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.



19
20
21
22
# File 'lib/kuby/docker/dockerfile.rb', line 19

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

Instance Attribute Details

#asObject (readonly)

Returns the value of attribute as.



17
18
19
# File 'lib/kuby/docker/dockerfile.rb', line 17

def as
  @as
end

#image_urlObject (readonly)

Returns the value of attribute image_url.



17
18
19
# File 'lib/kuby/docker/dockerfile.rb', line 17

def image_url
  @image_url
end

Instance Method Details

#to_sObject



24
25
26
27
28
# File 'lib/kuby/docker/dockerfile.rb', line 24

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