Class: Mercadopago::Config
- Inherits:
-
Object
- Object
- Mercadopago::Config
- Defined in:
- lib/mercadopago/config/config.rb
Overview
Holds SDK-wide configuration constants: version, API base URL, User-Agent header, tracking identifiers, and MIME types.
Instances are created internally by MPBase and RequestOptions; there is no need to instantiate this class directly.
Constant Summary collapse
- @@VERSION =
Current SDK version following SemVer.
'3.0.1'- @@USER_AGENT =
User-Agent string sent with every HTTP request for server-side tracking.
"MercadoPago Ruby SDK v#{@@VERSION}"- @@PRODUCT_ID =
Internal product identifier registered with the MercadoPago platform.
'bc32a7vtrpp001u8nhjg'- @@TRACKING_ID =
Tracking string that reports Ruby version and SDK version to the API.
"platform:#{RUBY_VERSION},type:SDK#{@@VERSION},so;"- @@API_BASE_URL =
Base URL for all MercadoPago REST API endpoints.
'https://api.mercadopago.com'- @@MIME_JSON =
MIME type used for JSON request/response bodies.
'application/json'- @@MIME_FORM =
MIME type used for form-encoded request bodies.
'application/x-www-form-urlencoded'
Instance Method Summary collapse
-
#api_base_url ⇒ String
MercadoPago API base URL.
-
#mime_form ⇒ String
Form-encoded MIME type.
-
#mime_json ⇒ String
JSON MIME type.
-
#product_id ⇒ String
MercadoPago internal product identifier.
-
#tracking_id ⇒ String
Tracking string with Ruby and SDK versions.
-
#user_agent ⇒ String
User-Agent header value.
-
#version ⇒ String
Current SDK version (e.g. “3.0.0”).
Instance Method Details
#api_base_url ⇒ String
Returns MercadoPago API base URL.
53 54 55 |
# File 'lib/mercadopago/config/config.rb', line 53 def api_base_url @@API_BASE_URL end |
#mime_form ⇒ String
Returns form-encoded MIME type.
63 64 65 |
# File 'lib/mercadopago/config/config.rb', line 63 def mime_form @@MIME_FORM end |
#mime_json ⇒ String
Returns JSON MIME type.
58 59 60 |
# File 'lib/mercadopago/config/config.rb', line 58 def mime_json @@MIME_JSON end |
#product_id ⇒ String
Returns MercadoPago internal product identifier.
43 44 45 |
# File 'lib/mercadopago/config/config.rb', line 43 def product_id @@PRODUCT_ID end |
#tracking_id ⇒ String
Returns tracking string with Ruby and SDK versions.
48 49 50 |
# File 'lib/mercadopago/config/config.rb', line 48 def tracking_id @@TRACKING_ID end |
#user_agent ⇒ String
Returns User-Agent header value.
38 39 40 |
# File 'lib/mercadopago/config/config.rb', line 38 def user_agent @@USER_AGENT end |
#version ⇒ String
Returns current SDK version (e.g. “3.0.0”).
33 34 35 |
# File 'lib/mercadopago/config/config.rb', line 33 def version @@VERSION end |