Class: SemiStatic::Tag
- Inherits:
-
Array
- Object
- Array
- SemiStatic::Tag
- 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
-
#name ⇒ Object
readonly
Display name (i.e., Semi Static).
-
#slug ⇒ Object
readonly
URL-ified name (i.e., semi-static).
-
#uri ⇒ Object
readonly
URI for the tag’s index page.
Instance Method Summary collapse
-
#initialize(owner, name) ⇒ Tag
constructor
Initializes a new Tag.
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
#name ⇒ Object (readonly)
Display name (i.e., Semi Static)
8 9 10 |
# File 'lib/semi-static/tags.rb', line 8 def name @name end |
#slug ⇒ Object (readonly)
URL-ified name (i.e., semi-static)
12 13 14 |
# File 'lib/semi-static/tags.rb', line 12 def slug @slug end |
#uri ⇒ Object (readonly)
URI for the tag’s index page.
16 17 18 |
# File 'lib/semi-static/tags.rb', line 16 def uri @uri end |