inoicouldalwaysturn2u
11/4/2013 - 6:45 PM

Just my own testing of Ruby classes, objects and how they go together, inheritance, etc.

Just my own testing of Ruby classes, objects and how they go together, inheritance, etc.

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