Sha256: 5f25fa0b0b5056bb1aa84b3051fefefed6034d1bf32871fc475bf7efc0a86ceb

Contents?: true

Size: 397 Bytes

Versions: 4

Compression:

Stored size: 397 Bytes

Contents

# frozen_string_literal: true

module Kind
  module Is
    def self.call(expected, value)
      expected_mod = Kind::Of.Module(expected)
      mod = Kind::Of.Module(value)

      mod <= expected_mod || false
    end

    def self.Class(value)
      value.is_a?(::Class)
    end

    def self.Module(value)
      value == ::Module || (value.is_a?(::Module) && !self.Class(value))
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kind-1.5.0 lib/kind/is.rb
kind-1.4.0 lib/kind/is.rb
kind-1.3.0 lib/kind/is.rb
kind-1.2.0 lib/kind/is.rb