Class: ABNF::Compiler::AST::Leaf

Inherits:
Object
  • Object
show all
Defined in:
lib/abnf/compiler/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Leaf

Returns a new instance of Leaf.



11
12
13
# File 'lib/abnf/compiler/ast.rb', line 11

def initialize text
  @text = text
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



9
10
11
# File 'lib/abnf/compiler/ast.rb', line 9

def text
  @text
end

Instance Method Details

#==(other_node) ⇒ Object



15
16
17
# File 'lib/abnf/compiler/ast.rb', line 15

def == other_node
  other_node.respond_to? :text and text == other_node.text
end

#inner_textObject



19
20
21
# File 'lib/abnf/compiler/ast.rb', line 19

def inner_text
  text
end