Module: Ronin::Model::HasName::ClassMethods

Defined in:
lib/ronin/model/has_name.rb

Overview

Class methods that are added when Ronin::Model::HasName is included into a model.

Instance Method Summary collapse

Instance Method Details

#named(fragment) ⇒ Array<Model>

Finds models with names containing a given fragment of text.

Examples:

Exploit.named 'ProFTP'

Parameters:

  • fragment (String)

    The fragment of text to search for within the names of models.

Returns:

  • (Array<Model>)

    The found models.


65
66
67
# File 'lib/ronin/model/has_name.rb', line 65

def named(fragment)
  all(:name.like => "%#{fragment}%")
end