Class: Katalyst::GoogleApis::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/katalyst/google_apis/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/katalyst/google_apis/config.rb', line 8

def initialize
  @project_id            = ENV.fetch("GOOGLE_PROJECT_ID", nil)
  @project_number        = ENV.fetch("GOOGLE_PROJECT_NUMBER", nil)
  @service_account_email = ENV.fetch("GOOGLE_SERVICE_ACCOUNT_EMAIL", nil)
  @identity_pool         = ENV.fetch("GOOGLE_OIDC_IDENTITY_POOL", nil)
  @identity_provider     = ENV.fetch("GOOGLE_OIDC_IDENTITY_PROVIDER", nil)
  @recaptcha             = ActiveSupport::OrderedOptions.new.tap do |defaults|
    defaults.site_key  = ENV.fetch("GOOGLE_RECAPTCHA_SITE_KEY", nil)
    defaults.score     = ENV.fetch("GOOGLE_RECAPTCHA_SCORE", 0.5).to_f
    defaults.test_mode = !ENV.fetch("VERIFY_RECAPTCHA", !Rails.env.local?)
  end
end

Instance Attribute Details

#identity_poolObject

Returns the value of attribute identity_pool.



6
7
8
# File 'lib/katalyst/google_apis/config.rb', line 6

def identity_pool
  @identity_pool
end

#identity_providerObject

Returns the value of attribute identity_provider.



6
7
8
# File 'lib/katalyst/google_apis/config.rb', line 6

def identity_provider
  @identity_provider
end

#project_idObject

Returns the value of attribute project_id.



6
7
8
# File 'lib/katalyst/google_apis/config.rb', line 6

def project_id
  @project_id
end

#project_numberObject

Returns the value of attribute project_number.



6
7
8
# File 'lib/katalyst/google_apis/config.rb', line 6

def project_number
  @project_number
end

#recaptchaObject

Returns the value of attribute recaptcha.



6
7
8
# File 'lib/katalyst/google_apis/config.rb', line 6

def recaptcha
  @recaptcha
end

#service_account_emailObject

Returns the value of attribute service_account_email.



6
7
8
# File 'lib/katalyst/google_apis/config.rb', line 6

def 
  @service_account_email
end