Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions concepts/basics/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ end
my_first_calc = Calculator.new
```

Classes can contain other classes (_inner classes_):

```
# Define outer class
class Calculator

# Define inner class
class SpecialHandler
# ...
end

# ...
end
```

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.

```ruby
Expand Down
15 changes: 15 additions & 0 deletions exercises/concept/lasagna/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ end
my_first_calc = Calculator.new
```

Classes can contain other classes (_inner classes_):

```
# Define outer class
class Calculator
# Define inner class
class SpecialHandler
# ...
end
# ...
end
```
Comment on lines +50 to +63
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not understanding why or how the Lasgna problem introduces name spacing. The other change is good, though.


## Methods

Units of functionality are encapsulated in methods - similar to _functions_ in other languages.
Expand Down
Loading