Module: NounProjectApi::Connection

Included in:
Reporter, Retriever
Defined in:
lib/noun-project-api/connection.rb

Overview

Basic connection methods and setup.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



4
5
6
# File 'lib/noun-project-api/connection.rb', line 4

def access_token
  @access_token
end

#secretObject

Returns the value of attribute secret.



4
5
6
# File 'lib/noun-project-api/connection.rb', line 4

def secret
  @secret
end

#tokenObject

Returns the value of attribute token.



4
5
6
# File 'lib/noun-project-api/connection.rb', line 4

def token
  @token
end

Instance Method Details

#initialize(token, secret) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/noun-project-api/connection.rb', line 6

def initialize(token, secret)
  @token = token
  @secret = secret
  fail(ArgumentError, "Missing token or secret") unless @token && @secret

  @access_token = OAuth::AccessToken.new(OAuth::Consumer.new(token, secret))
end