Class: Kuby::Docker::Dockerfile::From

Inherits:
Command
  • Object
show all
Defined in:
lib/kuby/docker/dockerfile.rb

Instance Attribute Summary collapse

Attributes inherited from Command

#args

Instance Method Summary collapse

Constructor Details

#initialize(image_url, as: nil) ⇒ From

Returns a new instance of From.



35
36
37
38
# File 'lib/kuby/docker/dockerfile.rb', line 35

def initialize(image_url, as: nil)
  @image_url = image_url
  @as = as
end

Instance Attribute Details

#asObject (readonly)

Returns the value of attribute as.



32
33
34
# File 'lib/kuby/docker/dockerfile.rb', line 32

def as
  @as
end

#image_urlObject (readonly)

Returns the value of attribute image_url.



29
30
31
# File 'lib/kuby/docker/dockerfile.rb', line 29

def image_url
  @image_url
end

Instance Method Details

#to_sObject



41
42
43
44
45
# File 'lib/kuby/docker/dockerfile.rb', line 41

def to_s
  str = "FROM #{image_url}"
  str << " AS #{as}" if as
  str
end