Class: ESearchy::Search

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

Defined Under Namespace

Modules: MetaType Classes: Emails, People

Constant Summary collapse

EMAIL_ENGINES =
{
  :Google         => ESearchy::SearchEngines::Google, 
  :Bing           => ESearchy::SearchEngines::Bing, 
  :Yahoo          => ESearchy::SearchEngines::Yahoo, 
  :Altavista      => ESearchy::SearchEngines::Altavista,
  :PGP            => ESearchy::OtherEngines::PGP, 
  :Spider         => ESearchy::OtherEngines::Spider,
  :Usenet         => ESearchy::OtherEngines::Usenet,
  :GoogleGroups   => ESearchy::OtherEngines::GoogleGroups  
}
PEOPLE_ENGINES =
{
:LinkedIn       => ESearchy::SocialEngines::LinkedIn, 
:GoogleProfiles => ESearchy::SocialEngines::GoogleProfiles,
:GooglePlus => ESearchy::SocialEngines::GooglePlus,
:Naymz          => ESearchy::SocialEngines::Naymz,
:Classmates     => ESearchy::SocialEngines::Classmates,
:Spoke          => ESearchy::SocialEngines::Spoke,
:JigSaw         => ESearchy::SocialEngines::JigSaw,
:Ziggs          => ESearchy::SocialEngines::Ziggs,
:Plaxo          => ESearchy::SocialEngines::Plaxo
}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args, &block) ⇒ Search

Returns a new instance of Search.



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/esearchy/esearchy.rb', line 48

def initialize(args, &block)    
  @@query = args[:query] || nil
  @@company = args[:company] || nil
  @@maxhits = args[:maxhits] || nil
  @@start_at = args[:start_at] || nil
  @@website = args[:website] || nil
  ESearchy.log = args[:log] if args[:log]
  $emails = []
  $people = []
  $results = []
  block.call(self) if block_given?
end

Class Method Details

.companyObject



71
72
73
# File 'lib/esearchy/esearchy.rb', line 71

def self.company
  @@company
end

.maxhitsObject



79
80
81
# File 'lib/esearchy/esearchy.rb', line 79

def self.maxhits
  @@maxhits
end

.queryObject

Global Attributes



67
68
69
# File 'lib/esearchy/esearchy.rb', line 67

def self.query
  @@query
end

.websiteObject



75
76
77
# File 'lib/esearchy/esearchy.rb', line 75

def self.website
  @@website
end

Instance Method Details

#Emails(*args, &block) ⇒ Object



99
100
101
# File 'lib/esearchy/esearchy.rb', line 99

def Emails(*args, &block)
  Emails.new(*args, &block)
end

#emailsObject



87
88
89
# File 'lib/esearchy/esearchy.rb', line 87

def emails
  $emails
end

#maxhitsObject



83
84
85
# File 'lib/esearchy/esearchy.rb', line 83

def maxhits
  @@maxhits
end

#peopleObject



91
92
93
# File 'lib/esearchy/esearchy.rb', line 91

def people
  $people
end

#People(*args, &block) ⇒ Object



103
104
105
# File 'lib/esearchy/esearchy.rb', line 103

def People(*args, &block)
  People.new(*args, &block)
end

#resultsObject



95
96
97
# File 'lib/esearchy/esearchy.rb', line 95

def results
  $results
end

#start(&block) ⇒ Object



61
62
63
# File 'lib/esearchy/esearchy.rb', line 61

def start(&block)
  block.call(self)
end