Class: Muddyit::Collections::Collection::Entities::Entity
- Defined in:
- lib/muddyit/collections/entities/entity.rb
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
-
#related(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
#related(options = {}) ⇒ Object
retrieve entities related to the specified entity within the collection entities collection
Params
-
options (Optional)
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/muddyit/collections/entities/entity.rb', line 16 def ( = {}) api_url = "/collections/#{self.collection.attributes[:token]}/entities/#{Digest::MD5.hexdigest(@attributes[:uri])}/related" response = @muddyit.send_request(api_url, :get, ) results = [] response.each { |result| # The return format needs sorting out here ....... results.push Muddyit::Collections::Collection::Entities::Entity.new(@muddyit, result) } return results end |