Class: Exclaim::Bind
- Inherits:
-
Object
- Object
- Exclaim::Bind
- Defined in:
- lib/exclaim/bind.rb
Instance Attribute Summary collapse
-
#json_declaration ⇒ Object
readonly
Returns the value of attribute json_declaration.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #evaluate(env) ⇒ Object
-
#initialize(path:, json_declaration: nil) ⇒ Bind
constructor
A new instance of Bind.
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_declaration ⇒ Object (readonly)
Returns the value of attribute json_declaration.
5 6 7 |
# File 'lib/exclaim/bind.rb', line 5 def json_declaration @json_declaration end |
#path ⇒ Object
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 |