Class: Racket::Settings::Application
- Defined in:
- lib/racket/settings/application.rb
Overview
Class for storing application settings.
Class Method Summary collapse
-
.directory_setting(symbol, directory) ⇒ nil
Creates a directory setting with a default value.
-
.service(options = {}) ⇒ Proc
Returns a service proc that can be used by the registry.
Instance Method Summary collapse
-
#initialize(utils, defaults = {}) ⇒ Application
constructor
A new instance of Application.
Methods inherited from Base
default_value, #delete, #fetch, #present?, setting, #store
Constructor Details
#initialize(utils, defaults = {}) ⇒ Application
Returns a new instance of Application.
42 43 44 45 |
# File 'lib/racket/settings/application.rb', line 42 def initialize(utils, defaults = {}) @utils = utils super(defaults) end |
Class Method Details
.directory_setting(symbol, directory) ⇒ nil
Creates a directory setting with a default value.
52 53 54 55 |
# File 'lib/racket/settings/application.rb', line 52 def self.directory_setting(symbol, directory) define_directory_method(symbol, "@#{symbol}".to_sym, directory) attr_writer(symbol) && nil end |
.service(options = {}) ⇒ Proc
Returns a service proc that can be used by the registry.
38 39 40 |
# File 'lib/racket/settings/application.rb', line 38 def self.service( = {}) ->(reg) { new(reg.utils, ) } end |