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 lib/yarp/node.rb, line 10569 def initialize(filepath, location) @filepath = filepath @location = location end
Public Instance Methods
accept(visitor)
click to toggle source
def accept: (visitor: Visitor
) -> void
# File lib/yarp/node.rb, line 10575 def accept(visitor) visitor.visit_source_file_node(self) end
child_nodes()
click to toggle source
def child_nodes
: () -> Array[nil | Node]
# File lib/yarp/node.rb, line 10580 def child_nodes [] end
Also aliased as: deconstruct
comment_targets()
click to toggle source
def comment_targets
: () -> Array[Node | Location]
# File lib/yarp/node.rb, line 10590 def comment_targets [] end
compact_child_nodes()
click to toggle source
def compact_child_nodes
: () -> Array
# File lib/yarp/node.rb, line 10585 def compact_child_nodes [] end
copy(**params)
click to toggle source
def copy: (**params) -> SourceFileNode
# File lib/yarp/node.rb, line 10595 def copy(**params) SourceFileNode.new( params.fetch(:filepath) { filepath }, params.fetch(:location) { location }, ) end
deconstruct_keys(keys)
click to toggle source
def deconstruct_keys
: (keys: Array) -> Hash[Symbol, nil | Node | Array | String
| Token | Array | Location]
# File lib/yarp/node.rb, line 10606 def deconstruct_keys(keys) { filepath: filepath, location: location } end
inspect(inspector = NodeInspector.new)
click to toggle source
# File lib/yarp/node.rb, line 10610 def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector << "└── filepath: #{filepath.inspect}\n" inspector.to_str end