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

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

Direct Known Subclasses

Ids, Location, Range, Scalar, Set

Defined Under Namespace

Classes: Accuracy, Coordinate, DatePart, Has, Iconic, Identified, Ids, Licensed, Licenses, Location, Models, Period, Place, Project, Range, Rank, Scalar, ScalarCoord, ScalarLocation, ScalarModel, Set, Taxon, Verifiable

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(helper, key) ⇒ Field

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



19
20
21
22
# File 'lib/inat-get/data/helpers/defs.rb', line 19

def initialize helper, key
  @helper = helper
  @key = key
end

Instance Attribute Details

#helperINatGet::Data::Helper (readonly)

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.



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

def helper
  @helper
end

#keySymbol (readonly)

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:

  • (Symbol)


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

def key
  @key
end

Instance Method Details

#prepare(value) ⇒ Hash, 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.

Returns:

  • (Hash, Object)


30
31
32
# File 'lib/inat-get/data/helpers/defs.rb', line 30

def prepare value
  value
end

#to_api(value) ⇒ Hash, 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.

Returns:

  • (Hash, Object)


35
36
37
# File 'lib/inat-get/data/helpers/defs.rb', line 35

def to_api value
  value
end

#to_sequel(value) ⇒ Sequel::SQL::Expression

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:

  • (Sequel::SQL::Expression)


40
41
42
# File 'lib/inat-get/data/helpers/defs.rb', line 40

def to_sequel value
  { @key => value }
end

#valid?(value) ⇒ Boolean

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:

  • (Boolean)

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/inat-get/data/helpers/defs.rb', line 25

def valid? value
  raise NotImplementedError, "Not implemented method 'valid?' for abstract class", caller_locations
end