Class: Demux::Transmitter

Inherits:
Object
  • Object
show all
Defined in:
lib/demux/transmitter.rb

Overview

Transmit a Transmission

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transmission) ⇒ self

Constructor

Parameters:


15
16
17
18
19
# File 'lib/demux/transmitter.rb', line 15

def initialize(transmission)
  @transmission = transmission
  @uri = URI(@transmission.request_url)
  @receipt = NullTransmissionReceipt.new
end

Instance Attribute Details

#receiptObject (readonly)

Returns the value of attribute receipt


8
9
10
# File 'lib/demux/transmitter.rb', line 8

def receipt
  @receipt
end

Instance Method Details

#transmitself

Use the transmitter to send it's transmission

Returns:

  • (self)

25
26
27
28
29
30
31
32
33
34
35
# File 'lib/demux/transmitter.rb', line 25

def transmit
  build_request

  send_request

  @receipt = TransmissionReceipt.new(@request, @response)

  log_transmission

  self
end