Sha256: 79fcb15dc1d9f16059d44a647b0df5a8caa408b6f4dede473bf1447c282677ac
Contents?: true
Size: 439 Bytes
Versions: 6
Compression:
Stored size: 439 Bytes
Contents
module Teacup module_function def to_instance(class_or_instance) if class_or_instance.is_a? Class unless class_or_instance <= UIView raise "Expected subclass of UIView, got: #{class_or_instance.inspect}" end return class_or_instance.new elsif class_or_instance.is_a?(UIView) return class_or_instance else raise "Expected a UIView, got: #{class_or_instance.inspect}" end end end
Version data entries
6 entries across 6 versions & 1 rubygems