Class: Xenon::Response
- Inherits:
-
Object
- Object
- Xenon::Response
- Defined in:
- lib/xenon/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #complete? ⇒ Boolean
- #copy(changes = {}) ⇒ Object
- #freeze ⇒ Object
-
#initialize ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 |
# File 'lib/xenon/response.rb', line 7 def initialize @headers = Headers.new @complete = false freeze end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/xenon/response.rb', line 5 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/xenon/response.rb', line 5 def headers @headers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/xenon/response.rb', line 5 def status @status end |
Instance Method Details
#complete? ⇒ Boolean
13 14 15 |
# File 'lib/xenon/response.rb', line 13 def complete? @complete end |
#copy(changes = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/xenon/response.rb', line 17 def copy(changes = {}) r = dup changes.each { |k, v| r.instance_variable_set("@#{k}", v) } r.freeze end |
#freeze ⇒ Object
23 24 25 26 27 |
# File 'lib/xenon/response.rb', line 23 def freeze @headers.freeze @body.freeze super end |