Sha256: acf666a0a0ac889b470034a712a96215917795968706d37a021489f3ef2efe54

Contents?: true

Size: 290 Bytes

Versions: 4

Compression:

Stored size: 290 Bytes

Contents

# frozen_string_literal: true

module Kind
  module Checker
    def class?(value)
      Kind::Is.(__kind, value)
    end

    def instance?(value)
      value.is_a?(__kind)
    end

    def or_nil(value)
      return value if instance?(value)
    end
  end

  private_constant :Checker
end

Version data entries

4 entries across 4 versions & 1 rubygems

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