We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prependという機能がruby2.0から入っています。
class Hoge attr_accessor :hoge_flag # 仕様変更で急に動作を変えるケースが出たのでフラグを追加した def hoge p "original" end module PrependHoge def hoge if hoge_flag p "hoggable" else super # 既存の処理を呼ぶ end end end prepend PrependHoge end Hoge.new.hoge => "original" hoge = Hoge.new hoge.hoge_flag = true hoge.hoge => "hoggable"
仕様変更が突然来たけど、I/Fを変えたくない場合とかにつかえそうです。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
prependという機能がruby2.0から入っています。
仕様変更が突然来たけど、I/Fを変えたくない場合とかにつかえそうです。
The text was updated successfully, but these errors were encountered: