Class: EacTemplates::Variables::Providers::Base
- Defined in:
- lib/eac_templates/variables/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.
11 12 13 |
# File 'lib/eac_templates/variables/providers/base.rb', line 11 def initialize(source) @source = source end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
9 10 11 |
# File 'lib/eac_templates/variables/providers/base.rb', line 9 def source @source end |
Instance Method Details
#variable_value(name) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/eac_templates/variables/providers/base.rb', line 15 def variable_value(name) return variable_fetch(name) if variable_exist?(name) raise ::EacTemplates::Variables::NotFoundError, "Variable \"#{name}\" not found in #{source}" end |