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.3.21 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.20 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.19 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.18 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.17 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.16 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.15 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.14 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.13 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.12 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.11g app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.10 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.9 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.8 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.7 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.6 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.5 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.4 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.3 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.2 app/presenters/festivity_datetime_filter_presenter.rb