Module: WSDirector::Protocols

Defined in:
lib/wsdirector/protocols.rb,
lib/wsdirector/protocols/base.rb,
lib/wsdirector/protocols/phoenix.rb,
lib/wsdirector/protocols/action_cable.rb

Overview

:nodoc:

Defined Under Namespace

Classes: ActionCable, Base, NoMessageError, PartialMatcher, Phoenix, UnexpectedMessageError, UnmatchedExpectationError

Class Method Summary collapse

Class Method Details

.get(id) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/wsdirector/protocols.rb', line 25

def get(id)
  class_name = if ID2CLASS.key?(id)
    ID2CLASS.fetch(id)
  else
    id
  end

  const_get(class_name)
rescue NameError
  raise Error, "Unknown protocol: #{id}"
end