Class: RailsCalendar::Configuration
- Inherits:
-
Object
- Object
- RailsCalendar::Configuration
- Defined in:
- lib/rails_calendar/configuration.rb
Instance Attribute Summary collapse
-
#another_month_class ⇒ Object
Returns the value of attribute another_month_class.
-
#class_prefix ⇒ Object
Returns the value of attribute class_prefix.
-
#day_cell_class ⇒ Object
Returns the value of attribute day_cell_class.
-
#day_contents_class ⇒ Object
Returns the value of attribute day_contents_class.
-
#day_name_class ⇒ Object
Returns the value of attribute day_name_class.
-
#day_number_class ⇒ Object
Returns the value of attribute day_number_class.
-
#i18n_days ⇒ Object
Returns the value of attribute i18n_days.
-
#start_of_week ⇒ Object
Returns the value of attribute start_of_week.
-
#table_class ⇒ Object
Returns the value of attribute table_class.
-
#today_class ⇒ Object
Returns the value of attribute today_class.
Instance Method Summary collapse
- #get_class(name) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset! ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 |
# File 'lib/rails_calendar/configuration.rb', line 14 def initialize reset! end |
Instance Attribute Details
#another_month_class ⇒ Object
Returns the value of attribute another_month_class.
11 12 13 |
# File 'lib/rails_calendar/configuration.rb', line 11 def another_month_class @another_month_class end |
#class_prefix ⇒ Object
Returns the value of attribute class_prefix.
3 4 5 |
# File 'lib/rails_calendar/configuration.rb', line 3 def class_prefix @class_prefix end |
#day_cell_class ⇒ Object
Returns the value of attribute day_cell_class.
7 8 9 |
# File 'lib/rails_calendar/configuration.rb', line 7 def day_cell_class @day_cell_class end |
#day_contents_class ⇒ Object
Returns the value of attribute day_contents_class.
9 10 11 |
# File 'lib/rails_calendar/configuration.rb', line 9 def day_contents_class @day_contents_class end |
#day_name_class ⇒ Object
Returns the value of attribute day_name_class.
8 9 10 |
# File 'lib/rails_calendar/configuration.rb', line 8 def day_name_class @day_name_class end |
#day_number_class ⇒ Object
Returns the value of attribute day_number_class.
6 7 8 |
# File 'lib/rails_calendar/configuration.rb', line 6 def day_number_class @day_number_class end |
#i18n_days ⇒ Object
Returns the value of attribute i18n_days.
4 5 6 |
# File 'lib/rails_calendar/configuration.rb', line 4 def i18n_days @i18n_days end |
#start_of_week ⇒ Object
Returns the value of attribute start_of_week.
12 13 14 |
# File 'lib/rails_calendar/configuration.rb', line 12 def start_of_week @start_of_week end |
#table_class ⇒ Object
Returns the value of attribute table_class.
5 6 7 |
# File 'lib/rails_calendar/configuration.rb', line 5 def table_class @table_class end |
#today_class ⇒ Object
Returns the value of attribute today_class.
10 11 12 |
# File 'lib/rails_calendar/configuration.rb', line 10 def today_class @today_class end |
Instance Method Details
#get_class(name) ⇒ Object
46 47 48 49 |
# File 'lib/rails_calendar/configuration.rb', line 46 def get_class(name) name = "#{name}_class" unless name.to_s.end_with?('_class') "#{@class_prefix}#{send(name)}" end |
#reset! ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/rails_calendar/configuration.rb', line 33 def reset! @class_prefix = 'calendar-' @i18n_days = 'date.abbr_day_names' @table_class = 'table' @day_number_class = 'day-number' @day_cell_class = 'day-cell' @day_name_class = 'day-name' @day_contents_class = 'day-contents' @today_class = 'today' @another_month_class = 'another-month' @start_of_week = :sunday end |
#to_h ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rails_calendar/configuration.rb', line 18 def to_h { class_prefix: @class_prefix, i18n_days: @i18n_days, table_class: @table_class, day_number_class: @day_number_class, day_cell_class: @day_cell_class, day_name_class: @day_name_class, day_contents_class: @day_contents_class, today_class: @today_class, another_month_class: @another_month_class, start_of_week: @start_of_week } end |