Class: Mooncell::ApplicationConfiguration Private
- Inherits:
-
Object
- Object
- Mooncell::ApplicationConfiguration
- Defined in:
- lib/mooncell/application_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.
The Application Configruation
Instance Method Summary collapse
-
#initialize(&block) ⇒ ApplicationConfiguration
constructor
private
Create new configuration.
-
#port(value = nil) ⇒ Object
private
Port.
-
#protocol(value = nil) ⇒ Object
private
Protocol.
Constructor Details
#initialize(&block) ⇒ ApplicationConfiguration
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.
Create new configuration
17 18 19 20 |
# File 'lib/mooncell/application_configuration.rb', line 17 def initialize(&block) @settings = {} instance_eval(&block) end |
Instance Method Details
#port ⇒ Number #port(value) ⇒ 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.
Port
54 55 56 57 58 |
# File 'lib/mooncell/application_configuration.rb', line 54 def port(value = nil) return settings[:port] if value.nil? settings[:port] = value.to_i end |
#protocol ⇒ String #protocol(value) ⇒ 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.
Protocol
34 35 36 37 38 39 40 |
# File 'lib/mooncell/application_configuration.rb', line 34 def protocol(value = nil) if value settings[:protocol] = value.to_s else settings[:portocol] || Mooncell.configuration.protocol end end |