Class: InstantApi::Model::Resource
- Inherits:
-
Object
- Object
- InstantApi::Model::Resource
- Defined in:
- lib/instant_api/model/resource.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#query_builder ⇒ Object
readonly
Returns the value of attribute query_builder.
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(klass, params) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(klass, params) ⇒ Resource
Returns a new instance of Resource.
5 6 7 8 |
# File 'lib/instant_api/model/resource.rb', line 5 def initialize(klass, params) @params = params @query_builder = InstantApi::Model::ActiveRecordQueryBuilder.new(klass) end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/instant_api/model/resource.rb', line 3 def params @params end |
#query_builder ⇒ Object (readonly)
Returns the value of attribute query_builder.
3 4 5 |
# File 'lib/instant_api/model/resource.rb', line 3 def query_builder @query_builder end |
Instance Method Details
#find ⇒ Object
10 11 12 |
# File 'lib/instant_api/model/resource.rb', line 10 def find query_builder.find_first(params) end |