Module: ScreenRecorder::TypeChecker Private
- Defined in:
- lib/screen-recorder/type_checker.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
-
.check(obj, klass) ⇒ Object
private
Compares the given object’s type (class) to the desired object type.
Class Method Details
.check(obj, klass) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Compares the given object’s type (class) to the desired object type. Raises an ArgumentError if the object is not of desired type.
10 11 12 |
# File 'lib/screen-recorder/type_checker.rb', line 10 def self.check(obj, klass) raise ArgumentError, "Expected #{klass}, given: #{obj.class}" unless obj.is_a? klass end |