class GPhoto2::CameraList

Public Class Methods

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

Public Instance Methods

length()
Alias for: size
size() click to toggle source

@return [Integer]

# File lib/gphoto2/camera_list.rb, line 11
def size
  count
end
Also aliased as: length
to_a() click to toggle source

@return [Array<GPhoto2::Entry>]

# File lib/gphoto2/camera_list.rb, line 17
def to_a
  size.times.map { |i| Entry.new(self, i) }
end

Private Instance Methods

count() click to toggle source
# File lib/gphoto2/camera_list.rb, line 30
def count
  rc = gp_list_count(ptr)
  GPhoto2.check!(rc)
  rc
end
new() click to toggle source
# File lib/gphoto2/camera_list.rb, line 23
def new
  ptr = FFI::MemoryPointer.new(:pointer)
  rc = gp_list_new(ptr)
  GPhoto2.check!(rc)
  @ptr = FFI::GPhoto2::CameraList.new(ptr.read_pointer)
end