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.


657
658
659
660
# File 'lib/ippon/validate.rb', line 657

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

Instance Attribute Details

#leftSchema (readonly)

Returns:


653
654
655
# File 'lib/ippon/validate.rb', line 653

def left
  @left
end

#rightSchema (readonly)

Returns:


655
656
657
# File 'lib/ippon/validate.rb', line 655

def right
  @right
end

Instance Method Details

#process(result) ⇒ Object

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


663
664
665
666
667
# File 'lib/ippon/validate.rb', line 663

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