Class: AgentXmpp::Xmpp::XDataItem

Inherits:
Element show all
Defined in:
lib/agent_xmpp/xmpp/x_data.rb

Overview


Instance Method Summary collapse

Methods inherited from Element

#<<, class_for_name_xmlns, #clone, import, #initialize, name_xmlns, name_xmlns_for_class, #parent=, #set_xml_lang, #typed_add, #xml_lang, #xml_lang=, xmpp_attribute, xmpp_child

Methods inherited from REXML::Element

#delete_elements, #first_element, #first_element_text, #import, import, #replace_element_text, #typed_add

Constructor Details

This class inherits a constructor from AgentXmpp::Xmpp::Element

Instance Method Details

#add_field_with_value(var, value, type = nil) ⇒ Object

.….….….….….….….….….….….….….….….….….….….….….….….….….



256
257
258
259
260
# File 'lib/agent_xmpp/xmpp/x_data.rb', line 256

def add_field_with_value(var, value, type=nil)
  field = XDataField.new(var, type)        
  field.values = value
  self << field
end

#fieldsObject

.….….….….….….….….….….….….….….….….….….….….….….….….….



251
252
253
# File 'lib/agent_xmpp/xmpp/x_data.rb', line 251

def fields
  elements.to_a('field')
end