mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 02:36:22 +00:00
10 lines
285 B
Ruby
10 lines
285 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Devuelve metadatos de cierto tipo
|
|
class MetadataFactory
|
|
def self.build(**args)
|
|
@@factory_cache ||= {}
|
|
@@factory_cache[args[:type]] ||= ('Metadata' + args[:type].to_s.camelcase).constantize
|
|
@@factory_cache[args[:type]].new(args)
|
|
end
|
|
end
|