Class: Emojidex::Util::CollectionChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/emojidex/util/collection_checker.rb

Overview

Check collections for presence of image assets and discrepencies in emoji indexes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collections, options = {}) ⇒ CollectionChecker

Returns a new instance of CollectionChecker.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/emojidex/util/collection_checker.rb', line 10

def initialize(collections, options = {})
  collections = *collections
  @index_only = {}
  @asset_only = {}
  asset_path = options[:asset_path] || collections.first.source_path
  sizes = options[:sizes] || Emojidex::Defaults.sizes.keys
  formats = options[:formats] || Emojidex::Defaults.formats

  asset_files = create_asset_file_list(asset_path, sizes, formats)
  check_for_index_only(collections, asset_files, sizes, formats)
  check_for_asset_only(collections, asset_files)
end

Instance Attribute Details

#asset_onlyObject (readonly)

Returns the value of attribute asset_only.



8
9
10
# File 'lib/emojidex/util/collection_checker.rb', line 8

def asset_only
  @asset_only
end

#index_onlyObject (readonly)

Returns the value of attribute index_only.



8
9
10
# File 'lib/emojidex/util/collection_checker.rb', line 8

def index_only
  @index_only
end