Class: ContainerRegistry::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/container_registry/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag, blob) ⇒ Config

Returns a new instance of Config.


7
8
9
10
# File 'lib/container_registry/config.rb', line 7

def initialize(tag, blob)
  @tag, @blob = tag, blob
  @data = Gitlab::Json.parse(blob.data)
end

Instance Attribute Details

#blobObject (readonly)

Returns the value of attribute blob


5
6
7
# File 'lib/container_registry/config.rb', line 5

def blob
  @blob
end

#dataObject (readonly)

Returns the value of attribute data


5
6
7
# File 'lib/container_registry/config.rb', line 5

def data
  @data
end

#tagObject (readonly)

Returns the value of attribute tag


5
6
7
# File 'lib/container_registry/config.rb', line 5

def tag
  @tag
end

Instance Method Details

#[](key) ⇒ Object


12
13
14
15
16
# File 'lib/container_registry/config.rb', line 12

def [](key)
  return unless data

  data[key]
end