Class: Aruba::EventBus::NameResolver::StringResolver

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

Overview

Convert a string 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)

81
82
83
# File 'lib/aruba/event_bus/name_resolver.rb', line 81

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

.supportsObject

Which types are supported


86
87
88
# File 'lib/aruba/event_bus/name_resolver.rb', line 86

def supports
  [String]
end

Instance Method Details

#transform(_, event_id) ⇒ Object


91
92
93
# File 'lib/aruba/event_bus/name_resolver.rb', line 91

def transform(_, event_id)
  constantize(event_id)
end