fork download
  1. # your code goes here
  2.  
  3. class Alphabet
  4.  
  5. def a_method
  6. 'a_a_method'
  7. end
  8.  
  9. def self.new_method
  10. 'new method'
  11. end
  12.  
  13. class << self
  14. def my_method
  15. 'my method'
  16. end
  17. end
  18. end
  19.  
  20. class AlphaNumeric < Alphabet
  21. attr_accessor :tu
  22.  
  23. end
  24.  
  25. obj_a = Alphabet.new
  26. obj_an = AlphaNumeric.new
  27.  
  28. p obj_a.class
  29. p obj_a.singleton_class
  30.  
  31. p obj_an.class.instance_methods(false)
  32. # p obj_an.class.class_methods
  33. p obj_an.a_method
  34. p obj_an.class.new_method
  35. p obj_an.class.my_method
Success #stdin #stdout 0.01s 6252KB
stdin
Standard input is empty
stdout
Alphabet
#<Class:#<Alphabet:0x0000558b449bd820>>
[:tu, :tu=]
"a_a_method"
"new method"
"my method"