gist: 3962 Download_button fork
public
Public Clone URL: git://gist.github.com/3962.git
Text only
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
> $VERBOSE = true
=> true
> s1 = String.new
=> ""
> s2 = String.new
=> ""
> class << s1
> S1 = 1
> end
=> 1
> S1
NameError: uninitialized constant S1
  from (irb):9
> String::S1
NameError: uninitialized constant String::S1
  from (irb):10
> s1::S1
TypeError: (null) is not a class/module
  from (irb):11
> s2::S1
TypeError: (null) is not a class/module
  from (irb):12
> class << s1; p S1; end
1
=> nil
> s3 = s1.dup
=> ""
> class << s3; p S1; end
NameError: uninitialized constant String::S1
  from (irb):15
> s4 = s1.clone
=> ""
> class << s4; p S1; end
1
=> nil
> class << s1; self.constants; end
=> ["S1"]
> class << s2; self.constants; end
=> []
> class << s3; self.constants; end
=> []
> class << s4; self.constants; end
=> ["S1"]
 
 
 

Owner

Anonymous

Revisions

  • 5bab5a Mon Aug 04 12:36:02 -0700 2008
  • b69576 Mon Aug 04 12:34:26 -0700 2008