Class: Aws::AsyncClientStubs::StubStream
- Inherits:
- 
      Object
      
        - Object
- Aws::AsyncClientStubs::StubStream
 
- Defined in:
- lib/aws-sdk-core/async_client_stubs.rb
Instance Attribute Summary collapse
- 
  
    
      #send_events  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute send_events. 
- 
  
    
      #state  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute state. 
Instance Method Summary collapse
- #close ⇒ Object
- #closed? ⇒ Boolean
- #data(bytes, options = {}) ⇒ Object
- 
  
    
      #initialize  ⇒ StubStream 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of StubStream. 
Constructor Details
#initialize ⇒ StubStream
Returns a new instance of StubStream.
| 55 56 57 | # File 'lib/aws-sdk-core/async_client_stubs.rb', line 55 def initialize @state = :open end | 
Instance Attribute Details
#send_events ⇒ Object
Returns the value of attribute send_events.
| 59 60 61 | # File 'lib/aws-sdk-core/async_client_stubs.rb', line 59 def send_events @send_events end | 
#state ⇒ Object (readonly)
Returns the value of attribute state.
| 61 62 63 | # File 'lib/aws-sdk-core/async_client_stubs.rb', line 61 def state @state end | 
Instance Method Details
#close ⇒ Object
| 77 78 79 | # File 'lib/aws-sdk-core/async_client_stubs.rb', line 77 def close @state = :closed end | 
#closed? ⇒ Boolean
| 73 74 75 | # File 'lib/aws-sdk-core/async_client_stubs.rb', line 73 def closed? @state == :closed end | 
#data(bytes, options = {}) ⇒ Object
| 63 64 65 66 67 68 69 70 71 | # File 'lib/aws-sdk-core/async_client_stubs.rb', line 63 def data(bytes, = {}) if [:end_stream] @state = :closed else decoder = Aws::EventStream::Decoder.new event = decoder.decode_chunk(bytes).first @send_events << decoder.decode_chunk(event.payload.read).first end end |