Sha256: c73b84fd59a5b466be69fbd3acf6bb3b36368be1075d30c00a80dfdc63fed76c

Contents?: true

Size: 291 Bytes

Versions: 8

Compression:

Stored size: 291 Bytes

Contents

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

  def present?
    !blank?
  end
end

class String
  def convert_to_cents
    (self.to_f * 100).to_i
  end
end

class Hash
  def deep_compact
    delete_if {|k,v| v.deep_compact if v.is_a?(Hash); v.nil?}
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
zoop-0.3.5 lib/zoop/core_ext.rb
zoop-0.3.4 lib/zoop/core_ext.rb
zoop-0.3.3 lib/zoop/core_ext.rb
zoop-0.3.2 lib/zoop/core_ext.rb
zoop-0.3.1 lib/zoop/core_ext.rb
zoop-0.3.0 lib/zoop/core_ext.rb
zoop-0.2.1 lib/zoop/core_ext.rb
zoop-0.1.0 lib/zoop/core_ext.rb