Module: Croudia::Default
- Defined in:
- lib/croudia/default.rb
Constant Summary collapse
- ENDPOINT =
'https://api.croudia.com'
- CONNECTION_OPTIONS =
{ headers: { accept: 'application/json', user_agent: "Croudia Ruby Gem/#{Croudia::VERSION}", }, request: { open_timeout: 10, timeout: 30, }, ssl: { verify: true, }, }
- MIDDLEWARE =
Faraday::Builder.new do |builder| builder.request :multipart_with_file builder.request :multipart builder.request :url_encoded builder.request :raise_error builder.response :raise_error builder.response :parse_json builder.adapter Faraday.default_adapter end
Class Method Summary collapse
- .access_token ⇒ Object
- .client_id ⇒ Object
- .client_secret ⇒ Object
- .connection_options ⇒ Object
- .endpoint ⇒ Object
- .middleware ⇒ Object
- .options ⇒ Object
Class Method Details
.access_token ⇒ Object
53 54 55 |
# File 'lib/croudia/default.rb', line 53 def access_token ENV['CROUDIA_ACCESS_TOKEN'] end |
.client_id ⇒ Object
45 46 47 |
# File 'lib/croudia/default.rb', line 45 def client_id ENV['CROUDIA_CLIENT_ID'] end |
.client_secret ⇒ Object
49 50 51 |
# File 'lib/croudia/default.rb', line 49 def client_secret ENV['CROUDIA_CLIENT_SECRET'] end |
.connection_options ⇒ Object
61 62 63 |
# File 'lib/croudia/default.rb', line 61 def CONNECTION_OPTIONS end |
.endpoint ⇒ Object
57 58 59 |
# File 'lib/croudia/default.rb', line 57 def endpoint ENDPOINT end |
.middleware ⇒ Object
65 66 67 |
# File 'lib/croudia/default.rb', line 65 def middleware MIDDLEWARE end |
.options ⇒ Object
39 40 41 42 43 |
# File 'lib/croudia/default.rb', line 39 def Hash[Croudia::Configurable.keys.map do |key| [key, __send__(key)] end] end |