Method: Exec::CheckParameter#check_vlan_id

Defined in:
lib/exec/check_parameter.rb

#check_vlan_id(str) ⇒ Object

Check vlan id format. It has to be a positive integer.



65
66
67
68
69
70
71
# File 'lib/exec/check_parameter.rb', line 65

def check_vlan_id(str)
  if str.to_i >= 10 && str.to_i <= 4096
    return match_regex(str.to_s, /^[1-9][0-9]+$/, "ID Vlan '#{str}' is not a correct number.")
  else
    return false, "ID Vlan '#{str}' is not a correct number."
  end
end