Skip to content

Commit b85be46

Browse files
habere-et-dispertirehabere
andauthored
Remove class wrapper from stub and add self (#797)
Co-authored-by: habere <habere@dispertire.org>
1 parent 7144e63 commit b85be46

2 files changed

Lines changed: 16 additions & 20 deletions

File tree

exercises/practice/rational-numbers/.meta/template-data.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,13 @@ example: |-
144144
}
145145
146146
stub: |-
147-
class RationalNumbers {
148147
has Int $.a;
149148
has Int $.b;
150149
151-
method add (RationalNumbers $op) { }
152-
method subtract (RationalNumbers $op) { }
153-
method multiply (RationalNumbers $op) { }
154-
method divide (RationalNumbers $op) { }
155-
method absolute { }
156-
method exponent ($power) { }
157-
method base ($base) { }
158-
}
150+
method add (RationalNumbers $op) { self }
151+
method subtract (RationalNumbers $op) { self }
152+
method multiply (RationalNumbers $op) { self }
153+
method divide (RationalNumbers $op) { self }
154+
method absolute { self }
155+
method exponent ($power) { self }
156+
method base ($base) { self }
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
unit class RationalNumbers;
22

3-
class RationalNumbers {
4-
has Int $.a;
5-
has Int $.b;
3+
has Int $.a;
4+
has Int $.b;
65

7-
method add (RationalNumbers $op) { }
8-
method subtract (RationalNumbers $op) { }
9-
method multiply (RationalNumbers $op) { }
10-
method divide (RationalNumbers $op) { }
11-
method absolute { }
12-
method exponent ($power) { }
13-
method base ($base) { }
14-
}
6+
method add (RationalNumbers $op) { self }
7+
method subtract (RationalNumbers $op) { self }
8+
method multiply (RationalNumbers $op) { self }
9+
method divide (RationalNumbers $op) { self }
10+
method absolute { self }
11+
method exponent ($power) { self }
12+
method base ($base) { self }

0 commit comments

Comments
 (0)