module Roda::Endpoints::Endpoint::Data

Accessing data inside of endpoint.

Attributes

repository_key[R]

@return [String]

Public Class Methods

new(name:, repository: "repositories. click to toggle source

@param name [String] @param repository [String] @param attributes [{Symbol=>Object}]

Calls superclass method
# File lib/roda/endpoints/endpoint/data.rb, line 15
def initialize(name:,
               repository: "repositories.#{Inflecto.pluralize(name)}",
               **attributes)
  @repository_key = repository
  super(name: name, **attributes)
end

Public Instance Methods

repository() click to toggle source

@return [ROM::Repository]

# File lib/roda/endpoints/endpoint/data.rb, line 26
def repository
  if @repository_key.is_a?(String)
    container[@repository_key]
  else
    @repository_key
  end
end