Class: Webdrone::Mark
- Inherits:
-
Object
- Object
- Webdrone::Mark
- Defined in:
- lib/webdrone/logg.rb,
lib/webdrone/mark.rb
Instance Attribute Summary collapse
-
#a0 ⇒ Object
Returns the value of attribute a0.
-
#default_sleep ⇒ Object
Returns the value of attribute default_sleep.
-
#default_times ⇒ Object
Returns the value of attribute default_times.
Instance Method Summary collapse
-
#initialize(a0) ⇒ Mark
constructor
A new instance of Mark.
- #mark_item(item, color: '#af1616', times: nil, sleep: nil, shot: nil, text: nil) ⇒ Object
Constructor Details
#initialize(a0) ⇒ Mark
Returns a new instance of Mark.
11 12 13 14 15 |
# File 'lib/webdrone/mark.rb', line 11 def initialize(a0) @a0 = a0 @default_times = ENV['WEBDRONE_MARK_TIMES'] || 3 @default_sleep = ENV['WEBDRONE_MARK_SLEEP'] || 0.05 end |
Instance Attribute Details
#a0 ⇒ Object
Returns the value of attribute a0.
9 10 11 |
# File 'lib/webdrone/mark.rb', line 9 def a0 @a0 end |
#default_sleep ⇒ Object
Returns the value of attribute default_sleep.
9 10 11 |
# File 'lib/webdrone/mark.rb', line 9 def default_sleep @default_sleep end |
#default_times ⇒ Object
Returns the value of attribute default_times.
9 10 11 |
# File 'lib/webdrone/mark.rb', line 9 def default_times @default_times end |
Instance Method Details
#mark_item(item, color: '#af1616', times: nil, sleep: nil, shot: nil, text: nil) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/webdrone/mark.rb', line 32 def mark_item(item, color: '#af1616', times: nil, sleep: nil, shot: nil, text: nil) times ||= @default_times sleep ||= @default_sleep times.times do mark_item_border item, 'white' sleep sleep mark_item_border item, 'black' sleep sleep mark_item_border item, color sleep sleep end @a0.shot.screen shot.is_a?(String) ? shot : text if shot item end |