class YARP::SourceFileNode
Represents the use of the ‘__FILE__` keyword.
__FILE__ ^^^^^^^^
Attributes
filepath[R]
attr_reader filepath: String
Public Class Methods
new(filepath, location)
click to toggle source
def initialize: (filepath: String, location: Location
) -> void
# File yarp/node.rb, line 9700 def initialize(filepath, location) @filepath = filepath @location = location end
Public Instance Methods
accept(visitor)
click to toggle source
def accept: (visitor: Visitor
) -> void
# File yarp/node.rb, line 9706 def accept(visitor) visitor.visit_source_file_node(self) end
child_nodes()
click to toggle source
def child_nodes
: () -> Array[nil | Node]
# File yarp/node.rb, line 9711 def child_nodes [] end
Also aliased as: deconstruct
comment_targets()
click to toggle source
def comment_targets
: () -> Array[Node | Location]
# File yarp/node.rb, line 9716 def comment_targets [] end
copy(**params)
click to toggle source
def copy: (**params) -> SourceFileNode
# File yarp/node.rb, line 9721 def copy(**params) SourceFileNode.new( params.fetch(:filepath) { filepath }, params.fetch(:location) { location }, ) end
deconstruct_keys(keys)
click to toggle source
inspect(inspector = NodeInspector.new)
click to toggle source
# File yarp/node.rb, line 9736 def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector << "└── filepath: #{filepath.inspect}\n" inspector.to_str end