Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pedro:~$ irb
- irb> class A ;end
- irb> class B ;end
- irb> class C ;end
- irb> A = B
- (irb):4: warning: already initialized constant A
- => B
- irb> class C
- irb> def self.hello
- irb> puts "hello"
- irb> end
- irb> end
- irb> B = C
- (irb):11: warning: already initialized constant B
- => C
- ## Testing the hello static method
- irb> A.hello
- NoMethodError: undefined method `hello' for B:Class
- from (irb):16
- from :0
- irb> B.hello
- hello
- irb> C.hello
- hello
- ## Classes
- pedro:~$ irb
- irb> class A ; end
- irb> class B ; end
- irb> class C ; end
- irb> A = B
- (irb):4: warning: already initialized constant A
- => B
- irb> B = C
- (irb):5: warning: already initialized constant B
- => C
- irb> A == B #=> false
- irb> B == C #=> true
- irb> A == A # => true
Add Comment
Please, Sign In to add comment