Module: FulfilApi::Relation::Naming
- Extended by:
- ActiveSupport::Concern
- Included in:
- FulfilApi::Relation
- Defined in:
- lib/fulfil_api/relation/naming.rb
Overview
The Naming extends the relation by
adding methods to it that allow us to identify the type of resource that
is being requested.
Instance Method Summary collapse
-
#set(model_name:) ⇒ FulfilApi::Relation
Sets the name of the resource model to be queried.
Instance Method Details
#set(model_name:) ⇒ FulfilApi::Relation
TODO:
In the future, derive the #name from the @resource_klass automatically.
Sets the name of the resource model to be queried.
17 18 19 20 21 |
# File 'lib/fulfil_api/relation/naming.rb', line 17 def set(model_name:) clone.tap do |relation| relation.model_name = model_name end end |