Class: TorigoyaKit::StreamExecutedResult
- Inherits:
-
Object
- Object
- TorigoyaKit::StreamExecutedResult
- Defined in:
- lib/torigoya_kit/stream_result.rb
Overview
related to StreamExecutedResult
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(mode, index, result) ⇒ StreamExecutedResult
constructor
A new instance of StreamExecutedResult.
- #to_s ⇒ Object
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
#index ⇒ Object (readonly)
Returns the value of attribute index.
129 130 131 |
# File 'lib/torigoya_kit/stream_result.rb', line 129 def index @index end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
129 130 131 |
# File 'lib/torigoya_kit/stream_result.rb', line 129 def mode @mode end |
#result ⇒ Object (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_s ⇒ Object
139 140 141 |
# File 'lib/torigoya_kit/stream_result.rb', line 139 def to_s return "#{self.class}/[#{@mode} #{@index} #{@result.to_s}]" end |