Class: Xlsx2Mysql::Column
- Inherits:
-
Object
- Object
- Xlsx2Mysql::Column
- Defined in:
- lib/xlsx2mysql/column.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#regexp ⇒ Object
Returns the value of attribute regexp.
Instance Method Summary collapse
- #+(other_column) ⇒ Object
-
#initialize(name, regexp = /(.*)/) ⇒ Column
constructor
A new instance of Column.
- #retrieve_value(row_index, ws) ⇒ Object
Constructor Details
#initialize(name, regexp = /(.*)/) ⇒ Column
Returns a new instance of Column.
5 6 7 8 |
# File 'lib/xlsx2mysql/column.rb', line 5 def initialize(name, regexp = /(.*)/) @name = name @regexp = regexp end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/xlsx2mysql/column.rb', line 3 def name @name end |
#regexp ⇒ Object
Returns the value of attribute regexp.
3 4 5 |
# File 'lib/xlsx2mysql/column.rb', line 3 def regexp @regexp end |
Instance Method Details
#+(other_column) ⇒ Object
10 11 12 |
# File 'lib/xlsx2mysql/column.rb', line 10 def + other_column Columns.new(self, other_column) end |
#retrieve_value(row_index, ws) ⇒ Object
14 15 16 17 18 |
# File 'lib/xlsx2mysql/column.rb', line 14 def retrieve_value row_index, ws index = name.to_s + row_index.to_s regexp.match(ws[index]) $1 end |