class Fake::Response

Attributes

body[R]
headers[RW]
status[RW]

Public Class Methods

new(body, status, headers, &block) click to toggle source
# File lib/fake/response.rb, line 8
def initialize(body, status, headers, &block)
  raise "Response created with body and block. Only other can be given" if body && block
  @body = body
  @status = status
  @block = block
  @headers = headers
end

Public Instance Methods

evaluate() click to toggle source
# File lib/fake/response.rb, line 16
def evaluate
  if !@body && @block
    @body = @block.call(self)
  end
  @body
end