Class: ConveyClient::Configuration
- Inherits:
-
Object
- Object
- ConveyClient::Configuration
- Defined in:
- lib/convey_client.rb
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#cache_timeout ⇒ Object
Returns the value of attribute cache_timeout.
-
#raise_request_errors ⇒ Object
Returns the value of attribute raise_request_errors.
-
#subdomain ⇒ Object
Returns the value of attribute subdomain.
Instance Method Summary collapse
Instance Attribute Details
#auth_token ⇒ Object
Returns the value of attribute auth_token.
54 55 56 |
# File 'lib/convey_client.rb', line 54 def auth_token @auth_token end |
#cache ⇒ Object
Returns the value of attribute cache.
54 55 56 |
# File 'lib/convey_client.rb', line 54 def cache @cache end |
#cache_timeout ⇒ Object
Returns the value of attribute cache_timeout.
54 55 56 |
# File 'lib/convey_client.rb', line 54 def cache_timeout @cache_timeout end |
#raise_request_errors ⇒ Object
Returns the value of attribute raise_request_errors.
54 55 56 |
# File 'lib/convey_client.rb', line 54 def raise_request_errors @raise_request_errors end |
#subdomain ⇒ Object
Returns the value of attribute subdomain.
54 55 56 |
# File 'lib/convey_client.rb', line 54 def subdomain @subdomain end |
Instance Method Details
#use_cache(method, timeout = nil, options = {}) ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/convey_client.rb', line 57 def use_cache(method, timeout = nil, ={}) timeout, = nil, timeout if timeout.is_a?(Hash) klass = method.to_s.split('_').collect { |e| e.capitalize }.join Moneta.autoload(klass.to_sym, "moneta/#{method}") self.cache = Moneta.const_get(klass).new() self.cache_timeout = timeout end |