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, 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

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#pathObject

Returns the value of attribute path.



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

def path
  @path
end

#postsObject

Returns the value of attribute posts.



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

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