Module: Vindi::Default
- Defined in:
- lib/vindi/default.rb
Constant Summary collapse
- API_ENDPOINT =
Default API endpoint
'https://app.vindi.com.br/api/v1/'.freeze
- MEDIA_TYPE =
Default media type
'application/vnd.api+json'.freeze
- USER_AGENT =
Default User Agent header string
"Vindi-Ruby/#{Vindi::VERSION}".freeze
- MIDDLEWARE =
Vindi::Response::RaiseError
Class Method Summary collapse
-
.api_endpoint ⇒ String
Default api endpoint string from ENV or API_ENDPOINT.
- .connection_options ⇒ Object
-
.default_media_type ⇒ String
Default media type header string from ENV or MEDIA_TYPE.
-
.key ⇒ String
Default user KEY string from ENV.
- .middleware ⇒ Object
-
.options ⇒ Hash
Default Settings for Vindi Ruby Gem.
-
.user_agent ⇒ String
Default User-Agent header string from ENV or USER_AGENT.
Class Method Details
.api_endpoint ⇒ String
Default api endpoint string from ENV or API_ENDPOINT
21 22 23 |
# File 'lib/vindi/default.rb', line 21 def api_endpoint ENV['VINDI_API_ENDPOINT'] || API_ENDPOINT end |
.connection_options ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/vindi/default.rb', line 47 def { headers: { 'User-Agent': user_agent } } end |
.default_media_type ⇒ String
Default media type header string from ENV or MEDIA_TYPE
27 28 29 |
# File 'lib/vindi/default.rb', line 27 def default_media_type ENV['VINDI_MEDIA_TYPE'] || MEDIA_TYPE end |
.key ⇒ String
Default user KEY string from ENV
33 34 35 |
# File 'lib/vindi/default.rb', line 33 def key ENV['VINDI_KEY'] end |
.middleware ⇒ Object
43 44 45 |
# File 'lib/vindi/default.rb', line 43 def middleware MIDDLEWARE end |
.options ⇒ Hash
Default Settings for Vindi Ruby Gem
57 58 59 60 |
# File 'lib/vindi/default.rb', line 57 def Hash[Vindi::Configuration.keys .map{ |key| [key, send(key)] }] end |
.user_agent ⇒ String
Default User-Agent header string from ENV or USER_AGENT
39 40 41 |
# File 'lib/vindi/default.rb', line 39 def user_agent ENV['VINDI_USER_AGENT'] || USER_AGENT end |