Class: Fluoride::Analyzer::RequestTemplater

Inherits:
Object
  • Object
show all
Defined in:
lib/fluoride-analyzer/request-templater.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRequestTemplater

Returns a new instance of RequestTemplater.



6
7
8
# File 'lib/fluoride-analyzer/request-templater.rb', line 6

def initialize

end

Instance Attribute Details

#resultsObject

Returns the value of attribute results.



9
10
11
# File 'lib/fluoride-analyzer/request-templater.rb', line 9

def results
  @results
end

#target_dirObject

Returns the value of attribute target_dir.



9
10
11
# File 'lib/fluoride-analyzer/request-templater.rb', line 9

def target_dir
  @target_dir
end

#templateObject

Returns the value of attribute template.



9
10
11
# File 'lib/fluoride-analyzer/request-templater.rb', line 9

def template
  @template
end

#template_stringObject

Returns the value of attribute template_string.



9
10
11
# File 'lib/fluoride-analyzer/request-templater.rb', line 9

def template_string
  @template_string
end

Instance Method Details

#goObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/fluoride-analyzer/request-templater.rb', line 15

def go
  results.each_pair do |pattern, statuses|
    context = PatternContext.new(pattern, statuses)

    path = File.join(context.filename)
    contents = template.result(context.context_binding)

    yield(path, contents)
  end
end