Class: INatGet::Data::Helper::Field::DatePart Private

Inherits:
Set show all
Defined in:
lib/inat-get/data/helpers/defs/datepart.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::Helper::Field

#helper, #key

Instance Method Summary collapse

Methods inherited from Set

#prepare, #valid?

Methods inherited from INatGet::Data::Helper::Field

#prepare, #to_sequel, #valid?

Constructor Details

#initialize(helper, key, drop = false) ⇒ DatePart

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 DatePart.



7
8
9
10
# File 'lib/inat-get/data/helpers/defs/datepart.rb', line 7

def initialize helper, key, drop = false
  super helper, key, Integer
  @drop = drop
end

Instance Method Details

#to_api(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.



12
13
14
15
# File 'lib/inat-get/data/helpers/defs/datepart.rb', line 12

def to_api value
  return {} if @drop
  { @key.to_s.gsub('observed_', '').to_sym => value }
end