Class: ConveyClient::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/convey_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auth_tokenObject

Returns the value of attribute auth_token.



54
55
56
# File 'lib/convey_client.rb', line 54

def auth_token
  @auth_token
end

#cacheObject

Returns the value of attribute cache.



54
55
56
# File 'lib/convey_client.rb', line 54

def cache
  @cache
end

#cache_timeoutObject

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_errorsObject

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

#subdomainObject

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, options={})
  timeout, options = 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(options)
  self.cache_timeout = timeout
end