Created
August 16, 2011 20:40
-
-
Save timuruski/1150114 to your computer and use it in GitHub Desktop.
There has to to be a better way to build a hash.
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
| def get_providers() | |
| plugins= get_plugins() | |
| ary= plugins.get_providers() | |
| h= {} | |
| h["providers"] = ary | |
| h | |
| end | |
| # Why not do this? | |
| def get_providers | |
| { :providers => get_plugins.get_providers } | |
| end | |
| # Renamed methods make it easy to understand | |
| def providers_hash | |
| { :providers => plugins.providers } | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment