Class: INatGet::Data::Helper::Field::Taxon Private

Inherits:
Models show all
Defined in:
lib/inat-get/data/helpers/defs/taxon.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 Models

#to_api

Methods inherited from Set

#valid?

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

#to_api, #valid?

Constructor Details

#initialize(helper, key) ⇒ Taxon

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



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

def initialize helper, key
  super helper, key, INatGet::Data::Model::Taxon
end

Instance Method Details

#prepare(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
# File 'lib/inat-get/data/helpers/defs/taxon.rb', line 11

def prepare value
  INatGet::Data::Model::Taxon::compact_set(*super(value))
end

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



15
16
17
18
# File 'lib/inat-get/data/helpers/defs/taxon.rb', line 15

def to_sequel value
  value = [ value ] unless value.is_a?(Enumerable)
  Sequel.|( *value.map { |v| { taxon: v.descendants_dataset } } )
end