Sha256: 39a5011837f9382b5c7baab742904e8f2397c83d0826512129f6587b2efede16

Contents?: true

Size: 383 Bytes

Versions: 21

Compression:

Stored size: 383 Bytes

Contents

# typed: strict
# frozen_string_literal: true

module DearInventory
  module IsASubclass
    extend T::Sig

    sig { params(comparison_class: T.untyped).returns(T::Boolean) }
    def is_a?(comparison_class)
      return true if super

      if T.unsafe(self).class == Class
        return T.unsafe(self).ancestors.include?(comparison_class)
      end

      false
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
dear_inventory-1.4.0 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-1.3.0 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-1.2.0 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-1.1.1 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-1.1.0 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-1.0.0 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.7.5 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.7.4 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.7.3 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.7.2 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.7.1 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.7.0 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.6.3 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.6.2 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.6.1 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.6.0 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.5.0 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.4.1 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.4.0 lib/dear_inventory/lib/is_a_subclass.rb
dear_inventory-0.3.0 lib/dear_inventory/lib/is_a_subclass.rb