Class: BenchPress::Report
- Inherits:
-
Object
- Object
- BenchPress::Report
- Defined in:
- lib/bench_press/report.rb
Constant Summary collapse
- SPACING =
4
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#date ⇒ Object
Returns the value of attribute date.
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
-
#runnables ⇒ Object
Returns the value of attribute runnables.
-
#summary ⇒ Object
Returns the value of attribute summary.
Instance Method Summary collapse
-
#initialize(name = "") ⇒ Report
constructor
A new instance of Report.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name = "") ⇒ Report
Returns a new instance of Report.
7 8 9 |
# File 'lib/bench_press/report.rb', line 7 def initialize(name = "") @name = name end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
5 6 7 |
# File 'lib/bench_press/report.rb', line 5 def @author end |
#date ⇒ Object
Returns the value of attribute date.
5 6 7 |
# File 'lib/bench_press/report.rb', line 5 def date @date end |
#email ⇒ Object
Returns the value of attribute email.
5 6 7 |
# File 'lib/bench_press/report.rb', line 5 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/bench_press/report.rb', line 5 def name @name end |
#runnables ⇒ Object
Returns the value of attribute runnables.
5 6 7 |
# File 'lib/bench_press/report.rb', line 5 def runnables @runnables end |
#summary ⇒ Object
Returns the value of attribute summary.
5 6 7 |
# File 'lib/bench_press/report.rb', line 5 def summary @summary end |
Instance Method Details
#to_hash ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/bench_press/report.rb', line 26 def to_hash result { :name => name, :heading => heading, :summary => summary, :email => email, :author => , :run_on => date, :repetitions => repetitions, :os => SystemInformation.os, :cpu => SystemInformation.cpu, :processor_count => SystemInformation.processor_count, :memory => SystemInformation.memory, :ruby_version => SystemInformation.ruby_version, :report => to_s, :crypted_identifier => SystemInformation.crypted_identifier, :runnables => runnables.map {|r| r.to_hash} } end |
#to_s ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/bench_press/report.rb', line 15 def to_s result [ cover_page, system_information, runnable_heading, runnable_table, ].join("\n\n") end |