Sha256: fa67641d29fcb527d28a86bc77a293dd45b59374eae40f655d35453811250e5d

Contents?: true

Size: 632 Bytes

Versions: 6

Compression:

Stored size: 632 Bytes

Contents

class Time
  # strftime() format to flatten a date
  FLAT_FORMAT = "%Y%m%d%H%M%S" unless defined?(FLAT_FORMAT)

  # Flatten
  def to_flat
    utc.strftime(FLAT_FORMAT)
  end unless method_defined?(:to_flat)
end

class DateTime < Date
  # strftime() format to flatten a date
  FLAT_FORMAT = "%Y%m%d%H%M%S" unless defined?(FLAT_FORMAT)

  # Flatten
  def to_flat
    strftime(FLAT_FORMAT)
  end unless method_defined?(:to_flat)
end

class Date
  # strftime() format to flatten a date
  FLAT_FORMAT = "%Y%m%d" unless defined?(FLAT_FORMAT)

  # Flatten
  def to_flat
    strftime(FLAT_FORMAT)
  end unless method_defined?(:to_flat)
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gorillib-0.0.7 lib/gorillib/datetime/flat.rb
gorillib-0.0.6 lib/gorillib/datetime/flat.rb
gorillib-0.0.5 lib/gorillib/datetime/flat.rb
gorillib-0.0.4 lib/gorillib/datetime/flat.rb
gorillib-0.0.3 lib/gorillib/datetime/flat.rb
gorillib-0.0.2 lib/gorillib/datetime/flat.rb