Class: Muddyit::Collections::Collection::Entities
- Defined in:
- lib/muddyit/collections/entities.rb
Defined Under Namespace
Classes: Entity
Instance Attribute Summary
Attributes inherited from Generic
Attributes inherited from Base
#access_token, #access_token_secret, #auth_type, #consumer_key, #consumer_secret, #password, #rest_endpoint, #username
Instance Method Summary collapse
-
#find_related(uri, options = {}) ⇒ Object
retrieve entities related to the specified entity within the collection entities collection.
Methods inherited from Generic
Methods inherited from Base
#collections, #extract, #initialize, #send_request
Constructor Details
This class inherits a constructor from Muddyit::Generic
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Muddyit::Generic
Instance Method Details
#find_related(uri, options = {}) ⇒ Object
retrieve entities related to the specified entity within the collection entities collection
Params
-
options (Optional)
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/muddyit/collections/entities.rb', line 9 def (uri, = {}) raise if uri.nil? api_url = "/collections/#{self.collection.attributes[:token]}/entities/#{Digest::MD5.hexdigest(uri)}/related" response = @muddyit.send_request(api_url, :get, ) results = [] response.each { |result| results.push :count => result.delete('count'), :entity => Muddyit::Collections::Collection::Entities::Entity.new(@muddyit, result) } return results end |