5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 04:16:22 +00:00
panel/app/models/metadata_factory.rb

11 lines
285 B
Ruby
Raw Permalink Normal View History

2019-08-06 17:54:17 +00:00
# frozen_string_literal: true
# Devuelve metadatos de cierto tipo
class MetadataFactory
def self.build(**args)
2020-10-04 01:31:37 +00:00
@@factory_cache ||= {}
@@factory_cache[args[:type]] ||= ('Metadata' + args[:type].to_s.camelcase).constantize
@@factory_cache[args[:type]].new(args)
2019-08-06 17:54:17 +00:00
end
end