Sha256: d1271b55068e4437faa156cbf1229438bde8e645c8d2e864a7241e546908161c

Contents?: true

Size: 357 Bytes

Versions: 4

Compression:

Stored size: 357 Bytes

Contents

class NilClass
  def val(*args)
    self
  end
end

class TrueClass
  def to_i
    1
  end
end

class FalseClass
  def to_i
    0
  end
end

class Object
  def to_bool
    ![false, 'false', '0', 0, 'f', nil, ''].include?(self.respond_to?(:downcase) ? self.downcase : self)
  end
end

class Date
  def tomorrow?
    self.to_date == ::Date.tomorrow
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ab_admin-0.8.3 lib/ab_admin/core_ext/other.rb
ab_admin-0.8.2 lib/ab_admin/core_ext/other.rb
ab_admin-0.8.1 lib/ab_admin/core_ext/other.rb
ab_admin-0.8.0 lib/ab_admin/core_ext/other.rb