Module: Virtuatable::Helpers::Gateways
- Included in:
- Controllers::Base
- Defined in:
- lib/virtuatable/helpers/gateways.rb
Overview
These helpers holds getters and checkers about API gateways.
Instance Method Summary collapse
-
#gateway ⇒ Arkaan::Monitoring::Gateway
Gets the gateway associated to the gatexway token in parameters.
-
#gateway! ⇒ Object
Checks the gateway requesting the service and raises an error if necessary.
Instance Method Details
#gateway ⇒ Arkaan::Monitoring::Gateway
Gets the gateway associated to the gatexway token in parameters.
10 11 12 |
# File 'lib/virtuatable/helpers/gateways.rb', line 10 def gateway Arkaan::Monitoring::Gateway.where(token: params['token']).first end |
#gateway! ⇒ Object
Checks the gateway requesting the service and raises an error if necessary.
15 16 17 18 19 20 |
# File 'lib/virtuatable/helpers/gateways.rb', line 15 def gateway! check_presence 'token' api_not_found 'token.unknown' if gateway.nil? gateway end |