Skip to content

Instantly share code, notes, and snippets.

@bdarcus
Created May 19, 2009 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdarcus/114375 to your computer and use it in GitHub Desktop.
Save bdarcus/114375 to your computer and use it in GitHub Desktop.
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