Class: Pubid::Api::Identifier
- Inherits:
-
Object
- Object
- Pubid::Api::Identifier
- Defined in:
- lib/pubid/api/identifier.rb
Constant Summary collapse
- TYPE_KEY_TO_KLASS =
Factory that builds an API identifier from a hash of primitives. Dispatch on ‘:type` to the matching subclass; default is Pubid::Api::Identifiers::Standard.
API identifiers have a hardcoded “API” publisher (via SingleIdentifier#publisher method) so the ‘:publisher` kwarg is silently dropped.
{ std: "Standard", rp: "RecommendedPractice", spec: "Specification", tr: "TechnicalReport", bull: "Bulletin", mpms: "Mpms", cos: "ContinuousOperationsStandard", publ: "Publication", typeless: "TypelessStandard", }.freeze
Class Method Summary collapse
Class Method Details
.create(type: nil, **opts) ⇒ Object
40 41 42 43 |
# File 'lib/pubid/api/identifier.rb', line 40 def self.create(type: nil, **opts) klass = resolve_create_class(type) klass.new(**coerce_create_attrs(opts)) end |