Module: Metasploit::Model::NilifyBlanks::ClassMethods

Defined in:
lib/metasploit/model/nilify_blanks.rb

Overview

Adds DSL methods once NilifyBlanks is included so that attributes where blanks should be changed to nil can be declared.

Instance Method Summary collapse

Instance Method Details

#nilify_blank(*attributes) ⇒ void

This method returns an undefined value.

Declares that attributes should be changed to nil before validation if they are blank.

Parameters:

  • attributes (Enumerable<Symbol>)

    one or more attribute names



20
21
22
# File 'lib/metasploit/model/nilify_blanks.rb', line 20

def nilify_blank(*attributes)
  nilify_blank_attribute_set.merge(attributes)
end

#nilify_blank_attribute_setSet<Symbol>

Set of all attributes registered with #nilify_blank.

Returns:

  • (Set<Symbol>)


27
28
29
# File 'lib/metasploit/model/nilify_blanks.rb', line 27

def nilify_blank_attribute_set
  @nilify_blank_attribute_set ||= Set.new
end