Class: Exercise::Output::CIC
- Inherits:
-
String
- Object
- String
- Exercise::Output::CIC
- Defined in:
- lib/commands/exercise/output/cic.rb
Instance Attribute Summary collapse
-
#cic_connect_command ⇒ Object
readonly
Returns the value of attribute cic_connect_command.
-
#cic_start_command ⇒ Object
readonly
Returns the value of attribute cic_start_command.
-
#cic_stop_command ⇒ Object
readonly
Returns the value of attribute cic_stop_command.
-
#container_id ⇒ Object
readonly
Returns the value of attribute container_id.
Instance Method Summary collapse
- #chomp(string) ⇒ Object
-
#initialize(string) ⇒ CIC
constructor
A new instance of CIC.
Constructor Details
#initialize(string) ⇒ CIC
Returns a new instance of CIC.
6 7 8 9 10 11 |
# File 'lib/commands/exercise/output/cic.rb', line 6 def initialize(string) @container_id = chomp(string[/cic connect (.*)/, 1]) @cic_start_command = chomp(string[/(cic start .*)/, 1]) @cic_connect_command = chomp(string[/(cic connect .*)/, 1]) @cic_stop_command = chomp(string[/(cic stop .*)/, 1]) end |
Instance Attribute Details
#cic_connect_command ⇒ Object (readonly)
Returns the value of attribute cic_connect_command.
4 5 6 |
# File 'lib/commands/exercise/output/cic.rb', line 4 def cic_connect_command @cic_connect_command end |
#cic_start_command ⇒ Object (readonly)
Returns the value of attribute cic_start_command.
4 5 6 |
# File 'lib/commands/exercise/output/cic.rb', line 4 def cic_start_command @cic_start_command end |
#cic_stop_command ⇒ Object (readonly)
Returns the value of attribute cic_stop_command.
4 5 6 |
# File 'lib/commands/exercise/output/cic.rb', line 4 def cic_stop_command @cic_stop_command end |
#container_id ⇒ Object (readonly)
Returns the value of attribute container_id.
4 5 6 |
# File 'lib/commands/exercise/output/cic.rb', line 4 def container_id @container_id end |
Instance Method Details
#chomp(string) ⇒ Object
13 14 15 |
# File 'lib/commands/exercise/output/cic.rb', line 13 def chomp(string) string&.chomp end |