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-base-2.0.0.beta3 lib/social_stream/population/timestamps.rb
social_stream-2.0.0.beta2 base/lib/social_stream/population/timestamps.rb
social_stream-base-2.0.0.beta2 lib/social_stream/population/timestamps.rb
social_stream-2.0.0.beta1 base/lib/social_stream/population/timestamps.rb
social_stream-base-2.0.0.beta1 lib/social_stream/population/timestamps.rb