Sha256: ab9b907d8e115baad9ad341cb2f04ec0b6c65d1c9c1ef1e159ef2644f22e6832

Contents?: true

Size: 628 Bytes

Versions: 233

Compression:

Stored size: 628 Bytes

Contents

require 'brakeman/tracker/collection'

module Brakeman
  class Template < Brakeman::Collection
    attr_accessor :type
    attr_reader :render_path
    attr_writer :src

    def initialize name, called_from, file_name, tracker
      super name, nil, file_name, nil, tracker
      @render_path = called_from
      @outputs = []
    end

    def add_output exp
      @outputs << exp
    end

    def each_output
      @outputs.each do |o|
        yield o
      end
    end

    def rendered_from_controller?
      if @render_path
        @render_path.rendered_from_controller?
      else
        false
      end
    end
  end
end

Version data entries

233 entries across 219 versions & 4 rubygems

Version Path
brakeman-min-3.1.5.pre1 lib/brakeman/tracker/template.rb
brakeman-3.1.5 lib/brakeman/tracker/template.rb
brakeman-min-3.1.5 lib/brakeman/tracker/template.rb
brakeman-3.1.4 lib/brakeman/tracker/template.rb
brakeman-min-3.1.4 lib/brakeman/tracker/template.rb
brakeman-3.1.3 lib/brakeman/tracker/template.rb
brakeman-min-3.1.3 lib/brakeman/tracker/template.rb
brakeman-3.1.2 lib/brakeman/tracker/template.rb
brakeman-min-3.1.2 lib/brakeman/tracker/template.rb
brakeman-3.1.1 lib/brakeman/tracker/template.rb
brakeman-min-3.1.1 lib/brakeman/tracker/template.rb
brakeman-3.1.0 lib/brakeman/tracker/template.rb
brakeman-min-3.1.0 lib/brakeman/tracker/template.rb