Class: Orchparty::Generators::DockerComposeV1

Inherits:
Object
  • Object
show all
Defined in:
lib/orchparty/generators/docker_compose_v1.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ast) ⇒ DockerComposeV1

Returns a new instance of DockerComposeV1.



6
7
8
# File 'lib/orchparty/generators/docker_compose_v1.rb', line 6

def initialize(ast)
  @ast = ast
end

Instance Attribute Details

#astObject (readonly)

Returns the value of attribute ast.



5
6
7
# File 'lib/orchparty/generators/docker_compose_v1.rb', line 5

def ast
  @ast
end

Instance Method Details

#output(application_name) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/orchparty/generators/docker_compose_v1.rb', line 10

def output(application_name)
  Psych.dump(ast.applications[application_name].services.map do |name, service|
    service = service.to_h
    service.delete(:mix)
    [service.delete(:name), HashUtils.deep_stringify_keys(service.to_h)]
  end.to_h)
end