class GPhoto2::PortInfoList

Public Class Methods

new() click to toggle source
# File lib/gphoto2/port_info_list.rb, line 6
def initialize
  new
  load
end

Public Instance Methods

[](index)
Alias for: at
at(index) click to toggle source

@param [Integer] index @return [GPhoto2::PortInfo]

# File lib/gphoto2/port_info_list.rb, line 20
def at(index)
  PortInfo.new(self, index)
end
Also aliased as: []
index(port)
Alias for: lookup_path
lookup_path(port) click to toggle source

@param [String] port @return [Integer]

# File lib/gphoto2/port_info_list.rb, line 13
def lookup_path(port)
  _lookup_path(port)
end
Also aliased as: index

Private Instance Methods

_lookup_path(port) click to toggle source
# File lib/gphoto2/port_info_list.rb, line 39
def _lookup_path(port)
  index = rc = gp_port_info_list_lookup_path(ptr, port)
  GPhoto2.check!(rc)
  index
end
load() click to toggle source
# File lib/gphoto2/port_info_list.rb, line 34
def load
  rc = gp_port_info_list_load(ptr)
  GPhoto2.check!(rc)
end
new() click to toggle source
# File lib/gphoto2/port_info_list.rb, line 27
def new
  ptr = FFI::MemoryPointer.new(:pointer)
  rc = gp_port_info_list_new(ptr)
  GPhoto2.check!(rc)
  @ptr = GPPortInfoList.new(ptr.read_pointer)
end