Class: Dimples::Category

Inherits:
Object
  • Object
show all
Includes:
Frontable
Defined in:
lib/dimples/category.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Frontable

#read_with_yaml

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

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/dimples/category.rb', line 6

def name
  @name
end

#postsObject

Returns the value of attribute posts.



7
8
9
# File 'lib/dimples/category.rb', line 7

def posts
  @posts
end

#slugObject

Returns the value of attribute slug.



5
6
7
# File 'lib/dimples/category.rb', line 5

def slug
  @slug
end