Module: RemoteResource::Querying::FinderMethods::ClassMethods
- Defined in:
- lib/remote_resource/querying/finder_methods.rb
Instance Method Summary collapse
- #all(connection_options = {}) ⇒ Object
- #find(id, connection_options = {}) ⇒ Object
- #find_by(params, connection_options = {}) ⇒ Object
- #where(params, connection_options = {}) ⇒ Object
Instance Method Details
#all(connection_options = {}) ⇒ Object
18 19 20 21 |
# File 'lib/remote_resource/querying/finder_methods.rb', line 18 def all( = {}) response = RemoteResource::Request.new(self, :get, {}, .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, = {}) response = RemoteResource::Request.new(self, :get, { id: id }, .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, = {}) response = RemoteResource::Request.new(self, :get, params, ).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, = {}) response = RemoteResource::Request.new(self, :get, params, .merge(collection: true)).perform build_collection_from_response(response) end |