Class: Expgen::Nodes::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/expgen/nodes.rb

Direct Known Subclasses

Alternation, Character, Group

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ast) ⇒ Node

Returns a new instance of Node.



6
7
8
# File 'lib/expgen/nodes.rb', line 6

def initialize(ast)
  @ast = ast
end

Instance Attribute Details

#astObject (readonly)

Returns the value of attribute ast.



4
5
6
# File 'lib/expgen/nodes.rb', line 4

def ast
  @ast
end

Instance Method Details

#maxObject



14
15
16
# File 'lib/expgen/nodes.rb', line 14

def max
  ast[:max]
end

#repeatObject



10
11
12
# File 'lib/expgen/nodes.rb', line 10

def repeat
  ast[:repeat]
end