Class: SyntaxTree::JSON::AST::Number
- Defined in:
- lib/syntax_tree/json/ast.rb
Overview
This represents a number 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:) ⇒ Number
constructor
A new instance of Number.
Methods inherited from Node
Constructor Details
#initialize(value:) ⇒ Number
Returns a new instance of Number.
78 79 80 |
# File 'lib/syntax_tree/json/ast.rb', line 78 def initialize(value:) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
76 77 78 |
# File 'lib/syntax_tree/json/ast.rb', line 76 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
82 83 84 |
# File 'lib/syntax_tree/json/ast.rb', line 82 def accept(visitor) visitor.visit_number(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
86 87 88 |
# File 'lib/syntax_tree/json/ast.rb', line 86 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
92 93 94 |
# File 'lib/syntax_tree/json/ast.rb', line 92 def deconstruct_keys(keys) { value: value } end |