Class: MyJohnDeereApi::Request::Collection::AssetLocations
- Defined in:
- lib/my_john_deere_api/request/collection/asset_locations.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create(attributes) ⇒ Object
Create a new asset location.
-
#model ⇒ Object
This is the class used to model the data.
-
#resource ⇒ Object
The resource path for the first page in the collection.
Methods inherited from Base
#accessor, #all, #count, #each, #initialize
Constructor Details
This class inherits a constructor from MyJohnDeereApi::Request::Collection::Base
Instance Method Details
#create(attributes) ⇒ Object
Create a new asset location
22 23 24 25 |
# File 'lib/my_john_deere_api/request/collection/asset_locations.rb', line 22 def create(attributes) merged_attributes = attributes.merge(asset_id: associations[:asset]) Create::AssetLocation.new(client, merged_attributes).object end |
#model ⇒ Object
This is the class used to model the data
15 16 17 |
# File 'lib/my_john_deere_api/request/collection/asset_locations.rb', line 15 def model MyJohnDeereApi::Model::AssetLocation end |
#resource ⇒ Object
The resource path for the first page in the collection
8 9 10 |
# File 'lib/my_john_deere_api/request/collection/asset_locations.rb', line 8 def resource "/assets/#{associations[:asset]}/locations" end |