Class: ActionDispatch::Journey::Nodes::Node

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/action_dispatch/journey/nodes/node.rb

Overview

:nodoc:

Direct Known Subclasses

Binary, Or, Terminal, Unary

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(left) ⇒ Node

Returns a new instance of Node.



13
14
15
16
# File 'lib/action_dispatch/journey/nodes/node.rb', line 13

def initialize(left)
  @left = left
  @memo = nil
end

Instance Attribute Details

#leftObject

Returns the value of attribute left.



11
12
13
# File 'lib/action_dispatch/journey/nodes/node.rb', line 11

def left
  @left
end

#memoObject

Returns the value of attribute memo.



11
12
13
# File 'lib/action_dispatch/journey/nodes/node.rb', line 11

def memo
  @memo
end

Instance Method Details

#cat?Boolean

Returns:

  • (Boolean)


46
# File 'lib/action_dispatch/journey/nodes/node.rb', line 46

def cat?; false; end

#each(&block) ⇒ Object



18
19
20
# File 'lib/action_dispatch/journey/nodes/node.rb', line 18

def each(&block)
  Visitors::Each::INSTANCE.accept(self, block)
end

#group?Boolean

Returns:

  • (Boolean)


47
# File 'lib/action_dispatch/journey/nodes/node.rb', line 47

def group?; false; end

#literal?Boolean

Returns:

  • (Boolean)


43
# File 'lib/action_dispatch/journey/nodes/node.rb', line 43

def literal?; false; end

#nameObject



34
35
36
# File 'lib/action_dispatch/journey/nodes/node.rb', line 34

def name
  -left.tr("*:", "")
end

#star?Boolean

Returns:

  • (Boolean)


45
# File 'lib/action_dispatch/journey/nodes/node.rb', line 45

def star?; false; end

#symbol?Boolean

Returns:

  • (Boolean)


42
# File 'lib/action_dispatch/journey/nodes/node.rb', line 42

def symbol?; false; end

#terminal?Boolean

Returns:

  • (Boolean)


44
# File 'lib/action_dispatch/journey/nodes/node.rb', line 44

def terminal?; false; end

#to_dotObject



26
27
28
# File 'lib/action_dispatch/journey/nodes/node.rb', line 26

def to_dot
  Visitors::Dot::INSTANCE.accept(self)
end

#to_sObject



22
23
24
# File 'lib/action_dispatch/journey/nodes/node.rb', line 22

def to_s
  Visitors::String::INSTANCE.accept(self, "")
end

#to_symObject



30
31
32
# File 'lib/action_dispatch/journey/nodes/node.rb', line 30

def to_sym
  name.to_sym
end

#typeObject

Raises:

  • (NotImplementedError)


38
39
40
# File 'lib/action_dispatch/journey/nodes/node.rb', line 38

def type
  raise NotImplementedError
end