Class: Ubi::Artifex

Inherits:
Object
  • Object
show all
Includes:
Consultor
Defined in:
lib/ubi/artifex.rb

Overview

Artifex: I work!

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query) ⇒ Artifex

Returns a new instance of Artifex.



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

def initialize(query)
  @thema = Thema.new(query[:name], query[:urls])
  query[:urls] ? fetch_pages : start_with_search
  social_search if query[:mail]
  other_search
  do_the_twist
end

Instance Attribute Details

#themaObject

Returns the value of attribute thema.



5
6
7
# File 'lib/ubi/artifex.rb', line 5

def thema
  @thema
end

Instance Method Details

#do_the_twistObject



31
32
33
34
35
# File 'lib/ubi/artifex.rb', line 31

def do_the_twist
  thema.araneas.each { |a| thema.try_datum(a) }
  # pp thema.spec
  # binding.pry if binding.respond_to?(:pry)
end

#fetch_pagesObject



27
28
29
# File 'lib/ubi/artifex.rb', line 27

def fetch_pages
  thema.araneas.each(&:work)
end

#other_searchObject



24
25
# File 'lib/ubi/artifex.rb', line 24

def other_search
end

#social_searchObject



21
22
# File 'lib/ubi/artifex.rb', line 21

def social_search
end

#start_with_searchObject



15
16
17
18
19
# File 'lib/ubi/artifex.rb', line 15

def start_with_search
  [Google, Yahoo, Bing, DuckDuckGo].each do |s|
    @thema.try_consultor(s)
  end
end