Class: Deployme::Settings
- Inherits:
-
Object
- Object
- Deployme::Settings
- Defined in:
- lib/deployme/settings.rb
Instance Method Summary collapse
-
#initialize(klass, config, options) ⇒ Settings
constructor
A new instance of Settings.
- #method_missing(name, *args, &blk) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(klass, config, options) ⇒ Settings
Returns a new instance of Settings.
5 6 7 8 9 |
# File 'lib/deployme/settings.rb', line 5 def initialize(klass, config, ) @prefix = klass.to_s.split('::').last.downcase @config = OpenStruct.new(klass.defaults.merge(config)) = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &blk) ⇒ Object
11 12 13 |
# File 'lib/deployme/settings.rb', line 11 def method_missing(name, *args, &blk) fetch_param(name) end |
Instance Method Details
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
15 16 17 |
# File 'lib/deployme/settings.rb', line 15 def respond_to_missing?(method_name, include_private = false) detect_param(method_name) || super end |