Class: Fcmpush::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fcmpush/configuration.rb', line 5

def initialize
  @scope = ['https://www.googleapis.com/auth/firebase.messaging']

  # set file path
  @json_key_io = nil

  # Or Environment Variable
  # ENV['GOOGLE_ACCOUNT_TYPE'] = 'service_account'
  # ENV['GOOGLE_CLIENT_ID'] = '000000000000000000000'
  # ENV['GOOGLE_CLIENT_EMAIL'] = '[email protected]'
  # ENV['GOOGLE_PRIVATE_KEY'] = '-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n'

  # regacy auth
  # @deprecated TODO: remove this next version
  @server_key = ENV['FCM_SERVER_KEY']
  if @server_key
    warn '[DEPRECATION] `FCM_SERVER_KEY` environment variable, also @server_key is deprecated. This attribute will be removed next version.'
  end

  # THIS IS EXPERIMENTAL
  # NOT support `HTTPS_PROXY` environment variable. This feature not tested well on CI.
  # cf. https://github.com/miyataka/fcmpush/pull/39#issuecomment-1722533622
  # proxy
  @proxy = :ENV

  # connection timeouts
  @open_timeout = nil
  @read_timeout = nil
end

Instance Attribute Details

#json_key_ioObject

Returns the value of attribute json_key_io.



3
4
5
# File 'lib/fcmpush/configuration.rb', line 3

def json_key_io
  @json_key_io
end

#open_timeoutObject

Returns the value of attribute open_timeout.



3
4
5
# File 'lib/fcmpush/configuration.rb', line 3

def open_timeout
  @open_timeout
end

#proxyObject

Returns the value of attribute proxy.



3
4
5
# File 'lib/fcmpush/configuration.rb', line 3

def proxy
  @proxy
end

#read_timeoutObject

Returns the value of attribute read_timeout.



3
4
5
# File 'lib/fcmpush/configuration.rb', line 3

def read_timeout
  @read_timeout
end

#scopeObject

Returns the value of attribute scope.



3
4
5
# File 'lib/fcmpush/configuration.rb', line 3

def scope
  @scope
end

#server_keyObject

Returns the value of attribute server_key.



3
4
5
# File 'lib/fcmpush/configuration.rb', line 3

def server_key
  @server_key
end