Class: ApiProxy::Config
- Inherits:
-
Object
- Object
- ApiProxy::Config
- Defined in:
- lib/api_proxy/config.rb
Instance Attribute Summary collapse
-
#api_host ⇒ Object
Returns the value of attribute api_host.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_port ⇒ Object
Returns the value of attribute api_port.
-
#api_prefix ⇒ Object
Returns the value of attribute api_prefix.
-
#api_secret ⇒ Object
Returns the value of attribute api_secret.
-
#custom_headers ⇒ Object
Returns the value of attribute custom_headers.
-
#reject_params ⇒ Object
Returns the value of attribute reject_params.
-
#request_allowed ⇒ Object
Returns the value of attribute request_allowed.
-
#request_starts_with ⇒ Object
Returns the value of attribute request_starts_with.
-
#url_scheme ⇒ Object
Returns the value of attribute url_scheme.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #load_defaults ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
16 17 18 |
# File 'lib/api_proxy/config.rb', line 16 def initialize load_defaults end |
Instance Attribute Details
#api_host ⇒ Object
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_key ⇒ Object
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_port ⇒ Object
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_prefix ⇒ Object
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_secret ⇒ Object
Returns the value of attribute api_secret.
5 6 7 |
# File 'lib/api_proxy/config.rb', line 5 def api_secret @api_secret end |
#custom_headers ⇒ Object
Returns the value of attribute custom_headers.
5 6 7 |
# File 'lib/api_proxy/config.rb', line 5 def custom_headers @custom_headers end |
#reject_params ⇒ Object
Returns the value of attribute reject_params.
5 6 7 |
# File 'lib/api_proxy/config.rb', line 5 def reject_params @reject_params end |
#request_allowed ⇒ Object
Returns the value of attribute request_allowed.
5 6 7 |
# File 'lib/api_proxy/config.rb', line 5 def request_allowed @request_allowed end |
#request_starts_with ⇒ Object
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_scheme ⇒ Object
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_defaults ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/api_proxy/config.rb', line 20 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' @request_allowed = ->(_env) { true } @custom_headers = ->(_env) { {} } @reject_params = %w[utf8 authenticity_token commit format controller action] end |