Class: EacRubyUtils::Templates::VariableProviders::Hash

Inherits:
Base
  • Object
show all
Defined in:
lib/eac_ruby_utils/templates/variable_providers/hash.rb

Instance Attribute Summary

Attributes inherited from Base

#source

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#variable_value

Constructor Details

#initialize(source) ⇒ Hash

Returns a new instance of Hash.


15
16
17
# File 'lib/eac_ruby_utils/templates/variable_providers/hash.rb', line 15

def initialize(source)
  super(source.with_indifferent_access)
end

Class Method Details

.accept?(variables_source) ⇒ Boolean

Returns:


10
11
12
# File 'lib/eac_ruby_utils/templates/variable_providers/hash.rb', line 10

def accept?(variables_source)
  variables_source.is_a?(::Hash)
end

Instance Method Details

#variable_exist?(name) ⇒ Boolean

Returns:


19
20
21
# File 'lib/eac_ruby_utils/templates/variable_providers/hash.rb', line 19

def variable_exist?(name)
  source.key?(name)
end

#variable_fetch(name) ⇒ Object


23
24
25
# File 'lib/eac_ruby_utils/templates/variable_providers/hash.rb', line 23

def variable_fetch(name)
  source.fetch(name)
end