Class: Yuzu::Filters::Category
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #blog_folder ⇒ Object
-
#initialize(name, website_file) ⇒ Category
constructor
A new instance of Category.
- #link ⇒ Object
- #path ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(name, website_file) ⇒ Category
Returns a new instance of Category.
32 33 34 35 |
# File 'lib/yuzu/filters/categories.rb', line 32 def initialize(name, website_file) @name = name.dasherize.downcase @website_file = website_file end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
30 31 32 |
# File 'lib/yuzu/filters/categories.rb', line 30 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
53 54 55 |
# File 'lib/yuzu/filters/categories.rb', line 53 def <=>(other) @name <=> other.name end |
#blog_folder ⇒ Object
49 50 51 |
# File 'lib/yuzu/filters/categories.rb', line 49 def blog_folder @website_file.blog_folder end |
#link ⇒ Object
37 38 39 |
# File 'lib/yuzu/filters/categories.rb', line 37 def link Html::Link.new(:href => url) << @name.titlecase end |
#path ⇒ Object
45 46 47 |
# File 'lib/yuzu/filters/categories.rb', line 45 def path Helpers::Path.new(blog_folder.path.name, @name) end |
#url ⇒ Object
41 42 43 |
# File 'lib/yuzu/filters/categories.rb', line 41 def url blog_folder.link_url + "/" + @name end |