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.

Since:

  • 1.0.0.beta10

Class Method Summary collapse

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.

Raises:

  • (ArgumentError)

Since:

  • 1.0.0.beta10



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