Class: Yardstick::ReportOutput
- Inherits:
-
Object
- Object
- Yardstick::ReportOutput
- Defined in:
- lib/yardstick/report_output.rb
Overview
Handles writing reports
Class Method Summary collapse
-
.coerce(target) ⇒ Yardstick::ReportOutput
private
Coerces string path into proper output object.
Instance Method Summary collapse
-
#initialize(target) ⇒ undefined
constructor
private
Initializes ReportOutput instance.
- #to_s ⇒ String private
-
#write {|io| ... } ⇒ undefined
private
Open up a report for writing.
Constructor Details
#initialize(target) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes ReportOutput instance
25 26 27 |
# File 'lib/yardstick/report_output.rb', line 25 def initialize(target) @target = target end |
Class Method Details
.coerce(target) ⇒ Yardstick::ReportOutput
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Coerces string path into proper output object
14 15 16 |
# File 'lib/yardstick/report_output.rb', line 14 def self.coerce(target) new(Pathname(target)) end |
Instance Method Details
#to_s ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
50 51 52 |
# File 'lib/yardstick/report_output.rb', line 50 def to_s @target.to_s end |
#write {|io| ... } ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Open up a report for writing
40 41 42 43 |
# File 'lib/yardstick/report_output.rb', line 40 def write(&block) @target.dirname.mkpath @target.open('w', &block) end |