Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment