Class: Xing::Client
- Inherits:
-
Object
- Object
- Xing::Client
- 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
-
#consumer_options ⇒ Object
readonly
Returns the value of attribute consumer_options.
-
#consumer_secret ⇒ Object
readonly
Returns the value of attribute consumer_secret.
-
#consumer_token ⇒ Object
readonly
Returns the value of attribute consumer_token.
Instance Method Summary collapse
- #access_token ⇒ Object
- #consumer ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Api::Reader
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(={}) @consumer_key = [:consumer_key] @consumer_secret = [:consumer_secret] @auth_token = [:oauth_token] @auth_secret = [:oauth_token_secret] end |
Instance Attribute Details
#consumer_options ⇒ Object (readonly)
Returns the value of attribute consumer_options.
8 9 10 |
# File 'lib/xing/client.rb', line 8 def @consumer_options end |
#consumer_secret ⇒ Object (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_token ⇒ Object (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_token ⇒ Object
21 22 23 |
# File 'lib/xing/client.rb', line 21 def access_token @access_token ||= ::OAuth::AccessToken.new(consumer, @auth_token, @auth_secret) end |
#consumer ⇒ Object
17 18 19 |
# File 'lib/xing/client.rb', line 17 def consumer @consumer ||= ::OAuth::Consumer.new(@consumer_key, @consumer_secret, DEFAULT_OAUTH_OPTIONS) end |