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