1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

[ci skip] Add :private option to delegate section in guide

This commit is contained in:
Yoshiyuki Hirano 2018-04-04 20:04:10 +09:00
parent 57a9661a9c
commit 34a10e0c41

View file

@ -779,6 +779,14 @@ delegate :size, to: :attachment, prefix: :avatar
In the previous example the macro generates `avatar_size` rather than `size`.
The option `:private` changes methods scope:
```ruby
delegate :date_of_birth, to: :profile, private: true
```
The delegated methods are public by default. Pass `private: true` to change that.
NOTE: Defined in `active_support/core_ext/module/delegation.rb`
#### `delegate_missing_to`