Class: Roda::Endpoints::Endpoint::Item

Inherits:
Singleton show all
Extended by:
Forwardable
Defined in:
lib/roda/endpoints/endpoint/item.rb

Overview

HTTP endpoint representing a specific item of collection uniquely identified by some parameter.

Instance Attribute Summary

Attributes inherited from Singleton

#entity, #finder, #on

Attributes included from Data

#repository_key

Attributes inherited from Roda::Endpoints::Endpoint

#captures, #on

Attributes included from ClassInterface

#attributes, #defaults, #statuses, #transactions, #verbs

Attributes included from Namespace

#name, #ns, #parent

Attributes included from Verbs

#verbs

Instance Method Summary collapse

Methods inherited from Singleton

#delete, #fetch_entity, #get, id_proc, #last_modified, #patch, #put

Methods included from Caching

#initialize, #last_modified, #to_hash

Methods included from Data

#initialize, #repository

Methods inherited from Roda::Endpoints::Endpoint

#child, #inheritable_attributes, #initialize, #route, #to_hash, #type, #with

Methods included from ClassInterface

#container, #define_attribute, #inherited, #ns, #route, #transaction, #type, #validate, #verb

Methods included from Lookup

#container, #lookup, #lookup_keys, #lookup_path, #operation_for, #transaction_for, #validation_for

Methods included from Namespace

included, #initialize

Methods included from Transactions

#after, #before, #perform, #prepare_transactions!, #step, #transactions

Methods included from Validations

#defaults, #prepare_validations!, #provide_default_validation!, #validate, #validation

Methods included from Functions::Shortcut

#f

Methods included from Verbs

#implemented_verbs, #initialize, #prepare_verbs!, #verb, #verbs_to_implement

Instance Method Details

#collectionEndpoint::Collection



15
16
17
# File 'lib/roda/endpoints/endpoint/item.rb', line 15

def collection
  parent
end

#idInteger

Returns:

  • (Integer)


21
22
23
# File 'lib/roda/endpoints/endpoint/item.rb', line 21

id_proc do
  instance_variable_defined?(:@id) ? @id : captures.last
end