Class: JustGiving::Configuration
- Inherits:
-
Object
- Object
- JustGiving::Configuration
- Defined in:
- lib/just_giving/configuration.rb
Constant Summary collapse
- BASE_URI_MAP =
{ :production => "http://www.justgiving.com", :staging => "http://v3-staging.justgiving.com", :sandbox => "http://v3-sandbox.justgiving.com" }
- @@application_id =
nil
- @@environment =
:staging
- @@ca_path =
"/usr/lib/ssl/certs"
Class Method Summary collapse
-
.api_endpoint ⇒ Object
The API endpoint.
-
.application_id ⇒ Object
This is your Just Giving application id.
- .application_id=(id) ⇒ Object
- .base_uri ⇒ Object
- .ca_path ⇒ Object
-
.ca_path=(path) ⇒ Object
Path to the systems CA cert bundles.
- .environment ⇒ Object
-
.environment=(env) ⇒ Object
This can be :sandbox, :staging or :production and sets what endpoint to use.
- .password ⇒ Object
- .password=(password) ⇒ Object
-
.username ⇒ Object
Username/password for basic auth.
- .username=(username) ⇒ Object
Class Method Details
.api_endpoint ⇒ Object
The API endpoint
36 37 38 39 40 41 42 43 |
# File 'lib/just_giving/configuration.rb', line 36 def self.api_endpoint raise JustGiving::InvalidApplicationId.new if !application_id case environment when :sandbox then "https://api-sandbox.justgiving.com/#{application_id}" when :staging then "https://api-staging.justgiving.com/#{application_id}" else "https://api.justgiving.com/#{application_id}" end end |
.application_id ⇒ Object
This is your Just Giving application id
14 15 16 |
# File 'lib/just_giving/configuration.rb', line 14 def self.application_id @@application_id end |
.application_id=(id) ⇒ Object
18 19 20 |
# File 'lib/just_giving/configuration.rb', line 18 def self.application_id=(id) @@application_id = id end |
.base_uri ⇒ Object
22 23 24 |
# File 'lib/just_giving/configuration.rb', line 22 def self.base_uri BASE_URI_MAP[self.environment] end |
.ca_path ⇒ Object
50 51 52 |
# File 'lib/just_giving/configuration.rb', line 50 def self.ca_path @@ca_path end |
.ca_path=(path) ⇒ Object
Path to the systems CA cert bundles
46 47 48 |
# File 'lib/just_giving/configuration.rb', line 46 def self.ca_path=(path) @@ca_path = path end |
.environment ⇒ Object
31 32 33 |
# File 'lib/just_giving/configuration.rb', line 31 def self.environment @@environment end |
.environment=(env) ⇒ Object
This can be :sandbox, :staging or :production and sets what endpoint to use
27 28 29 |
# File 'lib/just_giving/configuration.rb', line 27 def self.environment=(env) @@environment = env end |
.password ⇒ Object
67 68 69 |
# File 'lib/just_giving/configuration.rb', line 67 def self.password @@password end |
.password=(password) ⇒ Object
63 64 65 |
# File 'lib/just_giving/configuration.rb', line 63 def self.password=(password) @@password = password end |
.username ⇒ Object
Username/password for basic auth
55 56 57 |
# File 'lib/just_giving/configuration.rb', line 55 def self.username @@username end |
.username=(username) ⇒ Object
59 60 61 |
# File 'lib/just_giving/configuration.rb', line 59 def self.username=(username) @@username = username end |