Class: CuffSert::BasePresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/cuffsert/presenters.rb

Direct Known Subclasses

RawPresenter, RendererPresenter

Instance Method Summary collapse

Constructor Details

#initialize(events) ⇒ BasePresenter

Returns a new instance of BasePresenter.



8
9
10
11
12
13
14
# File 'lib/cuffsert/presenters.rb', line 8

def initialize(events)
  events.subscribe(
    method(:on_event),
    method(:on_error),
    method(:on_complete)
  )
end

Instance Method Details

#on_completeObject



22
23
# File 'lib/cuffsert/presenters.rb', line 22

def on_complete
end

#on_error(err) ⇒ Object



16
17
18
19
20
# File 'lib/cuffsert/presenters.rb', line 16

def on_error(err)
  STDERR.puts'Error:'
  STDERR.puts err
  STDERR.puts err.backtrace.join("\n\t")
end

#update_width(width) ⇒ Object



25
26
# File 'lib/cuffsert/presenters.rb', line 25

def update_width(width)
end