Class: Muddyit::Collections::Collection::Entities::Entity

Inherits:
Generic
  • Object
show all
Defined in:
lib/muddyit/collections/entities/entity.rb

Instance Attribute Summary

Attributes inherited from Generic

#attributes

Attributes inherited from Base

#access_token, #access_token_secret, #auth_type, #consumer_key, #consumer_secret, #password, #rest_endpoint, #username

Instance Method Summary collapse

Methods inherited from Generic

#initialize, #method_missing

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

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 related(options = {})
  api_url = "/collections/#{self.collection.attributes[:token]}/entities/#{Digest::MD5.hexdigest(@attributes[:uri])}/related"
  response = @muddyit.send_request(api_url, :get, options)

  results = []
  response.each { |result|
    # The return format needs sorting out here .......
    results.push Muddyit::Collections::Collection::Entities::Entity.new(@muddyit, result)
  }
  return results
end