Class: OneSignal::Rails::Plugin::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/onesignal/rails/plugin.rb

Overview

Configuration options for the OneSignal plugin.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



41
42
43
# File 'lib/onesignal/rails/plugin.rb', line 41

def initialize
  set_defaults
end

Instance Attribute Details

#app_idObject

Returns the value of attribute app_id.



39
40
41
# File 'lib/onesignal/rails/plugin.rb', line 39

def app_id
  @app_id
end

#app_keyObject

Returns the value of attribute app_key.



39
40
41
# File 'lib/onesignal/rails/plugin.rb', line 39

def app_key
  @app_key
end

Instance Method Details

#set_defaultsObject



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/onesignal/rails/plugin.rb', line 45

def set_defaults
  @app_key = if ENV.key?('ONESIGNAL_APP_KEY')
              ENV['ONESIGNAL_APP_KEY']
            else
              ''
            end

  @app_id = if ENV.key?('ONESIGNAL_APP_ID')
              ENV['ONESIGNAL_APP_ID']
            else
              ''
            end
end