Class: Protos::Markdown::AST::Node

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/protos/markdown/ast.rb

Instance Method Summary collapse

Instance Method Details

#accept(visitor) ⇒ Object



7
8
9
# File 'lib/protos/markdown/ast.rb', line 7

def accept(visitor)
  visitor.send(:"visit_#{type}", self)
end

#each(&block) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/protos/markdown/ast.rb', line 11

def each(&block)
  return enum_for(:each) unless block

  super do |child|
    yield Node.new(child)
  end
end