Class: Punchblock::Component::SendFax::FaxDocument

Inherits:
RayoNode show all
Defined in:
lib/punchblock/component/send_fax.rb

Instance Attribute Summary

Attributes inherited from RayoNode

#client, #connection, #original_component

Instance Method Summary collapse

Methods inherited from RayoNode

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

Instance Method Details

#inherit(xml_node) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/punchblock/component/send_fax.rb', line 16

def inherit(xml_node)
  super
  if pages = xml_node[:pages]
    self.pages = pages.split(',').map { |p| p.include?('-') ? Range.new(*p.split('-').map(&:to_i)) : p.to_i }
  end
  self
end

#rayo_attributesObject



24
25
26
27
28
29
30
31
# File 'lib/punchblock/component/send_fax.rb', line 24

def rayo_attributes
  {
    'url'      => url,
    'identity' => identity,
    'header'   => header,
    'pages'    => rayo_pages
  }
end