This repository has been archived by the owner on Jul 23, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
39 additions
and
44 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module Slanger | ||
module Validate | ||
InvalidRequest = Class.new ArgumentError | ||
|
||
def socket_id(socket_id) | ||
if socket_id !~ /\A\d+\.\d+\z/ | ||
raise InvalidRequest, "Invalid socket_id #{socket_id.inspect}" | ||
end | ||
|
||
socket_id | ||
end | ||
|
||
def channel_id(channel_id) | ||
if channel_id !~ /\A[\w@\-;]+\z/ | ||
raise InvalidRequest, "Invalid channel_id #{channel_id.inspect}" | ||
end | ||
|
||
channel_id | ||
end | ||
|
||
extend self | ||
end | ||
end |