Class: TBK::Config

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

Instance Method Summary collapse

Instance Method Details

#commerce_id(id = nil) ⇒ Object

Set and gets the default commerce id



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

def commerce_id(id = nil)
  @id = id if id
  @id || ENV['TBK_COMMERCE_ID']
end

#commerce_key(key = nil) ⇒ Object

Sets and gets the default commerce key



11
12
13
14
# File 'lib/tbk/config.rb', line 11

def commerce_key(key = nil)
  @key = key if key
  @key || ENV['TBK_COMMERCE_KEY']
end

#environment(environment = nil) ⇒ Symbol

Sets the default commerce environment

Returns:

  • (Symbol)

    the default commerce environment



18
19
20
21
# File 'lib/tbk/config.rb', line 18

def environment(environment = nil)
  @environment = environment if environment
  (@environment || ENV['TBK_COMMERCE_ENVIRONMENT'] || :production).to_sym
end

#ssl_verify_mode(mode = nil) ⇒ Object



23
24
25
26
# File 'lib/tbk/config.rb', line 23

def ssl_verify_mode(mode = nil)
  @ssl_verify_mode = mode if mode
  @ssl_verify_mode || OpenSSL::SSL::VERIFY_PEER
end