Class: SocialStream::Population::Timestamps

Inherits:
Object
  • Object
show all
Defined in:
lib/social_stream/population/timestamps.rb

Constant Summary collapse

SCOPE =
1.month

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTimestamps

Returns a new instance of Timestamps.



8
9
10
11
12
13
14
15
# File 'lib/social_stream/population/timestamps.rb', line 8

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

Instance Attribute Details

#createdObject (readonly)

Returns the value of attribute created.



6
7
8
# File 'lib/social_stream/population/timestamps.rb', line 6

def created
  @created
end

#updatedObject (readonly)

Returns the value of attribute updated.



6
7
8
# File 'lib/social_stream/population/timestamps.rb', line 6

def updated
  @updated
end