class SyntaxTree::Ensure
end
ensure
begin
statements.
Ensure represents the use of the ensure keyword and its subsequent
def ===(other)
def ===(other) other.is_a?(Ensure) && keyword === other.keyword && statements === other.statements end
def accept(visitor)
def accept(visitor) visitor.visit_ensure(self) end
def child_nodes
def child_nodes [keyword, statements] end
def copy(keyword: nil, statements: nil, location: nil)
def copy(keyword: nil, statements: nil, location: nil) node = Ensure.new( keyword: keyword || self.keyword, statements: statements || self.statements, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { keyword: keyword, statements: statements, location: location, comments: comments } end
def format(q)
def format(q) q.format(keyword) unless statements.empty? q.indent do q.breakable_force q.format(statements) end end end
def initialize(keyword:, statements:, location:)
def initialize(keyword:, statements:, location:) @keyword = keyword @statements = statements @location = location @comments = [] end