Class: Axel::Configurator
- Inherits:
-
Object
- Object
- Axel::Configurator
- Defined in:
- lib/axel/configurator.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#environment_uri_config ⇒ Object
Returns the value of attribute environment_uri_config.
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
-
#proxy_request_options ⇒ Object
readonly
Returns the value of attribute proxy_request_options.
-
#services ⇒ Object
readonly
Returns the value of attribute services.
-
#uses_rails_api ⇒ Object
writeonly
Sets the attribute uses_rails_api.
Instance Method Summary collapse
- #add_resource(service_name, resource_name, options = {}) ⇒ Object
- #add_service(service_name, url) ⇒ Object
-
#initialize ⇒ Configurator
constructor
A new instance of Configurator.
- #manual_environment_set? ⇒ Boolean
- #resources ⇒ Object
- #service_configs ⇒ Object
- #set_environment(name, stage_number = nil) ⇒ Object
- #setup_proxy(url, request_options = {}) ⇒ Object
- #uses_rails_api? ⇒ Boolean
Constructor Details
#initialize ⇒ Configurator
Returns a new instance of Configurator.
17 18 19 |
# File 'lib/axel/configurator.rb', line 17 def initialize self.services = Configurators::Services.new end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
12 13 14 |
# File 'lib/axel/configurator.rb', line 12 def environment @environment end |
#environment_uri_config ⇒ Object
Returns the value of attribute environment_uri_config.
15 16 17 |
# File 'lib/axel/configurator.rb', line 15 def environment_uri_config @environment_uri_config end |
#proxy ⇒ Object
Returns the value of attribute proxy.
11 12 13 |
# File 'lib/axel/configurator.rb', line 11 def proxy @proxy end |
#proxy_request_options ⇒ Object (readonly)
Returns the value of attribute proxy_request_options.
14 15 16 |
# File 'lib/axel/configurator.rb', line 14 def @proxy_request_options end |
#services ⇒ Object
Returns the value of attribute services.
10 11 12 |
# File 'lib/axel/configurator.rb', line 10 def services @services end |
#uses_rails_api=(value) ⇒ Object (writeonly)
Sets the attribute uses_rails_api
13 14 15 |
# File 'lib/axel/configurator.rb', line 13 def uses_rails_api=(value) @uses_rails_api = value end |
Instance Method Details
#add_resource(service_name, resource_name, options = {}) ⇒ Object
46 47 48 |
# File 'lib/axel/configurator.rb', line 46 def add_resource(service_name, resource_name, = {}) services.add_resource service_name, resource_name, end |
#add_service(service_name, url) ⇒ Object
42 43 44 |
# File 'lib/axel/configurator.rb', line 42 def add_service(service_name, url) services.add_service service_name, url end |
#manual_environment_set? ⇒ Boolean
38 39 40 |
# File 'lib/axel/configurator.rb', line 38 def manual_environment_set? self.environment.present? end |
#resources ⇒ Object
25 26 27 |
# File 'lib/axel/configurator.rb', line 25 def resources services.resources end |
#service_configs ⇒ Object
21 22 23 |
# File 'lib/axel/configurator.rb', line 21 def service_configs services.services end |
#set_environment(name, stage_number = nil) ⇒ Object
34 35 36 |
# File 'lib/axel/configurator.rb', line 34 def set_environment(name, stage_number = nil) self.environment = [name, stage_number] end |
#setup_proxy(url, request_options = {}) ⇒ Object
29 30 31 32 |
# File 'lib/axel/configurator.rb', line 29 def setup_proxy(url, = {}) self.proxy = ApiProxy.new url, proxy.register! end |
#uses_rails_api? ⇒ Boolean
50 51 52 |
# File 'lib/axel/configurator.rb', line 50 def uses_rails_api? !!@uses_rails_api end |