Module: DearInventory::IsASubclass

Extended by:
T::Sig
Included in:
Model, Parameters, Resource, Response, TestResponse
Defined in:
lib/dear_inventory/lib/is_a_subclass.rb

Instance Method Summary collapse

Instance Method Details

#is_a?(comparison_class) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
17
# File 'lib/dear_inventory/lib/is_a_subclass.rb', line 9

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