Class: Paddle::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
15
# File 'lib/paddle/configuration.rb', line 11

def initialize
  @environment ||= :production
  @version ||= 1
  @connection_options = {}
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



8
9
10
# File 'lib/paddle/configuration.rb', line 8

def api_key
  @api_key
end

#connection_optionsObject

Returns the value of attribute connection_options.



9
10
11
# File 'lib/paddle/configuration.rb', line 9

def connection_options
  @connection_options
end

#environmentObject

Returns the value of attribute environment.



5
6
7
# File 'lib/paddle/configuration.rb', line 5

def environment
  @environment
end

#versionObject

Returns the value of attribute version.



7
8
9
# File 'lib/paddle/configuration.rb', line 7

def version
  @version
end

Instance Method Details

#urlObject



25
26
27
28
29
30
31
32
# File 'lib/paddle/configuration.rb', line 25

def url
  case @environment
  when :production
    "https://api.paddle.com"
  when :development, :sandbox
    "https://sandbox-api.paddle.com"
  end
end