Sha256: 73fdc96ee5750037f488e484fa702085fc6c99b6e08b643241d71496651e8bfd

Contents?: true

Size: 222 Bytes

Versions: 11

Compression:

Stored size: 222 Bytes

Contents

# frozen_string_literal: true

module Kind
  module Of
    def self.call(kind, object, kind_name = nil)
      return object if kind === object

      raise Kind::Error.new(kind_name || kind.name, object)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kind-3.1.0 lib/kind/of.rb
kind-3.0.1 lib/kind/of.rb
kind-3.0.0 lib/kind/of.rb
kind-2.3.0 lib/kind/of.rb
kind-2.2.0 lib/kind/of.rb
kind-2.1.0 lib/kind/of.rb
kind-2.0.0 lib/kind/of.rb
kind-1.9.0 lib/kind/of.rb
kind-1.8.0 lib/kind/of.rb
kind-1.7.0 lib/kind/of.rb
kind-1.6.0 lib/kind/of.rb