Class: MotionAL::Library

Inherits:
Object
  • Object
show all
Defined in:
lib/motional/library.rb

Overview

A wrapper of ALAssetLibrary class.

An instance of ALAssetsLibrary provides access to the videos and photos that are under the control of the Photos application.
The library includes those that are in the Saved Photos album, those coming from iTunes, and those that were directly imported into the device. You use it to retrieve the list of all asset groups and to save images and videos into the Saved Photos album.

And added some convinience methods.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLibrary

Returns a new instance of Library.



22
23
24
# File 'lib/motional/library.rb', line 22

def initialize 
  @groups = MotionAL::Group
end

Instance Attribute Details

#groupsClass (readonly)

Returns An alias of MotionAL::Group class.

Returns:

  • (Class)

    An alias of MotionAL::Group class



14
15
16
# File 'lib/motional/library.rb', line 14

def groups
  @groups
end

Class Method Details

.instanceMotionAL::Library

Returns Singleton instance.

Returns:



17
18
19
20
# File 'lib/motional/library.rb', line 17

def self.instance
  Dispatch.once { @@instance ||= new }
  @@instance
end

Instance Method Details

#al_asset_libraryALAssetsLibrary

An instance of ALAssetLibrary.

Returns:

  • (ALAssetsLibrary)


28
29
30
# File 'lib/motional/library.rb', line 28

def al_asset_library
  @al_asset_library ||= ALAssetsLibrary.new
end