Class: Slyde::Slide

Inherits:
Object
  • Object
show all
Defined in:
lib/slyde/slide.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/slyde/slide.rb', line 3

def body
  @body
end

#pageObject (readonly)

Returns the value of attribute page.



3
4
5
# File 'lib/slyde/slide.rb', line 3

def page
  @page
end

#titleObject (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 ==(another_slide)
  id == another_slide.id
end

#idObject



15
16
17
# File 'lib/slyde/slide.rb', line 15

def id
  title.gsub(/\W+/, "-").downcase
end

#to_htmlObject



11
12
13
# File 'lib/slyde/slide.rb', line 11

def to_html
  body
end