Class: Wpxf::EnumOption
- 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
-
#valid?(value) ⇒ Boolean
Check if the specified value is valid in the context of this option.
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.
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 |