Class: Rex::PeParsey::PeBase::GenericStruct
- Inherits:
-
Object
- Object
- Rex::PeParsey::PeBase::GenericStruct
- Defined in:
- lib/rex/peparsey/pebase.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#struct ⇒ Object
Returns the value of attribute struct.
Instance Method Summary collapse
-
#[](*args) ⇒ Object
Access a value by array.
-
#initialize(_struct) ⇒ GenericStruct
constructor
A new instance of GenericStruct.
-
#keys ⇒ Object
Obtain an array of all fields.
- #method_missing(meth, *args) ⇒ Object
-
#v ⇒ Object
Access a value.
Constructor Details
#initialize(_struct) ⇒ GenericStruct
Returns a new instance of GenericStruct.
84 85 86 |
# File 'lib/rex/peparsey/pebase.rb', line 84 def initialize(_struct) self.struct = _struct end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args) ⇒ Object
105 106 107 |
# File 'lib/rex/peparsey/pebase.rb', line 105 def method_missing(meth, *args) v[meth.to_s] || (raise NoMethodError.new, meth) end |
Instance Attribute Details
#struct ⇒ Object
Returns the value of attribute struct.
83 84 85 |
# File 'lib/rex/peparsey/pebase.rb', line 83 def struct @struct end |
Instance Method Details
#[](*args) ⇒ Object
Access a value by array
96 97 98 |
# File 'lib/rex/peparsey/pebase.rb', line 96 def [](*args) struct[*args] end |
#keys ⇒ Object
Obtain an array of all fields
101 102 103 |
# File 'lib/rex/peparsey/pebase.rb', line 101 def keys struct.keys end |
#v ⇒ Object
Access a value
91 92 93 |
# File 'lib/rex/peparsey/pebase.rb', line 91 def v struct.v end |