Class: QbwcRequests::Factory::Instantiator
- Inherits:
-
Object
- Object
- QbwcRequests::Factory::Instantiator
- Defined in:
- lib/qbwc_requests/factory.rb
Instance Method Summary collapse
- #factory(params = {}, version = nil) ⇒ Object
-
#initialize(module_name, klass) ⇒ Instantiator
constructor
A new instance of Instantiator.
- #name ⇒ Object
Constructor Details
#initialize(module_name, klass) ⇒ Instantiator
Returns a new instance of Instantiator.
6 7 8 9 |
# File 'lib/qbwc_requests/factory.rb', line 6 def initialize module_name, klass @module_name = module_name @klass = klass end |
Instance Method Details
#factory(params = {}, version = nil) ⇒ Object
11 12 13 14 15 |
# File 'lib/qbwc_requests/factory.rb', line 11 def factory params = {}, version = nil final_version = version || QbwcRequests.QBXML_VERSION object = Object.const_get("QbwcRequests::#{@module_name}::V#{final_version}::#{@klass}") object.new(params) end |
#name ⇒ Object
17 18 19 |
# File 'lib/qbwc_requests/factory.rb', line 17 def name @module_name end |