class Emittance::EventLookup::CompositeIdentifier
Converts a collection of objects to a ready-to-go identifier.
Attributes
objs[R]
Public Class Methods
new(*objs)
click to toggle source
# File lib/emittance/event_lookup.rb, line 114 def initialize(*objs) @objs = objs end
Public Instance Methods
generate()
click to toggle source
Compiles the objects and generates an event class name for them.
# File lib/emittance/event_lookup.rb, line 119 def generate parts = objs.map { |obj| identifier_name_for obj } compose_identifier_parts parts end
Private Instance Methods
compose_identifier_parts(parts)
click to toggle source
# File lib/emittance/event_lookup.rb, line 136 def compose_identifier_parts(parts) parts.join('_').to_sym end
identifier_name_for(obj)
click to toggle source
# File lib/emittance/event_lookup.rb, line 128 def identifier_name_for(obj) name_str = obj.to_s name_str = clean_up_punctuation name_str name_str = snake_case name_str name_str end