Class: Journey::Nodes::Symbol

Inherits:
Terminal show all
Defined in:
lib/journey/nodes/node.rb

Constant Summary collapse

DEFAULT_EXP =
/[^\.\/\?]+/

Instance Attribute Summary collapse

Attributes inherited from Node

#left, #memo

Instance Method Summary collapse

Methods inherited from Node

#each, #name, #to_dot, #to_s, #to_sym, #type

Constructor Details

#initialize(left) ⇒ Symbol

Returns a new instance of Symbol.



57
58
59
60
# File 'lib/journey/nodes/node.rb', line 57

def initialize left
  super
  @regexp = DEFAULT_EXP
end

Instance Attribute Details

#regexpObject Also known as: symbol

Returns the value of attribute regexp.



53
54
55
# File 'lib/journey/nodes/node.rb', line 53

def regexp
  @regexp
end

Instance Method Details

#default_regexp?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/journey/nodes/node.rb', line 62

def default_regexp?
  regexp == DEFAULT_EXP
end