lib/affirm/configuration.rb in affirm-ruby-1.0.1 vs lib/affirm/configuration.rb in affirm-ruby-1.0.2
- old
+ new
@@ -1,17 +1,21 @@
module Affirm
class Configuration
attr_accessor :public_api_key
attr_accessor :private_api_key
- attr_accessor :environment
+ attr_reader :environment
ENDPOINTS = {
production: "api.affirm.com",
sandbox: "sandbox.affirm.com"
}
def initialize
@environment = :production
+ end
+
+ def environment=(env)
+ @environment = env.to_sym
end
def endpoint
"https://#{ENDPOINTS[environment]}"
end