Class: ActiveUsage::WindowStartedAt

Inherits:
Object
  • Object
show all
Defined in:
lib/active_usage/window_started_at.rb

Instance Method Summary collapse

Constructor Details

#initialize(finished_at, size) ⇒ WindowStartedAt

Returns a new instance of WindowStartedAt.



5
6
7
8
# File 'lib/active_usage/window_started_at.rb', line 5

def initialize(finished_at, size)
  @finished_at = finished_at
  @size = size
end

Instance Method Details

#callObject



10
11
12
# File 'lib/active_usage/window_started_at.rb', line 10

def call
  Time.at(epoch - (epoch % @size))
end