Module: Metasploit::Model::Architecture::ClassMethods
- Defined in:
- lib/metasploit/model/architecture.rb
Overview
Adds
Class Method Summary collapse
-
.set(attribute) ⇒ Set
Set of valid values to search for
attribute.
Instance Method Summary collapse
-
#abbreviation_set ⇒ Set<String>
Set of valid #abbreviation for search.
-
#bits_set ⇒ Set<Integer>
Set of valid #bits for search.
-
#endianness_set ⇒ Set<String>
Set of valid #endianness for search.
-
#family_set ⇒ Set<String>
Set of valid #family for search.
Class Method Details
.set(attribute) ⇒ Set
Set of valid values to search for attribute. Does not include nil as search syntax cannot differentiate
'' and nil when parsing.
263 264 265 266 267 268 269 270 271 |
# File 'lib/metasploit/model/architecture.rb', line 263 def self.set(attribute) SEED_ATTRIBUTES.each_with_object(Set.new) { |attributes, set| value = attributes.fetch(attribute) unless value.nil? set.add value end } end |
Instance Method Details
#abbreviation_set ⇒ Set<String>
Set of valid Metasploit::Model::Architecture#abbreviation for search.
292 293 294 295 296 297 298 299 |
# File 'lib/metasploit/model/architecture.rb', line 292 [:abbreviation, :bits, :endianness, :family].each do |attribute| # calculate external to method so it is only calculated once set = self.set(attribute) define_method("#{attribute}_set") do set end end |
#bits_set ⇒ Set<Integer>
Set of valid Metasploit::Model::Architecture#bits for search.
292 293 294 295 296 297 298 299 |
# File 'lib/metasploit/model/architecture.rb', line 292 [:abbreviation, :bits, :endianness, :family].each do |attribute| # calculate external to method so it is only calculated once set = self.set(attribute) define_method("#{attribute}_set") do set end end |
#endianness_set ⇒ Set<String>
Set of valid Metasploit::Model::Architecture#endianness for search.
292 293 294 295 296 297 298 299 |
# File 'lib/metasploit/model/architecture.rb', line 292 [:abbreviation, :bits, :endianness, :family].each do |attribute| # calculate external to method so it is only calculated once set = self.set(attribute) define_method("#{attribute}_set") do set end end |
#family_set ⇒ Set<String>
Set of valid Metasploit::Model::Architecture#family for search.
292 293 294 295 296 297 298 299 |
# File 'lib/metasploit/model/architecture.rb', line 292 [:abbreviation, :bits, :endianness, :family].each do |attribute| # calculate external to method so it is only calculated once set = self.set(attribute) define_method("#{attribute}_set") do set end end |