Class: ContentBlockTools::TimePeriodComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- ContentBlockTools::TimePeriodComponent
- Defined in:
- app/components/content_block_tools/time_period_component.rb
Constant Summary collapse
- SUPPORTED_FORMATS =
%w[ default long_form months_and_years_long start_day_and_month start_month_as_word years years_short ].freeze
Instance Method Summary collapse
-
#initialize(content_block:, _block_type: nil, _block_name: nil) ⇒ TimePeriodComponent
constructor
A new instance of TimePeriodComponent.
- #render ⇒ Object
Methods included from OverrideClasses
#font_classes, #font_size_class, #font_weight_class, #margin_classes, #padding_classes
Methods included from Govspeak
Constructor Details
#initialize(content_block:, _block_type: nil, _block_name: nil) ⇒ TimePeriodComponent
Returns a new instance of TimePeriodComponent.
13 14 15 16 17 |
# File 'app/components/content_block_tools/time_period_component.rb', line 13 def initialize(content_block:, _block_type: nil, _block_name: nil) @content_block = content_block @normalised_date_range = normalise_date_range validate_format! end |
Instance Method Details
#render ⇒ Object
19 20 21 |
# File 'app/components/content_block_tools/time_period_component.rb', line 19 def render format_component.render end |