Class: Scrapes::Initializer
- Inherits:
-
Object
- Object
- Scrapes::Initializer
- Defined in:
- lib/scrapes/initializer.rb
Overview
Initialize the Scrapes library
Instance Attribute Summary collapse
-
#pages_dir ⇒ Object
The directory name where the pages classes are kept.
-
#pages_parent ⇒ Object
The parent directory where the pages_dir can be found.
Class Method Summary collapse
-
.run {|initializer| ... } ⇒ Object
Create a new Initializer and run it.
Instance Method Summary collapse
-
#initialize ⇒ Initializer
constructor
Establish all the defaults.
-
#process ⇒ Object
Run all the initilization methods.
Constructor Details
#initialize ⇒ Initializer
Establish all the defaults
47 48 49 50 |
# File 'lib/scrapes/initializer.rb', line 47 def initialize @pages_dir = 'pages' @pages_parent = File.dirname($0) end |
Instance Attribute Details
#pages_dir ⇒ Object
The directory name where the pages classes are kept
31 32 33 |
# File 'lib/scrapes/initializer.rb', line 31 def pages_dir @pages_dir end |
#pages_parent ⇒ Object
The parent directory where the pages_dir can be found
35 36 37 |
# File 'lib/scrapes/initializer.rb', line 35 def pages_parent @pages_parent end |
Class Method Details
.run {|initializer| ... } ⇒ Object
Create a new Initializer and run it
39 40 41 42 43 |
# File 'lib/scrapes/initializer.rb', line 39 def self.run (&block) initializer = self.new yield initializer if block initializer end |
Instance Method Details
#process ⇒ Object
Run all the initilization methods
54 55 56 |
# File 'lib/scrapes/initializer.rb', line 54 def process load_pages end |