class UdooNeoRest::ValidateGpio

Validate the GPIO parameter

value : the gpio value to be validated

Public Instance Methods

valid?() click to toggle source
# File lib/udooneorest/validators.rb, line 51
def valid?
  unless GPIOS.include?(@value) && (@value != 'NA')
    @error_message = UdooNeoRest::Base.status_error("GPIO value of '#{@value}' is invalid. Should be one of #{(GPIOS - ['NA']).sort.join(',')}.")
    return false
  end

  @error_message  = nil
  true
end