Class: Mooncell::Configuration Private
- Inherits:
-
Object
- Object
- Mooncell::Configuration
- Defined in:
- lib/mooncell/configuration.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#app(app) ⇒ Object
private
Set App.
- #apps ⇒ Object private
-
#initialize(&block) ⇒ Configuration
constructor
private
A new instance of Configuration.
-
#protocol(name = nil) ⇒ Object
private
Set or get application protocol.
Constructor Details
#initialize(&block) ⇒ Configuration
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Configuration.
11 12 13 14 |
# File 'lib/mooncell/configuration.rb', line 11 def initialize(&block) @settings = Concurrent::Map.new instance_eval(&block) end |
Instance Method Details
#app(app) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set App
41 42 43 |
# File 'lib/mooncell/configuration.rb', line 41 def app(app) apps[app.app_name] = app.new end |
#apps ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 |
# File 'lib/mooncell/configuration.rb', line 31 def apps settings.fetch_or_store(:apps, {}) end |
#protocol(name = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set or get application protocol
22 23 24 25 26 27 |
# File 'lib/mooncell/configuration.rb', line 22 def protocol(name = nil) # TODO: Support multiple protocol each server return settings[:protocol] if name.nil? settings[:protocol] = name.to_s end |