Class: Kanpachi::DSL::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/kanpachi/dsl/response.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



4
5
6
# File 'lib/kanpachi/dsl/response.rb', line 4

def initialize(response)
  @response = response
end

Instance Method Details

#header(key, value) ⇒ Object



12
13
14
# File 'lib/kanpachi/dsl/response.rb', line 12

def header(key, value)
  @response.headers[key] = value
end

#representation(&block) ⇒ Object



16
17
18
# File 'lib/kanpachi/dsl/response.rb', line 16

def representation(&block)
  @response.representation.module_eval &block
end

#status(status) ⇒ Object



8
9
10
# File 'lib/kanpachi/dsl/response.rb', line 8

def status(status)
  @response.status = status
end