Class: MarkovTwitter::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/markov_twitter/authenticator.rb

Overview

Wrapper for the twitter gem’s client.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, secret_key:) ⇒ Authenticator

Returns a new instance of Authenticator.

Parameters:

  • api_key (String)

    should be stored in ENV var.

  • secret_key (String)

    should be stored in ENV var.



9
10
11
12
13
14
# File 'lib/markov_twitter/authenticator.rb', line 9

def initialize(api_key:, secret_key:)
  @client = Twitter::REST::Client.new do |config|
    config.consumer_key        = api_key
    config.consumer_secret     = secret_key
  end
end

Instance Attribute Details

#clientTwitter::Client (readonly)

Returns:

  • (Twitter::Client)


5
6
7
# File 'lib/markov_twitter/authenticator.rb', line 5

def client
  @client
end