Class: INatGet::Data::Helper::Field::Iconic Private
- Inherits:
-
Set
- Object
- INatGet::Data::Helper::Field
- Set
- INatGet::Data::Helper::Field::Iconic
- Defined in:
- lib/inat-get/data/helpers/defs/iconic.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
Instance Method Summary collapse
-
#initialize(helper, key) ⇒ Iconic
constructor
private
A new instance of Iconic.
- #to_sequel(value) ⇒ Object private
- #value_to_sequel(value) ⇒ Object private
Methods inherited from Set
Methods inherited from INatGet::Data::Helper::Field
Constructor Details
#initialize(helper, key) ⇒ Iconic
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 Iconic.
8 9 10 |
# File 'lib/inat-get/data/helpers/defs/iconic.rb', line 8 def initialize helper, key super helper, key, lambda { |v| v.is_a?(String) || v.is_a?(Enumerable) || v.is_a?(INatGet::Data::Enum::Iconic) } end |
Instance Method Details
#to_sequel(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 |
# File 'lib/inat-get/data/helpers/defs/iconic.rb', line 12 def to_sequel value { taxon_id: value_to_sequel(value) } end |
#value_to_sequel(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.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/inat-get/data/helpers/defs/iconic.rb', line 16 def value_to_sequel value case value when Enumerable value.map { |v| value_to_sequel(v) }.to_set when INatGet::Data::Enum::Iconic value.taxon_id when String INatGet::Data::Enum::Iconic::parse(value).taxon_id else value end end |