Module: DDC::ResponseBuilder
- Defined in:
- lib/ddc/response_builder.rb
Instance Method Summary collapse
- #created(obj) ⇒ Object
- #deleted ⇒ Object
- #not_found ⇒ Object
- #not_valid(obj) ⇒ Object
- #ok(obj) ⇒ Object
Instance Method Details
#created(obj) ⇒ Object
11 12 13 |
# File 'lib/ddc/response_builder.rb', line 11 def created(obj) {status: :created, object: obj} end |
#deleted ⇒ Object
19 20 21 |
# File 'lib/ddc/response_builder.rb', line 19 def deleted {status: :deleted} end |
#not_found ⇒ Object
3 4 5 |
# File 'lib/ddc/response_builder.rb', line 3 def not_found {status: :not_found} end |
#not_valid(obj) ⇒ Object
15 16 17 |
# File 'lib/ddc/response_builder.rb', line 15 def not_valid(obj) {status: :not_valid, errors: obj.errors.to_hash} end |
#ok(obj) ⇒ Object
7 8 9 |
# File 'lib/ddc/response_builder.rb', line 7 def ok(obj) {status: :ok, object: obj} end |