Class: Flotte::Role
- Inherits:
-
Object
- Object
- Flotte::Role
- Defined in:
- lib/flotte/role.rb
Instance Attribute Summary collapse
- #command ⇒ Array<String> readonly
- #environment ⇒ String readonly
- #hosts ⇒ Array<Flotte::Host> readonly
- #name ⇒ String readonly
- #service ⇒ Flotte::Service readonly
Instance Method Summary collapse
- #id ⇒ String
- #image ⇒ String
-
#initialize(name:, service:, hosts:, command: [], environment: {}) ⇒ Role
constructor
A new instance of Role.
- #name_for_container ⇒ Object
Constructor Details
#initialize(name:, service:, hosts:, command: [], environment: {}) ⇒ Role
Returns a new instance of Role.
14 15 16 17 18 19 20 |
# File 'lib/flotte/role.rb', line 14 def initialize(name:, service:, hosts:, command: [], environment: {}) @name = name @service = service @hosts = hosts @command = command @environment = environment end |
Instance Attribute Details
#command ⇒ Array<String> (readonly)
10 11 12 |
# File 'lib/flotte/role.rb', line 10 def command @command end |
#environment ⇒ String (readonly)
4 5 6 |
# File 'lib/flotte/role.rb', line 4 def environment @environment end |
#hosts ⇒ Array<Flotte::Host> (readonly)
8 9 10 |
# File 'lib/flotte/role.rb', line 8 def hosts @hosts end |
#name ⇒ String (readonly)
4 5 6 |
# File 'lib/flotte/role.rb', line 4 def name @name end |
#service ⇒ Flotte::Service (readonly)
6 7 8 |
# File 'lib/flotte/role.rb', line 6 def service @service end |
Instance Method Details
#id ⇒ String
23 24 25 |
# File 'lib/flotte/role.rb', line 23 def id "#{service.name}.#{name}" end |
#image ⇒ String
12 |
# File 'lib/flotte/role.rb', line 12 delegate :image, to: :service |
#name_for_container ⇒ Object
27 28 29 |
# File 'lib/flotte/role.rb', line 27 def name_for_container id end |