Class: CIAT::Feedback::HtmlFeedbackBuilder

Inherits:
Object
  • Object
show all
Includes:
IO
Defined in:
lib/ciat/feedback/html_feedback_builder.rb

Constant Summary

Constants included from IO

IO::OUTPUT_FOLDER, IO::REPORT_FILENAME

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from IO

#read_file, #write_file

Constructor Details

#initialize(options) ⇒ HtmlFeedbackBuilder

Returns a new instance of HtmlFeedbackBuilder.



8
9
10
# File 'lib/ciat/feedback/html_feedback_builder.rb', line 8

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/ciat/feedback/html_feedback_builder.rb', line 6

def options
  @options
end

Instance Method Details

#build_output_folderObject



12
13
14
# File 'lib/ciat/feedback/html_feedback_builder.rb', line 12

def build_output_folder
  options[:output_folder] || OUTPUT_FOLDER
end

#build_report_filenameObject



16
17
18
# File 'lib/ciat/feedback/html_feedback_builder.rb', line 16

def build_report_filename
  File.join(build_output_folder, options[:report_filename] || REPORT_FILENAME)
end

#build_report_titleObject



20
21
22
23
24
25
26
# File 'lib/ciat/feedback/html_feedback_builder.rb', line 20

def build_report_title
  if options[:report_title]
    "CIAT Report: " + options[:report_title]
  else
    "CIAT Report"
  end
end