Class: EacTemplates::Variables::Providers::Hash

Inherits:
Base
  • Object
show all
Defined in:
lib/eac_templates/variables/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.



13
14
15
# File 'lib/eac_templates/variables/providers/hash.rb', line 13

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

Class Method Details

.accept?(variables_source) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/eac_templates/variables/providers/hash.rb', line 8

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

Instance Method Details

#variable_exist?(name) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/eac_templates/variables/providers/hash.rb', line 17

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

#variable_fetch(name) ⇒ Object



21
22
23
# File 'lib/eac_templates/variables/providers/hash.rb', line 21

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