Class: Chute::Response
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- Chute::Response
- Defined in:
- lib/chute/response.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.with_code_and_error(code, error) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/chute/response.rb', line 6 def self.with_code_and_error(code, error) object = Chute::Response.new object.code = code object.errors = [error] object end |
Instance Method Details
#pretty_print ⇒ Object
17 18 19 |
# File 'lib/chute/response.rb', line 17 def pretty_print puts JSON.pretty_generate self end |
#success? ⇒ Boolean
13 14 15 |
# File 'lib/chute/response.rb', line 13 def success? [200, 201].include?(response.code) end |