Class: Sijka::Smoke

Inherits:
Object
  • Object
show all
Defined in:
lib/sijka/smoke.rb

Constant Summary collapse

SLEEP_TIME =
0.02

Instance Method Summary collapse

Constructor Details

#initialize(name, file_name) ⇒ Smoke



7
8
9
10
11
12
13
# File 'lib/sijka/smoke.rb', line 7

def initialize(name, file_name)
  set_standarted_img file_name
  @movement_range = TermInfo.screen_size[1] - @img_length

  message = Translator.new.smoken_with_locale(file_name)
  @message_with_name = name.to_s.empty? ? "#{message}!" : "#{message}, #{name}!"
end

Instance Method Details

#smokeObject



15
16
17
18
19
20
21
22
# File 'lib/sijka/smoke.rb', line 15

def smoke
  right_move
  reverse_img
  left_move
  puts @message_with_name
  sleep(1.3)
  system 'clear'
end