Class: ABNF::Compiler::AST::Repetition
- Inherits:
-
Object
- Object
- ABNF::Compiler::AST::Repetition
- 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) ⇒ Repetition
constructor
A new instance of Repetition.
- #inner_text ⇒ Object
Constructor Details
#initialize(*nodes) ⇒ Repetition
Returns a new instance of Repetition.
31 32 33 |
# File 'lib/abnf/compiler/ast.rb', line 31 def initialize *nodes @nodes = nodes end |
Instance Attribute Details
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
29 30 31 |
# File 'lib/abnf/compiler/ast.rb', line 29 def nodes @nodes end |
Instance Method Details
#==(other_node) ⇒ Object
35 36 37 |
# File 'lib/abnf/compiler/ast.rb', line 35 def == other_node other_node.respond_to? :nodes and nodes == other_node.nodes end |
#inner_text ⇒ Object
39 40 41 42 |
# File 'lib/abnf/compiler/ast.rb', line 39 def inner_text strings = nodes.map &:inner_text strings.join end |