mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-05 14:57:30 +01:00
cedab15c8f
- lots of improvements over Struct / Struct2-perl - lots of bug fixes, and much stronger functionality - added an example test - comments on this all is encouraged git-svn-id: file:///home/svn/incoming/trunk@2330 4d416f70-5f16-0410-b530-b9f4589650da
27 lines
486 B
Ruby
27 lines
486 B
Ruby
#!/usr/bin/ruby
|
|
|
|
# Rex::Struct2
|
|
module Rex
|
|
module Struct2
|
|
|
|
# this is a "constant" element. It's not actually constant, you can set it
|
|
# via the constructor and value. It doesn't do from_s/to_s, etc.
|
|
|
|
# what use is it? Well it's useful for doing constant restraints (like fix
|
|
# sized arrays), and probably not a ton more.
|
|
|
|
class Constant
|
|
|
|
require 'Rex/Struct2/Element'
|
|
include Rex::Struct2::Element
|
|
|
|
def initialize(value)
|
|
self.value = value
|
|
end
|
|
|
|
end
|
|
|
|
# end Rex::Struct2
|
|
end
|
|
end
|