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
-
#nilify_blank(*attributes) ⇒ void
Declares that
attributes
should be changed tonil
before validation if they are blank. -
#nilify_blank_attribute_set ⇒ Set<Symbol>
Set of all attributes registered with #nilify_blank.
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.
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_set ⇒ Set<Symbol>
Set of all attributes registered with #nilify_blank.
27 28 29 |
# File 'lib/metasploit/model/nilify_blanks.rb', line 27 def nilify_blank_attribute_set @nilify_blank_attribute_set ||= Set.new end |