summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-05-18 01:11:20 -0600
committerDan Allen <dan.j.allen@gmail.com>2021-05-18 01:11:20 -0600
commit2f0000cf418d1f210bcef02a7cc7df08bef224d1 (patch)
tree9d2ef1c05489cff8b928ad1bfae9e083204a23f5 /lib
parent4332c41f38456a320c39d79ec93bd148b266ed74 (diff)
use class << self idiom to define class methods for Converter::TemplateConverter
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/converter/template.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/asciidoctor/converter/template.rb b/lib/asciidoctor/converter/template.rb
index bc64200b..4b4a5a76 100644
--- a/lib/asciidoctor/converter/template.rb
+++ b/lib/asciidoctor/converter/template.rb
@@ -41,13 +41,13 @@ class Converter::TemplateConverter < Converter::Base
@caches = { scans: {}, templates: {} }
end
- def self.caches
- @caches
- end
+ class << self
+ attr_reader :caches
- def self.clear_caches
- @caches[:scans].clear if @caches[:scans]
- @caches[:templates].clear if @caches[:templates]
+ def clear_caches
+ @caches[:scans].clear
+ @caches[:templates].clear
+ end
end
def initialize backend, template_dirs, opts = {}