class OCG
Option combination generator. Copyright © 2019 AUTHORS, MIT License.
Option combination generator. Copyright © 2019 AUTHORS, MIT License.
OCG
class.
Option combination generator. Copyright © 2019 AUTHORS, MIT License.
Constants
- DELEGATORS
Current delegators.
- VARIABLES_TO_COPY
Current variables to copy.
- VERSION
Option combination generator version.
Public Class Methods
Initializes options generator using generator_or_options
. generator_or_options
may be generator
object or options
. options
is a hash with values convertable to array.
# File lib/ocg/main.rb, line 28 def initialize(generator_or_options = {}) @generator = self.class.prepare_generator generator_or_options end
Prepares options generator using generator_or_options
. generator_or_options
may be generator
object or options
. options
is a hash with values convertable to array.
# File lib/ocg/main.rb, line 35 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
Adds generator_or_options
to current option combinations generator.
# File lib/ocg/main.rb, line 42 def and(generator_or_options = {}) Operator::AND.new self, generator_or_options end
Processes each option combination.
# File lib/ocg/main.rb, line 57 def each(&_block) instance = dup instance.reset yield instance.next until instance.finished? nil end
Mixes generator_or_options
with current option combinations generator.
# File lib/ocg/main.rb, line 47 def mix(generator_or_options = {}) Operator::MIX.new self, generator_or_options end
Mixes generator_or_options
with current option combinations generator.
# File lib/ocg/main.rb, line 52 def or(generator_or_options = {}) Operator::OR.new self, generator_or_options end