Sha256: 0f68d93762c3066fe424bda8dedf1b1c8f7e4a94a70d589721bdf854a9378a21

Contents?: true

Size: 436 Bytes

Versions: 66

Compression:

Stored size: 436 Bytes

Contents

class FestivityDatetimeFilterPresenter

  def self.new(datetimes, datetime_type)
    datetimes.map { |datetime| datetime_type_class(datetime_type).new(datetime) }

  end

  def self.parse(datetimes, datetime_type)
    self.new(datetimes.map{|date| Chronic.parse(date)}, datetime_type)
  end

  private

  def self.datetime_type_class(datetime_type)
   datetime_type == "date" ? FestivityDatePresenter : FestivityTimePresenter
  end

end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.6.3 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.6.2 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.6.1 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.6 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.19 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.18 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.17 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.16 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.15 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.14 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.13 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.12 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.11 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.10 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.9 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.8 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.7 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.6 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.5 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.4 app/presenters/festivity_datetime_filter_presenter.rb