Class: Adhoq::Reporter::Json
- Inherits:
-
Object
- Object
- Adhoq::Reporter::Json
- Defined in:
- lib/adhoq/reporter/json.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build_report ⇒ Object
-
#initialize(result) ⇒ Json
constructor
A new instance of Json.
Constructor Details
#initialize(result) ⇒ Json
Returns a new instance of Json.
11 12 13 |
# File 'lib/adhoq/reporter/json.rb', line 11 def initialize(result) @result = result end |
Class Method Details
.mime_type ⇒ Object
7 8 9 |
# File 'lib/adhoq/reporter/json.rb', line 7 def self.mime_type 'application/json' end |
Instance Method Details
#build_report ⇒ Object
15 16 17 18 19 20 |
# File 'lib/adhoq/reporter/json.rb', line 15 def build_report file = Tempfile.new(['adhoq-reporter', '.csv'], Dir.tmpdir, encoding: 'UTF-8') write_content!(file) file.tap(&:rewind) end |