Class: UdooNeoRest::ValidateGpio
- Defined in:
- lib/udooneorest/validators.rb
Overview
Validate the GPIO parameter
value : the gpio value to be validated
Instance Attribute Summary
Attributes inherited from Validate
Instance Method Summary collapse
Methods inherited from Validate
Constructor Details
This class inherits a constructor from UdooNeoRest::Validate
Instance Method Details
#valid? ⇒ Boolean
51 52 53 54 55 56 57 58 59 |
# File 'lib/udooneorest/validators.rb', line 51 def valid? unless GPIOS.include?(@value) && (@value != 'NA') = UdooNeoRest::Base.status_error("GPIO value of '#{@value}' is invalid. Should be one of #{(GPIOS - ['NA']).sort.join(',')}.") return false end = nil true end |