Sha256: a2339fbb5cbf1229069a1dec0335f8b9811472ddf8a0b4fa24fb32e2f5123ba0

Contents?: true

Size: 629 Bytes

Versions: 66

Compression:

Stored size: 629 Bytes

Contents

class FestivityDatetimePresenter
  attr_reader :datetime

  def initialize(datetime)
    @datetime = datetime
  end

  def ==(other_object)
    @datetime == other_object.datetime
  end

  def display_as_date
    @datetime.strftime("%a, %B %-d")
  end

  def to_s
    @datetime.to_s
  end

  def to_date
    @datetime.to_date
  end

  def display_as_time_range
    "#{display_start_time} - #{display_end_time}"
  end

  def display_start_time
    @datetime.strftime(display_time_format)
  end

  def display_end_time
    (@datetime + 1.hour).strftime(display_time_format)
  end

  def display_time_format
    "%l:%M %P"
  end

end

Version data entries

66 entries across 66 versions & 1 rubygems

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