Class: XmlPayload::StatusRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/valuefirst/xml_payload/status_request.rb

Class Method Summary collapse

Class Method Details

.guid_tag(guid, seq_list) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/valuefirst/xml_payload/status_request.rb', line 16

def self.guid_tag guid, seq_list
  guid_tag = XmlPayload::XmlGenerator.create_node("GUID", attributes: {"GUID" => guid })
  if !seq_list.empty?
    seq_list.each do |seq|
      guid_tag << XmlPayload::XmlGenerator.create_node("STATUS", attributes: {"SEQ" => seq.to_s})
    end
  end
  guid_tag
end

.statusrequest(vfirst_config, guid_seq_hash) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/valuefirst/xml_payload/status_request.rb', line 3

def self.statusrequest vfirst_config, guid_seq_hash
  doc = XmlPayload::XmlGenerator.new_doc
  message_tag = XmlPayload::XmlGenerator.create_node("STATUSREQUEST", attributes: {"VER" => XmlPayload::VERSION})
  doc.root = message_tag
  user_tag = XmlPayload::XmlGenerator.user_tag vfirst_config
  doc.root << user_tag

  guid_seq_hash.each do |guid, seq_list|
    doc.root << guid_tag(guid, seq_list)
  end
  doc
end