Module: FlowChat::NamedConfiguration

Overview

The named-configuration registry every platform's Configuration shares.

Storage is a class-level ivar on the including class, not a class variable. A @@configurations in a shared module would give every platform one merged registry, so a name registered for Messenger would resolve for WhatsApp.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
# File 'lib/flow_chat/named_configuration.rb', line 8

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#register_as(name) ⇒ Object



58
59
60
61
62
63
# File 'lib/flow_chat/named_configuration.rb', line 58

def register_as(name)
  FlowChat.logger.debug { "#{self.class.name}: Registering configuration as '#{name}'" }
  @name = name.to_sym
  self.class.register(@name, self)
  self
end