Class: Rapns::Daemon::Configuration
- Inherits:
-
Object
- Object
- Rapns::Daemon::Configuration
- Defined in:
- lib/rapns/daemon/configuration.rb
Instance Attribute Summary collapse
-
#airbrake_notify ⇒ Object
(also: #airbrake_notify?)
Returns the value of attribute airbrake_notify.
-
#certificate ⇒ Object
Returns the value of attribute certificate.
-
#certificate_password ⇒ Object
Returns the value of attribute certificate_password.
-
#feedback ⇒ Object
Returns the value of attribute feedback.
-
#pid_file ⇒ Object
Returns the value of attribute pid_file.
-
#push ⇒ Object
Returns the value of attribute push.
Instance Method Summary collapse
-
#initialize(environment, config_path) ⇒ Configuration
constructor
A new instance of Configuration.
- #load ⇒ Object
Constructor Details
#initialize(environment, config_path) ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 |
# File 'lib/rapns/daemon/configuration.rb', line 12 def initialize(environment, config_path) @environment = environment @config_path = config_path self.push = Struct.new(:host, :port, :connections, :poll).new self.feedback = Struct.new(:host, :port, :poll).new end |
Instance Attribute Details
#airbrake_notify ⇒ Object Also known as: airbrake_notify?
Returns the value of attribute airbrake_notify.
9 10 11 |
# File 'lib/rapns/daemon/configuration.rb', line 9 def airbrake_notify @airbrake_notify end |
#certificate ⇒ Object
Returns the value of attribute certificate.
9 10 11 |
# File 'lib/rapns/daemon/configuration.rb', line 9 def certificate @certificate end |
#certificate_password ⇒ Object
Returns the value of attribute certificate_password.
9 10 11 |
# File 'lib/rapns/daemon/configuration.rb', line 9 def certificate_password @certificate_password end |
#feedback ⇒ Object
Returns the value of attribute feedback.
8 9 10 |
# File 'lib/rapns/daemon/configuration.rb', line 8 def feedback @feedback end |
#pid_file ⇒ Object
Returns the value of attribute pid_file.
9 10 11 |
# File 'lib/rapns/daemon/configuration.rb', line 9 def pid_file @pid_file end |
#push ⇒ Object
Returns the value of attribute push.
8 9 10 |
# File 'lib/rapns/daemon/configuration.rb', line 8 def push @push end |
Instance Method Details
#load ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rapns/daemon/configuration.rb', line 20 def load config = read_config ensure_environment_configured(config) config = config[@environment] set_variable(:push, :host, config) set_variable(:push, :port, config) set_variable(:push, :poll, config, :optional => true, :default => 2) set_variable(:push, :connections, config, :optional => true, :default => 3) set_variable(:feedback, :host, config) set_variable(:feedback, :port, config) set_variable(:feedback, :poll, config, :optional => true, :default => 60) set_variable(nil, :certificate, config) set_variable(nil, :airbrake_notify, config, :optional => true, :default => true) set_variable(nil, :certificate_password, config, :optional => true, :default => "") set_variable(nil, :pid_file, config, :optional => true, :default => "") end |