Class: DwCAContentAnalyzer::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/dwca_content_analyzer/column.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index, contents, *detectors) ⇒ Column

Returns a new instance of Column.

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
16
17
18
# File 'lib/dwca_content_analyzer/column.rb', line 9

def initialize(index, contents, *detectors)
  raise ArgumentError unless index.is_a? Integer
  detectors = [] if detectors.include? :none
  detectors = %i[type= length=] if detectors.include? :all
  detectors.map! { |d| (d.id2name + '=').to_sym }
  @index = index
  @type = nil
  @length = nil
  analyze(contents, detectors)
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



7
8
9
# File 'lib/dwca_content_analyzer/column.rb', line 7

def index
  @index
end

#lengthObject

Returns the value of attribute length.



7
8
9
# File 'lib/dwca_content_analyzer/column.rb', line 7

def length
  @length
end

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/dwca_content_analyzer/column.rb', line 7

def type
  @type
end