Created
May 8, 2013 04:38
-
-
Save BrayanZ/5538229 to your computer and use it in GitHub Desktop.
This file contains 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 Message | |
attr_reader :status | |
def initialize | |
@status = :started | |
end | |
def cancel | |
@status = :canceled | |
end | |
# ... | |
end | |
class UrgentMessage < Message | |
attr_reader :status | |
def cancel | |
raise ForbiddenCancelError if @status == :started | |
@status = :canceled | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment