Advertisement
Guest User

Untitled

a guest
Jan 30th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.34 KB | None | 0 0
  1. class parent
  2.   @selectors = {
  3.     'a':  'hello',
  4.     'b':  'world',
  5.   }
  6. end
  7.  
  8. class child < parent
  9.   @selectors = {
  10.     'b':  'foo',
  11.     'c':  'bar',
  12.   }
  13.  
  14.   def initialize()
  15.     what I want here is to merge the selectors from my child class and my parent class.  So puts(@selectors) would show :
  16.     {a:hello,b:foo,c:bar}
  17.   }
  18.  
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement