Skip to content

Instantly share code, notes, and snippets.

@at-longhoang
Created March 9, 2016 08:29
Show Gist options
  • Save at-longhoang/a3417de0242b86c2c6c7 to your computer and use it in GitHub Desktop.
Save at-longhoang/a3417de0242b86c2c6c7 to your computer and use it in GitHub Desktop.
class Parent
private
def name
'Testing'
end
end
p = Parent.new
error:
p.name
# => NoMethodError: private method `name' called for #<Parent:0x0000000182a360>
p.send(:name)
# => "Testing"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment