Class: Exclaim::Bind

Inherits:
Object
  • Object
show all
Defined in:
lib/exclaim/bind.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, json_declaration: nil) ⇒ Bind

Returns a new instance of Bind.



7
8
9
10
11
12
# File 'lib/exclaim/bind.rb', line 7

def initialize(path:, json_declaration: nil)
  raise UiConfigurationError.new("$bind path must be a String, found #{path.class}") unless path.is_a?(String)

  @json_declaration = json_declaration
  self.path = path
end

Instance Attribute Details

#json_declarationObject (readonly)

Returns the value of attribute json_declaration.



5
6
7
# File 'lib/exclaim/bind.rb', line 5

def json_declaration
  @json_declaration
end

#pathObject

Returns the value of attribute path.



5
6
7
# File 'lib/exclaim/bind.rb', line 5

def path
  @path
end

Instance Method Details

#evaluate(env) ⇒ Object



24
25
26
# File 'lib/exclaim/bind.rb', line 24

def evaluate(env)
  env.dig(*@path_keys_for_arrays) || env.dig(*@path_keys)
end