Class: Termplot::Producers::BaseProducer

Inherits:
Object
  • Object
show all
Defined in:
lib/termplot/producers/base_producer.rb

Direct Known Subclasses

CommandProducer, StdinProducer

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ BaseProducer

Returns a new instance of BaseProducer.



4
5
6
7
# File 'lib/termplot/producers/base_producer.rb', line 4

def initialize(options)
  @options = options
  @on_message_handler = -> {}
end

Instance Method Details

#on_message(&block) ⇒ Object



9
10
11
# File 'lib/termplot/producers/base_producer.rb', line 9

def on_message(&block)
  @on_message_handler = block
end

#runObject



13
14
15
# File 'lib/termplot/producers/base_producer.rb', line 13

def run
  raise "Must be implemented"
end