class Roda::Endpoints::Endpoint::Collection
HTTP endpoint representing a collection of items of the same type.
Attributes
item[R]
@return [{Symbol=>Object}]
Public Instance Methods
child(name: item_name, type: Item, **params)
click to toggle source
@param [Symbol] name @param [Hash] params
Calls superclass method
Roda::Endpoints::Endpoint#child
# File lib/roda/endpoints/endpoint/collection.rb, line 32 def child(name: item_name, type: Item, **params) super( name: name, type: type, last_modified: @last_modified || Undefined, **params ) end
item_name()
click to toggle source
@return [Symbol]
# File lib/roda/endpoints/endpoint/collection.rb, line 42 def item_name @item_name ||= Inflecto.singularize(name).to_sym end
last_modified()
click to toggle source
@return [Time]
Calls superclass method
Roda::Endpoints::Endpoint::Caching#last_modified
# File lib/roda/endpoints/endpoint/collection.rb, line 26 def last_modified @last_modified ? repository.public_send(@last_modified) : super end