I hereby claim:
- I am manfred on github.
- I am manfred (https://keybase.io/manfred) on keybase.
- I have a public key ASDppOBDpAM6DvUVkd8Cs8kWFV9Ov-K6F8vrhC2QxbvnFAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Run this example with $ ruby -W w.rb | |
class Gallery | |
attr_reader :disabled | |
def initialize(disabled:) | |
@disabled = disabled | |
end | |
def images |
def random_sales_force_account_id | |
'%d%d%d%d-%d%d%d%d%d-%d%d%d%d' % ([9]*13).map { |i| rand(i) } | |
end |
def assert(expectation, message=nil) | |
if expectation | |
$stderr.write('.') | |
else | |
message ||= "assertion failed" | |
puts "FAILURE: #{caller(0)[1]}" | |
puts " #{message}" | |
exit -1 | |
end | |
end |
class Payment < Struct.new(:amount) | |
def self.fees | |
if @fees.nil? | |
@fees = {}; ObjectSpace.each_object do |object| | |
if object.class == String and match = /returns.*of\s\$(\d+).*\(\$([\d\.]+)\)/.match(object.to_s) | |
@fees[match[1].to_i] = match[2].to_f | |
end | |
end | |
end; @fees | |
end |