Class: Mrsk::Configuration::Role
- Inherits:
-
Object
- Object
- Mrsk::Configuration::Role
- Defined in:
- lib/mrsk/configuration/role.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #cmd ⇒ Object
- #hosts ⇒ Object
-
#initialize(name, config:) ⇒ Role
constructor
A new instance of Role.
- #label_args ⇒ Object
- #labels ⇒ Object
Constructor Details
#initialize(name, config:) ⇒ Role
Returns a new instance of Role.
6 7 8 |
# File 'lib/mrsk/configuration/role.rb', line 6 def initialize(name, config:) @name, @config = name.inquiry, config end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/mrsk/configuration/role.rb', line 4 def name @name end |
Instance Method Details
#cmd ⇒ Object
26 27 28 |
# File 'lib/mrsk/configuration/role.rb', line 26 def cmd specializations["cmd"] end |
#hosts ⇒ Object
10 11 12 |
# File 'lib/mrsk/configuration/role.rb', line 10 def hosts @hosts ||= extract_hosts_from_config end |
#label_args ⇒ Object
22 23 24 |
# File 'lib/mrsk/configuration/role.rb', line 22 def label_args argumentize "--label", labels end |
#labels ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/mrsk/configuration/role.rb', line 14 def labels if name.web? default_labels.merge(traefik_labels).merge(custom_labels) else default_labels.merge(custom_labels) end end |