public static DefineStruct ( RubyClass owner, string className, string attributeNames ) : RubyClass | ||
owner | RubyClass | |
className | string | |
attributeNames | string | |
return | RubyClass |
/// <summary> /// Struct#new /// Creates Struct classes with the specified name and members /// </summary> private static object Create(BlockParam block, RubyClass /*!*/ self, string className, string /*!*/[] /*!*/ attributeNames) { var result = RubyStruct.DefineStruct(self, className, attributeNames); if (block != null) { return(RubyUtils.EvaluateInModule(result, block, result)); } return(result); }
internal static RubyClass /*!*/ CreateTmsClass(RubyModule /*!*/ module) { // class is available for the library even if the constant is removed => store it on the context: return((RubyClass)module.Context.GetOrCreateLibraryData(TmsStructClassKey, () => RubyStruct.DefineStruct( (RubyClass)module, "Tms", new[] { "utime", "stime", "cutime", "cstime" } ))); }