class OCG::Operator::OR

OCG::Operator::OR class.

Public Instance Methods

finished?() click to toggle source

Is option combinations generation finished?

# File lib/ocg/operator/or.rb, line 39
def finished?
  @left_generator.finished? && @right_generator.finished?
end
last() click to toggle source

Get last option combination result.

# File lib/ocg/operator/or.rb, line 22
def last
  left  = @left_generator.last
  right = @right_generator.last

  if right.nil?
    left
  else
    right
  end
end
length() click to toggle source

Get option combinations length.

# File lib/ocg/operator/or.rb, line 44
def length
  @left_generator.length + @right_generator.length
end
next() click to toggle source

Get next option combination result.

# File lib/ocg/operator/or.rb, line 11
def next
  return nil if finished?

  if @left_generator.finished?
    @right_generator.next
  else
    @left_generator.next
  end
end
started?() click to toggle source

Is option combinations generation started?

# File lib/ocg/operator/or.rb, line 34
def started?
  @left_generator.started? || @right_generator.started?
end