Module: HelpScoutDocs::Default
- Defined in:
- lib/help_scout_docs/default.rb
Constant Summary collapse
- ENDPOINT =
Faraday.default_adapter = :net_http_persistent
'https://docsapi.helpscout.net/v1/'
- MIDDLEWARE =
Faraday::Builder.new do |builder| # Encode request params as "www-form-urlencoded" builder.use Faraday::Request::UrlEncoded # Parse JSON response bodies builder.use HelpScoutDocs::Response::ParseJson#, content_type: /\bjson$/ # Use Faraday logger builder.use Faraday::Response::Logger if ENV['DEBUG'] # Set Faraday's HTTP adapter builder.adapter Faraday.default_adapter end
Class Method Summary collapse
- .api_key ⇒ String
- .api_password ⇒ String
- .endpoint ⇒ String
- .middleware ⇒ Faraday::Builder
- .options ⇒ Hash
Class Method Details
.api_key ⇒ String
31 32 33 |
# File 'lib/help_scout_docs/default.rb', line 31 def api_key ENV['HELP_SCOUT_DOCS_API_KEY'] end |
.api_password ⇒ String
36 37 38 |
# File 'lib/help_scout_docs/default.rb', line 36 def api_password ENV['HELP_SCOUT_DOCS_API_PASSWORD'] || "X" end |
.endpoint ⇒ String
41 42 43 |
# File 'lib/help_scout_docs/default.rb', line 41 def endpoint ENDPOINT end |
.middleware ⇒ Faraday::Builder
Note:
Faraday’s middleware stack implementation is comparable to that of Rack middleware. The order of middleware is important: the first middleware on the list wraps all others, while the last middleware is the innermost one.
49 50 51 |
# File 'lib/help_scout_docs/default.rb', line 49 def middleware MIDDLEWARE end |
.options ⇒ Hash
26 27 28 |
# File 'lib/help_scout_docs/default.rb', line 26 def Hash[HelpScoutDocs::Configurable.keys.map{|key| [key, send(key)]}] end |