class SyntaxTree::Period
Period
represents the use of the .
operator. It is usually found in method calls.
Attributes
value[R]
- String
-
the period
Public Class Methods
new(value:, location:)
click to toggle source
# File lib/syntax_tree/node.rb, line 8560 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 8595 def ===(other) other.is_a?(Period) && value === other.value end
accept(visitor)
click to toggle source
# File lib/syntax_tree/node.rb, line 8566 def accept(visitor) visitor.visit_period(self) end
child_nodes()
click to toggle source
# File lib/syntax_tree/node.rb, line 8570 def child_nodes [] end
Also aliased as: deconstruct
copy(value: nil, location: nil)
click to toggle source
# File lib/syntax_tree/node.rb, line 8574 def copy(value: nil, location: nil) node = Period.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 8587 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end
format(q)
click to toggle source
# File lib/syntax_tree/node.rb, line 8591 def format(q) q.text(value) end