class Emojidex::Client

A consolidated client which handles a user and their collection

Public Class Methods

CACHE_PATH() click to toggle source
# File lib/emojidex/client.rb, line 34
def self.CACHE_PATH
  return @@client_cache_path unless @@client_cache_path.nil?
  @@client_cache_path = Emojidex::Defaults.system_cache_path
  @@client_cache_path
end
COLLECTION() click to toggle source
# File lib/emojidex/client.rb, line 23
def self.COLLECTION
  return @@collection_instance unless @@collection_instance.nil?
  @@collection_instance = Emojidex::Data::Collection.new
  @@collection_instance.load_cache
  @@collection_instance
end
USER() click to toggle source
# File lib/emojidex/client.rb, line 12
def self.USER
  return @@user_instance unless @@user_instance.nil?
  @@user_instance = Emojidex::Service::User.new
  @@user_instance.load(@cache_path)
  @@user_instance
end
new(opts = {}) click to toggle source
# File lib/emojidex/client.rb, line 44
def initialize(opts = {})
  if (opts.include? :cache_path)
    @@client_cache_path = opts[:cache_path]
    user = collection = nil
  end
  user
  collection
end

Public Instance Methods

cache_path() click to toggle source
# File lib/emojidex/client.rb, line 40
def cache_path
  Emojidex::Client.CACHE_PATH
end
collection() click to toggle source
# File lib/emojidex/client.rb, line 30
def collection
  Emojidex::Client.COLLECTION
end
user() click to toggle source
# File lib/emojidex/client.rb, line 19
def user
  Emojidex::Client.USER
end