Class: Markio::Parser
- Inherits:
-
Object
- Object
- Markio::Parser
- Defined in:
- lib/markio/parser.rb
Instance Method Summary collapse
-
#initialize(data) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(data) ⇒ Parser
Returns a new instance of Parser.
6 7 8 |
# File 'lib/markio/parser.rb', line 6 def initialize data @document = Nokogiri::HTML data end |
Instance Method Details
#parse ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/markio/parser.rb', line 10 def parse bookmarks = [] traverse(@document, []) do |bookmark| bookmarks << bookmark end consolidate bookmarks end |