Class: Fukuzatsu::Formatters::JsonIndex
- Inherits:
-
Object
- Object
- Fukuzatsu::Formatters::JsonIndex
- Includes:
- Base
- Defined in:
- lib/fukuzatsu/formatters/json_index.rb
Instance Attribute Summary collapse
-
#summaries ⇒ Object
readonly
Returns the value of attribute summaries.
Instance Method Summary collapse
- #content ⇒ Object
- #file_extension ⇒ Object
- #filename ⇒ Object
-
#initialize(summaries, base_output_path) ⇒ JsonIndex
constructor
A new instance of JsonIndex.
Methods included from Base
#export, included, #output_directory, #output_path, #path_to_results
Constructor Details
#initialize(summaries, base_output_path) ⇒ JsonIndex
Returns a new instance of JsonIndex.
11 12 13 14 |
# File 'lib/fukuzatsu/formatters/json_index.rb', line 11 def initialize(summaries, base_output_path) @summaries = summaries @base_output_path = base_output_path end |
Instance Attribute Details
#summaries ⇒ Object (readonly)
Returns the value of attribute summaries.
9 10 11 |
# File 'lib/fukuzatsu/formatters/json_index.rb', line 9 def summaries @summaries end |
Instance Method Details
#content ⇒ Object
16 17 18 |
# File 'lib/fukuzatsu/formatters/json_index.rb', line 16 def content summaries.map { |summary| Json.new(summary: summary, base_output_path: self.base_output_path).as_json }.to_json end |
#file_extension ⇒ Object
24 25 26 |
# File 'lib/fukuzatsu/formatters/json_index.rb', line 24 def file_extension ".json" end |
#filename ⇒ Object
20 21 22 |
# File 'lib/fukuzatsu/formatters/json_index.rb', line 20 def filename "json/results.json" end |