Class: Object

Inherits:
BasicObject
Defined in:
lib/time_crisis/support/ext/object/blank.rb,
lib/time_crisis/support/ext/object/acts_like.rb

Instance Method Summary collapse

Instance Method Details

#acts_like?(duck) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/time_crisis/support/ext/object/acts_like.rb', line 2

def acts_like?(duck)
  respond_to? :"acts_like_#{duck}?"
end

#blank?Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/time_crisis/support/ext/object/blank.rb', line 2

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

#present?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/time_crisis/support/ext/object/blank.rb', line 6

def present?
  !blank?
end