Class: Contained::Command::Base Abstract

Inherits:
Object
  • Object
show all
Includes:
SSHKit::DSL
Defined in:
lib/contained/command/base.rb

Overview

This class is abstract.

Direct Known Subclasses

DockerLogin, DockerLogout

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment:, config:) ⇒ Base

Returns a new instance of Base.



17
18
19
20
# File 'lib/contained/command/base.rb', line 17

def initialize(environment:, config:)
  @environment = environment
  @config = config
end

Class Method Details

.commandObject



11
12
13
# File 'lib/contained/command/base.rb', line 11

def self.command(...)
  new(...).command
end

Instance Method Details

#commandArray<Symbol,String>

Returns e.g. [:docker, :login, “hub.docker.com”, “-u”, “root”, “-p”, “secret”].

Returns:

  • (Array<Symbol,String>)

    e.g. [:docker, :login, “hub.docker.com”, “-u”, “root”, “-p”, “secret”]

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/contained/command/base.rb', line 23

def command
  raise NotImplementedError, "#execute! undefined"
end