Class: Braspag::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/braspag/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(merchant_id, environment = :production) ⇒ Connection

Returns a new instance of Connection.



5
6
7
8
9
10
# File 'lib/braspag/connection.rb', line 5

def initialize(merchant_id, environment = :production)
  environment = :test unless environment.eql? :production
  @environment = eval(environment.to_s.capitalize)
  @base_url = @environment::BASE_URL
  @merchant_id = merchant_id
end

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



3
4
5
# File 'lib/braspag/connection.rb', line 3

def base_url
  @base_url
end

#environmentObject (readonly)

Returns the value of attribute environment.



3
4
5
# File 'lib/braspag/connection.rb', line 3

def environment
  @environment
end

#merchant_idObject (readonly)

Returns the value of attribute merchant_id.



3
4
5
# File 'lib/braspag/connection.rb', line 3

def merchant_id
  @merchant_id
end