class MotionAL::AssetsFilter
For filtering assets in the group by asset type.
Constants
- DEFAULT_FILTER
:all means no filter.
Public Class Methods
asset_filters()
click to toggle source
@return [Hash] Human readable keys and AssetLibrary Framework constant value.
# File lib/motional/assets_filter.rb, line 24 def self.asset_filters { all: ALAssetsFilter.allAssets, photo: ALAssetsFilter.allPhotos, video: ALAssetsFilter.allVideos, } end
reset(group)
click to toggle source
Reset filter. In other words set default filter. @param group [MotionAL::Group]
# File lib/motional/assets_filter.rb, line 19 def self.reset(group) group.al_asset_group.setAssetsFilter(asset_filters[DEFAULT_FILTER]) end
set(group, filter)
click to toggle source
Set filter. @param group [MotionAL::Group] @param filter [Symbol] :all, :photo or :video @note Set filter once, it is available permanently until calling ‘reset`.
# File lib/motional/assets_filter.rb, line 12 def self.set(group, filter) group.al_asset_group.setAssetsFilter(asset_filters[filter.to_sym]) end