Class: Dina::Determination

Inherits:
Object
  • Object
show all
Defined in:
lib/dina/components/determination.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDetermination

Returns a new instance of Determination.



24
25
26
27
# File 'lib/dina/components/determination.rb', line 24

def initialize
  @scientificNameDetails = {}
  @determiner = []
end

Instance Attribute Details

#classificationObject

Returns the value of attribute classification.



21
22
23
# File 'lib/dina/components/determination.rb', line 21

def classification
  @classification
end

#determinationRemarksObject

Returns the value of attribute determinationRemarks.



9
10
11
# File 'lib/dina/components/determination.rb', line 9

def determinationRemarks
  @determinationRemarks
end

#determinedOnObject

Returns the value of attribute determinedOn.



13
14
15
# File 'lib/dina/components/determination.rb', line 13

def determinedOn
  @determinedOn
end

#determinerObject

An array of known UUIDs for Person



12
13
14
# File 'lib/dina/components/determination.rb', line 12

def determiner
  @determiner
end

#isFiledAsObject

boolean



18
19
20
# File 'lib/dina/components/determination.rb', line 18

def isFiledAs
  @isFiledAs
end

#isPrimaryObject

boolean



17
18
19
# File 'lib/dina/components/determination.rb', line 17

def isPrimary
  @isPrimary
end

#managedAttributesObject

array



19
20
21
# File 'lib/dina/components/determination.rb', line 19

def managedAttributes
  @managedAttributes
end

#qualifierObject

Returns the value of attribute qualifier.



14
15
16
# File 'lib/dina/components/determination.rb', line 14

def qualifier
  @qualifier
end

#ranksObject

Returns the value of attribute ranks.



22
23
24
# File 'lib/dina/components/determination.rb', line 22

def ranks
  @ranks
end

#scientificNameObject

Returns the value of attribute scientificName.



6
7
8
# File 'lib/dina/components/determination.rb', line 6

def scientificName
  @scientificName
end

#scientificNameDetailsObject

in the form { classificationPath: “”, classificationRanks: “” }



16
17
18
# File 'lib/dina/components/determination.rb', line 16

def scientificNameDetails
  @scientificNameDetails
end

#scientificNameSourceObject

Returns the value of attribute scientificNameSource.



15
16
17
# File 'lib/dina/components/determination.rb', line 15

def scientificNameSource
  @scientificNameSource
end

#transcriberRemarksObject

Returns the value of attribute transcriberRemarks.



7
8
9
# File 'lib/dina/components/determination.rb', line 7

def transcriberRemarks
  @transcriberRemarks
end

#typeStatusObject

Returns the value of attribute typeStatus.



10
11
12
# File 'lib/dina/components/determination.rb', line 10

def typeStatus
  @typeStatus
end

#typeStatusEvidenceObject

Returns the value of attribute typeStatusEvidence.



11
12
13
# File 'lib/dina/components/determination.rb', line 11

def typeStatusEvidence
  @typeStatusEvidence
end

#verbatimDateObject

Returns the value of attribute verbatimDate.



5
6
7
# File 'lib/dina/components/determination.rb', line 5

def verbatimDate
  @verbatimDate
end

#verbatimDeterminerObject

Returns the value of attribute verbatimDeterminer.



4
5
6
# File 'lib/dina/components/determination.rb', line 4

def verbatimDeterminer
  @verbatimDeterminer
end

#verbatimRemarksObject

Returns the value of attribute verbatimRemarks.



8
9
10
# File 'lib/dina/components/determination.rb', line 8

def verbatimRemarks
  @verbatimRemarks
end

#verbatimScientificNameObject

Returns the value of attribute verbatimScientificName.



3
4
5
# File 'lib/dina/components/determination.rb', line 3

def verbatimScientificName
  @verbatimScientificName
end

Instance Method Details

#add_determiner(id:) ⇒ Object

Add a determiner as UUID to the array of determiner

Parameters:

  • id (String)

    a UUID for a determiner

Raises:



56
57
58
59
# File 'lib/dina/components/determination.rb', line 56

def add_determiner(id:)
  raise PropertyValueInvalid, "Determiner must be a UUID." if !id.is_uuid?
  @determiner << id
end

#to_hashObject

Produce a hash with symbolized keys



62
63
64
65
66
67
68
# File 'lib/dina/components/determination.rb', line 62

def to_hash
  hash = {}
  remove_instance_variable(:@classification) if @classification
  remove_instance_variable(:@ranks) if @ranks
  instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
  hash.deep_symbolize_keys
end