Class: AndroidServices::Configuration
- Inherits:
-
Object
- Object
- AndroidServices::Configuration
- Defined in:
- lib/android_services/configuration.rb
Constant Summary collapse
- OPTIONS =
[:api_key, :messaging_endpoint, :secure, :port, :protocol].freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#messaging_endpoint ⇒ Object
Returns the value of attribute messaging_endpoint.
-
#port ⇒ Object
Returns the value of attribute port.
-
#secure ⇒ Object
(also: #secure?)
Returns the value of attribute secure.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #protocol ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 19 20 |
# File 'lib/android_services/configuration.rb', line 16 def initialize @secure = true @messaging_endpoint = "#{protocol}://android.googleapis.com/gcm/send" @content_type = 'application/json' end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
4 5 6 |
# File 'lib/android_services/configuration.rb', line 4 def api_key @api_key end |
#content_type ⇒ Object
Returns the value of attribute content_type.
12 13 14 |
# File 'lib/android_services/configuration.rb', line 12 def content_type @content_type end |
#messaging_endpoint ⇒ Object
Returns the value of attribute messaging_endpoint.
6 7 8 |
# File 'lib/android_services/configuration.rb', line 6 def messaging_endpoint @messaging_endpoint end |
#port ⇒ Object
Returns the value of attribute port.
10 11 12 |
# File 'lib/android_services/configuration.rb', line 10 def port @port end |
#secure ⇒ Object Also known as: secure?
Returns the value of attribute secure.
8 9 10 |
# File 'lib/android_services/configuration.rb', line 8 def secure @secure end |
Instance Method Details
#protocol ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/android_services/configuration.rb', line 26 def protocol if secure? 'https' else 'http' end end |