class SlideHero::List

Attributes

style[R]

Public Class Methods

new(style=:unordered, &block) click to toggle source
# File lib/slide_hero/list.rb, line 5
def initialize(style=:unordered, &block)
  @style = style
  instance_eval(&block)
end

Public Instance Methods

compile() click to toggle source
# File lib/slide_hero/list.rb, line 10
def compile
  if style == :unordered
    Tilt::ERBTemplate.new(
    File.join(SlideHero.template_path, 'lib/slide_hero/views/unordered_list.html.erb')).
    render(self).strip
  else
    Tilt::ERBTemplate.new(
    File.join(SlideHero.template_path, 'lib/slide_hero/views/ordered_list.html.erb')).
    render(self).strip
  end
end
list(style=:unordered, &block) click to toggle source
# File lib/slide_hero/list.rb, line 26
def list(style=:unordered, &block)
  points << List.new(style, &block).compile
end
point(text, animation: nil) click to toggle source
# File lib/slide_hero/list.rb, line 22
def point(text, animation: nil)
  points << ListPoint.new(text, { animation: animation })
end
points() click to toggle source
# File lib/slide_hero/list.rb, line 30
def points
  @points ||= []
end