Class: Crusade::APNS::Configuration
- Inherits:
-
Object
- Object
- Crusade::APNS::Configuration
- Defined in:
- lib/crusade/apns/configuration.rb
Instance Attribute Summary collapse
-
#allowed_domains ⇒ Object
Returns the value of attribute allowed_domains.
-
#certificate ⇒ Object
Returns the value of attribute certificate.
-
#certificate_password ⇒ Object
Returns the value of attribute certificate_password.
-
#iconset_dir ⇒ Object
Returns the value of attribute iconset_dir.
-
#push_id ⇒ Object
Returns the value of attribute push_id.
-
#site_name ⇒ Object
Returns the value of attribute site_name.
-
#url_format ⇒ Object
Returns the value of attribute url_format.
-
#webservice_url ⇒ Object
Returns the value of attribute webservice_url.
Class Method Summary collapse
Instance Method Summary collapse
- #iconset_files ⇒ Object
-
#initialize(attributes) ⇒ Configuration
constructor
A new instance of Configuration.
- #temp_dir ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/crusade/apns/configuration.rb', line 11 def initialize(attributes) self.site_name = attributes[:site_name] self.push_id = attributes[:push_id] self.url_format = attributes[:url_format] self.webservice_url = attributes[:webservice_url] self.allowed_domains = attributes[:allowed_domains] self.iconset_dir = attributes[:iconset_dir] self.certificate = attributes[:certificate] || 'config/push_certificate.p12' self.certificate_password = attributes[:certificate_password] || nil end |
Instance Attribute Details
#allowed_domains ⇒ Object
Returns the value of attribute allowed_domains.
7 8 9 |
# File 'lib/crusade/apns/configuration.rb', line 7 def allowed_domains @allowed_domains end |
#certificate ⇒ Object
Returns the value of attribute certificate.
7 8 9 |
# File 'lib/crusade/apns/configuration.rb', line 7 def certificate @certificate end |
#certificate_password ⇒ Object
Returns the value of attribute certificate_password.
7 8 9 |
# File 'lib/crusade/apns/configuration.rb', line 7 def certificate_password @certificate_password end |
#iconset_dir ⇒ Object
Returns the value of attribute iconset_dir.
7 8 9 |
# File 'lib/crusade/apns/configuration.rb', line 7 def iconset_dir @iconset_dir end |
#push_id ⇒ Object
Returns the value of attribute push_id.
7 8 9 |
# File 'lib/crusade/apns/configuration.rb', line 7 def push_id @push_id end |
#site_name ⇒ Object
Returns the value of attribute site_name.
7 8 9 |
# File 'lib/crusade/apns/configuration.rb', line 7 def site_name @site_name end |
#url_format ⇒ Object
Returns the value of attribute url_format.
7 8 9 |
# File 'lib/crusade/apns/configuration.rb', line 7 def url_format @url_format end |
#webservice_url ⇒ Object
Returns the value of attribute webservice_url.
7 8 9 |
# File 'lib/crusade/apns/configuration.rb', line 7 def webservice_url @webservice_url end |
Class Method Details
.load(config_file, env = 'development') ⇒ Object
33 34 35 36 37 |
# File 'lib/crusade/apns/configuration.rb', line 33 def self.load config_file, env = 'development' yaml = load_yaml config_file config = symbolize_keys yaml[env.to_s] new(config) end |
Instance Method Details
#iconset_files ⇒ Object
23 24 25 26 27 |
# File 'lib/crusade/apns/configuration.rb', line 23 def iconset_files %w(16x16 16x16@2x 32x32 32x32@2x 128x128 128x128@2x).map do |size| File.join iconset_dir, "icon_#{size}.png" end end |
#temp_dir ⇒ Object
29 30 31 |
# File 'lib/crusade/apns/configuration.rb', line 29 def temp_dir @temp_dir ||= Dir.mktmpdir end |