Skip to content

Commit 16d1c6b

Browse files
committed
Changing method name to match book
1 parent a2b5cc1 commit 16d1c6b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: Chapter 5/ChainOfResponsibility.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var Westeros;
1414
var ClerkOfTheCourt = (function () {
1515
function ClerkOfTheCourt() {
1616
}
17-
ClerkOfTheCourt.prototype.IsInterestedInComplaint = function (complaint) {
17+
ClerkOfTheCourt.prototype.IsAbleToResolveComplaint = function (complaint) {
1818
//decide if this is a complaint which can be solved by the clerk
1919
return false;
2020
};
@@ -31,7 +31,7 @@ var Westeros;
3131
var King = (function () {
3232
function King() {
3333
}
34-
King.prototype.IsInterestedInComplaint = function (complaint) {
34+
King.prototype.IsAbleToResolveComplaint = function (complaint) {
3535
return true;
3636
};
3737

@@ -52,7 +52,7 @@ var Westeros;
5252
}
5353
ComplaintResolver.prototype.ResolveComplaint = function (complaint) {
5454
for (var i = 0; i < this.complaintListeners.length; i++) {
55-
if (this.complaintListeners[i].IsInterestedInComplaint(complaint)) {
55+
if (this.complaintListeners[i].IsAbleToResolveComplaint(complaint)) {
5656
return this.complaintListeners[i].ListenToComplaint(complaint);
5757
}
5858
}

Diff for: Chapter 5/ChainOfResponsibility.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ module Westeros.JudicialSystem{
77
}
88

99
export interface ComplaintListener{
10-
IsInterestedInComplaint(complaint: Complaint): boolean;
10+
IsAbleToResolveComplaint(complaint: Complaint): boolean;
1111
ListenToComplaint(complaint: Complaint): string;
1212
}
1313

1414
export class ClerkOfTheCourt implements ComplaintListener{
15-
IsInterestedInComplaint(complaint: Complaint): boolean{
15+
IsAbleToResolveComplaint(complaint: Complaint): boolean{
1616
//decide if this is a complaint which can be solved by the clerk
1717
return false;
1818
}
@@ -26,7 +26,7 @@ module Westeros.JudicialSystem{
2626
}
2727

2828
export class King implements ComplaintListener{
29-
IsInterestedInComplaint(complaint: Complaint): boolean{
29+
IsAbleToResolveComplaint(complaint: Complaint): boolean{
3030
return true;
3131
}
3232

@@ -49,7 +49,7 @@ module Westeros.JudicialSystem{
4949
public ResolveComplaint(complaint: Complaint): string{
5050
for(var i = 0; i<this.complaintListeners.length; i++)
5151
{
52-
if(this.complaintListeners[i].IsInterestedInComplaint(complaint))
52+
if(this.complaintListeners[i].IsAbleToResolveComplaint(complaint))
5353
{
5454
return this.complaintListeners[i].ListenToComplaint(complaint);
5555
}

0 commit comments

Comments
 (0)