Class: Aqueductron::EndPiece
- Inherits:
-
Object
- Object
- Aqueductron::EndPiece
- Includes:
- PieceCommon
- Defined in:
- lib/aqueductron/end_piece.rb
Instance Method Summary collapse
- #eof ⇒ Object
-
#initialize(monoid, so_far = :no_value) ⇒ EndPiece
constructor
A new instance of EndPiece.
- #receive(msg) ⇒ Object
Methods included from PieceCommon
Constructor Details
#initialize(monoid, so_far = :no_value) ⇒ EndPiece
Returns a new instance of EndPiece.
7 8 9 10 |
# File 'lib/aqueductron/end_piece.rb', line 7 def initialize(monoid, so_far = :no_value) @monoid = monoid @so_far = (so_far == :no_value) ? monoid.zero : so_far end |
Instance Method Details
#eof ⇒ Object
12 13 14 |
# File 'lib/aqueductron/end_piece.rb', line 12 def eof SimpleResult.new(@so_far) end |