Class: TaxonReporter::Field
- Inherits:
-
Object
- Object
- TaxonReporter::Field
- Defined in:
- lib/taxon_reporter/field.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source, name) ⇒ Field
constructor
A new instance of Field.
- #merge_values(current, new_values) ⇒ Object
Constructor Details
#initialize(source, name) ⇒ Field
Returns a new instance of Field.
9 10 11 12 13 |
# File 'lib/taxon_reporter/field.rb', line 9 def initialize(source, name) @source = source @name = name @id = "#{source}:#{name}" end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/taxon_reporter/field.rb', line 7 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/taxon_reporter/field.rb', line 6 def name @name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
5 6 7 |
# File 'lib/taxon_reporter/field.rb', line 5 def source @source end |
Instance Method Details
#merge_values(current, new_values) ⇒ Object
15 16 17 18 19 |
# File 'lib/taxon_reporter/field.rb', line 15 def merge_values(current, new_values) result = current result = Set.new unless result result.merge(new_values) end |