This adds the ability to use the module as a hash
git-svn-id: file:///home/svn/framework3/trunk@8117 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
54095a585e
commit
3823512ae9
|
@ -506,6 +506,20 @@ class Module
|
|||
false
|
||||
end
|
||||
|
||||
#
|
||||
# Read a value from the module store
|
||||
#
|
||||
def [](k)
|
||||
self.module_store[k]
|
||||
end
|
||||
|
||||
#
|
||||
# Store a value into the module
|
||||
#
|
||||
def []=(k,v)
|
||||
self.module_store[k] = v
|
||||
end
|
||||
|
||||
#
|
||||
# The array of zero or more authors.
|
||||
#
|
||||
|
@ -544,6 +558,11 @@ class Module
|
|||
#
|
||||
attr_accessor :job_id
|
||||
|
||||
#
|
||||
# A generic hash used for passing additional information to modules
|
||||
#
|
||||
attr_accessor :module_store
|
||||
|
||||
protected
|
||||
|
||||
#
|
||||
|
@ -566,6 +585,7 @@ protected
|
|||
'Privileged' => false,
|
||||
'License' => MSF_LICENSE,
|
||||
}.update(self.module_info)
|
||||
self.module_store = {}
|
||||
end
|
||||
|
||||
#
|
||||
|
@ -813,7 +833,6 @@ protected
|
|||
merge_info_options(info, val, false, true)
|
||||
end
|
||||
|
||||
|
||||
attr_accessor :module_info # :nodoc:
|
||||
attr_writer :author, :arch, :platform, :references, :datastore, :options # :nodoc:
|
||||
attr_writer :privileged # :nodoc:
|
||||
|
|
Loading…
Reference in New Issue