Class: SyntaxTree::JSON::AST::String
- Defined in:
- lib/syntax_tree/json/ast.rb
Overview
This represents a string in the tree.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(value:) ⇒ String
constructor
A new instance of String.
Methods inherited from Node
Constructor Details
#initialize(value:) ⇒ String
Returns a new instance of String.
147 148 149 |
# File 'lib/syntax_tree/json/ast.rb', line 147 def initialize(value:) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
145 146 147 |
# File 'lib/syntax_tree/json/ast.rb', line 145 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
151 152 153 |
# File 'lib/syntax_tree/json/ast.rb', line 151 def accept(visitor) visitor.visit_string(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
155 156 157 |
# File 'lib/syntax_tree/json/ast.rb', line 155 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
161 162 163 |
# File 'lib/syntax_tree/json/ast.rb', line 161 def deconstruct_keys(keys) { value: value } end |