Class: RightScraper::Builders::Builder
- Inherits:
-
Object
- Object
- RightScraper::Builders::Builder
- 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 ⇒ Object
Notification that all scans for this repository have completed.
-
#go(dir, resource) ⇒ Object
Run builder for this resource.
-
#initialize(options = {}) ⇒ Builder
constructor
Create a new Builder.
Constructor Details
#initialize(options = {}) ⇒ Builder
Create a new Builder. Recognizes options as given. Some options may be required, others optional. This class recognizes only :logger.
Options
:logger
-
Optional. Logger currently being used
Parameters
- options(Hash)
-
builder options
46 47 48 |
# File 'lib/right_scraper/builders/base.rb', line 46 def initialize(={}) @logger = .fetch(:logger, Logger.new) end |
Instance Method Details
#finish ⇒ Object
Notification that all scans for this repository have completed.
60 61 |
# File 'lib/right_scraper/builders/base.rb', line 60 def finish end |
#go(dir, resource) ⇒ Object
Run builder for this resource.
Parameters
- dir(String)
-
directory resource exists at
- resource(Object)
-
resource instance being built
55 56 |
# File 'lib/right_scraper/builders/base.rb', line 55 def go(dir, resource) end |