Sha256: 15a49ac623c5e1ccd6ed31adc1d0156676cd6a9143d034baa99dd1c40cb2a598

Contents?: true

Size: 951 Bytes

Versions: 1

Compression:

Stored size: 951 Bytes

Contents

require 'recursive-open-struct'
require 'active_support/all'

require 'identity_parade/version'
require 'identity_parade/match'
require 'identity_parade/matcher'
require 'identity_parade/matchers/hash_matcher'
require 'identity_parade/matchers/string_matcher'
require 'identity_parade/matchers/array_matcher'
require 'identity_parade/matchers/numeric_matcher'
require 'identity_parade/matchers/integer_matcher'
require 'identity_parade/matchers/float_matcher'

# This gem allows to compare two types.
module IdentityParade
  class << self
    # :reek;Attribute because we want to share the config
    def config
      @config ||= RecursiveOpenStruct.new
    end

    def configure
      yield(config)
    end
  end

  module_function

  def match(left, right)
    IdentityParade::Match.new(left, right).score
  end

  def match?(left, right)
    match(left, right) >= IdentityParade.config.match_score
  end
end

require 'identity_parade/initializer'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
identity_parade-0.1.0 lib/identity_parade.rb