Class: Jabber::EntityTime::IqTime
- Inherits:
-
IqQuery
- Object
- REXML::Element
- XMPPElement
- IqQuery
- Jabber::EntityTime::IqTime
- Defined in:
- lib/xmpp4r/entity_time/iq.rb
Instance Method Summary collapse
-
#initialize(time = nil) ⇒ IqTime
constructor
A new instance of IqTime.
- #set_time(time = nil) ⇒ Object
Methods inherited from XMPPElement
class_for_name_xmlns, #clone, force_xmlns, force_xmlns?, import, name_xmlns, name_xmlns_for_class, #parent=, #set_xml_lang, #typed_add, #xml_lang, #xml_lang=
Methods inherited from REXML::Element
#==, #delete_elements, #each_elements, #first_element, #first_element_content, #first_element_text, #import, import, #replace_element_content, #replace_element_text, #typed_add
Constructor Details
#initialize(time = nil) ⇒ IqTime
Returns a new instance of IqTime.
13 14 15 16 |
# File 'lib/xmpp4r/entity_time/iq.rb', line 13 def initialize(time=nil) super() set_time(time) end |
Instance Method Details
#set_time(time = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/xmpp4r/entity_time/iq.rb', line 18 def set_time(time=nil) time ||= Time.now tzo = self.add_element('tzo') tzo.add_text(time_zone_offset(time)) utc = self.add_element('utc') utc.add_text(utc_time(time)) end |