Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Report
- def output
- formatter_class =
- begin
- @format.to_s.classify.constantize
- rescue NameError
- # ...handle 'invalid formatter type'
- end
- formatter = formatter_class.send(:new, self)
- # etc
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement