Class: Orchparty::MixinBuilder

Inherits:
Builder
  • Object
show all
Defined in:
lib/orchparty/dsl_parser.rb

Instance Method Summary collapse

Methods inherited from Builder

#assign_or_merge, build

Constructor Details

#initialize(name) ⇒ MixinBuilder

Returns a new instance of MixinBuilder.



68
69
70
# File 'lib/orchparty/dsl_parser.rb', line 68

def initialize(name)
  @mixin = AST.mixin(name:)
end

Instance Method Details

#_buildObject



96
97
98
# File 'lib/orchparty/dsl_parser.rb', line 96

def _build
  @mixin
end

#mixin(name, &block) ⇒ Object



84
85
86
# File 'lib/orchparty/dsl_parser.rb', line 84

def mixin(name, &block)
  @mixin._mixins[name] = ServiceBuilder.build(name, block)
end

#networks(&block) ⇒ Object



92
93
94
# File 'lib/orchparty/dsl_parser.rb', line 92

def networks(&block)
  @mixin.networks = HashBuilder.build(block)
end

#service(name, &block) ⇒ Object



72
73
74
75
76
77
# File 'lib/orchparty/dsl_parser.rb', line 72

def service(name, &block)
  result = ServiceBuilder.build(name, block)
  @mixin.services[name] = result
  @mixin._mixins[name] = result
  self
end

#variables(&block) ⇒ Object



79
80
81
82
# File 'lib/orchparty/dsl_parser.rb', line 79

def variables(&block)
  @mixin._variables = VariableBuilder.build(block)
  self
end

#volumes(&block) ⇒ Object



88
89
90
# File 'lib/orchparty/dsl_parser.rb', line 88

def volumes(&block)
  @mixin.volumes = HashBuilder.build(block)
end