Class: Emittance::EventLookup::EventKlassName

Inherits:
EventKlassConverter show all
Defined in:
lib/emittance/event_lookup.rb

Overview

Derives an event class name from an identifier.

Constant Summary

Constants inherited from EventKlassConverter

Emittance::EventLookup::EventKlassConverter::KLASS_NAME_SUFFIX

Instance Method Summary collapse

Methods included from Helpers::StringHelpers

#camel_case, #clean_up_punctuation, #snake_case

Constructor Details

#initialize(identifier) ⇒ EventKlassName

Returns a new instance of EventKlassName.



145
146
147
# File 'lib/emittance/event_lookup.rb', line 145

def initialize(identifier)
  @identifier = identifier
end

Instance Method Details

#generateObject

Generates an event class name for the given identifier.



150
151
152
153
# File 'lib/emittance/event_lookup.rb', line 150

def generate
  base_name = camel_case identifier.to_s
  decorate_klass_name base_name
end