class KuberKit::Core::Service
Constants
- AttributeNotSet
Attributes
attributes[R]
dependencies[R]
deployer_strategy[R]
images[R]
name[R]
template_name[R]
Public Class Methods
new(name:, dependencies:, template_name:, tags:, images:, attributes:, deployer_strategy:)
click to toggle source
# File lib/kuber_kit/core/service.rb, line 15 def initialize(name:, dependencies:, template_name:, tags:, images:, attributes:, deployer_strategy:) @name = name @dependencies = dependencies @template_name = template_name @tags = tags @images = images @attributes = attributes @deployer_strategy = deployer_strategy end
Public Instance Methods
attribute(attribute_name, default: nil)
click to toggle source
# File lib/kuber_kit/core/service.rb, line 29 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
uri()
click to toggle source
# File lib/kuber_kit/core/service.rb, line 25 def uri name.to_s.gsub("_", "-") end