Class: ApiProxy::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/api_proxy/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



7
8
9
# File 'lib/api_proxy/config.rb', line 7

def initialize
  load_defaults
end

Instance Attribute Details

#api_hostObject

Returns the value of attribute api_host.



5
6
7
# File 'lib/api_proxy/config.rb', line 5

def api_host
  @api_host
end

#api_keyObject

Returns the value of attribute api_key.



5
6
7
# File 'lib/api_proxy/config.rb', line 5

def api_key
  @api_key
end

#api_portObject

Returns the value of attribute api_port.



5
6
7
# File 'lib/api_proxy/config.rb', line 5

def api_port
  @api_port
end

#api_prefixObject

Returns the value of attribute api_prefix.



5
6
7
# File 'lib/api_proxy/config.rb', line 5

def api_prefix
  @api_prefix
end

#api_secretObject

Returns the value of attribute api_secret.



5
6
7
# File 'lib/api_proxy/config.rb', line 5

def api_secret
  @api_secret
end

#request_starts_withObject

Returns the value of attribute request_starts_with.



5
6
7
# File 'lib/api_proxy/config.rb', line 5

def request_starts_with
  @request_starts_with
end

#url_schemeObject

Returns the value of attribute url_scheme.



5
6
7
# File 'lib/api_proxy/config.rb', line 5

def url_scheme
  @url_scheme
end

Instance Method Details

#load_defaultsObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/api_proxy/config.rb', line 11

def load_defaults
  @api_key = 'key'
  @api_secret = 'secret'

  @url_scheme = 'http'
  @api_host = 'localhost'
  @api_port = 3000

  @api_prefix = '/api/v1/'
  @request_starts_with = '/_ts'
end