Class: TtySlides::SlideList
- Inherits:
-
Object
- Object
- TtySlides::SlideList
- Defined in:
- lib/slide_list.rb
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
Instance Method Summary collapse
-
#initialize(start = 0) ⇒ SlideList
constructor
A new instance of SlideList.
- #next ⇒ Object
- #previous ⇒ Object
Constructor Details
#initialize(start = 0) ⇒ SlideList
Returns a new instance of SlideList.
4 5 6 |
# File 'lib/slide_list.rb', line 4 def initialize(start = 0) @current = start - 1 end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
2 3 4 |
# File 'lib/slide_list.rb', line 2 def current @current end |
Instance Method Details
#next ⇒ Object
8 9 10 11 12 |
# File 'lib/slide_list.rb', line 8 def next @current += 1 @current = SLIDES.size - 1 if @current >= SLIDES.size BASE_PATH + "#{SLIDES[@current]}.cml" end |
#previous ⇒ Object
14 15 16 17 18 |
# File 'lib/slide_list.rb', line 14 def previous @current -= 1 @current = 0 if @current < 0 BASE_PATH + "#{SLIDES[@current]}.cml" end |