Skip to content

Commit 53c6315

Browse files
Update basics introduction.md in concepts (inner classes)
Update basic concepts to mention inner classes.
1 parent 71d5ca5 commit 53c6315

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

concepts/basics/introduction.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ end
3131
my_first_calc = Calculator.new
3232
```
3333

34+
Classes can contain other classes (_inner classes_):
35+
36+
```
37+
# Define outer class
38+
class Calculator
39+
40+
class SpecialHandler
41+
# ...
42+
end
43+
44+
# ...
45+
end
46+
```
47+
3448
Units of functionality are encapsulated in methods - similar to _functions_ in other languages. A method can optionally be defined with positional arguments, and/or keyword arguments that are defined and called using the `:` syntax. Methods either implicitly return the result of the last evaluated statement, or can explicitly return an object via the `return` keyword. Methods are invoked using `.` syntax.
3549

3650
```ruby

0 commit comments

Comments
 (0)