Module: BWAPI::Configuration

Included in:
BWAPI, Client
Defined in:
lib/bwapi/configuration.rb

Overview

Configuration module

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#access_tokenObject

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_expiryObject

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

#adapterObject

Returns the value of attribute adapter.



4
5
6
# File 'lib/bwapi/configuration.rb', line 4

def adapter
  @adapter
end

#api_endpointObject

Returns the value of attribute api_endpoint.



4
5
6
# File 'lib/bwapi/configuration.rb', line 4

def api_endpoint
  @api_endpoint
end

#client_idObject

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

Parameters:

  • value

    the value to set the attribute client_secret to.



7
8
9
# File 'lib/bwapi/configuration.rb', line 7

def client_secret=(value)
  @client_secret = value
end

#debugObject

Returns the value of attribute debug.



4
5
6
# File 'lib/bwapi/configuration.rb', line 4

def debug
  @debug
end

#grant_typeObject

Returns the value of attribute grant_type.



4
5
6
# File 'lib/bwapi/configuration.rb', line 4

def grant_type
  @grant_type
end

#loggerObject

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

Parameters:

  • value

    the value to set the attribute password to.



7
8
9
# File 'lib/bwapi/configuration.rb', line 7

def password=(value)
  @password = value
end

#performanceObject

Returns the value of attribute performance.



4
5
6
# File 'lib/bwapi/configuration.rb', line 4

def performance
  @performance
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



4
5
6
# File 'lib/bwapi/configuration.rb', line 4

def refresh_token
  @refresh_token
end

#user_agentObject

Returns the value of attribute user_agent.



4
5
6
# File 'lib/bwapi/configuration.rb', line 4

def user_agent
  @user_agent
end

#usernameObject

Returns the value of attribute username.



4
5
6
# File 'lib/bwapi/configuration.rb', line 4

def username
  @username
end

#verify_sslObject

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

.keysObject

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

Yields:

  • (_self)

Yield Parameters:



34
35
36
# File 'lib/bwapi/configuration.rb', line 34

def configure
  yield self
end

#destroyObject



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

#resetObject



38
39
40
41
# File 'lib/bwapi/configuration.rb', line 38

def reset
  BWAPI::Configuration.keys.each { |key| instance_variable_set(:"@#{key}", BWAPI::Default.options[key]) }
  self
end