Class: Object

Inherits:
BasicObject
Defined in:
lib/pubnub.rb

Overview

Adding blank? and present? methods to Object.

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/pubnub.rb', line 17

def blank?
  respond_to?(:empty?) ? empty? : !self
end

#present?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/pubnub.rb', line 21

def present?
  !blank?
end