Sha256: 391f46c60471a535724de4477013b002c79bd9be7bfbc308887f713f7a549ce9

Contents?: true

Size: 444 Bytes

Versions: 3

Compression:

Stored size: 444 Bytes

Contents

class ViewContext
  attr_accessor :start_date, :start_date_param

  def initialize(start_date=nil, options={})
    @start_date = start_date
    @start_date_param = options.fetch(:start_date_param, :start_date)
  end

  def params
    if @start_date.present?
      ActionController::Parameters.new({start_date_param => @start_date})
    else
      ActionController::Parameters.new
    end
  end

  def render(options = {})
    options
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
simple_calendar-2.4.1 spec/support/view_context.rb
simple_calendar-2.4.0 spec/support/view_context.rb
simple_calendar-2.3.0 spec/support/view_context.rb