Module: Compropago

Defined in:
lib/compropago.rb,
lib/compropago/sms.rb,
lib/compropago/base.rb,
lib/compropago/charge.rb,
lib/compropago/client.rb,
lib/compropago/version.rb,
lib/compropago/connection.rb,
lib/compropago/configuration.rb

Defined Under Namespace

Modules: Connection Classes: Base, Charge, Client, SMS

Constant Summary collapse

VERSION =
"0.1.2"

Class Method Summary collapse

Class Method Details

.api_keyObject



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

def self.api_key
  @api_key
end

.api_key=(api_key) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/compropago/configuration.rb', line 17

def self.api_key=(api_key)
  @api_key = api_key
  ActiveRestClient::Base.faraday_config do |faraday|
    faraday.request  :basic_auth, api_key, nil
    faraday.request  :url_encoded             # form-encode POST params
    faraday.response :logger                  # log requests to STDOUT
    faraday.response :raise_error
    faraday.adapter  Faraday.default_adapter  # make requests with Net::HTTP

    #FIXME https://github.com/lostisland/faraday/wiki/Setting-up-SSL-certificates#solutions-to-avoid
    faraday.ssl.merge!({ verify: false })
  end
end

.api_urlObject



13
14
15
# File 'lib/compropago/configuration.rb', line 13

def self.api_url
  ActiveRestClient::Base.base_url
end

.api_url=(api_url) ⇒ Object



31
32
33
# File 'lib/compropago/configuration.rb', line 31

def self.api_url=(api_url)
  ActiveRestClient::Base.base_url = api_url
end