Class: ConfigurableFromEnv::Configurable::Configuration
- Inherits:
-
ActiveSupport::InheritableOptions
- Object
- ActiveSupport::InheritableOptions
- ConfigurableFromEnv::Configurable::Configuration
- Defined in:
- lib/configurable_from_env/configurable.rb
Class Method Summary collapse
-
.compile_methods!(keys) ⇒ Object
Compiles reader methods so we don’t have to go through method_missing.
Instance Method Summary collapse
Class Method Details
.compile_methods!(keys) ⇒ Object
Compiles reader methods so we don’t have to go through method_missing.
42 43 44 45 46 47 48 |
# File 'lib/configurable_from_env/configurable.rb', line 42 def self.compile_methods!(keys) keys.reject { |m| method_defined?(m) }.each do |key| class_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{key}; _get(#{key.inspect}); end RUBY end end |
Instance Method Details
#compile_methods! ⇒ Object
37 38 39 |
# File 'lib/configurable_from_env/configurable.rb', line 37 def compile_methods! self.class.compile_methods!(keys) end |