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.
210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/adhearsion/initializer/configuration.rb', line 210 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].to_a.each { |ip| acl << 'deny' << ip } overrides[:allow].to_a.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.
196 197 198 |
# File 'lib/adhearsion/initializer/configuration.rb', line 196 def acl @acl end |
#host ⇒ Object
Returns the value of attribute host.
195 196 197 |
# File 'lib/adhearsion/initializer/configuration.rb', line 195 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
194 195 196 |
# File 'lib/adhearsion/initializer/configuration.rb', line 194 def port @port end |