Module: FFMPEG::TypeChecker

Defined in:
lib/ffmpeg/type_checker.rb

Overview

Since:

  • 1.0.0.beta10

Class Method Summary collapse

Class Method Details

.check(obj, klass) ⇒ Object

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


8
9
10
# File 'lib/ffmpeg/type_checker.rb', line 8

def self.check(obj, klass)
  raise ArgumentError, "Expected #{klass}, given: #{obj.class}" unless obj.is_a? klass
end