Module: BWAPI::Configuration
Overview
Configuration module
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#access_token_expiry ⇒ Object
Returns the value of attribute access_token_expiry.
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
writeonly
Sets the attribute client_secret.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#grant_type ⇒ Object
Returns the value of attribute grant_type.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#password ⇒ Object
writeonly
Sets the attribute password.
-
#performance ⇒ Object
Returns the value of attribute performance.
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
-
#username ⇒ Object
Returns the value of attribute username.
-
#verify_ssl ⇒ Object
Returns the value of attribute verify_ssl.
Class Method Summary collapse
-
.keys ⇒ Object
Configuration keys.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Set configuration options using a block.
- #destroy ⇒ Object
- #reset ⇒ Object
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def access_token @access_token end |
#access_token_expiry ⇒ Object
Returns the value of attribute access_token_expiry.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def access_token_expiry @access_token_expiry end |
#adapter ⇒ Object
Returns the value of attribute adapter.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def adapter @adapter end |
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def api_endpoint @api_endpoint end |
#client_id ⇒ Object
Returns the value of attribute client_id.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def client_id @client_id end |
#client_secret=(value) ⇒ Object
Sets the attribute client_secret
7 8 9 |
# File 'lib/bwapi/configuration.rb', line 7 def client_secret=(value) @client_secret = value end |
#debug ⇒ Object
Returns the value of attribute debug.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def debug @debug end |
#grant_type ⇒ Object
Returns the value of attribute grant_type.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def grant_type @grant_type end |
#logger ⇒ Object
Returns the value of attribute logger.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def logger @logger end |
#password=(value) ⇒ Object
Sets the attribute password
7 8 9 |
# File 'lib/bwapi/configuration.rb', line 7 def password=(value) @password = value end |
#performance ⇒ Object
Returns the value of attribute performance.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def performance @performance end |
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def refresh_token @refresh_token end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def user_agent @user_agent end |
#username ⇒ Object
Returns the value of attribute username.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def username @username end |
#verify_ssl ⇒ Object
Returns the value of attribute verify_ssl.
4 5 6 |
# File 'lib/bwapi/configuration.rb', line 4 def verify_ssl @verify_ssl end |
Class Method Details
.keys ⇒ Object
Configuration keys
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/bwapi/configuration.rb', line 11 def keys @keys ||= [ :access_token, :access_token_expiry, :adapter, :api_endpoint, :client_id, :client_secret, :connection_options, :debug, :grant_type, :logger, :password, :performance, :refresh_token, :user_agent, :username, :verify_ssl ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Set configuration options using a block
34 35 36 |
# File 'lib/bwapi/configuration.rb', line 34 def configure yield self end |
#destroy ⇒ Object
43 44 45 46 |
# File 'lib/bwapi/configuration.rb', line 43 def destroy BWAPI::Configuration.keys.each { |key| instance_variable_set(:"@#{key}", nil) } self end |
#reset ⇒ Object
38 39 40 41 |
# File 'lib/bwapi/configuration.rb', line 38 def reset BWAPI::Configuration.keys.each { |key| instance_variable_set(:"@#{key}", BWAPI::Default.[key]) } self end |