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.

[View source]

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

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

Instance Attribute Details

#leftObject

Returns the value of attribute left.


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

def left
  @left
end

#memoObject

Returns the value of attribute memo.


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

def memo
  @memo
end

Instance Method Details

#cat?Boolean

Returns:

  • (Boolean)
[View source]

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

def cat?; false; end

#each(&block) ⇒ Object

[View source]

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

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

#group?Boolean

Returns:

  • (Boolean)
[View source]

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

def group?; false; end

#literal?Boolean

Returns:

  • (Boolean)
[View source]

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

def literal?; false; end

#nameObject

[View source]

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

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

#star?Boolean

Returns:

  • (Boolean)
[View source]

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

def star?; false; end

#symbol?Boolean

Returns:

  • (Boolean)
[View source]

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

def symbol?; false; end

#terminal?Boolean

Returns:

  • (Boolean)
[View source]

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

def terminal?; false; end

#to_dotObject

[View source]

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

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

#to_sObject

[View source]

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

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

#to_symObject

[View source]

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

def to_sym
  name.to_sym
end

#typeObject

Raises:

  • (NotImplementedError)
[View source]

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

def type
  raise NotImplementedError
end