Class: MyTankInfo::TankRulesResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/my_tank_info/resources/tank_rules.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

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(tank_id:) ⇒ Object



5
6
7
8
# File 'lib/my_tank_info/resources/tank_rules.rb', line 5

def list(tank_id:)
  response = get_request("/api/tanks/#{tank_id}/rules")
  Collection.from_response(response, type: TankRule)
end

#update(tank_id:, attributes:) ⇒ Object



10
11
12
13
# File 'lib/my_tank_info/resources/tank_rules.rb', line 10

def update(tank_id:, attributes:)
  response = put_request("api/tanks/#{tank_id}/rules", body: attributes)
  Collection.from_response(response, type: TankRule)
end