Skip to content

Instantly share code, notes, and snippets.

@jamiehodge
Created November 11, 2015 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiehodge/68389548d9a86febce89 to your computer and use it in GitHub Desktop.
Save jamiehodge/68389548d9a86febce89 to your computer and use it in GitHub Desktop.
Private readers
class Foo
attr_reader :bar
def initialize(bar:, baz:)
@bar = bar
@baz = baz
end
def to_h
{ bar: bar, baz: baz }
end
private
attr_reader :baz
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment