Class: InstanceId::Configure

Inherits:
Object
  • Object
show all
Defined in:
lib/instance_id/configure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfigure

Returns a new instance of Configure.

[View source]

6
7
8
9
# File 'lib/instance_id/configure.rb', line 6

def initialize
  @server_key = ''
  @logger     = Logger.new(STDOUT)
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.


4
5
6
# File 'lib/instance_id/configure.rb', line 4

def logger
  @logger
end

#server_keyObject

Returns the value of attribute server_key.


3
4
5
# File 'lib/instance_id/configure.rb', line 3

def server_key
  @server_key
end

Instance Method Details

#base_urlObject

[View source]

18
19
20
# File 'lib/instance_id/configure.rb', line 18

def base_url
  'https://iid.googleapis.com'
end

#headersObject

[View source]

11
12
13
14
15
16
# File 'lib/instance_id/configure.rb', line 11

def headers
  {
    'Authorization' => "key=#{@server_key}",
    'Content-Type'  => 'application/json'
  }
end