Class: Estatic::ProductPage
Instance Attribute Summary collapse
-
#product ⇒ Object
readonly
Returns the value of attribute product.
Attributes inherited from Page
Instance Method Summary collapse
- #filename ⇒ Object
-
#initialize(resource, product) ⇒ ProductPage
constructor
A new instance of ProductPage.
Methods inherited from Page
Constructor Details
#initialize(resource, product) ⇒ ProductPage
Returns a new instance of ProductPage.
5 6 7 8 |
# File 'lib/estatic/product_page.rb', line 5 def initialize(resource, product) super(resource) @product = product end |
Instance Attribute Details
#product ⇒ Object (readonly)
Returns the value of attribute product.
3 4 5 |
# File 'lib/estatic/product_page.rb', line 3 def product @product end |
Instance Method Details
#filename ⇒ Object
10 11 12 |
# File 'lib/estatic/product_page.rb', line 10 def filename "#{product.name.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')}.html" end |