Class: SemiStatic::Tag

Inherits:
Array
  • Object
show all
Defined in:
lib/semi-static/tags.rb

Overview

A group of posts in the site that have the same tag in their metadata.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner, name) ⇒ Tag

Initializes a new Tag



20
21
22
23
24
25
# File 'lib/semi-static/tags.rb', line 20

def initialize(owner, name)
    super()
    @name = name
    @slug = Tags.slugize name
    @uri = "#{owner.uri}#{slug}/"
end

Instance Attribute Details

#nameObject (readonly)

Display name (i.e., Semi Static)



8
9
10
# File 'lib/semi-static/tags.rb', line 8

def name
  @name
end

#slugObject (readonly)

URL-ified name (i.e., semi-static)



12
13
14
# File 'lib/semi-static/tags.rb', line 12

def slug
  @slug
end

#uriObject (readonly)

URI for the tag’s index page.



16
17
18
# File 'lib/semi-static/tags.rb', line 16

def uri
  @uri
end