Sha256: 3f30cace8db7585f7c4a7a696b90a69d2f5cb78bce48770889d707bb55c283ec
Contents?: true
Size: 769 Bytes
Versions: 1
Compression:
Stored size: 769 Bytes
Contents
# frozen_string_literal: true require 'roda/endpoints/endpoint/singleton' require 'roda/endpoints/endpoint/data' class Roda module Endpoints class Endpoint # HTTP endpoint representing a specific item of collection uniquely # identified by some parameter. class Item < Singleton prepend Data self.attributes += %i(id by on) self.defaults = defaults.merge( by: :fetch, on: :id, finder: -> { repository.public_send(by, id) } ) # @return [Symbol] attr_reader :by # @return [Integer] def id captures.first end # @return [Endpoint::Collection] def collection parent end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
roda-endpoints-0.2.0 | lib/roda/endpoints/endpoint/item.rb |