Class: Servitor::ServiceDefinition

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location = nil, service_root = nil) ⇒ ServiceDefinition

Returns a new instance of ServiceDefinition.



24
25
26
27
28
29
30
31
# File 'lib/service/service_definition/service_definition.rb', line 24

def initialize(location=nil, service_root=nil)
  @location = location
  @service_root = service_root
  @depends_on = []
  @deployment_stages = DeploymentStages.new
  @infrastructure_requirements = InfrastructureRequirements.new
  @configuration = ServiceConfiguration.new
end

Instance Attribute Details

#locationObject (readonly)

these are derived at load time



22
23
24
# File 'lib/service/service_definition/service_definition.rb', line 22

def location
  @location
end

#service_rootObject (readonly)

these are derived at load time



22
23
24
# File 'lib/service/service_definition/service_definition.rb', line 22

def service_root
  @service_root
end

Instance Method Details

#configuration(&block) ⇒ Object



43
44
45
46
# File 'lib/service/service_definition/service_definition.rb', line 43

def configuration(&block)
  @configuration.instance_exec(&block) if block_given?
  @configuration
end

#deployment_stages(*args, &block) ⇒ Object



33
34
35
36
# File 'lib/service/service_definition/service_definition.rb', line 33

def deployment_stages(*args, &block)
  @deployment_stages.instance_exec(&block) if block_given?
  @deployment_stages
end

#infrastructure_requirements(&block) ⇒ Object



38
39
40
41
# File 'lib/service/service_definition/service_definition.rb', line 38

def infrastructure_requirements(&block)
  @infrastructure_requirements.instance_exec(&block) if block_given?
  @infrastructure_requirements
end