Module: AirbrakeAPI::Configuration
- Included in:
- AirbrakeAPI
- Defined in:
- lib/airbrake-api/configuration.rb
Constant Summary collapse
- VALID_OPTIONS_KEYS =
[ :account, :auth_token, :secure, :connection_options, :adapter, :user_agent]
- DEFAULT_ADAPTER =
:net_http
- DEFAULT_USER_AGENT =
"AirbrakeAPI Ruby Gem #{AirbrakeAPI::VERSION}"
- DEFAULT_CONNECTION_OPTIONS =
{}
Class Method Summary collapse
Instance Method Summary collapse
- #account_path ⇒ Object
- #configure(options = {}) {|_self| ... } ⇒ Object
- #options ⇒ Object
- #protocol ⇒ Object
- #reset ⇒ Object
Class Method Details
.extended(base) ⇒ Object
19 20 21 |
# File 'lib/airbrake-api/configuration.rb', line 19 def self.extended(base) base.reset end |
Instance Method Details
#account_path ⇒ Object
37 38 39 |
# File 'lib/airbrake-api/configuration.rb', line 37 def account_path "#{protocol}://#{@account}.airbrake.io" end |
#configure(options = {}) {|_self| ... } ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/airbrake-api/configuration.rb', line 23 def configure(={}) @account = [:account] if .has_key?(:account) @auth_token = [:auth_token] if .has_key?(:auth_token) @secure = [:secure] if .has_key?(:secure) yield self if block_given? self end |
#options ⇒ Object
31 32 33 34 35 |
# File 'lib/airbrake-api/configuration.rb', line 31 def = {} VALID_OPTIONS_KEYS.each{|k| [k] = send(k)} end |
#protocol ⇒ Object
41 42 43 |
# File 'lib/airbrake-api/configuration.rb', line 41 def protocol @secure ? "https" : "http" end |
#reset ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/airbrake-api/configuration.rb', line 45 def reset @account = nil @auth_token = nil @secure = false @adapter = DEFAULT_ADAPTER @user_agent = DEFAULT_USER_AGENT @connection_options = DEFAULT_CONNECTION_OPTIONS end |