Class: EacTemplates::VariableProviders::Hash
- Defined in:
- lib/eac_templates/variable_providers/hash.rb
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source) ⇒ Hash
constructor
A new instance of Hash.
- #variable_exist?(name) ⇒ Boolean
- #variable_fetch(name) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(source) ⇒ Hash
Returns a new instance of Hash.
14 15 16 |
# File 'lib/eac_templates/variable_providers/hash.rb', line 14 def initialize(source) super(source.with_indifferent_access) end |
Class Method Details
.accept?(variables_source) ⇒ Boolean
9 10 11 |
# File 'lib/eac_templates/variable_providers/hash.rb', line 9 def accept?(variables_source) variables_source.is_a?(::Hash) end |
Instance Method Details
#variable_exist?(name) ⇒ Boolean
18 19 20 |
# File 'lib/eac_templates/variable_providers/hash.rb', line 18 def variable_exist?(name) source.key?(name) end |
#variable_fetch(name) ⇒ Object
22 23 24 |
# File 'lib/eac_templates/variable_providers/hash.rb', line 22 def variable_fetch(name) source.fetch(name) end |