lib/twitter/request.rb in szimek-twitter-0.6.4 vs lib/twitter/request.rb in szimek-twitter-0.6.5

- old
+ new

@@ -13,11 +13,11 @@ attr_reader :client, :method, :path, :options def_delegators :client, :get, :post def initialize(client, method, path, options={}) - @client, @method, @path, @options = client, method, path, options + @client, @method, @path, @options = client, method, path, {:mash => true}.merge(options) end def uri @uri ||= begin uri = URI.parse(path) @@ -43,10 +43,11 @@ send(:post, uri, options[:body], options[:headers]) end def make_friendly(response) raise_errors(response) - mash(parse(response)) + data = parse(response) + options[:mash] ? mash(data) : data end def raise_errors(response) case response.code.to_i when 400 \ No newline at end of file