Module: PUBG::Configurable

Included in:
PUBG, Client
Defined in:
lib/pubg/configurable.rb

Overview

Configuration options for Client

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/pubg/configurable.rb', line 4

def access_token
  @access_token
end

#api_endpointObject (readonly)

Returns the value of attribute api_endpoint.



5
6
7
# File 'lib/pubg/configurable.rb', line 5

def api_endpoint
  @api_endpoint
end

#connection_optionsObject (readonly)

Returns the value of attribute connection_options.



5
6
7
# File 'lib/pubg/configurable.rb', line 5

def connection_options
  @connection_options
end

#regionObject

Returns the value of attribute region.



4
5
6
# File 'lib/pubg/configurable.rb', line 4

def region
  @region
end

Class Method Details

.keysObject



8
9
10
# File 'lib/pubg/configurable.rb', line 8

def keys
  @keys || i[access_token region connection_options api_endpoint]
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



13
14
15
# File 'lib/pubg/configurable.rb', line 13

def configure
  yield self
end

#reset!Object



17
18
19
20
21
22
# File 'lib/pubg/configurable.rb', line 17

def reset!
  PUBG::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", PUBG::Default.options[key])
  end
  self
end