Class: OCG
- Inherits:
-
Object
- Object
- OCG
- Extended by:
- Forwardable
- Includes:
- Enumerable, Copyable
- Defined in:
- lib/ocg/error.rb,
lib/ocg/main.rb,
lib/ocg/options.rb,
lib/ocg/version.rb,
lib/ocg/copyable.rb,
lib/ocg/validation.rb,
lib/ocg/operator/or.rb,
lib/ocg/operator/and.rb,
lib/ocg/operator/mix.rb,
lib/ocg/operator/abstract.rb
Overview
Option combination generator. Copyright © 2019 AUTHORS, MIT License.
Direct Known Subclasses
Defined Under Namespace
Modules: Copyable, Operator, Validation Classes: BaseError, NotImplementedError, Options, ValidateError
Constant Summary collapse
- DELEGATORS =
%i[reset next last started? finished? length].freeze
- VARIABLES_TO_COPY =
%i[generator].freeze
- VERSION =
"1.4.2".freeze
Class Method Summary collapse
Instance Method Summary collapse
- #and(generator_or_options = {}) ⇒ Object
- #each(&_block) ⇒ Object
-
#initialize(generator_or_options = {}) ⇒ OCG
constructor
A new instance of OCG.
- #mix(generator_or_options = {}) ⇒ Object
- #or(generator_or_options = {}) ⇒ Object
Methods included from Copyable
Constructor Details
#initialize(generator_or_options = {}) ⇒ OCG
Returns a new instance of OCG.
20 21 22 |
# File 'lib/ocg/main.rb', line 20 def initialize( = {}) @generator = self.class.prepare_generator end |
Class Method Details
Instance Method Details
#and(generator_or_options = {}) ⇒ Object
30 31 32 |
# File 'lib/ocg/main.rb', line 30 def and( = {}) Operator::AND.new self, end |
#each(&_block) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/ocg/main.rb', line 42 def each(&_block) instance = dup instance.reset yield instance.next until instance.finished? nil end |