Class: Workarea::Metadata::CatalogCategory

Inherits:
Workarea::Metadata show all
Defined in:
app/queries/workarea/metadata/catalog_category.rb

Instance Attribute Summary

Attributes inherited from Workarea::Metadata

#content, #model

Instance Method Summary collapse

Methods inherited from Workarea::Metadata

automation_klass, #initialize, model_name, update, #update

Constructor Details

This class inherits a constructor from Workarea::Metadata

Instance Method Details

#descriptionString

Provides a default value for use as the html content meta tag using the top selling sub-categories (based on navigation structure)

Examples:

Top selling categories

Shop Men for a great selection including Shirts, Pants,
Suits, and Coats

Returns:



28
29
30
31
32
33
34
35
36
37
# File 'app/queries/workarea/metadata/catalog_category.rb', line 28

def description
  if top_taxons.present?
    description = [
      I18n.t('workarea.metadata.shop_selection', name: model.name)
    ]

    description << top_taxons.map(&:name).to_sentence
    description.join(' ')
  end
end

#titleString

Provides a default value for use as the html page title using the name of the category and its top selling sub-categories

Examples:

Top selling categories

Men: Shirts, Pants, Suits, and Coats

Returns:



12
13
14
15
16
# File 'app/queries/workarea/metadata/catalog_category.rb', line 12

def title
  if top_taxons.present?
    "#{model.name}: #{top_taxons.map(&:name).to_sentence}"
  end
end