Class: INatGet::Data::Parser::Part::Observed Private

Inherits:
Time show all
Defined in:
lib/inat-get/data/parsers/defs/observed.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from INatGet::Data::Parser::Part

#parser

Instance Method Summary collapse

Constructor Details

#initialize(parser) ⇒ Observed

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Observed.



7
8
9
# File 'lib/inat-get/data/parsers/defs/observed.rb', line 7

def initialize parser
  super parser, observed: :time_observed_at
end

Instance Method Details

#parse(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
14
15
# File 'lib/inat-get/data/parsers/defs/observed.rb', line 11

def parse value
  result = super value
  result[:observed] ||= ::Time::parse value[:observed_on]
  result
end