Class: Rex::PeParsey::PeBase::GenericStruct

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/peparsey/pebase.rb

Direct Known Subclasses

GenericHeader

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_struct) ⇒ GenericStruct

Returns a new instance of GenericStruct.



90
91
92
# File 'lib/rex/peparsey/pebase.rb', line 90

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



111
112
113
# File 'lib/rex/peparsey/pebase.rb', line 111

def method_missing(meth, *args)
	v[meth.to_s] || (raise NoMethodError.new, meth)
end

Instance Attribute Details

#structObject

Returns the value of attribute struct.



89
90
91
# File 'lib/rex/peparsey/pebase.rb', line 89

def struct
  @struct
end

Instance Method Details

#[](*args) ⇒ Object

Access a value by array



102
103
104
# File 'lib/rex/peparsey/pebase.rb', line 102

def [](*args)
	struct[*args]
end

#keysObject

Obtain an array of all fields



107
108
109
# File 'lib/rex/peparsey/pebase.rb', line 107

def keys
	struct.keys
end

#vObject

Access a value



97
98
99
# File 'lib/rex/peparsey/pebase.rb', line 97

def v
	struct.v
end