Class: ContentBlockTools::TimePeriod::YearsComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/content_block_tools/time_period/years_component.rb

Instance Method Summary collapse

Methods included from OverrideClasses

#font_classes, #font_size_class, #font_weight_class, #margin_classes, #padding_classes

Methods included from Govspeak

#render_govspeak

Constructor Details

#initialize(start_date:, end_date:) ⇒ YearsComponent

Returns a new instance of YearsComponent.



4
5
6
7
# File 'app/components/content_block_tools/time_period/years_component.rb', line 4

def initialize(start_date:, end_date:)
  @start_date = start_date
  @end_date = end_date
end

Instance Method Details

#renderObject



9
10
11
12
13
# File 'app/components/content_block_tools/time_period/years_component.rb', line 9

def render
  return "" unless start_date && end_date

  render_in(view_context)
end