Class: Twitty::Facade
- Inherits:
-
Object
- Object
- Twitty::Facade
- Defined in:
- lib/twitty/facade.rb
Constant Summary
Constants included from Payload
Payload::EMPTY_PAYLOAD_ACTIONS
Constants included from Constants
Instance Method Summary collapse
- #generate_crc(crc_token) ⇒ Object
-
#initialize {|config| ... } ⇒ Facade
constructor
A new instance of Facade.
- #override_client_tokens(access_token, access_token_secret) ⇒ Object
Methods included from Payload
#access_token_payload, #build_payload, #like_tweet_payload, #request_oauth_token_payload, #send_direct_message_payload, #send_tweet_reply_payload, #unlike_tweet_payload
Constructor Details
#initialize {|config| ... } ⇒ Facade
Returns a new instance of Facade.
7 8 9 |
# File 'lib/twitty/facade.rb', line 7 def initialize yield(config) if block_given? end |
Instance Method Details
#generate_crc(crc_token) ⇒ Object
17 18 19 20 |
# File 'lib/twitty/facade.rb', line 17 def generate_crc(crc_token) hash = OpenSSL::HMAC.digest('sha256', config.consumer_secret, crc_token) Base64.encode64(hash).strip! end |
#override_client_tokens(access_token, access_token_secret) ⇒ Object
22 23 24 25 |
# File 'lib/twitty/facade.rb', line 22 def override_client_tokens(access_token, access_token_secret) config.access_token = access_token config.access_token_secret = access_token_secret end |