Class: Harfbuzz::Blob
Instance Attribute Summary collapse
-
#hb_blob ⇒ Object
readonly
Returns the value of attribute hb_blob.
Instance Method Summary collapse
-
#initialize(data, mode = 0, user_data = nil) ⇒ Blob
constructor
A new instance of Blob.
- #length ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(data, mode = 0, user_data = nil) ⇒ Blob
Returns a new instance of Blob.
28 29 30 31 32 33 34 |
# File 'lib/harfbuzz/blob.rb', line 28 def initialize(data, mode=0, user_data=nil) data = data.read if data.kind_of?(IO) data_ptr = FFI::MemoryPointer.new(:char, data.size) data_ptr.put_bytes(0, data) @hb_blob = Harfbuzz.hb_blob_create(data_ptr, data.size, mode, user_data, nil) define_finalizer(:hb_blob_destroy, @hb_blob) end |
Instance Attribute Details
#hb_blob ⇒ Object (readonly)
Returns the value of attribute hb_blob.
26 27 28 |
# File 'lib/harfbuzz/blob.rb', line 26 def hb_blob @hb_blob end |
Instance Method Details
#length ⇒ Object
36 37 38 |
# File 'lib/harfbuzz/blob.rb', line 36 def length Harfbuzz.hb_blob_get_length(@hb_blob) end |