Module: SpinToWin

Defined in:
lib/spin_to_win.rb,
lib/spin_to_win/spinner.rb,
lib/spin_to_win/version.rb

Overview

Spinner

Defined Under Namespace

Classes: Spinner

Constant Summary collapse

VERSION =
'0.1.1'.freeze

Class Method Summary collapse

Class Method Details



24
25
26
# File 'lib/spin_to_win.rb', line 24

def banner(msg)
  Celluloid::Notifications.notifier.publish('spinner_set_banner', msg)
end

.complete!Object



16
17
18
# File 'lib/spin_to_win.rb', line 16

def complete!
  Celluloid::Notifications.notifier.publish('spinner_complete')
end

.increment_done!Object



12
13
14
# File 'lib/spin_to_win.rb', line 12

def increment_done!
  Celluloid::Notifications.notifier.publish('spinner_increment_done')
end

.increment_todo!Object



8
9
10
# File 'lib/spin_to_win.rb', line 8

def increment_todo!
  Celluloid::Notifications.notifier.publish('spinner_increment_todo')
end

.output(msg) ⇒ Object



20
21
22
# File 'lib/spin_to_win.rb', line 20

def output(msg)
  Celluloid::Notifications.notifier.publish('spinner_output', msg)
end

.remove_banner(msg) ⇒ Object



28
29
30
# File 'lib/spin_to_win.rb', line 28

def remove_banner(msg)
  Celluloid::Notifications.notifier.publish('spinner_remove_banner', msg)
end

.with_spinner(title = nil, charset: :line, &blk) ⇒ Object



32
33
34
# File 'lib/spin_to_win.rb', line 32

def with_spinner(title = nil, charset: :line, &blk)
  SpinToWin::Spinner.with_spinner(title, charset: charset, &blk)
end