Method: Brine::TypeChecking::TypeChecks#initialize

Defined in:
lib/brine/type_checking.rb

#initialize(map = {Object: be_a_kind_of(Hash), String: be_a_kind_of(String), Number: be_a_kind_of(Numeric), Integer: be_a_kind_of(Integer), Array: be_a_kind_of(Array), DateTime: be_a_kind_of(Time), Boolean: satisfy{|it| it == true || it == false } }) ⇒ TypeChecks

Initialize an instance with default checks or those provided.

Parameters:

  • Provide (Hash<String, Matcher>)

    a hash of Matchers by type, where the Matcher value will be used as the Matcher for the specified type. It is expected that no map will be provided and the default mapping will therefore be used.



30
31
32
33
34
35
36
37
38
# File 'lib/brine/type_checking.rb', line 30

def initialize(map={Object: be_a_kind_of(Hash),
                    String: be_a_kind_of(String),
                    Number: be_a_kind_of(Numeric),
                    Integer: be_a_kind_of(Integer),
                    Array: be_a_kind_of(Array),
                    DateTime: be_a_kind_of(Time),
                    Boolean: satisfy{|it| it == true || it == false } })
  @map = map
end