class CSVModel::Column

Attributes

name[R]

Public Class Methods

new(name, options = {}) click to toggle source
# File lib/csv_model/column.rb, line 9
def initialize(name, options = {})
  @name = name
  @options = options
end

Public Instance Methods

is_primary_key?() click to toggle source
# File lib/csv_model/column.rb, line 14
def is_primary_key?
  option(:primary_key, false)
end
key() click to toggle source
# File lib/csv_model/column.rb, line 18
def key
  name.to_column_key
end
model_attribute() click to toggle source
# File lib/csv_model/column.rb, line 22
def model_attribute
  key.underscore.to_sym
end