Created
February 24, 2016 12:11
-
-
Save tomcha/f40bbbdf5b11803d5356 to your computer and use it in GitHub Desktop.
main.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # coding:utf-8 | |
| class MyApp | |
| attr_accessor :foo | |
| def initialize(*foo) | |
| @foo = foo | |
| end | |
| def bar() | |
| return 'barですよ' | |
| end | |
| end | |
| class MyApp2 < MyApp | |
| def bar() | |
| return 'barですよ2' | |
| end | |
| end | |
| app = MyApp.new('ふぉおおお') | |
| app2 = MyApp2.new | |
| #app.foo = 'ふぉー' | |
| puts app.foo | |
| puts app.bar | |
| puts app2.bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment