Sha256: 2d3aef7597d784ffed07b8bf3dc5d8cfac4c3a940764aad598e89240052c3cfc

Contents?: true

Size: 397 Bytes

Versions: 25

Compression:

Stored size: 397 Bytes

Contents

module SocialStream
  module Population
    class Timestamps
      SCOPE = 1.month

      attr_reader :created, :updated

      def initialize
        created = rand(SCOPE)
        update = [ true, false ].sample
        updated = update ? rand(created) : created

        @created = Time.at(Time.now.to_i - created)
        @updated = Time.at(Time.now.to_i - updated)
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
social_stream-2.2.2 base/lib/social_stream/population/timestamps.rb
social_stream-base-2.2.2 lib/social_stream/population/timestamps.rb
social_stream-2.2.1 base/lib/social_stream/population/timestamps.rb
social_stream-base-2.2.1 lib/social_stream/population/timestamps.rb
social_stream-2.2.0 base/lib/social_stream/population/timestamps.rb
social_stream-base-2.2.0 lib/social_stream/population/timestamps.rb
social_stream-2.1.1 base/lib/social_stream/population/timestamps.rb
social_stream-2.1.0 base/lib/social_stream/population/timestamps.rb
social_stream-base-2.1.0 lib/social_stream/population/timestamps.rb
social_stream-2.0.4 base/lib/social_stream/population/timestamps.rb
social_stream-base-2.0.4 lib/social_stream/population/timestamps.rb
social_stream-2.0.3 base/lib/social_stream/population/timestamps.rb
social_stream-base-2.0.3 lib/social_stream/population/timestamps.rb
social_stream-2.0.2 base/lib/social_stream/population/timestamps.rb
social_stream-base-2.0.2 lib/social_stream/population/timestamps.rb
social_stream-2.0.1 base/lib/social_stream/population/timestamps.rb
social_stream-base-2.0.1 lib/social_stream/population/timestamps.rb
social_stream-2.0.0 base/lib/social_stream/population/timestamps.rb
social_stream-base-2.0.0 lib/social_stream/population/timestamps.rb
social_stream-2.0.0.beta3 base/lib/social_stream/population/timestamps.rb