Method: Wpxf::IntegerOption#initialize

Defined in:
lib/wpxf/core/opts/integer_option.rb

#initialize(attrs) ⇒ IntegerOption

Initializes a named option.

Parameters:

  • attrs

    an object containing the following values

    • name: the name of the option (required)

    • desc: the description of the option (required)

    • required: whether or not the option is required

    • default: the default value of the option

    • advanced: whether or not this is an advanced option

    • evasion: whether or not this is an evasion option

    • enums: the list of potential valid values

    • regex: regex to validate the option value

    • min: the lowest valid value

    • max: the highest valid value



19
20
21
22
23
24
# File 'lib/wpxf/core/opts/integer_option.rb', line 19

def initialize(attrs)
  super

  self.min = attrs[:min].to_i unless attrs[:min].nil?
  self.max = attrs[:max].to_i unless attrs[:max].nil?
end