Sha256: e675d49ac74b3a0c122d22c181e2a573b997f050eea4da16c0e8d24e250d081b

Contents?: true

Size: 634 Bytes

Versions: 4

Compression:

Stored size: 634 Bytes

Contents

require 'railroader/tracker/collection'

module Railroader
  class Template < Railroader::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

4 entries across 4 versions & 1 rubygems

Version Path
railroader-4.3.8 lib/railroader/tracker/template.rb
railroader-4.3.7 lib/railroader/tracker/template.rb
railroader-4.3.5 lib/railroader/tracker/template.rb
railroader-4.3.4 lib/railroader/tracker/template.rb