Class: SlideHero::ListPoint

Inherits:
Object
  • Object
show all
Defined in:
lib/slide_hero/list_point.rb

Constant Summary collapse

SUPPORTED_ANIMATIONS =
%w{grow shrink roll-in fade-out 
highlight-red highlight-green highlight-blue}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, options = {}) ⇒ ListPoint

Returns a new instance of ListPoint.



7
8
9
10
# File 'lib/slide_hero/list_point.rb', line 7

def initialize(text, options={})
  @text = text
  @animation = options[:animation]
end

Instance Attribute Details

#animationObject (readonly)

Returns the value of attribute animation.



3
4
5
# File 'lib/slide_hero/list_point.rb', line 3

def animation
  @animation
end

#textObject (readonly)

Returns the value of attribute text.



3
4
5
# File 'lib/slide_hero/list_point.rb', line 3

def text
  @text
end

Instance Method Details

#animation_classObject



16
17
18
19
20
21
22
23
24
# File 'lib/slide_hero/list_point.rb', line 16

def animation_class
  if animation
    animation_markup = ' class="fragment ' 
    if SUPPORTED_ANIMATIONS.include? animation
      animation_markup << animation 
    end
    animation_markup + "\""
  end
end

#to_sObject



12
13
14
# File 'lib/slide_hero/list_point.rb', line 12

def to_s
  "<li#{animation_class}>#{text}</li>"
end