Skip to content

Instantly share code, notes, and snippets.

@darkhelmet
Created December 18, 2009 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkhelmet/259248 to your computer and use it in GitHub Desktop.
Save darkhelmet/259248 to your computer and use it in GitHub Desktop.
class Foo
def initialize(a, business = 1, charlie = 2)
@a = a
@business = business
@charlie = charlie
end
def bar
# do stuff
@a = 1 + 1
rescue
nil
end
def biz
something_expensive(1,2)
rescue FooError => e
log(e)
rescue BarError => e
remote_log(e)
end
class << self
def build
Foo.new(1)
end
def build_other
DEFAULTS.each do |d|
process(d)
end
Foo.new(2)
end
def pickle
Other.build.try(:pickle)
end
end
private
def baz(time)
self.time = time
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment