lib/cocina/models.rb in cocina-models-0.68.0 vs lib/cocina/models.rb in cocina-models-0.69.0
- old
+ new
@@ -20,10 +20,11 @@
'dro' => 'DRO',
'request_dro' => 'RequestDRO',
'dro_access' => 'DROAccess',
'dro_structural' => 'DROStructural',
'request_dro_structural' => 'RequestDROStructural',
+ 'rspec' => 'RSpec',
'version' => 'VERSION'
}.freeze
def camelize(basename, _abspath)
INFLECTIONS.fetch(basename) { super }
@@ -53,9 +54,20 @@
# DRY Types
module Types
include Dry.Types()
end
+
+ ##
+ # Alias for `Cocina::Models::Vocabulary.create`.
+ #
+ # @param (see Cocina::Models::Vocabulary#initialize)
+ # @return [Class]
+ # rubocop:disable Naming/MethodName
+ def self.Vocabulary(uri)
+ Vocabulary.create(uri)
+ end
+ # rubocop:enable Naming/MethodName
# @param [Hash] dyn a ruby hash representation of the JSON serialization of a collection or DRO
# @param [boolean] validate
# @return [DRO,Collection,AdminPolicy]
# @raises [UnknownTypeError] if a valid type is not found in the data