Created
December 18, 2009 02:46
-
-
Save darkhelmet/259248 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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