Class: Okei::Api::V1::UnitsController

Inherits:
ResponderController show all
Defined in:
app/controllers/okei/api/v1/units_controller.rb

Overview

Controller for getting units

Instance Method Summary collapse

Methods inherited from ResponderController

#on_found, #on_not_found, #on_success

Instance Method Details

#indexObject

Returns either all units of measure or units of given measure.



15
16
17
# File 'app/controllers/okei/api/v1/units_controller.rb', line 15

def index
  run_case GetUnits, with: :measure
end

#searchObject

Finds a unit of measure by text



25
26
27
# File 'app/controllers/okei/api/v1/units_controller.rb', line 25

def search
  run_case FindUnit, with: :text
end

#showObject

Finds a unit of measure by uuid.



20
21
22
# File 'app/controllers/okei/api/v1/units_controller.rb', line 20

def show
  run_case GetUnit, with: :uuid
end