Module: FlossFunding::Check

Defined in:
lib/floss_funding/check.rb

Overview

This module loads inside an anonymous module on Ruby 3.1+.
This is why FlossFunding herein uses top-level namespace as ::FlossFunding.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.extended(base, now = Time.now) ⇒ void

This method returns an undefined value.

When this module is extended, also extend with class-level helpers and
set the deterministic time source.

Parameters:

  • base (Module)

    the extending module

  • now (Time) (defaults to: Time.now)

    the current time (defaults to Time.now)



27
28
29
30
# File 'lib/floss_funding/check.rb', line 27

def self.extended(base, now = Time.now)
  base.extend(ClassMethods)
  ClassMethods.now_time = now
end

.included(base, now = Time.now) ⇒ void

This method returns an undefined value.

When this module is included, extend the target with class-level helpers
and set the deterministic time source (used in specs via Timecop).

Parameters:

  • base (Module)

    the including module

  • now (Time) (defaults to: Time.now)

    the current time (defaults to Time.now)



16
17
18
19
# File 'lib/floss_funding/check.rb', line 16

def self.included(base, now = Time.now)
  base.extend(ClassMethods)
  ClassMethods.now_time = now
end