Method: Object#must

Defined in:
lib/el4r/el4r-sub.rb

#must(*args) ⇒ Object

Assert: type === obj ex. obj.must Fixnum, Float

Raises:

  • (TypeError)


781
782
783
784
# File 'lib/el4r/el4r-sub.rb', line 781

def must( *args )
  args.each {|c| return self if c === self }
  raise TypeError, "wrong arg type '#{self.class}' for required #{args.join('/')}"
end