Class: Object

Inherits:
BasicObject
Defined in:
lib/array_model.rb

Instance Method Summary collapse

Instance Method Details

#is_a!(t, name = nil) ⇒ Object


159
160
161
162
163
164
165
166
167
# File 'lib/array_model.rb', line 159

def is_a!(t, name = nil)
	if !is_a? t
		if name.nil?
			raise "expected #{t} but got #{self.class}"
		else
			raise "#{name} requires #{t} but got #{self.class}"
		end
	end
end