Class: It::Interpolation
- Inherits:
-
Object
- Object
- It::Interpolation
- Defined in:
- lib/it/interpolation.rb
Overview
Contains one interpolation and will delegate the work to the It::Tag (or subclass) or ERB::Util.h
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key, value, label) ⇒ Interpolation
constructor
A new instance of Interpolation.
- #process ⇒ Object
Constructor Details
#initialize(key, value, label) ⇒ Interpolation
Returns a new instance of Interpolation.
24 25 26 27 28 |
# File 'lib/it/interpolation.rb', line 24 def initialize(key, value, label) @key = key @value = value @label = label end |
Class Method Details
.call(string, values) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/it/interpolation.rb', line 6 def call(string, values) key, label = extract_key_and_label_from(string) value = values[key] raise KeyError, "key{#{key}} not found" unless values.key?(key) new(key, value, label).process end |