Skip to content

Commit

Permalink
Remove outdated example
Browse files Browse the repository at this point in the history
  • Loading branch information
remi committed Apr 9, 2012
1 parent 55c59f0 commit 351d9d3
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/her/model/orm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ def initialize(single_data) # {{{
@data = self.class.parse_relationships(@data)
end # }}}

# Initialize a collection of resources with raw data from an HTTP request
#
# @example
# User.get("/users/popular") { |data| User.new_collection(data) }
def new_collection(parsed_data) # {{{
collection_data = parsed_data[:data]
Her::Model::ORM.initialize_collection(self.to_s.downcase.to_sym, collection_data)
end # }}}

# Initialize a collection of resources
# @private
def self.initialize_collection(name, collection_data) # {{{
Expand All @@ -40,6 +31,12 @@ def method_missing(method, attrs=nil) # {{{
end
end # }}}

# Initialize a collection of resources with raw data from an HTTP request
def new_collection(parsed_data) # {{{
collection_data = parsed_data[:data]
Her::Model::ORM.initialize_collection(self.to_s.downcase.to_sym, collection_data)
end # }}}

# Fetch a specific resource based on an ID
def find(id, params={}) # {{{
request(params.merge(:_method => :get, :_path => "#{@her_collection_path}/#{id}")) do |parsed_data|
Expand Down

0 comments on commit 351d9d3

Please sign in to comment.