Class: MatchedRequests

Inherits:
Object
  • Object
show all
Defined in:
lib/report/report_differ.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#request1Object

Returns the value of attribute request1.



18
19
20
# File 'lib/report/report_differ.rb', line 18

def request1
  @request1
end

#request2Object

Returns the value of attribute request2.



18
19
20
# File 'lib/report/report_differ.rb', line 18

def request2
  @request2
end

Instance Method Details

#keyObject



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_sObject



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