Files

Axiom::Types::Hash

Represents a hash type

Public Class Methods

finalize() click to toggle source

Finalize by setting up constraints for the key and value

@return [Class<Axiom::Types::Hash>]

@api private

# File lib/axiom/types/hash.rb, line 41
def self.finalize
  return self if frozen?
  key_type.finalize
  value_type.finalize
  matches_key_and_value_types
  super
end
infer(object) click to toggle source

Infer the type of the object

@example

type = Axiom::Types.infer(object)

@param [Object] object

@return [Class<Axiom::Types::Hash>]

returned if the type matches

@return [nil]

returned if the type does not match

@api public

# File lib/axiom/types/hash.rb, line 27
def self.infer(object)
  case object
  when primitive
    infer_from_primitive_instance(object)
  else
    super
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.