Class: Rum::Docker::Run
- Inherits:
-
Object
- Object
- Rum::Docker::Run
- Extended by:
- AttrCallable
- Includes:
- Executable
- Defined in:
- lib/rumrunner/docker.rb
Overview
Docker run command object.
Instance Attribute Summary
Attributes included from Executable
Instance Method Summary collapse
-
#each {|@image| ... } ⇒ Object
Yield the Docker run commmand word-by-word.
-
#image ⇒ Object
Access
IMAGE
andCMD
with method. -
#initialize(options: nil, image: nil, cmd: nil, &block) ⇒ Run
constructor
Initialize Docker run command with
OPTIONS
,IMAGE
, andCMD
.
Methods included from AttrCallable
Methods included from Executable
#clear_options, #method_missing, #to_s, #with_defaults
Constructor Details
#initialize(options: nil, image: nil, cmd: nil, &block) ⇒ Run
Initialize Docker run command with OPTIONS
, IMAGE
, and CMD
. Evaluates the &block
if given.
221 222 223 224 225 |
# File 'lib/rumrunner/docker.rb', line 221 def initialize(options:nil, image:nil, cmd:nil, &block) @image = image @cmd = cmd super options: , &block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Rum::Docker::Executable
Instance Method Details
#each {|@image| ... } ⇒ Object
Yield the Docker run commmand word-by-word.
229 230 231 232 233 |
# File 'lib/rumrunner/docker.rb', line 229 def each super{|x| yield x } yield @image @cmd.is_a?(Array) ? @cmd.each{|x| yield x } : yield(@cmd) unless @cmd.nil? end |
#image ⇒ Object
Access IMAGE
and CMD
with method.
216 |
# File 'lib/rumrunner/docker.rb', line 216 attr_method_accessor :image, :cmd |