Class: Scrapes::Initializer

Inherits:
Object
  • Object
show all
Defined in:
lib/scrapes/initializer.rb

Overview

Initialize the Scrapes library

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInitializer

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_dirObject

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_parentObject

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

Yields:

  • (initializer)


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

#processObject

Run all the initilization methods



54
55
56
# File 'lib/scrapes/initializer.rb', line 54

def process
  load_pages
end