Class: WinevtBookmarkDocument

Inherits:
Nokogiri::XML::SAX::Document
  • Object
show all
Defined in:
lib/fluent/plugin/bookmark_sax_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWinevtBookmarkDocument

Returns a new instance of WinevtBookmarkDocument.



6
7
8
9
# File 'lib/fluent/plugin/bookmark_sax_parser.rb', line 6

def initialize
  @result = {}
  super
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



4
5
6
# File 'lib/fluent/plugin/bookmark_sax_parser.rb', line 4

def result
  @result
end

Instance Method Details

#characters(string) ⇒ Object



22
23
# File 'lib/fluent/plugin/bookmark_sax_parser.rb', line 22

def characters(string)
end

#end_documentObject



28
29
# File 'lib/fluent/plugin/bookmark_sax_parser.rb', line 28

def end_document
end

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



25
26
# File 'lib/fluent/plugin/bookmark_sax_parser.rb', line 25

def end_element(name, attributes = [])
end

#start_documentObject



11
12
# File 'lib/fluent/plugin/bookmark_sax_parser.rb', line 11

def start_document
end

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



14
15
16
17
18
19
20
# File 'lib/fluent/plugin/bookmark_sax_parser.rb', line 14

def start_element(name, attributes = [])
  if name == "Bookmark"
    @result[:channel] = attributes[0][1] rescue nil
    @result[:record_id] = attributes[1][1].to_i rescue nil
    @result[:is_current] = attributes[2][1].downcase == "true" rescue nil
  end
end