Class: Orchparty::Kubernetes::RootBuilder
- Defined in:
- lib/orchparty/dsl_parser_kubernetes.rb
Instance Method Summary collapse
- #_build ⇒ Object
- #application(name, &block) ⇒ Object
- #import(rel_file) ⇒ Object
-
#initialize ⇒ RootBuilder
constructor
A new instance of RootBuilder.
- #mixin(name, &block) ⇒ Object
Methods inherited from Builder
Constructor Details
#initialize ⇒ RootBuilder
Returns a new instance of RootBuilder.
39 40 41 |
# File 'lib/orchparty/dsl_parser_kubernetes.rb', line 39 def initialize @root = AST.root end |
Instance Method Details
#_build ⇒ Object
61 62 63 |
# File 'lib/orchparty/dsl_parser_kubernetes.rb', line 61 def _build @root end |
#application(name, &block) ⇒ Object
51 52 53 54 |
# File 'lib/orchparty/dsl_parser_kubernetes.rb', line 51 def application(name, &block) @root.applications[name] = ApplicationBuilder.build(name, block) self end |
#import(rel_file) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/orchparty/dsl_parser_kubernetes.rb', line 43 def import(rel_file) old_file_path = Pathname.new(caller[0][/[^:]+/]).parent rel_file_path = Pathname.new rel_file new_file_path = old_file_path + rel_file_path file_content = File.read(new_file_path) instance_eval(file_content, new_file_path..to_s) end |
#mixin(name, &block) ⇒ Object
56 57 58 59 |
# File 'lib/orchparty/dsl_parser_kubernetes.rb', line 56 def mixin(name, &block) @root._mixins[name] = MixinBuilder.build(name, block) self end |