Class: ABNF::Compiler::AST::Sequence
- Inherits:
-
Object
- Object
- ABNF::Compiler::AST::Sequence
- Defined in:
- lib/abnf/compiler/ast.rb
Instance Attribute Summary collapse
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #==(other_node) ⇒ Object
-
#initialize(*nodes) ⇒ Sequence
constructor
A new instance of Sequence.
- #inner_text ⇒ Object
Constructor Details
#initialize(*nodes) ⇒ Sequence
Returns a new instance of Sequence.
52 53 54 |
# File 'lib/abnf/compiler/ast.rb', line 52 def initialize *nodes @nodes = nodes end |
Instance Attribute Details
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
50 51 52 |
# File 'lib/abnf/compiler/ast.rb', line 50 def nodes @nodes end |
Instance Method Details
#==(other_node) ⇒ Object
56 57 58 |
# File 'lib/abnf/compiler/ast.rb', line 56 def == other_node other_node.respond_to? :nodes and nodes == other_node.nodes end |
#inner_text ⇒ Object
60 61 62 63 |
# File 'lib/abnf/compiler/ast.rb', line 60 def inner_text strings = nodes.map &:inner_text strings.join end |