Sha256: 24305359edb46446205a1e24ab96d6088987e923351e58958f0d93b0e2e76f56
Contents?: true
Size: 518 Bytes
Versions: 57
Compression:
Stored size: 518 Bytes
Contents
module Paypal module Util def self.formatted_amount(x) # Thanks @nahi ;) sprintf "%0.2f", BigDecimal.new(x.to_s).truncate(2) end def self.to_numeric(x) if x.to_f == x.to_i x.to_i else x.to_f end end def numeric_attribute?(key) !!(key.to_s =~ /(amount|frequency|cycles|paid)/) end def ==(other) instance_variables.all? do |key| instance_variable_get(key) == other.instance_variable_get(key) end end end end
Version data entries
57 entries across 57 versions & 3 rubygems