Class: Tyt::RunDetail
- Inherits:
-
Hashie::Dash
- Object
- Hashie::Dash
- Tyt::RunDetail
- Defined in:
- lib/tyt/run_detail.rb
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ RunDetail
constructor
A new instance of RunDetail.
- #string_to_i(str) ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ RunDetail
Returns a new instance of RunDetail.
8 9 10 11 12 |
# File 'lib/tyt/run_detail.rb', line 8 def initialize(hash = {}) hash[:vertical_feet] = string_to_i(hash[:vertical_feet]) hash[:vertical_meters] = string_to_i(hash[:vertical_meters]) super end |
Instance Method Details
#string_to_i(str) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/tyt/run_detail.rb', line 14 def string_to_i(str) if str str = str.gsub(',','') return str.to_i else return nil end end |