Module: Gemwarrior::Animation

Defined in:
lib/gemwarrior/misc/animation.rb

Class Method Summary collapse

Class Method Details

.run(opts) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/gemwarrior/misc/animation.rb', line 6

def self.run(opts)
  options = {
    :oneline => false, 
    :speed => nil, 
    :alpha => true, 
    :numeric => true, 
    :random => true
  }.merge(opts)

  th = Thread.new do
    print Matrext::process({
      :phrase     => options.fetch(:phrase),
      :oneline    => options.fetch(:oneline),
      :speed      => options.fetch(:speed),
      :alpha      => options.fetch(:alpha),
      :numeric    => options.fetch(:numeric),
      :random     => options.fetch(:random)
    })
  end

  return th.join
end