Sha256: 263bc9d6690dc2fcf810335742ba517b7380e329948fe55b8ccf62fa1387fece

Contents?: true

Size: 375 Bytes

Versions: 2

Compression:

Stored size: 375 Bytes

Contents

module TP
  class SlideDeck
    attr_accessor :cursor, :slides

    def initialize(slides)
      self.cursor = 0
      self.slides = slides
    end

    def [](index)
      slides[index]
    end

    def current
      slides[cursor]
    end

    def next
      self.cursor += 1

      current
    end

    def previous
      self.cursor -= 1

      current
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tp-0.1.1 lib/tp/slide_deck.rb
tp-0.1.0 lib/tp/slide_deck.rb