Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created November 1, 2015 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5e707e36f5243a95d8ca to your computer and use it in GitHub Desktop.
Save anonymous/5e707e36f5243a95d8ca to your computer and use it in GitHub Desktop.
2.2.0 :001 > class KlassExample
2.2.0 :002?>
2.2.0 :003 > def initialize(target=nil)
2.2.0 :004?> @description = "description"
2.2.0 :005?> end
2.2.0 :006?>
2.2.0 :007 > def self.description
2.2.0 :008?> @description
2.2.0 :009?> end
2.2.0 :010?> end
=> :description
2.2.0 :011 > klass = Object.const_get "KlassExample"
=> KlassExample
2.2.0 :012 > klass.description
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment