Class: MediaTypes::Object
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- MediaTypes::Object
- Defined in:
- lib/media_types/object.rb
Instance Method Summary collapse
- #===(other) ⇒ Object
- #blank? ⇒ Boolean (also: #empty?)
- #class ⇒ Object
- #present? ⇒ Boolean
Instance Method Details
#===(other) ⇒ Object
9 10 11 |
# File 'lib/media_types/object.rb', line 9 def ===(other) __getobj__ === other # rubocop:disable Style/CaseEquality end |
#blank? ⇒ Boolean Also known as: empty?
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/media_types/object.rb', line 13 def blank? if __getobj__.respond_to?(:blank?) return __getobj__.blank? end if __getobj__.respond_to?(:empty?) return __getobj__.empty? end if __getobj__.respond_to?(:length) return __getobj__.length.zero? end !__getobj__ end |
#class ⇒ Object
5 6 7 |
# File 'lib/media_types/object.rb', line 5 def class __getobj__.class end |
#present? ⇒ Boolean
31 32 33 |
# File 'lib/media_types/object.rb', line 31 def present? !blank? end |