Class: KuberKit::Core::Service
Constant Summary collapse
- AttributeNotSet =
Class.new(Indocker::Error)
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#template_name ⇒ Object
readonly
Returns the value of attribute template_name.
Instance Method Summary collapse
- #attribute(attribute_name) ⇒ Object
-
#initialize(name:, template_name:, tags:, images:, attributes:) ⇒ Service
constructor
A new instance of Service.
- #uri ⇒ Object
Constructor Details
#initialize(name:, template_name:, tags:, images:, attributes:) ⇒ Service
Returns a new instance of Service.
13 14 15 16 17 18 19 |
# File 'lib/kuber_kit/core/service.rb', line 13 def initialize(name:, template_name:, tags:, images:, attributes:) @name = name @template_name = template_name @tags = @images = images @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/kuber_kit/core/service.rb', line 4 def attributes @attributes end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
4 5 6 |
# File 'lib/kuber_kit/core/service.rb', line 4 def images @images end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/kuber_kit/core/service.rb', line 4 def name @name end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
4 5 6 |
# File 'lib/kuber_kit/core/service.rb', line 4 def @tags end |
#template_name ⇒ Object (readonly)
Returns the value of attribute template_name.
4 5 6 |
# File 'lib/kuber_kit/core/service.rb', line 4 def template_name @template_name end |
Instance Method Details
#attribute(attribute_name) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/kuber_kit/core/service.rb', line 25 def attribute(attribute_name) unless attributes.has_key?(attribute_name.to_sym) raise AttributeNotSet, "attribute #{attribute_name} was not set" end attributes[attribute_name.to_sym] end |
#uri ⇒ Object
21 22 23 |
# File 'lib/kuber_kit/core/service.rb', line 21 def uri name.to_s.gsub("_", "-") end |