class OCG

Option combination generator. Copyright © 2019 AUTHORS, MIT License.

Option combination generator. Copyright © 2019 AUTHORS, MIT License.

Option combination generator. Copyright © 2019 AUTHORS, MIT License.

Constants

DELEGATORS
VARIABLES_TO_COPY
VERSION

Public Class Methods

new(generator_or_options) click to toggle source
# File lib/ocg/main.rb, line 20
def initialize(generator_or_options)
  @generator = self.class.prepare_generator generator_or_options
end
prepare_generator(generator_or_options) click to toggle source
# File lib/ocg/main.rb, line 24
def self.prepare_generator(generator_or_options)
  return generator_or_options if generator_or_options.is_a? OCG

  Options.new generator_or_options
end

Public Instance Methods

and(generator_or_options) click to toggle source
# File lib/ocg/main.rb, line 30
def and(generator_or_options)
  Operator::AND.new self, generator_or_options
end
each() { |next until finished?| ... } click to toggle source
# File lib/ocg/main.rb, line 42
def each(&_block)
  instance = dup
  instance.reset

  yield instance.next until instance.finished?

  nil
end
mix(generator_or_options) click to toggle source
# File lib/ocg/main.rb, line 34
def mix(generator_or_options)
  Operator::MIX.new self, generator_or_options
end
or(generator_or_options) click to toggle source
# File lib/ocg/main.rb, line 38
def or(generator_or_options)
  Operator::OR.new self, generator_or_options
end