public void Scenario_RubyNameMangling2() { Assert(RubyUtils.MangleName("IPStack") == "ip_stack"); // TODO Assert(RubyUtils.MangleName("Stack") == "stack"); Assert(RubyUtils.MangleName("ThisIsMyLongName") == "this_is_my_long_name"); Assert(RubyUtils.MangleName("") == ""); Assert(RubyUtils.MangleName("F") == "f"); Assert(RubyUtils.MangleName("FO") == "fo"); Assert(RubyUtils.MangleName("FOO") == "foo"); Assert(RubyUtils.MangleName("FOOBar") == "foo_bar"); Assert(RubyUtils.MangleName("MaM") == "ma_m"); Assert(RubyUtils.MangleName("initialize") == "initialize"); Assert(RubyUtils.MangleName("Initialize") == "Initialize"); }
protected override bool TryGetName(Type clrType, PropertyInfo pi, MethodInfo mi, out string name) { if (mi.Name.StartsWith("get_")) { name = RubyUtils.MangleName(pi.Name); } else if (mi.Name.StartsWith("set_")) { name = RubyUtils.MangleName(pi.Name) + "="; } else { name = null; return(false); } return(true); }
protected override bool TryGetName(Type clrType, EventInfo ei, MethodInfo mi, out string name) { // TODO: Determine naming convention? name = RubyUtils.MangleName(ei.Name); return(true); }
protected override bool TryGetName(Type clrType, MethodInfo mi, out string name) { name = RubyUtils.MangleName(mi.Name); return(true); }