Class: TableSaw::VariableInterpolation
- Inherits:
-
Object
- Object
- TableSaw::VariableInterpolation
- Defined in:
- lib/table_saw/variable_interpolation.rb
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(input) ⇒ VariableInterpolation
constructor
A new instance of VariableInterpolation.
Constructor Details
#initialize(input) ⇒ VariableInterpolation
Returns a new instance of VariableInterpolation.
11 12 13 |
# File 'lib/table_saw/variable_interpolation.rb', line 11 def initialize(input) @input = input end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
9 10 11 |
# File 'lib/table_saw/variable_interpolation.rb', line 9 def input @input end |
Class Method Details
.call(variables) ⇒ Object
5 6 7 |
# File 'lib/table_saw/variable_interpolation.rb', line 5 def self.call(variables) new(variables).call end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/table_saw/variable_interpolation.rb', line 15 def call input.transform_values do |value| next value unless value.is_a?(String) interpolate_variables(value, input) end end |