Class: Emojidex::Service
- Inherits:
-
Collection
- Object
- Collection
- Emojidex::Service
- Defined in:
- lib/emojidex/service.rb
Overview
listing and search of emoji from the online service/emojidex.com
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Attributes inherited from Collection
#categories, #emoji, #raster_source_path, #source_path, #vector_source_path
Attributes included from CollectionCache
Instance Method Summary collapse
-
#find_by_code(code) ⇒ Object
directly retrieves the emoji with the given code.
-
#find_by_code_ja(code) ⇒ Object
emoji on the emojidex service make no language distinctions find_by_code_ja is simply remapped to find_by_code.
-
#initialize(emoji_list = nil, client_opts = {}) ⇒ Service
constructor
A new instance of Service.
-
#search(criteria = {}) ⇒ Object
sends an API search, adding results with add_emoji returns a collection, and adds results to the @emoji array.
Methods inherited from Collection
#add_emoji, #category, #category?, #collect, #each, #find_by_moji, #load_local_collection, #map, #select
Methods included from CollectionAssetInformation
#generate_checksums, #generate_paths, #get_checksums, #get_paths
Methods included from CollectionCache
#cache!, #cache_index, #setup_cache, #write_index
Constructor Details
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
7 8 9 |
# File 'lib/emojidex/service.rb', line 7 def client @client end |
Instance Method Details
#find_by_code(code) ⇒ Object
directly retrieves the emoji with the given code
20 21 22 |
# File 'lib/emojidex/service.rb', line 20 def find_by_code(code) # TODO: perform a query on emojidex API end |
#find_by_code_ja(code) ⇒ Object
emoji on the emojidex service make no language distinctions find_by_code_ja is simply remapped to find_by_code
26 27 28 |
# File 'lib/emojidex/service.rb', line 26 def find_by_code_ja(code) find_by_code(code) end |
#search(criteria = {}) ⇒ Object
sends an API search, adding results with add_emoji returns a collection, and adds results to the @emoji array
15 16 17 |
# File 'lib/emojidex/service.rb', line 15 def search(criteria = {}) # TODO: *NOTE try and replicate regex search functionality by passing regex to server end |