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

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

Defined Under Namespace

Classes: Entity

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)



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/muddyit/collections/entities.rb', line 9

def find_related(uri, options = {})

  raise if uri.nil?
  api_url = "/collections/#{self.collection.attributes[:token]}/entities/#{Digest::MD5.hexdigest(uri)}/related"
  response = @muddyit.send_request(api_url, :get, options)

  results = []
  response.each { |result|
    results.push :count => result.delete('count'), :entity => Muddyit::Collections::Collection::Entities::Entity.new(@muddyit, result)
  }
  return results
end