Class: Avrocado::Encoder
- Inherits:
- 
      Object
      
        - Object
- Avrocado::Encoder
 
- Defined in:
- lib/avrocado/serializer.rb
Instance Attribute Summary collapse
- 
  
    
      #message  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute message. 
- 
  
    
      #schema  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute schema. 
Instance Method Summary collapse
- #encoded ⇒ Object
- 
  
    
      #initialize(message, schema)  ⇒ Encoder 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Encoder. 
Constructor Details
#initialize(message, schema) ⇒ Encoder
Returns a new instance of Encoder.
| 21 22 23 24 | # File 'lib/avrocado/serializer.rb', line 21 def initialize(, schema) @message = @schema = schema end | 
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
| 19 20 21 | # File 'lib/avrocado/serializer.rb', line 19 def @message end | 
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
| 19 20 21 | # File 'lib/avrocado/serializer.rb', line 19 def schema @schema end | 
Instance Method Details
#encoded ⇒ Object
| 26 27 28 29 30 31 32 33 34 | # File 'lib/avrocado/serializer.rb', line 26 def encoded .each { |field, value| record.put(field.to_s, value) } writer.write(record, encoder) encoder.flush output.to_byte_array end |