Class: M2Config::Handler
- Inherits:
-
Object
- Object
- M2Config::Handler
- Defined in:
- lib/m2config/handler.rb
Constant Summary collapse
- ID_REGEX =
/^[-a-zA-Z0-9]+$/
Instance Method Summary collapse
-
#initialize(fields) ⇒ Handler
constructor
A new instance of Handler.
- #type ⇒ Object
Constructor Details
#initialize(fields) ⇒ Handler
Returns a new instance of Handler.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/m2config/handler.rb', line 7 def initialize( fields ) raise ArgumentError, "The send and receive endpoints can not be the same" if fields[:send_spec] == fields[:recv_spec] raise ArgumentError, "Handler send and recv IDs must only use -a-zA-Z0-9" if !(fields[:send_ident] =~ ID_REGEX && fields[:send_ident] =~ ID_REGEX) fields[:recv_ident] ||= "" super(fields, false) save end |
Instance Method Details
#type ⇒ Object
18 19 20 |
# File 'lib/m2config/handler.rb', line 18 def type "handler" end |