Class: Ntswf::Instance
- Inherits:
-
Object
- Object
- Ntswf::Instance
- Defined in:
- lib/ntswf/instance.rb
Instance Method Summary collapse
-
#initialize(*modules, config) ⇒ Instance
constructor
A new instance of Instance.
Constructor Details
#initialize(*modules, config) ⇒ Instance
Returns a new instance of Instance.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/ntswf/instance.rb', line 8 def initialize(*args) symbols = args.grep Symbol configs = args - symbols instance_exec do module_names = symbols.map(&:to_s).map { |s| s.gsub(/(^|_)(.)/) { $2.upcase } } module_names = DEFAULT_MODULES if module_names.empty? module_names.each { |module_name| extend Ntswf::const_get module_name } end configure(configs.last || {}) end |