Class: CSVMachine::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/csv-machine/field.rb

Constant Summary collapse

VALID_OPTIONS =

TODO: :convert

[ :column, :type ]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Field

Returns a new instance of Field.



10
11
12
# File 'lib/csv-machine/field.rb', line 10

def initialize(name, options={})
  @name, @options = name.to_sym, options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/csv-machine/field.rb', line 5

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/csv-machine/field.rb', line 6

def options
  @options
end

Instance Method Details

#columnObject



14
15
16
# File 'lib/csv-machine/field.rb', line 14

def column
  @options[:column]
end