Class: AndroidServices::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/android_services/configuration.rb

Constant Summary collapse

OPTIONS =
[:api_key, :messaging_endpoint, :secure, :port, :protocol].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_keyObject

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_typeObject

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_endpointObject

Returns the value of attribute messaging_endpoint.



6
7
8
# File 'lib/android_services/configuration.rb', line 6

def messaging_endpoint
  @messaging_endpoint
end

#portObject

Returns the value of attribute port.



10
11
12
# File 'lib/android_services/configuration.rb', line 10

def port
  @port
end

#secureObject 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

#protocolObject



26
27
28
29
30
31
32
# File 'lib/android_services/configuration.rb', line 26

def protocol
  if secure?
    'https'
  else
    'http'
  end
end