Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. class Tree
  3.     @branches = 0
  4.     @height = 0  
  5.     @availableOptions: => ['branches', 'height']
  6.  
  7. class Dog
  8.    @age = 0
  9.    @name = 'Doge'
  10.    @availableOptions: => ['age', 'name']
  11.    
  12.    
  13. arr = ['Tree', 'Dog']
  14.    
  15.    #alert(Tree.availableOptions())
  16.    
  17. for elem in arr
  18.     do ->
  19.       options = eval("#{elem}.availableOptions()")
  20.       for option in options
  21.         do ->
  22.           val = eval("#{elem}.#{option}")
  23.           alert(val)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement