Module: FFMPEG::TypeChecker
- Defined in:
- lib/ffmpeg/type_checker.rb
Overview
Class Method Summary collapse
-
.check(obj, klass) ⇒ Object
Compares the given object’s type (class) to the desired object type.
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.
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 |