Class: Fitreader::FieldData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, raw_value, type) ⇒ FieldData

Returns a new instance of FieldData.



5
6
7
8
9
10
11
12
13
# File 'lib/fitreader/field_data.rb', line 5

def initialize(id, raw_value, type)
  @id = id
  @raw_value = raw_value
  unless type.nil?
    process_type(raw_value, type)
  else
    puts "nil type #{id} - #{raw_value}"
  end
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/fitreader/field_data.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/fitreader/field_data.rb', line 3

def name
  @name
end

#raw_valueObject

Returns the value of attribute raw_value.



3
4
5
# File 'lib/fitreader/field_data.rb', line 3

def raw_value
  @raw_value
end

#validObject

Returns the value of attribute valid.



3
4
5
# File 'lib/fitreader/field_data.rb', line 3

def valid
  @valid
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/fitreader/field_data.rb', line 3

def value
  @value
end