class SyntaxTree::Imaginary
Imaginary
represents an imaginary number literal.
1i
Attributes
- String
-
the value of the imaginary number literal
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 6702 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 6737 def ===(other) other.is_a?(Imaginary) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 6708 def accept(visitor) visitor.visit_imaginary(self) end
Source
# File lib/syntax_tree/node.rb, line 6712 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 6716 def copy(value: nil, location: nil) node = Imaginary.new( value: value || self.value, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 6729 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end