Class: ActionviewPrecompiler::ControllerParser

Inherits:
Object
  • Object
show all
Defined in:
lib/actionview_precompiler/controller_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ ControllerParser

Returns a new instance of ControllerParser.



3
4
5
# File 'lib/actionview_precompiler/controller_parser.rb', line 3

def initialize(filename)
  @filename = filename
end

Instance Method Details

#render_callsObject



7
8
9
10
11
# File 'lib/actionview_precompiler/controller_parser.rb', line 7

def render_calls
  src = File.read(@filename)
  return [] unless src.include?("render")
  RenderParser.new(src, from_controller: true).render_calls
end