Class: GPhoto2::FileCameraFileInfo

Inherits:
CameraFileInfo show all
Defined in:
lib/gphoto2/camera_file_info/file_camera_file_info.rb

Constant Summary

Constants included from FFI::GPhoto2

FFI::GPhoto2::CameraCaptureType, FFI::GPhoto2::CameraDriverStatus, FFI::GPhoto2::CameraEventType, FFI::GPhoto2::CameraFileAccessType, FFI::GPhoto2::CameraFileInfoFields, FFI::GPhoto2::CameraFileOperation, FFI::GPhoto2::CameraFilePermissions, FFI::GPhoto2::CameraFileStatus, FFI::GPhoto2::CameraFileType, FFI::GPhoto2::CameraFolderOperation, FFI::GPhoto2::CameraOperation, FFI::GPhoto2::CameraWidgetType, FFI::GPhoto2::GphotoDeviceType

Instance Attribute Summary

Attributes included from Struct

#ptr

Instance Method Summary collapse

Methods inherited from CameraFileInfo

#fields, #has_field?, #initialize, #size, #status, #type

Methods included from Struct

#to_ptr

Constructor Details

This class inherits a constructor from GPhoto2::CameraFileInfo

Instance Method Details

#deletable?Boolean?

Returns:

  • (Boolean, nil)


20
21
22
23
# File 'lib/gphoto2/camera_file_info/file_camera_file_info.rb', line 20

def deletable?
  permissions = fetch(:permissions)
  (permissions & CameraFilePermissions[:delete]) != 0 if permissions
end

#heightInteger?

Returns:

  • (Integer, nil)


9
10
11
# File 'lib/gphoto2/camera_file_info/file_camera_file_info.rb', line 9

def height
  fetch(:height)
end

#mtimeTime?

Returns the last modification time.

Returns:

  • (Time, nil)

    the last modification time



26
27
28
# File 'lib/gphoto2/camera_file_info/file_camera_file_info.rb', line 26

def mtime
  Time.at(ptr[:mtime]) if has_field?(:mtime)
end

#readable?Boolean?

Returns:

  • (Boolean, nil)


14
15
16
17
# File 'lib/gphoto2/camera_file_info/file_camera_file_info.rb', line 14

def readable?
  permissions = fetch(:permissions)
  (permissions & CameraFilePermissions[:read]) != 0 if permissions
end

#widthInteger?

Returns:

  • (Integer, nil)


4
5
6
# File 'lib/gphoto2/camera_file_info/file_camera_file_info.rb', line 4

def width
  fetch(:width)
end