We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38dc427 commit 57c445aCopy full SHA for 57c445a
chapters/classes_and_objects/class-variables.md
@@ -13,6 +13,9 @@ You want to create a class variable.
13
class Zoo
14
@MAX_ANIMALS: 50
15
MAX_ZOOKEEPERS: 3
16
+
17
+ helpfulInfo: =>
18
+ "Zoos may contain a maximum of #{@constructor.MAX_ANIMALS} animals"
19
20
Zoo.MAX_ANIMALS
21
# => 50
@@ -23,6 +26,8 @@ Zoo.MAX_ZOOKEEPERS
23
26
zoo = new Zoo
24
27
zoo.MAX_ZOOKEEPERS
25
28
# => 3
29
+zoo.helpfulInfo()
30
+# => "Zoos may contain a maximum of 50 animals"
31
{% endhighlight %}
32
33
## Discussion
0 commit comments