Created
August 22, 2014 04:47
-
-
Save acconrad/71fa180d20bceb8594e7 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 TestClass | |
LIST_OF_METHODS = { | |
1 => -> { method_1 } | |
2 => -> { method_2 } | |
} | |
def select_method(number) | |
LIST_OF_METHODS[number].call | |
end | |
private | |
def method_1 | |
return true | |
end | |
def method_2 | |
return false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment