Class: Exercise::Output
- Inherits:
-
String
- Object
- String
- Exercise::Output
show all
- Defined in:
- lib/commands/exercise/output.rb,
lib/commands/exercise/output/cic.rb,
lib/commands/exercise/output/pytest.rb,
lib/commands/exercise/output/ansible.rb
Defined Under Namespace
Classes: Ansible, CIC, Pytest
Instance Method Summary
collapse
Constructor Details
#initialize(string) ⇒ Output
Returns a new instance of Output.
6
7
8
9
10
11
|
# File 'lib/commands/exercise/output.rb', line 6
def initialize(string)
string = string.scrub
bytes = string.bytes.delete_if { |byte| byte == 27 }
string = bytes.pack('U*')
super normalise(string.chomp)
end
|
Instance Method Details
#to_ansible_output ⇒ Object
13
14
15
|
# File 'lib/commands/exercise/output.rb', line 13
def to_ansible_output
Ansible.new(self)
end
|
#to_cic_output ⇒ Object
17
18
19
|
# File 'lib/commands/exercise/output.rb', line 17
def to_cic_output
CIC.new(self)
end
|
#to_pytest_output ⇒ Object
21
22
23
|
# File 'lib/commands/exercise/output.rb', line 21
def to_pytest_output
Pytest.new(self)
end
|