class Hakuban::FFI::FFIObjectDescriptor
Attributes
Public Class Methods
construct(tags,json)
click to toggle source
# File lib/hakuban/ffi.rb, line 76 def self.construct(tags,json) descriptor = FFIObjectDescriptor.new descriptor[:tags_count] = tags.size descriptor.tags_strings = tags.map { |tag| FFI::MemoryPointer.from_string(JSON.dump(tag)) } descriptor[:tags] = FFI::MemoryPointer.new(:pointer, descriptor.tags_strings.size) descriptor[:tags].write_array_of_pointer(descriptor.tags_strings) descriptor[:json] = FFI::MemoryPointer.from_string(JSON.dump(json)) descriptor end
Public Instance Methods
json()
click to toggle source
# File lib/hakuban/ffi.rb, line 72 def json JSON.parse(self[:json].read_string()) end