Class: Axel::Configurations::Service

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, url) ⇒ Service

Returns a new instance of Service.



13
14
15
16
17
# File 'lib/axel/configurations/service.rb', line 13

def initialize(name, url)
  @name = name.to_s.singularize
  @resources = {}.with_indifferent_access
  @url = url.to_s
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/axel/configurations/service.rb', line 5

def name
  @name
end

#resourcesObject (readonly)

Returns the value of attribute resources.



7
8
9
# File 'lib/axel/configurations/service.rb', line 7

def resources
  @resources
end

#urlObject



19
20
21
# File 'lib/axel/configurations/service.rb', line 19

def url
  manual_environment_set? ? Uri.new(@url).to(*environment).to_s : @url
end

Instance Method Details

#add_resource(resource_name, options = {}) ⇒ Object



23
24
25
# File 'lib/axel/configurations/service.rb', line 23

def add_resource(resource_name, options = {})
  resources[resource_name] = Configurations::Resource.new(resource_name, self, options)
end