Class: Indocker::BuildContextHelper::Container

Inherits:
Object
  • Object
show all
Defined in:
lib/indocker/build_context_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration, container) ⇒ Container

Returns a new instance of Container.



75
76
77
78
# File 'lib/indocker/build_context_helper.rb', line 75

def initialize(configuration, container)
  @configuration = configuration
  @container = container
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



97
98
99
# File 'lib/indocker/build_context_helper.rb', line 97

def method_missing(name, *args)
  @container.send(name, *args)
end

Instance Method Details

#build_argsObject



80
81
82
83
84
85
86
87
# File 'lib/indocker/build_context_helper.rb', line 80

def build_args
  Indocker::ContextArgs.new(
    nil,
    Indocker::HashMerger.deep_merge(@container.build_args, @container.image.build_args),
    nil,
    @container
  )
end

#countObject



93
94
95
# File 'lib/indocker/build_context_helper.rb', line 93

def count
  @container.get_start_option(:scale) || 1
end

#hostname(number = nil) ⇒ Object



89
90
91
# File 'lib/indocker/build_context_helper.rb', line 89

def hostname(number = nil)
  Indocker::ContainerHelper.hostname(@configuration.name, @container, number)
end