Sha256: 87bfad4afdcc2c03c5682b0c6de21cc23e196bbe31dbfed27e1933deb0c63ea2

Contents?: true

Size: 556 Bytes

Versions: 2

Compression:

Stored size: 556 Bytes

Contents

# frozen_string_literal: true

require 'ffi'

module Librollenspielsache
  module Dice
    # The Result from a roll
    class RollResult < FFI::AutoPointer
      def self.release(ptr)
        Binding.free ptr
      end

      def to_s(ptr)
        Binding.to_s ptr
      end

      # Rust externs
      module Binding
        extend FFI::Library
        ffi_lib 'librollenspielsache'

        attach_function :to_s, :roll_result_to_string, [:pointer], :string
        attach_function :free, :roll_result_free, [:pointer], :void
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
librollenspielsache-rb-0.1.0 lib/librollenspielsache/dice/roll_result.rb
librollenspielsache-rb-0.0.1 lib/librollenspielsache/dice/roll_result.rb