Skip to content

Instantly share code, notes, and snippets.

@thiagoa
Last active October 4, 2016 11:28
Show Gist options
  • Select an option

  • Save thiagoa/a65c7eea472d377d6df785ae8e272c63 to your computer and use it in GitHub Desktop.

Select an option

Save thiagoa/a65c7eea472d377d6df785ae8e272c63 to your computer and use it in GitHub Desktop.
First twitter client factory
# app/models/twitter_client_factory.rb
class TwitterClientFactory
def call(params)
Twitter::REST::Client.new do |config|
config.consumer_key = params['consumer_key']
config.consumer_secret = params['consumer_secret']
config.access_token = params['access_token']
config.access_token_secret = params['access_token_secret']
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment