Class: PiSlides::Slideshow
- Inherits:
-
Object
- Object
- PiSlides::Slideshow
- Defined in:
- lib/pi_slides/slideshow.rb
Instance Attribute Summary collapse
-
#fim ⇒ Object
readonly
Returns the value of attribute fim.
-
#interval ⇒ Object
Returns the value of attribute interval.
Instance Method Summary collapse
-
#initialize(image_dir, fim, options = {}) ⇒ Slideshow
constructor
A new instance of Slideshow.
- #join ⇒ Object
- #next ⇒ Object
- #pause ⇒ Object
- #paused? ⇒ Boolean
- #play ⇒ Object
- #run ⇒ Object
- #running? ⇒ Boolean
- #stop ⇒ Object
Constructor Details
#initialize(image_dir, fim, options = {}) ⇒ Slideshow
Returns a new instance of Slideshow.
5 6 7 8 9 10 |
# File 'lib/pi_slides/slideshow.rb', line 5 def initialize(image_dir, fim, = {}) = { :interval => 30 }.merge @interval = [:interval] @image_dir = image_dir @fim = fim end |
Instance Attribute Details
#fim ⇒ Object (readonly)
Returns the value of attribute fim.
3 4 5 |
# File 'lib/pi_slides/slideshow.rb', line 3 def fim @fim end |
#interval ⇒ Object
Returns the value of attribute interval.
3 4 5 |
# File 'lib/pi_slides/slideshow.rb', line 3 def interval @interval end |
Instance Method Details
#join ⇒ Object
43 44 45 |
# File 'lib/pi_slides/slideshow.rb', line 43 def join @thread.join end |
#next ⇒ Object
31 32 33 |
# File 'lib/pi_slides/slideshow.rb', line 31 def next @skip_to_next = true end |
#pause ⇒ Object
23 24 25 |
# File 'lib/pi_slides/slideshow.rb', line 23 def pause @paused = true end |
#paused? ⇒ Boolean
35 36 37 |
# File 'lib/pi_slides/slideshow.rb', line 35 def paused? !!@paused end |
#play ⇒ Object
27 28 29 |
# File 'lib/pi_slides/slideshow.rb', line 27 def play @paused = false end |
#run ⇒ Object
51 52 53 |
# File 'lib/pi_slides/slideshow.rb', line 51 def run @thread = Thread.new{ _run } end |
#running? ⇒ Boolean
39 40 41 |
# File 'lib/pi_slides/slideshow.rb', line 39 def running? !paused? end |
#stop ⇒ Object
47 48 49 |
# File 'lib/pi_slides/slideshow.rb', line 47 def stop @stopped = true end |