Skip to content

Instantly share code, notes, and snippets.

@aeden
Created April 17, 2009 21:16
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 aeden/97265 to your computer and use it in GitHub Desktop.
Save aeden/97265 to your computer and use it in GitHub Desktop.
module Poco
def field_id
@field_id ||= rand
end
def field_id=(field_id)
@field_id = field_id
end
end
Time.send(:include, Poco)
String.send(:include, Poco)
t = Time.now
puts t.field_id
puts t.is_a?(Time)
s = "chicken"
puts s.field_id
puts s.is_a?(String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment