Yes, it's that simple. :-) You've just got a couple of improper literals in {21}
and {32}
.
The following works:
class Shape
def profile
{ properties: 21 }
end
end
class Rectangle < Shape
def profile
super.merge({ location: 32 })
end
end
rect = Rectangle.new
puts rect.profile # => {:properties => 21, :location => 32}