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.
-
#path ⇒ Object
Returns the value of attribute path.
-
#posts ⇒ Object
Returns the value of attribute posts.
-
#slug ⇒ Object
Returns the value of attribute slug.
Instance Method Summary collapse
-
#initialize(slug, path) ⇒ Category
constructor
A new instance of Category.
Methods included from Frontable
Constructor Details
#initialize(slug, path) ⇒ Category
Returns a new instance of Category.
10 11 12 13 14 15 16 17 18 |
# File 'lib/dimples/category.rb', line 10 def initialize(slug, path) @slug = slug @path = path @name = @slug.capitalize read_with_yaml(path) @posts = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/dimples/category.rb', line 7 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/dimples/category.rb', line 6 def path @path end |
#posts ⇒ Object
Returns the value of attribute posts.
8 9 10 |
# File 'lib/dimples/category.rb', line 8 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 |