private void PopulateLookupTables(IEnumerable <string> methodNames) { var methodAliases = (Hash)_rubyEngine.CallMethod(ControllerClass, "name_selectors"); AliasedMethods = methodAliases.Map(pair => KeyValuePairFor(pair)); NonAliasedMethods = clr3::System.Linq.Enumerable.Where(methodNames, method => AliasedMethods.DoesNotContain( pair => String.Equals(pair.Key, method.Underscore(), StringComparison.OrdinalIgnoreCase) || String.Equals(pair.Key, method.Pascalize(), StringComparison.OrdinalIgnoreCase) ) ); }
public new ViewResult View(string viewName, string masterName, object model) { var vdd = new ViewDataDictionary(); // vdd["__scriptRuntime"] = ((RubyEngine) _engine).Runtime; _engine.CallMethod(this, "fill_view_data"); foreach (var entry in _viewData) { vdd[Convert.ToString(entry.Key, CultureInfo.InvariantCulture)] = entry.Value; } var hash = model as Hash; vdd.Model = (hash != null) ? new HashWrapper(hash) : model; ModelState.ForEach(pair => vdd.ModelState.Add(pair.Key.ToString(), pair.Value)); return(new ViewResult { ViewName = viewName, MasterName = masterName, ViewData = vdd, TempData = TempData }); }