Class: Www::SaleBadgeComponent

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

Overview

ViewComponent: renders the sale badge block.

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(percentage:, size: :normal) ⇒ SaleBadgeComponent

Returns a new instance of SaleBadgeComponent.



4
5
6
7
# File 'app/components/www/sale_badge_component.rb', line 4

def initialize(percentage:, size: :normal)
  @percentage = percentage
  @size = size
end