Class: Cascade::ColumnsMatching
- Inherits:
-
Object
- Object
- Cascade::ColumnsMatching
- Extended by:
- Forwardable
- Defined in:
- lib/cascade/columns_matching.rb
Constant Summary collapse
- ROOT_KEY =
'mapping'
Instance Method Summary collapse
-
#column_type(key) ⇒ Symbol
Presenter for passed key.
-
#initialize(options = {}) ⇒ ColumnsMatching
constructor
A new instance of ColumnsMatching.
-
#supported_keys ⇒ Array
Defines set of possible keys that can be used for iterating through the parsed line.
Constructor Details
#initialize(options = {}) ⇒ ColumnsMatching
Returns a new instance of ColumnsMatching.
15 16 17 18 19 |
# File 'lib/cascade/columns_matching.rb', line 15 def initialize( = {}) @content = .fetch(:content) do parse_content_file(.fetch(:filepath)) end end |
Instance Method Details
#column_type(key) ⇒ Symbol
Presenter for passed key
32 33 34 |
# File 'lib/cascade/columns_matching.rb', line 32 def column_type(key) @content[key].to_sym end |
#supported_keys ⇒ Array
Defines set of possible keys that can be used for iterating through the parsed line
25 26 27 |
# File 'lib/cascade/columns_matching.rb', line 25 def supported_keys @supported_keys ||= @content.keys end |