Class: BookmarkParser
- Inherits:
-
Object
- Object
- BookmarkParser
- Defined in:
- lib/bookmarks.rb
Overview
Abstract base class for bookmark parsers
Direct Known Subclasses
Instance Attribute Summary collapse
-
#allurls ⇒ Object
readonly
Returns the value of attribute allurls.
Instance Method Summary collapse
-
#initialize(file_path, search_term) ⇒ BookmarkParser
constructor
A new instance of BookmarkParser.
-
#parse ⇒ Object
Abstract method - must be implemented by subclasses.
- #results ⇒ Object
Constructor Details
#initialize(file_path, search_term) ⇒ BookmarkParser
Returns a new instance of BookmarkParser.
57 58 59 60 61 |
# File 'lib/bookmarks.rb', line 57 def initialize(file_path, search_term) @file_path = file_path @searching = /#{search_term}/i @allurls = [] end |
Instance Attribute Details
#allurls ⇒ Object (readonly)
Returns the value of attribute allurls.
55 56 57 |
# File 'lib/bookmarks.rb', line 55 def allurls @allurls end |
Instance Method Details
#parse ⇒ Object
Abstract method - must be implemented by subclasses
64 65 66 |
# File 'lib/bookmarks.rb', line 64 def parse raise NotImplementedError, "Subclasses must implement parse method" end |
#results ⇒ Object
68 69 70 |
# File 'lib/bookmarks.rb', line 68 def results @allurls end |