Sha256: c93fc0db5f66684239294fefd948af795bef2d63460c017855a29277ff11f5e1
Contents?: true
Size: 789 Bytes
Versions: 13
Compression:
Stored size: 789 Bytes
Contents
module MyApi include NCore::Builder configure do self.default_url = 'https://api.example.com/v1/' self.default_headers = { accept: 'application/json', content_type: 'application/json', user_agent: "MyApi/ruby v#{VERSION}" } if ENV['API_USER'] && ENV['API_KEY'] self.credentials = { api_user: ENV['API_USER'], api_key: ENV['API_KEY'] } end self.debug = false self.strict_attributes = false self.instrument_key = 'request.my_api' self.status_page = 'http://my.api.status.page' self.auth_header_prefix = 'X-MyApi' self.credentials_error_message = %Q{Missing API credentials. Set default credentials using "MyApi.credentials = {api_user: YOUR_API_USER, api_key: YOUR_API_KEY}"} end end
Version data entries
13 entries across 13 versions & 1 rubygems