Last active
August 29, 2015 13:57
-
-
Save dpaola2/9653948 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tweet < ActiveRecord::Base | |
def self.client | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = ENV['TWITTER_KEY'] | |
config.consumer_secret = ENV['TWITTER_SECRET'] | |
end | |
client | |
end | |
def original | |
Tweet.client.status(self.twitter_id.to_i) | |
end | |
def oembed | |
Twitter::OEmbed.new(:id => self.original.id.to_i) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment