Class: StimulusPlumbers::Components::Calendar::Turbo::DaysOfMonth

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

Constant Summary collapse

DAYS_IN_WEEK =
7

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, selectable: false, selected_date: nil, show_other_months: false) ⇒ DaysOfMonth

Returns a new instance of DaysOfMonth.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/stimulus_plumbers/components/calendar/turbo/days_of_month.rb', line 12

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

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



10
11
12
# File 'lib/stimulus_plumbers/components/calendar/turbo/days_of_month.rb', line 10

def date
  @date
end

#selectableObject (readonly)

Returns the value of attribute selectable.



10
11
12
# File 'lib/stimulus_plumbers/components/calendar/turbo/days_of_month.rb', line 10

def selectable
  @selectable
end

#selected_dateObject (readonly)

Returns the value of attribute selected_date.



10
11
12
# File 'lib/stimulus_plumbers/components/calendar/turbo/days_of_month.rb', line 10

def selected_date
  @selected_date
end

#show_other_monthsObject (readonly)

Returns the value of attribute show_other_months.



10
11
12
# File 'lib/stimulus_plumbers/components/calendar/turbo/days_of_month.rb', line 10

def show_other_months
  @show_other_months
end

#todayObject (readonly)

Returns the value of attribute today.



10
11
12
# File 'lib/stimulus_plumbers/components/calendar/turbo/days_of_month.rb', line 10

def today
  @today
end

Instance Method Details

#renderObject



28
29
30
# File 'lib/stimulus_plumbers/components/calendar/turbo/days_of_month.rb', line 28

def render(...)
  render_days_of_month(...)
end