Class: InCSV::ColumnType

Inherits:
Object
  • Object
show all
Defined in:
lib/incsv/column_type.rb

Direct Known Subclasses

Types::Currency, Types::Date, Types::String

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ColumnType

Returns a new instance of ColumnType.



11
12
13
# File 'lib/incsv/column_type.rb', line 11

def initialize(value)
  @value = value
end

Class Method Details

.clean_value(value) ⇒ Object



23
24
25
# File 'lib/incsv/column_type.rb', line 23

def self.clean_value(value)
  value
end

.for_databaseObject



7
8
9
# File 'lib/incsv/column_type.rb', line 7

def self.for_database
  self.to_s.sub(/.*::/, "").downcase.to_sym
end

.nameObject



3
4
5
# File 'lib/incsv/column_type.rb', line 3

def self.name
  self.to_s.sub(/.*::/, "").downcase.to_sym
end

Instance Method Details

#clean_valueObject



19
20
21
# File 'lib/incsv/column_type.rb', line 19

def clean_value
  self.class.clean_value(@value)
end

#match?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/incsv/column_type.rb', line 15

def match?
  false
end