Sha256: 6dd03c0451ffeeb610ad3fe3d5b859421ff302106866ab9175fdfb4c87aa7e20
Contents?: true
Size: 654 Bytes
Versions: 36
Compression:
Stored size: 654 Bytes
Contents
class KuberKit::TemplateReader::Reader ReaderNotFoundError = Class.new(KuberKit::NotFoundError) def use_reader(template_reader, template_class:) @@readers ||= {} if !template_reader.is_a?(KuberKit::TemplateReader::Strategies::Abstract) raise ArgumentError.new("should be an instance of KuberKit::TemplateReader::Strategies::Abstract, got: #{template_reader.inspect}") end @@readers[template_class] = template_reader end def read(shell, template) reader = @@readers[template.class] raise ReaderNotFoundError, "Can't find reader for template #{template}" if reader.nil? reader.read(shell, template) end end
Version data entries
36 entries across 36 versions & 1 rubygems