Class: Lita::PluginBuilder Private
- Inherits:
-
Object
- Object
- Lita::PluginBuilder
- Defined in:
- lib/lita/plugin_builder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constructs a Lita plugin from a block.
Instance Method Summary collapse
-
#build_adapter ⇒ Lita::Adapter
private
Constructs an Adapter from the provided block.
-
#build_handler ⇒ Lita::Handler
private
Constructs a Handler from the provided block.
-
#initialize(namespace) { ... } ⇒ PluginBuilder
constructor
private
A new instance of PluginBuilder.
Constructor Details
#initialize(namespace) { ... } ⇒ PluginBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of PluginBuilder.
8 9 10 11 |
# File 'lib/lita/plugin_builder.rb', line 8 def initialize(namespace, &block) @namespace = namespace.to_s @block = block end |
Instance Method Details
#build_adapter ⇒ Lita::Adapter
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Constructs an Adapter from the provided block.
15 16 17 18 19 |
# File 'lib/lita/plugin_builder.rb', line 15 def build_adapter adapter = create_plugin(Adapter) adapter.class_exec(&@block) adapter end |
#build_handler ⇒ Lita::Handler
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Constructs a Handler from the provided block.
23 24 25 26 27 |
# File 'lib/lita/plugin_builder.rb', line 23 def build_handler handler = create_plugin(Handler) handler.class_exec(&@block) handler end |