Class: MotionAL::AssetsFilter
- Inherits:
-
Object
- Object
- MotionAL::AssetsFilter
- Defined in:
- lib/motional/assets_filter.rb
Overview
For filtering assets in the group by asset type.
Constant Summary collapse
- DEFAULT_FILTER =
:all means no filter.
:all
Class Method Summary collapse
-
.asset_filters ⇒ Hash
Human readable keys and AssetLibrary Framework constant value.
-
.reset(group) ⇒ Object
Reset filter.
-
.set(group, filter) ⇒ Object
Set filter.
Class Method Details
.asset_filters ⇒ Hash
Returns Human readable keys and AssetLibrary Framework constant value.
25 26 27 28 29 30 31 |
# File 'lib/motional/assets_filter.rb', line 25 def self.asset_filters { all: ALAssetsFilter.allAssets, photo: ALAssetsFilter.allPhotos, video: ALAssetsFilter.allVideos, } end |
.reset(group) ⇒ Object
Reset filter. In other words set default filter.
20 21 22 |
# File 'lib/motional/assets_filter.rb', line 20 def self.reset(group) group.al_asset_group.setAssetsFilter(asset_filters[DEFAULT_FILTER]) end |
.set(group, filter) ⇒ Object
Note:
Set filter once, it is available permanently until calling ‘reset`.
Set filter.
13 14 15 |
# File 'lib/motional/assets_filter.rb', line 13 def self.set(group, filter) group.al_asset_group.setAssetsFilter(asset_filters[filter.to_sym]) end |