Class: Request
- Inherits:
-
Object
- Object
- Request
- Defined in:
- lib/report/report_parser.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#avg_time ⇒ Object
Returns the value of attribute avg_time.
-
#controller ⇒ Object
Returns the value of attribute controller.
-
#count ⇒ Object
Returns the value of attribute count.
-
#format ⇒ Object
Returns the value of attribute format.
-
#max_time ⇒ Object
Returns the value of attribute max_time.
-
#min_time ⇒ Object
Returns the value of attribute min_time.
-
#std_dev ⇒ Object
Returns the value of attribute std_dev.
-
#verb ⇒ Object
Returns the value of attribute verb.
Class Method Summary collapse
Instance Method Summary collapse
- #fixup_controller_name! ⇒ Object
-
#initialize ⇒ Request
constructor
A new instance of Request.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Request
Returns a new instance of Request.
26 27 |
# File 'lib/report/report_parser.rb', line 26 def initialize end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
22 23 24 |
# File 'lib/report/report_parser.rb', line 22 def action @action end |
#avg_time ⇒ Object
Returns the value of attribute avg_time.
25 26 27 |
# File 'lib/report/report_parser.rb', line 25 def avg_time @avg_time end |
#controller ⇒ Object
Returns the value of attribute controller.
21 22 23 |
# File 'lib/report/report_parser.rb', line 21 def controller @controller end |
#count ⇒ Object
Returns the value of attribute count.
25 26 27 |
# File 'lib/report/report_parser.rb', line 25 def count @count end |
#format ⇒ Object
Returns the value of attribute format.
24 25 26 |
# File 'lib/report/report_parser.rb', line 24 def format @format end |
#max_time ⇒ Object
Returns the value of attribute max_time.
25 26 27 |
# File 'lib/report/report_parser.rb', line 25 def max_time @max_time end |
#min_time ⇒ Object
Returns the value of attribute min_time.
25 26 27 |
# File 'lib/report/report_parser.rb', line 25 def min_time @min_time end |
#std_dev ⇒ Object
Returns the value of attribute std_dev.
25 26 27 |
# File 'lib/report/report_parser.rb', line 25 def std_dev @std_dev end |
#verb ⇒ Object
Returns the value of attribute verb.
23 24 25 |
# File 'lib/report/report_parser.rb', line 23 def verb @verb end |
Class Method Details
.create(controller, action, count, avg_time, std_dev, min_time, max_time, options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/report/report_parser.rb', line 29 def self.create(controller, action, count, avg_time, std_dev, min_time, max_time, ={}) r = Request.new r.verb = [:verb] r.format = [:format] r.controller=controller r.action=action r.count=count r.avg_time=avg_time r.std_dev=std_dev r.min_time=min_time r.max_time=max_time return r end |
Instance Method Details
#fixup_controller_name! ⇒ Object
43 44 45 46 47 |
# File 'lib/report/report_parser.rb', line 43 def fixup_controller_name! if @controller =~ /^Api([^:].*)Controller/ @controller = "Api::V1::#{$1}Controller" end end |
#to_s ⇒ Object
49 50 51 |
# File 'lib/report/report_parser.rb', line 49 def to_s "%s#%s.%s.%s" % [ controller, action, verb, format ] end |