Module: Axiom::Types

Defined in:
lib/axiom/types.rb,
lib/axiom/types/set.rb,
lib/axiom/types/date.rb,
lib/axiom/types/hash.rb,
lib/axiom/types/time.rb,
lib/axiom/types/type.rb,
lib/axiom/types/array.rb,
lib/axiom/types/class.rb,
lib/axiom/types/float.rb,
lib/axiom/types/object.rb,
lib/axiom/types/string.rb,
lib/axiom/types/symbol.rb,
lib/axiom/types/boolean.rb,
lib/axiom/types/decimal.rb,
lib/axiom/types/integer.rb,
lib/axiom/types/numeric.rb,
lib/axiom/types/version.rb,
lib/axiom/types/date_time.rb,
lib/axiom/types/encodable.rb,
lib/axiom/types/collection.rb,
lib/axiom/types/support/options.rb,
lib/axiom/types/support/infinity.rb,
lib/axiom/types/value_comparable.rb,
lib/axiom/types/length_comparable.rb

Overview

Gem namespace

Defined Under Namespace

Modules: Encodable, LengthComparable, Options, ValueComparable Classes: Array, Boolean, Class, Collection, Date, DateTime, Decimal, Float, Hash, Infinity, Integer, NegativeInfinity, Numeric, Object, Set, String, Symbol, Time, Type

Constant Summary collapse

Undefined =

Represent an undefined argument

Object.new.freeze
Tautology =

A true proposition

->(_value) { true }.freeze
Contradiction =

A false proposition

->(_value) { true }.freeze
VERSION =

Gem version

'0.1.1'.freeze

Class Method Summary collapse

Class Method Details

.finalizeModule<Axiom::Types>

Finalize Axiom::Types::Type subclasses

Examples:

Axiom::Types.finalize  # => Axiom::Types

Returns:



58
59
60
61
# File 'lib/axiom/types.rb', line 58

def self.finalize
  Type.descendants.each(&:finalize)
  self
end

.infer(object) ⇒ Class<Axiom::Types::Type>

Infer the type of an object

Examples:

Axiom::Types.infer(Integer)  # => Axiom::Types::Integer

Parameters:

  • object (Object)

    object to infer the type of

Returns:



46
47
48
# File 'lib/axiom/types.rb', line 46

def self.infer(object)
  @inference_cache[object]
end