class Micky::Response

Delegates to a Net::HTTPResponse instance

Attributes

uri[R]

Public Class Methods

new(response, uri) click to toggle source
Calls superclass method
# File lib/micky/response.rb, line 8
def initialize(response, uri)
  super(response)
  @uri = uri
end

Public Instance Methods

ai(*args) click to toggle source

Support for `awesome_print`

# File lib/micky/response.rb, line 41
def ai(*args)
  "#<Micky::Response #{super}>"
end
data() click to toggle source
# File lib/micky/response.rb, line 13
def data
  @data ||= begin
    if body and parser = Micky.parsers[content_type]
      parser.call(body)
    else
      body
    end
  end
end
data_uri() click to toggle source
# File lib/micky/response.rb, line 23
def data_uri
  @data_uri ||= begin
    if body
      require 'base64' unless defined? Base64
      "data:#{content_type};base64,#{Base64.encode64(body)}"
    end
  end
end
inspect() click to toggle source
# File lib/micky/response.rb, line 36
def inspect
  "#<Micky::Response #{super}>"
end
to_s() click to toggle source
# File lib/micky/response.rb, line 32
def to_s
  body
end