Class: Blaml::TreeBuilder
- Inherits:
-
Psych::TreeBuilder
- Object
- Psych::TreeBuilder
- Blaml::TreeBuilder
- Defined in:
- lib/blaml/tree_builder.rb
Instance Method Summary collapse
-
#add_meta(obj) ⇒ Object
Sets the @meta instance variable to the metadata matched for the string object.
-
#initialize(meta_binding) ⇒ TreeBuilder
constructor
A new instance of TreeBuilder.
-
#scalar(value, anchor, tag, plain, quoted, style) ⇒ Object
Calls parent and applies metadata to return value.
Constructor Details
#initialize(meta_binding) ⇒ TreeBuilder
Returns a new instance of TreeBuilder.
5 6 7 8 |
# File 'lib/blaml/tree_builder.rb', line 5 def initialize @meta_binding = super() end |
Instance Method Details
#add_meta(obj) ⇒ Object
Sets the @meta instance variable to the metadata matched for the string object. Returns the passed instance.
16 17 18 19 |
# File 'lib/blaml/tree_builder.rb', line 16 def obj obj. = @meta_binding. obj.value obj end |
#scalar(value, anchor, tag, plain, quoted, style) ⇒ Object
Calls parent and applies metadata to return value.
25 26 27 28 |
# File 'lib/blaml/tree_builder.rb', line 25 def scalar value, anchor, tag, plain, quoted, style super @last.children.last end |