Class: Dimples::Category
- Inherits:
-
Object
- Object
- Dimples::Category
- Includes:
- Frontable
- Defined in:
- lib/dimples/category.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#posts ⇒ Object
Returns the value of attribute posts.
-
#slug ⇒ Object
Returns the value of attribute slug.
Instance Method Summary collapse
-
#initialize(slug, name = nil) ⇒ Category
constructor
A new instance of Category.
Methods included from Frontable
Constructor Details
#initialize(slug, name = nil) ⇒ Category
Returns a new instance of Category.
9 10 11 12 13 14 |
# File 'lib/dimples/category.rb', line 9 def initialize(slug, name = nil) @slug = slug @name = name || @slug.capitalize @posts = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/dimples/category.rb', line 6 def name @name end |
#posts ⇒ Object
Returns the value of attribute posts.
7 8 9 |
# File 'lib/dimples/category.rb', line 7 def posts @posts end |
#slug ⇒ Object
Returns the value of attribute slug.
5 6 7 |
# File 'lib/dimples/category.rb', line 5 def slug @slug end |