Class: Parsers::Brave

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

Overview

Brave Bookmarks Parser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rawdata) ⇒ Brave

Returns a new instance of Brave.



11
12
13
# File 'lib/bkmrq/parsers/brave.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/brave.rb', line 9

def rawdata
  @rawdata
end

Instance Method Details

#runObject



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

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