Class: Www::FeatureListComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Www::FeatureListComponent
- Includes:
- IconHelper
- Defined in:
- app/components/www/feature_list_component.rb
Constant Summary collapse
- DEFAULT_ICON =
'list-check'
Constants included from IconHelper
IconHelper::CUSTOM_ICON_MAP, IconHelper::CUSTOM_SVG_DIR, IconHelper::DEFAULT_FAMILY
Instance Method Summary collapse
- #border_classes ⇒ Object
-
#initialize(features:, extra_classes: nil, columns: 2, section_title: nil, section_icon: nil, section_description: nil, section_link: nil, section_link_title: nil, show_learn_more: false, stacked: false, border: nil) ⇒ FeatureListComponent
constructor
A new instance of FeatureListComponent.
Methods included from IconHelper
#account_nav_icon, #fa_icon, #star_rating_html
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(features:, extra_classes: nil, columns: 2, section_title: nil, section_icon: nil, section_description: nil, section_link: nil, section_link_title: nil, show_learn_more: false, stacked: false, border: nil) ⇒ FeatureListComponent
Returns a new instance of FeatureListComponent.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/components/www/feature_list_component.rb', line 19 def initialize(features:, extra_classes: nil, columns: 2, section_title: nil, section_icon: nil, section_description: nil, section_link: nil, section_link_title: nil, show_learn_more: false, stacked: false, border: nil) super() @features = features @extra_classes = extra_classes @columns = columns @section_title = section_title @section_icon = section_icon || DEFAULT_ICON @section_description = section_description @section_link = section_link @section_link_title = section_link_title @show_learn_more = show_learn_more @stacked = stacked @border = border end |
Instance Method Details
#border_classes ⇒ Object
34 35 36 37 38 39 40 |
# File 'app/components/www/feature_list_component.rb', line 34 def border_classes case @border when :top then 'border-top' when :bottom then 'border-bottom' when :both then 'border-top border-bottom' end end |