Class: Killbill::Plugin::Creator
Instance Attribute Summary collapse
-
#target_class_name ⇒ Object
readonly
Returns the value of attribute target_class_name.
Instance Method Summary collapse
- #create(services) ⇒ Object
-
#initialize(target_class_name) ⇒ Creator
constructor
A new instance of Creator.
Constructor Details
#initialize(target_class_name) ⇒ Creator
Returns a new instance of Creator.
14 15 16 |
# File 'lib/killbill/creator.rb', line 14 def initialize(target_class_name) @target_class_name = target_class_name end |
Instance Attribute Details
#target_class_name ⇒ Object (readonly)
Returns the value of attribute target_class_name.
12 13 14 |
# File 'lib/killbill/creator.rb', line 12 def target_class_name @target_class_name end |
Instance Method Details
#create(services) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/killbill/creator.rb', line 18 def create(services) real_class = @target_class_name.to_class plugin_delegate = real_class.new plugin_delegate.root = services["root"] plugin_delegate.logger = services["logger"] plugin_delegate.conf_dir = services["conf_dir"] plugin_delegate.clock = services["clock"] plugin_delegate.plugin_name = extract_plugin_name(plugin_delegate.root) # At this point we removed everything from the map which is not API, so we can build the APIs # Note: services["kb_apis"] is never nil, except in tests kb_apis = KillbillApi.new(@target_class_name, services["kb_apis"] || {}) plugin_delegate.kb_apis = kb_apis plugin_delegate end |