Class: SlideHero::ListPoint
- Inherits:
-
Object
- Object
- SlideHero::ListPoint
- 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
-
#animation ⇒ Object
readonly
Returns the value of attribute animation.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #animation_class ⇒ Object
-
#initialize(text, options = {}) ⇒ ListPoint
constructor
A new instance of ListPoint.
- #to_s ⇒ Object
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, ={}) @text = text @animation = [:animation] end |
Instance Attribute Details
#animation ⇒ Object (readonly)
Returns the value of attribute animation.
3 4 5 |
# File 'lib/slide_hero/list_point.rb', line 3 def animation @animation end |
#text ⇒ Object (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_class ⇒ Object
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_s ⇒ Object
12 13 14 |
# File 'lib/slide_hero/list_point.rb', line 12 def to_s "<li#{animation_class}>#{text}</li>" end |