Class: YmlErrorResponder::ErrorsExampleController

Inherits:
Api::V1::BaseController
  • Object
show all
Defined in:
app/controllers/yml_error_responder/errors_example_controller.rb

Defined Under Namespace

Classes: Appointment, CvvInvalid

Instance Method Summary collapse

Instance Method Details

#appointmentObject

Raises:



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/yml_error_responder/errors_example_controller.rb', line 11

def appointment
  raise Appointment.new(meta: {
    "available_slots": [
      {
        "id": 4,
        "name": "Slot1"
      },
      {
        "id": 5,
        "name": "Slot2"
      }
    ]
  })
end

#cvvObject

Raises:



7
8
9
# File 'app/controllers/yml_error_responder/errors_example_controller.rb', line 7

def cvv
  raise CvvInvalid
end

#uncoveredObject



26
27
28
# File 'app/controllers/yml_error_responder/errors_example_controller.rb', line 26

def uncovered
  raise 'UncoveredExeption'
end