Class: FistOfFury::Clock

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/fist_of_fury/clock.rb

Direct Known Subclasses

Actor::Clock

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#schedulesObject (readonly)

Returns the value of attribute schedules.



5
6
7
# File 'lib/fist_of_fury/clock.rb', line 5

def schedules
  @schedules
end

Instance Method Details

#current_timeObject



11
12
13
# File 'lib/fist_of_fury/clock.rb', line 11

def current_time
  FistOfFury.config.utc ? Time.now.utc : Time.now
end

#schedule_for(worker) ⇒ Object



7
8
9
# File 'lib/fist_of_fury/clock.rb', line 7

def schedule_for(worker)
  worker.schedule if worker.respond_to? :schedule
end