class Object

Public Instance Methods

blank?() click to toggle source
# File lib/core_ext/object.rb, line 5
def blank?
  respond_to?(:empty?) ? empty? : !self
end
present?() click to toggle source

From: activesupport/lib/active_support/core_ext/object/blank.rb, line 19

# File lib/core_ext/object.rb, line 12
def present?
  !blank?
end
try(*a) { |self| ... } click to toggle source

From: activesupport/lib/active_support/core_ext/object/try.rb, line 28

# File lib/core_ext/object.rb, line 19
def try(*a, &b)
  if a.empty? && block_given?
    yield self
  else
    __send__(*a, &b)
  end
end