Class: Exercise::Output::CIC

Inherits:
String
  • Object
show all
Defined in:
lib/commands/exercise/output/cic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_commandObject (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_commandObject (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_commandObject (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_idObject (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