Class: Wpxf::EnumOption

Inherits:
Option
  • Object
show all
Defined in:
lib/wpxf/core/opts/enum_option.rb

Overview

An enum option.

Instance Attribute Summary

Attributes inherited from Option

#advanced, #default, #desc, #enums, #evasion, #name, #regex, #required

Instance Method Summary collapse

Methods inherited from Option

#advanced?, #display_value, #empty?, #empty_required_value?, #evasion?, #initialize, #normalize, #required?, #update_optional_attributes, #value?

Constructor Details

This class inherits a constructor from Wpxf::Option

Instance Method Details

#valid?(value) ⇒ Boolean

Check if the specified value is valid in the context of this option.

Parameters:

  • value

    the value to validate.

Returns:

  • (Boolean)

    true if valid.



10
11
12
13
# File 'lib/wpxf/core/opts/enum_option.rb', line 10

def valid?(value)
  return false if value && !enums.include?(value)
  super
end