Class: Sendable::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



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

def initialize
  set_defaults
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



4
5
6
# File 'lib/sendable/config.rb', line 4

def api_key
  @api_key
end

#project_idObject

Returns the value of attribute project_id.



3
4
5
# File 'lib/sendable/config.rb', line 3

def project_id
  @project_id
end

Instance Method Details

#set_defaultsObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sendable/config.rb', line 10

def set_defaults
  if ENV.has_key?("SENDABLE_PROJECT_ID")
    @project_id = ENV["SENDABLE_PROJECT_ID"]
  else
    @project_id = nil
  end

  if ENV.has_key?("SENDABLE_API_KEY")
    @api_key = ENV["SENDABLE_API_KEY"]
  else
    @api_key = ""
  end
end