Class: Slyde::Slide
- Inherits:
-
Object
- Object
- Slyde::Slide
- Defined in:
- lib/slyde/slide.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #==(another_slide) ⇒ Object
- #id ⇒ Object
-
#initialize(attributes) ⇒ Slide
constructor
A new instance of Slide.
- #to_html ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Slide
Returns a new instance of Slide.
5 6 7 8 9 |
# File 'lib/slyde/slide.rb', line 5 def initialize(attributes) @title = attributes[:title] @body = attributes[:body] @page = attributes[:page] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/slyde/slide.rb', line 3 def body @body end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
3 4 5 |
# File 'lib/slyde/slide.rb', line 3 def page @page end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/slyde/slide.rb', line 3 def title @title end |
Instance Method Details
#==(another_slide) ⇒ Object
19 20 21 |
# File 'lib/slyde/slide.rb', line 19 def ==() id == .id end |
#id ⇒ Object
15 16 17 |
# File 'lib/slyde/slide.rb', line 15 def id title.gsub(/\W+/, "-").downcase end |
#to_html ⇒ Object
11 12 13 |
# File 'lib/slyde/slide.rb', line 11 def to_html body end |