Skip to content

Commit 266cae4

Browse files
committed
Replace instances of "this." with "@" shorthand for greater legibility.
1 parent 50829fe commit 266cae4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

chapters/design_patterns/builder.textile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ TodoTxtBuilder = (defaultParameters={ }) ->
2121
projects: defaultParameters.projects or [ ]
2222
priority: defaultParameters.priority or undefined
2323
newTodo: (description, parameters={ }) ->
24-
date = (parameters.date and new Date(parameters.date)) or this.date
25-
contexts = this.contexts.concat(parameters.contexts or [ ])
26-
projects = this.projects.concat(parameters.projects or [ ])
27-
priorityLevel = parameters.priority or this.priority
24+
date = (parameters.date and new Date(parameters.date)) or @date
25+
contexts = @contexts.concat(parameters.contexts or [ ])
26+
projects = @projects.concat(parameters.projects or [ ])
27+
priorityLevel = parameters.priority or @priority
2828
createdAt = [date.getFullYear(), date.getMonth()+1, date.getDate()].join("-")
2929
contextNames = ("@#{context}" for context in contexts).join(" ")
3030
projectNames = ("+#{project}" for project in projects).join(" ")

chapters/design_patterns/decorator.textile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ TextProcessor = (processors) ->
3535
else
3636
existing
3737
processLine: (text) ->
38-
this.processors.reduce this.reducer, text
38+
@processors.reduce @reducer, text
3939
processString: (text) ->
40-
(this.processLine(line) for line in text.split("\n")).join("\n")
40+
(@processLine(line) for line in text.split("\n")).join("\n")
4141

4242
exampleText = '''
4343
# A level 1 header

chapters/design_patterns/strategy.textile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Given an unsorted list, for example, we can change the sorting algorithm under d
1818
StringSorter = (algorithm) ->
1919
algorithm: algorithm
2020
sort: (list) ->
21-
this.algorithm list
21+
@algorithm list
2222

2323
bubbleSort = (list) ->
2424
anySwaps = false

0 commit comments

Comments
 (0)