Sha256: 297b8b363325760157043017c60a1af8c10f47f9343c01d00f77a5c8e1ec7c0f

Contents?: true

Size: 561 Bytes

Versions: 32

Compression:

Stored size: 561 Bytes

Contents

module Fog
  class Time < ::Time

    DAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
    MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']

    def self.now
      at((::Time.now - offset).to_i)
    end

    def self.now=(new_now)
      old_now = ::Time.now
      @offset = old_now - new_now
      new_now
    end

    def self.offset
      @offset ||= 0
    end

    def to_date_header
      self.utc.strftime("#{DAYS[self.utc.wday]}, %d #{MONTHS[self.utc.month - 1]} %Y %H:%M:%S +0000")
    end

  end
end

Version data entries

32 entries across 32 versions & 8 rubygems

Version Path
fog-1.5.0 lib/fog/core/time.rb
rackspace-fog-1.4.2 lib/rackspace-fog/core/time.rb
fog-1.4.0 lib/fog/core/time.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/core/time.rb
michiels-fog-1.3.1 lib/fog/core/time.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/core/time.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/core/time.rb
fog-1.3.1 lib/fog/core/time.rb
fog-1.3.0 lib/fog/core/time.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/core/time.rb
fog-1.2.0 lib/fog/core/time.rb
ktheory-fog-1.1.2 lib/fog/core/time.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/core/time.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/core/time.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/core/time.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/core/time.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/core/time.rb
fog-1.1.2 lib/fog/core/time.rb
fog_tractical-1.1.4 lib/fog/core/time.rb
fog_tractical-1.1.3 lib/fog/core/time.rb