Method: Waylon::SenseRegistry#register

Defined in:
lib/waylon/sense_registry.rb

#register(name, class_name) ⇒ Class

Add the provided Sense class to the registry under ‘name`

Parameters:

  • name (String)

    The name of the Sense in the registry

  • class_name (Class)

    The Sense subclass to add

Returns:

  • (Class)

    The Sense subclass



21
22
23
24
# File 'lib/waylon/sense_registry.rb', line 21

def register(name, class_name)
  @senses ||= {}
  @senses[name.to_s] = class_name
end