Class: TtySlides::SlideList

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#currentObject (readonly)

Returns the value of attribute current.



2
3
4
# File 'lib/slide_list.rb', line 2

def current
  @current
end

Instance Method Details

#nextObject



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

#previousObject



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