• 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

例外で反応するのをrespondしてるといわないでほしい・・・

ruby>>
irb(main):001:0> 1.respond_to? :dup
=> true
irb(main):002:0> 1.dup
TypeError: can't dup Fixnum
from (irb):2:in `dup'
from (irb):2
from :0
<<ruby

posted by technohippy technohippy on Thu 7 Aug 2008 at 16:46 with 0 comments