Class: Calendrier::CalendrierBuilder::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/calendrier/calendrier_builder.rb

Direct Known Subclasses

SimpleBuilder

Instance Method Summary collapse

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, options = {})
  @context, @options = context, options
  @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

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/calendrier/calendrier_builder.rb', line 17

def render(&block)
  raise NotImplementedError
end