Class: StimulusPlumbers::Components::Calendar::Turbo::YearsOfDecade

Inherits:
Plumber::Base
  • Object
show all
Defined in:
lib/stimulus_plumbers/components/calendar/turbo/years_of_decade.rb

Constant Summary collapse

YEARS_PER_ROW =
4
DECADE_SIZE =
10

Instance Attribute Summary collapse

Attributes inherited from Plumber::Base

#template

Instance Method Summary collapse

Methods inherited from Plumber::Base

#theme

Methods included from Plumber::Renderer

#set_slots, #slot_block_for, #slot_kwargs_for, #slot_renderable?

Methods included from Plumber::Options::Aria

#labelled_aria

Methods included from Plumber::Options::Html

#merge_html_options

Constructor Details

#initialize(template, date: Date.today, today: Date.today, selected_date: nil) ⇒ YearsOfDecade

Returns a new instance of YearsOfDecade.



13
14
15
16
17
18
# File 'lib/stimulus_plumbers/components/calendar/turbo/years_of_decade.rb', line 13

def initialize(template, date: Date.today, today: Date.today, selected_date: nil)
  super(template)
  @date          = date
  @today         = today
  @selected_date = selected_date
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



11
12
13
# File 'lib/stimulus_plumbers/components/calendar/turbo/years_of_decade.rb', line 11

def date
  @date
end

#selected_dateObject (readonly)

Returns the value of attribute selected_date.



11
12
13
# File 'lib/stimulus_plumbers/components/calendar/turbo/years_of_decade.rb', line 11

def selected_date
  @selected_date
end

#todayObject (readonly)

Returns the value of attribute today.



11
12
13
# File 'lib/stimulus_plumbers/components/calendar/turbo/years_of_decade.rb', line 11

def today
  @today
end

Instance Method Details

#renderObject



20
21
22
# File 'lib/stimulus_plumbers/components/calendar/turbo/years_of_decade.rb', line 20

def render(...)
  render_years_of_decade(...)
end