class Estatic::Subcategory
Attributes
category_name[R]
products[R]
Public Class Methods
new(name, category_name)
click to toggle source
Calls superclass method
Estatic::Resource::new
# File lib/estatic/subcategory.rb, line 5 def initialize(name, category_name) super(name) @category_name = category_name @products = get_products end
Public Instance Methods
directory()
click to toggle source
# File lib/estatic/subcategory.rb, line 20 def directory File.join(Estatic.configuration.estatic_site_path, category_name, name) end
get_products()
click to toggle source
# File lib/estatic/subcategory.rb, line 15 def get_products products = CSVParser.parse(name) products.map { |attributes| OpenStruct.new product(attributes) } end
has_subcategories?()
click to toggle source
# File lib/estatic/subcategory.rb, line 11 def has_subcategories? false end
root_path()
click to toggle source
# File lib/estatic/subcategory.rb, line 24 def root_path '../../'.freeze end