Class: TorigoyaKit::StreamOutputResult

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

Overview

related to MessageKindOutputs

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mode, index, output) ⇒ StreamOutputResult



43
44
45
46
47
48
49
# File 'lib/torigoya_kit/stream_result.rb', line 43

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

  validate
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



50
51
52
# File 'lib/torigoya_kit/stream_result.rb', line 50

def index
  @index
end

#modeObject (readonly)

Returns the value of attribute mode.



50
51
52
# File 'lib/torigoya_kit/stream_result.rb', line 50

def mode
  @mode
end

#outputObject (readonly)

Returns the value of attribute output.



50
51
52
# File 'lib/torigoya_kit/stream_result.rb', line 50

def output
  @output
end

Class Method Details

.from_hash(hash) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/torigoya_kit/stream_result.rb', line 52

def self.from_hash(hash)
  return StreamOutputResult.new(
           hash["mode"],
           hash["index"],
           StreamOutput.from_hash(hash["output"])
         )
end

Instance Method Details

#to_sObject



60
61
62
# File 'lib/torigoya_kit/stream_result.rb', line 60

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