Private Attribute Reader by Austin — 10 January 2018 Utility gem to easily declare private attribute readers in the same way you currently declare attr_reader https://github.com/Austio/private_attr_reader Comments You could also do like def private_attr_reader(*names) send(:attr_reader, *names) send(:private, *names) end Roman Trofimov — 10 January 2018 Sorry fo the bad code formatting. Roman Trofimov — 10 January 2018 :) all good on the formatting, thanks for the feedback/idea! Austin — 11 January 2018 Post a comment You can use basic HTML markup (e.g. <a>) or Markdown. Authenticate with GitHub As you are not logged in, you will bedirected via GitHub to signup or sign in
Comments
You could also do like
def private_attr_reader(*names) send(:attr_reader, *names) send(:private, *names) end
Sorry fo the bad code formatting.
:) all good on the formatting, thanks for the feedback/idea!
Post a comment