Class: FFI::Struct

Inherits:
Object
  • Object
show all
Defined in:
lib/ffi-libav.rb

Instance Method Summary collapse

Instance Method Details

#to_hashObject



37
38
39
40
41
# File 'lib/ffi-libav.rb', line 37

def to_hash
  return {} if pointer.null?

  members.inject({}) { |h,k| h[k] = send(:[], k); h }
end

#to_hexdumpObject



43
44
45
# File 'lib/ffi-libav.rb', line 43

def to_hexdump
  self.pointer.read_bytes(self.size).hexdump
end