class MyTankInfo::AlarmHistoryResource
Public Instance Methods
list(site_id: nil, **params)
click to toggle source
# File lib/my_tank_info/resources/alarm_history.rb, line 5 def list(site_id: nil, **params) response = if site_id.nil? get_request("api/alarmhistory", params: params) else get_request("api/sites/#{site_id}/alarmhistory", params: params) end Collection.from_response(response, type: Alarm) end
list_notes(alarm_id:)
click to toggle source
# File lib/my_tank_info/resources/alarm_history.rb, line 16 def list_notes(alarm_id:) response = get_request("api/alarmhistory/#{alarm_id}/notes") Collection.from_response(response, type: AlarmNote) end
retrieve(alarm_id:)
click to toggle source
# File lib/my_tank_info/resources/alarm_history.rb, line 21 def retrieve(alarm_id:) Alarm.new get_request("api/alarmhistory/#{alarm_id}").body end