Skip to content

Commit

Permalink
Make Twitter request format configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Oct 8, 2010
1 parent e664502 commit d35d644
Show file tree
Hide file tree
Showing 12 changed files with 237 additions and 148 deletions.
9 changes: 6 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PATH
twitter (0.10.0)
addressable (~> 2.2.1)
faraday (~> 0.4.6)
faraday_middleware (~> 0.1.0)
faraday_middleware (~> 0.1.1)
hashie (~> 0.4.0)
roauth (~> 0.0.3)

Expand All @@ -17,16 +17,19 @@ GEM
faraday (0.4.6)
addressable (>= 2.1.1)
rack (>= 1.0.1)
faraday_middleware (0.1.0)
faraday_middleware (0.1.1)
faraday (~> 0.4.5)
hashie (~> 0.4.0)
multi_json (~> 0.0.4)
multi_xml (~> 0.0.1)
oauth2 (~> 0.0.13)
roauth (~> 0.0.3)
hashie (0.4.0)
json_pure (1.4.6)
mocha (0.9.8)
rake
multi_json (0.0.4)
multi_xml (0.0.1)
oauth2 (0.0.13)
faraday (~> 0.4.1)
multi_json (>= 0.0.4)
Expand All @@ -43,7 +46,7 @@ DEPENDENCIES
addressable (~> 2.2.1)
fakeweb (~> 1.3.0)
faraday (~> 0.4.6)
faraday_middleware (~> 0.1.0)
faraday_middleware (~> 0.1.1)
hashie (~> 0.4.0)
json_pure (~> 1.4.6)
mocha (~> 0.9.8)
Expand Down
10 changes: 9 additions & 1 deletion lib/twitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ def self.user_agent=(value)
@user_agent = value
end

def self.format
@format ||= 'json'
end

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

def self.api_endpoint
api_endpoint = "api.twitter.com/#{Twitter.api_version}"
api_endpoint = Addressable::URI.heuristic_parse(api_endpoint).to_s
Expand All @@ -45,7 +53,7 @@ def self.api_version
def self.api_version=(value)
@api_version = value
end

class << self
attr_accessor :consumer_key
attr_accessor :consumer_secret
Expand Down
Loading

0 comments on commit d35d644

Please sign in to comment.