Class: Scrape::DefaultLoader
- Inherits:
-
Object
- Object
- Scrape::DefaultLoader
- Defined in:
- lib/scrape/default_loader.rb
Instance Method Summary collapse
-
#initialize(app) ⇒ DefaultLoader
constructor
A new instance of DefaultLoader.
- #load(path) ⇒ Object
Constructor Details
#initialize(app) ⇒ DefaultLoader
Returns a new instance of DefaultLoader.
2 3 4 |
# File 'lib/scrape/default_loader.rb', line 2 def initialize app @app = app end |
Instance Method Details
#load(path) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/scrape/default_loader.rb', line 6 def load path path = File. path File.exists? path or raise Scrape::FileNotFound, path dsl = Scrape::DSL.new @app dsl.instance_eval File.read(path), path end |