Class: AastraXmlApi::PhoneDirectoryEntry

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

Constant Summary

Constants inherited from Phone

AastraXmlApi::Phone::HIGHASCII

Instance Method Summary collapse

Methods inherited from Phone

#addIcon, #addSoftkey, #convert_high_ascii, #escape, #getRefreshTimeout, #getRefreshURL, #setAllowAnswer, #setBeep, #setCancelAction, #setDestroyOnExit, #setLockIn, #setRefresh, #setTimeout, #setTitle, #setTitleWrap

Constructor Details

#initialize(name, telephone) ⇒ PhoneDirectoryEntry

Create new name and number entry. Overrides the initialize method of Phone.



17
18
19
20
# File 'lib/aastra_xml_api/phone_directory_entry.rb', line 17

def initialize(name, telephone)
  @name = name
  @telephone = telephone
end

Instance Method Details

#getNameObject

Get the name associated with this entry.



23
24
25
# File 'lib/aastra_xml_api/phone_directory_entry.rb', line 23

def getName
  @name
end

#renderObject

Create XML text output for this entry.



28
29
30
31
32
# File 'lib/aastra_xml_api/phone_directory_entry.rb', line 28

def render
  name = escape(@name)
  telephone = escape(@telephone)
  return "<MenuItem>\n<Prompt>#{name}</Prompt>\n<URI>#{telephone}</URI>\n</MenuItem>\n"
end