Class: OCG::Operator::Abstract
Overview
OCG::Operator::Abstract class.
Constant Summary collapse
- VARIABLES_TO_COPY =
%i[left_generator right_generator].freeze
Constants inherited from OCG
Instance Method Summary collapse
- #finished? ⇒ Boolean
-
#initialize(left_generator_or_options, right_generator_or_options) ⇒ Abstract
constructor
Initializes operator using
left_generator_or_options
andright_generator_or_options
. - #last ⇒ Object
- #length ⇒ Object
-
#next ⇒ Object
:nocov:.
-
#reset ⇒ Object
Resets left and right generators specifically for options.
- #started? ⇒ Boolean
Methods inherited from OCG
#and, #each, #mix, #or, prepare_generator
Methods included from Copyable
Constructor Details
#initialize(left_generator_or_options, right_generator_or_options) ⇒ Abstract
Initializes operator using left_generator_or_options
and right_generator_or_options
. Internaly object initializes left and right generators.
14 15 16 17 18 19 |
# File 'lib/ocg/operator/abstract.rb', line 14 def initialize(, ) # rubocop:disable Lint/MissingSuper @left_generator = OCG.prepare_generator @right_generator = OCG.prepare_generator reset end |
Instance Method Details
#finished? ⇒ Boolean
53 54 55 |
# File 'lib/ocg/operator/abstract.rb', line 53 def finished? raise NotImplementedError, "\"finished?\" is not implemented" end |
#last ⇒ Object
45 46 47 |
# File 'lib/ocg/operator/abstract.rb', line 45 def last raise NotImplementedError, "\"last\" is not implemented" end |
#length ⇒ Object
57 58 59 |
# File 'lib/ocg/operator/abstract.rb', line 57 def length raise NotImplementedError, "\"length\" is not implemented" end |
#next ⇒ Object
:nocov:
41 42 43 |
# File 'lib/ocg/operator/abstract.rb', line 41 def next raise NotImplementedError, "\"next\" is not implemented" end |
#reset ⇒ Object
Resets left and right generators specifically for options.
22 23 24 25 26 27 |
# File 'lib/ocg/operator/abstract.rb', line 22 def reset @left_generator.reset @right_generator.reset nil end |
#started? ⇒ Boolean
49 50 51 |
# File 'lib/ocg/operator/abstract.rb', line 49 def started? raise NotImplementedError, "\"started?\" is not implemented" end |