Class: CooCoo::Drawing::Sixel::Streamer
- Defined in:
- lib/coo-coo/drawing/sixel.rb
Instance Method Summary collapse
-
#initialize(io = $stdout, stringer = Stringer.new, &block) ⇒ Streamer
constructor
A new instance of Streamer.
- #method_missing(mid, *args, &block) ⇒ Object
- #with_sixel(&block) ⇒ Object
Constructor Details
#initialize(io = $stdout, stringer = Stringer.new, &block) ⇒ Streamer
Returns a new instance of Streamer.
24 25 26 27 28 |
# File 'lib/coo-coo/drawing/sixel.rb', line 24 def initialize(io = $stdout, stringer = Stringer.new, &block) @io = io @stringer = stringer with_sixel(&block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(mid, *args, &block) ⇒ Object
30 31 32 |
# File 'lib/coo-coo/drawing/sixel.rb', line 30 def method_missing(mid, *args, &block) @io.write(@stringer.send(mid, *args, &block)) end |
Instance Method Details
#with_sixel(&block) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/coo-coo/drawing/sixel.rb', line 34 def with_sixel(&block) begin_sixel block.call(self) ensure finish_sixel end |