Skip to content

Commit

Permalink
Specify Twitter API version for all REST API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Sep 23, 2010
1 parent 108019e commit 76b1fa3
Show file tree
Hide file tree
Showing 12 changed files with 195 additions and 194 deletions.
11 changes: 9 additions & 2 deletions lib/twitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

module Twitter
include HTTParty
API_VERSION = "1".freeze

class TwitterError < StandardError
attr_reader :data
Expand All @@ -26,13 +25,21 @@ class InformTwitter < StandardError; end
class NotFound < StandardError; end

def self.api_endpoint
@api_endpoint ||= "api.twitter.com/#{API_VERSION}"
@api_endpoint ||= "api.twitter.com/#{self.api_version}"
end

def self.api_endpoint=(value)
@api_endpoint = value
end

def self.api_version
@api_version ||= "1"
end

def self.api_version=(value)
@api_version = value
end

def self.firehose(options = {})
perform_get("/statuses/public_timeline.json")
end
Expand Down
Loading

0 comments on commit 76b1fa3

Please sign in to comment.