Skip to content

module Athena::Clock::Aware #

Can be used to make a type time aware without having to alter its constructor.

class Example
  include Athena::Clock::Aware

  def expired?
    self.now > some_time_instance
  end
end

# By default uses an `Athena::Clock` instance
example = Example.new

# Or use a custom implementation.
custom_example = Example.new
custom_example.clock = my_clock

Methods#

#clock=(clock : ACLK | Nil)#

View source

#now : ACLK::Interface#

View source