Created
May 7, 2013 13:03
-
-
Save anonymous/5532383 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
module Ox | |
class Error < StandardError | |
end # Error | |
# An Exception that is raised as a result of a parse error while parsing a XML document. | |
class ParseError < Error | |
end # ParseError | |
# An Exception that is raised as a result of an invalid argument. | |
class ArgError < Error | |
end # ArgError | |
# An Exception raised if a path is not valid. | |
class InvalidPath < Error | |
def initialize(path) | |
super("#{path.join('/')} is not a valid location.") | |
end | |
end # InvalidPath | |
end # Ox |
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
irb(main):001:0> require 'ox' | |
true | |
irb(main):002:0> defined?(Ox::InvalidPath) | |
"constant" | |
irb(main):003:0> defined?(Ox::ParseError) | |
nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment