Class: Www::ShowcaseGridComponent

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

Constant Summary collapse

DEFAULT_ICON =
'images'

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:, showcases:, section_icon: nil, description: nil, view_more_title: nil, view_more_href: nil, col_size: 'col-12 col-sm-4 col-lg-3 mb-4', border: nil) ⇒ ShowcaseGridComponent

Returns a new instance of ShowcaseGridComponent.

Parameters:

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

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

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

    Font Awesome icon name (defaults to 'images')

  • showcases (Object)
  • description (Object, nil) (defaults to: nil)
  • view_more_title (Object, nil) (defaults to: nil)
  • view_more_href (Object, nil) (defaults to: nil)
  • col_size (String) (defaults to: 'col-12 col-sm-4 col-lg-3 mb-4')


14
15
16
17
18
19
20
21
22
23
24
# File 'app/components/www/showcase_grid_component.rb', line 14

def initialize(section_title:, showcases:, section_icon: nil, description: nil, view_more_title: nil, view_more_href: nil, col_size: 'col-12 col-sm-4 col-lg-3 mb-4', border: nil)
  super()
  @section_title = section_title
  @section_icon = section_icon || DEFAULT_ICON
  @showcases = showcases
  @description = description
  @view_more_title = view_more_title
  @view_more_href = view_more_href
  @col_size = col_size
  @border = border
end