Created
March 9, 2012 03:38
-
-
Save dasch/2004886 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 Score | |
attr_reader :value | |
def initialize(value) | |
@value = value | |
end | |
def available? | |
true | |
end | |
end | |
class ScoreNotAvailable < RuntimeError | |
end | |
class NoScore | |
def self.available? | |
false | |
end | |
def self.value | |
raise ScoreNotAvailable | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment