Class: Sappy::Responses::AccountInfo

Inherits:
Sappy::Response show all
Defined in:
lib/sappy/responses/account_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Sappy::Response

#failure, #initialize, parse, #parse

Constructor Details

This class inherits a constructor from Sappy::Response

Instance Attribute Details

#available_monitorsObject (readonly)

Returns the value of attribute available_monitors.



4
5
6
# File 'lib/sappy/responses/account_info.rb', line 4

def available_monitors
  @available_monitors
end

#setup_monitorsObject (readonly)

Returns the value of attribute setup_monitors.



4
5
6
# File 'lib/sappy/responses/account_info.rb', line 4

def setup_monitors
  @setup_monitors
end

#sms_alertsObject (readonly)

Returns the value of attribute sms_alerts.



4
5
6
# File 'lib/sappy/responses/account_info.rb', line 4

def sms_alerts
  @sms_alerts
end

Instance Method Details

#success(hash) ⇒ Object



6
7
8
9
10
11
# File 'lib/sappy/responses/account_info.rb', line 6

def success(hash)
  accountinfo = hash["accountinfo"].first
  @available_monitors = accountinfo["availablemonitors"].to_i
  @setup_monitors = accountinfo["setupmonitors"].to_i
  @sms_alerts = accountinfo["smsalerts"].to_i
end