Class: REXML::Validation::ZeroOrMore
- Defined in:
- lib/rexml/validation/relaxng.rb
Instance Method Summary collapse
Methods inherited from Optional
Methods inherited from State
#<<, #initialize, #inspect, #previous=, #reset, #to_s
Constructor Details
This class inherits a constructor from REXML::Validation::State
Instance Method Details
#expected ⇒ Object
305 306 307 308 |
# File 'lib/rexml/validation/relaxng.rb', line 305 def expected return [ @prior.expected, @events[0] ].flatten if @current == 0 [@events[@current]] end |
#next(event) ⇒ Object
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/rexml/validation/relaxng.rb', line 284 def next( event ) ( @events, @current ) if @events[@current].class == Ref if ( @events[@current].matches?(event) ) @current += 1 if @events[@current].nil? @current = 0 self elsif @events[@current].kind_of? State @current += 1 @events[@current-1].previous = self @events[@current-1] else self end else @prior = @previous.pop return @prior.next( event ) if @current == 0 nil end end |