Class: Sappy::Responses::SummaryStatistics

Inherits:
Sappy::Response show all
Defined in:
lib/sappy/responses/summary_statistics.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

#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

#success(hash) ⇒ Object



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

def success(hash)
  hash["summarystatistics"].first.each do |stat,value|
    instance_variable_set("@#{stat}", value.to_i)
  end
end