query
stringlengths 7
6.41k
| document
stringlengths 12
28.8k
| metadata
dict | negatives
sequencelengths 30
30
| negative_scores
sequencelengths 30
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Register a new view key with the view factory eg: factory = AbstractViewFactory.new factory.register my_view: SomeViewClass You can setup many at the same time: factory.register my_view: SomeClass, another_view: OtherViewClass | def register(view_hash)
self.class.register view_hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def view(view, symbol)\n registered_views[String(view)] = { symbol: String(symbol).to_sym }\n self\n end",
"def register(key, &factory)\n @factories[key] = factory\n self\n end",
"def register_view_by(user)\n if user\n view = view_for(user) \n if view.nil?\n view = views.build(user: user)\n end\n view.increment!(\"count\")\n view.save\n end\n end",
"def registry_createkey(key, view = REGISTRY_VIEW_NATIVE)\n if session_has_registry_ext\n meterpreter_registry_createkey(key, view)\n else\n shell_registry_createkey(key, view)\n end\n end",
"def view(name, &block)\n @views[name] = block\n end",
"def shell_registry_createkey(key, view)\n key = normalize_key(key)\n # REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f]\n shell_registry_cmd_result(\"add /f \\\"#{key}\\\"\", view)\n end",
"def define_view\n \t#puts \"#{controller_name}.define_view:begin view=#{@myparams[:view_id]}\"\n \t# views: liste des vues possibles est utilisee dans la view ruby show\n\t\t@views = View.all\n\t\t# view_id: id de la vue selectionnee est utilisee dans la view ruby show\n\t\t#@myparams[:view_id] = @views.first.id if @myparams[:view_id].nil?\n\t\tif @myparams[:view_id].nil?\n\t\t\tif logged_in?\n\t\t\t@myparams[:view_id] = current_user.get_default_view.id\n\t\t\tend\n\t\tend\n\t\t#puts \"#{controller_name}.define_view:end view=#{@myparams[:view_id]}\"\n\tend",
"def view_registry\n @view_registry = nil unless production?\n @view_registry ||= View::Registry.new(@root)\n end",
"def attach_view(view)\n @views << view\n end",
"def add_view(listener)\n @views.add listener\n end",
"def register(key, klass)\n container.register(key, klass)\n end",
"def set_view(view)\n add_actions \"SetView(#{view})\"\n end",
"def view_step(*view_name, &block)\n \n # Instantiate a ViewStep object if symbol or string received\n view_name.each do |name|\n \n step = WebFlow::ViewStep.new(name.to_s)\n \n # Register this step in the flow repository\n register name.to_s, step\n \n # Execute the config block\n step.instance_eval(&block) if block_given?\n \n end\n \n end",
"def set_view\n @view = View.find(params[:id])\n end",
"def assign_factory(key, factory); @assigned_factories[key] = factory; end",
"def create_view(name, opts = {})\n Designs::View.define_and_create(self, name, opts)\n end",
"def assign_factory(key, factory)\n @assigned_factories[key] = factory\n end",
"def create\n @view = View.new(params[:view])\n @view.ministry = @ministry\n\n respond_to do |format|\n if @view.save\n # Make this view the current view\n session[:view_id] = @view.id\n flash[:notice] = 'View was successfully created.'\n format.html { redirect_to edit_view_url(@view) }\n format.xml { head :created, :location => view_url(@view) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @view.errors.to_xml }\n end\n end\n end",
"def create_view(view_name, map_function, reduce_function = nil)\n design_doc = database.get \"_design/#{self.name.underscore}\" rescue nil\n if design_doc\n design_doc[\"views\"][view_name] = {:map => map_function, :reduce => reduce_function}\n else\n design_doc = {\n \"_id\" => \"_design/#{self.name.underscore}\",\n :views => {\n view_name => {\n :map => map_function,\n :reduce => reduce_function\n }\n }\n }\n end\n database.save(design_doc)\n end",
"def meterpreter_registry_createkey(key, view)\n begin\n root_key, base_key = session.sys.registry.splitkey(key)\n perms = meterpreter_registry_perms(KEY_WRITE, view)\n open_key = session.sys.registry.create_key(root_key, base_key, perms)\n open_key.close\n return true\n rescue Rex::Post::Meterpreter::RequestError => e\n return nil\n end\n end",
"def add_view(kind, template)\n id = \"#{kind}.view\"\n transitions = {\n edit: \"#{kind}.update\",\n list: \"#{kind}.list\",\n delete: \"#{kind}.list\",\n }\n add_display(View.new(kind, id, template, transitions))\n end",
"def set_view(view_class)\n @view = validate_class(view_class)\n end",
"def define(design_doc, name, opts = {})\n model = design_doc.model\n\n # Is this an all view?\n if name.to_s == 'all'\n opts[:map] = <<-EOF\n function(doc) {\n if (doc['#{model.model_type_key}'] == '#{model.to_s}') {\n emit(doc._id, null);\n }\n }\n EOF\n elsif !opts[:map]\n if opts[:by].nil? && name.to_s =~ /^by_(.+)/\n opts[:by] = $1.split(/_and_/)\n end\n raise \"View cannot be created without recognised name, :map or :by options\" if opts[:by].nil?\n\n opts[:allow_blank] = opts[:allow_blank].nil? ? true : opts[:allow_blank]\n opts[:guards] ||= []\n opts[:guards].push \"(doc['#{model.model_type_key}'] == '#{model.to_s}')\"\n\n keys = opts[:by].map{|o| \"doc['#{o}']\"}\n emit = keys.length == 1 ? keys.first : \"[#{keys.join(', ')}]\"\n opts[:guards] += keys.map{|k| \"(#{k} != null)\"} unless opts[:allow_nil]\n opts[:guards] += keys.map{|k| \"(#{k} != '')\"} unless opts[:allow_blank]\n opts[:map] = <<-EOF\n function(doc) {\n if (#{opts[:guards].join(' && ')}) {\n emit(#{emit}, 1);\n }\n }\n EOF\n if opts[:reduce].nil?\n # Use built-in sum function by default\n opts[:reduce] = \"_sum\"\n end\n end\n\n if opts[:reduce].is_a?(Symbol)\n # Assume calling a built in method, convert to a string\n opts[:reduce] = \"_#{opts[:reduce]}\"\n end\n\n design_doc['views'] ||= {}\n view = design_doc['views'][name.to_s] = { }\n view['map'] = opts[:map]\n view['reduce'] = opts[:reduce] if opts[:reduce]\n view\n end",
"def register\n\t\ttype = @view.type_client\n\t\t# user_attributes = @view.display_register\n\t\tif type == \"admin\"\n\t\t\tuser_attributes = @view.display_register\n\t\t\tuser = Admin.new(user_attributes[0], user_attributes[1], user_attributes[2])\n\t\t\tuser.add_user(user)\n\t\t\t@current_user = user\n\t\t\toption = @view.second_view(user, user.actions)\n\t\t\tlist(option)\n\t\telsif type == \"vendor\"\n\t\t\tuser_attributes = @view.display_register\n\t\t\tuser = Vendor.new(user_attributes[0], user_attributes[1], user_attributes[2])\n\t\t\tuser.add_user(user)\n\t\t\t@current_user = user\n\t\t\toption = @view.second_view(user, user.actions)\n\t\t\tlist(option)\n\t\telsif type == \"client\"\n\t\t\tuser_attributes = @view.display_register\n\t\t\tuser = Client.new(user_attributes[0], user_attributes[1], user_attributes[2])\n\t\t\tuser.add_user(user)\n\t\t\t@current_user = user\n\t\t\toption = @view.second_view(user, user.actions)\n\t\t\tlist(option)\n\t\telse\n\t\t \tputs \"Try again\"\n\t\t \tputs \"\"\n\t\t \toption = @view.initial_view\n\t\t \tselect(option)\n\t\tend\n\tend",
"def initialize(view)\n @view = view\n end",
"def factory(key)\n @factories[key]\n end",
"def views(name = nil)\n raise NotImplementedError, \"views is an abstract method\"\n end",
"def add_view\n super\n end",
"def initialize(view)\n @view = view\n end",
"def set_view_name\n\n if !(session[:generic_view_name].nil?)\n\n @view_name = session[:generic_view_name]\n\n else\n\n error_log(\"session[:generic_view_name] was nil\",2)\n\n end\n\n end"
] | [
"0.6591519",
"0.6507942",
"0.63272035",
"0.61373234",
"0.608776",
"0.595585",
"0.5938726",
"0.5794936",
"0.5771254",
"0.5731997",
"0.5666165",
"0.56103075",
"0.5598721",
"0.5576095",
"0.55547476",
"0.55299664",
"0.5525555",
"0.5513879",
"0.5476883",
"0.54575104",
"0.54317105",
"0.5333186",
"0.53060895",
"0.5294936",
"0.5274382",
"0.52571034",
"0.5252025",
"0.5220614",
"0.52098984",
"0.5200342"
] | 0.74382234 | 0 |
GET /charted_accountants GET /charted_accountants.json | def index
@charted_accountants = ChartedAccountant.all
@general_setting = GeneralSetting.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_charted_accountant\n @charted_accountant = ChartedAccountant.find(params[:id])\n end",
"def agency_chart\n if(params[ :year ].nil?)\n params[ :year ] = '2015'\n else\n # Nothing to do.\n end\n expenses_of_public_agency = HelperController.expenses_year( \n params[ :id ].to_i, params[ :year ] )\n expenses_list = change_type_list_expenses( \n expenses_of_public_agency, params[ :year ] )\n\n respond_to do |format|\n format.json { render json: expenses_list }\n end\n end",
"def index\n @accountants = Accountant.all\n end",
"def list_tenants_for_circle(args = {}) \n get(\"/tenantcircles.json/tenants\", args)\nend",
"def show\n @travel_chart = Travel::Chart.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @travel_chart }\n end\n end",
"def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend",
"def index\n @accounts = policy_scope(Account)\n\n render json: @accounts, include: [:user]\n end",
"def index\n @payments = @payments.order(\"date DESC\")\n @graph = { :members => chart(\"members\"), \n :total => chart(\"total\"), \n :basic => chart(\"basic\"), \n :associate => chart(\"associate\")}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @payments }\n end\n end",
"def index\n\t\t@accounts = Account.all\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: @accounts }\n\t\tend\n\tend",
"def index\n\n begin\n\n @accounts = Account.active\n render json: @accounts.to_json(:except=>:password, :methods => [:subdomains, :template] )\n\n rescue => e\n render :json => e.message, :status => :unprocessable_entity\n end\n\n end",
"def index\n #chart = Chart.find(params[:chart_id])\n chart = Chart.where(\"id = ? AND user_id = ?\", params[:chart_id], current_user.id).limit(1)[0]\n data_sets = chart.data_sets.all\n\n respond_with(data_sets) do |format|\n \t#response string in specified format\n format.json { render json: { success: true, data_sets: data_sets } }\n end\n end",
"def index\n @grants =\n if @company\n @company.grants(params[:filter_by], params[:sort_by], params[:desc])\n else\n Grant.kept.order(name: :asc)\n end\n\n headers[\"Total\"] = @grants.count\n headers[\"Per-Page\"] = params[:per_page]\n\n render json: (params[:page] == 'all' ? @grants : paginator(@grants)), has_type: false\n end",
"def index\n @tenants = current_account.tenants\n end",
"def index\n @accounts = Account.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @accounts }\n end\n end",
"def index\n @ledger_accounts = current_user.ledger_accounts.all\n respond_with @ledger_accounts\n end",
"def index\n @ledger_accounts = current_user.ledger_accounts.all\n respond_with @ledger_accounts\n end",
"def index\n @tenants = Tenant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tenants }\n end\n end",
"def index\n @bank_accounts = BankAccount.all\n render :json => @bank_accounts.to_json\n end",
"def profile\n borrows = Transaction.find_by_id_b(current_user.id)\n lends = Transaction.find_by_id_l(current_user.id)\n\n if borrows == nil and lends == nil\n @empty = true\n @all_charts = [].to_json\n else\n @empty = false\n all_charts = {}\n\n #line chart - All\n res = Transaction.historygraph(current_user.id)\n all_charts.store('DebtLevel', JSON.parse(res))\n\n #pie chart - Debt\n res = Transaction.borrower_piechart(current_user.id)\n all_charts.store('Pie_d', JSON.parse(res))\n\n #pie chart - AR\n res = Transaction.lender_piechart(current_user.id)\n all_charts.store('Pie_ar', JSON.parse(res))\n\n #bubble chart - Debt\n res = Transaction.paidbackhistory(current_user.id)\n all_charts.store('History_d', JSON.parse(res))\n\n #bubble chart - AR\n #uri = URI('http://iou.azurewebsites.net/api/values/History/spaceholder/AR/' + session[:user])\n #res = Net::HTTP.get(uri)\n #all_charts.store('History_ar', JSON.parse(res))\n\n @all_charts = all_charts.to_json\n end\n\n end",
"def show\n authorize @accounts\n render json: @account\n end",
"def index\n @tenants = keystone.tenants\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @tenants }\n end\n end",
"def index\n @admittings = Admitting.all\n render json: @admittings\n end",
"def index\n @chart_account_klasses = Chart::AccountKlass.all\n end",
"def index\n @accounts = current_user.person.linked_in_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def index\n @pt_accounts = current_user.pt_accounts.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pt_accounts }\n end\n end",
"def index\n index = json_account_params[:json_id].to_i if !index \n if admin_signed_in?\n @accounts = Account.all\n else\n @accounts = Account.tri(@current_user.id).all[(index)..(index + 5)]\n end\n index = index + 1\n respond_to do |format|\n format.html\n format.json { render json: @accounts, locals: {last: \"@last\"} }\n end\n end",
"def index\n @careers = Career.all\n json_response(@careers)\n end",
"def all_accounts\n puts params[:id]\n accounts = []\n user = User.find params[:id]\n user.accounts.each do |f|\n accounts << {id:f.id, title: f.title}\n end\n render json: accounts\n end",
"def index\n @petty_cash_expenses = PettyCashExpense.all\n render json: @petty_cash_expenses\n end",
"def get_folio_data\n netid = params['netid']\n url = ENV['OKAPI_URL']\n tenant = ENV['OKAPI_TENANT']\n account = CUL::FOLIO::Edge.patron_account(url, tenant, folio_token, { username: netid })\n # Rails.logger.debug(\"mjc12test: Got FOLIO account #{account.inspect}\")\n render json: account\n end"
] | [
"0.65485334",
"0.6393527",
"0.63027585",
"0.6299109",
"0.6244783",
"0.6234712",
"0.6230231",
"0.6229354",
"0.6220164",
"0.61622345",
"0.61622185",
"0.61556613",
"0.61353517",
"0.61142105",
"0.6102393",
"0.6102393",
"0.6084765",
"0.60839134",
"0.608084",
"0.60797185",
"0.6071396",
"0.60683316",
"0.60572416",
"0.6050064",
"0.6039736",
"0.6016141",
"0.5970615",
"0.59566617",
"0.5952373",
"0.5938408"
] | 0.6540054 | 1 |