Class: TaxonReporter::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/taxon_reporter/field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/taxon_reporter/field.rb', line 7

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/taxon_reporter/field.rb', line 6

def name
  @name
end

#sourceObject (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