Class: Eggplant::Slides

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

Instance Method Summary collapse

Constructor Details

#initialize(path, options = {}) ⇒ Slides



4
5
6
7
8
9
10
11
12
# File 'lib/eggplant/slides.rb', line 4

def initialize path, options={}
  @slides = []
  @title = nil
  Dir[path+'/**/*.md'].each do |file|
    if !(file =~ /README.md$/)
      process file, File.read(file)
    end
  end
end

Instance Method Details

#sizeObject



14
15
16
# File 'lib/eggplant/slides.rb', line 14

def size
  @slides.size
end

#to_htmlObject



18
19
20
21
22
# File 'lib/eggplant/slides.rb', line 18

def to_html
  @slides.map do |slide|
    render_slide slide[:body], slide[:options]
  end.join "\n"
end