Class: Sappy::Responses::AddMonitor
- Inherits:
-
Sappy::Response
- Object
- Sappy::Response
- Sappy::Responses::AddMonitor
- Defined in:
- lib/sappy/responses/add_monitor.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
Methods inherited from Sappy::Response
Constructor Details
This class inherits a constructor from Sappy::Response
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/sappy/responses/add_monitor.rb', line 4 def id @id end |
Instance Method Details
#failure(code, message) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/sappy/responses/add_monitor.rb', line 9 def failure(code, ) case code when "WRONG_DATA" raise ArgumentError, "You didn't provide the correct data: #{}" end end |
#success(hash) ⇒ Object
5 6 7 |
# File 'lib/sappy/responses/add_monitor.rb', line 5 def success(hash) @id = hash["monitor"].first["id"] end |