Parent

Class/Module Index [+]

Quicksearch

Twitter::REST::Response::ParseJson

Constants

WHITESPACE_REGEX

Public Instance Methods

on_complete(response) click to toggle source
# File lib/twitter/rest/response/parse_json.rb, line 19
def on_complete(response)
  response.body = parse(response.body) if respond_to?(:parse) && !unparsable_status_codes.include?(response.status)
end
parse(body) click to toggle source
# File lib/twitter/rest/response/parse_json.rb, line 10
def parse(body)
  case body
  when WHITESPACE_REGEX, nil
    nil
  else
    JSON.parse(body, :symbolize_names => true)
  end
end
unparsable_status_codes() click to toggle source
# File lib/twitter/rest/response/parse_json.rb, line 23
def unparsable_status_codes
  [204, 301, 302, 304]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.