Class: Exercise::Output::Ansible
- Inherits:
-
String
- Object
- String
- Exercise::Output::Ansible
- Defined in:
- lib/commands/exercise/output/ansible.rb
Instance Attribute Summary collapse
-
#play ⇒ Object
readonly
Returns the value of attribute play.
-
#play_recap ⇒ Object
readonly
Returns the value of attribute play_recap.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
Instance Method Summary collapse
-
#initialize(string) ⇒ Ansible
constructor
A new instance of Ansible.
Constructor Details
#initialize(string) ⇒ Ansible
Returns a new instance of Ansible.
6 7 8 9 10 11 12 |
# File 'lib/commands/exercise/output/ansible.rb', line 6 def initialize(string) super @tasks = string.scan(/(TASK .*\**$\n.*\n)/).flatten @play = string.scan(/(PLAY \[.*\**$)/).flatten.first @play_recap = string.scan(/(PLAY RECAP.*\**$\n.*)/).flatten.first end |
Instance Attribute Details
#play ⇒ Object (readonly)
Returns the value of attribute play.
4 5 6 |
# File 'lib/commands/exercise/output/ansible.rb', line 4 def play @play end |
#play_recap ⇒ Object (readonly)
Returns the value of attribute play_recap.
4 5 6 |
# File 'lib/commands/exercise/output/ansible.rb', line 4 def play_recap @play_recap end |
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
4 5 6 |
# File 'lib/commands/exercise/output/ansible.rb', line 4 def tasks @tasks end |