Class: Once::ActionResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/buildonce.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exit_code:, stdout: nil, stderr: nil, outputs: {}) ⇒ ActionResult

Returns a new instance of ActionResult.



10
11
12
13
# File 'lib/buildonce.rb', line 10

def initialize(exit_code:, stdout: nil, stderr: nil, outputs: {})
  outputs ||= {}
  super(exit_code: exit_code, stdout: stdout, stderr: stderr, outputs: outputs.dup.freeze)
end

Instance Attribute Details

#exit_codeObject

Returns the value of attribute exit_code

Returns:

  • (Object)

    the current value of exit_code



9
10
11
# File 'lib/buildonce.rb', line 9

def exit_code
  @exit_code
end

#outputsObject

Returns the value of attribute outputs

Returns:

  • (Object)

    the current value of outputs



9
10
11
# File 'lib/buildonce.rb', line 9

def outputs
  @outputs
end

#stderrObject

Returns the value of attribute stderr

Returns:

  • (Object)

    the current value of stderr



9
10
11
# File 'lib/buildonce.rb', line 9

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout

Returns:

  • (Object)

    the current value of stdout



9
10
11
# File 'lib/buildonce.rb', line 9

def stdout
  @stdout
end

Instance Method Details

#to_hObject



15
16
17
18
19
20
21
22
# File 'lib/buildonce.rb', line 15

def to_h
  {
    exit_code: exit_code,
    stdout: stdout,
    stderr: stderr,
    outputs: outputs || {},
  }
end