Module: HardwaresHelper

Defined in:
app/helpers/hardwares_helper.rb

Overview

The HardwaresHelper module.

Constant Summary

TYPE_QR =

QR Code

'qr'
TYPE_NFC =

NFC tag

'nfc'
TYPE_BLE =

Bluetooth LE beacon

'ble-beacon'

Class Method Summary (collapse)

Class Method Details

+ (Object) supported_hardware_types

Get all valid and currently supported hardware types.



26
27
28
# File 'app/helpers/hardwares_helper.rb', line 26

def self.supported_hardware_types
  [TYPE_QR, TYPE_NFC, TYPE_BLE]
end

+ (Object) supported_hardware_types_with_names

Get all valid and currently supported hardware types including their names.



32
33
34
# File 'app/helpers/hardwares_helper.rb', line 32

def self.supported_hardware_types_with_names
  [['QR-Code', TYPE_QR], ['NFC', TYPE_NFC], ['iBeacon', TYPE_BLE]]
end

+ (Object) validate_hardware_type(hardware_type)

Check if the given hardware type is valid.

Parameters:

  • hardware_type (String)

    The hardware type which should be validated.



17
18
19
20
21
22
# File 'app/helpers/hardwares_helper.rb', line 17

def self.validate_hardware_type(hardware_type)
  if hardware_type == TYPE_NFC or hardware_type == TYPE_BLE or hardware_type == TYPE_QR
    return true
  end
  return false
end