Class: Parsers::Chrome
- Inherits:
-
Object
- Object
- Parsers::Chrome
- Defined in:
- lib/bkmrq/parsers/chrome.rb
Overview
Chrome Bookmarks Parser
Instance Attribute Summary collapse
-
#rawdata ⇒ Object
Returns the value of attribute rawdata.
Instance Method Summary collapse
-
#initialize(rawdata) ⇒ Chrome
constructor
A new instance of Chrome.
- #run ⇒ Object
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
#rawdata ⇒ Object
Returns the value of attribute rawdata.
9 10 11 |
# File 'lib/bkmrq/parsers/chrome.rb', line 9 def rawdata @rawdata end |
Instance Method Details
#run ⇒ Object
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 |