class SyntaxTree::RationalLiteral
RationalLiteral
represents the use of a rational number literal.
1r
Attributes
value[R]
- String
-
the rational number literal
Public Class Methods
new(value:, location:)
click to toggle source
# File lib/syntax_tree/node.rb, line 8904 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
===(other)
click to toggle source
# File lib/syntax_tree/node.rb, line 8939 def ===(other) other.is_a?(RationalLiteral) && value === other.value end
accept(visitor)
click to toggle source
# File lib/syntax_tree/node.rb, line 8910 def accept(visitor) visitor.visit_rational(self) end
child_nodes()
click to toggle source
# File lib/syntax_tree/node.rb, line 8914 def child_nodes [] end
Also aliased as: deconstruct
copy(value: nil, location: nil)
click to toggle source
# File lib/syntax_tree/node.rb, line 8918 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
deconstruct_keys(_keys)
click to toggle source
# File lib/syntax_tree/node.rb, line 8931 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end
format(q)
click to toggle source
# File lib/syntax_tree/node.rb, line 8935 def format(q) q.text(value) end