Class: Pedalog::Data
- Inherits:
-
Object
- Object
- Pedalog::Data
- Defined in:
- lib/pedalog.rb
Overview
A class to hold the data returned from a Pedalog device.
Instance Attribute Summary collapse
-
#avg_power ⇒ Object
Returns the value of attribute avg_power.
-
#current ⇒ Object
Returns the value of attribute current.
-
#energy ⇒ Object
Returns the value of attribute energy.
-
#max_power ⇒ Object
Returns the value of attribute max_power.
-
#power ⇒ Object
Returns the value of attribute power.
-
#time ⇒ Object
Returns the value of attribute time.
-
#voltage ⇒ Object
Returns the value of attribute voltage.
Instance Method Summary collapse
-
#readable_string ⇒ Object
Creates a string listing the data in an easily-readable format.
Instance Attribute Details
#avg_power ⇒ Object
Returns the value of attribute avg_power.
95 96 97 |
# File 'lib/pedalog.rb', line 95 def avg_power @avg_power end |
#current ⇒ Object
Returns the value of attribute current.
91 92 93 |
# File 'lib/pedalog.rb', line 91 def current @current end |
#energy ⇒ Object
Returns the value of attribute energy.
93 94 95 |
# File 'lib/pedalog.rb', line 93 def energy @energy end |
#max_power ⇒ Object
Returns the value of attribute max_power.
94 95 96 |
# File 'lib/pedalog.rb', line 94 def max_power @max_power end |
#power ⇒ Object
Returns the value of attribute power.
92 93 94 |
# File 'lib/pedalog.rb', line 92 def power @power end |
#time ⇒ Object
Returns the value of attribute time.
96 97 98 |
# File 'lib/pedalog.rb', line 96 def time @time end |
#voltage ⇒ Object
Returns the value of attribute voltage.
90 91 92 |
# File 'lib/pedalog.rb', line 90 def voltage @voltage end |
Instance Method Details
#readable_string ⇒ Object
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 |