Class: UnarmBind::Arguments

Inherits:
FFI::AutoPointer
  • Object
show all
Includes:
Enumerable
Defined in:
lib/unarm/unarm.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.release(ptr) ⇒ Object



357
358
359
# File 'lib/unarm/unarm.rb', line 357

def self.release(ptr)
  UnarmBind.free_ins_args(ptr, 6)
end

Instance Method Details

#[](index) ⇒ Object

Raises:

  • (IndexError)


361
362
363
364
# File 'lib/unarm/unarm.rb', line 361

def [](index)
  raise IndexError, 'there are 6 args' if index < 0 || index >= 6
  Argument.new(self + index * Argument.size)
end

#eachObject



366
367
368
369
# File 'lib/unarm/unarm.rb', line 366

def each
  return enum_for(:each) unless block_given?
  6.times { |i| yield self[i] }
end