This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is from the end of weakref.rb: | |
if __FILE__ == $0 | |
# require 'thread' | |
foo = Object.new | |
p foo.to_s # original's class | |
foo = WeakRef.new(foo) | |
p foo.to_s # should be same class | |
ObjectSpace.garbage_collect | |
ObjectSpace.garbage_collect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Forked from trevoke | |
require 'csv' | |
require 'yaml' | |
require 'rails/all' | |
require 'active_record' | |
require 'active_support' | |
require 'sqlite3' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A # top-level A | |
end | |
module M | |
module ClassMethods | |
def create_an_a | |
A.new # top-level A | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
attr_accessor :first_name, :last_name | |
def whole_name | |
first_name + " " + last_name | |
end | |
end | |
p = Person.new | |
p.first_name = "David" |
OlderNewer