Created
May 19, 2009 20:32
-
-
Save bdarcus/114375 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Presentation | |
attr_accessor :description, :date, :location, :slides | |
def initialize(description = nil, date = nil, location = nil, slides = nil) | |
@description = description | |
@date = date | |
@location = location | |
@slides = slides | |
end | |
end | |
class SlideShow | |
attr_accessor :title, :subtitle, :slides | |
def initialize(title, subtitle = nil) | |
@title = title | |
@subtitle = subtitle | |
@slides = [] | |
end | |
def add_slide(slide) | |
@slides << slide | |
end | |
end | |
class Slide | |
attr_accessor :heading, :type, :items, :image | |
def initialize(heading, items = nil, type = 'default', image = nil) | |
@heading = heading | |
@type = type | |
@items = items | |
@image = image | |
end | |
def to_html | |
puts '<li class="slide">' | |
puts ' <h1>' + @heading + '</h1>' | |
puts ' <ul>' | |
bullets.each {|b| puts ' <li>' + b + '</li>'} | |
puts ' </ul>' | |
puts '</li>' | |
end | |
end | |
class Item | |
attr_accessor :body, :type, :children | |
def initialize(body, type= = 'unordered', children = nil) | |
@body = body | |
@type = type | |
@children = [] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment