Class: OCG::Operator::Abstract

Inherits:
OCG
  • Object
show all
Defined in:
lib/ocg/operator/abstract.rb

Direct Known Subclasses

AND, MIX, OR

Constant Summary

Constants inherited from OCG

DELEGATORS, VERSION

Instance Method Summary collapse

Methods inherited from OCG

#and, #mix, #or, prepare_generator, #to_a

Constructor Details

#initialize(left_generator_or_options, right_generator_or_options) ⇒ Abstract



9
10
11
12
13
14
# File 'lib/ocg/operator/abstract.rb', line 9

def initialize(left_generator_or_options, right_generator_or_options)
  @left_generator  = OCG.prepare_generator left_generator_or_options
  @right_generator = OCG.prepare_generator right_generator_or_options

  reset
end

Instance Method Details

#finished?Boolean



35
36
37
# File 'lib/ocg/operator/abstract.rb', line 35

def finished?
  raise NotImplementedError, "\"finished?\" is not implemented"
end

#lastObject



27
28
29
# File 'lib/ocg/operator/abstract.rb', line 27

def last
  raise NotImplementedError, "\"last\" is not implemented"
end

#lengthObject



39
40
41
# File 'lib/ocg/operator/abstract.rb', line 39

def length
  raise NotImplementedError, "\"length\" is not implemented"
end

#nextObject



23
24
25
# File 'lib/ocg/operator/abstract.rb', line 23

def next
  raise NotImplementedError, "\"next\" is not implemented"
end

#resetObject



16
17
18
19
20
21
# File 'lib/ocg/operator/abstract.rb', line 16

def reset
  @left_generator.reset
  @right_generator.reset

  nil
end

#started?Boolean



31
32
33
# File 'lib/ocg/operator/abstract.rb', line 31

def started?
  raise NotImplementedError, "\"started?\" is not implemented"
end