Sha256: 106b7f7d94cb50a2cb224f9c67a1dd1a4c37365ead58ba62734a854a24a0d9b0
Contents?: true
Size: 914 Bytes
Versions: 2
Compression:
Stored size: 914 Bytes
Contents
module Troo module API class Headers class << self def build!(uri, headers = {}) new(uri, headers).build! end end def initialize(uri, headers = {}) @uri, @headers = uri, headers end def build! defaults.merge!(@headers) end private attr_reader :uri def defaults { 'Authorization' => consumer.sign!(wrapper, application) } end def application OAuth::Token.new(Troo.configuration.api_oauth_token, Troo.configuration.api_oauth_token_secret) end def wrapper Net::HTTP::Get.new(uri) end def consumer OAuth::Consumer.new(Troo.configuration.api_key, Troo.configuration.api_token, OAuthSettings.new(uri: uri).to_hash) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
troo-0.0.10 | lib/troo/api/headers.rb |
troo-0.0.9 | lib/troo/api/headers.rb |