Sha256: bdf47396ff381bf785fbf963dcb986b566a48829260d75bdd749ce107bec4084

Contents?: true

Size: 447 Bytes

Versions: 5

Compression:

Stored size: 447 Bytes

Contents

class MyProxyFoo
  attr_accessor :obj_block
  include FromHash
  fattr(:obj) { obj_block[] }
  def method_missing(sym,*args,&b)
   # raise "sending #{args.inspect}"
    obj.send(sym,*args,&b)
  end
end

def try_all(*args)
  args.flatten.each do |arg|
    begin
      yield(arg)
      puts "#{arg} worked"
      return
    rescue(RuntimeError)
      puts "runtimeerror"
    rescue
      puts "generic error"
    end
  end
  raise "none worked"
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
import_everything-0.1.6 spec/junk.rb
import_everything-0.1.5 spec/junk.rb
import_everything-0.1.3 spec/junk.rb
import_everything-0.1.2 spec/junk.rb
import_everything-0.1.0 spec/junk.rb