Class: Nextcloud::Ruby::Response
- Inherits:
-
Object
- Object
- Nextcloud::Ruby::Response
- Defined in:
- lib/nextcloud/ruby/response.rb
Constant Summary collapse
- SUCCESS_CODES =
[201, 204, 207].freeze
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#status_code ⇒ Object
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(body, status_code) ⇒ Response
constructor
A new instance of Response.
- #ok? ⇒ Boolean
Constructor Details
#initialize(body, status_code) ⇒ Response
Returns a new instance of Response.
7 8 9 10 |
# File 'lib/nextcloud/ruby/response.rb', line 7 def initialize(body, status_code) @body = to_xml(body) @status_code = status_code end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
5 6 7 |
# File 'lib/nextcloud/ruby/response.rb', line 5 def body @body end |
#status_code ⇒ Object
Returns the value of attribute status_code.
5 6 7 |
# File 'lib/nextcloud/ruby/response.rb', line 5 def status_code @status_code end |
Instance Method Details
#ok? ⇒ Boolean
12 13 14 |
# File 'lib/nextcloud/ruby/response.rb', line 12 def ok? SUCCESS_CODES.include?(@status_code) end |