Class: APND::Settings
- Inherits:
-
Object
- Object
- APND::Settings
- Defined in:
- lib/apnd/settings.rb
Overview
Settings for APND
Defined Under Namespace
Classes: AppleConnection, Daemon, Notification
Instance Method Summary collapse
-
#apple ⇒ Object
Returns the AppleConnection settings.
-
#apple=(options = {}) ⇒ Object
Mass assign AppleConnection settings.
-
#daemon ⇒ Object
Returns the Daemon settings.
-
#daemon=(options = {}) ⇒ Object
Mass assign Daemon settings.
-
#notification ⇒ Object
Returns the Notification settings.
-
#notification=(options = {}) ⇒ Object
Mass assign Notification settings.
Instance Method Details
#apple ⇒ Object
Returns the AppleConnection settings
110 111 112 |
# File 'lib/apnd/settings.rb', line 110 def apple @apple ||= APND::Settings::AppleConnection.new end |
#apple=(options = {}) ⇒ Object
Mass assign AppleConnection settings
117 118 119 120 121 122 123 124 |
# File 'lib/apnd/settings.rb', line 117 def apple=( = {}) if .respond_to?(:keys) apple.cert = [:cert] if [:cert] apple.cert_pass = [:cert_pass] if [:cert_pass] apple.host = [:host] if [:host] apple.port = [:port] if [:port] end end |
#daemon ⇒ Object
Returns the Daemon settings
129 130 131 |
# File 'lib/apnd/settings.rb', line 129 def daemon @daemon ||= APND::Settings::Daemon.new end |
#daemon=(options = {}) ⇒ Object
Mass assign Daemon settings
136 137 138 139 140 141 142 143 |
# File 'lib/apnd/settings.rb', line 136 def daemon=( = {}) if .respond_to?(:keys) daemon.bind = [:bind] if [:bind] daemon.port = [:port] if [:port] daemon.log_file = [:log_file] if [:log_file] daemon.timer = [:timer] if [:timer] end end |
#notification ⇒ Object
Returns the Notification settings
148 149 150 |
# File 'lib/apnd/settings.rb', line 148 def notification @notification ||= APND::Settings::Notification.new end |
#notification=(options = {}) ⇒ Object
Mass assign Notification settings
155 156 157 158 159 160 |
# File 'lib/apnd/settings.rb', line 155 def notification=( = {}) if .respond_to?(:keys) notification.port = [:port] if [:port] notification.host = [:host] if [:host] end end |