Class: Adhearsion::Configuration::DrbConfiguration
- Inherits:
-
AbstractConfiguration
- Object
- AbstractConfiguration
- Adhearsion::Configuration::DrbConfiguration
- Defined in:
- lib/adhearsion/initializer/configuration.rb
Instance Attribute Summary collapse
-
#acl ⇒ Object
Returns the value of attribute acl.
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(overrides = {}) ⇒ DrbConfiguration
constructor
A new instance of DrbConfiguration.
Methods included from ConfigurationEntryPoint
Constructor Details
#initialize(overrides = {}) ⇒ DrbConfiguration
Returns a new instance of DrbConfiguration.
242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/adhearsion/initializer/configuration.rb', line 242 def initialize(overrides = {}) self.port = overrides[:port] || self.class.default_port self.host = overrides[:host] || self.class.default_host self.acl = overrides[:raw_acl] unless acl self.acl = [] [*overrides[ :deny]].compact.each { |ip| acl << 'deny' << ip } [*overrides[:allow]].compact.each { |ip| acl << 'allow' << ip } acl.concat %w[allow 127.0.0.1] if acl.empty? end end |
Instance Attribute Details
#acl ⇒ Object
Returns the value of attribute acl.
228 229 230 |
# File 'lib/adhearsion/initializer/configuration.rb', line 228 def acl @acl end |
#host ⇒ Object
Returns the value of attribute host.
227 228 229 |
# File 'lib/adhearsion/initializer/configuration.rb', line 227 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
226 227 228 |
# File 'lib/adhearsion/initializer/configuration.rb', line 226 def port @port end |