Skip to content

Commit a3784a5

Browse files
benluobishabosha
authored andcommitted
correct 2&3 and 3 only.
1 parent 8392e7c commit a3784a5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

_overviews/scala3-book/domain-modeling-oop.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ trait TranslationService:
151151

152152
To compose the two services, we can simply create a new trait extending them:
153153

154-
{% tabs traits_5 class=tabs-scala-version %}
154+
{% tabs traits_5 %}
155155
{% tab 'Scala 2 and 3' for=traits_5 %}
156156

157157
```scala
@@ -210,7 +210,7 @@ class MyService(name: String) extends ComposedService, Showable:
210210

211211
We can create an instance of `MyService` as follows:
212212

213-
{% tabs class_2 class=tabs-scala-version %}
213+
{% tabs class_2 %}
214214
{% tab 'Scala 2 and 3' for=class_2 %}
215215

216216
```scala
@@ -222,7 +222,7 @@ val s1: MyService = MyService("Service 1")
222222

223223
Through the means of subtyping, our instance `s1` can be used everywhere that any of the extended traits is expected:
224224

225-
{% tabs class_3 class=tabs-scala-version %}
225+
{% tabs class_3 %}
226226
{% tab 'Scala 2 and 3' for=class_3 %}
227227

228228
```scala
@@ -238,7 +238,7 @@ val s4: Showable = s1
238238

239239
As mentioned before, it is possible to extend another class:
240240

241-
{% tabs class_4 class=tabs-scala-version %}
241+
{% tabs class_4 %}
242242
{% tab 'Scala 2 and 3' for=class_4 %}
243243

244244
```scala
@@ -254,7 +254,7 @@ However, since _traits_ are designed as the primary means of decomposition,
254254
a class that is defined in one file _cannot_ be extended in another file.
255255
In order to allow this, the base class needs to be marked as `open`:
256256

257-
{% tabs class_5 class=tabs-scala-version %}
257+
{% tabs class_5 %}
258258
{% tab 'Scala 2 and 3' for=class_5 %}
259259

260260
```scala
@@ -307,7 +307,7 @@ class Counter:
307307

308308
Every instance of the class `Counter` has its own private state that can only be observed through the method `count`, as the following interaction illustrates:
309309

310-
{% tabs instance_7 class=tabs-scala-version %}
310+
{% tabs instance_7 %}
311311
{% tab 'Scala 2 and 3' for=instance_7 %}
312312

313313
```scala

0 commit comments

Comments
 (0)