Class: Parsers::Chrome

Inherits:
Object
  • Object
show all
Defined in:
lib/bkmrq/parsers/chrome.rb

Overview

Chrome Bookmarks Parser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rawdata) ⇒ Chrome

Returns a new instance of Chrome.



11
12
13
# File 'lib/bkmrq/parsers/chrome.rb', line 11

def initialize(rawdata)
  @rawdata = rawdata
end

Instance Attribute Details

#rawdataObject

Returns the value of attribute rawdata.



9
10
11
# File 'lib/bkmrq/parsers/chrome.rb', line 9

def rawdata
  @rawdata
end

Instance Method Details

#runObject



15
16
17
# File 'lib/bkmrq/parsers/chrome.rb', line 15

def run
  Oj.load(rawdata).fetch('roots', {}).then { |roots| parse(Bkmrq::BookmarkDir.new('*'), roots.values) }
end