Class: RouteNGN::Connection
- Inherits:
-
Object
- Object
- RouteNGN::Connection
- Defined in:
- lib/routengn.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Connection
constructor
A new instance of Connection.
- #to_json ⇒ Object
Constructor Details
#initialize(*args) ⇒ Connection
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/routengn.rb', line 24 def initialize(*args) @site, @key, @secret = args.empty? ? file_config : args @consumer = OAuth::Consumer.new @key, @secret, { :signature_method => 'HMAC-SHA1', :site => @site } @request_token = @consumer.get_request_token @consumer.request(:get, @request_token.) @access_token = @request_token.get_access_token @access_token.consumer.http.read_timeout = 5000 end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
22 23 24 |
# File 'lib/routengn.rb', line 22 def access_token @access_token end |
Instance Method Details
#to_json ⇒ Object
38 39 40 |
# File 'lib/routengn.rb', line 38 def to_json {:site => @site, :key => @key, :secret => @secret}.to_json end |