Class: Punchblock::Component::SendFax

Inherits:
ComponentNode show all
Defined in:
lib/punchblock/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 Punchblock::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 Punchblock::Component::ComponentNode

Instance Method Details

#inherit(xml_node) ⇒ Object


40
41
42
43
44
45
# File 'lib/punchblock/component/send_fax.rb', line 40

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


47
48
49
50
51
52
# File 'lib/punchblock/component/send_fax.rb', line 47

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

#render_document=(other) ⇒ Object


57
58
59
# File 'lib/punchblock/component/send_fax.rb', line 57

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

#render_documentsDocument

Returns the document to render

Returns:

  • (Document)

    the document to render


55
# File 'lib/punchblock/component/send_fax.rb', line 55

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