Class: WriteFlagSettingStreamingInputEnumerable

Inherits:
Object
  • Object
show all
Defined in:
src/ruby/pb/test/client.rb

Overview

Intended to be used to wrap a call_op, and to adjust the write flag of the call_op in between messages yielded to it.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(requests_and_write_flags) ⇒ WriteFlagSettingStreamingInputEnumerable

Returns a new instance of WriteFlagSettingStreamingInputEnumerable.



241
242
243
# File 'src/ruby/pb/test/client.rb', line 241

def initialize(requests_and_write_flags)
  @requests_and_write_flags = requests_and_write_flags
end

Instance Attribute Details

#call_opObject

Returns the value of attribute call_op.



239
240
241
# File 'src/ruby/pb/test/client.rb', line 239

def call_op
  @call_op
end

Instance Method Details

#eachObject



245
246
247
248
249
250
# File 'src/ruby/pb/test/client.rb', line 245

def each
  @requests_and_write_flags.each do |request_and_flag|
    @call_op.write_flag = request_and_flag[:write_flag]
    yield request_and_flag[:request]
  end
end