Class: DockerfileRB::From

Inherits:
Object
  • Object
show all
Defined in:
lib/dockerfile-rb/from.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from_value, as_value) ⇒ From

Returns a new instance of From.



4
5
6
7
8
9
# File 'lib/dockerfile-rb/from.rb', line 4

def initialize(from_value, as_value)
  @name = as_value
  @image = from_value.value.split(':')[0]
  @image_tag = from_value.value.split(':')[1]
  @image_digest = from_value.value.split('@')[1]
end

Instance Attribute Details

#imageObject (readonly)

Returns the value of attribute image.



3
4
5
# File 'lib/dockerfile-rb/from.rb', line 3

def image
  @image
end

#image_digestObject (readonly)

Returns the value of attribute image_digest.



3
4
5
# File 'lib/dockerfile-rb/from.rb', line 3

def image_digest
  @image_digest
end

#image_tagObject (readonly)

Returns the value of attribute image_tag.



3
4
5
# File 'lib/dockerfile-rb/from.rb', line 3

def image_tag
  @image_tag
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/dockerfile-rb/from.rb', line 3

def name
  @name
end