module HamdownCore::Ast::HasChildren

Public Class Methods

new(*) click to toggle source
Calls superclass method
# File lib/hamdown_core/ast.rb, line 6
def initialize(*)
  super
  self.children ||= []
end

Public Instance Methods

<<(ast) click to toggle source
# File lib/hamdown_core/ast.rb, line 11
def <<(ast)
  self.children << ast
end
to_h() click to toggle source
Calls superclass method
# File lib/hamdown_core/ast.rb, line 15
def to_h
  super.merge(children: children.map(&:to_h))
end