Module: Scrapable

Included in:
AirConditioner, UPS
Defined in:
lib/liebert/scrapable.rb

Instance Method Summary collapse

Instance Method Details

#allObject

Create a summary of all attributes and values in a format digestable by Ganglia



6
7
8
9
10
11
12
# File 'lib/liebert/scrapable.rb', line 6

def all
  self.class::ATTRS.inject(String.new) do |string, attr|
    get_webpage
    self.class::ATTRS.each { |attr| eval("scrape_#{attr}") }
    string << "#{attr.capitalize}\t#{eval("@#{attr}")}\n"
  end
end