Class: Xlsx2Mysql::Columns
- Inherits:
-
Object
- Object
- Xlsx2Mysql::Columns
- Defined in:
- lib/xlsx2mysql/column.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
Instance Method Summary collapse
- #+(x) ⇒ Object
-
#initialize(*args) ⇒ Columns
constructor
A new instance of Columns.
- #retrieve_value(row_index, ws) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Columns
Returns a new instance of Columns.
24 25 26 |
# File 'lib/xlsx2mysql/column.rb', line 24 def initialize *args @columns = args end |
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
22 23 24 |
# File 'lib/xlsx2mysql/column.rb', line 22 def columns @columns end |
Instance Method Details
#+(x) ⇒ Object
28 29 30 31 |
# File 'lib/xlsx2mysql/column.rb', line 28 def + x columns << x self end |
#retrieve_value(row_index, ws) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/xlsx2mysql/column.rb', line 33 def retrieve_value row_index, ws res_array = [] columns.each do |x| if x.is_a?(Column) res_array << x.retrieve_value(row_index, ws) elsif x.is_a?(String) res_array << x else end end res_array.join end |