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, #literal?, #name, #to_dot, #to_s, #to_sym, #type

Constructor Details

#initialize(left) ⇒ Symbol

Returns a new instance of Symbol.



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

def initialize left
  super
  @regexp = DEFAULT_EXP
end

Instance Attribute Details

#regexpObject Also known as: symbol

Returns the value of attribute regexp.



69
70
71
# File 'lib/journey/nodes/node.rb', line 69

def regexp
  @regexp
end

Instance Method Details

#default_regexp?Boolean

Returns:

  • (Boolean)


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

def default_regexp?
  regexp == DEFAULT_EXP
end

#symbol?Boolean

Returns:

  • (Boolean)


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

def symbol?; true; end