Module: Joule::Hashable

Included in:
DataPoint, Marker, PeakPower
Defined in:
lib/joule/hashable.rb

Instance Method Summary collapse

Instance Method Details

#to_hashObject



3
4
5
6
7
# File 'lib/joule/hashable.rb', line 3

def to_hash
  hash = Hash.new
  instance_variables.each { |v| hash[ v[1..-1].to_sym ] = instance_variable_get v  }
  hash
end