Class: BootstrapCalendarRails::ViewHelpers::BootstrapCalendar
- Inherits:
-
Object
- Object
- BootstrapCalendarRails::ViewHelpers::BootstrapCalendar
- Defined in:
- lib/bootstrap_calendar_rails/view_helper.rb
Constant Summary collapse
- DAY_NAMES =
%w[Sunday Monday Tuesday Wednesday Thursday Friday Saturday]
- MOBILE_DAY_NAMES =
%w[Sun Mon Tues Wed Thur Fri Sat]
Instance Attribute Summary collapse
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#view ⇒ Object
readonly
Returns the value of attribute view.
Instance Method Summary collapse
-
#build ⇒ Object
build calendar.
-
#initialize(view, date, options = {}, callback) ⇒ BootstrapCalendar
constructor
you can pass some extra options in “options” parameter.
Constructor Details
#initialize(view, date, options = {}, callback) ⇒ BootstrapCalendar
you can pass some extra options in “options” parameter
28 29 30 31 32 33 |
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 28 def initialize(view, date, = {}, callback) @view = view @date = date @options = .symbolize_keys @callback = callback end |
Instance Attribute Details
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
17 18 19 |
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 17 def callback @callback end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
17 18 19 |
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 17 def date @date end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
17 18 19 |
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 17 def @options end |
#view ⇒ Object (readonly)
Returns the value of attribute view.
17 18 19 |
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 17 def view @view end |
Instance Method Details
#build ⇒ Object
build calendar
20 21 22 23 24 25 |
# File 'lib/bootstrap_calendar_rails/view_helper.rb', line 20 def build result = content_tag :div, class: 'cal-month-box' do week_rows end header << result end |