Class: Ippon::Validate::Sequence

Inherits:
Schema
  • Object
show all
Defined in:
lib/ippon/validate.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Schema

#&, #unhalt, #validate, #validate!, #|

Constructor Details

#initialize(left, right) ⇒ Sequence

Returns a new instance of Sequence.



747
748
749
750
# File 'lib/ippon/validate.rb', line 747

def initialize(left, right)
  @left = left
  @right = right
end

Instance Attribute Details

#leftSchema (readonly)

Returns:



743
744
745
# File 'lib/ippon/validate.rb', line 743

def left
  @left
end

#rightSchema (readonly)

Returns:



745
746
747
# File 'lib/ippon/validate.rb', line 745

def right
  @right
end

Instance Method Details

#process(result) ⇒ Object

Implements the Ippon::Validate::Schema#process interface.



753
754
755
756
757
# File 'lib/ippon/validate.rb', line 753

def process(result)
  result = @left.process(result)
  return result if result.halted?
  @right.process(result)
end