Module: RemoteResource::Querying::FinderMethods::ClassMethods

Defined in:
lib/remote_resource/querying/finder_methods.rb

Instance Method Summary collapse

Instance Method Details

#all(connection_options = {}) ⇒ Object



18
19
20
21
# File 'lib/remote_resource/querying/finder_methods.rb', line 18

def all(connection_options = {})
  response = RemoteResource::Request.new(self, :get, {}, connection_options.merge(collection: true)).perform
  build_collection_from_response(response)
end

#find(id, connection_options = {}) ⇒ Object



8
9
10
11
# File 'lib/remote_resource/querying/finder_methods.rb', line 8

def find(id, connection_options = {})
  response = RemoteResource::Request.new(self, :get, { id: id }, connection_options.merge(no_attributes: true)).perform
  build_resource_from_response(response)
end

#find_by(params, connection_options = {}) ⇒ Object



13
14
15
16
# File 'lib/remote_resource/querying/finder_methods.rb', line 13

def find_by(params, connection_options = {})
  response = RemoteResource::Request.new(self, :get, params, connection_options).perform
  build_resource_from_response(response)
end

#where(params, connection_options = {}) ⇒ Object



23
24
25
26
# File 'lib/remote_resource/querying/finder_methods.rb', line 23

def where(params, connection_options = {})
  response = RemoteResource::Request.new(self, :get, params, connection_options.merge(collection: true)).perform
  build_collection_from_response(response)
end