Class: Object

Inherits:
BasicObject
Defined in:
lib/moo/core_ext/object.rb

Instance Method Summary collapse

Instance Method Details

#complain_if_not_a(klass, error = ArgumentError) ⇒ Object



2
3
4
5
6
# File 'lib/moo/core_ext/object.rb', line 2

def complain_if_not_a(klass, error = ArgumentError)
  unless self.is_a? klass
    raise error, "Expected instance of '#{klass.to_s}', got a '#{self.class}'"
  end
end