Class: ContentBlockTools::TimePeriod::YearsShortComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- ContentBlockTools::TimePeriod::YearsShortComponent
- Defined in:
- app/components/content_block_tools/time_period/years_short_component.rb
Instance Method Summary collapse
-
#initialize(start_date:, end_date:) ⇒ YearsShortComponent
constructor
A new instance of YearsShortComponent.
- #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(start_date:, end_date:) ⇒ YearsShortComponent
Returns a new instance of YearsShortComponent.
4 5 6 7 |
# File 'app/components/content_block_tools/time_period/years_short_component.rb', line 4 def initialize(start_date:, end_date:) @start_date = start_date @end_date = end_date end |
Instance Method Details
#render ⇒ Object
9 10 11 12 13 |
# File 'app/components/content_block_tools/time_period/years_short_component.rb', line 9 def render return "" unless start_date && end_date render_in(view_context) end |