Class: Braspag::Environment

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

Overview

API Environment URLs

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api, api_query) ⇒ Environment

Returns a new instance of Environment.



10
11
12
13
# File 'lib/braspag/environment.rb', line 10

def initialize(api, api_query)
    @api = api
    @api_query = api_query
end

Instance Attribute Details

#apiString

API URL

Returns:

  • (String)

    the current value of api



6
7
8
# File 'lib/braspag/environment.rb', line 6

def api
  @api
end

#api_queryObject

Returns the value of attribute api_query.



7
8
9
# File 'lib/braspag/environment.rb', line 7

def api_query
  @api_query
end

#apiQueryString

API Query URL

Returns:

  • (String)

    the current value of apiQuery



6
7
8
# File 'lib/braspag/environment.rb', line 6

def apiQuery
  @apiQuery
end

Class Method Details

.productionEnvironment

The production environment

Returns:

  • (Environment)

    a configured Environment for production



18
19
20
21
# File 'lib/braspag/environment.rb', line 18

def self.production()
    return Environment.new("https://api.braspag.com.br/",
                           "https://apiquery.braspag.com.br/")
end

.sandboxEnvironment

The sandbox environment

Returns:

  • (Environment)

    a configured Environment for testing



26
27
28
29
# File 'lib/braspag/environment.rb', line 26

def self.sandbox()
    return Environment.new("https://apisandbox.braspag.com.br/",
                           "https://apiquerysandbox.braspag.com.br/")
end