Class: StimulusPlumbers::Components::Calendar::Turbo::MonthsOfYear
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::Calendar::Turbo::MonthsOfYear
- Defined in:
- lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb
Constant Summary collapse
- MONTHS_PER_ROW =
4- MONTH_FORMATS =
%i[narrow short long].freeze
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#selected_date ⇒ Object
readonly
Returns the value of attribute selected_date.
-
#today ⇒ Object
readonly
Returns the value of attribute today.
Attributes inherited from Plumber::Base
Instance Method Summary collapse
-
#initialize(template, date: Date.today, today: Date.today, selected_date: nil, format: :short) ⇒ MonthsOfYear
constructor
A new instance of MonthsOfYear.
- #render ⇒ Object
Methods inherited from Plumber::Base
Methods included from Plumber::Renderer
#set_slots, #slot_block_for, #slot_kwargs_for, #slot_renderable?
Methods included from Plumber::Options::Aria
Methods included from Plumber::Options::Html
Constructor Details
#initialize(template, date: Date.today, today: Date.today, selected_date: nil, format: :short) ⇒ MonthsOfYear
Returns a new instance of MonthsOfYear.
13 14 15 16 17 18 19 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 13 def initialize(template, date: Date.today, today: Date.today, selected_date: nil, format: :short) super(template) @date = date @today = today @selected_date = selected_date @format = format end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
11 12 13 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 11 def date @date end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
11 12 13 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 11 def format @format end |
#selected_date ⇒ Object (readonly)
Returns the value of attribute selected_date.
11 12 13 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 11 def selected_date @selected_date end |
#today ⇒ Object (readonly)
Returns the value of attribute today.
11 12 13 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 11 def today @today end |
Instance Method Details
#render ⇒ Object
21 22 23 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 21 def render(...) render_months_of_year(...) end |