Skip to content

Instantly share code, notes, and snippets.

@Shinpeim
Created October 10, 2012 08:36
Show Gist options
  • Save Shinpeim/3864094 to your computer and use it in GitHub Desktop.
Save Shinpeim/3864094 to your computer and use it in GitHub Desktop.
class ServicenameAPIError < StandardError
def self.error_id(id)
define_method :error_id do
id
end
end
def self.description(description)
define_method :description do
description
end
end
end
class RoomNotFoundError < ServicenameAPIError
error_id 1
description "room not found"
end
class TooLargeRequestError < ServicenameAPIError
error_id 2
description "too large request"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment