Class: Facer::Linker

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

Overview

This class hold the main linkage to face.com acting as a gateway to subclasses

Constant Summary collapse

FaceComURI =

The main uri to face.com api.

"http://api.face.com/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(applicationName, key, secret) ⇒ Linker

Initialize the linker with security informations



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

def initialize(applicationName,key,secret)  
  @account=Account.new(self,applicationName,key,secret)
  @faces=Faces.new(self)
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



14
15
16
# File 'lib/linker.rb', line 14

def 
  @account
end

#facesObject (readonly)

Returns the value of attribute faces.



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

def faces
  @faces
end

Instance Method Details

#call(bclass, method, params = {}, files = nil) ⇒ Object

Call the service appending security informations to every request



24
25
26
27
28
29
30
# File 'lib/linker.rb', line 24

def call(bclass,method,params = {},files = nil)
  params ||={}
  params["api_key"]=@account.apiKey
  params["api_secret"]=@account.apiSecret
  resp=callAPI(bclass,method,params,files)
  return resp
end