Module: Rddd::Presenters::CacheableConfig

Defined in:
lib/rddd/presenters/cacheable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#serializerObject (readonly)

Returns the value of attribute serializer.



139
140
141
# File 'lib/rddd/presenters/cacheable.rb', line 139

def serializer
  @serializer
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



139
140
141
# File 'lib/rddd/presenters/cacheable.rb', line 139

def timeout
  @timeout
end

Instance Method Details

#cache(attributes) ⇒ Object



141
142
143
144
145
# File 'lib/rddd/presenters/cacheable.rb', line 141

def cache(attributes)
  @timeout = attributes.fetch(:timeout, nil)
  @timeout = @timeout && 60 * @timeout
  @serializer = attributes.fetch(:serializer, nil)
end