Skip to content

Instantly share code, notes, and snippets.

@dasch
Created March 9, 2012 03:38
Show Gist options
  • Save dasch/2004886 to your computer and use it in GitHub Desktop.
Save dasch/2004886 to your computer and use it in GitHub Desktop.
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