module Dough
  module Helpers
    class InsetBlock
      include ActionView::Helpers::RenderingHelper

      attr_reader :text

      def initialize(options = {})
        @text = options[:text]
      end

      def render
        renderer.render lookup_context, partial: 'inset_block', locals: { text: text }
      end

      def renderer
        ActionView::Renderer.new(lookup_context)
      end

      def lookup_context
        ActionView::LookupContext.new(ActionController::Base.view_paths + [Dough::Engine.root.join('app/views/dough/helpers/inset_block')])
      end
    end
  end
end

module Dough
  module Helpers
    class InsetBlock
      include ActionView::Helpers::RenderingHelper

      attr_reader :text

      def initialize(options = {})
        @text = options[:text]
      end

      def render
        renderer.render lookup_context, partial: 'inset_block', locals: { text: text }
      end

      private

      def renderer
        ActionView::Renderer.new(lookup_context)
      end

      def lookup_context
        ActionView::LookupContext.new(ActionController::Base.view_paths + [Dough::Engine.root.join('app/views/dough/helpers/inset_block')])
      end
    end
  end
end

Revert "Revert "make methods private""
Revert "Revert "make methods private""

This reverts commit 0932d09b42e8b04ea9accaf1323b21ba7aa0385a.
