Class: Orchparty::MixinBuilder
- Defined in:
- lib/orchparty/dsl_parser.rb
Instance Method Summary collapse
- #_build ⇒ Object
-
#initialize(name) ⇒ MixinBuilder
constructor
A new instance of MixinBuilder.
- #mixin(name, &block) ⇒ Object
- #networks(&block) ⇒ Object
- #service(name, &block) ⇒ Object
- #variables(&block) ⇒ Object
- #volumes(&block) ⇒ Object
Methods inherited from Builder
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
#_build ⇒ Object
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 |