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.5.3 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.2 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.1 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.5.0 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.4.6 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.4.5 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.4.4 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.4.3 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.4.2 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.4.1 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.4.0 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.30 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.29 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.28 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.27 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.26 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.25 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.24 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.23 app/presenters/festivity_datetime_filter_presenter.rb
trusty-festivity-extension-2.3.22 app/presenters/festivity_datetime_filter_presenter.rb