Class: Yuzu::Filters::Category

Inherits:
Object
  • Object
show all
Defined in:
lib/yuzu/filters/categories.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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_folderObject



49
50
51
# File 'lib/yuzu/filters/categories.rb', line 49

def blog_folder
  @website_file.blog_folder
end


37
38
39
# File 'lib/yuzu/filters/categories.rb', line 37

def link
  Html::Link.new(:href => url) << @name.titlecase
end

#pathObject



45
46
47
# File 'lib/yuzu/filters/categories.rb', line 45

def path
  Helpers::Path.new(blog_folder.path.name, @name)
end

#urlObject



41
42
43
# File 'lib/yuzu/filters/categories.rb', line 41

def url
  blog_folder.link_url + "/" + @name
end