Skip to content

Instantly share code, notes, and snippets.

@mcardacci
Created June 8, 2015 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcardacci/05d09877e8430aa757a1 to your computer and use it in GitHub Desktop.
Save mcardacci/05d09877e8430aa757a1 to your computer and use it in GitHub Desktop.
class Http_Response
attr_reader :version, :status_code, :reason_phrase, :content_type, :body
def intialize(args)
@version = args.fetch(:version)
@status_code = args.fetch(:status_code)
@reason_phrase = args.fetch(:reason_phrase)
@content_type = args.fetch(:content_type)
@body = args.fetch(:body)
end
def to_s
puts "#{version} #{status_code} #{reason_phrase} \n #{content_type} \n \n #{body} \n "
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment