public class RubyDate extends RubyObject
Date
implementation - 'native' parts.
In MRI, since 2.x, all of date.rb has been moved to native (C) code.
NOTE: There's still date.rb, where this gets bootstrapped from.RubyObject.Data
RubyBasicObject.Finalizer
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUST_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStamp
NULL_ARRAY
Modifier | Constructor and Description |
---|---|
|
RubyDate(Ruby runtime,
org.joda.time.DateTime dt) |
|
RubyDate(Ruby runtime,
long millis,
org.joda.time.Chronology chronology) |
protected |
RubyDate(Ruby runtime,
RubyClass klass) |
|
RubyDate(Ruby runtime,
RubyClass klass,
org.joda.time.DateTime dt) |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, eqlInternal, equalInternal, getNativeClassIndex, inspect, op_eqq, puts, specificEval, toRubyString, toString
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dup, ensureInstanceVariablesSettable, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize19, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing, method_missing19, method, method19, methods, methods, methods19, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_equal_19, op_equal, op_match, op_match19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, rbClone, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_method, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
public RubyDate(Ruby runtime, org.joda.time.DateTime dt)
public RubyDate(Ruby runtime, long millis, org.joda.time.Chronology chronology)
public RubyDate initialize(ThreadContext context, IRubyObject dt)
public RubyDate initialize(ThreadContext context, IRubyObject ajd, IRubyObject of)
public RubyDate initialize(ThreadContext context, IRubyObject ajd, IRubyObject of, IRubyObject sg)
public IRubyObject initialize_copy(IRubyObject original)
RubyBasicObject
initialize_copy
in class RubyBasicObject
public static RubyDate new_(ThreadContext context, IRubyObject self)
public static RubyDate new_(ThreadContext context, IRubyObject self, IRubyObject ajd)
public static RubyDate new_(ThreadContext context, IRubyObject self, IRubyObject ajd, IRubyObject of)
public static RubyDate new_(ThreadContext context, IRubyObject self, IRubyObject ajd, IRubyObject of, IRubyObject sg)
public static RubyDate civil(ThreadContext context, IRubyObject self)
public static RubyDate civil(ThreadContext context, IRubyObject self, IRubyObject year)
public static RubyDate civil(ThreadContext context, IRubyObject self, IRubyObject year, IRubyObject month)
public static RubyDate civil(ThreadContext context, IRubyObject self, IRubyObject year, IRubyObject month, IRubyObject mday)
public static RubyDate civil(ThreadContext context, IRubyObject self, IRubyObject[] args)
public static IRubyObject valid_civil_p(ThreadContext context, IRubyObject self, IRubyObject[] args)
public static IRubyObject _valid_time_p(ThreadContext context, IRubyObject self, IRubyObject h, IRubyObject m, IRubyObject s)
public static RubyDate jd(ThreadContext context, IRubyObject self)
public static RubyDate jd(ThreadContext context, IRubyObject self, IRubyObject jd)
public static RubyDate jd(ThreadContext context, IRubyObject self, IRubyObject jd, IRubyObject sg)
public static IRubyObject valid_jd_p(ThreadContext context, IRubyObject self, IRubyObject jd)
public static IRubyObject valid_jd_p(ThreadContext context, IRubyObject self, IRubyObject jd, IRubyObject sg)
public static IRubyObject _valid_jd_p(IRubyObject self, IRubyObject jd)
public static IRubyObject _valid_jd_p(IRubyObject self, IRubyObject jd, IRubyObject sg)
public static RubyDate ordinal(ThreadContext context, IRubyObject self, IRubyObject[] args)
public static IRubyObject valid_ordinal_p(ThreadContext context, IRubyObject self, IRubyObject[] args)
@Deprecated public static IRubyObject _valid_ordinal_p(ThreadContext context, IRubyObject self, IRubyObject[] args)
@Deprecated public IRubyObject _valid_ordinal_p(ThreadContext context, IRubyObject[] args)
public static RubyDate commercial(ThreadContext context, IRubyObject self, IRubyObject[] args)
public static IRubyObject valid_commercial_p(ThreadContext context, IRubyObject self, IRubyObject[] args)
@Deprecated public static IRubyObject _valid_commercial_p(ThreadContext context, IRubyObject self, IRubyObject[] args)
@Deprecated public static IRubyObject _valid_weeknum_p(ThreadContext context, IRubyObject self, IRubyObject[] args)
public static RubyDate today(ThreadContext context, IRubyObject self)
public static RubyDate today(ThreadContext context, IRubyObject self, IRubyObject sg)
@Deprecated public static IRubyObject _valid_civil_p(ThreadContext context, IRubyObject self, IRubyObject[] args)
@Deprecated public IRubyObject _valid_civil_p(ThreadContext context, IRubyObject[] args)
public org.joda.time.DateTime getDateTime()
public boolean equals(java.lang.Object other)
RubyObject
equals
in class RubyObject
RubyBasicObject.equals(Object)
public final boolean equals(RubyDate that)
public IRubyObject eql_p(IRubyObject other) throws java.lang.RuntimeException
RubyBasicObject
eql_p
in class RubyBasicObject
java.lang.RuntimeException
public IRubyObject op_cmp(ThreadContext context, IRubyObject other) throws RaiseException
op_cmp
in class RubyBasicObject
RaiseException
public int hashCode()
RubyObject
hashCode
in class RubyObject
RubyBasicObject.hashCode()
public RubyFixnum hash(ThreadContext context)
public RubyFixnum hash()
RubyBasicObject
hash
in class RubyBasicObject
public RubyFixnum jd(ThreadContext context)
public final long getJulianDayNumber()
public RubyBoolean julian_p(ThreadContext context)
public RubyBoolean gregorian_p(ThreadContext context)
public final boolean isJulian()
public IRubyObject ajd(ThreadContext context)
public IRubyObject amjd(ThreadContext context)
public IRubyObject start(ThreadContext context)
public RubyInteger year(ThreadContext context)
public RubyInteger yday(ThreadContext context)
public RubyInteger mon(ThreadContext context)
public RubyInteger mday(ThreadContext context)
public IRubyObject day_fraction(ThreadContext context)
public RubyInteger hour(ThreadContext context)
public RubyInteger minute(ThreadContext context)
public RubyInteger second(ThreadContext context)
public IRubyObject sec_fraction(ThreadContext context)
public RubyInteger cwyear(ThreadContext context)
public RubyInteger cweek(ThreadContext context)
public RubyInteger cwday(ThreadContext context)
public RubyInteger wday(ThreadContext context)
public RubyString zone(ThreadContext context)
public IRubyObject mjd(ThreadContext context)
public IRubyObject ld(ThreadContext context)
public IRubyObject offset(ThreadContext context)
public IRubyObject new_offset(ThreadContext context, IRubyObject[] args)
public IRubyObject new_start(ThreadContext context)
public IRubyObject new_start(ThreadContext context, IRubyObject sg)
public IRubyObject italy(ThreadContext context)
public IRubyObject england(ThreadContext context)
public IRubyObject julian(ThreadContext context)
public IRubyObject gregorian(ThreadContext context)
public static IRubyObject julian_leap_p(ThreadContext context, IRubyObject self, IRubyObject year)
public static IRubyObject gregorian_leap_p(ThreadContext context, IRubyObject self, IRubyObject year)
public IRubyObject leap_p(ThreadContext context)
public IRubyObject op_plus(ThreadContext context, IRubyObject n)
public IRubyObject op_minus(ThreadContext context, IRubyObject n)
public IRubyObject next(ThreadContext context)
public IRubyObject next_day(ThreadContext context)
public IRubyObject next_day(ThreadContext context, IRubyObject n)
public IRubyObject prev_day(ThreadContext context)
public IRubyObject prev_day(ThreadContext context, IRubyObject n)
public IRubyObject next_month(ThreadContext context)
public IRubyObject next_month(ThreadContext context, IRubyObject n)
public IRubyObject prev_month(ThreadContext context)
public IRubyObject prev_month(ThreadContext context, IRubyObject n)
public IRubyObject shift_fw(ThreadContext context, IRubyObject n)
public IRubyObject shift_bw(ThreadContext context, IRubyObject n)
public IRubyObject next_year(ThreadContext context)
public IRubyObject next_year(ThreadContext context, IRubyObject n)
public IRubyObject prev_year(ThreadContext context)
public IRubyObject prev_year(ThreadContext context, IRubyObject n)
public IRubyObject marshal_dump(ThreadContext context)
public static RubyDate _load(ThreadContext context, IRubyObject klass, IRubyObject str)
public RubyDate marshal_load(ThreadContext context, IRubyObject a)
public static RubyNumeric jd_to_ajd(ThreadContext context, IRubyObject self, IRubyObject[] args)
public final IRubyObject inspect()
RubyBasicObject
to_s
method to
generate the string.
[ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]"
Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"inspect
in interface IRubyObject
inspect
in class RubyBasicObject
public RubyString inspect(ThreadContext context)
public final IRubyObject to_s()
RubyBasicObject
to_s
prints the object's class and an encoding of the
object id. As a special case, the top-level object that is the
initial execution context of Ruby programs returns ``main.''to_s
in class RubyBasicObject
public RubyString to_s(ThreadContext context)
public RubyDate to_date()
public RubyDateTime to_datetime(ThreadContext context)
public RubyTime to_time(ThreadContext context)
public RubyString strftime(ThreadContext context)
public RubyString strftime(ThreadContext context, IRubyObject fmt)
public static IRubyObject _strptime(ThreadContext context, IRubyObject self, IRubyObject string)
public static IRubyObject _strptime(ThreadContext context, IRubyObject self, IRubyObject string, IRubyObject format)
public static IRubyObject _strptime(ThreadContext context, IRubyObject self, IRubyObject[] args)
public static IRubyObject zone_to_diff(ThreadContext context, IRubyObject self, IRubyObject zone)
public static RubyInteger _i(ThreadContext context, IRubyObject self, IRubyObject val)
public static RubyInteger _comp_year69(ThreadContext context, IRubyObject self, IRubyObject year)
public int getYear()
public int getMonth()
public int getDay()
public int getHour()
public int getMinute()
public int getSecond()
public int getNanos()
public java.util.Date toDate()
public java.time.Instant toInstant()
public java.time.LocalDate toLocalDate()
public java.lang.Class getJavaClass()
RubyBasicObject
getJavaClass
in interface IRubyObject
getJavaClass
in class RubyBasicObject
public <T> T toJava(java.lang.Class<T> target)
IRubyObject
toJava
in interface IRubyObject
toJava
in class RubyBasicObject
target
- The target type to which the object should be converted.IRubyObject.toJava(java.lang.Class<T>)
Copyright © 2001-2018 JRuby. All Rights Reserved.