Sha256: 9e86c4588af858e85aa263a8ac50305431eb5f5ed47d5bc99e45c48436f0b110
Contents?: true
Size: 1.29 KB
Versions: 11
Compression:
Stored size: 1.29 KB
Contents
class KuberKit::Core::Service AttributeNotSet = Class.new(KuberKit::Error) attr_reader :name, :initializers, :template_name, :tags, :images, :attributes, :deployer_strategy, :generator_strategy Contract KeywordArgs[ name: Symbol, initializers: ArrayOf[Symbol], template_name: Maybe[Symbol], tags: ArrayOf[Symbol], images: ArrayOf[Symbol], attributes: HashOf[Symbol => Any], deployer_strategy: Maybe[Symbol], generator_strategy: Maybe[Symbol] ] => Any def initialize(name:, initializers:, template_name:, tags:, images:, attributes:, deployer_strategy:, generator_strategy:) @name = name @initializers = initializers @template_name = template_name @tags = tags @images = images @attributes = attributes @deployer_strategy = deployer_strategy @generator_strategy = generator_strategy end def uri name.to_s.gsub("_", "-") end def attribute(attribute_name, default: nil) if !attributes.has_key?(attribute_name.to_sym) && default.nil? raise AttributeNotSet, "attribute #{attribute_name} was not set" end if !attributes.has_key?(attribute_name.to_sym) && !default.nil? return default end attributes[attribute_name.to_sym] end end
Version data entries
11 entries across 11 versions & 1 rubygems