class TonSdk::Interop::TcStringData

Public Class Methods

from_string(s) click to toggle source
# File lib/ton_sdk_client/interop.rb, line 20
def self.from_string(s)
  tcs = TcStringData.new
  bytes_count = s.unpack("C*").size
  ptr1 = FFI::MemoryPointer.new(:char, bytes_count)
  ptr1.put_bytes(0, s, 0, bytes_count)
  tcs[:content] = ptr1
  tcs[:len] = ptr1.size
  tcs
end