Class: TorigoyaKit::ExecutedResult

Inherits:
Object
  • Object
show all
Defined in:
lib/torigoya_kit/stream_result.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exited, exit_status, signaled, signal, cpu_time, memory, s_es, s_em) ⇒ ExecutedResult

Returns a new instance of ExecutedResult.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/torigoya_kit/stream_result.rb', line 74

def initialize(exited, exit_status, signaled, signal, cpu_time, memory, s_es, s_em)
  @exited = exited
  @exit_status = exit_status
  @signaled = signaled
  @signal = signal

  @used_cpu_time_sec = cpu_time
  @used_memory_bytes = memory

  @system_error_status = s_es
  @system_error_message = s_em

  validate
end

Instance Attribute Details

#exit_statusObject (readonly)

Returns the value of attribute exit_status.



88
89
90
# File 'lib/torigoya_kit/stream_result.rb', line 88

def exit_status
  @exit_status
end

#exitedObject (readonly)

Returns the value of attribute exited.



88
89
90
# File 'lib/torigoya_kit/stream_result.rb', line 88

def exited
  @exited
end

#signalObject (readonly)

Returns the value of attribute signal.



88
89
90
# File 'lib/torigoya_kit/stream_result.rb', line 88

def signal
  @signal
end

#signaledObject (readonly)

Returns the value of attribute signaled.



88
89
90
# File 'lib/torigoya_kit/stream_result.rb', line 88

def signaled
  @signaled
end

#system_error_messageObject (readonly)

Returns the value of attribute system_error_message.



90
91
92
# File 'lib/torigoya_kit/stream_result.rb', line 90

def system_error_message
  @system_error_message
end

#system_error_statusObject (readonly)

Returns the value of attribute system_error_status.



90
91
92
# File 'lib/torigoya_kit/stream_result.rb', line 90

def system_error_status
  @system_error_status
end

#used_cpu_time_secObject (readonly)

Returns the value of attribute used_cpu_time_sec.



89
90
91
# File 'lib/torigoya_kit/stream_result.rb', line 89

def used_cpu_time_sec
  @used_cpu_time_sec
end

#used_memory_bytesObject (readonly)

Returns the value of attribute used_memory_bytes.



89
90
91
# File 'lib/torigoya_kit/stream_result.rb', line 89

def used_memory_bytes
  @used_memory_bytes
end

Class Method Details

.from_hash(hash) ⇒ Object



92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/torigoya_kit/stream_result.rb', line 92

def self.from_hash(hash)
  return ExecutedResult.new(
           hash["exited"],
           hash["exit_status"],
           hash["signaled"],
           hash["signal"],
           hash["used_cpu_time_sec"],
           hash["used_memory_bytes"],
           hash["system_error_status"],
           hash["system_error_message"],
         )
end