class Docker::Asset

Base class for containers, images and other Docker assets.

Public Class Methods

new(json, session:nil) click to toggle source
# File lib/docker/asset.rb, line 4
def initialize(json, session:nil)
  json = JSON.load(json) if json.is_a?(String)
  @json = json
  @session = session
end

Public Instance Methods

inspect() click to toggle source
# File lib/docker/asset.rb, line 10
def inspect
  %Q{#<#{self.class.name}:#{self.name}>}
end
name() click to toggle source

@return [String] human-readable name of container, image or volume

# File lib/docker/asset.rb, line 15
def name
  @json['Name']
end
to_h() click to toggle source
# File lib/docker/asset.rb, line 19
def to_h
  @json
end
to_s() click to toggle source
# File lib/docker/asset.rb, line 23
def to_s
  self.inspect
end