Class: Taxii::MessageParsers::PollResponse

Inherits:
Nokogiri::XML::SAX::Document
  • Object
show all
Defined in:
lib/taxii/parsers/sax_poll_response.rb

Instance Method Summary collapse

Instance Method Details

#captureObject



9
10
11
# File 'lib/taxii/parsers/sax_poll_response.rb', line 9

def capture
  @capture.nil? ? @capture = false : @capture
end

#capture=(flag) ⇒ Object



12
13
14
# File 'lib/taxii/parsers/sax_poll_response.rb', line 12

def capture=(flag)
  @capture=flag
end

#characters(str) ⇒ Object



21
22
23
# File 'lib/taxii/parsers/sax_poll_response.rb', line 21

def characters(str)
  self.package_data << str
end

#end_element(name, attrs = []) ⇒ Object



24
25
26
27
28
29
# File 'lib/taxii/parsers/sax_poll_response.rb', line 24

def end_element(name, attrs=[])
  if name.match(/taxii_11:Content_Block/)
    STDERR.puts 'END Content_Block'
    self.capture=false
  end
end

#package_dataObject



6
7
8
# File 'lib/taxii/parsers/sax_poll_response.rb', line 6

def package_data
  @package_data ||= []
end

#start_element(name, attrs = []) ⇒ Object



15
16
17
18
19
20
# File 'lib/taxii/parsers/sax_poll_response.rb', line 15

def start_element(name, attrs=[])
  if name.match(/taxii_11:Content_Block/)
    STDERR.puts 'START Content_Block'
    self.capture=true
  end
end