summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStormwind <stormwind@stormwinds-page.de>2012-11-17 14:35:15 +0100
committerStormwind <stormwind@stormwinds-page.de>2012-11-17 14:35:15 +0100
commit633d5fb7c808cf6672cc5ab355edff5cb5e95acc (patch)
tree762cc02980eff2b961cebcb029c4f446a1918830 /lib
parent41cf83c525053a7e6d2124e173b8a4e14295781b (diff)
Converts any input in status to an integer
Diffstat (limited to 'lib')
-rw-r--r--lib/zero/response.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/zero/response.rb b/lib/zero/response.rb
index 418c8a7..3c54c54 100644
--- a/lib/zero/response.rb
+++ b/lib/zero/response.rb
@@ -3,7 +3,17 @@ module Zero
# This is the representation of a response
#
class Response
- attr_accessor :status, :header, :body
+ attr_reader :status
+ attr_accessor :header, :body
+
+ # Sets the status.
+ # Also converts every input directly to an integer
+ #
+ # @param [Integer] status
+ #
+ def status=(status)
+ @status = status.to_i
+ end
# Returns the data of the response as an array:
# [status, header, body]