Module: ActionService::Protocol::Registry::ClassMethods

Defined in:
lib/action_service/protocol/registry.rb

Instance Method Summary collapse

Instance Method Details

#register_protocol(type, klass) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/action_service/protocol/registry.rb', line 14

def register_protocol(type, klass)
  case type
  when HeaderAndBody
    write_inheritable_array("header_and_body_protocols", [klass])
  when BodyOnly
    write_inheritable_array("body_only_protocols", [klass])
  else
    raise(ProtocolError, "unknown protocol type #{type}")
  end
end