Class: TorigoyaKit::StreamExecutedResult

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

Overview

related to StreamExecutedResult

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mode, index, result) ⇒ StreamExecutedResult

Returns a new instance of StreamExecutedResult.



122
123
124
125
126
127
128
# File 'lib/torigoya_kit/stream_result.rb', line 122

def initialize(mode, index, result)
  @mode = mode
  @index = index
  @result = result

  validate
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



129
130
131
# File 'lib/torigoya_kit/stream_result.rb', line 129

def index
  @index
end

#modeObject (readonly)

Returns the value of attribute mode.



129
130
131
# File 'lib/torigoya_kit/stream_result.rb', line 129

def mode
  @mode
end

#resultObject (readonly)

Returns the value of attribute result.



129
130
131
# File 'lib/torigoya_kit/stream_result.rb', line 129

def result
  @result
end

Class Method Details

.from_hash(hash) ⇒ Object



131
132
133
134
135
136
137
# File 'lib/torigoya_kit/stream_result.rb', line 131

def self.from_hash(hash)
  return StreamExecutedResult.new(
           hash["mode"],
           hash["index"],
           ExecutedResult.from_hash(hash["result"])
         )
end

Instance Method Details

#to_sObject



139
140
141
# File 'lib/torigoya_kit/stream_result.rb', line 139

def to_s
  return "#{self.class}/[#{@mode} #{@index} #{@result.to_s}]"
end