Class: Fiddle::Pointer
- Inherits:
-
Object
- Object
- Fiddle::Pointer
- Defined in:
- lib/fiddle_ext.rb
Instance Method Summary collapse
-
#copy_from(other) ⇒ Object
Copies data from the specified pointer into this one, starting at offset 0 and ending at either this pointer’s size or the size of ‘other`, whichever is smaller.
Instance Method Details
#copy_from(other) ⇒ Object
Copies data from the specified pointer into this one, starting at offset 0 and ending at either this pointer’s size or the size of ‘other`, whichever is smaller.
9 10 11 12 13 |
# File 'lib/fiddle_ext.rb', line 9 def copy_from(other) size = self.size > other.size ? other.size : self.size self[0, size] = other self end |