Class: MyTankInfo::TanksResource
- Defined in:
- lib/my_tank_info/resources/tanks.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
Methods inherited from Resource
#delete_request, #get_request, #initialize, #patch_request, #post_request, #put_request
Constructor Details
This class inherits a constructor from MyTankInfo::Resource
Instance Method Details
#list(site_id: nil) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/my_tank_info/resources/tanks.rb', line 5 def list(site_id: nil) response = get_request("api/tanks") if site_id.nil? Collection.from_response(response, type: Tank) else Collection.from_response( response, type: Tank, filter_attribute: :site_id, filter_value: site_id ) end end |