Class: Sijka::Smoke
- Inherits:
-
Object
- Object
- Sijka::Smoke
- Defined in:
- lib/sijka/smoke.rb
Constant Summary collapse
- MOVE_SLEEP_TIME =
0.025- SLEEP_TIME_IN_THE_END =
1.5- DEFAULT_IMG_FILE =
'sijka'.freeze
Instance Attribute Summary collapse
-
#img_file_name ⇒ Object
readonly
Returns the value of attribute img_file_name.
-
#smoker_name ⇒ Object
readonly
Returns the value of attribute smoker_name.
Instance Method Summary collapse
-
#initialize(smoker_name, file_name) ⇒ Smoke
constructor
A new instance of Smoke.
- #smoke ⇒ Object
Constructor Details
#initialize(smoker_name, file_name) ⇒ Smoke
Returns a new instance of Smoke.
9 10 11 12 13 14 15 |
# File 'lib/sijka/smoke.rb', line 9 def initialize(smoker_name, file_name) @smoker_name = smoker_name @img_file_name = validated_img_file_name(file_name&.downcase) load_standarted_img CursesInitializer.call @movement_range = Curses.cols - @img_length end |
Instance Attribute Details
#img_file_name ⇒ Object (readonly)
Returns the value of attribute img_file_name.
7 8 9 |
# File 'lib/sijka/smoke.rb', line 7 def img_file_name @img_file_name end |
#smoker_name ⇒ Object (readonly)
Returns the value of attribute smoker_name.
7 8 9 |
# File 'lib/sijka/smoke.rb', line 7 def smoker_name @smoker_name end |
Instance Method Details
#smoke ⇒ Object
17 18 19 20 21 22 |
# File 'lib/sijka/smoke.rb', line 17 def smoke right_move reverse_img left_move end |