Module: Gps::Nmea::HasDatetime

Included in:
Rmc
Defined in:
lib/gps/nmea/has_datetime.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#date_strObject

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

#datetimeObject

Returns the value of attribute datetime.



6
7
8
# File 'lib/gps/nmea/has_datetime.rb', line 6

def datetime
  @datetime
end

#time_strObject

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_datetimeObject



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