Created
September 6, 2012 14:26
-
-
Save ukitazume/3656836 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Controller | |
| [400, 401, 402, 403, 404].each do |code| | |
| define_method("render_#{code}", lambda {|message = 'error'| puts message}) | |
| end | |
| end | |
| controller = Controller.new | |
| controller.render_400 | |
| controller.render_400('new message') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment