class Matrixeval::Variant

Attributes

container[R]
default[R]
env[R]
key[R]
mounts[R]
vector[R]

Public Class Methods

default(key, vector) click to toggle source
# File lib/matrixeval/variant.rb, line 4
def default(key, vector)
  self.new({"key" => key}, vector)
end
new(config = {}, vector) click to toggle source
# File lib/matrixeval/variant.rb, line 11
def initialize(config = {}, vector)
  raise Error.new("Variant#key is missing") if config["key"].nil?

  @vector = vector
  @key = config["key"].to_s
  @container = Container.new(config["container"])
  @env = config["env"] || {}
  @default = config["default"] || false
  @mounts = config["mounts"] || []
end

Public Instance Methods

==(variant) click to toggle source
# File lib/matrixeval/variant.rb, line 46
def ==(variant)
  vector.key == variant.vector.key &&
    key == variant.key
end
default?() click to toggle source
# File lib/matrixeval/variant.rb, line 38
def default?
  default
end
docker_compose_service_name() click to toggle source
# File lib/matrixeval/variant.rb, line 30
def docker_compose_service_name
  id
end
id() click to toggle source
# File lib/matrixeval/variant.rb, line 26
def id
  "#{vector.id}_#{key.to_s.gsub(/[^A-Za-z0-9]/,'_')}"
end
match_command_options?(options) click to toggle source
# File lib/matrixeval/variant.rb, line 42
def match_command_options?(options)
  options[vector.key] == key.to_s
end
name() click to toggle source
# File lib/matrixeval/variant.rb, line 22
def name
  "#{vector.key}: #{key}"
end
pathname() click to toggle source
# File lib/matrixeval/variant.rb, line 34
def pathname
  id
end