Class: DwCAContentAnalyzer::Column
- Inherits:
-
Object
- Object
- DwCAContentAnalyzer::Column
- Defined in:
- lib/dwca_content_analyzer/column.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(index, contents, *detectors) ⇒ Column
constructor
A new instance of Column.
Constructor Details
#initialize(index, contents, *detectors) ⇒ Column
Returns a new instance of Column.
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
#index ⇒ Object (readonly)
Returns the value of attribute index.
7 8 9 |
# File 'lib/dwca_content_analyzer/column.rb', line 7 def index @index end |
#length ⇒ Object
Returns the value of attribute length.
7 8 9 |
# File 'lib/dwca_content_analyzer/column.rb', line 7 def length @length end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/dwca_content_analyzer/column.rb', line 7 def type @type end |