Class: Foreplay::Engine::Role
- Inherits:
-
Object
- Object
- Foreplay::Engine::Role
- Defined in:
- lib/foreplay/engine/role.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#instructions ⇒ Object
readonly
Returns the value of attribute instructions.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#servers ⇒ Object
readonly
Returns the value of attribute servers.
Instance Method Summary collapse
-
#initialize(e, m, i) ⇒ Role
constructor
A new instance of Role.
- #threads ⇒ Object
Constructor Details
#initialize(e, m, i) ⇒ Role
Returns a new instance of Role.
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/foreplay/engine/role.rb', line 3 def initialize(e, m, i) @environment = e @mode = m @instructions = i @servers = @instructions['servers'] preposition = mode == :deploy ? 'to' : 'for' return if @servers.length == 1 puts "#{mode.capitalize}ing #{instructions['name'].yellow} #{preposition} #{@servers.join(', ').yellow} "\ "for the #{instructions['role'].dup.yellow} role in the #{environment.dup.yellow} environment..." end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
2 3 4 |
# File 'lib/foreplay/engine/role.rb', line 2 def environment @environment end |
#instructions ⇒ Object (readonly)
Returns the value of attribute instructions.
2 3 4 |
# File 'lib/foreplay/engine/role.rb', line 2 def instructions @instructions end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
2 3 4 |
# File 'lib/foreplay/engine/role.rb', line 2 def mode @mode end |
#servers ⇒ Object (readonly)
Returns the value of attribute servers.
2 3 4 |
# File 'lib/foreplay/engine/role.rb', line 2 def servers @servers end |