Class: HXL::HXLColSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/hxl/hxl_col_spec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_col_number, column = nil, fixed_column = nil, fixed_value = nil) ⇒ HXLColSpec

Column metadata for parsing a HXL CSV file

This class captures the way a column is encoded in the input CSV file, which might be different from the logical structure of the HXL data. Used only during parsing.



12
13
14
15
16
17
# File 'lib/hxl/hxl_col_spec.rb', line 12

def initialize(source_col_number, column = nil, fixed_column = nil, fixed_value = nil)
  @source_col_number = source_col_number
  @column = column
  @fixed_column = fixed_column
  @fixed_value = fixed_value
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



3
4
5
# File 'lib/hxl/hxl_col_spec.rb', line 3

def column
  @column
end

#fixed_columnObject (readonly)

Returns the value of attribute fixed_column.



3
4
5
# File 'lib/hxl/hxl_col_spec.rb', line 3

def fixed_column
  @fixed_column
end

#fixed_valueObject

Returns the value of attribute fixed_value.



4
5
6
# File 'lib/hxl/hxl_col_spec.rb', line 4

def fixed_value
  @fixed_value
end

#source_col_numberObject (readonly)

Returns the value of attribute source_col_number.



3
4
5
# File 'lib/hxl/hxl_col_spec.rb', line 3

def source_col_number
  @source_col_number
end