Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/mod_object.rb
Instance Method Summary collapse
Instance Method Details
#must_be(item) ⇒ Object
2 3 4 5 |
# File 'lib/mod_object.rb', line 2 def must_be item raise TypeError, "can't convert #{self.class} into #{item}" unless self.is_a? item true end |
#must_have(property, value) ⇒ Object
7 8 9 10 |
# File 'lib/mod_object.rb', line 7 def must_have property, value raise StandardError, "##{property} must be #{value} (#{self.send(property)})" unless self.send(property) == value true end |