Module: Ronin::Exploits::Metadata::Shouts::ClassMethods

Defined in:
lib/ronin/exploits/metadata/shouts.rb

Overview

Class-methods.

Instance Method Summary collapse

Instance Method Details

#shouts(new_shouts = nil) ⇒ Array<String>

Gets or sets the exploit's shouts.

Examples:

Set the shouts:

shouts ['Ultra Laser', 'Dr.Doom']

Get the shout links:

MyExploit.shouts
# => ["Ultra Laser", "Dr.Doom"]

Parameters:

  • new_shouts (Array<String>, nil) (defaults to: nil)

    The optional new shout list to set.

Returns:

  • (Array<String>)

    The previously set shout list.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/ronin/exploits/metadata/shouts.rb', line 74

def shouts(new_shouts=nil)
  if new_shouts
    @shouts = if superclass.kind_of?(ClassMethods)
                superclass.shouts + new_shouts
              else
                new_shouts
              end
  else
    @shouts || if superclass.kind_of?(ClassMethods)
                 superclass.shouts
               else
                 []
               end
  end
end