class Ikra::AST::BlockDefNode

Attributes

body[R]
parameters[R]
ruby_block[R]

Public Class Methods

new(body:, ruby_block:, parameters: nil) click to toggle source
# File lib/ast/nodes.rb, line 184
def initialize(body:, ruby_block:, parameters: nil)
    @body = body
    @ruby_block = ruby_block
    @parameters = parameters

    body.parent = self
end

Public Instance Methods

==(other) click to toggle source
Calls superclass method Ikra::AST::Node#==
# File lib/ast/nodes.rb, line 203
def ==(other)
    return super(other) && body == other.body && parameters == other.parameters
end
accept(visitor) click to toggle source
# File lib/ast/visitor.rb, line 38
def accept(visitor)
    return visitor.visit_block_def_node(self)
end
binding() click to toggle source
# File lib/ast/nodes.rb, line 199
def binding
    return ruby_block.binding
end
clone() click to toggle source
# File lib/ast/nodes.rb, line 192
def clone
    return BlockDefNode.new(
        body: @body.clone,
        ruby_block: @ruby_block,
        parameters: @parameters == nil ? nil : @parameters.dup)
end
to_s() click to toggle source
# File lib/ast/printer.rb, line 34
def to_s
    return "[BlockDefNode: #{body.to_s}]"
end