Class: RightScraper::Builders::Base
- Inherits:
-
Object
- Object
- RightScraper::Builders::Base
- Defined in:
- lib/right_scraper/builders/base.rb
Overview
Base class for building additional metadata from filesystem based checkouts. Subclasses should override #go, and possibly #new if they require additional arguments.
The lifecycle for a builder is as follows:
-
builder = Builder.new (once)
-
builder.go(dir, resource) (many times)
-
builder.finish (once)
Direct Known Subclasses
Instance Method Summary collapse
-
#finish ⇒ TrueClass
Notification that all scans for this repository have completed.
-
#go(dir, resource) ⇒ TrueClass
Run builder for this resource.
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
41 42 43 |
# File 'lib/right_scraper/builders/base.rb', line 41 def initialize( = {}) @logger = [:logger] || ::RightScraper::Loggers::Default.new end |
Instance Method Details
#finish ⇒ TrueClass
Notification that all scans for this repository have completed.
58 59 60 |
# File 'lib/right_scraper/builders/base.rb', line 58 def finish true end |
#go(dir, resource) ⇒ TrueClass
Run builder for this resource.
51 52 53 |
# File 'lib/right_scraper/builders/base.rb', line 51 def go(dir, resource) raise NotImplementedError end |