Skip to content

Commit f74f6b4

Browse files
committed
Replace explicity initializer assignments with more concise property arguments.
1 parent 266cae4 commit f74f6b4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

chapters/design_patterns/decorator.textile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ miniMarkdown = (line) ->
2727
stripComments = (line) ->
2828
line.replace /\s*\/\/.*$/, '' # Removes one-line, double-slash C-style comments
2929

30-
TextProcessor = (processors) ->
31-
processors: processors
30+
TextProcessor = (@processors) ->
3231
reducer: (existing, processor) ->
3332
if processor
3433
processor(existing or '')

chapters/design_patterns/strategy.textile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ Encapsulate your algorithms inside of Strategy objects.
1515
Given an unsorted list, for example, we can change the sorting algorithm under different circumstances.
1616

1717
{% highlight coffeescript %}
18-
StringSorter = (algorithm) ->
19-
algorithm: algorithm
18+
StringSorter = (@algorithm) ->
2019
sort: (list) ->
2120
@algorithm list
2221

0 commit comments

Comments
 (0)