Class: Resyma::Core::RegexpSomething
- Defined in:
- lib/resyma/core/automaton/regexp.rb
Instance Attribute Summary collapse
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(matchable) ⇒ RegexpSomething
constructor
Matches what the matchable matches.
- #inject(ab, start_state) ⇒ Object
Methods inherited from Regexp
Constructor Details
#initialize(matchable) ⇒ RegexpSomething
Matches what the matchable matches
125 126 127 |
# File 'lib/resyma/core/automaton/regexp.rb', line 125 def initialize(matchable) @condition = matchable end |
Instance Attribute Details
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
129 130 131 |
# File 'lib/resyma/core/automaton/regexp.rb', line 129 def condition @condition end |
Instance Method Details
#==(other) ⇒ Object
131 132 133 |
# File 'lib/resyma/core/automaton/regexp.rb', line 131 def ==(other) other.is_a?(self.class) && other.condition == @condition end |
#inject(ab, start_state) ⇒ Object
135 136 137 138 139 |
# File 'lib/resyma/core/automaton/regexp.rb', line 135 def inject(ab, start_state) accept = ab.new_state! ab.add_transition!(start_state, @condition, accept) accept end |