Class: SafariBookmarksParser::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/safari_bookmarks_parser/parser.rb

Constant Summary collapse

READING_LIST_KEY =
'com.apple.ReadingList'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParser

Returns a new instance of Parser.



22
23
24
25
26
# File 'lib/safari_bookmarks_parser/parser.rb', line 22

def initialize
  @root_folder = nil
  @root_folder_without_reading_list = nil
  @reading_list = nil
end

Instance Attribute Details

#reading_listObject (readonly)

Returns the value of attribute reading_list.



20
21
22
# File 'lib/safari_bookmarks_parser/parser.rb', line 20

def reading_list
  @reading_list
end

#root_folderObject (readonly)

Returns the value of attribute root_folder.



20
21
22
# File 'lib/safari_bookmarks_parser/parser.rb', line 20

def root_folder
  @root_folder
end

#root_folder_without_reading_listObject (readonly)

Returns the value of attribute root_folder_without_reading_list.



20
21
22
# File 'lib/safari_bookmarks_parser/parser.rb', line 20

def root_folder_without_reading_list
  @root_folder_without_reading_list
end

Class Method Details

.parse(binary_plist_path) ⇒ Object



16
17
18
# File 'lib/safari_bookmarks_parser/parser.rb', line 16

def self.parse(binary_plist_path)
  new.parse(binary_plist_path)
end

Instance Method Details

#parse(binary_plist_path) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/safari_bookmarks_parser/parser.rb', line 28

def parse(binary_plist_path)
  root_node = parse_xml_plist(binary_plist_to_xml_plist(binary_plist_path))

  parse_combined(root_node)
  parse_splitted(root_node)

  self
end