Class: Nineflats::Client

Inherits:
Base
  • Object
show all
Includes:
Requests
Defined in:
lib/nineflats-api/client.rb

Constant Summary collapse

WEB_BASE_URI =

API_BASE_URI = “api.9flats.com/api/v1” API_BASE_URI = “localhost.com:3000/api/v1” WEB_BASE_URI = “www.9flats.com

"http://localhost.com:3000"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Requests

included

Methods inherited from Base

api_call, base_url, client_app_key, client_app_key=, object_link

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



10
11
12
# File 'lib/nineflats-api/client.rb', line 10

def access_token
  @access_token
end

#consumerObject (readonly)

Returns the value of attribute consumer.



11
12
13
# File 'lib/nineflats-api/client.rb', line 11

def consumer
  @consumer
end

#request_token(callback_url) ⇒ Object

Returns the value of attribute request_token.



9
10
11
# File 'lib/nineflats-api/client.rb', line 9

def request_token
  @request_token
end

Class Method Details

.clientObject



23
24
25
# File 'lib/nineflats-api/client.rb', line 23

def self.client
  @@client
end

.connect(api_key, api_secret, options = {}) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/nineflats-api/client.rb', line 15

def self.connect(api_key, api_secret, options={})
  @@client = Client.new(api_key, api_secret, options)
  if block_given?
    yield @@client
  end
  @@client
end

.consumerObject



27
28
29
# File 'lib/nineflats-api/client.rb', line 27

def self.consumer
  @@client.consumer
end

Instance Method Details

#exchange_access_token(request_token, verifier) ⇒ Object



35
36
37
# File 'lib/nineflats-api/client.rb', line 35

def exchange_access_token(request_token, verifier)
  request_token.get_access_token(:oauth_verifier => verifier)
end