Sha256: 004e04087df941dadd745feb14c666635e772f0e49ea211168fbb149ba9e57cb

Contents?: true

Size: 523 Bytes

Versions: 7

Compression:

Stored size: 523 Bytes

Contents

module MetasploitDataModels::SerializedPrefs
  def serialized_prefs_attr_accessor(*args)
    args.each do |method_name|

      method_declarations = <<-RUBY
          def #{method_name}
            return if not self.prefs
            self.prefs[:#{method_name}]
          end

          def #{method_name}=(value)
            temp = self.prefs || {}
            temp[:#{method_name}] = value
            self.prefs = temp
          end
      RUBY

      class_eval method_declarations, __FILE__, __LINE__
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
metasploit_data_models-0.24.5 lib/metasploit_data_models/serialized_prefs.rb
metasploit_data_models-0.24.1.pre.rspec.pre.3.pre.1 lib/metasploit_data_models/serialized_prefs.rb
metasploit_data_models-0.24.1 lib/metasploit_data_models/serialized_prefs.rb
metasploit_data_models-1.0.0.pre.rails.pre.4.0b lib/metasploit_data_models/serialized_prefs.rb
metasploit_data_models-1.0.0.pre.rails.pre.4.0a lib/metasploit_data_models/serialized_prefs.rb
metasploit_data_models-0.24.0 lib/metasploit_data_models/serialized_prefs.rb
metasploit_data_models-0.23.3.pre.autoload lib/metasploit_data_models/serialized_prefs.rb