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.



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

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



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

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

Instance Attribute Details

#structObject

Returns the value of attribute struct.



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

def struct
  @struct
end

Instance Method Details

#[](*args) ⇒ Object

Access a value by array



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

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

#keysObject

Obtain an array of all fields



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

def keys
	struct.keys
end

#vObject

Access a value



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

def v
	struct.v
end