Files

Axiom::Types::ValueComparable

Add a minimum and maximum value constraint to a type

Attributes

range[R]

The range of allowed values

@return [Range]

@api public

Public Class Methods

extended(descendant) click to toggle source

Hook called when module is extended

Add minimum and maximum DSL methods to descendant.

@param [Class<Axiom::Types::Type>] descendant

@return [undefined]

@api private

# File lib/axiom/types/value_comparable.rb, line 24
def self.extended(descendant)
  super
  descendant.accept_options :minimum, :maximum
end

Public Instance Methods

finalize() click to toggle source

Finalize by setting up a value range constraint

@return [Axiom::Types::ValueComparable]

@api private

# File lib/axiom/types/value_comparable.rb, line 34
def finalize
  return self if frozen?
  @range = IceNine.deep_freeze(minimum..maximum)
  use_value_within_range
  super
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.