codeclimate/codeclimate-duplication

View on GitHub
lib/cc/engine/processed_source.rb

Summary

Maintainability
A
0 mins
Test Coverage
require "cc/parser"

module CC
  module Engine
    class ProcessedSource
      attr_reader :path

      def initialize(path, request_path)
        @path = path
        @request_path = request_path
      end

      def raw_source
        @raw_source ||= File.read(path)
      end

      def ast
        @ast ||= CC::Parser.parse(raw_source, request_path, filename: path)
      end

      private

      attr_reader :request_path
    end
  end
end