class ABNF::Parser::Node::Sequence

Attributes

abnf[R]
children[R]

Public Class Methods

new(children, abnf) click to toggle source
# File lib/abnf/parser/node.rb, line 74
def initialize children, abnf
  @abnf = abnf
  @children = children
end

Public Instance Methods

<<(child)
Alias for: add
add(child) click to toggle source
# File lib/abnf/parser/node.rb, line 79
def add child
  children << child
end
Also aliased as: <<
text() click to toggle source
# File lib/abnf/parser/node.rb, line 84
def text
  @text ||= to_a.join
end
to_a() click to toggle source
# File lib/abnf/parser/node.rb, line 88
def to_a
  map do |child|
    if child.respond_to? :to_a
      child.to_a
    else
      child.text
    end
  end
end