Class: Message
- Inherits:
-
Object
- Object
- Message
- Defined in:
- lib/fitreader/message.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#global_num ⇒ Object
Returns the value of attribute global_num.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(definitions) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(definitions) ⇒ Message
Returns a new instance of Message.
4 5 6 7 8 9 10 11 |
# File 'lib/fitreader/message.rb', line 4 def initialize(definitions) @global_num = definitions[0] @name = Sdk.(@global_num) return unless @name fd = Sdk.fields(@global_num) @data = definitions[1].map { |x| (x, fd) }.flatten end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
2 3 4 |
# File 'lib/fitreader/message.rb', line 2 def data @data end |
#global_num ⇒ Object
Returns the value of attribute global_num.
2 3 4 |
# File 'lib/fitreader/message.rb', line 2 def global_num @global_num end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/fitreader/message.rb', line 2 def name @name end |