module Athena::Clock::Aware

Overview

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

Defined in:

aware.cr

Instance Method Summary

Instance Method Detail

def clock=(clock : ACLK | Nil) #

[View source]
def now : ACLK::Interface #

[View source]