Class: Signalwire::Relay::Calling::FaxSend

Inherits:
BaseFax show all
Defined in:
lib/signalwire/relay/calling/component/fax_send.rb

Instance Attribute Summary

Attributes inherited from BaseFax

#direction, #document, #identity, #pages, #remote_identity

Attributes inherited from Component

#blocker, #call, #completed, #event, #execute_result, #state, #successful

Instance Method Summary collapse

Methods inherited from BaseFax

#broadcast_event, #event_type, #notification_handler

Methods inherited from ControlComponent

#control_id, #execute_subcommand, #setup_handlers, #stop

Methods inherited from Component

#after_execute, #check_for_waiting_events, #create_blocker, #event_type, #execute, #execute_params, #handle_execute_result, #has_blocker?, #notification_handler, #payload, #setup_handlers, #setup_waiting_events, #terminate, #unblock, #wait_for, #wait_on_blocker

Methods included from Logger

#level=, #logger, logger

Constructor Details

#initialize(call:, document:, identity: nil, header: nil) ⇒ FaxSend

Returns a new instance of FaxSend.



3
4
5
6
7
8
# File 'lib/signalwire/relay/calling/component/fax_send.rb', line 3

def initialize(call:, document:, identity: nil, header: nil)
  super(call: call)
  @priv_document = document
  @priv_identity = identity
  @priv_header = header
end

Instance Method Details

#inner_paramsObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/signalwire/relay/calling/component/fax_send.rb', line 14

def inner_params
  params = {
    node_id: @call.node_id,
    call_id: @call.id,
    control_id: control_id,
    document: @priv_document
  }

  params[:identity] = @priv_identity if @priv_identity
  params[:header_info] = @priv_header if @priv_header

  params
end

#methodObject



10
11
12
# File 'lib/signalwire/relay/calling/component/fax_send.rb', line 10

def method
  Relay::ComponentMethod::SEND_FAX
end