Skip to content

Instantly share code, notes, and snippets.

@mark
Created July 16, 2013 20:03
Show Gist options
  • Save mark/6012155 to your computer and use it in GitHub Desktop.
Save mark/6012155 to your computer and use it in GitHub Desktop.
1.9.3p194 :039 > class MyClass
1.9.3p194 :040?> def foo; puts "foo"; end
1.9.3p194 :041?> end
=> nil
1.9.3p194 :042 > class MyClass
1.9.3p194 :043?> private
1.9.3p194 :044?> def bar; puts "bar"; end
1.9.3p194 :045?> end
=> nil
1.9.3p194 :046 > class YourClass < MyClass
1.9.3p194 :047?> def initialize
1.9.3p194 :048?> foo; bar
1.9.3p194 :049?> end
1.9.3p194 :050?> end
=> nil
1.9.3p194 :051 > YourClass.new
foo
bar
=> #<YourClass:0x000001022ee368>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment