class SyntaxTree::RationalLiteral
RationalLiteral
represents the use of a rational number literal.
1r
Attributes
- String
-
the rational number literal
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 8919 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 8954 def ===(other) other.is_a?(RationalLiteral) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 8925 def accept(visitor) visitor.visit_rational(self) end
Source
# File lib/syntax_tree/node.rb, line 8929 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 8933 def copy(value: nil, location: nil) node = RationalLiteral.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 8946 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end