Class: BenchPress::RubyBenchmark
- Inherits:
-
Object
- Object
- BenchPress::RubyBenchmark
- Includes:
- HTTParty
- Defined in:
- lib/bench_press/ruby_benchmark.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(response) ⇒ RubyBenchmark
constructor
A new instance of RubyBenchmark.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ RubyBenchmark
Returns a new instance of RubyBenchmark.
17 18 19 |
# File 'lib/bench_press/ruby_benchmark.rb', line 17 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
15 16 17 |
# File 'lib/bench_press/ruby_benchmark.rb', line 15 def response @response end |
Class Method Details
.publish(measurable, file_path) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/bench_press/ruby_benchmark.rb', line 8 def self.publish(measurable, file_path) report = measurable.report.to_hash report[:results_attributes] = report.delete(:runnables) report.merge! :source => File.read(file_path) new post("/reports", :body => {:report => report}) end |
Instance Method Details
#to_s ⇒ Object
21 22 23 |
# File 'lib/bench_press/ruby_benchmark.rb', line 21 def to_s response.body end |