Class: Tag
- Inherits:
-
Zarchitect
- Object
- Zarchitect
- Tag
- Defined in:
- lib/zarchitect/tag.rb
Constant Summary
Constants inherited from Zarchitect
Zarchitect::ASSETDIR, Zarchitect::ASSETSDIR, Zarchitect::BUILDIR, Zarchitect::CONFIGDIR, Zarchitect::DEBUGSDIR, Zarchitect::DRAFTDIR, Zarchitect::FILEDIR, Zarchitect::FILESDIR, Zarchitect::HTMLDIR, Zarchitect::LAYOUTDIR, Zarchitect::NODEDIR, Zarchitect::SHARESDIR, Zarchitect::VERSION
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#index ⇒ Object
Returns the value of attribute index.
-
#key ⇒ Object
Returns the value of attribute key.
-
#name ⇒ Object
Returns the value of attribute name.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #build_html ⇒ Object
-
#initialize(str, cat) ⇒ Tag
constructor
A new instance of Tag.
- #posts ⇒ Object
- #write_html ⇒ Object
Methods inherited from Zarchitect
Constructor Details
#initialize(str, cat) ⇒ Tag
Returns a new instance of Tag.
4 5 6 7 8 9 10 11 |
# File 'lib/zarchitect/tag.rb', line 4 def initialize(str, cat) @category = cat @name = str set_key @url = "/#{@category.section.key}/#{@category.key}/#{@key}/index.html" create_dir setup_index end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
2 3 4 |
# File 'lib/zarchitect/tag.rb', line 2 def category @category end |
#index ⇒ Object
Returns the value of attribute index.
2 3 4 |
# File 'lib/zarchitect/tag.rb', line 2 def index @index end |
#key ⇒ Object
Returns the value of attribute key.
2 3 4 |
# File 'lib/zarchitect/tag.rb', line 2 def key @key end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/zarchitect/tag.rb', line 2 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/zarchitect/tag.rb', line 2 def url @url end |
Instance Method Details
#build_html ⇒ Object
19 20 21 |
# File 'lib/zarchitect/tag.rb', line 19 def build_html @index.build_html end |
#posts ⇒ Object
13 14 15 16 17 |
# File 'lib/zarchitect/tag.rb', line 13 def posts @category.section.posts.select do |p| ((p.category == @category) && (p..include?(@name))) end end |
#write_html ⇒ Object
23 24 25 |
# File 'lib/zarchitect/tag.rb', line 23 def write_html @index.write_html end |