Advertisement
Guest User

Untitled

a guest
Nov 1st, 2015
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. 2.2.0 :001 > class KlassExample
  2. 2.2.0 :002?>
  3. 2.2.0 :003 > def initialize(target=nil)
  4. 2.2.0 :004?> @description = "description"
  5. 2.2.0 :005?> end
  6. 2.2.0 :006?>
  7. 2.2.0 :007 > def self.description
  8. 2.2.0 :008?> @description
  9. 2.2.0 :009?> end
  10. 2.2.0 :010?> end
  11. => :description
  12. 2.2.0 :011 > klass = Object.const_get "KlassExample"
  13. => KlassExample
  14. 2.2.0 :012 > klass.description
  15. => nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement