Class: Www::ProductCategoryCardsComponent

Inherits:
ApplicationComponent show all
Defined in:
app/components/www/product_category_cards_component.rb

Constant Summary collapse

DEFAULT_ICON =
'box-open'

Instance Method Summary collapse

Methods inherited from ApplicationComponent

#cms_link, #fetch_or_fallback, #image_asset_tag, #image_tag, #number_to_currency, #number_with_delimiter, #post_path, #post_url, #strip_tags

Constructor Details

#initialize(section_title: nil, section_icon: nil, description: nil, categories: [], border: nil) ⇒ ProductCategoryCardsComponent

Returns a new instance of ProductCategoryCardsComponent.

Parameters:

  • border (Symbol, nil) (defaults to: nil)

    Border style: :top, :bottom, or :both

  • section_title (Object, nil) (defaults to: nil)
  • section_icon (String, nil) (defaults to: nil)

    Font Awesome icon name (defaults to 'box-open')

  • description (Object, nil) (defaults to: nil)
  • categories (Array<Object>) (defaults to: [])


11
12
13
14
15
16
17
18
# File 'app/components/www/product_category_cards_component.rb', line 11

def initialize(section_title: nil, section_icon: nil, description: nil, categories: [], border: nil)
  super()
  @section_title = section_title
  @section_icon = section_icon || DEFAULT_ICON
  @description = description
  @categories = Array(categories)
  @border = border
end