class TurboRex::MSRPC::RPCBase::Structures_Klass

Attributes

xrefs[RW]

Public Class Methods

new(cstruct) click to toggle source
# File lib/turborex/msrpc/rpcbase.rb, line 389
def initialize(cstruct)
  @xrefs = []
  @value_table = {}          
  @cstruct = cstruct
  parse_struct(cstruct)
end

Public Instance Methods

[](key) click to toggle source
# File lib/turborex/msrpc/rpcbase.rb, line 400
def [](key)
  self.send key
end
method_missing(m, *args) click to toggle source
Calls superclass method
# File lib/turborex/msrpc/rpcbase.rb, line 404
def method_missing(m, *args)
  if m.to_s.end_with?('_Value')
    key = m.to_s.split('_Value')[0].to_sym
    @value_table[key]
  elsif @value_table.keys.map(&:downcase).include?(m.downcase)
    self.define_singleton_method(m) do
      @value_table[m]
    end
    @value_table[m]
  else
    super(m, *args)
  end
end
to_s() click to toggle source
# File lib/turborex/msrpc/rpcbase.rb, line 396
def to_s
  @cstruct.to_s
end
xref_from(cstruct) click to toggle source
# File lib/turborex/msrpc/rpcbase.rb, line 424
def xref_from(cstruct)
  cstruct.xrefs << self
end