Module: CoreSystemConfiguration::ClassMethods
- Defined in:
- lib/app/models/concerns/core_system_configuration.rb
Overview
Class methods for SystemConfiguration
Instance Method Summary collapse
- #configuration ⇒ Object
-
#method_missing(method, *args, &block) ⇒ Object
NOTE: Currently ignored Codacy issue: When using ‘method_missing’, fall back on ‘super’.
- #respond_to?(method_name, include_private = false) ⇒ Boolean
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
NOTE: Currently ignored Codacy issue: When using ‘method_missing’, fall back on ‘super’
68 69 70 71 72 73 74 |
# File 'lib/app/models/concerns/core_system_configuration.rb', line 68 def method_missing(method, *args, &block) if configuration.respond_to?(method) configuration.send(method, *args, &block) else super end end |
Instance Method Details
#configuration ⇒ Object
61 62 63 |
# File 'lib/app/models/concerns/core_system_configuration.rb', line 61 def configuration SystemConfiguration.find_or_create_by!(environment: Rails.env) end |
#respond_to?(method_name, include_private = false) ⇒ Boolean
76 77 78 |
# File 'lib/app/models/concerns/core_system_configuration.rb', line 76 def respond_to?(method_name, include_private = false) super || configuration.respond_to?(method_name, include_private) end |
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
80 81 82 |
# File 'lib/app/models/concerns/core_system_configuration.rb', line 80 def respond_to_missing?(method_name, include_private = false) configuration.respond_to?(method_name, include_private) || super end |