Created
November 4, 2013 18:45
-
-
Save ssaadh/7307314 to your computer and use it in GitHub Desktop.
Just my own testing of Ruby classes, objects and how they go together, inheritance, etc.
This file contains 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
class AParent | |
attr_reader :hello | |
end | |
class Outer | |
attr_reader :inner | |
def initialize( inner ) | |
@inner = inner | |
end | |
def lol | |
'lulz' | |
end | |
end | |
class Inner < AParent | |
def hi | |
'there' | |
end | |
end | |
inner = Inner.new | |
outer = Outer.new inner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment