module Roda::Endpoints::Endpoint::Caching
Accessing data inside of endpoint.
Public Class Methods
new(last_modified: Undefined, **attributes)
click to toggle source
@param last_modified
[Symbol] @param attributes [{Symbol=>Object}]
Calls superclass method
# File lib/roda/endpoints/endpoint/caching.rb, line 11 def initialize(last_modified: Undefined, **attributes) @last_modified = last_modified unless last_modified == Undefined super(**attributes) end
Public Instance Methods
last_modified()
click to toggle source
@return [Time]
# File lib/roda/endpoints/endpoint/caching.rb, line 17 def last_modified Time.now end
to_hash()
click to toggle source
@return [{Symbol=>Object}]
Calls superclass method
# File lib/roda/endpoints/endpoint/caching.rb, line 22 def to_hash @last_modified ? super.merge(last_modified: @last_modified) : super end