mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Module#attr_reader/writer are public methods since Ruby 2.5
This commit is contained in:
parent
b37473ebbd
commit
1f86a17031
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ class Module
|
||||||
def attr_internal_define(attr_name, type)
|
def attr_internal_define(attr_name, type)
|
||||||
internal_name = attr_internal_ivar_name(attr_name).delete_prefix("@")
|
internal_name = attr_internal_ivar_name(attr_name).delete_prefix("@")
|
||||||
# use native attr_* methods as they are faster on some Ruby implementations
|
# use native attr_* methods as they are faster on some Ruby implementations
|
||||||
send("attr_#{type}", internal_name)
|
public_send("attr_#{type}", internal_name)
|
||||||
attr_name, internal_name = "#{attr_name}=", "#{internal_name}=" if type == :writer
|
attr_name, internal_name = "#{attr_name}=", "#{internal_name}=" if type == :writer
|
||||||
alias_method attr_name, internal_name
|
alias_method attr_name, internal_name
|
||||||
remove_method internal_name
|
remove_method internal_name
|
||||||
|
|
Loading…
Reference in a new issue