Module: Gps::Nmea::HasDatetime
- Included in:
- Rmc
- Defined in:
- lib/gps/nmea/has_datetime.rb
Instance Attribute Summary collapse
-
#date_str ⇒ Object
Returns the value of attribute date_str.
-
#datetime ⇒ Object
Returns the value of attribute datetime.
-
#time_str ⇒ Object
Returns the value of attribute time_str.
Instance Method Summary collapse
Instance Attribute Details
#date_str ⇒ Object
Returns the value of attribute date_str.
6 7 8 |
# File 'lib/gps/nmea/has_datetime.rb', line 6 def date_str @date_str end |
#datetime ⇒ Object
Returns the value of attribute datetime.
6 7 8 |
# File 'lib/gps/nmea/has_datetime.rb', line 6 def datetime @datetime end |
#time_str ⇒ Object
Returns the value of attribute time_str.
6 7 8 |
# File 'lib/gps/nmea/has_datetime.rb', line 6 def time_str @time_str end |
Instance Method Details
#update_datetime ⇒ Object
8 9 10 11 12 |
# File 'lib/gps/nmea/has_datetime.rb', line 8 def update_datetime if @date_str && @time_str @datetime = DateTime.iso8601 "#{@date_str}T#{@time_str}Z" end end |