diff --git a/lib/typelizer/generator.rb b/lib/typelizer/generator.rb index 9ac4224..2ecc677 100644 --- a/lib/typelizer/generator.rb +++ b/lib/typelizer/generator.rb @@ -16,14 +16,18 @@ def initialize(config = Typelizer::Config) def call(force: false) return unless Typelizer.enabled? - read_serializers - - interfaces = target_serializers.map(&:typelizer_interface).reject(&:empty?) writer.call(interfaces, force: force) interfaces end + def interfaces + @interfaces ||= begin + read_serializers + target_serializers.map(&:typelizer_interface).reject(&:empty?) + end + end + private def target_serializers