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.
65 66 67 |
# File 'lib/orchparty/dsl_parser.rb', line 65 def initialize(name) @mixin = AST.mixin(name: name) end |
Instance Method Details
#_build ⇒ Object
88 89 90 |
# File 'lib/orchparty/dsl_parser.rb', line 88 def _build @mixin end |
#mixin(name, &block) ⇒ Object
76 77 78 |
# File 'lib/orchparty/dsl_parser.rb', line 76 def mixin(name, &block) @mixin._mixins[name] = ServiceBuilder.build(name, block) end |
#networks(&block) ⇒ Object
84 85 86 |
# File 'lib/orchparty/dsl_parser.rb', line 84 def networks(&block) @mixin.networks = HashBuilder.build(block) end |
#service(name, &block) ⇒ Object
69 70 71 72 73 74 |
# File 'lib/orchparty/dsl_parser.rb', line 69 def service(name, &block) result = ServiceBuilder.build(name, block) @mixin.services[name] = result @mixin._mixins[name] = result self end |
#volumes(&block) ⇒ Object
80 81 82 |
# File 'lib/orchparty/dsl_parser.rb', line 80 def volumes(&block) @mixin.volumes = HashBuilder.build(block) end |