Class: Amfetamine::Config

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.base_uriObject

Returns the value of attribute base_uri.



5
6
7
# File 'lib/amfetamine/config.rb', line 5

def base_uri
  @base_uri
end

.disable_cachingObject

Returns the value of attribute disable_caching.



5
6
7
# File 'lib/amfetamine/config.rb', line 5

def disable_caching
  @disable_caching
end

.loggerObject (readonly)

Returns the value of attribute logger.



5
6
7
# File 'lib/amfetamine/config.rb', line 5

def logger
  @logger
end

.memcached_instanceObject

Returns the value of attribute memcached_instance.



5
6
7
# File 'lib/amfetamine/config.rb', line 5

def memcached_instance
  @memcached_instance
end

.resource_suffixObject

Returns the value of attribute resource_suffix.



5
6
7
# File 'lib/amfetamine/config.rb', line 5

def resource_suffix
  @resource_suffix
end

.rest_clientObject

Returns the value of attribute rest_client.



5
6
7
# File 'lib/amfetamine/config.rb', line 5

def rest_client
  @rest_client
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



7
8
9
10
# File 'lib/amfetamine/config.rb', line 7

def configure
  yield(self)
  @base_uri ||= ""
end

.default_memcached_optionsObject



37
38
39
40
41
# File 'lib/amfetamine/config.rb', line 37

def default_memcached_options
  {
    expires_in: expiration_time
  }
end

.expiration_timeObject



43
44
45
46
47
48
49
# File 'lib/amfetamine/config.rb', line 43

def expiration_time
  if defined?(::Rails) && Rails.env.development?
    60.seconds
  else
    10.minutes
  end
end