Module: RuGUI::FrameworkAdapters::FrameworkAdapterSupport::CommonClassAndInstanceMethods

Defined in:
lib/rugui/framework_adapters/framework_adapter_support.rb

Instance Method Summary collapse

Instance Method Details

#adapter_module_name(framework_adapter = RuGUI.configuration.framework_adapter) ⇒ Object



17
18
19
# File 'lib/rugui/framework_adapters/framework_adapter_support.rb', line 17

def adapter_module_name(framework_adapter = RuGUI.configuration.framework_adapter)
  "RuGUI::FrameworkAdapters::#{framework_adapter.camelize}"
end

#class_adapter_for(class_name) ⇒ Object



21
22
23
24
25
26
# File 'lib/rugui/framework_adapters/framework_adapter_support.rb', line 21

def class_adapter_for(class_name)
  "#{adapter_module_name}::#{class_name}".constantize
rescue
  # Fallback to the base_framework_adapter.
  "#{adapter_module_name('base_framework_adapter')}::#{class_name}".constantize
end