Class: EacTemplates::VariableProviders::Base
- Defined in:
- lib/eac_templates/variable_providers/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source) ⇒ Base
constructor
A new instance of Base.
- #variable_value(name) ⇒ Object
Constructor Details
#initialize(source) ⇒ Base
Returns a new instance of Base.
10 11 12 |
# File 'lib/eac_templates/variable_providers/base.rb', line 10 def initialize(source) @source = source end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
8 9 10 |
# File 'lib/eac_templates/variable_providers/base.rb', line 8 def source @source end |
Instance Method Details
#variable_value(name) ⇒ Object
14 15 16 17 18 |
# File 'lib/eac_templates/variable_providers/base.rb', line 14 def variable_value(name) return variable_fetch(name) if variable_exist?(name) raise VariableNotFoundError, "Variable \"#{name}\" not found in #{source}" end |