Class: Calendrier::CalendrierBuilder::Builder
- Inherits:
-
Object
- Object
- Calendrier::CalendrierBuilder::Builder
- Defined in:
- lib/calendrier/calendrier_builder.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(context, options = {}) ⇒ Builder
constructor
A new instance of Builder.
- #render(&block) ⇒ Object
Constructor Details
#initialize(context, options = {}) ⇒ Builder
Returns a new instance of Builder.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/calendrier/calendrier_builder.rb', line 5 def initialize(context, = {}) @context, @options = context, @options[:display] ||= :month unless @options.include? :title month = @options[:month] || nil year = @options[:year] || nil date = (month.nil? || year.nil?) ? Time.now.to_date : Date.new(year, month) @options[:title] = "#{I18n.l(date)}" end end |
Instance Method Details
#render(&block) ⇒ Object
17 18 19 |
# File 'lib/calendrier/calendrier_builder.rb', line 17 def render(&block) raise NotImplementedError end |