Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/tektite_ruby_utils/present.rb
Overview
Add some methods concerning present and PresentClass to all objects by extending Object.
Instance Method Summary collapse
-
#present? ⇒ Boolean
Allow .present? method on all objects.
-
#present_with_type ⇒ Object
(also: #present_with_class)
Return a new PresentClass object with @type defined as the type of the object.
Instance Method Details
#present? ⇒ Boolean
Allow .present? method on all objects
58 59 60 |
# File 'lib/tektite_ruby_utils/present.rb', line 58 def present? !nil? end |
#present_with_type ⇒ Object Also known as: present_with_class
Return a new PresentClass object with @type defined as the type of the object.
64 65 66 |
# File 'lib/tektite_ruby_utils/present.rb', line 64 def present_with_type PresentClass.new(self.class) end |