Module: Igsearch

Defined in:
lib/igsearch.rb,
lib/igsearch/person.rb,
lib/igsearch/version.rb

Defined Under Namespace

Classes: Person

Constant Summary collapse

VERSION =
"0.0.3"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.apikeyObject

Public: Your Infogroup API key.



24
25
26
# File 'lib/igsearch.rb', line 24

def apikey
  @apikey
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Public: Set global options.

Yields the Igsearch module so you can set options on it.

Returns self.

Yields:

  • (_self)

Yield Parameters:

  • _self (Igsearch)

    the object that the method was called on



10
11
12
13
14
15
# File 'lib/igsearch.rb', line 10

def self.configure
  yield self
  # TODO: find a better way to do this
  self::Person.default_params :apikey => self.apikey
  self
end

.live_api?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/igsearch/person.rb', line 7

def self.live_api?
  HTTParty.get('http://api.infoconnect.com/v1/').code == 200
end

.reset!Object

Public: Reset the configuration to the defaults. Useful for testing.

Returns nil.



19
20
21
# File 'lib/igsearch.rb', line 19

def self.reset!
  @apikey = nil
end