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.



73
74
75
76
# File 'lib/action_dispatch/journey/nodes/node.rb', line 73

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

Instance Attribute Details

#leftObject

Returns the value of attribute left.



71
72
73
# File 'lib/action_dispatch/journey/nodes/node.rb', line 71

def left
  @left
end

#memoObject

Returns the value of attribute memo.



71
72
73
# File 'lib/action_dispatch/journey/nodes/node.rb', line 71

def memo
  @memo
end

Instance Method Details

#cat?Boolean

Returns:

  • (Boolean)


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

def cat?; false; end

#each(&block) ⇒ Object



78
79
80
# File 'lib/action_dispatch/journey/nodes/node.rb', line 78

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

#group?Boolean

Returns:

  • (Boolean)


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

def group?; false; end

#literal?Boolean

Returns:

  • (Boolean)


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

def literal?; false; end

#nameObject



94
95
96
# File 'lib/action_dispatch/journey/nodes/node.rb', line 94

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

#star?Boolean

Returns:

  • (Boolean)


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

def star?; false; end

#symbol?Boolean

Returns:

  • (Boolean)


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

def symbol?; false; end

#terminal?Boolean

Returns:

  • (Boolean)


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

def terminal?; false; end

#to_dotObject



86
87
88
# File 'lib/action_dispatch/journey/nodes/node.rb', line 86

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

#to_sObject



82
83
84
# File 'lib/action_dispatch/journey/nodes/node.rb', line 82

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

#to_symObject



90
91
92
# File 'lib/action_dispatch/journey/nodes/node.rb', line 90

def to_sym
  name.to_sym
end

#typeObject

Raises:

  • (NotImplementedError)


98
99
100
# File 'lib/action_dispatch/journey/nodes/node.rb', line 98

def type
  raise NotImplementedError
end