Class: Lino::Executors::Mock::Execution
- Inherits:
-
Object
- Object
- Lino::Executors::Mock::Execution
- Defined in:
- lib/lino/executors/mock.rb
Instance Attribute Summary collapse
-
#command_line ⇒ Object
readonly
Returns the value of attribute command_line.
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#stderr_contents ⇒ Object
readonly
Returns the value of attribute stderr_contents.
-
#stdin_contents ⇒ Object
readonly
Returns the value of attribute stdin_contents.
-
#stdout_contents ⇒ Object
readonly
Returns the value of attribute stdout_contents.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(state) ⇒ Execution
constructor
A new instance of Execution.
- #with_stderr_contents(contents) ⇒ Object
- #with_stdin_contents(contents) ⇒ Object
- #with_stdout_contents(contents) ⇒ Object
Constructor Details
#initialize(state) ⇒ Execution
Returns a new instance of Execution.
85 86 87 88 89 90 91 92 |
# File 'lib/lino/executors/mock.rb', line 85 def initialize(state) @command_line = state[:command_line] @opts = state[:opts] @exit_code = state[:exit_code] @stdin_contents = state[:stdin_contents] @stdout_contents = state[:stdout_contents] @stderr_contents = state[:stderr_contents] end |
Instance Attribute Details
#command_line ⇒ Object (readonly)
Returns the value of attribute command_line.
78 79 80 |
# File 'lib/lino/executors/mock.rb', line 78 def command_line @command_line end |
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
78 79 80 |
# File 'lib/lino/executors/mock.rb', line 78 def exit_code @exit_code end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
78 79 80 |
# File 'lib/lino/executors/mock.rb', line 78 def opts @opts end |
#stderr_contents ⇒ Object (readonly)
Returns the value of attribute stderr_contents.
78 79 80 |
# File 'lib/lino/executors/mock.rb', line 78 def stderr_contents @stderr_contents end |
#stdin_contents ⇒ Object (readonly)
Returns the value of attribute stdin_contents.
78 79 80 |
# File 'lib/lino/executors/mock.rb', line 78 def stdin_contents @stdin_contents end |
#stdout_contents ⇒ Object (readonly)
Returns the value of attribute stdout_contents.
78 79 80 |
# File 'lib/lino/executors/mock.rb', line 78 def stdout_contents @stdout_contents end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
106 107 108 109 |
# File 'lib/lino/executors/mock.rb', line 106 def ==(other) self.class == other.class && state_array == other.state_array end |
#hash ⇒ Object
113 114 115 |
# File 'lib/lino/executors/mock.rb', line 113 def hash [self.class, state_array].hash end |
#with_stderr_contents(contents) ⇒ Object
102 103 104 |
# File 'lib/lino/executors/mock.rb', line 102 def with_stderr_contents(contents) Execution.new(state_hash.merge(stderr_contents: contents)) end |