Class: SyntaxTree::JSON::AST::Object
- Defined in:
- lib/syntax_tree/json/ast.rb
Overview
This represents an object in the tree.
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(values:) ⇒ Object
constructor
A new instance of Object.
Methods inherited from Node
Constructor Details
#initialize(values:) ⇒ Object
Returns a new instance of Object.
101 102 103 |
# File 'lib/syntax_tree/json/ast.rb', line 101 def initialize(values:) @values = values end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
99 100 101 |
# File 'lib/syntax_tree/json/ast.rb', line 99 def values @values end |
Instance Method Details
#accept(visitor) ⇒ Object
105 106 107 |
# File 'lib/syntax_tree/json/ast.rb', line 105 def accept(visitor) visitor.visit_object(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
109 110 111 |
# File 'lib/syntax_tree/json/ast.rb', line 109 def child_nodes values.values end |
#deconstruct_keys(keys) ⇒ Object
115 116 117 |
# File 'lib/syntax_tree/json/ast.rb', line 115 def deconstruct_keys(keys) { values: values } end |