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

Inherits:
RayoNode show all
Defined in:
lib/adhearsion/rayo/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



17
18
19
20
21
22
23
# File 'lib/adhearsion/rayo/component/send_fax.rb', line 17

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



25
26
27
28
29
30
31
32
# File 'lib/adhearsion/rayo/component/send_fax.rb', line 25

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