Class: ForestLiana::ResourceGetter
- Inherits:
-
BaseGetter
- Object
- BaseGetter
- ForestLiana::ResourceGetter
- Defined in:
- app/services/forest_liana/resource_getter.rb
Instance Attribute Summary collapse
-
#record ⇒ Object
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(resource, params) ⇒ ResourceGetter
constructor
A new instance of ResourceGetter.
- #perform ⇒ Object
Methods inherited from BaseGetter
#get_collection, #get_resource, #includes_for_serialization
Constructor Details
#initialize(resource, params) ⇒ ResourceGetter
Returns a new instance of ResourceGetter.
5 6 7 8 9 10 11 |
# File 'app/services/forest_liana/resource_getter.rb', line 5 def initialize(resource, params) @resource = resource @params = params @collection_name = ForestLiana.name_for(@resource) @collection = get_collection(@collection_name) compute_includes() end |
Instance Attribute Details
#record ⇒ Object
Returns the value of attribute record.
3 4 5 |
# File 'app/services/forest_liana/resource_getter.rb', line 3 def record @record end |
Instance Method Details
#perform ⇒ Object
13 14 15 |
# File 'app/services/forest_liana/resource_getter.rb', line 13 def perform @record = get_resource().eager_load(@includes).find(@params[:id]) end |