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
27 28 29 |
# File 'lib/yardstick/report_output.rb', line 27 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
16 17 18 |
# File 'lib/yardstick/report_output.rb', line 16 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.
52 53 54 |
# File 'lib/yardstick/report_output.rb', line 52 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
42 43 44 45 |
# File 'lib/yardstick/report_output.rb', line 42 def write(&block) @target.dirname.mkpath @target.open('w', &block) end |