Class: Kanpachi::DSL::Response
- Inherits:
-
Object
- Object
- Kanpachi::DSL::Response
- Defined in:
- lib/kanpachi/dsl/response.rb
Instance Method Summary collapse
- #header(key, value) ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #representation(&block) ⇒ Object
- #status(status) ⇒ Object
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 |