Class: MoreCoreExtensions::ArrayTableize::Tableizer
- Inherits:
-
Object
- Object
- MoreCoreExtensions::ArrayTableize::Tableizer
- Defined in:
- lib/more_core_extensions/core_ext/array/tableize.rb
Overview
This class is a private implementation and not part of the public API.
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(target, options) ⇒ Tableizer
constructor
A new instance of Tableizer.
- #tableize ⇒ Object
Constructor Details
#initialize(target, options) ⇒ Tableizer
Returns a new instance of Tableizer.
41 42 43 44 |
# File 'lib/more_core_extensions/core_ext/array/tableize.rb', line 41 def initialize(target, ) @target = target @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
39 40 41 |
# File 'lib/more_core_extensions/core_ext/array/tableize.rb', line 39 def @options end |
#target ⇒ Object
Returns the value of attribute target.
39 40 41 |
# File 'lib/more_core_extensions/core_ext/array/tableize.rb', line 39 def target @target end |
Instance Method Details
#tableize ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/more_core_extensions/core_ext/array/tableize.rb', line 46 def tableize case target.first when Array then tableize_arrays when Hash then tableize_hashes else raise "must be an Array of Arrays or Array of Hashes" end end |