Module: EOAT
- Defined in:
- lib/eoat.rb,
lib/eoat/zk_api.rb,
lib/eoat/eve_api.rb,
lib/eoat/request.rb,
lib/eoat/version.rb,
lib/eoat/exception.rb,
lib/eoat/result/eve_type.rb,
lib/eoat/cache/file_cache.rb,
lib/eoat/cache/none_cache.rb,
lib/eoat/cache/redis_cache.rb,
lib/eoat/cache/memcached_cache.rb
Overview
Eve Online API Toolbox (EOAT) module
Defined Under Namespace
Modules: Cache, Exception, Result Classes: EveApi, Request, ZKApi
Constant Summary collapse
- VERSION =
Current gem version
'0.1.2'
Class Method Summary collapse
-
.cache ⇒ EOAT::Cache #read
Return current cache storage class instance.
-
.cache=(val) ⇒ Object
Define new cache store class.
-
.headers ⇒ Hash #read
This method allows to control the request headers.
-
.max_ttl ⇒ Fixnum, #read
Return a current maximum TTL of cache in seconds By default: 30 days.
-
.max_ttl=(val) ⇒ Object
Allow set maximum TTL of cache.
Class Method Details
.cache ⇒ EOAT::Cache #read
Return current cache storage class instance
27 28 29 |
# File 'lib/eoat.rb', line 27 def self.cache @cache end |
.cache=(val) ⇒ Object
Available cache classes: FileCache, MemcachedCache, NoneCache RedisCache
Define new cache store class.
40 41 42 43 44 45 46 |
# File 'lib/eoat.rb', line 40 def self.cache=(val) if EOAT::Cache.constants.include? val.class.name.split('::').last.to_sym @cache = val else raise TypeError, "Wrong cache class #{val.class}" end end |
.headers ⇒ Hash #read
This method allows to control the request headers
54 55 56 |
# File 'lib/eoat.rb', line 54 def self.headers @headers end |
.max_ttl ⇒ Fixnum, #read
Return a current maximum TTL of cache in seconds By default: 30 days. Has been introduced to support the memcached. Since the TTL is calculated from the cached_until - request_time, and it may be ~ 10 years. Example: https://api.eveonline.com/eve/SkillTree.xml.aspx
64 65 66 |
# File 'lib/eoat.rb', line 64 def self.max_ttl @max_ttl end |
.max_ttl=(val) ⇒ Object
Allow set maximum TTL of cache
70 71 72 73 74 75 76 |
# File 'lib/eoat.rb', line 70 def self.max_ttl=(val) if val.class == Fixnum @max_ttl = val else raise TypeError, "Wrong class #{val.class} of value, it should be Fixnum" end end |