Class: CZTop::Z85::Pipe::Strategy Abstract
- Inherits:
-
Object
- Object
- CZTop::Z85::Pipe::Strategy
- Defined in:
- lib/cztop/z85/pipe.rb
Overview
This class is abstract.
Different encoding/decoding strategies (algorithms).
This is mainly just for me to practice the GoF Strategy Pattern.
Direct Known Subclasses
Defined Under Namespace
Classes: Parallel, Sequential
Instance Method Summary collapse
-
#execute ⇒ Object
abstract
Runs the algorithm.
-
#initialize(source, sink, read_sz, &xcode) {|chunk, prev_chunk| ... } ⇒ Strategy
constructor
A new instance of Strategy.
Constructor Details
#initialize(source, sink, read_sz, &xcode) {|chunk, prev_chunk| ... } ⇒ Strategy
Returns a new instance of Strategy.
80 81 82 83 84 85 |
# File 'lib/cztop/z85/pipe.rb', line 80 def initialize(source, sink, read_sz, &xcode) @source = source @sink = sink @read_sz = read_sz @xcode = xcode end |
Instance Method Details
#execute ⇒ Object
This method is abstract.
Runs the algorithm.
91 92 93 |
# File 'lib/cztop/z85/pipe.rb', line 91 def execute raise NotImplementedError end |