Class: MatchedRequests
- Inherits:
-
Object
- Object
- MatchedRequests
- Defined in:
- lib/report/report_differ.rb
Instance Attribute Summary collapse
-
#request1 ⇒ Object
Returns the value of attribute request1.
-
#request2 ⇒ Object
Returns the value of attribute request2.
Instance Method Summary collapse
-
#initialize(request1, request2) ⇒ MatchedRequests
constructor
A new instance of MatchedRequests.
- #key ⇒ Object
- #to_s ⇒ Object
- #values_ab(method_name) ⇒ Object
Constructor Details
#initialize(request1, request2) ⇒ MatchedRequests
Returns a new instance of MatchedRequests.
19 20 21 22 |
# File 'lib/report/report_differ.rb', line 19 def initialize(request1, request2) @request1 = request1 @request2 = request2 end |
Instance Attribute Details
#request1 ⇒ Object
Returns the value of attribute request1.
18 19 20 |
# File 'lib/report/report_differ.rb', line 18 def request1 @request1 end |
#request2 ⇒ Object
Returns the value of attribute request2.
18 19 20 |
# File 'lib/report/report_differ.rb', line 18 def request2 @request2 end |
Instance Method Details
#key ⇒ Object
24 25 26 27 |
# File 'lib/report/report_differ.rb', line 24 def key r = @request1 [["%s#%s" % [r.controller, r.action]], r.verb, r.format].compact.join(".") end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/report/report_differ.rb', line 33 def to_s "%s matches %s" %[@request1, @request2] end |
#values_ab(method_name) ⇒ Object
29 30 31 |
# File 'lib/report/report_differ.rb', line 29 def values_ab(method_name) [ @request1, @request2 ].map {|req| req.send(method_name) } end |