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
- #volumes(&block) ⇒ Object
Methods inherited from Builder
Constructor Details
#initialize(name) ⇒ MixinBuilder
Returns a new instance of MixinBuilder.
57 58 59 |
# File 'lib/orchparty/dsl_parser.rb', line 57 def initialize(name) @mixin = AST.mixin(name: name) end |
Instance Method Details
#_build ⇒ Object
80 81 82 |
# File 'lib/orchparty/dsl_parser.rb', line 80 def _build @mixin end |
#mixin(name, &block) ⇒ Object
68 69 70 |
# File 'lib/orchparty/dsl_parser.rb', line 68 def mixin(name, &block) @mixin._mixins[name] = ServiceBuilder.build(name, block) end |
#networks(&block) ⇒ Object
76 77 78 |
# File 'lib/orchparty/dsl_parser.rb', line 76 def networks(&block) @mixin.networks = HashBuilder.build(block) end |
#service(name, &block) ⇒ Object
61 62 63 64 65 66 |
# File 'lib/orchparty/dsl_parser.rb', line 61 def service(name, &block) result = ServiceBuilder.build(name, block) @mixin.services[name] = result @mixin._mixins[name] = result self end |
#volumes(&block) ⇒ Object
72 73 74 |
# File 'lib/orchparty/dsl_parser.rb', line 72 def volumes(&block) @mixin.volumes = HashBuilder.build(block) end |