Class: Cthulhu::Destroyer

Inherits:
Object
  • Object
show all
Defined in:
lib/cthulhu/destroyer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root, blacklisted = [], not_to_be_crawled = [], option_overrides = {}) ⇒ Destroyer

Returns a new instance of Destroyer.



7
8
9
10
11
12
13
# File 'lib/cthulhu/destroyer.rb', line 7

def initialize root, blacklisted = [], not_to_be_crawled = [], option_overrides = {}
  @root = root
  @root_klass = root.class
  @skip = not_to_be_crawled.to_set
  @option_overrides = option_overrides
  @blacklisted = blacklisted
end

Instance Attribute Details

#blacklistedObject (readonly)

Returns the value of attribute blacklisted.



4
5
6
# File 'lib/cthulhu/destroyer.rb', line 4

def blacklisted
  @blacklisted
end

#option_overridesObject (readonly)

Returns the value of attribute option_overrides.



4
5
6
# File 'lib/cthulhu/destroyer.rb', line 4

def option_overrides
  @option_overrides
end

#rootObject (readonly)

Returns the value of attribute root.



4
5
6
# File 'lib/cthulhu/destroyer.rb', line 4

def root
  @root
end

#root_klassObject (readonly)

Returns the value of attribute root_klass.



4
5
6
# File 'lib/cthulhu/destroyer.rb', line 4

def root_klass
  @root_klass
end

#skipObject

Returns the value of attribute skip.



5
6
7
# File 'lib/cthulhu/destroyer.rb', line 5

def skip
  @skip
end

Instance Method Details

#destroy!Object



15
16
17
# File 'lib/cthulhu/destroyer.rb', line 15

def destroy!
  crawl root.class, [root.class]
end