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
- YEAR_SIZE =
12- MONTHS_PER_ROW =
4- MONTH_FORMATS =
%i[narrow short long].freeze
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#disabled_months ⇒ Object
readonly
Returns the value of attribute disabled_months.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#selected_date ⇒ Object
readonly
Returns the value of attribute selected_date.
-
#since ⇒ Object
readonly
Returns the value of attribute since.
-
#till ⇒ Object
readonly
Returns the value of attribute till.
-
#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, since: nil, till: nil, disabled_months: []) ⇒ 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, since: nil, till: nil, disabled_months: []) ⇒ MonthsOfYear
Returns a new instance of MonthsOfYear.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 14 def initialize( template, date: Date.today, today: Date.today, selected_date: nil, format: :short, since: nil, till: nil, disabled_months: [] ) super(template) @date = date @today = today @selected_date = selected_date @format = format @since = since @till = till @disabled_months = disabled_months end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
12 13 14 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 12 def date @date end |
#disabled_months ⇒ Object (readonly)
Returns the value of attribute disabled_months.
12 13 14 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 12 def disabled_months @disabled_months end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
12 13 14 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 12 def format @format end |
#selected_date ⇒ Object (readonly)
Returns the value of attribute selected_date.
12 13 14 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 12 def selected_date @selected_date end |
#since ⇒ Object (readonly)
Returns the value of attribute since.
12 13 14 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 12 def since @since end |
#till ⇒ Object (readonly)
Returns the value of attribute till.
12 13 14 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 12 def till @till end |
#today ⇒ Object (readonly)
Returns the value of attribute today.
12 13 14 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 12 def today @today end |
Instance Method Details
#render ⇒ Object
34 35 36 |
# File 'lib/stimulus_plumbers/components/calendar/turbo/months_of_year.rb', line 34 def render(...) render_months_of_year(...) end |