Class: HTTPResponse::Response

Inherits:
Object
  • Object
show all
Extended by:
Wizarding
Defined in:
lib/bats/modules/httpresponse.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Wizarding

inherited, traits

Methods included from Metaid

#class_def, #meta_def, #meta_eval, #metaclass

Class Method Details

.b(b) ⇒ Object



18
19
20
21
# File 'lib/bats/modules/httpresponse.rb', line 18

def self.b b
  @traits[:body] = b
  self
end

.call(env) ⇒ Object



11
# File 'lib/bats/modules/httpresponse.rb', line 11

def self.call env; new.call( env ); end

.h(h) ⇒ Object



13
14
15
16
# File 'lib/bats/modules/httpresponse.rb', line 13

def self.h h
  @traits[:headers].merge!( h )
  self
end

Instance Method Details

#call(env) ⇒ Object



23
24
25
26
# File 'lib/bats/modules/httpresponse.rb', line 23

def call env
  @headers.merge! 'Content-Length' => @body.length.to_s
  [ @status, @headers, @body ]
end