Class: Adhearsion::Rayo::Component::SendFax

Inherits:
ComponentNode show all
Defined in:
lib/adhearsion/rayo/component/send_fax.rb

Defined Under Namespace

Classes: FaxDocument

Instance Attribute Summary

Attributes inherited from RayoNode

#client, #connection, #original_component

Instance Method Summary collapse

Methods inherited from ComponentNode

#add_event, #complete_event, #complete_event=, #initialize, #register_event_handler, #register_internal_handlers, #response=, #stop!, #stop_action, #trigger_event_handler, #write_action

Methods inherited from Adhearsion::Rayo::CommandNode

#initialize, #response, #response=

Methods inherited from RayoNode

#==, class_from_registration, from_xml, #inspect, #rayo_attributes, register, #source, #to_rayo, #to_xml

Constructor Details

This class inherits a constructor from Adhearsion::Rayo::Component::ComponentNode

Instance Method Details

#inherit(xml_node) ⇒ Object


41
42
43
44
45
46
# File 'lib/adhearsion/rayo/component/send_fax.rb', line 41

def inherit(xml_node)
   document_nodes = xml_node.xpath 'ns:document', ns: self.class.registered_ns
   self.render_documents = document_nodes.to_a.map { |node| FaxDocument.from_xml node }

   super
end

#rayo_children(root) ⇒ Object


48
49
50
51
52
53
# File 'lib/adhearsion/rayo/component/send_fax.rb', line 48

def rayo_children(root)
  render_documents.each do |render_document|
    render_document.to_rayo root.parent
  end
  super
end

#render_document=(other) ⇒ Object


58
59
60
# File 'lib/adhearsion/rayo/component/send_fax.rb', line 58

def render_document=(other)
  self.render_documents = [other].compact
end

#render_documentsDocument

Returns the document to render

Returns:

  • (Document)

    the document to render


56
# File 'lib/adhearsion/rayo/component/send_fax.rb', line 56

attribute :render_documents, Array[FaxDocument], default: []