Class: AastraXmlApi::PhoneSoftkeyEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/aastra_xml_api/phone_softkey_entry.rb

Instance Method Summary collapse

Constructor Details

#initialize(index, label, uri, icon) ⇒ PhoneSoftkeyEntry

Create new softkey entry at index showing on screen with label. When pressed will call URI. Next to the label text the given icon will be shown.



21
22
23
24
25
26
# File 'lib/aastra_xml_api/phone_softkey_entry.rb', line 21

def initialize(index, label, uri, icon)
  @index = index
  @label = label
  @uri = uri
  @icon = icon
end

Instance Method Details

#renderObject

Create XML text output for this entry.



29
30
31
32
33
34
35
36
37
# File 'lib/aastra_xml_api/phone_softkey_entry.rb', line 29

def render
  xml = "<SoftKey index=\"#{@index}\""
  xml += " icon=\"#{@icon}\"" if not @icon.nil?
  xml += ">\n"
  xml += "<Label>#{@label}</Label>\n"
  xml += "<URI>#{@uri}</URI>\n"
  xml += "</SoftKey>\n"
  return xml
end