I usually make my private methods like this:
```
class Foo
private
def private_method
end
end
```
However, there is inline-style private method like this:
```
class Foo
private def private_method
end
def puiblic_method_yo!
end
end
```
Additionally, attr_reader is also available for inline-style private method:
```
class Foo
private attr_reader :bar
end
```
So fancy, isn't it? lol
沒有留言:
張貼留言