Module: DynamicModel::ManagedDomains
- Defined in:
- lib/database_introspection/dynamic_model/managed_domains.rb
Overview
Namespace for domains
Class Method Summary collapse
- .domain_module(table_prefix) ⇒ Object
- .domain_modules ⇒ Object
- .domain_prefixes ⇒ Object
- .tables ⇒ Object
- .to_hash ⇒ Object
Class Method Details
.domain_module(table_prefix) ⇒ Object
19 20 21 |
# File 'lib/database_introspection/dynamic_model/managed_domains.rb', line 19 def self.domain_module(table_prefix) Hash[domain_prefixes.zip domain_modules][table_prefix] end |
.domain_modules ⇒ Object
7 8 9 |
# File 'lib/database_introspection/dynamic_model/managed_domains.rb', line 7 def self.domain_modules constants.map {|c| "#{self.name}::#{c.to_s}".constantize} end |
.domain_prefixes ⇒ Object
3 4 5 |
# File 'lib/database_introspection/dynamic_model/managed_domains.rb', line 3 def self.domain_prefixes constants.map {|c| c.to_s.underscore} end |
.tables ⇒ Object
15 16 17 |
# File 'lib/database_introspection/dynamic_model/managed_domains.rb', line 15 def self.tables self.domain_modules.map {|mod| mod.table_names}.flatten end |
.to_hash ⇒ Object
11 12 13 |
# File 'lib/database_introspection/dynamic_model/managed_domains.rb', line 11 def self.to_hash Hash[domain_modules.zip domain_prefixes] end |