Class: Logux::Stream

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/logux/stream.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream) ⇒ Stream

Returns a new instance of Stream.



11
12
13
# File 'lib/logux/stream.rb', line 11

def initialize(stream)
  @stream = stream
end

Instance Attribute Details

#streamObject (readonly)

Returns the value of attribute stream.



7
8
9
# File 'lib/logux/stream.rb', line 7

def stream
  @stream
end

Instance Method Details

#write(payload) ⇒ Object



15
16
17
18
19
# File 'lib/logux/stream.rb', line 15

def write(payload)
  processed_payload = process(payload)
  Logux.logger.debug("Write to Logux response: #{processed_payload}")
  stream << processed_payload
end