Class: Marktable::Tables::Array
- Inherits:
-
Object
- Object
- Marktable::Tables::Array
- Defined in:
- lib/marktable/tables/array.rb
Instance Method Summary collapse
-
#initialize(array, headers) ⇒ Array
constructor
A new instance of Array.
- #parse ⇒ Object
Constructor Details
#initialize(array, headers) ⇒ Array
Returns a new instance of Array.
8 9 10 11 |
# File 'lib/marktable/tables/array.rb', line 8 def initialize(array, headers) @array = array @headers_flag = headers end |
Instance Method Details
#parse ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/marktable/tables/array.rb', line 13 def parse return Tables::Base.blank if @array.empty? # Determine if this is an array of hashes or array of arrays if @array.first.is_a?(Hash) parse_array_of_hashes else parse_array_of_arrays end end |