Class: Aruba::EventBus::NameResolver::SymbolResolver

Inherits:
Object
  • Object
show all
Includes:
ResolveHelpers
Defined in:
lib/aruba/event_bus/name_resolver.rb

Overview

Convert a symbol in to an event class

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ResolveHelpers

#camel_case, #constantize

Class Method Details

.match?(event_id) ⇒ Boolean

Returns:

  • (Boolean)

102
103
104
# File 'lib/aruba/event_bus/name_resolver.rb', line 102

def match?(event_id)
  event_id.is_a? Symbol
end

.supportsObject

Which types are supported


107
108
109
# File 'lib/aruba/event_bus/name_resolver.rb', line 107

def supports
  [Symbol]
end

Instance Method Details

#transform(default_namespace, event_id) ⇒ Object


112
113
114
# File 'lib/aruba/event_bus/name_resolver.rb', line 112

def transform(default_namespace, event_id)
  constantize("#{default_namespace}::#{camel_case(event_id)}")
end