Class: Sappy::Responses::SummaryStatistics

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

Instance Attribute Summary collapse

Attributes inherited from Sappy::Response

#data, #xml

Instance Method Summary collapse

Methods inherited from Sappy::Response

#error_response, #error_response?, #failure, #first_xpath, #initialize, parse, #parse

Constructor Details

This class inherits a constructor from Sappy::Response

Instance Attribute Details

#downObject (readonly)

Returns the value of attribute down.



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

def down
  @down
end

#inactiveObject (readonly)

Returns the value of attribute inactive.



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

def inactive
  @inactive
end

#upObject (readonly)

Returns the value of attribute up.



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

def up
  @up
end

Instance Method Details

#successObject



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

def success
  node      = first_xpath('//summarystatistics')
  @up       = node['up'].to_i
  @down     = node['down'].to_i
  @inactive = node['inactive'].to_i
end