Class: Fluoride::Analyzer::RequestTemplater
- Inherits:
-
Object
- Object
- Fluoride::Analyzer::RequestTemplater
- Defined in:
- lib/fluoride-analyzer/request-templater.rb
Instance Attribute Summary collapse
-
#results ⇒ Object
Returns the value of attribute results.
-
#target_dir ⇒ Object
Returns the value of attribute target_dir.
-
#template ⇒ Object
Returns the value of attribute template.
-
#template_string ⇒ Object
Returns the value of attribute template_string.
Instance Method Summary collapse
- #go ⇒ Object
-
#initialize ⇒ RequestTemplater
constructor
A new instance of RequestTemplater.
Constructor Details
#initialize ⇒ RequestTemplater
Returns a new instance of RequestTemplater.
6 7 8 |
# File 'lib/fluoride-analyzer/request-templater.rb', line 6 def initialize end |
Instance Attribute Details
#results ⇒ Object
Returns the value of attribute results.
9 10 11 |
# File 'lib/fluoride-analyzer/request-templater.rb', line 9 def results @results end |
#target_dir ⇒ Object
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 |
#template ⇒ Object
Returns the value of attribute template.
9 10 11 |
# File 'lib/fluoride-analyzer/request-templater.rb', line 9 def template @template end |
#template_string ⇒ Object
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
#go ⇒ Object
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 |