Class: Xing::Client

Inherits:
Object
  • Object
show all
Includes:
Api::Reader, Api::Writer, Helpers::Request
Defined in:
lib/xing/client.rb

Constant Summary

Constants included from Helpers::Request

Helpers::Request::API_PATH, Helpers::Request::DEFAULT_HEADERS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Api::Reader

#network_feed

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



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

def initialize(options={})
  @consumer_key     = options[:consumer_key]
  @consumer_secret  = options[:consumer_secret]
  @auth_token       = options[:oauth_token]
  @auth_secret      = options[:oauth_token_secret]
end

Instance Attribute Details

#consumer_optionsObject (readonly)

Returns the value of attribute consumer_options.



8
9
10
# File 'lib/xing/client.rb', line 8

def consumer_options
  @consumer_options
end

#consumer_secretObject (readonly)

Returns the value of attribute consumer_secret.



8
9
10
# File 'lib/xing/client.rb', line 8

def consumer_secret
  @consumer_secret
end

#consumer_tokenObject (readonly)

Returns the value of attribute consumer_token.



8
9
10
# File 'lib/xing/client.rb', line 8

def consumer_token
  @consumer_token
end

Instance Method Details

#access_tokenObject



21
22
23
# File 'lib/xing/client.rb', line 21

def access_token
  @access_token ||= ::OAuth::AccessToken.new(consumer, @auth_token, @auth_secret)
end

#consumerObject



17
18
19
# File 'lib/xing/client.rb', line 17

def consumer
  @consumer ||= ::OAuth::Consumer.new(@consumer_key, @consumer_secret, DEFAULT_OAUTH_OPTIONS)
end