Class: Axel::Configurator

Inherits:
Object
  • Object
show all
Defined in:
lib/axel/configurator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfigurator

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

#environmentObject

Returns the value of attribute environment.



12
13
14
# File 'lib/axel/configurator.rb', line 12

def environment
  @environment
end

#environment_uri_configObject

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

#proxyObject

Returns the value of attribute proxy.



11
12
13
# File 'lib/axel/configurator.rb', line 11

def proxy
  @proxy
end

#proxy_request_optionsObject (readonly)

Returns the value of attribute proxy_request_options.



14
15
16
# File 'lib/axel/configurator.rb', line 14

def proxy_request_options
  @proxy_request_options
end

#servicesObject

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

Parameters:

  • value

    the value to set the attribute uses_rails_api to.



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, options = {})
  services.add_resource service_name, resource_name, options
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

Returns:

  • (Boolean)


38
39
40
# File 'lib/axel/configurator.rb', line 38

def manual_environment_set?
  self.environment.present?
end

#resourcesObject



25
26
27
# File 'lib/axel/configurator.rb', line 25

def resources
  services.resources
end

#service_configsObject



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, request_options = {})
  self.proxy = ApiProxy.new url, request_options
  proxy.register!
end

#uses_rails_api?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/axel/configurator.rb', line 50

def uses_rails_api?
  !!@uses_rails_api
end