jrubyが入ってたわ
java.util.Calendarの動作を確認したかったけど、めんどくさいなと思ってたけど、jrubyが入ってたわ
# jirb irb(main):001:0> require 'java' => false irb(main):002:0> import 'java.util.Calendar' => ["java.util.Calendar"] irb(main):003:0> c = Calendar.getInstance => #<Java::JavaUtil::GregorianCalendar:0x7c50b9 @java_object=#<Java::JavaObject:0x97aaa6>> irb(main):004:0> c.getTime.class => Java::JavaUtil::Date irb(main):005:0> c.class => Java::JavaUtil::GregorianCalendar irb(main):006:0> c.class.class => Class irb(main):007:0> c.class.superclass => Java::JavaUtil::Calendar irb(main):008:0> c.class.superclass.superclass => Java::JavaLang::Object irb(main):009:0> c.class.superclass.superclass.superclass => ConcreteJavaProxy irb(main):010:0> c.class.superclass.superclass.superclass.superclass => JavaProxy irb(main):011:0> c.class.superclass.superclass.superclass.superclass.superclass => Object irb(main):012:0> c.class.superclass.superclass.superclass.superclass.superclass.superclass => nil irb(main):013:0> c.ancestors NoMethodError: undefined method `ancestors' for #<Java::JavaUtil::GregorianCalendar:0x7c50b9> irb(main):014:0> c.toString => "java.util.GregorianCalendar[time=1257579114989,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id=\"Asia/Tokyo\",offset=32400000,dstSavings=0,useDaylight=false,transitions=10,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2009,MONTH=10,WEEK_OF_YEAR=45,WEEK_OF_MONTH=1,DAY_OF_MONTH=7,DAY_OF_YEAR=311,DAY_OF_WEEK=7,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=4,HOUR_OF_DAY=16,MINUTE=31,SECOND=54,MILLISECOND=989,ZONE_OFFSET=32400000,DST_OFFSET=0]" irb(main):015:0> c.get Calendar::HOUR_OF_DAY => 16 irb(main):016:0> c.getTime.toString => "Sat Nov 07 16:31:54 JST 2009" irb(main):017:0> c.clear Calendar::SECOND => nil irb(main):018:0> c.getTime.toString => "Sat Nov 07 16:31:00 JST 2009" irb(main):019:0> c.clear Calendar::MINUTE => nil irb(main):020:0> c.getTime.toString => "Sat Nov 07 16:00:00 JST 2009"