lib/roda/endpoints/endpoint/item.rb in roda-endpoints-0.3.5 vs lib/roda/endpoints/endpoint/item.rb in roda-endpoints-0.3.6
- old
+ new
@@ -14,9 +14,15 @@
# @return [Endpoint::Collection]
def collection
parent
end
+ # @!method id
+ # @return [Integer]
+ id_proc do
+ instance_variable_defined?(:@id) ? @id : captures.last
+ end
+
def_delegator :collection, :repository
end
end
end
end