Class: Pedalog::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/pedalog.rb

Overview

A class to hold the data returned from a Pedalog device.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#avg_powerObject

Returns the value of attribute avg_power.



95
96
97
# File 'lib/pedalog.rb', line 95

def avg_power
  @avg_power
end

#currentObject

Returns the value of attribute current.



91
92
93
# File 'lib/pedalog.rb', line 91

def current
  @current
end

#energyObject

Returns the value of attribute energy.



93
94
95
# File 'lib/pedalog.rb', line 93

def energy
  @energy
end

#max_powerObject

Returns the value of attribute max_power.



94
95
96
# File 'lib/pedalog.rb', line 94

def max_power
  @max_power
end

#powerObject

Returns the value of attribute power.



92
93
94
# File 'lib/pedalog.rb', line 92

def power
  @power
end

#timeObject

Returns the value of attribute time.



96
97
98
# File 'lib/pedalog.rb', line 96

def time
  @time
end

#voltageObject

Returns the value of attribute voltage.



90
91
92
# File 'lib/pedalog.rb', line 90

def voltage
  @voltage
end

Instance Method Details

#readable_stringObject

Creates a string listing the data in an easily-readable format.



99
100
101
# File 'lib/pedalog.rb', line 99

def readable_string
  "voltage: %f, current: %f, power: %f, energy: %f, max_power: %f, avg_power: %f, time: %d\n" % [ voltage, current, power, energy, max_power, avg_power, time ]
end