Class: Emojidex::Client
- Inherits:
-
Object
- Object
- Emojidex::Client
- Defined in:
- lib/emojidex/client.rb
Overview
A consolidated client which handles a user and their collection
Constant Summary collapse
- @@client_cache_path =
nil
- @@user_instance =
nil
- @@collection_instance =
nil
Class Method Summary collapse
Instance Method Summary collapse
- #cache_path ⇒ Object
- #collection ⇒ Object
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
- #user ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Client
Returns a new instance of Client.
44 45 46 47 48 49 50 51 |
# 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 |
Class Method Details
.CACHE_PATH ⇒ Object
34 35 36 37 38 |
# 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 ⇒ Object
23 24 25 26 27 28 |
# 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 |