class Blueprinter::Base

def self.identifier(method, name: method, extractor: Blueprinter.configuration.extractor_default.new, &block)

Returns:
  • (Field) - A Field object

Other tags:
    Example: Passing a block to be evaluated as the value. -
    Example: Specifying a uuid as an identifier. -

Other tags:
    Yield: - The object and the options passed to render are

Parameters:
  • extractor (AssociationExtractor, AutoExtractor, BlockExtractor, HashExtractor, PublicSendExtractor) --
  • name (Symbol) -- to rename the identifier key in the JSON
  • method (Symbol) -- the method or field used as an identifier that you
def self.identifier(method, name: method, extractor: Blueprinter.configuration.extractor_default.new, &block)
  view_collection[:identifier] << Field.new(
    method,
    name,
    extractor,
    self,
    block: block
  )
end