Skip to content

Instantly share code, notes, and snippets.

@kalorz
Created September 15, 2017 10:39
Show Gist options
  • Save kalorz/02de294b85f85f74125d94eee602652c to your computer and use it in GitHub Desktop.
Save kalorz/02de294b85f85f74125d94eee602652c to your computer and use it in GitHub Desktop.
Ruby Gotchas: accessor return value
class Foo
def self.bar=(value)
@foo = value
return 'OK'
end
end
Foo.bar = 3 # => 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment