Class: ActiveMessenger::Base
- Inherits:
-
Object
- Object
- ActiveMessenger::Base
- Includes:
- Core::ConfigParsable, Core::Postable
- Defined in:
- lib/active_messenger/base.rb
Class Method Summary collapse
- .adapter(adapter_sym) ⇒ Object
- .adapter_class ⇒ Object
- .method_missing(method_name, *args, &block) ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
A new instance of Base.
Methods included from Core::Postable
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
17 18 19 |
# File 'lib/active_messenger/base.rb', line 17 def initialize @adapter = self.class.adapter_class.new end |
Class Method Details
.adapter(adapter_sym) ⇒ Object
22 23 24 |
# File 'lib/active_messenger/base.rb', line 22 def adapter(adapter_sym) self.adapter = adapter_sym end |
.adapter_class ⇒ Object
26 27 28 |
# File 'lib/active_messenger/base.rb', line 26 def adapter_class "ActiveMessenger::Adapters::#{self.adapter.to_s.classify}".constantize end |
.method_missing(method_name, *args, &block) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/active_messenger/base.rb', line 30 def method_missing(method_name, *args, &block) if self.adapter_class.respond_to?(method_name) self.adapter_class.__send__(method_name, *args, &block) else super end end |