query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
sequencelengths 0
101
| negative_scores
sequencelengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
DELETE /tests/1 DELETE /tests/1.json | def destroy
@test.destroy
respond_to do |format|
format.html { redirect_to tests_url, notice: 'Test was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @test.destroy\n respond_to do |format|\n format.html { redirect_to tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test.destroy\n respond_to do |format|\n format.html { redirect_to tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test = Test.find(params[:id])\n @test.destroy\n\n respond_to do |format|\n format.html { redirect_to tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test.destroy\n respond_to do |format|\n format.html { redirect_to tests_url, notice: 'Prueba eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test = LoadTest.find(params[:id])\n @test.destroy\n\n respond_to do |format|\n format.html { redirect_to load_tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test1.destroy\n respond_to do |format|\n format.html { redirect_to test1s_url, notice: \"Test1 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def destroy\n @test = Mg::Test.find(params[:id])\n @test.destroy\n\n respond_to do |format|\n format.html { redirect_to(mg_tests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @testtest.destroy\n respond_to do |format|\n format.html { redirect_to testtests_url, notice: 'Testtest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n if @test.destroy\n return render json: { message: 'Test was removed succesfully.', error: false }\n else\n return render json: { message: 'Error :Something went wrong. Test was not removed.', error: true }\n end\n end",
"def destroy\n @test_run.destroy\n respond_to do |format|\n format.html { redirect_to test_runs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @testing_.destroy\n respond_to do |format|\n format.html { redirect_to testing_s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_test = TestTest.find(params[:id])\n @test_test.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_tests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @testis = Teste.find(params[:id])\n @testis.destroy\n\n respond_to do |format|\n format.html { redirect_to testes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @jsontest.destroy\n respond_to do |format|\n format.html { redirect_to jsontests_url, notice: 'Jsontest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_stuff.destroy\n respond_to do |format|\n format.html { redirect_to test_stuffs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @testdb = Testdb.find(params[:id])\n @testdb.destroy\n\n respond_to do |format|\n format.html { redirect_to testdbs_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @jquery_test.destroy\n respond_to do |format|\n format.html { redirect_to jquery_tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @testcase = Testcase.find(params[:id])\n @testcase.destroy\n\n respond_to do |format|\n format.html { redirect_to testcases_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tktest = Tktest.find(params[:id])\n @tktest.destroy\n\n respond_to do |format|\n format.html { redirect_to tktests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @smoke_test = SmokeTest.find(params[:id])\n @smoke_test.destroy\n\n respond_to do |format|\n format.html { redirect_to(smoke_tests_url) }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"def destroy\n @test_case.destroy\n respond_to do |format|\n format.html { redirect_to test_cases_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_run = TestRun.find(params[:id])\n @test_run.destroy\n\n respond_to do |format|\n format.html { redirect_to test_runs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_detail.destroy\n respond_to do |format|\n format.html { redirect_to test_details_url, notice: 'Test detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @usertest = Usertest.find(params[:id])\n @usertest.destroy\n\n respond_to do |format|\n format.html { redirect_to usertests_url }\n format.json { head :no_content }\n end\n end",
"def test_delete_post\n expected = 200\n post_id = 1\n uri = URI.parse('http://localhost:3000/v1/posts/'+post_id.to_s)\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Delete.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end",
"def destroy\n @fixit_test.destroy\n respond_to do |format|\n format.html { redirect_to fixit_tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @httparty_test.destroy\n respond_to do |format|\n format.html { redirect_to httparty_tests_url, notice: 'Httparty test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_test = Admin::Test.find(params[:id])\n @admin_test.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_tests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @test.destroy\n respond_to do |format|\n format.html { redirect_to tests_url(subject_class_id: @test.subject_class_id), notice: 'Test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_file = TestFile.find(params[:id])\n @test_file.destroy\n\n respond_to do |format|\n format.html { redirect_to test_files_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dtest = Dtest.find(params[:id])\n @dtest.destroy\n\n respond_to do |format|\n format.html { redirect_to dtests_url, notice: t(:dest_test) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test = TkdTest.find(params[:id])\n @test.destroy\n\n respond_to do |format|\n format.html { redirect_to(:action => :index) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\t\t\t\n\t\t\t\tTestimony.find(params[:id]).destroy\n\n\t\t\t\trender json: nil,status: 200\n\t\t\t\n\t\t\tend",
"def destroy\n @test_item.destroy\n respond_to do |format|\n format.html { redirect_to test_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @section_test = SectionTest.find(params[:id])\n @section_test.destroy\n\n respond_to do |format|\n format.html { redirect_to section_tests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @test_summary = TestSummary.find(params[:id])\n @test_summary.destroy\n\n respond_to do |format|\n format.html { redirect_to test_summaries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_suite = TestSuite.find(params[:id])\n @test_suite.destroy\n\n respond_to do |format|\n format.html { redirect_to test_suites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @testurl.destroy\n respond_to do |format|\n format.html { redirect_to testurls_url, notice: 'Testurl was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_stall.destroy\n respond_to do |format|\n format.html { redirect_to test_stalls_url, notice: 'Test stall was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test10 = Test10.find(params[:id])\n @test10.destroy\n\n respond_to do |format|\n format.html { redirect_to test10s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_datum.destroy\n respond_to do |format|\n format.html { redirect_to test_data_url, notice: 'Test datum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dovetest.destroy\n respond_to do |format|\n format.html { redirect_to dovetests_url, notice: 'Dovetest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n @copyeditor_test.destroy\n respond_to do |format|\n format.html { redirect_to copyeditor_tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tester = Tester.find(params[:id])\n @tester.destroy\n\n respond_to do |format|\n format.html { redirect_to testers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tester = Tester.find(params[:id])\n @tester.destroy\n\n respond_to do |format|\n format.html { redirect_to testers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test = Test.find_by_id(params[:id])\n @test.destroy\n\n respond_to do |format|\n format.html { redirect_to user_subject_tests_path }\n format.xml { head :ok }\n end\n end",
"def destroy\n @team_test = TeamTest.find(params[:id])\n @team_test.destroy\n\n respond_to do |format|\n format.html { redirect_to team_tests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @translations_versions_test.destroy\n respond_to do |format|\n format.html { redirect_to translations_versions_tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @alram_test.destroy\n respond_to do |format|\n format.html { redirect_to alram_tests_url, notice: 'Alram test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @student_test = StudentTest.find(params[:id])\n @student_test.destroy\n\n respond_to do |format|\n format.html { redirect_to student_tests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @runtest.destroy\n respond_to do |format|\n format.html { redirect_to runtests_url, notice: 'Runtest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ab_test.destroy\n respond_to do |format|\n format.html { redirect_to ab_tests_url, notice: 'Ab test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @what_test.destroy\n respond_to do |format|\n format.html { redirect_to what_tests_url, notice: 'What test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nginxtest.destroy\n respond_to do |format|\n format.html { redirect_to nginxtests_url, notice: \"Nginxtest was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @assert = Assert.find(params[:id])\n @assert.destroy\n\n respond_to do |format|\n format.html { redirect_to asserts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @testtype.destroy\n respond_to do |format|\n format.html { redirect_to testtypes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test.destroy\n head :no_content\n end",
"def destroy\n @user_test.destroy\n respond_to do |format|\n format.html { redirect_to user_tests_url, notice: 'User test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @assert = Assert.find(params[:id])\n @assert.destroy\n\n respond_to do |format|\n format.html { redirect_to asserts_url }\n format.json { head :no_content }\n end\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def destroy\n @test_set = TestSet.find(params[:id])\n permitted_to! :destroy, @test_set\n @test_set.destroy\n\n respond_to do |format|\n format.html { redirect_to test_sets_url }\n format.json { head :ok }\n end\n end",
"def destroy\n teacher_exclusive\n @test.destroy\n respond_to do |format|\n format.html { redirect_to tests_url, notice: \"L'épreuve a été supprimée\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_run = TestRun.accessible_by(current_ability).find(params[:id])\n @test_run.destroy\n\n respond_to do |format|\n format.html { redirect_to test_runs_url }\n format.json { head :no_content }\n end\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy\n @reacttest.destroy\n respond_to do |format|\n format.html { redirect_to reacttests_url, notice: 'Reacttest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @testpat.destroy\n respond_to do |format|\n format.html { redirect_to testpats_url }\n format.json { head :no_content }\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @test_two.destroy\n respond_to do |format|\n format.html { redirect_to test_twos_url, notice: 'Test two was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @case_test.destroy\n respond_to do |format|\n format.html { redirect_to case_tests_url, notice: 'Case test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fixture = Fixture.find(params[:id])\n @fixture.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @drug_test = DrugTest.find(params[:id])\n @drug_test.destroy\n\n respond_to do |format|\n format.html { redirect_to drug_tests_url }\n format.json { head :no_content }\n end\n end",
"def delete\n RestClient.delete(url, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end",
"def destroy\n @testing.destroy\n respond_to do |format|\n format.html { redirect_to testings_url, notice: 'Testing was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_metum.destroy\n respond_to do |format|\n format.html { redirect_to test_meta_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @runscope_test.destroy\n respond_to do |format|\n format.html { redirect_to runscope_tests_url, notice: 'Runscope test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @testmonial.destroy\n\n head :no_content\n end",
"def destroy\n @test_call.destroy\n respond_to do |format|\n format.html { redirect_to test_calls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_post = TestPost.find(params[:id])\n @test_post.destroy\n\n respond_to do |format|\n format.html { redirect_to test_posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expectation = Expectation.find(params[:id])\n @expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to expectations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @performance_test = PerformanceTest.find(params[:id])\n @performance_test.destroy\n\n respond_to do |format|\n format.html { redirect_to performance_tests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @test_record.destroy\n respond_to do |format|\n format.html { redirect_to test_records_url, notice: 'Test record was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @testcase = Testcase.find(params[:id])\n @testcase.destroy\n\n respond_to do |format|\n format.html { redirect_to(testcases_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @api_v1_exercise.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_exercises_url, notice: 'Exercise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @testsuite.destroy\n respond_to do |format|\n format.html { redirect_to testsuites_url, notice: 'Testsuite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_meta_datum.destroy\n respond_to do |format|\n format.html { redirect_to test_meta_data_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def destroy\n @type_test.destroy\n respond_to do |format|\n format.html { redirect_to type_tests_url, notice: 'Type test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.7714073",
"0.7714073",
"0.76993823",
"0.74377954",
"0.73900163",
"0.73229724",
"0.7315204",
"0.72704124",
"0.726755",
"0.7227424",
"0.7193738",
"0.718851",
"0.71764004",
"0.7156611",
"0.7138094",
"0.7136512",
"0.7135397",
"0.71252537",
"0.71075827",
"0.7105353",
"0.71051365",
"0.71030474",
"0.70944744",
"0.70850515",
"0.70581055",
"0.7051739",
"0.70511645",
"0.7041403",
"0.7035828",
"0.7024367",
"0.70229024",
"0.7013457",
"0.7009731",
"0.6999051",
"0.6989419",
"0.69839495",
"0.6957851",
"0.69577867",
"0.69334173",
"0.6927988",
"0.6926303",
"0.69214606",
"0.690904",
"0.6895772",
"0.6887112",
"0.68802327",
"0.6878895",
"0.6878895",
"0.6872141",
"0.6869322",
"0.68650395",
"0.68625444",
"0.6859295",
"0.68562865",
"0.685125",
"0.6846336",
"0.68442094",
"0.6834885",
"0.68335944",
"0.6823621",
"0.6813789",
"0.6811949",
"0.68100715",
"0.68067145",
"0.679673",
"0.67952394",
"0.6788314",
"0.6788314",
"0.6788314",
"0.6788314",
"0.6786637",
"0.6780512",
"0.67794335",
"0.6775163",
"0.6775138",
"0.6765114",
"0.6762586",
"0.67612624",
"0.67598957",
"0.6749683",
"0.6742136",
"0.6741705",
"0.673655",
"0.67249185",
"0.6723698",
"0.67209804",
"0.6710545",
"0.67075634",
"0.67073584",
"0.6706836",
"0.67051685",
"0.6700858",
"0.66951483"
] | 0.74184704 | 10 |
Use callbacks to share common setup or constraints between actions. | def set_test
@test = Test.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"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",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"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",
"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",
"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",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"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",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"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",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"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",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"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",
"def determine_valid_action\n\n end",
"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",
"def startcompany(action)\n @done = true\n action.setup\n end",
"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",
"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",
"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",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"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",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"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",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"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",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"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",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"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",
"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",
"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",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"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",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"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",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"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"
] | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def test_params
# params.fetch(:test, {})
params.require(:test).permit(:subject_id, :time_required, :number_of_questions, :user_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"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",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"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",
"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",
"def valid_params_request?; end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"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",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"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",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"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",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"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",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"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",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"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",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"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",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"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",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"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",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"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",
"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",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def url_whitelist; end",
"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",
"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",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def permit_request_params\n params.permit(:address)\n end",
"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",
"def secure_params\n params.require(:location).permit(:name)\n end",
"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",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def backend_user_params\n params.permit!\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"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",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"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",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"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",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] | [
"0.6981537",
"0.67835593",
"0.6748275",
"0.67436063",
"0.6736311",
"0.65937173",
"0.6503359",
"0.6498499",
"0.6482832",
"0.6478776",
"0.645703",
"0.6439998",
"0.63802195",
"0.6377008",
"0.6366287",
"0.632018",
"0.63016284",
"0.63011277",
"0.62932974",
"0.62919617",
"0.62905645",
"0.6289235",
"0.6283876",
"0.62425834",
"0.62410337",
"0.6218672",
"0.62151134",
"0.62096137",
"0.6192354",
"0.6178057",
"0.6177618",
"0.61727077",
"0.6162073",
"0.6152049",
"0.61515594",
"0.61458135",
"0.6122875",
"0.61165285",
"0.6107696",
"0.6104097",
"0.6091097",
"0.6080201",
"0.60699946",
"0.6063739",
"0.60206395",
"0.60169303",
"0.60134894",
"0.601003",
"0.6007347",
"0.6007347",
"0.6001054",
"0.59997267",
"0.5997844",
"0.5991826",
"0.5991213",
"0.59911627",
"0.5980111",
"0.5967009",
"0.59597385",
"0.5958542",
"0.595787",
"0.5957425",
"0.59522784",
"0.5951228",
"0.59423685",
"0.5939385",
"0.5939122",
"0.5939122",
"0.59325653",
"0.5930178",
"0.59248054",
"0.59243476",
"0.59164625",
"0.59106",
"0.59101933",
"0.59084356",
"0.5905666",
"0.58975077",
"0.58974737",
"0.5895128",
"0.58946574",
"0.589308",
"0.58916",
"0.5885987",
"0.58838505",
"0.58792",
"0.58723736",
"0.58684355",
"0.58677715",
"0.5865701",
"0.5865538",
"0.5865288",
"0.586385",
"0.5862139",
"0.58614355",
"0.58593005",
"0.5857459",
"0.58541363",
"0.58536613",
"0.58520085",
"0.585011"
] | 0.0 | -1 |
FizzBuzz The Programmer's Stairway to Heaven Define the fizzbuzz method to do the following: 10pts Use the modulo % method (divisible by) 2 % 2 => true 1 % 2 => false If a number is divisible by 3, puts "Fizz". If a number is divisible by 5, puts "Buzz". If a number is divisible by 3 and 5, puts "FizzBuzz" Use if statements 2pts Use the && operator 3pts Write a loop that will group the numbers from 1 through 50 by whether they fizz, buzz, or fizzbuzz 10pts solution 1 | def fizzbuzz(num)
collection = (1..num).to_a
collection.each do |num|
if (num % 3 == 0) && (num % 5 != 0)
puts "Fizz #{num}"
elsif (num % 5 == 0) && (num % 3 != 0)
puts "Buzz #{num}"
elsif (num % 3 == 0) && (num % 5 == 0)
puts "FizzBuzz #{num}"
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fizzbuzz\n\t(1..100).each do |num|\n\t if num % 3 == 0 && num % 5 == 0\n\t\tputs \"Fizzbuzz\"\n\t elsif num % 3 == 0\n\t\tputs \"Fizz\"\n\t elsif num % 5 == 0 \n\t\tputs \"Buzz\"\n\t else\n\t\tputs num\n\t end\n\tend\nend",
"def fizzbuzz\n\n\tfor i in (1..100) do\n\t\tif i % 3 == 0 and i % 5 == 0\n\t\t\tputs 'FizzBuzz'\n\t\telsif i % 5 == 0\n\t\t\tputs 'Buzz'\n\t\telsif i % 3 == 0\n\t\t\tputs 'Fizz'\n\t\telse puts i\n\n\t\tend\n\tend\n\nend",
"def fizzbuzz\n\t 1.upto(100) do |i|\n\tif i % 5 == 0 and i % 3 == 0\n\t puts \"FizzBuzz\"\n\telsif i % 5 == 0\n\t puts \"Buzz\"\n\telsif i % 3 == 0\n\t puts \"Fizz\"\n\telse\n\t puts i\n\tend\n\tend\nend",
"def fizz_buzz \n\ti=1\n\t while i < 100 do\n\t \tif i%3 == 0 && i%5 == 0\n\t \t\tprint \"FizzBuzz\\n\"\n\t \telsif i%3 == 0\n\t \tprint \"fizz\\n\"\n\t \telsif i%5 == 0\n\t \t\tprint \"Buzz\\n\"\n\t \telse\n\t \tprint \"#{i}\\n\"\n\t \tend\n\t\ti += 1\n\t end\nend",
"def fizzbuzz(num_1, num_2, range) #defines a method called fizzbuzz which takes 3 parameters (num_1, num_2, range)\n (1..range).each do |i| #iterates `i` over numbers 1 through a number set by parameter `range`\n if i % num_1 === 0 && i % num_2 === 0 #begins if...end loop with conditional that if the modulo of num_1 into `i` AND the modulo of num_2 into `i` both equal zero\n puts 'fizzbuzz' #then \"fizzbuzz\" will be sent to terminal\n elsif i % num_1 === 0 #if the first step is false AND the modulo of num_1 into `i` is 0 then\n puts 'fizz' #\"fizz\" will be printed to terminal\n elsif i % num_2 === 0 #if the first `if` AND the first `elsif` are false AND the modulo of num_2 into `i` is 0 then\n puts 'buzz' #\"buzz\" will be printed to terminal\n else #if all the above are false\n puts i #then variable `i` will be printed to terminal\n end #ends if statement from line 30\n end #ends .each do from line 29\nend",
"def fizzbuzz(num_1, num_2, range)\n# Iterate through each number in a range from 1 to whatever number is input for\n# the 'range' argument, and do something for each number.\n (1..range).each do |i|\n# Use an if statement that executes code if the conditional is true. If i is\n# divisible by num_1 and num_2, then execute the code below. If not true, move\n# on to the elsif statement.\n if i % num_1 === 0 && i % num_2 === 0\n# Print 'fizzbuzz' if the conditional above is true.\n puts 'fizzbuzz'\n# Use an elsif statement that executes code if the conditional is true. If i is\n# divisible by num_1, then print 'fizz'. If not true, move on to next elsif statement.\n elsif i % num_1 === 0\n puts 'fizz'\n# Use an elsif statement that executes code if the conditional is true. If i is\n# divisible by num_2, then print 'buzz'. If not true, move on to else statement.\n elsif i % num_2 === 0\n puts 'buzz'\n# If none of the above conditional statements are true, print i.\n else\n puts i\n# End the if/elsif/else statement.\n end\n# End the for loop.\n end\n# End the fizzbuzz method definition.\nend",
"def fizzbuzz\n\ty = (1..100)\n\ty.each { |x|\n\t\tif x % 3 == 0 && x % 5 == 0\n\t\t\tputs \"fizzbuzz\"\n\t\telsif x % 3 == 0\n\t\t\tputs \"fizz\"\n\t\telsif x % 5 == 0\n\t\t\tputs \"buzz\"\n\t\telse\n\t\t\tputs x\n\t\tend\n\t}\nend",
"def FizzBuzz()\n x=0\n while x < 100\n x += 1\n if x % 3 == 0 && x % 5 !=0\n puts \"Fizz\"\n elsif x % 5 == 0 && x% 3 !=0\n puts \"Buzz\"\n elsif x % 15 == 0\n puts \"FizzBuzz\"\n else puts x\n end\n end\nend",
"def fizz_buzz (i)\n 1.upto 100 do |i|\n if i % 5 == 0 && i % 3 == 0 \n puts \"FizzBuzz\"\n elsif i % 5 == 0\n puts \"Buzz\" \n elsif\n puts i % 3 == 0\n else \"Fizz\"\n puts i\n end\nend\nend",
"def fizz_buzz()\n for i in 1..100\n if i % 3 == 0 && i % 5 == 0\n puts 'FizzBuzz'\n elsif i % 3 == 0\n puts 'Fizz'\n elsif i % 5 == 0\n puts 'Buzz'\n else\n puts i\n end\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n#from integer 1 to argument range above, execute the code below for each element. variable i stands for the element in the range the program is currently using at the time.\n (1..range).each do |i|\n#conditional, if variable i modulo argument num_1 is equal to 0 AND variable i modulo argument num_2 is also equal to 0, print string \"fizzbuzz\"\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n#if the above conditional is not true, check if variable i modulo argument num_1 is equal to 0 by itself. if true, print string \"fizz\"\n elsif i % num_1 === 0\n puts 'fizz'\n#if neither of the above conditionals are true, check if variable i modulo argument num_2 is equal to 0 by itself. if true, print string \"buzz\"\n elsif i % num_2 === 0\n puts 'buzz'\n#if none of the above conditionals are found to be true, print the value of variable i (the number in the range the program was checking)\n else\n puts i\n end\n end\nend",
"def fizzbuzz(num)\n i = 1\n while i < num\n \n if i % 3 == 0 && i % 5 == 0\n p \"Fizzbuzz! nums is #{i}\"\n elsif i % 3 == 0\n p \"Fizz! num is #{i}\"\n elsif i % 5 == 0\n p \"Buzz! num is #{i}\"\n end\n i+= 1\n end\n\nend",
"def fizzbuzz(num_1, num_2, range)\n#Iterate the process begining at the value \"1\" up to the range argument's value.\n#A new variable i is established, i starts as \"1\" and goes up by 1 up until the range value is hit.\n (1..range).each do |i|\n#Establish a conditional: If i's value can be divided by num1's value with a remainder\n#of 0 AND i's value can also be divided by num2's value with a remainder of 0, print the string 'fizzbuzz' to the terminal\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n#If both prongs of the above conditional are not met, but i's value can be divided by num1's value with a remainder 0 then...\n elsif i % num_1 === 0\n#...print the string 'fizz' to the terminal\n puts 'fizz'\n#If neither of the two previous conditionals are met, but i's value can be divided by num2's value with a remainder 0 then...\n elsif i % num_2 === 0\n#...print the string 'fizz' to the terminal\n puts 'buzz'\n#If none of those conditionals were satisfied then...\n else\n#...print the value of i to the terminal\n puts i\n#end the conditional\n end\n#end the iteration\n end\n#end the method\nend",
"def fizzbuzz(num_1, num_2, range)\n#create a loop that iterates from 1 up to the value of the argument range\n# variable i gets assigned another value after each loop\n (1..range).each do |i|\n# in each iteration, if i is divided by num_1 and has 0 remainder (modulo)\n# AND if i is divided by num_2 and has 0 remainders, 'fizzbuzz' will print out\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n# if condition is not met from above, then if only i divided by num_1 has 0\n#remainder, then only print out 'fizz'\n elsif i % num_1 === 0\n puts 'fizz'\n# Or if only i divided by num_2 has 0 remainder, then only print out 'buzz'\n elsif i % num_2 === 0\n puts 'buzz'\n# if the three conditions above are not true then just print out value of i\n else\n puts i\n end\n #iterate the loop to the next value in the range\n end\n # when all values within the range are finished, end the loop\nend",
"def fizzbuzz\n\t1.upto(100) do |i|\n\t\tprint \"Fizz \" if a = (i % 3).zero?\n\t\tprint \"Buzz \" if b = (i % 5).zero?\n\t\tprint \"FizzBuzz \" if c = (i % 15).zero?\n\t\tprint i.to_s + \" \" unless (a || b || c)\n\tend\nend",
"def fizzbuzz()\n numbers = Array(1..100)\n numbers.each do |num|\n if num % 15 == 0\n puts \"FizzBuzz\" \n elsif num % 3 == 0\n puts \"Fizz\"\n elsif num % 5 == 0\n puts \"Buzz\"\n else\n puts num\n end\n end\nend",
"def fizzbuzz(number)\n (1..number).each do |num|\n if (num % 15).zero?\n puts 'FizzBuzz'\n elsif (num % 3).zero?\n puts 'Fizz'\n elsif (num % 5).zero?\n puts 'Buzz'\n else\n puts num\n end\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n # this line defines a for-loop that runs from 1 to the range parameter passed in\n # this will iterate on each number from 1 to the range parameter inclusive\n (1..range).each do |i|\n # this line defines an if statement with 3 conditional statements\n # 1) the remainder of the iterator number (i) / num_1 parameter is 0 (meaning even division)\n # 2) the remainder of the iterator number (i) / num_2 parameter is 0 (meaning even division)\n # 3) that both of the above conditionals are true, meaning i is evenly divided by both nums\n if i % num_1 === 0 && i % num_2 === 0\n # if the above conditionals are true this prints a string\n puts 'fizzbuzz'\n # this line will run if the previous if returns false. this defines a second\n # conditional that returns true if the remainder of i / num_1 parameter\n # is 0 (meaning even division)\n elsif i % num_1 === 0\n # if the above conditional is true this line prints a string\n puts 'fizz'\n # this line will run if the previous elsif returns false. this defines a third\n # conditional that returns true if the remainder of i / num_2 parameter\n # is 0 (meaning even division)\n elsif i % num_2 === 0\n # if the above conditional is true this line prints a string\n puts 'buzz'\n # if none of the above the above conditionals return true run line below\n else\n # this line prints the iterator number i\n puts i\n # this line ends the if-elsif-else block\n end\n # this line ends the for-loop\n end\n# this line ends the fizzbuzz method\nend",
"def fizz_buzz\n num = 0\n 100.times do\n num +=1\n if num % 5 == 0 && num % 3 == 0\n puts 'FizzBuzz'\n elsif num % 5 == 0\n puts 'Buzz'\n elsif num % 3 == 0\n puts 'Fizz'\n else\n puts num\n end\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n #Take all integers between 1 and the range arguments and does and using\n #if/elsif/else statements makes a function\n (1..range).each do |i|\n #Takes the integers from line 48 and divides them by the num_1 argument,\n #then takes the remainder, and sees if they equal 0, does this with num_2\n #argument as well, and if both are true runs the next line\n if i % num_1 === 0 && i % num_2 === 0\n #If the above is true, prints to terminal string 'fizzbuzz'\n puts 'fizzbuzz'\n #If the above code was not true and did not run, takes the integers from\n #line 48 and once again sees if the remainder of the argument num_1 ONLY\n #is equal to 0, if true, runs the next line\n elsif i % num_1 === 0\n #If the above is true, prints to terminal string 'fizz'\n puts 'fizz'\n #If both of the above code was not true and did not run, takes the integers\n #from line 48 and once again sees if the remainder of the argument num_2\n #ONLY is equal to 0, if true, runs the next line\n elsif i % num_2 === 0\n #If the above is true, prints to terminal string 'buzz'\n puts 'buzz'\n #If none of the above code was true for any argument, runs the code below\n else\n #If the above is true, prints the integer to terminal\n puts i\n #Ends the if/elsif/else function\n end\n #Ends the function that gave all integers between 1 and argument 'range' and\n #applied them to the if/elsif/else function\n end\n#Ends the function that defined what fizzbuzz did\nend",
"def fizzbuzz(num_1, num_2, range)\n# Take every integer between 1 and the range argument and do the following:\n (1..range).each do |i|\n # If the integer's modulous with num_1 argument equals zero and the integer's modulous with the num_2 argument equals zero\n if i % num_1 === 0 && i % num_2 === 0\n # print fizzbuzz\n puts 'fizzbuzz'\n # Otherwise if the integer's modulous with num_1 argument equals zero\n elsif i % num_1 === 0\n # print fizz\n puts 'fizz'\n # Otherwise if the integer's modulous with num_2 argument equals zero\n elsif i % num_2 === 0\n # print buzz\n puts 'buzz'\n # None of the above?\n else\n # Then just print the integer\n puts i\n # close if statement\n end\n # close .each method\n end\n# close fizz buzz method\nend",
"def fizz_buzz num\n puts \"FizzBuzz\" if num % 15 == 0\n puts \"Fizz\" if num % 3 == 0\n puts \"Buzz\" if num % 5 == 0\n puts num\nend",
"def fizzbuzz(num_1, num_2, range)\n#iterate throughout the number set\n (1..range).each do |i|\n #boolean, === is exact equals, % is the remainder from division (modulo), && is AND both conditions are met\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n #otherwise, if this exact number is met, put this phrase\n elsif i % num_1 === 0\n puts 'fizz'\n #otherwise, if this exact number is met, put this phrase\n elsif i % num_2 === 0\n puts 'buzz'\n #if all else fails, put i\n else\n puts i\n end\n end\nend",
"def fizzBuzz (number)\n for i in 1..number\n if (i % 15 == 0)\n puts \"fizzbuzz\"\n elsif (i % 3 ==0)\n puts \"fizz\"\n elsif (i % 5 ==0)\n puts \"buzz\"\n else\n puts i\n end\n end\nend",
"def fizzbuzz(number)\n\n if number % 3 == 0 && number % 5 == 0\n puts \"Fizzbuzz\"\n\n elsif number % 3 == 0 \n puts \"Fizz\"\n \n elsif number % 5 == 0\n puts \"Buzz\"\n \n end\n\nend",
"def fizzbuzz(num_1, num_2, range)\n # starts a counter from 1 to range value\n # for each in that range, print the specified output on\n # these next conditions:\n (1..range).each do |i|\n\n # if the next number in the counter is divisible\n # by both num1 and num2 (with 0 remainder)\n if i % num_1 === 0 && i % num_2 === 0\n # print this specified output\n puts 'fizzbuzz'\n\n # if the next number in the counter is divisible by num1 (with 0 remainder)\n elsif i % num_1 === 0\n # print this specified output\n puts 'fizz'\n\n # if the next number in the counter is divisible by num2 (with 0 remainder)\n elsif i % num_2 === 0\n # print this specified output\n puts 'buzz'\n # if none of these conditions are met,\n else\n # print the next number in the range counter.\n puts i\n # end of conditionals\n end\n # end of each.do loop\n end\n # end of method\nend",
"def fizzbuzz(num_1, num_2, range)\n # Invokes the for-loop method \"each\" to the interger range, ending the range\n # at the parameter \"range\" value.\n # Iterates the following if/elsif/else statement over each element in the index\n (1..range).each do |i|\n # Checks if the modulus of varriable \"i\" into the parameter \"num_1\" is the\n # same class as the interger 0\n # Checks if the modulus of varriable \"i\" into the parameter \"num_2\" is the\n # same class as the interger 0\n # The loogical AND operator checks if both === methods returned TRUE\n # If yes, returns TRUE. If no, returns FALSE.\n if i % num_1 === 0 && i % num_2 === 0\n # If the if statement returns TRUE, prints the string 'fizzbizz' to\n # the console\n # if the if statemnt returns FALSE, does nothing.\n puts 'fizzbuzz'\n # Calculates the modulus of the \"i\" variable into the paramater num_1.\n # Evaluates if the return to the above calculation is an interger.\n elsif i % num_1 === 0\n # If the elsif statement above returns TRUE, prints the string 'fizz' to\n # the console.\n # if the elsif statemnt above returns FLASE, does nothing.\n puts 'fizz'\n # Calculates the modulus of the \"i\" variable into the parameter num_2.\n # Evaluates if the return of the above calculation is an interger.\n elsif i % num_2 === 0\n # If the elsif statement above returns TRUE, prints the string 'buzz' to\n # the console.\n # if the eslif statemnt above returns FALSE, does nothing\n puts 'buzz'\n # If no nother if/els if statement has returned TRUE, this line will run\n else\n # Prints the current value of the varribale \"i\" to the console.\n puts i\n # Ends the if/elsif/els statements\n end\n # Ends the \".each\" method invocation\n end\n # Ends the definitions of the \"fizzbuzz\" method.\nend",
"def fizzbuzz(num_1, num_2, range)\n # sets 1 to range (last number) where each number will do the following\n (1..range).each do |i|\n # if the remainder of each number i divided by the first number num_1 should have a zero AND\n # the remainder of each number i divided by the second number num_2 should have a zero\n if i % num_1 === 0 && i % num_2 === 0\n # then print 'fizzbuzz'\n puts 'fizzbuzz'\n # otherwise, if the remainder of number i divdied by num_1 should have a zero\n elsif i % num_1 === 0\n # then print 'fizz'\n puts 'fizz'\n # otherwise, if the remainder of number i divided by num_2 should have a zero\n elsif i % num_2 === 0\n # then print 'buzz'\n puts 'buzz'\n else\n # if all the conditions above are not met, then print the number i\n puts i\n end\n end\nend",
"def fizzbuzz(int)\n if int % 15 == 0\n return \"FizzBuzz\"\nend\n if int % 3 == 0 # if the number int is divisible by 3\n return \"Fizz\" # Go fizz\nend\n if int % 5 == 0\n return \"Buzz\"\n end\nend",
"def fizzbuzz(number)\n if number % 5 == 0 && number % 3 == 0\n return \"FizzBuzz\"\n end\n if number % 3 == 0\n return \"Fizz\"\n end\n if number % 5 == 0\n return \"Buzz\"\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n # create loop and declare variable \"i\" assigned to integar 1, and repeat loop\n # for \"i\" on every subsequent integar until the 3rd argument \"range\" is reached\n (1..range).each do |i|\n # create if statement for if the modulus of variable i and argument num_1 is\n # equal to 0 and the modulus of variable i and num_2 is equal to zero,\n # print string \"fizzbuzz\"\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n # create else if statement for if the modulus of variable i and argument\n # num_1 is equal to 0, print string \"fizz\"\n elsif i % num_1 === 0\n puts 'fizz'\n # create else if statement for if the modulus of variable i and argument\n # num_2 is equal to 0, print string \"buzz\"\n elsif i % num_2 === 0\n puts 'buzz'\n # create else statement for all other conditions, and print \"i\"\n else\n puts i\n # end if statement\n end\n # end loop\n end\n# end method\nend",
"def fizzbuzz(num_1, num_2, range)\n # for each number in the range parameter (1 to range), do the following where i represents that number\n (1..range).each do |i|\n # if the remainder when you divide i by num_1 AND when you divide i by num_2 is 0 in both cases\n if i % num_1 === 0 && i % num_2 === 0\n # then print 'fizzbuzz'\n puts 'fizzbuzz'\n # if it IS true that the remainder when you divide i by num_1 is 0 (but not when you divide i by num_2)\n elsif i % num_1 === 0\n # then print just 'fizz'\n puts 'fizz'\n # if it's only true that the remainder is 0 when you divide i by num_2 and not num_1\n elsif i % num_2 === 0\n # then print just 'buzz'\n puts 'buzz'\n # if none of the three previous situations applies (is true)\n else\n #then instead, just print the number (i)\n puts i\n # close the if statement\n end\n # close the iteration loop\n end\n# close the method definition\nend",
"def fizzbuzz(num_1, num_2, range)\n # starts a loop which runs through all integers between 1 and whatever 'range' argument is equal to. i is the variable where each integer is stored during the loop.\n (1..range).each do |i|\n # starts if/else statement by detecting whether integer i is evenly divisible by both num_1 and num_2.\n if i % num_1 === 0 && i % num_2 === 0\n #If so, it prints 'fizzbuzz.'\n puts 'fizzbuzz'\n # detects if integer i is evenly divisible by num_1 (and only num_1, since line 45 would have caught it if it were divisible by both)\n elsif i % num_1 === 0\n # If so, it prints 'fizz'\n puts 'fizz'\n # detects if integer i is evenly divisible by num_2 (and only num_2)\n elsif i % num_2 === 0\n # If so, it prints 'buzz'\n puts 'buzz'\n # If integer i is evenly divisible by neither num_1 nor num_2, the function just prints integer i\n else\n puts i\n end\n end\nend",
"def fizzbuzz\n\ti = 1\n\twhile i < 101\n\t\tif i % 15 == 0\n\t\t\tputs \"fizzbuzz\"\n\t\telsif i % 5 == 0\n\t\t\tputs \"buzz\"\n\t\telsif i % 3 == 0\n\t\t\tputs \"fizz\"\n\t\telse\n\t\t\tputs \"#{i}\"\n\t\tend\n\t\ti = i + 1\n\tend\nend",
"def fizz_buzz\n x=1\n until x > 100 do\n if x%3 == 0 && x%5 !=0\n puts \"Fizz\"\n elsif x%5==0 && x%3 !=0\n puts \"Buzz\"\n elsif x%3 ==0 && x%5==0\n puts \"FizzBuzz\"\n else\n puts x\n end\n x+=1\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n #loop with .each do instead of for loop\n (1..range).each do |i|\n #Use modulo operator to get the remainder of the division i on num-1\n #if i modulo num_1 triple equals 0 AND i modulo num_2 triple equals 0\n if i % num_1 === 0 && i % num_2 === 0\n #print \"fizzbuzz\"\n puts 'fizzbuzz'\n #else if i modulo num_1 triple equals 0\n elsif i % num_1 === 0\n #print \"fizz\"\n puts 'fizz'\n #else if i modulo num_2 triple equals 0\n elsif i % num_2 === 0\n #print \"buzz\"\n puts 'buzz'\n #otherwise\n else\n #print i\n puts i\n #end\n end\n #end\n end\n #end\nend",
"def fizz_buzz number \n#prints numbers from 1 to 200\n #Modulo\n if number % 3 == 0 && number % 5 == 0\n 'FizzBuzz'\n elsif number % 3 == 0\n 'Fizz'\n elsif number % 5 == 0\n 'Buzz'\n else\n return number\n end\n\nend",
"def fizzbuzz(num)\n num.times do |i|\n \n if i % 15 == 0\n puts \"fizzbuzz\"\n elsif i % 3 == 0 \n puts \"fizz\"\n elsif i % 5 == 0\n puts \"buzz\"\n else\n puts \"num\"\n end\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n # for each of \"range\", do the below - i iterates from 1 to range\n (1..range).each do |i|\n # if statement - calculates whether remainder = 0 when i is divided by both num_1 and num_2 \n # this is equivalent to figuring out if num_1 and num_2 both divide evenly in. \n if i % num_1 === 0 && i % num_2 === 0\n # print \"fizzbuzz \" to screen if true \n puts 'fizzbuzz'\n # if quotient is zero for num_1 but not num_2 - print fizz \n elsif i % num_1 === 0\n # print fizz \n puts 'fizz'\n #if quotient = 0 for num_2 but not num_1 - print buzz \n elsif i % num_2 === 0\n # print buzz \n puts 'buzz'\n # if none of these are true - print i \n else\n # print i \n puts i\n \n end\n \n>>>>>>> 7f31df2026bbc770e1d39fa796fd7a1c7b96e2e3\n end\n\nend",
"def fizzbuzz(num_1, num_2, range)\n # create a for-loop that begins at 1 and runs until the range value is met\n (1..range).each do |i|\n # if the next value in the range is divided by num_1 and is mod 0 (no remainder)\n # and if the next value in the range is divided by num_2 and is mod 0\n if i % num_1 === 0 && i % num_2 === 0\n # display string\n puts 'fizzbuzz'\n # if the next value in the range is divided by num_1 and is mod 0\n elsif i % num_1 === 0\n # display string\n puts 'fizz'\n # if the next value in the range is divided by num_2 and is mod 0\n elsif i % num_2 === 0\n # display string\n puts 'buzz'\n else\n # if none of the previous statements are met, display the next value in the range\n puts i\n # end the if/else statement\n end\n # end the for-loop\n end\n# end the method\nend",
"def fizzbuzz(num_1, num_2, range)\n #calls alll numbers in range to each do variable |i|\n (1..range).each do |i|\n # begins if else statement if i can be divided by num_1 and if i divided by num_2\n if i % num_1 === 0 && i % num_2 === 0\n # 'fizzbuzz' is printed to terminal\n puts 'fizzbuzz'\n #if the above is not true i will be checked if divisble by num_1\n elsif i % num_1 === 0\n # if true 'fizz' will be printed to the terminal\n puts 'fizz'\n # checks if i can be divided by num_2\n elsif i % num_2 === 0\n # if true 'buzz' is printed to the terminal\n puts 'buzz'\n #if none of the above is true\n else\n # the variable i is printed to the terminal\n puts i\n #ends if else statement\n end\n #ends range.each do\n end\n #ends method\nend",
"def fizzbuzz(number)\n i = 1\n until i > number\n if i % 15 == 0\n puts \"Fizzbuzz for #{i}\"\n elsif i % 3 == 0\n puts \"Fizz for #{i}\"\n elsif i % 5 == 0\n puts \"Bizz for #{i}\"\n end\n i+=1\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n# Do i for all the numbers in a range from 1 to the value that will be assigned to the variable \"range\".\n (1..range).each do |i|\n# If i divided by the value assigned to num_1 is equal to 0 and i divided by the value assigned to num_2 is equal to zero then print \"fizzbuzz\".\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n# If i divided by the value assigned to num_1 is equal to zero print \"fizz\".\n elsif i % num_1 === 0\n puts 'fizz'\n# If i divided by the value assigned to num_2 is equal to zero print \"buzz\".\n elsif i % num_2 === 0\n puts 'buzz'\n# If none of the previous conditions are true print i.\n else\n puts i\n# Ends the if/else statement.\n end\n# Ends the argument.\n end\n# Ends the method.\nend",
"def fizzbuzz(start, finish)\n start.upto(finish) do |num|\n if div_by_3?(num) && div_by_5?(num)\n puts \"FizzBuzz\"\n elsif div_by_5?(num)\n puts \"Buzz\"\n elsif div_by_3?(num)\n puts \"Fizz\"\n else\n puts num\n end\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n # 1..range will compute from the numer 1 to the variable range. .each loops this varaible while do tells it to loop. The |i| is place holder for indexes\n (1..range).each do |i|\n # The if statemenet is stating if i has a remindar equal to num_1 that is equal to 0 AND if i has a remindar equal to num_2 that is equal to zero\n if i % num_1 === 0 && i % num_2 === 0\n # print fizzbuzz if the given condition above is true\n puts 'fizzbuzz'\n # elsif is stating that if the first condition isn't met, then print this method. This elsif method states if i has a remindar that is equal to num_1 that is equal to 0\n elsif i % num_1 === 0\n # Print fizz if the given condition above is true\n puts 'fizz'\n # elsif is stating that if the given if statement is false, then go to the next elsif statement. This is stating if i has a remindar equal to num_2 that is equal to=\n elsif i % num_2 === 0\n # Print buzz if the given condition above is true\n puts 'buzz'\n # else is the final condition in a if, elsif statement. If the if and elsif statements are false, else will automatically be the final condition.\n else\n # print i if the given conditions of if, elsif are false\n puts i\n # ends the if, elsif, else fuctions\n end\n # ends the looping function\n end\n # ends the method function\nend",
"def FizzBuzz\n\t\n1.upto(100) {|i| \n\tputs \"Fizz\" if i%3 == 0 && i%5 != 0\n\tputs \"Buzz\" if i%3 != 0 && i%5 == 0\n\tputs \"FizzBuzz\" if i%3 == 0 && i%5 == 0\n\tputs i if i%3 != 0 && i%5 != 0\n}\t\n\nend",
"def fizzbuzz(a,b)\n numbers = (a..b).to_a\n\n numbers.each do |number|\n if number % 15 == 0\n puts \"FizzBuzz\"\n elsif number % 3 == 0\n puts \"Fizz\"\n elsif number % 5 == 0\n puts \"Buzz\"\n else\n puts number\n end\n end\nend",
"def fizzbuzz(num)\n\tif num % 15 == 0\n\t\"FizzBuzz\"\n\telsif num % 3 == 0\n\t\"Fizz\"\n\telsif num % 5 == 0\n\t\"Buzz\"\n\t\n\telse num % 15 != 0\n\tputs\n\nend\nend",
"def fizzbuzz(starting, ending)\n (starting..ending).each do |num|\n if (num % 15).zero?\n p \"FizzBuzz\"\n elsif (num % 3).zero?\n p \"Fizz\"\n elsif (num % 5).zero?\n p \"Buzz\"\n else\n p num\n end\n end\nend",
"def fizz_buzz(n)\n i = 1\n while i <= n\n if i % 15 == 0 \n puts \"fizz buzz\" \n elsif i % 5 == 0 \n puts \"buzz\"\n elsif i % 3 == 0 \n puts \"fizz\"\n else\n puts i\n end\n i+=1\n end\nend",
"def fizzbuzz(number)\n if number % 3 == 0 && number % 5 == 0\n \"FizzBuzz\"\n elsif number % 3 == 0\n \"Fizz\"\n elsif number % 5 == 0\n \"Buzz\"\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n#Repeats the following code for the duration of the range argument.\n (1..range).each do |i|\n#If i is divisible by both num_1 and num_2, it displays string fizzbuzz\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n#If i is divisible by num_1, it displays string fizz\n elsif i % num_1 === 0\n puts 'fizz'\n#If i is divisible by num_2, it displays string buzz\n elsif i % num_2 === 0\n puts 'buzz'\n#If i isn't divisible by either num_1 or num_2, it displays integer i\n else\n puts i\n#Ends the if, elsif, elsif, else check\n end\n#ends our loop\n end\n#ends our method\nend",
"def fizzbuzz (i)\n if i % 3 == 0 && i % 5 == 0\n return \"FizzBuzz\"\nend\n if i % 3 == 0 \n return \"Fizz\"\nend\n if i % 5 == 0 \n return \"Buzz\"\nend \nend",
"def fizzbuzz(num_1, num_2, range)\n# for loop that parses through entire number range from 1 to what is passed as an argument\n (1..range).each do |i|\n# boolean if statement if the modulo of num_1 argument is 0 and num_2 argument is also 0 results\n if i % num_1 === 0 && i % num_2 === 0\n# prints fizzbuzz to terminal if above boolean is true\n puts 'fizzbuzz'\n# else if boolean range operator modulo num_1 argument is 0 results in string printing to terminal\n elsif i % num_1 === 0\n# prints fizz to terminals\n puts 'fizz'\n# else if boolean range value modulo num_2 argument is 0 prints string to terminal\n elsif i % num_2 === 0\n# prints buzz to terminal\n puts 'buzz'\n# if all above booleans fail\n else\n# puts range value\n puts i\n end\n end\nend",
"def fizzBuzz\n array = [*1..100]\n array.each { |num|\n if ((num % 3) == 0) && ((num % 5) == 0)\n puts \"FizBuzz\"\n elsif num % 5 == 0\n puts \"Buzz\"\n elsif num % 3 == 0\n puts \"Fizz\"\n else \n puts num\n end\n }\nend",
"def fizz_buzz num \n counter = 1\n until counter > num \n if (counter % 3) == 0 && (counter % 5) == 0 \n puts \"FizzBuzz #{counter}\"\n elsif (counter % 3) == 0 \n puts \"Fizz #{counter}\"\n elsif (counter % 5) == 0\n puts \"Buzz #{counter}\"\n end\n counter += 1\n end\nend",
"def fizzbuzz_group(number)\n if number % 3 == 0 && number % 5 == 0\n \"FizzBuzz\"\n elsif number % 3 == 0\n \"Fizz\"\n elsif number % 5 == 0\n \"Buzz\"\n end\nend",
"def super_fizz(number)\n(0..1000).each do |number|\ndivisible_by_3 = number % 3\ndivisible_by_5 = number % 5\ndivisible_by_7 = number % 7\nif divisible_by_3 == 0\n if divisible_by_5 == 0\n if divisible_by_7 == 0\n puts \"SuperFizzBuzz\"\n else\n puts \"FizzBuzz\"\n end\n elsif divisible_by_7 == 0\n puts \"SuperFizz\"\n else\n puts \"Fizz\"\n end\nelsif divisible_by_5 == 0\n if divisible_by_7 == 0\n puts \"SuperBuzz\"\n else\n puts \"Buzz\"\n end\nelsif divisible_by_7 == 0\n puts \"Super\"\nelse\n puts number\nend\nend\nend",
"def determine_fizz_buzz (num)\n if num % 3 == 0 and num % 5 == 0 and num != 0\n puts \"#{num} is FIZZ BUZZ\"\n elsif num % 5 == 0 and num != 0\n puts \"#{num} is BUZZ\"\n elsif num % 3 == 0 and num != 0\n puts \"#{num} is FIZZ\"\n else\n puts \"#{num} is boring...\"\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n# iteration on the range of values from 1 to the end of the range for the given input.\n (1..range).each do |i|\n# creating a happy path where the given value divided by num 1 and num 2 returns a remainder of 0 in *both* cases\n if i % num_1 === 0 && i % num_2 === 0\n# puts \"fizzbuzz\" into the console, pretty straightforward\n puts 'fizzbuzz'\n# another path, covering if the value divided by num_1 returns a remainder of 0, but the value divided by num_2 does not\n elsif i % num_1 === 0\n# puts \"fizz\" into the console\n puts 'fizz'\n# another path, covering if the value divided by num_2 returns a remainder of 0, but the value divided by num_1 does not\n elsif i % num_2 === 0\n# puts \"buzz\" into the console\n puts 'buzz'\n# final path, covering if the value divided by num_1 or num_2 doeesn't return a non-zero remainder in either case. also a catch-all for some odd inputs\n else\n# puts the current integer into the console\n puts i\n# ends our if/else paths\n end\n# ends our iteration of the range of values\n end\n# ends our function\nend",
"def fizzbuzz(num_1, num_2, range)\n# Defines a method that will test pass each of a range of integers to the if-statement.\n (1..range).each do |i|\n # Sets the condition to act on an integer if the it's multiple of num_1 and num_2.\n if i % num_1 === 0 && i % num_2 === 0\n # Prints string if the conditions are met.\n puts 'fizzbuzz'\n # Sets the condition to act on integer if it's a multiple of num_1\n elsif i % num_1 === 0\n # Prints string if the condition is met.\n puts 'fizz'\n # Sets the condition to act on integer if it's a multiple of num_2\n elsif i % num_2 === 0\n # Prints string if the condition is met.\n puts 'buzz'\n # Sets the condition if none of the previous conditions are met.\n else\n # Prints the integer from the range\n puts i\n # Closes if-statment\n end\n # Closes each method\n end\n# Closes method\nend",
"def fizz_buzz\n (1..100).each do |n|\n if is_div(n, 15)\n puts \"FIZZBUZZ\"\n elsif is_div(n, 3)\n puts \"FIZZ\"\n elsif is_div(n, 5)\n puts \"BUZZ\"\n else\n puts n\n end\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n # Declare a function that does the following for each argument (i) beginning at 1 and ending at\n # the range:\n (1..range).each do |i|\n # If the value of i divided by num_1 is an integer AND the value of i divided\n # by num_2 is also an integer, print the value 'fizzbizz' on the next line\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n # If the value of i divided by num_1 is an integer, print 'fizz' on the next line\n elsif i % num_1 === 0\n puts 'fizz'\n # If the value of i divided by num_2 is an integer, print 'buzz' on the next line\n elsif i % num_2 === 0\n puts 'buzz'\n # If none of the above conditions are met, print the value of i on the next line.\n else\n puts i\n end\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n #This is a for loop that loops from 1 to the given range argument.\n (1..range).each do |i|\n #This is an if statement which sees if both the remainder of i / num_1 is equal to 0 and if the remainder of 1 / num_2 is equal to 0\n if i % num_1 === 0 && i % num_2 === 0\n #If the above if statement is true then it will print 'fizzbuzz'\n puts 'fizzbuzz'\n #This is a continuation of the if statement where if only the remainder of i / num_1 is equal to 0 it will run\n elsif i % num_1 === 0\n #If the above if elsif statement is true then it will print 'fizz'\n puts 'fizz'\n #This is another continuation of the if statement in which if only the remainder of i / num_2 is equal to 0 it will run\n elsif i % num_2 === 0\n #If the above elsif statement is true it will print 'buzz'\n puts 'buzz'\n #If none of the above statements are true this will run\n else\n #If the else is fulfilled this will print i\n puts i\n end\n end\nend",
"def fizz(number)\t\t\t\t# creates fizz function had number argument\n\tfor\ti in 1..number\t\t\t# for loop i is the current value runs from 1 to 100 the agrument\n if i % 5 == 0 and i % 3 == 0 # if the current number is both divisible by 3\n puts \"FizzBuzz\"\t\t\t# prints FizzBuzz\n elsif i % 5 == 0\t\t\t# else if the current number is divisible by 5\n puts \"Buzz\"\t\t\t\t# prints Buzz\n elsif i % 3 == 0\t\t\t# esle if the current number is divisible by 3\n puts \"Fizz\"\t\t\t\t# prints Fizz\n else\t\t\t\t\t\t# else if none of the above conditions exist\n puts i\t\t\t\t\t# print the current number\n end\t\t\t\t\t\t# ends if\n end\t\t\t\t\t\t# ends \n end",
"def fizzbuzz(start_number, end_number)\n (start_number..end_number).each do |number|\n if number % 15 == 0 \n puts \"FizzBuzz\"\n elsif number % 5 == 0\n puts \"Buzz\"\n elsif number % 3 == 0\n puts \"Fizz\"\n else\n puts number\n end \n end\nend",
"def fizzbuzz(int)\n if int % 3 == 0 && int % 5 == 0 \n \"FizzBuzz\"\n \n elsif int % 5 == 0 # if the number int is divisible by 5\n \"Buzz\"\n \n # if number is divisible by 3 and 5 print \"FizzBuzz\"\n \n elsif int % 3 == 0 # if the number int is divisible by 3\n \"Fizz\"\n \n end\n end",
"def fizzbuzz(number)\n\n if number % 5 == 0 && number % 3 == 0\n \t\"FizzBuzz\"\n elsif number % 5 == 0\n \t\"Buzz\"\n elsif number % 3 == 0\n \t\"Fizz\"\n else\n \tnumber\n end\nend",
"def fizzbuzz(number)\nif (number%3==0) && (number%5==0)\n \"FizzBuzz\"\nelsif (number%3)==0\n \"Fizz\"\nelsif (number%5)==0\n \"Buzz\"\nelse\n nil\nend\nend",
"def fizzbuzz(num1,num2)\n for i in num1..num2 do\n if i%15 == 0\n puts \"FizzBuzz\"\n elsif i%3 == 0\n puts \"Fizz\"\n elsif i%5 == 0\n puts \"Buzz\"\n else\n puts i\n end\n end\nend",
"def fizzbuzz(num)\n test_3 = num % 3\n test_5 = num % 5\n \n if test_3 == 0 && test_5 == 0\n \"FizzBuzz\"\n elsif test_3 == 0 && test_5 != 0\n \"Fizz\"\n elsif test_3 != 0 && test_5 == 0\n \"Buzz\"\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n # for...in loop executes through the range with <1> beginning and the function argument <range> ending.\n (1..range).each do |i|\n # if local variable <i> modulo, fuction argument <num_1> === 0 and <i> modulo function argument <num_2> === 0, returns <true> the code beneath executes.\n if i % num_1 === 0 && i % num_2 === 0\n # prints the string 'fizzbuzz' to the terminal\n puts 'fizzbuzz'\n # if the if condition returned false, then the conditional statement: <i> modulo <num_1> === 0, is evaluated. If it returns <true> the code beneath executes.\n elsif i % num_1 === 0\n # prints the string 'fizz' to the terminal if the conditional statement above returns <true>.\n puts 'fizz'\n # if and eslif above return <false>: the conditional statement: <i> modulo <num_2> === 0, is evaluated. If <true> then the code beneath executes.\n elsif i % num_2 === 0\n # prints the string 'buzz' to the terminal if the conditional statement above returns <true>.\n puts 'buzz'\n # if none of the other conditional statements return <true> the code beneath <else> executes.\n else\n # prints the local variable <i> to the terminal.\n puts i\n # ends the if statement block\n end\n # ends the for...in loop\n end\n # ends the <fizzbuzz> function\nend",
"def fizzbuzz(num_1, num_2, range)\n #set range of numbers for fizzbuzz\n (1..range).each do |i|\n #set initial condition\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n #set alternate condition\n elsif i % num_1 === 0\n puts 'fizz'\n #set alternate condition\n elsif i % num_2 === 0\n puts 'buzz'\n #set else condition\n else\n puts i\n #close if-statement\n end\n #close .each method\n end\n#close fizzbuzz\nend",
"def fizzbuzz_without_modulo\n ints = []\n for i in 1..50\n ints.push(i)\n end\n\n (1..100).each do |x|\n if ints.include?(x/5.0)\n puts(ints.include?(x/3.0) ? 'fizzbuzz' : 'fizz')\n else\n puts(ints.include?(x/3.0) ? 'buzz' : x)\n end\n end\nend",
"def fizzbuzz(number)\n\t\n\tif number % 3 == 0 && number % 5 == 0\n\t\tputs \"FizzBuzz\"\n\n\telsif number % 3 == 0\n\t\tputs \"Fizz\"\n\t\n\telsif number % 5 == 0\n\t\tputs \"Buzz\"\n\n\telse \n\t\tputs number\n\tend\n\nend",
"def fizz_buzz(i)\nif i % 3 == 0 && i % 5 == 0\n\t\"fizzbuzz\"\nelsif i % 3 == 0 \n\t \"fizz\"\nelsif i % 5 == 0\n \"buzz\"\nelse\n\t i \n end\nend",
"def fizzbuzz(number)\n if number % 3 == 0 && number % 5 == 0\n puts \"FizzBuzz\"\n elsif number % 3 == 0\n puts \"Fizz\"\n \"FizzBuzz\"\n elsif number % 5 == 0\n puts \"Buzz\"\n # originally had `else puts number`. \n # removed because this isn't in instructions.\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n# looping through the code block using iteration.\n (1..range).each do |i|\n# If left hand operand i devided by right hand operand num_1 is equal to 0 and left hand operand i devided by right hand operand num_2 is equal to 0 then print fizzbuzz\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n# If not the first if check left hand operand i devided by right hand operand num_1 is equal to 0 if so print fizz.\n elsif i % num_1 === 0\n puts 'fizz'\n# If not the first if or first elsif check left hand operand i devided by right hand operand num_2 is equal to 0 if so print buzz. \n elsif i % num_2 === 0\n puts 'buzz'\n# If non of the above print i\n else\n puts i\n# End block of code\n end\n end\nend",
"def fizz_buzz number \n # for i in number\n # \tif i%3 == 0 \n # \t\treturn \"fiz\"\n # \telsif i%5 == 0\n # \t\treturn \"buzz\"\n # \tend \n # end\n\n if ((number % 3 == 0) && (number % 5 == 0))\n \treturn \"FizzBuzz\"\n elsif (number % 3 == 0)\n \treturn \"Fizz\"\n elsif (number % 5 == 0)\n \treturn \"Buzz\"\n else \n \treturn number\n end\nend",
"def fizzbuzz(number)\n if number.modulo(3).zero? and number.modulo(5).zero?\n \"FizzBuzz\"\n elsif number.modulo(5).zero?\n \"Buzz\"\n elsif number.modulo(3).zero?\n \"Fizz\"\n else\n phrase = nil\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n#Loop through the method using the integers 1 through the range value presented in the argument.\n (1..range).each do |i|\n#If both the modulo if integer and num_1 and integer and num_2 are equal to 0, the string fizzbuzz is returned.\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n#If only the modolo of integer and num_1 is equal to 0, the string fizz is returned.\n elsif i % num_1 === 0\n puts 'fizz'\n#If only the modulo of i and num_2 is equal to 0, the string buzz is returned.\n elsif i % num_2 === 0\n puts 'buzz'\n#If nothing equals 0, put the integer\n else\n puts i\n end\n end\nend",
"def fizzbuzz(num)\n if num % 3 == 0\n return \"fizz\"\n elsif num % 5 == 0\n return \"buzz\"\n elsif num % 3 ==0 && num % 5 == 0\n return \"fizzbuzz\"\n else\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n # Execute the code for each element in the collection (in this case, a range of numbers)\n (1..range).each do |i|\n # if i mod num_1 is zero (i.e. there isn't a remainder when you divide i by num_1) AND i mod num_2 is zero, then execute the code\n if i % num_1 === 0 && i % num_2 === 0\n # outputs string\n puts 'fizzbuzz'\n # Else if i mod num_1 is zero, then execute the code\n elsif i % num_1 === 0\n # outputs a string\n puts 'fizz'\n # Else if i mod num_2 is zero, then execute the code\n elsif i % num_2 === 0\n # outputs a string\n puts 'buzz'\n # If none of the above are true, then execute the code\n else\n # outputs a variable\n puts i\n # end the conditional arguments\n end\n # end the iteration\n end\n# end the method definition\nend",
"def fizzbuzz(num_1, num_2, range) # Create class method called 'fizzbuzz'\n (1..range).each do |i| # Iterate process for each item in a range\n if i % num_1 === 0 && i % num_2 === 0 # If statement - Modulus: Divides left hand operand by right hand operand and returns remainder. === tests equality\n puts 'fizzbuzz' # Prints fizzbuzz\n elsif i % num_1 === 0 # Elsif statement - Modulus of integer and num_1\n puts 'fizz' # Prints fizzbuzz\n elsif i % num_2 === 0 # Elsif statement - Modulus of integer and num_2\n puts 'buzz' # Prints buzz\n else # For anthing else\n puts i # Print the integer\n end\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n #iterates over the parameters of fizzbuzz\n (1..range).each do |i|\n #if the number i's remainder after dividing into num_1 is equal to 0 & i's remainder after dividing by num_2 is also 0 is true\n if i % num_1 === 0 && i % num_2 === 0\n #print fizzbuzz\n puts 'fizzbuzz'\n #if i's remainder from dividing into num_1 equals 0 is true\n elsif i % num_1 === 0\n #print fizz\n puts 'fizz'\n #if i's remainder from dividing into num_2 equals 0 is true\n elsif i % num_2 === 0\n #print buzz\n puts 'buzz'\n #if none of the above conditions are true, then\n else\n #print i\n puts i\n #closes if/else statements\n end\n #closes iteration\n end\n# closes fizzbuzz method\nend",
"def fizzbuzz(num)\n if num%3 == 0\n print \"Fizz\"\n elsif num%5 == 0\n print \"Buzz\"\n else\n puts num\nend",
"def fizzbuzz(number)\n #if the number is divisible by both 3 and 5\n if number % 3 == 0 && number % 5 == 0\n \"FizzBuzz\"\n #else div by only 3\n elsif number % 3 == 0\n \"Fizz\"\n #else div by only 5\n elsif number % 5 == 0\n \"Buzz\"\n #else nil\n end\nend",
"def fizzbuzz(start_num, end_num)\n start_num.upto(end_num) do |num|\n if num % 15 == 0\n print \"FizzBuzz \"\n elsif num % 5 == 0\n print \"Buzz \"\n elsif num % 3 == 0\n print \"Fizz \"\n else\n print \"#{num.to_i} \"\n end\n end\nend",
"def fizzbuzz(fiz_3)\n if fiz_3 % 3 == 0 && fiz_3 % 5 == 0 \n return \"FizzBuzz\"\n end \n \n if fiz_3 % 3 == 0 \n return \"Fizz\"\n end\n \n if fiz_3 % 5 == 0 \n return \"Buzz\"\n end\nend",
"def fizzbuzz(num_1, num_2, range)\n #sets up a counter starting at 1 ending in a defined range\n #and loops through the conditions until the full range is iterated\n (1..range).each do |i|\n #checks if i is divisible by both num_1 and num_2\n if i % num_1 === 0 && i % num_2 === 0\n #prints fizzbuzz if true\n puts 'fizzbuzz'\n #checks if i is divisible only by num_1\n elsif i % num_1 === 0\n #prints fizz if true\n puts 'fizz'\n #checks if i is divisible only by num_2\n elsif i % num_2 === 0\n #prints buzz if true\n puts 'buzz'\n #creates a condition that encompasses any other inputs\n else\n #prints i if true\n puts i\n #end of conditionals\n end\n #end of loop\n end\n#end of method\nend",
"def fizzbuzz(num)\n i = 0;\n num.times do\n i += 1\n # Check to see if num is a multiple of 3 but not 5\n if (i % 3 == 0 && i % 5 != 0)\n p \"Fizz\"\n # Check to see if num is a multiple of 5 but not 3\n elsif (i % 5 == 0 && i % 3 != 0)\n p \"Buzz\"\n # Check to see if num is a multiple of 3 and 5\n elsif (i % 5 == 0 && i % 3 == 0)\n p \"FizzBuzz\"\n else\n p i\n end\n end\nend",
"def fizzbuzz(x)\n if x % 3== 0 && x % 5== 0\n \"FizzBuzz\"\n \n elsif x % 3 == 0 \n \"Fizz\"\n elsif x % 5 == 0\n \"Buzz\"\n else\n end\nend",
"def fizzbuzz(num)\nif (num % 3 == 0)\n return \"Fizz\"\n elsif ((num % 3 == \"Fizz\") && (num % 5 == \"Buzz\"))\n return \"FizzBuzz\"\n elsif (num % 5 == 0)\n return \"Buzz\"\n else (num /15 == 0)\n \"FizzBuzz\"\n \nend\n return nil\nend",
"def fizzbuzz(num)\n num3 = num % 3\n num5 = num % 5\n if num3 + num5 == 0 \n return \"FizzBuzz\"\n elsif num3 == 0\n return \"Fizz\"\n elsif num5 == 0 \n return \"Buzz\"\n end\nend",
"def fizzbuzz(num)\n if num % 3 == 0 && num % 5 == 0\n \"FizzBuzz\"\n elsif num % 3 == 0\n \"Fizz\"\n elsif num % 5 == 0\n \"Buzz\"\n else\n num\n end\nend",
"def fizzbuzz(num)\n if num % 3 == 0 && num % 5 == 0\n \"FizzBuzz\"\n elsif num % 3 == 0\n \"Fizz\"\n elsif num % 5 == 0\n \"Buzz\"\n else\n num\n end\nend",
"def fizzbuzz(num)\n if num % 3 == 0 && num % 5 == 0\n \"FizzBuzz\"\n elsif num % 3 == 0\n \"Fizz\"\n elsif num % 5 == 0\n \"Buzz\"\n else\n num\n end\nend",
"def fizzbuzz(num)\n if num % 3 == 0 && num % 5 == 0\n \"FizzBuzz\"\n elsif num % 3 == 0\n \"Fizz\"\n elsif num % 5 == 0\n \"Buzz\"\n else\n num\n end\nend",
"def fizzbuzz(num)\n if num % 3 == 0 && num % 5 == 0\n \"FizzBuzz\"\n elsif num % 3 == 0\n \"Fizz\"\n elsif num % 5 == 0\n \"Buzz\"\n else\n num\n end\nend",
"def fizzbuzz(num)\n if num % 3 == 0 && num % 5 == 0\n \"FizzBuzz\"\n elsif num % 3 == 0\n \"Fizz\"\n elsif num % 5 == 0\n \"Buzz\"\n else\n num\n end\nend"
] | [
"0.8684358",
"0.8621742",
"0.86174226",
"0.85953134",
"0.85786533",
"0.8488763",
"0.84774846",
"0.8477323",
"0.84768677",
"0.8475961",
"0.84548813",
"0.84440327",
"0.8442429",
"0.8436295",
"0.84282774",
"0.8427708",
"0.8423755",
"0.8408999",
"0.84083796",
"0.83991957",
"0.83922184",
"0.838542",
"0.83838063",
"0.8383173",
"0.83652025",
"0.83554155",
"0.8351717",
"0.83514434",
"0.8349346",
"0.83464116",
"0.8346114",
"0.8339379",
"0.8334104",
"0.8332762",
"0.83302414",
"0.831595",
"0.8305968",
"0.82964396",
"0.82939345",
"0.82921934",
"0.82916176",
"0.8291615",
"0.8285987",
"0.8285459",
"0.8281563",
"0.82759565",
"0.82716286",
"0.8265153",
"0.8261753",
"0.82576007",
"0.82417405",
"0.82323515",
"0.8231029",
"0.82291913",
"0.82276785",
"0.8226712",
"0.82089025",
"0.8206663",
"0.8201502",
"0.81990296",
"0.8196008",
"0.81957185",
"0.8195128",
"0.81844735",
"0.8182709",
"0.8181201",
"0.8167782",
"0.816572",
"0.8161309",
"0.8157613",
"0.81570303",
"0.81554574",
"0.8149765",
"0.81437063",
"0.81413484",
"0.81407577",
"0.813984",
"0.81393",
"0.8135995",
"0.81280875",
"0.81250304",
"0.812058",
"0.81162506",
"0.81152785",
"0.8113053",
"0.8109687",
"0.8109651",
"0.8109469",
"0.810704",
"0.81038237",
"0.8102767",
"0.8101653",
"0.8089536",
"0.80891323",
"0.8088515",
"0.8088515",
"0.8088515",
"0.8088515",
"0.8088515",
"0.8088515"
] | 0.8213768 | 56 |
Accpets lat/lon coordinates and returns detailed political information. | def initialize coordinates
if coordinates.is_a?(Array)
@coordinates = ActiveSupport::JSON.encode(coordinates.map!{|a|CGI::escape(a)}) if coordinates.is_a?(Array)
elsif coordinates.is_a?(String)
@coordinates = CGI::escape(coordinates)
elsif coordinates.is_a?(Hash)
coordinates = sanitize(coordinates)
@coordinates = ActiveSupport::JSON.encode(coordinates.map!{|a| a.map!{|b| CGI::escape(b)}}) if coordinates.is_a?(Array)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def location\n if [latitude, longitude].all?(&:present?)\n [latitude, longitude]\n end\n end",
"def show\n positive = Positive.find(params[:id])\n @longlat = positive.lonlat\n\n @latlong= positive.lonlat\n\n end",
"def latlon\r\n [latitude,longitude]\r\n end",
"def latlon\r\n [latitude,longitude]\r\n end",
"def latlon\r\n [latitude,longitude]\r\n end",
"def load_precise_info\n @coordinates = @location[:coordinates] unless @location[:coordinates].nil?\n return if @location[:formattedAddress].nil?\n @formatted_address = @location[:formattedAddress]\n end",
"def assign_lon_lat_locator_fields\n box = getBoxForCoordinates( view_path_coordinates[\"LonLat\"] )\n self.nw_lon= box[0][0]\n self.nw_lat= box[0][1]\n self.se_lon= box[1][0]\n self.se_lat= box[1][1]\n end",
"def geo; end",
"def latlng\n [lat, lon]\n end",
"def get_coord\n @single_city_data['coord']\n end",
"def extract_geolocation\n img_lat = get_exif('GPSLatitude')[0][1].split(', ') rescue nil\n img_lng = get_exif('GPSLongitude')[0][1].split(', ') rescue nil\n lat_ref = get_exif('GPSLatitudeRef')[0][1] rescue nil\n lng_ref = get_exif('GPSLongitudeRef')[0][1] rescue nil\n return unless img_lat && img_lng && lat_ref && lng_ref \n latitude = to_frac(img_lat[0]) + (to_frac(img_lat[1])/60) + (to_frac(img_lat[2])/3600)\n longitude = to_frac(img_lng[0]) + (to_frac(img_lng[1])/60) + (to_frac(img_lng[2])/3600) \n latitude = latitude * -1 if lat_ref == 'S' # (N is +, S is -)\n longitude = longitude * -1 if lng_ref == 'W' # (W is -, E is +) \n self.latitude = latitude\n self.longitude = longitude\n end",
"def lonlat\r\n [longitude,latitude]\r\n end",
"def lonlat\r\n [longitude,latitude]\r\n end",
"def display_coordinates\n puts 'persons'\n @all_persons.each do |person|\n puts \"X: #{person.get_x_location} \\nY: #{person.get_y_location}\\n\"\n end\n puts 'MONSTERS'\n @all_monsters.each do |monster|\n puts \"X: #{monster.get_x_location} \\nY: #{monster.get_y_location}\\n\"\n end\n puts 'STRAWBERRIES'\n @all_strawberries.each do |strawberry|\n puts \"X: #{strawberry.get_x_location} \\nY: #{strawberry.get_y_location}\\n\"\n end\n puts 'MUSHROOMS'\n @all_mushrooms.each do |mushroom|\n puts \"X: #{mushroom.get_x_location} \\nY: #{mushroom.get_y_location}\\n\"\n end\n end",
"def compute_position\n # The negative and the ninety are the fudge to compensate for our map.\n lat = @latitude_radians = radians(-@latitude)\n long = @longitude_radians = radians(@longitude + 90)\n radius = $app.globe.diameter / 2.0 - 23\n @x = radius * cos(lat) * sin(long)\n @y = radius * sin(lat)\n @z = radius * cos(lat) * cos(long)\n end",
"def lat_lon\n [lat, lon]\n end",
"def get_longitude\n get_coord['lon']\n end",
"def coordinates\n [latitude, longitude]\n end",
"def constituency_loc_real(constituency)\n begin\n # Use the TWFY API to get the data\n location = TWFY_CLIENT.geometry name: constituency\n {lat: location.centre_lat, lng: location.centre_lon}\n rescue\n # Return (0,0) in case of failure\n {lat: 0, lng: 0}\n end\nend",
"def construct_coordinates\n construct_latitude\n construct_longitude\n end",
"def geo_location\n begin\n # Get Comma seperated coordinates and return as hash\n coordinates = @result[\"ipLocation\"][\"pointProperty\"][\"Point\"][\"coordinates\"].split(',')\n return { long: coordinates[0], lat: coordinates[1] }\n rescue \n raise \"geo location unknown\"\n end\n end",
"def get_info(lat, lon)\n Net::HTTP.get(URI(\"https://api.3geonames.org/#{lat},#{lon}.json\"))\nend",
"def longitude; end",
"def coordquery(p)\r\nend",
"def locate(latitude,longitude)\n get escape(\"lat=#{latitude}&lon=#{longitude}\")\n end",
"def get_coordinates\n if self.country_status == 'closed'\n self.latitude = nil\n self.longitude = nil\n else\n q = self.city || ''\n q += ','+self.state if self.state\n q += ','+self.country\n begin\n self.latitude, self.longitude = Geocoder.coordinates(q)\n # We need to make sure that that no 2 projects have exactly the same\n # coordinates. If they do, they will overlap on the flash map and\n # you won't be able to click on one of them.\n while SpProject.where(['latitude = ? and longitude = ?', self.latitude, self.longitude]).first\n delta_longitude, delta_latitude = 0,0\n delta_longitude = rand(6) - 3 while delta_longitude.abs < 2\n delta_latitude = rand(6) - 3 while delta_latitude.abs < 2\n # move it over a little.\n self.longitude += delta_longitude.to_f/10\n self.latitude += delta_latitude.to_f/10\n end\n rescue => e\n Airbrake.notify_or_ignore(e, :parameters => attributes)\n end\n end\n true\n end",
"def longitude\n end",
"def by_location latitude, longitude\n begin\n self.by_location! latitude, longitude\n rescue Exception \n nil\n end\n\n end",
"def point\n x = []\n y = []\n case geometry.type\n when 'MultiPolygon'\n coordinates.each { |list| append_list list, x, y }\n when 'LineString'\n append coordinates, x, y\n when 'Point'\n x << coordinates.first\n y << coordinates.last\n else\n append_list coordinates, x, y\n end\n lon = x.reduce(&:+) / x.size\n lat = y.reduce(&:+) / y.size\n [lon.round(7), lat.round(7)]\n end",
"def coordinates\n \"#{longitude},#{latitude}\"\n end",
"def calculate lon, lat\n _lon_idx = (lon - @radar_lon) * 118.206320981112 * @scaling\n _lat_idx = (@radar_lat - lat) * 138.888888888889 * @scaling\n [_lon_idx, _lat_idx]\n end",
"def lon\n @location.longitude\n end",
"def coordinates?(latitude, longitude)\n coordinate?(latitude) && coordinate?(longitude)\n end",
"def coordinates_for(x, y)\n build_request do |xml|\n xml.PixToLL {\n xml.PointCollection {\n xml.X x\n xml.Y y\n }\n set_map_state xml\n set_display_state xml\n authenticate xml\n }\n end\n \n remote_call(:map)\n \n coll = @response['PixToLLResponse']['LatLngCollection']\n \n {:latitude => coll['Lat'].to_i / 1000000.0, :longitude => coll['Lng'].to_i / 1000000.0}\n end",
"def geolocalization\n output = \"\".html_safe\n if question && question.position\n output << hidden_field_tag(\"question[position][lat]\", question.position[\"lat\"], :class => \"lat_input\")\n output << hidden_field_tag(\"question[position][long]\", question.position[\"long\"], :class => \"long_input\")\n end\n output\n end",
"def loc\r\n { x: @mapx,\r\n y: @mapy }\r\n end",
"def as_leaflet\n {\n lon: lon,\n lat: lat\n }.as_json\n end",
"def location\n [lat.to_f / 100_000, lng.to_f / 100_000]\n end",
"def locations_within_locus(latitude, longitude, radius)\n uri_params = { lat: latitude, lon: longitude, radius: radius }\n @client.get('/BikePoint', uri_params)\n end",
"def get_lots_coordinates\n xml = get_lots\n coords = xml.xpath '/ArrayOflot/lot/latitude | /ArrayOflot/lot/longitude'\n coords.each_slice(2).to_a.map { |p| [p[0].text, p[1].text] }\n end",
"def gps_api_fetch(latitude, longitude)\n \n HTTParty.get(\"https://api.openweathermap.org/data/2.5/weather?lat=#{latitude}&lon=#{longitude}&APPID=#{APPID}&units=imperial\")\n end",
"def geolocate \n Zoogle.graveyard_locator(self.graveyard)\n \"#{loc[:latitude]}, #{loc[:longitude]}\"\n end",
"def get_square(lat,lon)\n return [ ((lat * 100.0).round)/100.0,\n ((lon * 100.0).round)/100.0 ]\n \nend",
"def get_latitude\n get_coord['lat']\n end",
"def antipodal\n Location.new(:longitude => 180 - (longitude.abs),\n :latitude => -latitude )\n end",
"def get_coordinates\n checked_google_response do\n return parsed_response if raw\n parsed_response[\"results\"].inject([]) do |memo, result|\n memo << { \n :lat => result[\"geometry\"][\"location\"][\"lat\"], \n :lng => result[\"geometry\"][\"location\"][\"lng\"],\n :matched_address => result[\"formatted_address\"],\n :bounds => result[\"geometry\"][\"bounds\"],\n :full_data => result\n }\n end\n end\n end",
"def lon\r\n return @longitude\r\n end",
"def coordinate \n @coordinate\n end",
"def latitude; end",
"def location\n [@posX, @posY, @facing]\n end",
"def latitude\n end",
"def extract_coordinates(parsed)\n parsed['results'].first['geometry']['location']\nend",
"def show_prediction_by_latlong\n params = location_params\n @cur_date = {:date => Time.now.strftime(\"%d-%m-%Y\")}\n lat = params[:latitude].to_f\n lon = params[:longitude].to_f\n @coordinates = {:latitude => lat, :longitude => lon}\n @location = Location.find_closest_to(lat, lon)\n @predictions = DataHelper.predict(@location, params[:period])\n end",
"def get_plateau_coordinates\n @input = STDIN.gets.chomp.split\n\n #Prompt the user for input until valid coordinates are entered.\n while !valid_coordinates\n puts \"Incorrect upper right coordinates entered. Enter upper right coordinates:\"\n @input = STDIN.gets.chomp.split\n end\n\n @plateau = Plateau.new(input[0], input[1])\n end",
"def show\n @vet_profile = VetProfile.find(params[:id])\n @vetLat = @vet_profile.vetLat\n @vetLong = @vet_profile.vetLong\n if current_user\n user_profile = UserProfile.find(current_user.id)\n @userLat = user_profile.userLat\n @userLong = user_profile.userLong\n else\n @userLat = @vetLat\n @userLong = @vetLong\n end\n end",
"def get_area_details\n response = RestClient.get \"http://www.broadbandmap.gov/broadbandmap/census/block?latitude=#{self.location_lat}&longitude=#{self.location_lng}&format=json\"\n if response.code == 200\n response = JSON.parse(response)\n self.fips_block_type = response['Results']['block'][0]['geographyType']\n self.fips_state = response['Results']['block'][0]['FIPS'][0..1]\n self.fips_county = response['Results']['block'][0]['FIPS'][2..4]\n self.fips_tract = response['Results']['block'][0]['FIPS'][5..10]\n true\n end\n false\n end",
"def ll\n \"#{lat},#{lng}\"\n end",
"def ll\n \"#{lat},#{lng}\"\n end",
"def location_detail\n\t\t[self.city, self.state, self.country].compact.join(\", \")\n\tend",
"def accuracy\r\n Api.proj_coordoperation_get_accuracy(self.context, self)\r\n end",
"def show\n @coordinate = coordinate_for_current_user params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coordinate }\n end\n end",
"def query_location_lat_long\n loc = MultiGeocoder.geocode(location)\n [loc.lat, loc.lng]\n end",
"def _geoloc\n {\n 'lat' => location.try(:latitude) || '0.0',\n 'lng' => location.try(:longitude) || '0.0'\n }\n end",
"def _geoloc\n {\n 'lat' => location.try(:latitude) || '0.0',\n 'lng' => location.try(:longitude) || '0.0'\n }\n end",
"def resembles_latlng?\n !!coordinates\n end",
"def to_s # :nodoc:\n \"#{ self.lattitude },#{ self.longitude } #{ self.radius }\"\n end",
"def locations_within_proximity\n field.locations.where( x_coordinate: x_proximity,\n y_coordinate: y_proximity )\n end",
"def geo_location\n if loc = self.location\n res = GeoKit::GeoLoc.new(loc.geokit_attributes)\n res.success = !!(res.lat && res.lng)\n res\n end\n end",
"def location\n fetch('rick_and_morty.locations')\n end",
"def print_location\n\t\t@location.print_point\t\n\tend",
"def getlocation\r\n @myip = remote_ip()\r\n # based off freegeoip.net is really terrible\r\n result = Geocoder.search(@myip)\r\n @mylat = result.latitude\r\n @mylong = result.longitude\r\n @mycity = result.address\r\n #51.243048, -0.588458\r\n end",
"def tryWorldKit(location)\n url = getWorldKitURL(location)\n if url\n xml_data = Net::HTTP.get_response(URI.parse(url)).body\n doc = REXML::Document.new(xml_data)\n if doc.elements[\"*/geo:Point/geo:long\"]\n long = doc.elements[\"*/geo:Point/geo:long\"].text\n lat = doc.elements[\"*/geo:Point/geo:lat\"].text\n return [lat, long]\n else\n return nil\n end\n else\n return nil\n end\n end",
"def latlng_to_pixel_xy(lat,lng,level_of_detail)\n\n latitude = safe_val(lat,MIN_LATITUDE,MAX_LATITUDE)\n longitude = safe_val(lng,MIN_LONGITUDE,MAX_LONGITUDE)\n\n x = (longitude + 180 ) / 360 \n sin_latitude = sin( latitude * PI_PREC / 180, DECIMAL_PREC)\n y = 0.5 - log(1 + sin_latitude, DECIMAL_PREC) / (1 - sin_latitude ) / 4 * PI_PREC\n\n map_size_level = map_size(level_of_detail) \n pixel_x = safe_val(x * map_size_level + 0.5, 0, map_size_level - 1 )\n pixel_y = safe_val(y * map_size_level + 0.5, 0, map_size_level - 1 )\n\n [pixel_x,pixel_y]\n end",
"def check_coordinates(trace)\n coordinates = trace[:coordinates] || trace.coordinates\n\n coordinates.each do |c|\n lat = c[:latitude] || c.latitude\n long = c[:longitude] || c.longitude\n\n expect(lat).to be_a(Float)\n expect(long).to be_a(Float)\n end\n end",
"def getLocationContext( location_id, latitude, longitude, radius, resolution, country, num_results)\n params = Hash.new\n params['location_id'] = location_id\n params['latitude'] = latitude\n params['longitude'] = longitude\n params['radius'] = radius\n params['resolution'] = resolution\n params['country'] = country\n params['num_results'] = num_results\n return doCurl(\"get\",\"/location/context\",params)\n end",
"def get_lat_long(doc) \r\n\tscript1 = doc.css('body #container #content script')[1]\r\n\tlat_lon = /\"latitude\":\"(\\d+\\.\\d+)\",\"longitude\":\"(-\\d+\\.\\d+)\"/.match(script1.to_s)\r\n\t# puts \"lat is #{lat_lon[1]} long is #{lat_lon[2]} \"\r\n end",
"def show\n @dip = Dip.find(params[:id])\n @activity = Activity.find(@dip.activity_id)\n @location_type = LocationType.find(@dip.location_type_id)\n @user = current_user\n address = @user.address\n \n \n if address\n coordinates = Geocoder.coordinates(address)\n elsif request.remote_ip\n coordinates = Geocoder.coordinates(request.remote_ip)\n end\n\n # Default to Sunshine Coast if other location methods fail\n coordinates = [-26.6500669, 153.0666733] unless coordinates\n @locations = @dip.matching_locations(coordinates[0], coordinates[1]).shuffle[0...10]\n end",
"def test_lat_lon_format\n note = build(:note, :latitude => 0.00004 * GeoRecord::SCALE, :longitude => 0.00008 * GeoRecord::SCALE)\n\n assert_equal \"0.0000400\", note.lat.to_s\n assert_equal \"0.0000800\", note.lon.to_s\n end",
"def loc_geographic\n FACTORY.unproject(self.loc)\n end",
"def location\n b = []\n b << latitude\n b << longitude\n Geocoder.coordinates(b)\n end",
"def geo\n fetch('creature.bird.geo')\n end",
"def run_lookup(argv = ARGV)\n lng = argv[1].to_f\n lat = argv[2].to_f\n\n res = dstk.coordinates2politics([lat, lng])\n nbh = res[0]['politics'].select { |r| r['friendly_type'] == 'neighborhood'}\n puts \"#{lng},#{lat},#{nbh.first['name']}\"\n end",
"def show\n educacao = Educacao.find(params[:id])\n ponto = educacao.the_geom\n @latitude = ponto.x\n @longitude = ponto.y\n\n respond_to do |format|\n format.html\n format.json {render json: educacao}\n end\n end",
"def map_locs\n [location]\n end",
"def map_locs\n [location]\n end",
"def position_Calculate(lat, long)\n if lat >= 0 \n {\"tilt_angle\" => lat.abs().ceil(2), \"description\" => \"from North to be due south\"} \n else\n {\"tilt_angle\" => lat.abs().ceil(2), \"description\" => \"from South to be due North\"}\n end\n end",
"def lon\n @position[1]\n end",
"def index\n\t\trender text: \"Cannot show nearby locations without a lat and lon.\", status: :bad_request and return unless params[\"lat\"] && params[\"lon\"]\n\t\tlat = Location.convert_lat_or_lon_to_d(params[\"lat\"])\n\t\tlon = Location.convert_lat_or_lon_to_d(params[\"lon\"])\n\t\tputs \"LAT:#{lat}\", \"LON:#{lon}\"\n\n\t\tangular_radius = @@DISTANCE / @@EARTH_RADIUS\n\t\tlat_min = lat - angular_radius\n\t\tlat_max = lat + angular_radius\n\t\tputs \"LAT_MAX:#{lat_max}\", \"LAT_MIN:#{lat_min}\"\n\n\t\tdelta_lon = Math.asin(Math.sin(angular_radius) / Math.cos(lat))\n\t\tlon_min = lon - delta_lon\n\t\tlon_max = lon + delta_lon\n\t\tputs \"LON_MAX:#{lon_max}\", \"LON_MIN:#{lat_min}\"\n\n\t\tlocations = nil\n\t\tif params[\"food\"]\n\t\t\tlocations = Location.joins({ vehicles: { vendor: :foods}})\n\t\t\t\t\t\t\t.where(\"foods.name ilike ? OR foods.name ilike '%everything%'\", \"%#{params['food']}%\").where(\"status = 'APPROVED'\")\n\t\t\t\t\t\t\t.where(\"lat BETWEEN ? AND ?\", lat_min, lat_max).where(\"lon BETWEEN ? AND ?\", lon_min, lon_max)\n\t\t\t\t\t\t\t.where(\"acos(sin(?) * sin(lat) + cos(?) * cos(lat) * cos(lon - ?)) <= ?\", lat, lat, lon, angular_radius)\n\t\t\t\t\t\t\t# formula distance = arccos(sin(lat1) · sin(lat2) + cos(lat1) · cos(lat2) · cos(lon1 - lon2)) * earth_radius\n\t\t\t\t\t\t\t# doesn't take into account poles or the 180th Meridian\n\t\telse\n\t\t\tlocations = Location.joins(:vehicles).where(\"status = 'APPROVED'\")\n\t\t\t\t\t\t\t.where(\"lat BETWEEN ? AND ?\", lat_min, lat_max).where(\"lon BETWEEN ? AND ?\", lon_min, lon_max)\n\t\t\t\t\t\t\t.where(\"acos(sin(?) * sin(lat) + cos(?) * cos(lat) * cos(lon - ?)) <= ?\", lat, lat, lon, angular_radius)\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: locations }\n\t\t\tformat.html { render :nothing }\n\t\tend\n\tend",
"def extract_latlng(params)\n lat = params.delete('pio_latitude')\n lng = params.delete('pio_longitude')\n params['pio_latlng'] = \"#{lat},#{lng}\" if lat && lng\n return params['pio_latlng']\n end",
"def get_location\n @lat, @lng = request.location.try(:latitude), request.location.try(:longitude) \n end",
"def coordinates\n raw_coords = multivalue_field('coordinates_ssim')\n coords = []\n raw_coords.each do |raw_coord|\n split_coord = raw_coord.split('|')\n coords << { :name => split_coord[0], :lat => split_coord[1], :lon => split_coord[2] }\n end\n coords\n end",
"def home\n @coordinates = Coordinate.where(\"user_id=?\",current_user.id)\n if @coordinates.empty?\n @centerLatitude = 6.199733\n @centerLongitude = -75.578686\n else\n @centerLatitude = @coordinates.last.latitude\n @centerLongitude = @coordinates.last.longitude\n end\n end",
"def lat_lon\n [latitude, longitude].join(',')\n end",
"def user_coordinates\n self.user_located? ? LocationCoordinate.new(self.userLocation.location.coordinate) : nil\n end",
"def degrees_to_meters(lon, lat)\n half_circumference = 20037508.34\n x = lon * half_circumference / 180\n y = Math.log(Math.tan((90 + lat) * Math::PI / 360)) / (Math::PI / 180)\n \n y = y * half_circumference / 180\n \n return [x, y]\nend",
"def coordinates\n return {latitude: self.latitude, longitude: self.longitude}\n end",
"def to_coordinates\n [latitude, longitude]\n end",
"def latitude\n coordinates[0];\n end",
"def geom_coords\n# self.geom.geometry_n(0).y.to_s + \" \" + self.geom.geometry_n(0).x.to_s\n \"\" + self.latitude.to_s + \" \" + self.longitude.to_s\n end",
"def test_lat_lon_xml_format\n tracepoint = build(:tracepoint, :latitude => 0.00004 * GeoRecord::SCALE, :longitude => 0.00008 * GeoRecord::SCALE)\n\n assert_match /lat=\"0.0000400\"/, tracepoint.to_xml_node.to_s\n assert_match /lon=\"0.0000800\"/, tracepoint.to_xml_node.to_s\n end",
"def geolocate(location)\n\t\tkey = \"f94d9fe40481b0a044edc8f729724335\"\n\t\tlocation = URI.escape(location, Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\"))\n\t\t# location = CGI.escape(location)\n\t\t# location = URI.escape(location)\n\t\thost = \"ondemand.metacarta.com\"\n\t\tpath = \"/webservices/GeoTagger/JSON/basic?version=1.0.0\"\n\t\tpath = \"#{path}&doc=#{location}\"\n\t\tdata = {}\n\t\tbegin\n\t\t\treq = Net::HTTP::Get.new(path)\n\t\t\treq.basic_auth SITE_METACARTA_USERID, SITE_METACARTA_PASSWORD\n\t\t\thttp = Net::HTTP.start(host)\n\t\t\t#if response.is_a?(Net::HTTPSuccess)\n\t\t\t\tresponse = http.request(req)\n\t\t\t\tdata = JSON.parse(response.body)\n\t\t\t#end\n\t\trescue Timeout::Error\n\t\t\t# DO SOMETHING WISER\n\t\t\treturn 0,0\n\t\trescue\n\t\t\treturn 0,0\n\t\tend\n\t\tbegin\n\t\t\tlat = data[\"Locations\"][0][\"Centroid\"][\"Latitude\"]\n\t\t\tlon = data[\"Locations\"][0][\"Centroid\"][\"Longitude\"]\n\t\t\treturn lat,lon\n\t\trescue\n\t\tend\n\t\treturn 0,0\n\tend"
] | [
"0.6227487",
"0.61855775",
"0.60524994",
"0.60524994",
"0.60524994",
"0.6035276",
"0.6013638",
"0.6001187",
"0.59712887",
"0.59503263",
"0.59459955",
"0.59372807",
"0.59372807",
"0.59322053",
"0.59092426",
"0.5907989",
"0.5904974",
"0.5878478",
"0.5877239",
"0.5876684",
"0.5875488",
"0.5872472",
"0.5850366",
"0.5847627",
"0.5808396",
"0.5783307",
"0.57746184",
"0.5704762",
"0.56705236",
"0.56502515",
"0.5641288",
"0.56397784",
"0.56249297",
"0.56231046",
"0.56211424",
"0.5620661",
"0.56167966",
"0.5609489",
"0.5599587",
"0.5599301",
"0.5587667",
"0.5564538",
"0.55594265",
"0.5547831",
"0.5543487",
"0.5530713",
"0.5472839",
"0.5446034",
"0.54448146",
"0.5431389",
"0.5429589",
"0.54182327",
"0.54057616",
"0.53906316",
"0.5364182",
"0.5359686",
"0.5356385",
"0.5356385",
"0.53562623",
"0.53557205",
"0.53486377",
"0.5344453",
"0.5339836",
"0.5339836",
"0.5338416",
"0.5332633",
"0.5328862",
"0.5322529",
"0.5316102",
"0.53130156",
"0.5311221",
"0.53110415",
"0.53083146",
"0.5307789",
"0.53039753",
"0.5302816",
"0.5297212",
"0.5286329",
"0.52810884",
"0.52787584",
"0.5278178",
"0.52765733",
"0.5273897",
"0.52733403",
"0.52733403",
"0.5270408",
"0.52701277",
"0.52543277",
"0.52501214",
"0.52433443",
"0.52424645",
"0.52418995",
"0.52382624",
"0.5238144",
"0.5237038",
"0.5232224",
"0.5228301",
"0.5228114",
"0.5227277",
"0.5224644",
"0.5220983"
] | 0.0 | -1 |
6h > 1/12 off 12h > 2/12 off 18h > 3/12 off 24h > 4/12 off | def flat_prices(hourly_price)
{
"6h" => {:duration => 6.hours, :price => "#{hourly_price*5.5}"},
"12h" => {:duration => 12.hours, :price => "#{hourly_price*10}"},
"18h" => {:duration => 18.hours, :price => "#{hourly_price*13.5}"},
"24h" => {:duration => 24.hours, :price => "#{hourly_price*16}"},
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def angl(hrs, mnts)\n 0.5 * (60 * hrs - 11 * mnts)\nend",
"def fuel_per_hour\n 10\n end",
"def cooking_time(eggs)\n (eggs.to_f / 8).ceil * 5\nend",
"def boil_off_gallons_per_hour\n 1.0\n end",
"def hours\n _nudge[0]\n end",
"def calc_raw_hours(job, task_name, effort)\n if $op_cyclo\n ## The cyclo can be used instead of cyclo, the relationship depends on the coding style, but\n ## a linear seems to hold\n hour = 6*job.cyclo()\n else\n hour = job.each_loc()\n end\n\n hour = hour/effort.to_f\n\n ## Adjust to each product/company coding style (flatness)\n hour = hour * $op_coding_style\n\n hour = 1.5 if hour < 1.5 # .5 hour work is the min for each file\n\n return hour\n end",
"def opening_hour\n 11\n end",
"def processing_times\n total = ab_output.match(/Total:\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)/)\n ninety = ab_output.match(/ 90%\\s+([0-9.]+)/)\n ninetyfive = ab_output.match(/ 95%\\s+([0-9.]+)/)\n [total[1], total[2], total[4], ninety[1], ninetyfive[1], total[5]]\n end",
"def load_showtimes\n available_times = {\n 10.45 => \"10:45am\", 11.00 => \"11:00am\", 11.15 => \"11:15am\", 11.30 => \"11:30am\",11.45 => \"11:45am\", 12.00 => \"12:00pm\", 12.15 => \"12:15pm\", 12.30 => \"12:30pm\", 12.45 => \"12:45pm\", \n 13.00 => \"1:00pm\", 13.15 => \"1:15pm\", 13.30 => \"1:30pm\",13.45 => \"1:45pm\",14.00 => \"2:00pm\",14.15 => \"2:15pm\",14.30 => \"2:30pm\", 14.45 => \"2:45pm\", 15.00 => \"3:00pm\",15.15 => \"3:15pm\",16.00 => \"4:00pm\", 16.15 => \"4:15pm\", 16.30 => \"4:30pm\", 16.45 => \"4:45pm\", 17.00 => \"5:00pm\",17.15 => \"5:15pm\", 17.30 => \"5:30pm\",17.45 => \"5:45pm\",18.00 => \"6:00pm\", 18.15 => \"6:15pm\", 18.30 => \"6:30pm\", 18.45 => \"6:45pm\", 19.00 => \"7:00pm\", 19.15 => \"7:15pm\", 19.30 => \"7:30pm\", 19.45 => \"7:45pm\", 20.00 => \"8:00pm\", 20.15 => \"8:15pm\", 20.30 => \"8:30pm\", 20.45 => \"8:45pm\", 21.00 => \"9:00pm\", 21.15 => \"9:15pm\", 21.30 => \"9:30pm\", \n 22.00 => \"10:00pm\", 22.15 => \"10:15pm\", 22.30 => \"10:30pm\", 22.45 => \"10:45pm\", 23.00=> \"11:00pm\", 23.15 => \"11:15pm\", \n 23.30 => \"11:30pm\", 23.45 => \"11:45pm\",24.00 => \"12:00am\"}\n\n\n\n showtimes = [10.45]\n\n if self.runtime >= 1.33 && self.runtime <= 1.5\n showtimes << 12.30 << 14.00 << 15.30 << 17.00 << 18.30 << 20.00 << 21.30 << 23.00\n\n elsif self.runtime >= 1.5 && self.runtime <= 2 \n showtimes << 13.00 << 15.00 << 17.00 << 19.00 << 21.00 << 23.00 << 24.00\n\n elsif self.runtime >= 2 && self.runtime <= 3\n showtimes << 14.15 << 17.15 << 21.15 << 24.00\n end \n\n\n\n showtimes.map! do |time|\n time = Showing.create!(military_time: time.to_f, time_string: available_times[time], movie: self)\n end\n\n self.showings = showtimes\n end",
"def in_words(t)\n # to get the number of minutes subtract out days\n # Then calculate hours and subtract those out to get minutes.\n s = []\n days = t.round(4).to_i\n s << \"#{ days } day(s)\" unless days == 0\n \n remainder = t - days\n minutes = remainder * 1440.0 # number of minutes in a day\n hours = (minutes / 60.0).round.to_i\n s << \"#{ hours } hours\" unless hours == 0\n \n # round to 2 decimal places and call it\n minutes = (minutes - hours * 60).round\n s << \"#{ minutes } minutes\" unless minutes == 0\n \n if s.empty?\n s << \"now\"\n else\n s << \"ago\"\n end\n \n s.join(\" \")\n end",
"def rational_hour(seconds); end",
"def parse_hour_12h(time)\n sounds_for_number(time.strftime(\"%l\"))\n end",
"def hours\n self.to_i * 3_600\n end",
"def fuel_hours\n (fuel_blocks / fuel_per_hour).floor\n end",
"def calculate_hours_minutes(output)\n return unless output =~ /up\\s+(\\d+):-?(\\d+),/\n\n SECS_IN_AN_HOUR * Regexp.last_match(1).to_i +\n SECS_IN_A_MINUTE * Regexp.last_match(2).to_i\n end",
"def calculate_days_hours_minutes(output)\n return unless output =~ /(\\d+) day(?:s|\\(s\\))?,?\\s+(\\d+):-?(\\d+)/\n\n SECS_IN_A_DAY * Regexp.last_match(1).to_i +\n SECS_IN_AN_HOUR * Regexp.last_match(2).to_i +\n SECS_IN_A_MINUTE * Regexp.last_match(3).to_i\n end",
"def lead_time\n 4\n end",
"def thirty_minute_yoga_classes\n end",
"def time_in_words(time)\n days = (time / 86_400).to_i\n time -= days * 86_400\n hours = (time / 3600).to_i\n time -= hours * 3600\n minutes = (time / 60).to_i\n string = \"#{days} day#{'s' unless days == 1},\"\n string << \" #{hours} hour#{'s' unless hours == 1},\"\n string << \" #{minutes} minute#{'s' unless minutes == 1}\"\n end",
"def hour() end",
"def low_toms\n [43]\n end",
"def fortnights ; Duration[self * 1209600] ; end",
"def night_length night_timelimit\n case day_timelimit\n when 1\n return \"336 hours (2 weeks)\"\n when 2\n return \"168 hours (1 week)\"\n when 3\n return \"120 hours (5 days)\"\n when 4\n return \"72 hours (3 days)\"\n when 5\n return \"48 hours (2 days)\"\n when 6\n return \"24 hours (1 day)\"\n when 7\n return \"12 hours\"\n when 8\n return \"6 hours\"\n when 9\n return \"3 hours\"\n when 10\n return \"2 hours\"\n when 11\n return \"1 hour\"\n when 12\n return \"30 minutes\"\n when 13\n return \"15 minutes\"\n when 14\n return \"10 minutes\"\n when 15\n return \"5 minutes\"\n else\n return \"Error\"\n end\n end",
"def hours() 60 * minutes end",
"def get_timeslots_12hrs\n \t#create the new array\n \t@timeslots_12hrs = Array.new\n\n for i in 0...@timeslots.length\n @temp_holder = @timeslots[i].split(':')\n @temp_holder[0] = @temp_holder[0].to_i\n if @temp_holder[0] > 12\n @temp_holder[0] = @temp_holder[0] - 12\n @timeslots_12hrs.push(@temp_holder[0].to_s + \":\" + @temp_holder[1] + \"pm\")\n elsif @temp_holder[0] == 12\n @timeslots_12hrs.push(@temp_holder[0].to_s + \":\" + @temp_holder[1] + \"pm\")\n else\n @timeslots_12hrs.push(@timeslots[i] + \"am\")\n end\n end\n\n return @timeslots_12hrs\n end",
"def period; end",
"def period; end",
"def period; end",
"def convert_price_in_work_time(amount)\n amount / SMIC_HORAIRE_NET * 60 * 60\nend",
"def eats_at\n if @meal_time >= 13\n return \"#{@meal_time - 12}pm\"\n elsif @meal_time <= 11\n return \"#{@meal_time}am\"\n else\n return \"#{@meal_time}pm\"\n end\n end",
"def after_midnight(string)\n (string[0, 2].to_i * 60 + string[3, 2].to_i) % 1440\nend",
"def meridiem\n hour_24 / 12\n end",
"def format_hours\n\n self.breakHours = self.breakHours[1,self.breakHours.length] if !self.breakHours.blank? && self.breakHours =~ /0[0-9]:/\n\t\tself.hours = self.hours[1,hours.length] if !self.hours.blank? && self.hours =~ /0[0-9]:/\n \n\tend",
"def cutime(*) end",
"def parse_hour_24h(time)\n sounds_for_number(time.strftime(\"%k\"))\n end",
"def hours ; Duration[self * 3600] ; end",
"def time_in_words(time)\n\t\tdays = (time / 86_400).to_i\n\t\ttime -= days * 86_400\n\t\thours = (time / 3600).to_i\n\t\ttime -= hours * 3600\n\t\tminutes = (time / 60).to_i\n\t\tstring = \"#{days} day#{'s' unless days == 1},\"\n\t\tstring << \" #{hours} hour#{'s' unless hours == 1},\"\n\t\tstring << \" #{minutes} minute#{'s' unless minutes == 1}\"\n\tend",
"def after_midnight(time_str)\n count = 0\n hour, min = time_str.split ':'\n hour.to_i.times { count += 60 }\n count += min.to_i\n count % 1440\nend",
"def opening_hour\n 11 # 11am\n end",
"def hours\n value_parts[0]\n end",
"def hours\n value_parts[0]\n end",
"def time_string(string)\n\n times=string.split(\":\")\n puts times.inspect\n residual= times[1].to_f/2\n hour_degrees=times[0].to_i*30+residual\n minutes=times[1].to_i*6\n return hour_degrees-minutes\n\nend",
"def hourglass\r\n return 188\r\n end",
"def hours; self * HOUR; end",
"def hours; self * HOUR; end",
"def get_seconds_after_midnight_from_hms(h, m, s); end",
"def get_seconds_after_midnight_from_hms(h, m, s); end",
"def h # human\n \"%02d:%02d:%02d\" % [total/3600%24, total/60%60, total%60]\n end",
"def prep_time_passed\n return \"7:34\"\n end",
"def hm2s(hm)\n if hm =~ /\\d+h +\\d+m/\n h, m = /(\\d+)h +(\\d+)m/.match(hm).captures\n h.to_i * 60 * 60 + m.to_i * 60\n elsif hm =~ /\\d+m/\n m = /(\\d+)m/.match(hm).captures\n m[0].to_i * 60\n elsif hm =~ /\\d+h/\n h = /(\\d+)h/.match(hm).captures\n h[0].to_i * 60 * 60\n else\n raise \"hm2s: illegal input #{hm}\"\n end\nend",
"def remaining_hours\n \n end",
"def display_time_at\n gm = self.good_memories.count\n bm = self.bad_memories.count\n lifespan = (Time.now.to_i - self.created_at.to_i)\n unless gm == 0\n shift = (lifespan * (bm + 1)) / gm\n return (Time.now.to_i - shift)\n else\n shift = lifespan * (bm + 1)\n return (Time.now.to_i - shift)\n end\n end",
"def calc_upg_ch4_per_hour(val1= calc_upg_ch4, val2= 364 * 24)\n\t\t(val1 / val2).round 2\n\tend",
"def hours\n fail \"A value is required for #{__method__}\" unless @value\n fail 'A value cannot be > 24' if @value > 24\n fail 'A value cannot be <= 0' if @value <= 0\n return 'daily' if @value == 24\n\n \"0/#{@value}:0:0\"\n end",
"def hours( calculator )\n a = []\n a << terse_hours( calculator.total ) if ( @report.include_totals )\n a << terse_hours( calculator.committed ) if ( @report.include_committed )\n a << terse_hours( calculator.not_committed ) if ( @report.include_not_committed )\n return a\n end",
"def hours\n \n end",
"def get_timeslots_12hrs\n #create the new array\n timeslots_12hrs = Array.new\n\n for i in 0...@timeslots.length\n temp_holder = @timeslots[i].split(':')\n temp_holder[0] = temp_holder[0].to_i\n\n if temp_holder[0] > 12\n temp_holder[0] = temp_holder[0] - 12\n timeslots_12hrs.push(temp_holder[0].to_s + \":\" + temp_holder[1] + \"pm\")\n elsif temp_holder[0] == 12\n timeslots_12hrs.push(temp_holder[0].to_s + \":\" + temp_holder[1] + \"pm\")\n else\n timeslots_12hrs.push(@timeslots[i] + \"am\")\n end\n end\n\n return timeslots_12hrs\n end",
"def cutime=(*) end",
"def boil_off_gallons\n (@boil_minutes.to_f / 60.to_f) * boil_off_gallons_per_hour.to_f\n end",
"def lesson_length\n seconds = self.end_at - self.start_at\n seconds / 3600.0\n end",
"def duration_offset text\n match_data = text.match('CPD\\s[-\\s]*([0-9])*\\s(hours|days)')\n #unit = match_data[2] All are in hours - you can use this if they change to using days.\n if match_data\n return match_data[1].to_i * 3600 #86400 if days\n else\n 0\n end\n\nend",
"def beautiful_times()\n count = @options.count\n\n # Is the target count minute aligned?\n if count % 60 != 0\n return count # Not minute aligned.\n end\n\n # Is the target count hour aligned?\n minutes = count / 60\n if 60 % minutes != 0\n return count # Not hour aligned.\n end\n\n # See if we are already suitably aligned right now.\n now = Time.now\n mm = now.min\n ss = now.sec\n if mm % minutes == 0 && 1 <= ss && ss <= 50\n return count # Now is minute aligned and within minute drift limits.\n end\n\n # Target 10 seconds into the next aligned minute.\n short_mm = minutes - (mm % minutes)\n count = (short_mm * 60) + 10 - ss\n return count\n end",
"def evaporator(content, evap_per_day, threshold)\n day = 0\n difference = content * (threshold / 100.0)\n until content < difference\n day += 1\n content -= (content * (evap_per_day / 100.0))\n end\n day\nend",
"def timeConversion(s)\n # Write your code here\n b = s[-2..-1] == 'PM' ? 12 : 0\n p b\n h = s.split(':')[0]\n h = h.to_i%12 + b\n p h\n p h.to_s + s[2..-3]\nend",
"def get_beats_in_bar()\n return get_time_signature == \"3/4\" ? 3 : 4\n end",
"def calories_per_liter\n 672\n end",
"def get_route_duration\n return duration.div(3600)+\"Stunden\"+(duration % 60)+ \"Minuten\" \n end",
"def minutos(seg)\n return seg.to_f / 60\nend",
"def guilt_trip\n \"how much of the 10000 hours have you put\"\n end",
"def hourly_totals(emoji)\n hour_zero = self.last_hour.where(emoji: emoji).pluck(:created_at).size\n hour_one = self.last_hour_plus_one.where(emoji: emoji).pluck(:created_at).size\n hour_two = self.last_hour_plus_two.where(emoji: emoji).pluck(:created_at).size\n hour_three = self.last_hour_plus_three.where(emoji: emoji).pluck(:created_at).size\n hour_four = self.last_hour_plus_four.where(emoji: emoji).pluck(:created_at).size\n some_days = [hour_zero, hour_one, hour_two, hour_three, hour_four]\n end",
"def hours\n self * SECONDS_IN_HOUR\n end",
"def reporthelp_decorated_hours( actual, potential )\n class_name = actual < 0 ? 'overrun' : 'no_overrun'\n output = \"<strong><span class=\\\"#{ class_name }\\\">#{ apphelp_terse_hours( actual ) }</span> / \"\n class_name = potential < 0 ? 'overrun' : 'no_overrun'\n output << \"<span class=\\\"#{ class_name }\\\">#{ apphelp_terse_hours( potential ) }</span></strong>\"\n\n return output.html_safe()\n end",
"def freq_intercommit_durations events\n events.map(&:date).sort\n .uniq\n .each_cons(2)\n .map {|before,after| (after.to_i - before.to_i) / 60 }\n .freq_by { |e| e / 5}\n .select {|e| e[0] <= 12 * 8 }\nend",
"def sbv_time(t)\r\n i = t.to_i\r\n \"%d:%02d:%02d.%03d\" % [i/3600, i/60%60, i%60, (t*1000).to_i%1000]\r\nend",
"def time_string(h, m, s)\n n = []\n n[0] = h\n n[1] = m \n n[2] = s\n \n # all greater than \n if n[0] >= 10 && n[1] >= 10 && n[2] >= 10\n return \"#{n[0]}:#{n[1]}:#{n[2]}\"\n\n # less, greater, greater\n elsif n[0] < 10 && n[1] >= 10 && n[2] >= 10\n return \"0#{n[0]}:#{n[1]}:#{n[2]}\"\n\n # less, less, greater\n elsif n[0] < 10 && n[1] < 10 && n[2] >= 10\n return \"0#{n[0]}:0#{n[1]}:#{n[2]}\"\n\n # all less than\n elsif n[0] < 10 && n[1] < 10 && n[2] < 10\n return \"0#{n[0]}:0#{n[1]}:0#{n[2]}\"\n\n # greater, less, less \n elsif n[0] >= 10 && n[1] < 10 && n[2] < 10\n return \"#{n[0]}:0#{n[1]}:0#{n[2]}\"\n\n # greater, greater, less \n elsif n[0] >= 10 && n[1] >= 10 && n[2] < 10\n return \"#{n[0]}:#{n[1]}:0#{n[2]}\"\n\n # greater, less, greater \n elsif n[0] >= 10 && n[1] < 10 && n[2] >= 10\n return \"#{n[0]}:0#{n[1]}:#{n[2]}\"\n\n # less, greater, less\n elsif n[0] < 10 && n[1] >= 10 && n[2] < 10\n return \"0#{n[0]}:#{n[1]}:0#{n[2]}\"\n\n else \n return \"Enter a positive integer\" \n end\nend",
"def clock_hour12(clock)\n to_clock12(clock).hour\nend",
"def set_mtimes(times)\n pm = false\n _24hr = true\n\n times_24 = []\n now = Time.now\n \n #convert to '24hr' for consistency\n #start backwards to make sure its am or pm\n times.reverse_each do |t|\n\n hr, min = t[0].to_s.split(':', 2)\n\n #change to pm\n if (min.include?(\"pm\"))\n pm = true\n _24hr = false\n end\n\n #change from pm to am\n if (min.include?(\"am\") && !_24hr)\n pm = false\n end\n\n #only am start - hackish\n if (min.include?(\"am\") && times.length < 3)\n _24hr = false\n end\n\n if (_24hr)\n augment =0\n if (hr.to_i == 12)\n augment = 12\n end\n\n t = Time.new(now.year, now.month, now.day,\n hr.to_i - augment, min[/[0-9]+/]) + 24*60*60 #add a day\n elsif (pm)\n augment = 0\n if hr.to_i != 12\n augment = 12\n end\n t = Time.new(now.year, now.month, now.day,\n hr.to_i + augment, min[/[0-9]+/])\n\n elsif (!pm & !_24hr)\n t = Time.new(now.year, now.month, now.day,\n hr.to_i, min[/[0-9]+/])\n end\n\n=begin\n #midnight seems to be latest\n if ((!pm && min.include?(\"am\") && hr.to_i == 12) ||\n ((!pm && hr.to_i == 12)))\n \n t = Time.new(now.year, now.month, now.day,\n hr.to_i - 12, min[/[0-9]+/]) + 24*60*60 #add a day\n\n elsif (!pm && min.include?(\"am\"))\n pm = false\n\n t = Time.new(now.year, now.month, now.day,\n hr.to_i, min[/[0-9]+/])\n\n elsif (pm || min.include?(\"pm\"))\n pm = true\n augment = 0\n if (hr.to_i != 12)\n augment = 12\n end\n\n t = Time.new(now.year, now.month, now.day,\n hr.to_i + augment, min[/[0-9]+/])\n\n end\n=end\n times_24.push t\n end\n\n self.mtimes = times_24\n\n end",
"def parse_time(time)\n result = Struct.new(:days, :hours, :minutes).new\n time = time.to_i\n result.days = time / 86_400\n time = time % 84_600\n result.hours = time / 3_600\n time %= 3_600\n result.minutes = time / 60\n result\nend",
"def human_time_diff(t, n = 5)\n t = t.round # handle fractional seconds\n mm, ss = t.divmod(60)\n hh, mm = mm.divmod(60)\n dd, hh = hh.divmod(24)\n {d: dd, h: hh, m: mm, s: ss}.reject{ |_,v| v == 0 }.map{ |k,v| \"#{v.round}#{k}\" }.first(n).join\n end",
"def ask_time\n # twelve\n end",
"def past(h, m, s)\r\n return 0 if [h, m, s].sum == 0\r\n return (h*3600 + m*60 + s) * 1000\r\nend",
"def total_hours\n ('%.02f' % ((ends_at - starts_at) / 1.hour)).to_f\n end",
"def round_hours\n self.hours = self.hours.round_to_half\n self.impact = 'None' if self.hours == 0.0\n end",
"def gmtoff() end",
"def four_hours\n self.range('4hr')\n end",
"def hour_thc\n hour = @t_hour\n hour -= 12 if hour > 12\n return hour\n end",
"def tiempointerv(ai,mei,di,hi,mii,af,mef,df,hf,mif)\n\t\tfechaini = DateTime.new(ai,mei,di,hi,mii) #fecha de inicio\n\t\tfechafin = DateTime.new(af,mef,df,hf,mif) #fecha de final\n\t\tdiferencia = fechafin - fechaini\n\t\thours,minutes,seconds,frac = Date.day_fraction_to_time(diferencia)\n\t\tif hours < 10\n\t\t\thoras = '0' + hours.to_s\n\t\telse\n\t\t\thoras = hours.to_s\n\t\tend\n\t\tif minutes < 10\n\t\t\tminutos = '0' + minutes.to_s\n\t\telse\n\t\t\tminutos = minutes.to_s\n\t\tend\n\t\ttiempo = horas + ':' + minutos\n\t\treturn tiempo\n\n\tend",
"def time_gap(t1,t2)\n\nh1=t1.to_s[11..12].to_i #hour\nm1=t1.to_s[14..15].to_i #minute\ns1=t1.to_s[17..18].to_i #second\n\nh2=t2.to_s[11..12].to_i #hour\nm2=t2.to_s[14..15].to_i #minute\ns2=t2.to_s[17..18].to_i #second\n\nreturn 3600*(h2-h1)+60*(m2-m1)+(s2-s1)\n\nend",
"def time_of_day(integer)\n number, remainder = integer.divmod(1440)\n total_minutes = remainder\n\n number, remainder = remainder.divmod(60)\n final_hours = number\n final_minutes = remainder\n\n if final_hours < 10 && final_minutes < 10\n final_hours = \"#{'0'}#{final_hours}\"\n final_minutes = \"#{'0'}#{final_minutes}\"\n final_string = \"#{final_hours}:#{final_minutes}\" \n elsif final_hours < 10 && final_minutes > 10\n final_hours = \"#{'0'}#{final_hours}\"\n final_string = \"#{final_hours}:#{final_minutes}\" \n elsif final_hours > 10 && final_minutes < 10\n final_minutes = \"#{'0'}#{final_minutes}\"\n final_string = \"#{final_hours}:#{final_minutes}\" \n else\n final_string = \"#{final_hours}:#{final_minutes}\" \n end \n\n final_string\nend",
"def get_owghat_range\n @now = (Time.now.hour-1) *60 + Time.now.min \n if @now <420 and @now>300\n return 1\n elsif @now>720 and @now<1140\n return 2\n elsif @now>1200 and @now<1440 \n return 4\n else \n return -1\n end\n end",
"def before_midnight(str)\n hour, minute = str.split(':').map(&:to_i)\n ( (23-hour) * 60 + (60-minute) ) % 1440\nend",
"def bot(h, m, amOrpm)\n\t\tlastString = ''\t# this will save last string of digital clock\n\n\t\th = h.to_s\t# convert hour from integer to string\n\t\tif m < 10\t# if minute is less than 10\n\t\t\tm = m.to_s\t\n\t\t\tm = '0' + m.to_s\t# then put the 0 in front of minute (ex 09, 02, 03)\n\t\telse\n\t\t\tm = m.to_s\t\t# if not just convert from integer to string\n\t\tend\n\t\ttotal = h + m\t\t\t# I combined the hour and minute in one string\n\n\t\tfor i in 0..total.length-1 do\t# loop until total length\n\t\t\tif total[i] == '1'\t\t\t\t# if character is 1\n\t\t\t\tlastString = lastString + \" | \"\t\t# save proper bar\n\t\t\telsif total[i] == '4' || total[i] == '7'\t# if character is 4 or 7\n\t\t\t\tlastString = lastString + \" |\"\t\t# save proper bar\n\t\t\telsif total[i] == '2'\t\t\t\t# if character is 2\n\t\t\t\tlastString = lastString + \"|_ \"\t\t# save proper bar\n\t\t\telsif total[i] == '3' || total[i] == '5' || total[i] == '9'\t# if character is 3 or 5 or 9\n\t\t\t\tlastString = lastString + \" _|\"\t\t# save proper bar\n\t\t\telsif total[i] == '6' || total[i] == '8'\t# if character is 6 or 8\n\t\t\t\tlastString = lastString + \"|_|\"\t\t# save proper bar\n\t\t\telsif total[i] == '0'\t\t\t\t# if character is 0\n\t\t\t\tlastString = lastString + \"|_|\"\t\t# save proper bar\n\t\t\tend\n\n\t\t\tif h.length == i+1\t\t\t\t# if hour length is matched with i\n\t\t\t\tlastString = lastString + \".\"\t\t# then save dot which represent colon in the future\n\t\t\tend\n\t\tend\n\t\t\n\t\t# AM and PM is consist of same string in middle and top, except bot. So in the bot method we will decide A or P (AM or PM)\n\t\tif amOrpm == 1\t\t\t\t\t\t# This decide last bar of PM or Am\n\t\t\tlastString = lastString + \" | \"\t\t# it is P\n\t\telse\n\t\t\tlastString = lastString + \" | |\"\t\t# It is A\n\t\tend\n\tend",
"def cooking_time\n end",
"def initialTimeDecimal(inputStartTime)\n split = inputStartTime.split(':')\n hours = split[0].to_i\n split = split[1].split(' ')\n #mins = split[0].to_i\n if (split[1] == \"PM\")\n hours += 12\n end\n return hours\nend",
"def eats_at\n if @meal_time < 12\n return \"#{@meal_time} AM\"\n elsif @meal_time > 12\n return \"#{@meal_time -12} PM\"\n elsif @meal_time==0\n return \"Midnight\"\n else\n return \"Current meal time is invalid.\"\n end\nend",
"def hour_cell(half_hour)\n if half_hour % 2 == 0\n content_tag :td, :class => \"day_hour_cell\", \n :width => \"1%\", :rowspan => 2 do\n if (half_hour/2 == 0)\n ''\n elsif (half_hour/2 < 12)\n (half_hour/2).to_s + 'am'\n elsif (half_hour/2 == 12)\n 'Noon'\n elsif (half_hour/2 > 12)\n ((half_hour/2) - 12).to_s + 'pm'\n end\n end\n else\n nil\n end\n end",
"def distance_of_time_in_words(time)\n minutes = (Time.new.to_i - time.to_i).floor / 60\n case\n when minutes < 1\n \"less than a minute\"\n when minutes < 2\n \"about a minute\"\n when minutes < 50\n \"#{minutes} minutes\"\n when minutes < 90\n \"about an hour\"\n when minutes < 1080\n \"#{(minutes / 60.to_f).ceil} hours\"\n when minutes < 2160\n \"1 day\"\n else\n \"#{(minutes / 1440).round} days\"\n end\n end",
"def split_playtime(start)\r\r\n number = []\r\r\n number[0] = start / 60 / 60\r\r\n number[1] = start / 60 % 60\r\r\n number[2] = start % 60\r\r\n return number\r\r\n end",
"def total_time(distance, mph)\n time = distance / mph \nend",
"def calc_hours_till\n (calc_mins_till / 60.00).round(2)\n end",
"def d_hours( v )\n TimeDelta.new( HOUR_TO_MS * v )\n end"
] | [
"0.6147789",
"0.6109509",
"0.6086442",
"0.60184824",
"0.6015286",
"0.5951903",
"0.5906973",
"0.5905018",
"0.5898006",
"0.5874781",
"0.58522534",
"0.5844289",
"0.5834794",
"0.5795807",
"0.5775393",
"0.5760071",
"0.575431",
"0.5750253",
"0.5747266",
"0.5746979",
"0.57449245",
"0.57406545",
"0.5726521",
"0.5707594",
"0.5673996",
"0.56700563",
"0.56700563",
"0.56700563",
"0.56666106",
"0.5663858",
"0.5663656",
"0.5659506",
"0.56551176",
"0.56465465",
"0.5629576",
"0.56234676",
"0.56146",
"0.5611563",
"0.56110686",
"0.5609654",
"0.5609654",
"0.56096053",
"0.5601714",
"0.559617",
"0.559522",
"0.55813205",
"0.55813205",
"0.55777353",
"0.5576697",
"0.5572994",
"0.55678505",
"0.556248",
"0.55591494",
"0.5557798",
"0.5551925",
"0.55511034",
"0.55459946",
"0.55323935",
"0.55316997",
"0.5528119",
"0.55271196",
"0.5526447",
"0.551424",
"0.55140984",
"0.55139416",
"0.55133",
"0.5508424",
"0.55055135",
"0.5500188",
"0.5499976",
"0.5486562",
"0.54854447",
"0.5482808",
"0.5474787",
"0.5468307",
"0.5464475",
"0.5463868",
"0.54632914",
"0.54584897",
"0.54519665",
"0.5451679",
"0.5441312",
"0.5428812",
"0.5425935",
"0.5422618",
"0.54169357",
"0.5411373",
"0.54103994",
"0.5409681",
"0.5408648",
"0.5407797",
"0.54067534",
"0.5397438",
"0.5390839",
"0.53905356",
"0.5389247",
"0.5387952",
"0.5387552",
"0.53863156",
"0.5376007",
"0.53756773"
] | 0.0 | -1 |
GET /exhibitior_categories/1 GET /exhibitior_categories/1.json | def show
@exhibitior_category = ExhibitiorCategory.find(params[:id])
@exhibitor = @exhibitior_category.exhibitors
respond_to do |format|
format.html # show.html.erb
format.json { render json: @exhibitior_category }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend",
"def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend",
"def index\n @incidentcategories = Incidentcategory.all\n json_response(@incidentcategories)\n end",
"def categories\n get('venues/categories').categories\n end",
"def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end",
"def index\n @categorias = Categoria.where(ativo: true)\n \t\n render json: @categorias\n end",
"def get_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end",
"def index\n categories = @vertical.catgories.order('created_at DESC');\n render json: {status: 'SUCCESS', message:'Loaded categories', data:categories},status: :ok\n end",
"def index\n @exercise_categories = ExerciseCategory.where(\"organization_id IN (?)\", [Organization.current_organization, Organization.admin_organization])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercise_categories }\n end\n end",
"def index\n @categorias = Categoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @categorias }\n end\n end",
"def get_categories\n body = build_request(2935, 1501, \"ACTIVEHEADINGS\")\n response = send_to_localeze(body)\n xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)\n end",
"def index\n\n\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def getCategories(_, _, _)\n @db.categories\n end",
"def GetCategory id\n\n APICall(path: \"categories/#{id}.json\")\n\n end",
"def index\n categories = Category.all\n render json:categories\n end",
"def categories\n # list results from search results piped in from side nav categories\n @experiments = Experiment.find(:status => true)\n respond_to do |format|\n format.html { render :action => \"list\" }\n format.xml { render :xml => @experiments }\n end\n\n end",
"def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def index\n @categories = Category.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def get_menu_category\n require \"rest_client\"\n require \"json\"\n\n self.categories.update_all(still_present: false)\n response = RestClient.get(\"https://api.omnivore.io/0.1/locations/#{self.omnivore_id}/menu/categories\", {:content_type => :json, :'Api-Key' => Setting.first.app_api_key})\n res = JSON.parse(response)\n res[\"_embedded\"][\"categories\"].each do |category|\n cat = self.categories.where(omnivore_id: category[\"id\"]).first_or_create\n cat.name = category[\"name\"]\n cat.still_present = true\n cat.save\n end\n\n self.categories.where(still_present: false).destroy_all\n end",
"def get_categories()\n\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\tif response.success?\n\t\t\t@categories = response.parsed_response\n\t\telse\n\t\t\traise response.response\n\t\tend\n\t\treturn @categories\n\tend",
"def new\n @exhibitior_category = ExhibitiorCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exhibitior_category }\n end\n end",
"def index\n respond_with Category.all\n end",
"def index\n @echocategories = Echocategory.all\n end",
"def get_department_categories\n json_response({ message: 'NOT IMPLEMENTED' })\n end",
"def category\n client.categories.find(data[\"categoryId\"])\n end",
"def categories\n parsed_json['data']\n end",
"def get_categories(project_id_or_key)\n get(\"projects/#{project_id_or_key}/categories\")\n end",
"def show\n render json: @categoria\n end",
"def categories\n response[\"categories\"].map!{|category| Foursquared::Response::Category.new(client, category)} if response[\"categories\"]\n end",
"def categories(query_object)\n\t\tdata = do_get_json(CATEGORIES_ENDPOINT, query_object)\n\tend",
"def index\n @categories = Category.all\n @categories.each do |category|\n authorize! :read, category\n end\n render json: @categories\n end",
"def index\n @convention_categories = ConventionCategory.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @convention_categories }\n end\n end",
"def index\n\t @categories = Category.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @categories }\n\t end\n\tend",
"def index\n @categories = Category.all\n respond_with(@categories)\n end",
"def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def categories\n []\n end",
"def index\n @categories = CategoryService.index\n end",
"def index\n @hive_categories = HiveInformation.all\n end",
"def get_category id\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.get CATEGORIES, id )\n\t\t\t\tend",
"def meal_categories\n # API EXAMPLE: https://www.themealdb.com/api/json/v1/1/list.php?c=list\n content = api_call('list.php?c=list')\n validate(content)\n content\n end",
"def index\n @categorie_competences = CategorieCompetence.all\n end",
"def show\n @exhibitor_category = ExhibitorCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exhibitor_category }\n end\n end",
"def index\n @all_categories = CateItem.all\n end",
"def index\n @question_categories = QuestionCategory.with_questions()\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @question_categories }\n end\n end",
"def get_categories\n @categories = Category.all\n end",
"def index\n @categors = Categor.all\n end",
"def index\n @categories=Category.root\n respond_with @categories\n end",
"def get_category_list\n ret_hash = Rails.cache.fetch(\"zaim_api/category\", expired_in: 1.day) do\n json_categories = self.zaim_api.category\n tmp_ret_hash = {}\n json_categories['categories'].each do |value|\n tmp_ret_hash[value['id']] = value['name']\n end\n tmp_ret_hash\n end\n ret_hash\n end",
"def index\n @categories = @project.categories.all\n end",
"def categories\n category\n end",
"def categories\n @categories = response[\"categories\"] || []\n @categories.map!{|category| Foursquared::Response::Category.new(client, category)}\n end",
"def show\n render json: category\n end",
"def index\n @profession_categories = ProfessionCategory.all\n end",
"def expense_categories\n @expense_categories ||= Harvest::API::ExpenseCategories.new(credentials)\n end",
"def index\n @prompt_categories = PromptCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prompt_categories }\n end\n end",
"def index\n @cathegories = Cathegory.all\n end",
"def index\n @subcategorias = Subcategoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @subcategorias }\n end\n end",
"def index\n\n # dla formularza new\n @category = current_user.categories.build if signed_in?\n\n # dla tabeli index\n # @categories = Category.all\n @categories = Category.find(:all, :conditions => [\"\\\"isDefault\\\" = ? or user_id = ?\", true, current_user.id])\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def index\n @section_categories = SectionCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @section_categories }\n end\n end",
"def index\n @interviewcategories = Interviewcategory.all\n end",
"def budget_categories_data\n # @budget.budget_items.collect { |budget_item| budget_item.category.name.to_s }.to_json\n categories = Category.for_budget.to_a\n categories << Category.find_by_name(\"Miscellaneous\")\n return categories.collect { |category| category.name.to_s }.to_json\n end",
"def index\n @talk_categories = TalkCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talk_categories }\n end\n end",
"def index\n @q = scope.search(categories_name_eq: params[:category])\n @dishes = @q.result.includes(:categories).order(\"categories.position\")\n\n c = Hash.new {|x,v| x[v] = []}\n @dishes = @dishes.reduce(c) do |h, dishe|\n dishe.categories.each do |c|\n h[c.name] << dishe\n end\n h\n end.reject {|c, d| d.blank? }\n\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def index\n @categories = Category.all\n @categories= @categories.sort_by(&:name)\n render json: @categories\n end",
"def index\n @hospital_categories = HospitalCategory.all\n end",
"def show\n render json: @category\n end",
"def show\n @categorialivro = Categorialivro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @categorialivro }\n end\n end",
"def index\n if params[:categoria_producto]\n render json: Producto.find(params[:producto_id]).categorias\n else\n\t\t @categorias = Categoria.all\n render json: @categorias\n end\n\tend",
"def getcategories\n category_size = RequirementCategory.all.length\n current_offset = (params[:payload][:pagenumber] - 1)*10\n direction = params[:payload][:direction]\n\n respond_to do |format|\n format.json {\n\n \tif current_offset + direction < category_size && current_offset + direction >= 0\n offset = current_offset + direction\n \t@categories = RequirementCategory.all.offset(offset).take(10) \n \trender :json => @categories\n else\n \trender :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n\n\tend",
"def categories\n # @categories = Category.get_categories(@user.id)\n #@categories =Category.all.select(:id).select(:name).select(:description).select(:logo_url)\n @categories =Category.all\n user_cat= @user.categories.collect(&:id)\n categories = []\n @categories.each do |cat|\n cat_attr = cat.attributes\n user_cat.include?(cat.id) ? cat_attr.merge!('user_category' => true) : cat_attr.merge!('user_category' => false)\n categories << cat_attr\n end\n @categories = categories\n\n respond_to do |format|\n if @categories.blank?\n format.json {render json:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.xml {render xml:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.html {render json: {:success => false, :status_code => 404, :message => \"No category found\"}}\n else\n format.html {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.json {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.xml {render xml: {:success => true, :status_code => 200, :categories => @categories}}\n end\n end\n end",
"def index\n categories = {\n \"categoryId\": params[:ids]\n }\n auction_categories = Auction::Category.list categories\n if auction_categories[:comm][:code] == \"200\"\n render json: {status: auction_categories[:comm][:code].to_i, msg: auction_categories[:comm][:msg], data: {auction_categories: auction_categories[:data]}}\n else\n render json: {status: auction_categories[:comm][:code].to_i, msg: auction_categories[:comm][:msg], data: {}}\n end\n end",
"def index\n @categories = collections_config.values\n end",
"def index\n @mk_categories = MkCategoria.all\n end",
"def index\n @categories = Categorie.find(:all, :conditions => {:parametres_cabinet_id => current_user.parametres_cabinet_id})\n\n respond_to do |format|\n format.html {render :layout => \"light\"} # index.html.erb\n format.xml { render :xml => @categories }\n format.json {render :json => {\"success\"=>true,\"data\"=>@categories}}\n \n end\n end",
"def index\n @abuse_categories = AbuseCategory.find(:all , :order => \"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @abuse_categories }\n end\n end",
"def get_categories(add_params = nil)\n params = {\n }\n api_call('/global/categories(.:format)',:get,params,add_params)\n end",
"def index\n @categories = Category.roots\n end",
"def category\n data['category']\n end",
"def show\n render json: @accessory_category\n end",
"def index\n @ilance_categories = IlanceCategory.all\n end",
"def categories options = {}\n perform_get_with_object(\"/categories\", options, Vimeo::Entities::Category)\n end",
"def index\n @categs = Categ.all\n end",
"def index\n respond_to do |format|\n format.html { @categories = Category.all }\n format.json { @categories = Category.order(:name) }\n end\n end",
"def show\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categoria }\n end\n end",
"def index\n # @categories = current_user.categories\n @categories = Category.accessible_by(current_ability).all\n end",
"def all_categories\n end",
"def index\n @benefit_categories = BenefitCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @benefit_categories }\n end\n end",
"def get_categories(query_obj=nil)\n uri = URI.parse(@uri + \"/Categories\")\n results = get(uri,query_obj)\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end"
] | [
"0.7283221",
"0.7197113",
"0.71034133",
"0.7012842",
"0.6995474",
"0.6891323",
"0.677795",
"0.6718196",
"0.66946024",
"0.6640794",
"0.66325146",
"0.6614414",
"0.661238",
"0.66113895",
"0.66095465",
"0.6600718",
"0.6584939",
"0.6574456",
"0.6573825",
"0.6573825",
"0.65720296",
"0.6537497",
"0.65254694",
"0.65218323",
"0.6511186",
"0.6510565",
"0.64993787",
"0.64910436",
"0.6488767",
"0.64825964",
"0.645904",
"0.64570224",
"0.64546585",
"0.6431708",
"0.6429479",
"0.64152944",
"0.63970065",
"0.6389965",
"0.6378936",
"0.63758886",
"0.63711166",
"0.63688153",
"0.6368728",
"0.6357935",
"0.63520914",
"0.6350296",
"0.6345722",
"0.63390976",
"0.632351",
"0.631329",
"0.6310631",
"0.63097334",
"0.6308883",
"0.62935996",
"0.62918454",
"0.6288574",
"0.62842655",
"0.62834275",
"0.62815326",
"0.62783945",
"0.62710726",
"0.62678814",
"0.6263124",
"0.6262949",
"0.6258069",
"0.62509733",
"0.62425596",
"0.6241589",
"0.62399507",
"0.62336826",
"0.6230838",
"0.6229391",
"0.6226396",
"0.62243456",
"0.62234783",
"0.6222149",
"0.6219459",
"0.62186474",
"0.6211414",
"0.62102693",
"0.6209456",
"0.6205978",
"0.62056637",
"0.62001014",
"0.6195325",
"0.6191762",
"0.6189362",
"0.61807513",
"0.6162342",
"0.6159493",
"0.6153232",
"0.61531675",
"0.61531675",
"0.61531675",
"0.61531675",
"0.61531675",
"0.61531675",
"0.61531675",
"0.61531675",
"0.61531675"
] | 0.6923125 | 5 |
GET /exhibitior_categories/new GET /exhibitior_categories/new.json | def new
@exhibitior_category = ExhibitiorCategory.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @exhibitior_category }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n puts @category.inspect\n @internal = @category.internals.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @internal }\n end\n end",
"def new\n @category = Category.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def create\n @exhibitior_category = ExhibitiorCategory.new(params[:exhibitior_category])\n\n respond_to do |format|\n if @exhibitior_category.save\n format.html { redirect_to @exhibitior_category, notice: 'Exhibitior category was successfully created.' }\n format.json { render json: @exhibitior_category, status: :created, location: @exhibitior_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exhibitior_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @exercise_categories = ExerciseCategory.all\n @exercise_category = ExerciseCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exercise_category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category}\n end\n end",
"def new\n @categoria = Categoria.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @categoria }\n end\n end",
"def new\n @category = current_mall.categories.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @exhibitor_category = ExhibitorCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exhibitor_category }\n end\n end",
"def new\n return unless representsCompany?\n\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @categorias_tipo = CatTipo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @categorias_tipo }\n end\n end",
"def new\r\n @administration_category = Category.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @administration_category }\r\n end\r\n end",
"def new\n @category = Category.new\n\n # @categories = Category.all\n\n # respond_to do |format|\n # format.html # new.html.erb\n # format.json { render json: @category }\n # end\n end",
"def new\n @technology = Technology.new\n @categories = Category.find(:all)\n\n if @categories.count == 0\n flash[:error] = 'You need to create a category before you can create a technology'\n redirect_to new_category_path and return\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @technology }\n end\n end",
"def new\n @level_category = LevelCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level_category }\n end\n end",
"def new\n @categorialivro = Categorialivro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @categorialivro }\n end\n end",
"def new\n @quest = Quest.new\n\t@categories = find_all_categories\n\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quest }\n end\n end",
"def new\n @pcategory = Pcategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pcategory }\n end\n end",
"def new\n # category instance\n @category = Category.new\n end",
"def new\n @exercise_category = ExerciseCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exercise_category }\n end\n end",
"def new\n @category_type = CategoryType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category_type }\n end\n end",
"def new\n @kategory = Kategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kategory }\n end\n end",
"def new\n\n #@category = Category.new\n @category = current_user.categories.build if signed_in?\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n @taxonomy_category = TaxonomyCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taxonomy_category }\n end\n end",
"def new\n# @category = Category.by_company(current_company.id).new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @category }\n end\n end",
"def create\n @categorialivro = Categorialivro.new(params[:categorialivro])\n\n respond_to do |format|\n if @categorialivro.save\n format.html { redirect_to @categorialivro, :notice => 'Categorialivro was successfully created.' }\n format.json { render :json => @categorialivro, :status => :created, :location => @categorialivro }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @categorialivro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @categorization = Categorization.new\n @categories = category_list\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @categorization }\n end\n end",
"def new\n @categories = Category.where(validity: true)\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n\t\t@category = Category.new\n\tend",
"def new\n\t\t@category = Category.new\n\tend",
"def create\n @categoria = Categoria.new(params[:categoria])\n\n respond_to do |format|\n if @categoria.save\n format.html { redirect_to action: 'index', notice: 'Categoria was successfully created.' }\n format.json { render json: @categoria, status: :created, location: @categoria }\n else\n format.html { render action: \"new\" }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @category = Category.new\n @title = \"Новая категория\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n \t@category = Category.new\n end",
"def create\n @categoria = Categoria.new(categoria_params)\n if @categoria.save\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end",
"def new\n @finding_category = FindingCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @finding_category }\n end\n end",
"def new\n @cat = Cat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cat }\n end\n end",
"def new\n @cat = Cat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cat }\n end\n end",
"def new\n @model = Model.new\n# @model.build_category\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @model }\n end\n end",
"def new\n @model = Model.new\n# @model.build_category\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @model }\n end\n end",
"def new\n @post_category = Post::Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post_category }\n end\n end",
"def new\n @category = Category.new\n end",
"def new\n @category = Category.new\n end",
"def new\n @category = Category.new\n end",
"def new\n @category = Category.new\n end",
"def new\n @category = Category.new\n end",
"def new\n @category = Category.new\n end",
"def new\n @category = Category.new\n end",
"def new\n @category = Category.new\n end",
"def new\n @categoria = Categoria.new\n @categoria.status = Status.find_by_descricao('Ativo')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @categoria }\n end\n end",
"def new\n @cat = Category.new\n end",
"def new\n @title = t(\"h2.categories\")\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @category }\n end\n end",
"def new\n @recipe_category = RecipeCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe_category }\n end\n end",
"def new\n @category_history = CategoryHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category_history }\n end\n end",
"def new\n \t@category =Category.new\n end",
"def new\n @post_category = current_user.post_categories.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post_category }\n end\n end",
"def new\n @course_category = CourseCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_category }\n end\n end",
"def create\n @category = current_user.categories.new(name: params[:name])\n if @category.save\n render \"create.json.jbuilder\", status: :created\n else\n render json: { errors: @category.errors.full_messages }, status: :unprocessable_entity\n end\n end",
"def new\n @category = Category.new\n respond_with(@category)\n end",
"def new\n @category = Category.new\n respond_with(@category)\n end",
"def new\n @category = Category.new\n respond_with(@category)\n end",
"def new\n @categorie_analytique = CategorieAnalytique.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @categorie_analytique }\n end\n end",
"def new\n @expense = Expense.new\n @assigned_categories = \"\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end",
"def new\n @consumer_category = ConsumerCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @consumer_category }\n end\n end",
"def new\n @product = Product.new\n @categories = Category.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @product }\n end\n end",
"def new\n\t @category = Category.new\n\n\t respond_to do |format|\n\t\tformat.html # new.html.erb\n\t end\n\tend",
"def new\n @current_page = 'recettes'\n @recette = Recette.new\n @categories = Category.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recette }\n end\n end",
"def new\n @question_category = QuestionCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question_category }\n end\n end",
"def new\n @poi_category = PoiCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @poi_category }\n end\n end",
"def new\n @talk_category = TalkCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @talk_category }\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @productcategory = Productcategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @productcategory }\n end\n end",
"def create\n @category = current_mall.categories.new(params[:category])\n\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def create\n @categoria = Categoria.new(categoria_params)\n\n if @categoria.save\n flash[:success] = 'Se inserto exitosamente la nueva categoría.'\n redirect_to categorias_path\n else\n render 'new'\n end\n end",
"def new\n @category = Category.new\n @top_categories = Category.top_categories\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def new\n get_supplier\n get_categories\n @supplier_category = @supplier.categories.new\n end",
"def new\n @category = @section.dish_categories.build\n\n\n respond_to do |format|\n format.html { render \"edit\"}\n format.json { render json: @category }\n end\n end",
"def create\n @exhibitor_category = ExhibitorCategory.new(params[:exhibitor_category])\n\n respond_to do |format|\n if @exhibitor_category.save\n format.html { redirect_to @exhibitor_category, notice: 'Exhibitor category was successfully created.' }\n format.json { render json: @exhibitor_category, status: :created, location: @exhibitor_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exhibitor_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n @title = \"Neue Kategorie erstellen\"\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @charity_category = CharityCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @charity_category }\n end\n end",
"def new\n @abuse_category = AbuseCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @abuse_category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @category }\n end\n end",
"def new\n @channel_category = ChannelCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @channel_category }\n end\n end",
"def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to management_categories_path }\n format.json { render json: @category, status: :created }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @category }\n end\n end",
"def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"def new\n @exam_category = ExamCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exam_category }\n end\n end",
"def new\n @event = Event.new\n @categories = Category.all or []\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def create\n if @category.save\n render json: @category, status: :created, location: @category\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def new\n @taxonomy = Taxonomy.new(:taxonomy_type => params[:taxonomy_type].presence || 'category')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taxonomy }\n end\n end"
] | [
"0.74364746",
"0.73833764",
"0.73656535",
"0.7362489",
"0.7362489",
"0.7362489",
"0.7362489",
"0.7362489",
"0.7362489",
"0.7362489",
"0.7362489",
"0.7362489",
"0.7344639",
"0.73279166",
"0.7327913",
"0.7300623",
"0.7237526",
"0.7175016",
"0.71696764",
"0.71354294",
"0.71328616",
"0.7131727",
"0.71264595",
"0.7124879",
"0.7123689",
"0.70924675",
"0.7084681",
"0.7060058",
"0.70527756",
"0.7050586",
"0.70462334",
"0.7045736",
"0.7031568",
"0.70180607",
"0.70121676",
"0.7008635",
"0.7006215",
"0.7006215",
"0.69988585",
"0.698026",
"0.69795865",
"0.6967504",
"0.69673526",
"0.696385",
"0.696385",
"0.6937358",
"0.6937358",
"0.69336027",
"0.6931074",
"0.6931074",
"0.6931074",
"0.6931074",
"0.6931074",
"0.6931074",
"0.6931074",
"0.6931074",
"0.6931007",
"0.69217014",
"0.6913536",
"0.69011015",
"0.6889465",
"0.68874663",
"0.6858061",
"0.6855489",
"0.68543106",
"0.685297",
"0.685297",
"0.685297",
"0.68411815",
"0.68405247",
"0.6837815",
"0.683508",
"0.6824391",
"0.6823238",
"0.68194604",
"0.6809301",
"0.68061",
"0.6803738",
"0.6795181",
"0.6786995",
"0.6777835",
"0.6776232",
"0.6772481",
"0.6767868",
"0.67662877",
"0.6762601",
"0.6762289",
"0.6759539",
"0.67570686",
"0.67464674",
"0.6736523",
"0.67361534",
"0.67361534",
"0.67361534",
"0.67361534",
"0.67348903",
"0.67334837",
"0.67334026",
"0.67279536",
"0.6725566"
] | 0.77980167 | 0 |
POST /exhibitior_categories POST /exhibitior_categories.json | def create
@exhibitior_category = ExhibitiorCategory.new(params[:exhibitior_category])
respond_to do |format|
if @exhibitior_category.save
format.html { redirect_to @exhibitior_category, notice: 'Exhibitior category was successfully created.' }
format.json { render json: @exhibitior_category, status: :created, location: @exhibitior_category }
else
format.html { render action: "new" }
format.json { render json: @exhibitior_category.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @categoria = Categoria.new(categoria_params)\n if @categoria.save\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end",
"def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend",
"def CreateCategory params = {}\n \n APICall(path: 'categories.json',method: 'POST',payload: params.to_json)\n \n end",
"def create\n @category = Category.new(category_params)\n @category.save\n render json: { params: params, notice: 'Categoria registrada exitosamente' }\n end",
"def create\n if params[:categoria_producto]\n p = Producto.find(params[:producto_id])\n c = Categoria.find(params[:categoria_id])\n\n if p.categorias << c\n render json: c, status: :created\n else\n render json: {:errors => {categoria: [\"No se ha podido agregar categoria\"]}}, status: :unprocessable_entity\n end\n\n else\n @categoria = Categoria.new(parametros_categoria)\n\n if @categoria.save\n render json: @categoria, status: :created\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end\n end",
"def create\n @incidentcategory = Incidentcategory.new(incidentcategory_params)\n\n if @incidentcategory.save\n json_response(@incidentcategory)\n else\n render json: @incidentcategory.errors, status: :unprocessable_entity\n end\n end",
"def create\n @categoria = Categoria.new(params[:categoria])\n\n respond_to do |format|\n if @categoria.save\n format.html { redirect_to action: 'index', notice: 'Categoria was successfully created.' }\n format.json { render json: @categoria, status: :created, location: @categoria }\n else\n format.html { render action: \"new\" }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categorium = Categorium.new(categorium_params)\n\n respond_to do |format|\n if @categorium.save\n format.html { redirect_to @categorium, notice: 'Categoría fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @categorium }\n else\n format.html { render :new }\n format.json { render json: @categorium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categorialivro = Categorialivro.new(params[:categorialivro])\n\n respond_to do |format|\n if @categorialivro.save\n format.html { redirect_to @categorialivro, :notice => 'Categorialivro was successfully created.' }\n format.json { render :json => @categorialivro, :status => :created, :location => @categorialivro }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @categorialivro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @expense = @current_user.expenses.create(params[:expense])\n params[:expense][:categories].each do |category_id|\n category_id = category_id.to_i\n if category_id > 0\n @expense.categories << Category.find(category_id)\n end\n end\n respond_to do |format|\n if @expense.save\n flash[:notice] = 'Expense was successfully created.'\n format.html { redirect_to(@expense) }\n format.xml { render :xml => @expense, :status => :created, :location => @expense }\n format.iphone { redirect_to(@expense) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @expense.errors, :status => :unprocessable_entity }\n format.iphone { render :action => \"new\" }\n end\n end\n end",
"def create\n @categorization = Categorization.new(params[:categorization])\n @categories = category_list\n respond_to do |format|\n if @categorization.save\n format.html { redirect_to(admin_categorization_path(@categorization), :notice => 'Categorization was successfully created.') }\n format.xml { render :xml => @categorization, :status => :created, :location => @categorization }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @categorization.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n \n @categorias_tipo = CatTipo.new(params[:cat_tipo])\n\n\t\trespond_to do |format|\n\t\t\tif @categorias_tipo.save\n \t\t\tcategories = @categorias_tipo.update_attributes(:tipo_acc_ids =>params[:tipo_accs])\n\t\t\t\t@categorias_tipo.update_attributes(:estado_ids =>params[:estados])\n\t\t\t\t\n\t\t\t\n\n format.html { redirect_to cat_tipos_path, notice: 'OK' }\n format.json { render json: @categorias_tipo, status: :created, location: @categorias_tipo }\n\t\t\telse\n format.html { render action: \"new\" }\n format.json { render json: @categorias_tipo.errors, status: :unprocessable_entity }\n \tend\t\n\t\tend\n\tend",
"def create\n category = @current_user.categories.create!(category_params)\n render json: { category: category }\n end",
"def create\n json_create(category_params, Category)\n end",
"def create\n @exercise_category = ExerciseCategory.new(params[:exercise_category].permit(:name, :organization_id))\n\n respond_to do |format|\n if @exercise_category.save\n format.html { redirect_to exercise_categories_path }\n format.json { render json: exercise_categories_path, status: :created, location: @exercise_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exercise_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categoria = Categoria.new(categoria_params)\n\n if @categoria.save\n flash[:success] = 'Se inserto exitosamente la nueva categoría.'\n redirect_to categorias_path\n else\n render 'new'\n end\n end",
"def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def create\n @proyectos_categoria = ProyectosCategoria.new(proyectos_categoria_params)\n\n respond_to do |format|\n if @proyectos_categoria.save\n format.html { redirect_to @proyectos_categoria, notice: 'Proyectos categoria was successfully created.' }\n format.json { render :show, status: :created, location: @proyectos_categoria }\n else\n format.html { render :new }\n format.json { render json: @proyectos_categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend",
"def create\n @category = current_user.categories.new(name: params[:name])\n if @category.save\n render \"create.json.jbuilder\", status: :created\n else\n render json: { errors: @category.errors.full_messages }, status: :unprocessable_entity\n end\n end",
"def new\n @exhibitior_category = ExhibitiorCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exhibitior_category }\n end\n end",
"def create\n if @category.save\n render json: @category, status: :created, location: @category\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def create\n \n category = params[:category]\n category_name = category['name']\n \n write_log(\"category.to_s: #{category.to_s}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n \n cats = []\n if category_name != nil\n cats = category_name.split(\" \")\n end\n \n write_log(\"cats.size: #{cats.size}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n if cats.size > 1\n \n flag = true\n counter = 0\n \n cats.each do |cat|\n # @category = Category.new(params[:category])\n # @category = Category.new(name=cat)\n @category = Category.new({\"name\"=> cat, \"genre_id\"=> category['genre_id']})\n \n if @category.save\n else\n counter += 1\n end\n end#cats.each do |cat|\n \n respond_to do |format|\n format.html { redirect_to @category, \n notice: \"New categories: Created => #{cats.size - counter}, Failed => #{counter}\" }\n format.json { render json: @category, status: :created, location: @category }\n end\n \n else#if cats.size > 1\n @category = Category.new(params[:category])\n \n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end#if cats.size > 1\n \n \n # @category = Category.new(params[:category])\n# \n # respond_to do |format|\n # if @category.save\n # format.html { redirect_to @category, notice: 'Category was successfully created.' }\n # format.json { render json: @category, status: :created, location: @category }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def user_category\n # byebug\n @user = User.where(contact: params[:contact]).first\n params[:category_ids].each do |category|\n @user.user_categories.create!(category_id: category, user_id: @user.id)\n end\n render json: {status: \"SUCCESS\", message: \"user-data\", data: \"category saved\"}, status: :ok\n end",
"def create\n @categoria = Categoria.new(params[:categoria])\n\n respond_to do |format|\n if @categoria.save\n format.html { redirect_to [:admin, @categoria], :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @categoria, :status => :created, :location => @categoria }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @categoria.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @categ = Categ.new(categ_params)\n\n respond_to do |format|\n if @categ.save\n format.html { redirect_to @categ, notice: 'Categ was successfully created.' }\n format.json { render :show, status: :created, location: @categ }\n else\n format.html { render :new }\n format.json { render json: @categ.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mk_categoria = MkCategoria.new(mk_categoria_params)\n\n respond_to do |format|\n if @mk_categoria.save\n format.html { redirect_to @mk_categoria, notice: 'Mk categoria was successfully created.' }\n format.json { render :show, status: :created, location: @mk_categoria }\n else\n format.html { render :new }\n format.json { render json: @mk_categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @echocategory = current_profile.echocategories.build(echocategory_params)\n\n respond_to do |format|\n if @echocategory.save\n format.html { redirect_to @echocategory, notice: 'Echocategory was successfully created.' }\n format.json { render :show, status: :created, location: @echocategory }\n else\n format.html { render :new }\n format.json { render json: @echocategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categorie_analytique = CategorieAnalytique.new(params[:categorie_analytique])\n\n respond_to do |format|\n if @categorie_analytique.save\n format.html { redirect_to @categorie_analytique, notice: 'Categorie analytique was successfully created.' }\n format.json { render json: @categorie_analytique, status: :created, location: @categorie_analytique }\n else\n format.html { render action: \"new\" }\n format.json { render json: @categorie_analytique.errors, status: :unprocessable_entity }\n end\n end\n end",
"def modify_category(categories)\n begin\n puts Rainbow(\"Current categories: #{categories.join(', ')}\").whitesmoke\n yield\n\n write_json(categories, \"Categories/cat\", \"Available categories are: #{categories.join(', ')}\")\n rescue StandardError\n puts \"There are no categories to delete\"\n end\nend",
"def create\n @categor = Categor.new(categor_params)\n\n respond_to do |format|\n if @categor.save\n format.html { redirect_to @categor, notice: 'Categor was successfully created.' }\n format.json { render :show, status: :created, location: @categor }\n else\n format.html { render :new }\n format.json { render json: @categor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @accessory_category = AccessoryCategory.new(accessory_category_params)\n\n if @accessory_category.save\n audit(@accessory_category, current_user)\n render json: @accessory_category, status: :created\n else\n render json: @accessory_category.errors, status: :unprocessable_entity\n end\n end",
"def create\n @exhibitor_category = ExhibitorCategory.new(params[:exhibitor_category])\n\n respond_to do |format|\n if @exhibitor_category.save\n format.html { redirect_to @exhibitor_category, notice: 'Exhibitor category was successfully created.' }\n format.json { render json: @exhibitor_category, status: :created, location: @exhibitor_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exhibitor_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n category = Category.create(category_params)\n\n \n if category\n render json:{\n status: :created,\n category: category}\n else\n render json: { status: 500 }\n end\n end",
"def create\n @exercise_category = ExerciseCategory.new(params[:exercise_category])\n\n respond_to do |format|\n if @exercise_category.save\n format.html { redirect_to @exercise_category, notice: 'Exercise category was successfully created.' }\n format.json { render json: @exercise_category, status: :created, location: @exercise_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exercise_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = current_mall.categories.new(params[:category])\n\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def create\n @category = Category.new(category_params)\n authorize! :create, @category\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def create\n @categories = Category.all\n\n @category = Category.create(category_params)\n flash[:notice]=\"Catégorie créer avec succès!!!\"\n end",
"def create\n @excategory = Excategory.new(excategory_params)\n\n respond_to do |format|\n if @excategory.save\n format.html { redirect_to @excategory, notice: 'Excategory was successfully created.' }\n format.json { render :show, status: :created, location: @excategory }\n else\n format.html { render :new }\n format.json { render json: @excategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def categories=(value)\n @categories = value\n end",
"def create\n @categoria = Categoria.new(params[:categoria])\n\n @categoria.save\n render :layout => false\n end",
"def create\n @categorie = Categorie.new(params[:categorie])\n\n if @categorie.save\n redirect_to :action => :index\n else\n respond_to do |format|\n format.html { render :action => \"new\" }\n format.xml { render :xml => @categorie.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @categoria_ing = CategoriaIng.new(categoria_ing_params)\n\n respond_to do |format|\n if @categoria_ing.save\n format.html { redirect_to @categoria_ing, notice: 'Categoria ing was successfully created.' }\n format.json { render :show, status: :created, location: @categoria_ing }\n else\n format.html { render :new }\n format.json { render json: @categoria_ing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categoriafinaceiro = Categoriafinaceiro.new(categoriafinaceiro_params)\n\n respond_to do |format|\n if @categoriafinaceiro.save\n format.html { redirect_to @categoriafinaceiro, notice: 'Categoria cadastrada com sucesso.' }\n format.json { render :show, status: :created, location: @categoriafinaceiro }\n else\n format.html { render :new }\n format.json { render json: @categoriafinaceiro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categorie_competence = CategorieCompetence.new(categorie_competence_params)\n\n respond_to do |format|\n if @categorie_competence.save\n format.html { redirect_to @categorie_competence, notice: 'Categorie competence was successfully created.' }\n format.json { render :show, status: :created, location: @categorie_competence }\n else\n format.html { render :new }\n format.json { render json: @categorie_competence.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n # @category = Category.new(params[:category])\n @category = current_user.categories.build(params[:category])\n\n respond_to do |format|\n if @category.save\n # format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.html { redirect_to categories_path, notice: 'Pomyślnie utworzono kategorię.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n # format.html { render action: \"new\" }\n format.html { redirect_to categories_path, :flash => { :error => 'Nie udało się utworzyć kategorii' } }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categories = Category.all\n @organisateurs = Organisateur.where(user_id: current_user.id)\n\n @evenement = Evenement.new(evenement_params)\n cat = Category.find(params[:category_id])\n org = Organisateur.find(params[:organisateur_id])\n @evenement.category = cat\n @evenement.organisateur = org\n respond_to do |format|\n if @evenement.save\n format.html { redirect_to event_show_path(@evenement.id), notice: 'Evenement was successfully created.' }\n format.json { render :show, status: :created, location: @evenement }\n else\n format.html { render :new }\n format.json { render json: @evenement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n if params[:project][:category_list].present?\n @project.category_list = []\n params[:project][:category_list].each do |cat|\n @project.category_list.add(cat)\n end \n end\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categories_category_expense = manager.create(categories_category_expense_params, current_user)\n\n respond_to do |format|\n if @categories_category_expense.save\n format.html { redirect_to categories_category_expenses_path, notice: 'Category expense was successfully created.' }\n format.json { render :show, status: :created, location: @categories_category_expense }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @categories_category_expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categoria = Categoria.new(categoria_params)\n\n respond_to do |format|\n if @categoria.save\n format.html { redirect_to categorias_path, notice: @@titulo + t('msg.salva') }\n format.json { render :show, status: :created, location: @categoria }\n else\n format.html { redirect_to categorias_path, alert: @categoria.errors.messages }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"def explore_params\n params.permit(category:[])\n end",
"def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to adminpanel_categories_path, notice: \"Категория #{@category.name} успешно создана\" }\n format.json { render :show, status: :created, location: adminpanel_categories_path }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @expense = Expense.new(params[:expense])\n unless @expense.date\n @expense.date = Time.now.to_s[0,10]\n end\n @expense.currency_id = Currency.find_by_name('Euro').id\n @expense.user_id = current_user.id\n @expense.categories = params[:categories].split(',')\n\n respond_to do |format|\n if @expense.save\n add_tagger_to_taggings(@expense)\n format.html { redirect_to @expense, notice: 'Expense was successfully created.' }\n format.json { render json: @expense, status: :created, location: @expense }\n format.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def create\n @technology = Technology.new(params[:technology])\n @categories = Category.find(:all)\n\n respond_to do |format|\n if @technology.save\n flash[:success] = 'Technology was successfully created.'\n format.html { redirect_to @technology }\n format.json { render json: @technology, status: :created, location: @technology }\n else\n format.html { render action: \"new\" }\n format.json { render json: @technology.errors, status: :unprocessable_entity }\n end\n end\n end",
"def addCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.new(name: params[:name])\n status = c.save\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end",
"def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Категория была успешно создана'}\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def categories\n # @categories = Category.get_categories(@user.id)\n #@categories =Category.all.select(:id).select(:name).select(:description).select(:logo_url)\n @categories =Category.all\n user_cat= @user.categories.collect(&:id)\n categories = []\n @categories.each do |cat|\n cat_attr = cat.attributes\n user_cat.include?(cat.id) ? cat_attr.merge!('user_category' => true) : cat_attr.merge!('user_category' => false)\n categories << cat_attr\n end\n @categories = categories\n\n respond_to do |format|\n if @categories.blank?\n format.json {render json:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.xml {render xml:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.html {render json: {:success => false, :status_code => 404, :message => \"No category found\"}}\n else\n format.html {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.json {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.xml {render xml: {:success => true, :status_code => 200, :categories => @categories}}\n end\n end\n end",
"def categories=(categories)\n end",
"def create\n @categoria = Categoria.new(params[:categoria])\n\n respond_to do |format|\n if @categoria.save\n format.html { redirect_to(@categoria, :notice => 'Categoria was successfully created.') }\n format.xml { render :xml => @categoria, :status => :created, :location => @categoria }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @categoria.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @incidentcategory = Incidentcategory.new(incidentcategory_params)\n\n respond_to do |format|\n if @incidentcategory.save\n format.html { redirect_to incidentcategories_path, notice: 'Incidentcategory was successfully created.' }\n format.json { render :show, status: :created, location: @incidentcategory }\n else\n format.html { render :new }\n format.json { render json: @incidentcategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categories = Category.where(validity: true)\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t(:category_created) }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kategory = Kategory.new(params[:kategory])\n\n respond_to do |format|\n if @kategory.save\n format.html { redirect_to @kategory, notice: 'Kategory was successfully created.' }\n format.json { render json: @kategory, status: :created, location: @kategory }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @receipe_category = ReceipeCategory.new(receipe_category_params)\n\n respond_to do |format|\n if @receipe_category.save\n format.html { redirect_to @receipe_category, notice: 'Receipe category was successfully created.' }\n format.json { render :show, status: :created, location: @receipe_category }\n else\n format.html { render :new }\n format.json { render json: @receipe_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Категория добавлена.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = current_user\n @category = Category.new(params[:category])\n @user.categories << @category\n #TODO: error handling\n #TODO: AJAX this\n if @user.save\n redirect_to user_path(@user)\n else\n render \"new\"\n end\n end",
"def create\n @post_category = current_user.post_categories.build(params[:post_category])\n\n respond_to do |format|\n if @post_category.save\n format.html { redirect_to [:client,:post_categories], notice: 'Post category was successfully created.' }\n format.json { render json: @post_category, status: :created, location: @post_category }\n else\n format.html { render action: \"index\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def categorium_params\n params.require(:categorium).permit(:categoria)\n end",
"def create\n @activo_categoria_ci = Activo::CategoriaCi.new(params[:activo_categoria_ci])\n\n respond_to do |format|\n if @activo_categoria_ci.save\n format.html { redirect_to edit_activo_categoria_ci_path(@activo_categoria_ci), notice: 'Guardado Correctamente.' }\n format.json { render json: @activo_categoria_ci, status: :created, location: @activo_categoria_ci }\n else\n format.html { render action: \"new\" }\n format.json { render json: @activo_categoria_ci.errors, status: :unprocessable_entity }\n end\n end\n end",
"def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend",
"def create\n @cathegory = Cathegory.new(cathegory_params)\n\n respond_to do |format|\n if @cathegory.save\n format.html { redirect_to @cathegory, notice: 'Cathegory was successfully created.' }\n format.json { render :show, status: :created, location: @cathegory }\n else\n format.html { render :new }\n format.json { render json: @cathegory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @agendacategory = Agendacategory.new(agendacategory_params)\n\n respond_to do |format|\n if @agendacategory.save\n format.html { redirect_to @agendacategory, notice: 'Agendacategory was successfully created.' }\n format.json { render :show, status: :created, location: @agendacategory }\n else\n format.html { render :new }\n format.json { render json: @agendacategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n if @category.save\n flash[:notice] = 'Categoria criada com sucesso.'\n else\n flash[:notice] = 'Erro ao salvar a categoria.'\n end\n\n # respond_to do |format|\n # if @category.save\n # format.html { redirect_to categories_path}\n # format.json { render json: @category, status: :created, location: @category }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def get_department_categories\n json_response({ message: 'NOT IMPLEMENTED' })\n end",
"def create\n @profile = current_user.profile\n\n if (params[:first_signup] == \"true\")\n #first signup explores update\n @list = @profile.explore_categories.pluck(:id).uniq\n @category = JSON.parse(params[\"exploreCategories\"])[\"exp_categories\"]\n # @categories_to_add = @selected_categories.reject{|x| @saved_categories.include? x.to_i}\n\n @add_cat = @category - @list\n @del_cat = @list - @category\n\n @add_cat.each do |x|\n @explore= Explore.new\n @explore.profile = @profile\n @explore.category = Category.find(x)\n @explore.save\n end\n @del_cat.each do |x|\n @profile.explore_categories.destroy(Category.find(x))\n end\n\n respond_to do |format|\n format.html { redirect_to '/profile/guides', notice: 'Explores was successfully added.' }\n format.json { render :show, status: :ok, location: @profile }\n end\n\n else\n #edit categories from profile page\n @list = @profile.explore_categories.pluck(:id).uniq\n @category = JSON.parse(params[\"exploreCategories\"])[\"exp_categories\"]\n\n @add_cat = @category - @list\n @del_cat = @list - @category\n\n @add_cat.each do |x|\n @explore= Explore.new\n @explore.profile = @profile\n @explore.category = Category.find(x.to_i)\n @explore.save\n end\n\n @del_cat.each do |x|\n @profile.explore_categories.destroy(Category.find(x))\n end\n\n flash[:success] = \"Explore was successfully created\"\n redirect_to profiles_path\n end\n end",
"def get_menu_category\n require \"rest_client\"\n require \"json\"\n\n self.categories.update_all(still_present: false)\n response = RestClient.get(\"https://api.omnivore.io/0.1/locations/#{self.omnivore_id}/menu/categories\", {:content_type => :json, :'Api-Key' => Setting.first.app_api_key})\n res = JSON.parse(response)\n res[\"_embedded\"][\"categories\"].each do |category|\n cat = self.categories.where(omnivore_id: category[\"id\"]).first_or_create\n cat.name = category[\"name\"]\n cat.still_present = true\n cat.save\n end\n\n self.categories.where(still_present: false).destroy_all\n end",
"def categoria_params\n params.require(:categoria).permit(:descricao, :ativo)\n end",
"def create\n @category = Category.new(category_params)\n\n\n begin\n Category.transaction do # un ActiveRecord\n #@full_category.each do |f|\n #Category.create(f)\n #f.save!\n #end\n @category.save!\n end\n #Código de éxito\n rescue => e\n raise ActiveRecord::Rollback #Lanzamos el rollback de nuevo a saco\n #Seguimos con las acciones que queramos, como notificar, etc.\n end\n\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_category_path(@category), notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @article = Article.new(article_params)\n\n @article.user = current_user\n\n @article.save_categories\n\n respond_to do |format|\n\n if @article.save\n\n format.html { redirect_to @article, notice: \"Article was successfully created.\" }\n\n format.json { render :show, status: :created, location: @article }\n\n else\n\n format.html { render :new, status: :unprocessable_entity }\n\n format.json { render json: @article.errors, status: :unprocessable_entity }\n\n end\n\n end\n\n end",
"def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to management_categories_path }\n format.json { render json: @category, status: :created }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profession_category = ProfessionCategory.new(profession_category_params)\n\n respond_to do |format|\n if @profession_category.save\n format.html { redirect_to profession_categories_path, notice: 'Profession category was successfully created.' }\n format.json { render :show, status: :created, location: @profession_category }\n else\n format.html { render :new }\n format.json { render json: @profession_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n @category.user_id=current_user.id\n \n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Categorie was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def categoria_params\n params.require(:categoria).permit(:nombre, :limInferior, :limSuperior)\n end",
"def meal_categories\n # API EXAMPLE: https://www.themealdb.com/api/json/v1/1/list.php?c=list\n content = api_call('list.php?c=list')\n validate(content)\n content\n end",
"def create\n @subcategorium = Subcategorium.new(subcategorium_params)\n\n respond_to do |format|\n if @subcategorium.save\n format.html { redirect_to @subcategorium, notice: 'Subcategorium was successfully created.' }\n format.json { render :show, status: :created, location: @subcategorium }\n else\n format.html { render :new }\n format.json { render json: @subcategorium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exam_category = ExamCategory.new(params[:exam_category])\n\n respond_to do |format|\n if @exam_category.save\n format.html { redirect_to @exam_category, notice: 'Exam category was successfully created.' }\n format.json { render json: @exam_category, status: :created, location: @exam_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exam_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @interviewcategory = Interviewcategory.new(interviewcategory_params)\n\n respond_to do |format|\n if @interviewcategory.save\n format.html { redirect_to @interviewcategory, notice: \"Interviewcategory was successfully created.\" }\n format.json { render :show, status: :created, location: @interviewcategory }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @interviewcategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categorie_endroit = CategorieEndroit.new(params[:categorie_endroit])\n\n respond_to do |format|\n if @categorie_endroit.save\n format.html { redirect_to @categorie_endroit, notice: 'Categorie endroit was successfully created.' }\n format.json { render json: @categorie_endroit, status: :created, location: @categorie_endroit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @categorie_endroit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @convention_category = ConventionCategory.new(params[:convention_category])\n\n add_missing_translation_content(@convention_category.convention_category_translations)\n\n respond_to do |format|\n if @convention_category.save\n format.html { redirect_to admin_convention_categories_path, notice: t('app.msgs.success_created', :obj => t('activerecord.models.convention_category')) }\n format.json { render json: @convention_category, status: :created, location: @convention_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @convention_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def categories=(value)\n @categories = value\n end",
"def categories=(value)\n @categories = value\n end",
"def categories=(value)\n @categories = value\n end",
"def create_category\n @category = TestCategory.new(params[:category])\n @category.save\n @categories = TestCategory.find(:all)\n redraw 'categories'\n end",
"def create\n @pcategory = Pcategory.new(params[:pcategory])\n\n respond_to do |format|\n if @pcategory.save\n format.html { redirect_to @pcategory, notice: 'La categoria se creo satisfactoriamente.' }\n format.json { render json: @pcategory, status: :created, location: @pcategory }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pcategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@category = Category.new(category_params)\n\t\t@category.user = current_user\n\t\tif(category_params[:titulo] == \"Geral\")\n\t\t\t@category.titulo = \"Geral (nova)\"\n\t\tend\n\t\trespond_to do |format|\n\t\t\tif @category.save\n\t\t\t\tformat.html { redirect_to @category, notice: 'Category criada com sucesso!' }\n\t\t\t\tformat.json { render :show, status: :created, location: @category }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @category.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n @category = Category.create(params[:category])\n respond_with(@category, location: categories_url)\n end",
"def create\n @coach_category = CoachCategory.new(coach_category_params)\n\n respond_to do |format|\n if @coach_category.save\n format.html { redirect_to @coach_category, notice: 'Categoria de treinador foi criada com sucesso.' }\n format.json { render action: 'show', status: :created, location: @coach_category }\n else\n format.html { render action: 'new' }\n format.json { render json: @coach_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @charity_category = CharityCategory.new(params[:charity_category])\n\n respond_to do |format|\n if @charity_category.save\n format.html { redirect_to admins_charity_categories_url, notice: 'Charity Category was successfully created.' }\n format.json { render json: @charity_category, status: :created, location: @charity_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @charity_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def categories=(value)\n\t\t@categories = value\n\tend",
"def categories=(value)\n\t\t@categories = value\n\tend"
] | [
"0.67995447",
"0.67280954",
"0.6692331",
"0.6446782",
"0.64250207",
"0.6298797",
"0.62950927",
"0.6272612",
"0.6272286",
"0.62249583",
"0.62238014",
"0.621838",
"0.61868274",
"0.61715853",
"0.61662114",
"0.61554",
"0.61518496",
"0.6138151",
"0.6121284",
"0.6093589",
"0.60908616",
"0.6085796",
"0.60809445",
"0.60590476",
"0.60500187",
"0.6032568",
"0.6029759",
"0.6024609",
"0.6013093",
"0.597123",
"0.59691",
"0.59681064",
"0.5965803",
"0.59462726",
"0.59456486",
"0.59381837",
"0.5937243",
"0.5936242",
"0.5935556",
"0.59338254",
"0.59330755",
"0.59277415",
"0.59221905",
"0.5909412",
"0.59092313",
"0.59078974",
"0.59034675",
"0.590141",
"0.58779234",
"0.58759266",
"0.5865423",
"0.5861485",
"0.58611244",
"0.5857697",
"0.5844695",
"0.5836298",
"0.5833802",
"0.58238065",
"0.58047533",
"0.5801266",
"0.57970256",
"0.5793532",
"0.5791485",
"0.5787871",
"0.57858324",
"0.5784978",
"0.5769009",
"0.57661015",
"0.57649964",
"0.5763525",
"0.5761042",
"0.5746488",
"0.5739487",
"0.5735309",
"0.5732691",
"0.57324606",
"0.573233",
"0.57309854",
"0.5725288",
"0.5716539",
"0.5703953",
"0.57001805",
"0.5694914",
"0.5683231",
"0.5679985",
"0.56748337",
"0.5673032",
"0.5671789",
"0.56705076",
"0.56665516",
"0.56665516",
"0.56665516",
"0.5656108",
"0.5654779",
"0.56526357",
"0.56484556",
"0.5646578",
"0.56463444",
"0.5646314",
"0.5646314"
] | 0.698518 | 0 |
PUT /exhibitior_categories/1 PUT /exhibitior_categories/1.json | def update
@exhibitior_category = ExhibitiorCategory.find(params[:id])
respond_to do |format|
if @exhibitior_category.update_attributes(params[:exhibitior_category])
format.html { redirect_to @exhibitior_category, notice: 'Exhibitior category was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @exhibitior_category.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def UpdateCategory params = {}\n \n APICall(path: 'categories.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update_categories(categories, options = {} )\n options.merge!(:docid => self.docid, :categories => categories)\n resp = @conn.put do |req|\n req.url \"categories\"\n req.body = options.to_json\n end\n\n resp.status \n end",
"def update\n\n existing_categories = (Exercise.find_by id: params[:id]).categories\n is_already_category = (Exercise.find_by id: params[:id]).exercise_categorizations.pluck(:category_id).include? params[:category_id].to_i\n\n if(params[:checked] == \"checked\" )\n if(!is_already_category)\n existing_categories << (Category.find_by id: params[:category_id])\n end\n else\n if(is_already_category)\n existing_categories.delete(params[:category_id])\n end\n end\n\n respond_to do |format|\n if @exercise.update(exercise_params)\n format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @categoria.update(categoria_params)\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity \n end\n end",
"def update\n @expense.categories_expenses.destroy_all\n if (params[:expense][:categories]) \n params[:expense][:categories].each do |category_id|\n category_id = category_id.to_i\n if category_id > 0\n @expense.categories << Category.find(category_id)\n end\n end\n end\n\n respond_to do |format|\n if @expense.update_attributes(params[:expense])\n flash[:notice] = 'Expense was successfully updated.'\n format.html { redirect_to(@expense) }\n format.xml { head :ok }\n format.iphone { redirect_to :controller => \"welcome\", :action => \"home\" }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @expense.errors, :status => :unprocessable_entity }\n format.iphone { render :action => \"edit\" }\n end\n end\n end",
"def update\n @exhibitor_category = ExhibitorCategory.find(params[:id])\n\n respond_to do |format|\n if @exhibitor_category.update_attributes(params[:exhibitor_category])\n format.html { redirect_to @exhibitor_category, notice: 'Exhibitor category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exhibitor_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n json_update(category,category_params, Category)\n end",
"def update\n @exercise_category = ExerciseCategory.find(params[:id])\n \n respond_to do |format|\n if @exercise_category.update_attributes(params[:exercise_category])\n format.html { redirect_to exercise_categories_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exercise_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n existing_categories = (Ebook.find_by id: params[:id]).categories\n is_already_category = (Ebook.find_by id: params[:id]).ebook_categorizations.pluck(:category_id).include? params[:category_id].to_i\n\n if(params[:checked] == \"checked\" )\n if(!is_already_category)\n existing_categories << (Category.find_by id: params[:category_id])\n end\n else\n if(is_already_category)\n existing_categories.delete(params[:category_id])\n end\n end\n\n respond_to do |format|\n if @ebook.update(ebook_params)\n format.html { redirect_to @ebook, notice: \"#{@ebook_name} was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ebook.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @category.update(params[:category])\n head :no_content\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def update\n @categorialivro = Categorialivro.find(params[:id])\n\n respond_to do |format|\n if @categorialivro.update_attributes(params[:categorialivro])\n format.html { redirect_to @categorialivro, :notice => 'Categorialivro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @categorialivro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n if @categoria.update_attributes(params[:categoria])\n format.html { redirect_to action: 'index', notice: 'Categoria was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @accessory_category = AccessoryCategory.find(params[:id])\n\n if @accessory_category.update(accessory_category_params)\n audit(@accessory_category, current_user)\n head :no_content\n else\n render json: @accessory_category.errors, status: :unprocessable_entity\n end\n end",
"def update\n if params[:create_exercise_category]\n cu_id = current_user.id\n category = ExerciseCategory.find_or_new_by_category(cu_id, params[:create_category])\n params[:exercise][:exercise_category_attributes][:category] = category.category\n @exercise = current_user.exercises.find_by_id(params[:id])\n @exercise.exercise_category = category\n set_up_categories\n else\n @exercise = current_user.exercises.find_by_id(params[:id])\n if @exercise.update_attributes(params[:exercise])\n flash[:notice] = 'Edit was successful'\n redirect_to :action => 'show', :id => @exercise.id\n return\n else\n flash.now[:error] = \"Your exercise didn't update properly\"\n flash.now[:errors] = @exercise.errors\n end\n end\n render :action => 'edit'\n end",
"def create\n @exhibitior_category = ExhibitiorCategory.new(params[:exhibitior_category])\n\n respond_to do |format|\n if @exhibitior_category.save\n format.html { redirect_to @exhibitior_category, notice: 'Exhibitior category was successfully created.' }\n format.json { render json: @exhibitior_category, status: :created, location: @exhibitior_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exhibitior_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @exercise_category = ExerciseCategory.find(params[:id])\n\n respond_to do |format|\n if @exercise_category.update_attributes(params[:exercise_category])\n format.html { redirect_to @exercise_category, notice: 'Exercise category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exercise_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @incidentcategory.update(incidentcategory_params)\n json_response(@incidentcategory)\n else\n render json: @incidentcategory.errors, status: :unprocessable_entity\n end\n end\n end",
"def modify_category(categories)\n begin\n puts Rainbow(\"Current categories: #{categories.join(', ')}\").whitesmoke\n yield\n\n write_json(categories, \"Categories/cat\", \"Available categories are: #{categories.join(', ')}\")\n rescue StandardError\n puts \"There are no categories to delete\"\n end\nend",
"def user_category_edit\n @user = User.where(contact: params[:contact]).first\n @user.categories.destroy_all\n params[:category_ids].each do |category|\n @user.user_categories.create!(category_id: category, user_id: @user.id)\n end\n render json: {status: \"SUCCESS\", message: \"user-categories\", data: \"categories updated\"}, status: :ok\n end",
"def update\n if @category.update(category_params)\n render json: @category, status: :ok\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def update(request)\n if options[:multiple]\n cats = request.every(options[:category])\n cats.each do |cat|\n if cat || options[:nils]\n @categories[cat] ||= 0\n @categories[cat] += 1\n end \n end\n \n else\n cat = @categorizer.call(request)\n if cat || options[:nils]\n @categories[cat] ||= 0\n @categories[cat] += 1\n end\n end\n end",
"def update\n @expense = @household.expenses.find(params[:id])\n respond_to do |format|\n if @expense.update(expense_params)\n\n # c = Category.find cat_params[:category].to_i\n #\n # if @expense.categories << c\n # puts 'SUPER'\n # else\n # puts 'SCHEIßE'\n # end\n\n flash[:alert] = 'Expense was successfully updated.'\n format.html {redirect_to household_expenses_path(@household)}\n format.json {render :show, status: :ok, location: @expense}\n else\n format.html {render :edit}\n format.json {render json: @expense.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @categoria = Categoria.find(params[:id])\n\n @categoria.update_attributes(params[:categoria])\n render :layout => false\n end",
"def update\n @categorization = Categorization.find(params[:id])\n @categories = category_list\n respond_to do |format|\n if @categorization.update_attributes(params[:categorization])\n format.html { redirect_to(admin_categorization_path(@categorization), :notice => 'Categorization was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @categorization.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\t @expense = Expense.find(params[:id])\n\t @expense.categories = params[:categories].split(',')\n\n respond_to do |format|\n if @expense.update_attributes(params[:expense])\n add_tagger_to_taggings(@expense)\n format.html { redirect_to @expense, notice: 'Expense was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n update! {admin_categories_path}\n end",
"def update\n @categorias = CategoriaObjeto.all.order(:nome).map { |categoria| [categoria.nome, categoria.id]}.prepend(['Selecione uma categoria', 0])\n \n respond_to do |format|\n if @objeto.update(objeto_params)\n format.html { redirect_to @objeto, notice: 'Objeto was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_categories_category_expense\n @categories_category_expense = Categories::CategoryExpense.find(params[:id])\n end",
"def update!(**args)\n @categories = args[:categories] if args.key?(:categories)\n end",
"def update!(**args)\n @categories = args[:categories] if args.key?(:categories)\n end",
"def set_excategory\n @excategory = Excategory.find(params[:id])\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @excategory.update(excategory_params)\n format.html { redirect_to @excategory, notice: 'Excategory was successfully updated.' }\n format.json { render :show, status: :ok, location: @excategory }\n else\n format.html { render :edit }\n format.json { render json: @excategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n @echocategory = Echocategory.friendly.find(params[:id])\n\n\n respond_to do |format|\n if @echocategory.update(echocategory_params)\n format.html { redirect_to @echocategory, notice: 'Echocategory was successfully updated.' }\n format.json { render :show, status: :ok, location: @echocategory }\n else\n format.html { render :edit }\n format.json { render json: @echocategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @headline = t(:update_category)\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: t(:updated_category_success) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @coach_category.update(coach_category_params)\n format.html { redirect_to @coach_category, notice: 'Categoria de treinador foi actualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @coach_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @exhibitior_category = ExhibitiorCategory.find(params[:id])\n @exhibitior_category.destroy\n\n respond_to do |format|\n format.html { redirect_to exhibitior_categories_url }\n format.json { head :no_content }\n end\n end",
"def update\n respond_to do |format|\n if @categ.update(categ_params)\n format.html { redirect_to @categ, notice: 'Categ was successfully updated.' }\n format.json { render :show, status: :ok, location: @categ }\n else\n format.html { render :edit }\n format.json { render json: @categ.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Sucesso - update'\n else\n flash[:notice] = 'Falha ao atualizar a categoria'\n end\n\n # respond_to do |format|\n # if @category.update_attributes(params[:category])\n # format.html { redirect_to categories_path}\n # format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n \n # end\n # end\n end",
"def update\n respond_to do |format|\n if @categorium.update(categorium_params)\n format.html { redirect_to @categorium, notice: 'Categoría fue actualizada exitosamente.' }\n format.json { render :show, status: :ok, location: @categorium }\n else\n format.html { render :edit }\n format.json { render json: @categorium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @word_list = current_user.word_list\n\n #need to first remove categories from the word\n @word.categories.each do |category|\n @word.categories.delete category\n end\n\n #then push categories in from the category_params\n if params[\"category\"].include?(:category_ids)\n (params[\"category\"])[\"category_ids\"].each do |i|\n next if i.to_i == 0\n @word.categories << Category.find(i.to_i) unless @word.categories.include?(Category.find(i.to_i))\n end\n end\n\n if category_params.include?(:title) && ((params[\"category\"])[\"title\"]) != \"\"\n @word.categories << @word_list.categories.build(title: (params[\"category\"])[\"title\"])\n end\n\n respond_to do |format|\n if @word.update(word_params)\n format.html { redirect_to @word_list, notice: 'Word was successfully updated.' }\n #format.json { render :show, status: :ok, location: @word }\n else\n format.html { render :edit }\n #format.json { render json: @word.errors, status: :unprocessable_entity }\n end\n end\n end",
"def editCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.find(params[:id])\n status = c.update(name: params[:name])\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end",
"def update\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n if @categoria.update_attributes(params[:categoria])\n format.html { redirect_to [:admin, @categoria], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @categoria.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\t\tif (@category.titulo != \"Geral\")\n\t\t\trespond_to do |format|\n\t\t\t\tif @category.update(category_params)\n\t\t\t\t\tformat.html { redirect_to @category, notice: 'Categoria atualizada com sucesso.' }\n\t\t\t\t\tformat.json { head :no_content }\n\t\t\t\telse\n\t\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\t\tformat.json { render json: @category.errors, status: :unprocessable_entity }\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def update\n @categorie = Categorie.find(params[:id])\n\n respond_to do |format|\n if @categorie.update_attributes(params[:categorie])\n format.html { redirect_to(@categorie, :notice => 'Categorie was successfully updated.') }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>@categorie}}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @categorie.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @categoria.update(categoria_params)\n format.html { redirect_to categorias_path, notice: @@titulo + t('msg.update') }\n format.json { render :show, status: :ok, location: @categoria }\n else\n format.html { render :edit }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @categorie_competence.update(categorie_competence_params)\n format.html { redirect_to @categorie_competence, notice: 'Categorie competence was successfully updated.' }\n format.json { render :show, status: :ok, location: @categorie_competence }\n else\n format.html { render :edit }\n format.json { render json: @categorie_competence.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @kategory = Kategory.find(params[:id])\n\n respond_to do |format|\n if @kategory.update_attributes(params[:kategory])\n format.html { redirect_to @kategory, notice: 'Kategory was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @exam_category = ExamCategory.find(params[:id])\n\n respond_to do |format|\n if @exam_category.update_attributes(params[:exam_category])\n format.html { redirect_to @exam_category, notice: 'Exam category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exam_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n if @categoria.update_attributes(params[:categoria])\n format.html { redirect_to(@categoria, :notice => 'Categoria was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @categoria.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @categorie_analytique = CategorieAnalytique.find(params[:id])\n\n respond_to do |format|\n if @categorie_analytique.update_attributes(params[:categorie_analytique])\n format.html { redirect_to @categorie_analytique, notice: 'Categorie analytique was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @categorie_analytique.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cathegory.update(cathegory_params)\n format.html { redirect_to @cathegory, notice: 'Cathegory was successfully updated.' }\n format.json { render :show, status: :ok, location: @cathegory }\n else\n format.html { render :edit }\n format.json { render json: @cathegory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @categorias_tipo = CatTipo.find(params[:id])\n\n respond_to do |format|\n if @categorias_tipo.update_attributes(params[:cat_tipo])\n \t\tcategories = @categorias_tipo.update_attributes(:tipo_acc_ids =>params[:tipo_accs])\n\t\t\t\t@categorias_tipo.update_attributes(:estado_ids =>params[:estados])\n format.html { redirect_to cat_tipos_path, notice: 'Categorias tipo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @categorias_tipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @proyectos_categoria.update(proyectos_categoria_params)\n format.html { redirect_to @proyectos_categoria, notice: 'Proyectos categoria was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyectos_categoria }\n else\n format.html { render :edit }\n format.json { render json: @proyectos_categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @components_category = Components::Category.find(params[:id])\n index\n respond_to do |format|\n if @components_category.update_attributes(params[:components_category])\n format.js { \n @notice = 'Categoria actualizada correctamente' \n render 'index'\n }\n else\n format.js { \n @notice = \"Error al actualizar categoria\"\n render action: \"edit\" }\n end\n end\n end",
"def update\n respond_to do |format|\n if @categoriafinaceiro.update(categoriafinaceiro_params)\n format.html { redirect_to @categoriafinaceiro, notice: 'Categoria alterada com sucesso.' }\n format.json { render :show, status: :ok, location: @categoriafinaceiro }\n else\n format.html { render :edit }\n format.json { render json: @categoriafinaceiro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def putCategory( category_id, language, name)\n params = Hash.new\n params['category_id'] = category_id\n params['language'] = language\n params['name'] = name\n return doCurl(\"put\",\"/category\",params)\n end",
"def set_incidentcategory\n @incidentcategory = Incidentcategory.find(params[:id])\n end",
"def set_incidentcategory\n @incidentcategory = Incidentcategory.find(params[:id])\n end",
"def update\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with(@category, location: categories_url)\n end",
"def update\n respond_to do |format|\n if @alien_category.update(alien_category_params)\n format.html { redirect_to @alien_category, notice: 'Alien category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @alien_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @service_category.name == \"Sin Categoría\"\n redirect_to service_categories_path, notice: 'No es posible actualizar la categoría \"Sin Categoría\".'\n end\n respond_to do |format|\n if @service_category.update(service_category_params)\n format.html { redirect_to service_categories_path, notice: 'Categoría de Servicios actualizada exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @service_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to category_index_path, notice: 'Categorie was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if params[:project][:category_list].present?\n @project.category_list = []\n params[:project][:category_list].each do |cat|\n @project.category_list.add(cat)\n end \n end\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { render :show, status: :ok, location: @project }\n else\n format.html { render :edit }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n @title = 'Kategorie ' + @category.title + ' bearbeiten'\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to categories_path, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @expenditure_category = ExpenditureCategory.find(params[:id])\n\n respond_to do |format|\n if @expenditure_category.update_attributes(params[:expenditure_category])\n format.any { head :ok }\n else\n format.any { render :text => @expenditure_account.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.json { render :show, status: :ok, location: @category }\n else\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @categorias = CategoriaObjeto.all.order(:nome).map { |categoria| [categoria.nome, categoria.id]}.prepend(['Selecione uma categoria', 0])\n respond_to do |format|\n if @objeto.update(objeto_params)\n format.html { render :success, :locals => {:e => 1} }\n else\n format.html { render :edit }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n params[:company][:category_ids] ||= []\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to(@company, :notice => 'Company was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @category.update_attributes(params[:category])\n respond_with(@category)\n end",
"def set_categ\n @categ = Categ.find(params[:id])\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { render \"add_categories\"}\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",
"def update_categories(cats=[])\n rescue_extra_data\n cats = cats.to_i\n old_categories = categories.pluck(\"#{CamaleonCms::TermTaxonomy.table_name}.id\")\n delete_categories = old_categories - cats\n news_categories = cats - old_categories\n term_relationships.where(\"term_taxonomy_id in (?)\", delete_categories ).destroy_all if delete_categories.present?\n news_categories.each do |key|\n term_relationships.create(:term_taxonomy_id => key)\n end\n update_counters(\"categories\")\n end",
"def update\n if current_category.category==\"noone\"\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n else\n render :file => \"/public/404.html\",:status => \"404\"\n end\n \n end",
"def update\n respond_to do |format|\n if @hive_category.update(hive_category_params)\n format.html { redirect_to @hive_category, notice: 'Hive category was successfully updated.' }\n format.json { render :show, status: :ok, location: @hive_category }\n else\n format.html { render :edit }\n format.json { render json: @hive_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pcategory = Pcategory.find(params[:id])\n\n respond_to do |format|\n if @pcategory.update_attributes(params[:pcategory])\n format.html { redirect_to @pcategory, notice: 'La categoria se modifico satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pcategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to api_v1_category_path(@category), notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @categoria.update(ativo: false)\n render json: @categoria\n end",
"def update\n unless @category.name == \"ROOT\"\n if @category.update(category_params)\n render 'show', :status => 200, :layout => false, notice: 'Category was successfully created.'\n else\n render :json => {:message => \"Error in updating category\"}, notice: @category.errors, :layout => false, :status => 400\n end\n else\n render :json => {:message => \"Root can't be edited.\"}, :layout => false, :status => 400\n end\n end",
"def set_interviewcategory\n @interviewcategory = Interviewcategory.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @incidentcategory.update(incidentcategory_params)\n format.html { redirect_to @incidentcategory, notice: 'Incidentcategory was successfully updated.' }\n format.json { render :show, status: :ok, location: @incidentcategory }\n else\n format.html { render :edit }\n format.json { render json: @incidentcategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @interviewcategory.update(interviewcategory_params)\n format.html { redirect_to @interviewcategory, notice: \"Interviewcategory was successfully updated.\" }\n format.json { render :show, status: :ok, location: @interviewcategory }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @interviewcategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @categor.update(categor_params)\n format.html { redirect_to @categor, notice: 'Categor was successfully updated.' }\n format.json { render :show, status: :ok, location: @categor }\n else\n format.html { render :edit }\n format.json { render json: @categor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n #params.require(:article).permit(:title, :status)\n\n respond_to do |format|\n\n if @article.update(article_params)\n\n @article.save_categories\n\n format.html { redirect_to @article, notice: \"Article was successfully updated.\" }\n\n format.json { render :show, status: :ok, location: @article }\n\n else\n\n format.html { render :edit, status: :unprocessable_entity }\n\n format.json { render json: @article.errors, status: :unprocessable_entity }\n\n end\n\n end\n\n end",
"def set_category\n @categories = Category.find(params[:id])\n end",
"def update\n @post_category = current_user.post_categories.find(params[:id])\n\n respond_to do |format|\n if @post_category.update_attributes(params[:post_category])\n format.html { redirect_to [:client,@post_category], notice: 'Post category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mk_categoria.update(mk_categoria_params)\n format.html { redirect_to @mk_categoria, notice: 'Mk categoria was successfully updated.' }\n format.json { render :show, status: :ok, location: @mk_categoria }\n else\n format.html { render :edit }\n format.json { render json: @mk_categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_categorie_competence\n @categorie_competence = CategorieCompetence.find(params[:id])\n end",
"def update\n @categoria_comida = CategoriaComida.find(params[:id])\n\n respond_to do |format|\n if @categoria_comida.update_attributes(params[:categoria_comida])\n format.html { redirect_to(@categoria_comida, :notice => 'Categoria comida was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @categoria_comida.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n category = Documents::Category.find(params[:id])\n category.update!(category_params)\n redirect_to categories_path\n end",
"def update\n respond_to do |format|\n if @profession_category.update(profession_category_params)\n format.html { redirect_to profession_categories_path, notice: 'Profession category was successfully updated.' }\n format.json { render :show, status: :ok, location: @profession_category }\n else\n format.html { render :edit }\n format.json { render json: @profession_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Категория была успешно изменена' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @activo_categoria_ci = Activo::CategoriaCi.find(params[:id])\n\n respond_to do |format|\n if @activo_categoria_ci.update_attributes(params[:activo_categoria_ci])\n format.html { redirect_to edit_activo_categoria_ci_path(@activo_categoria_ci), notice: 'Actualizado Correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @activo_categoria_ci.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @categories = Category.all\n #@category =Categorie.find(params[:id])\n @category.update(category_params)\n flash[:notice]=\"Catégorie Modifié avec succès!!!\"\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: t('update.notice', name: t('activerecord.models.category')) }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @categoria = Categoria.find(params[:id])\n @categoria.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to admin_categorias_path }\n format.json { head :ok }\n end\n end",
"def update\n @sotto_categoria = SottoCategoria.find(params[:id])\n\n respond_to do |format|\n if @sotto_categoria.update_attributes(params[:sotto_categoria])\n format.html { redirect_to(@sotto_categoria, :notice => 'Sotto categoria was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sotto_categoria.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n category= Category.find(params[:id])\n category.update(category_params)\n \n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to management_categories_path }\n format.json { render json: @category, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @poi_category = PoiCategory.find(params[:id])\n\n respond_to do |format|\n if @poi_category.update_attributes(params[:poi_category])\n format.html { redirect_to @poi_category, :notice => 'Poi category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @poi_category.errors, :status => :unprocessable_entity }\n end\n end\n end"
] | [
"0.68047875",
"0.6802997",
"0.65672714",
"0.65645427",
"0.6486565",
"0.6376908",
"0.630117",
"0.6256176",
"0.62543267",
"0.6214432",
"0.6180587",
"0.61505646",
"0.61470294",
"0.6122314",
"0.6117411",
"0.611602",
"0.61112916",
"0.60785085",
"0.6060442",
"0.60554504",
"0.60426974",
"0.6040011",
"0.6002861",
"0.59883916",
"0.5974536",
"0.5972019",
"0.59716773",
"0.59704214",
"0.5945084",
"0.5945084",
"0.5941469",
"0.59344804",
"0.5927377",
"0.5924024",
"0.5916677",
"0.5915556",
"0.59118205",
"0.58998907",
"0.5898336",
"0.58970296",
"0.5895977",
"0.5892864",
"0.589122",
"0.58790374",
"0.5871857",
"0.5866385",
"0.5854489",
"0.58529663",
"0.5832079",
"0.58237034",
"0.5823335",
"0.5819248",
"0.5811935",
"0.5810612",
"0.5808167",
"0.58066154",
"0.58031243",
"0.5800268",
"0.5800268",
"0.57995194",
"0.5793689",
"0.57760626",
"0.5772379",
"0.57707",
"0.5770163",
"0.5767418",
"0.5766245",
"0.57648367",
"0.5756606",
"0.57531667",
"0.57511514",
"0.5746434",
"0.57448906",
"0.57415897",
"0.5739194",
"0.57360584",
"0.5734399",
"0.5730466",
"0.57284784",
"0.5720564",
"0.5716842",
"0.5713934",
"0.5709109",
"0.5701522",
"0.56914955",
"0.5688833",
"0.5683224",
"0.56690764",
"0.5665353",
"0.56642634",
"0.56639296",
"0.56633013",
"0.56624997",
"0.5658824",
"0.56561",
"0.56490505",
"0.56475717",
"0.5646352",
"0.56434083",
"0.56349194"
] | 0.7001599 | 0 |
DELETE /exhibitior_categories/1 DELETE /exhibitior_categories/1.json | def destroy
@exhibitior_category = ExhibitiorCategory.find(params[:id])
@exhibitior_category.destroy
respond_to do |format|
format.html { redirect_to exhibitior_categories_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @exhibitor_category = ExhibitorCategory.find(params[:id])\n @exhibitor_category.destroy\n\n respond_to do |format|\n format.html { redirect_to exhibitor_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@incidentcategory.destroy\n render json: {}, status: 200\n end",
"def destroy\n @alien_category.destroy\n respond_to do |format|\n format.html { redirect_to alien_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n category = set_category\n if category.destroy\n head :no_content\n else\n render json: { status: 500 }\n end\n \n end",
"def destroy\n @exam_category = ExamCategory.find(params[:id])\n @exam_category.destroy\n\n respond_to do |format|\n format.html { redirect_to exam_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n IndicatorCategory.delete_hack(params[:id])\n\n respond_to do |format|\n format.html { redirect_to indicator_categories_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @categoria = Categoria.find(params[:id])\n @categoria.destroy\n\n respond_to do |format|\n format.html { redirect_to categoria_index_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categorialivro = Categorialivro.find(params[:id])\n @categorialivro.destroy\n\n respond_to do |format|\n format.html { redirect_to categorialivros_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise_category = ExerciseCategory.find(params[:id])\n @exercise_category.destroy\n\n respond_to do |format|\n format.html { redirect_to exercise_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n render json: @category, status: :ok\n end",
"def destroy\n @categorium.destroy\n respond_to do |format|\n format.html { redirect_to categoria_url, notice: 'Categoría fue eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categorie_analytique = CategorieAnalytique.find(params[:id])\n @categorie_analytique.destroy\n\n respond_to do |format|\n format.html { redirect_to categorie_analytiques_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @category.destroy\n render json: { notice: 'Categoria eliminada exitosamente' }\n end",
"def destroy\n @categorie_droit.destroy\n respond_to do |format|\n format.html { redirect_to categorie_droits_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categoria.destroy\n respond_to do |format|\n format.html { redirect_to categorias_path, notice: @@titulo + t('msg.remove') }\n format.json { head :no_content }\n end\n end",
"def DeleteCategory id\n \n APICall(path: \"categories/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n @cathegory.destroy\n respond_to do |format|\n format.html { redirect_to cathegories_url, notice: 'Cathegory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @personality_category.destroy\n respond_to do |format|\n format.html { redirect_to personality_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @catagory.destroy\n respond_to do |format|\n format.html { redirect_to back_catagories_url, notice: I18n.t('view.notice.deleted') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categ.destroy\n respond_to do |format|\n format.html { redirect_to categs_url, notice: 'Categ was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @echocategory.destroy\n respond_to do |format|\n format.html { redirect_to echocategories_url, notice: 'Echocategory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categoria_norma.destroy\n respond_to do |format|\n format.html { redirect_to categoria_normas_url, notice: 'Categoria norma was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @desserts_category.destroy\n respond_to do |format|\n format.html { redirect_to desserts_categories_url}\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v1_categories_path }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_contcategory.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_contcategories_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @cetegory.destroy\n respond_to do |format|\n format.html { redirect_to cetegories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mk_categoria.destroy\n respond_to do |format|\n format.html { redirect_to mk_categories_url, notice: 'Mk categoria was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @convention_category = ConventionCategory.find(params[:id])\n @convention_category.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_convention_categories_url }\n format.json { head :ok }\n end\n end",
"def deleteCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.find(params[:id])\n status = c.destroy\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: true, reason: error, data: \"\"}\n end",
"def destroy\n @categorie_competence.destroy\n respond_to do |format|\n format.html { redirect_to categorie_competences_url, notice: 'Categorie competence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @excategory.destroy\n respond_to do |format|\n format.html { redirect_to excategories_url, notice: 'Excategory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subcategorium.destroy\n respond_to do |format|\n format.html { redirect_to subcategoria_url, notice: 'Subcategorium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categor.destroy\n respond_to do |format|\n format.html { redirect_to categors_url, notice: 'Categor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @kategory = Kategory.find(params[:id])\n @kategory.destroy\n\n respond_to do |format|\n format.html { redirect_to kategories_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to admin_good_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category_db.destroy\n respond_to do |format|\n format.html { redirect_to category_dbs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @coach_category.destroy\n respond_to do |format|\n format.html { redirect_to coach_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @level_category = LevelCategory.find(params[:id])\n @level_category.destroy\n\n respond_to do |format|\n format.html { redirect_to level_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categoriafinaceiro.destroy\n respond_to do |format|\n format.html { redirect_to categoriafinaceiros_url, notice: 'Categoria excluída com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dish_category.destroy\n respond_to do |format|\n format.html { redirect_to dish_categories_url, notice: 'Категория блюда удалена.' }\n format.json { head :no_content }\n end\n end",
"def delete_category id\n\t\t\t\t\tFreshdesk::Api::Client.delete_status_wrapper do\n\t\t\t\t\t\t( @connection.delete CATEGORIES, id ).code\n\t\t\t\t\tend\n\t\t\t\tend",
"def destroy\n # @retailer_category = RetailerCategory.find(params[:id])\n @retailer_category.destroy\n respond_to do |format|\n format.html { redirect_to retailer_categories_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @interviewcategory.destroy\n respond_to do |format|\n format.html { redirect_to interviewcategories_url, notice: \"Interviewcategory was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @agendacategory.destroy\n respond_to do |format|\n format.html { redirect_to agendacategories_url, notice: 'Agendacategory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = current_mall.categories.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to api_wmall_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categorie = Categorie.find(params[:id])\n @categorie.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>[]}}\n end\n end",
"def destroy\n @categorias_tipo = CatTipo.find(params[:id])\n @categorias_tipo.destroy\n\n respond_to do |format|\n format.html { redirect_to cat_tipos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @accolade_category.destroy\n respond_to do |format|\n format.html { redirect_to admin_accolade_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @incidentcategory.destroy\n respond_to do |format|\n format.html { redirect_to incidentcategories_url, notice: 'Incidentcategory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admission_category = AdmissionCategory.find(params[:id])\n @admission_category.destroy\n\n respond_to do |format|\n format.html { redirect_to admission_categories_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hive_category.destroy\n respond_to do |format|\n format.html { redirect_to hive_categories_url, notice: 'Hive category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n head :no_content\n end",
"def destroy\n @receipe_category.destroy\n respond_to do |format|\n format.html { redirect_to receipe_categories_url, notice: 'Receipe category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categorization = Categorization.find(params[:id])\n @categorization.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_categorizations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @hospital_category.destroy\n respond_to do |format|\n format.html { redirect_to hospital_categories_url, notice: 'hospital_category was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ilance_category.destroy\n respond_to do |format|\n format.html { redirect_to ilance_categories_url, notice: 'Ilance category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_category(name)\n data_array = JSON.parse(File.read(File_path))\n category_item = find_category(name)\n data_array.delete(category_item)\n File.open(File_path, 'w') { |f| f.write(data_array.to_json) }\nend",
"def destroy\n audit(@accessory_category, current_user)\n @accessory_category.destroy\n \n\n head :no_content\n end",
"def destroy\n @categoria_rec.destroy\n respond_to do |format|\n format.html { redirect_to categoria_recs_url, notice: 'Categoria rec was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cate_item = CateItem.find(params[:id])\n @cate_item.destroy\n\n respond_to do |format|\n format.html { redirect_to '/cate_items' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_category.destroy\n respond_to do |format|\n format.html { redirect_to admin_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @abuse_category = AbuseCategory.find(params[:id])\n @abuse_category.destroy\n\n respond_to do |format|\n format.html { redirect_to abuse_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post_category = current_user.post_categories.find(params[:id])\n @post_category.destroy\n\n respond_to do |format|\n format.html { redirect_to [:client, :post_categories] }\n format.json { head :no_content }\n end\n end",
"def destroy\n @body_style_categorization = BodyStyleCategorization.find(params[:id])\n @body_style_categorization.destroy\n\n respond_to do |format|\n format.html { redirect_to body_style_categorizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to admin_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n begin\n @category.destroy\n rescue ActiveRecord::DeleteRestrictionError\n error = 'Эта категория не может быть удалена, пока с ней связан хоть один файл.'\n ensure\n respond_to do |format|\n format.html { redirect_to categories_url, notice: error }\n format.json { head :ok }\n end\n end\n end",
"def destroy\n current_user.income_transactions.where(income_category_id: @income_category).delete_all\n @income_category.destroy\n respond_to do |format|\n format.html { redirect_to income_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_scenic_spots_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ledger_category.destroy\n respond_to do |format|\n format.html { redirect_to ledger_categories_url, notice: 'Ledger category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exhibit.destroy\n respond_to do |format|\n format.html { redirect_to admin_exhibits_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to cm_post_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @activity_category.destroy\n respond_to do |format|\n format.html { redirect_to activity_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sys_category.destroy\n respond_to do |format|\n format.html { redirect_to sys_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = DishCategory.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Категория удалена.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profession_category.destroy\n respond_to do |format|\n format.html { redirect_to profession_categories_url, notice: 'Profession category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: \"Journal was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @age_group_category = AgeGroupCategory.find(params[:id])\n @age_group_category.destroy\n\n respond_to do |format|\n format.html { redirect_to age_group_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contract_doc_category = ContractDocCategory.find(params[:id])\n @contract_doc_category.destroy\n\n respond_to do |format|\n format.html { redirect_to contract_doc_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise_category = ExerciseCategory.find(params[:id])\n\n if @exercise_category.exercise_subcategories.any?\n flash[:error] = I18n.t(:category_delete_failed)\n\n respond_to do |format|\n format.html { redirect_to @exercise_category }\n format.json { head :no_content }\n end\n else\n @exercise_category.destroy\n flash[:success] = I18n.t(:category_delete_success)\n\n respond_to do |format|\n format.html { redirect_to exercise_categories_url }\n format.json { head :no_content }\n end\n end\n\n end",
"def destroy\n @content_category = ContentCategory.find(params[:id])\n @content_category.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_home_index_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @taxonomy_category = TaxonomyCategory.find(params[:id])\n @taxonomy_category.destroy\n\n respond_to do |format|\n format.html { redirect_to taxonomy_categories_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @proyectos_categoria.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_categorias_url, notice: 'Proyectos categoria was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @administration_category = Category.find(params[:id])\r\n @administration_category.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to administration_categories_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @quiz_category.destroy\n respond_to do |format|\n format.html { redirect_to quiz_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @section_category = SectionCategory.find(params[:id])\n @section_category.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: t('destroy.notice', name: t('activerecord.models.category')) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to backend_shop_branch_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mastery_category = MasteryCategory.find(params[:id])\n @mastery_category.destroy\n\n respond_to do |format|\n format.html { redirect_to mastery_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @recipe_category = RecipeCategory.find(params[:id])\n @recipe_category.destroy\n\n respond_to do |format|\n format.html { redirect_to recipe_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to experts_path, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @patrimony_item_category.destroy\n respond_to do |format|\n format.html { redirect_to patrimony_item_categories_url, notice: 'Patrimony item category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = @collection.category.find(params[:id])\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categoriaproduto.destroy\n respond_to do |format|\n format.html { redirect_to categoriaprodutos_url, notice: 'Categoriaproduto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end"
] | [
"0.73797965",
"0.73602843",
"0.7295814",
"0.7242014",
"0.72043025",
"0.7200795",
"0.7151931",
"0.712239",
"0.71190214",
"0.71094865",
"0.7101901",
"0.7101655",
"0.7088081",
"0.70532817",
"0.7044528",
"0.70421284",
"0.7000866",
"0.6995815",
"0.6992089",
"0.698252",
"0.6978376",
"0.69677544",
"0.6956404",
"0.6952935",
"0.6951471",
"0.6950771",
"0.6941075",
"0.6930555",
"0.692017",
"0.6907185",
"0.69042593",
"0.69001406",
"0.6898538",
"0.6892736",
"0.68862945",
"0.6885031",
"0.6879428",
"0.6875416",
"0.68712324",
"0.68693715",
"0.6867101",
"0.68630034",
"0.68596226",
"0.6846381",
"0.68422914",
"0.68419296",
"0.684071",
"0.6838611",
"0.6838424",
"0.683348",
"0.68315816",
"0.6826961",
"0.68254405",
"0.6824333",
"0.68219155",
"0.68183774",
"0.6810613",
"0.6806516",
"0.68064517",
"0.6806244",
"0.6801106",
"0.6801",
"0.6794644",
"0.67931414",
"0.6791094",
"0.67850006",
"0.67824",
"0.67823887",
"0.67807436",
"0.6780146",
"0.6773322",
"0.6761602",
"0.67584413",
"0.67584413",
"0.67584413",
"0.6754791",
"0.6751853",
"0.67515844",
"0.6750284",
"0.6749912",
"0.6747454",
"0.6745219",
"0.6745041",
"0.6742793",
"0.67396045",
"0.6739366",
"0.67346597",
"0.67323107",
"0.6727378",
"0.6725826",
"0.6722244",
"0.67222065",
"0.6720089",
"0.6718321",
"0.6713035",
"0.6709143",
"0.67079824",
"0.6706165",
"0.6706165",
"0.6706165"
] | 0.77388936 | 0 |
+last_date_update+ is DateTime object | def get_ui_properties(language_id, last_date_update)
request('getUIProperties', {
accessKeyCode: @access_key_code,
languageId: language_id,
osType: @os_type,
lastDateUpdate: last_date_update,
})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_updated\n self.dig_for_datetime(\"lastUpdateOn\")\n end",
"def last_update_date_time\n return @last_update_date_time\n end",
"def last_update_date_time\n return @last_update_date_time\n end",
"def last_update_date_time\n return @last_update_date_time\n end",
"def last_update_date_time\n return @last_update_date_time\n end",
"def last_edited\n self.latest_update.to_date\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def last_edited\n\t\tself.latest_update.to_date\n\tend",
"def last_updated_date_time\n return @last_updated_date_time\n end",
"def last_updated_date_time\n return @last_updated_date_time\n end",
"def last_updated_date_time\n return @last_updated_date_time\n end",
"def last_updated_date_time\n return @last_updated_date_time\n end",
"def last_updated\n\t\tupdated_at\n\tend",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_update() (last_answer = answers.last) ? last_answer.time_stamp : created_at end",
"def last_updated_at\n @last_updated_at\n end",
"def last_updated\n time = self.updated_at\n if time < Time.now - (3600 * 24)\n time.strftime(\"%b %-d, %Y\")\n else\n time.strftime(\"%l:%M %p\")\n end\n end",
"def last_updated_time\n data[:last_updated_time]\n end",
"def last_update\n Time.parse(@record.SystemModstamp)\n end",
"def date() updated; end",
"def updated_at\n dateChanged\n end",
"def last_updated\n [updated_at, book_updated_at, photo_updated_at].compact.max\n end",
"def last_update_at\n connection.get_metric_last_update_at(@id)\n end",
"def updated_at_datetime\n @updated_at_datetime ||= DateTime.parse(@updated_at)\n end",
"def updated(date_or_time = T.unsafe(nil)); end",
"def updated_at\n @udpated_at ||=\n Utilities.utc_to_localtime(@ldap_entry[:whenchanged].first)\n end",
"def last_time\n @last_time\n end",
"def updated_at\n @updated_at ||= begin\n updated_dates = [self[:updated_at] || self[:created_at] || Date.null_date.to_time]\n updated_dates += self.captions.collect{|c| c.updated_at }\n \n updated_dates.compact.max\n end\n end",
"def last_refresh\n @dt\n end",
"def last_refresh\n @dt\n end",
"def last_refresh\n @dt\n end",
"def remote_last_updated_at\n require 'rexml/document'\n doc = REXML::Document.new(request('update'))\n Time.iso8601(doc.root.attributes['time'])\n end",
"def getlastmodified\n if !record.nil? and record.respond_to? :updated_at\n record.updated_at.httpdate\n end\n end",
"def resume_last_update\n self.resumes.first.updated_at.to_date\n end",
"def updated\n updated_at.utc.strftime(\"%F %T\") if updated_at\n end",
"def last_modified\n [updated_at, user.try(:updated_at)].max\n end",
"def last_update\n \"none\"\n end",
"def history_end_dt\n @parent.last_updated_dt\n end",
"def last_modified\n# stat.mtime\n @bson['uploadDate'] || Date.new\n end",
"def last_updated_at\n RefreshReportingViews.last_updated_at_facility_daily_follow_ups_and_registrations\n end",
"def date_updated\n updated_at.strftime(\"%b %d, %Y\")\n end",
"def last_updated_time\n CGI.escape(30.minutes.ago.to_datetime.to_formatted_s(:iso8601))\n end",
"def last_modified_date()\n\t\tmax_update = @database.execute(\"SELECT MAX(updated) as maxmodified FROM invoices;\")\n\t\tif (DBCHOICE == 'sqlite3') then\n\t\t\treturn max_update[0][0]\n\t\telsif (DBCHOICE == 'mysqltest' || DBCHOICE == 'mysql') then\n\t\t\t# structure is hash of hashes, look for the maxmodified key in 1st record and return\n\t\t\tmax_update.each do |row|\n\t\t\t\treturn row['maxmodified']\n\t\t\tend # max_update.each\n\t\tend\n\tend",
"def date_updated\n Time.parse(@attrs['DateUpdated'])\n end",
"def date_updated\n Time.parse(@attrs['DateUpdated'])\n end",
"def last_updated_at\n [ self.calendar_items.accessible.maximum('nodes.created_at'), self.updated_at ].compact.max\n end",
"def update \n update = object.updated_at\n end",
"def set_update_time!(time = last_modified_date)\n set_update_time(time)\n # disable_ferret\n save\n return last_updated__c\n end",
"def update_last_activity!\n if respond_to?(:update_column)\n self.update_column(:last_activity_at, Time.now.utc)\n elsif defined? Mongoid\n self.update_attribute(:last_activity_at, Time.now.utc)\n end\n end",
"def last_changed_at\n @last_changed_at ||= @changes.map { |c| c[:changed_at] }.max\n end",
"def last_updated_at\n if cache\n @last_updated_at ||= remote_last_updated_at\n else\n remote_last_updated_at\n end\n end",
"def timestamp\n begin\n max=model.max(:updated_at)\n #rescue PG::Error => err\n rescue => err\n # puts \" error was #{err}\"\n # if we get an error, just assume we need to update the table\n return Rake::EARLY\n end\n # this is embarassing, but rake doesn't have a way to say\n # that this thing is more recently updated than anything else\n max.nil? ? Time.parse('Dec 31, 9999') : max\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def date\n updated_at.strftime(\"%d %b %y %H:%M\")\n end",
"def last_line_modified_date()\n\t\tmax_update = @database.execute(\"SELECT MAX(updated) as maxmodified FROM invoice_lines;\")\n\t\tif (DBCHOICE == 'sqlite3') then\n\t\t\treturn max_update[0][0]\n\t\telsif (DBCHOICE == 'mysqltest' || DBCHOICE == 'mysql') then\n\t\t\t# structure is hash of hashes, look for the maxmodified key in 1st record and return\n\t\t\tmax_update.each do |row|\n\t\t\t\treturn row['maxmodified']\n\t\tend # max_update.each\n\tend\nend",
"def last_modified\n @metadata[:last_modified] || Time.now.utc\n end",
"def set_update_time(time = last_modified_date)\n self.last_updated__c = ((last_updated__c and time < last_updated__c) ? last_updated__c : time) # fails migration ?\n# self.last_updated__c = self.last_modified_date # for migration\n end",
"def end_date\n @raw.last.date\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_update\n Time._load(index_time_dbm_file['last']) rescue \"none\"\n end",
"def update_post_last_update_timestamp\n if self.instance_of? Post\n self.last_update = self.updated_at # this value will be saved because it's called by before_save/update callback\n elsif self.instance_of? Comment\n return if self.post.nil?\n self.post.last_update = self.updated_at\n self.post.save\n end\n end",
"def updated_at\n Time.at @updated rescue nil\n end",
"def last_synchronize\n last_update\n end",
"def get_max_updated_at\r\n @summary.max_updated_at\r\n end",
"def status_updated_date_time\n formatted_date_time(object.status_as_of)\n end",
"def updated_at\n @updated_at ||= Time.parse(@attributes['updated_at'])\n end",
"def latest_update\n latest_update = updated_at\n phases.each do |phase|\n if phase.updated_at > latest_update then\n latest_update = phase.updated_at\n end\n end\n return latest_update\n end",
"def updated_at\n DateTime.parse((solr_document[\"updated_at_dtsi\"] || solr_document[\"timestamp\"] || solr_document[\"created_at_dtsi\"]).to_s).utc\n end"
] | [
"0.7999643",
"0.79497194",
"0.79497194",
"0.79497194",
"0.79497194",
"0.77626234",
"0.76669496",
"0.76669496",
"0.76669496",
"0.76669496",
"0.76613456",
"0.7595919",
"0.7595919",
"0.7595919",
"0.7595919",
"0.75562894",
"0.7496774",
"0.7496774",
"0.7496774",
"0.7496774",
"0.7380468",
"0.7318687",
"0.7139349",
"0.710929",
"0.70177543",
"0.6983965",
"0.6948114",
"0.69310117",
"0.68493736",
"0.68174547",
"0.6802746",
"0.6802504",
"0.6779084",
"0.6771593",
"0.6767869",
"0.6767869",
"0.6767869",
"0.67332655",
"0.6696834",
"0.6693711",
"0.66883624",
"0.66753125",
"0.6663764",
"0.6653132",
"0.66470605",
"0.6631375",
"0.6625112",
"0.6620441",
"0.6615017",
"0.65986234",
"0.65986234",
"0.65956956",
"0.65897226",
"0.6584688",
"0.6570132",
"0.65561426",
"0.65466464",
"0.65366745",
"0.65283144",
"0.65283144",
"0.65283144",
"0.65283144",
"0.65283144",
"0.65283144",
"0.65283144",
"0.65283144",
"0.65283144",
"0.65283144",
"0.65283144",
"0.65283144",
"0.65283144",
"0.65283144",
"0.6501467",
"0.6501467",
"0.6501467",
"0.6501467",
"0.6501467",
"0.6501467",
"0.6501467",
"0.6501467",
"0.6501467",
"0.6501467",
"0.6501467",
"0.6501467",
"0.6501467",
"0.6501467",
"0.64893854",
"0.64849544",
"0.6484885",
"0.64687",
"0.64686245",
"0.64672357",
"0.64523417",
"0.6444021",
"0.6426955",
"0.6422254",
"0.64186054",
"0.64005816",
"0.63915354",
"0.6390228",
"0.6383799"
] | 0.0 | -1 |
Payments history for calendar month +month_period+ +month_period+ A string like 'yyyyMM' that represent month of year | def get_payments_history(month_period)
request('getPaymentsHistory', base_api_parameters.merge({ monthPeriod: month_period }))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def month() end",
"def period\n case self.recurring_month\n when 12\n 1.year # 1.year != 12.months\n else\n self.recurring_month.months\n end\n end",
"def monthly\n end",
"def month=(_arg0); end",
"def month; end",
"def month; end",
"def calculate_month_and_next_month(year, month)\n check_date = Time.new(year, month)\n {:actual => check_date, :next => check_date.next_month}\n end",
"def test_yearly_by_month_loop\n parse(\n 'FREQ=YEARLY;INTERVAL=1;UNTIL=20120203T225959Z;BYMONTH=2;BYSETPOS=1;BYDAY=SU,MO,TU,WE,TH,FR,SA',\n '2012-01-01 15:45:00',\n [\n '2012-02-01 15:45:00'\n ],\n '2012-01-29 23:00:00'\n )\n end",
"def months() 30 * days end",
"def commitment_period_origin\n I18n.l(created_at.advance(months: subscription_plan.commitment_period).to_date)\n end",
"def expiration_month\n @months = [\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\"]\n end",
"def all_movement_by_period(period)\n\t\tmonth,year = period.split(\"/\")\n\t\tperiod = \"#{year}-#{month}\"\n\t\tcash_bank_bank_movements.all(:conditions => [\"SUBSTRING(date,1,7) = '#{period}'\"])\n\tend",
"def month_depot\n \"#{depot.name} \"+\"#{issue_date.strftime(\"%b\")} \"+\"#{issue_date.year}\"\n end",
"def increment_month!\n if month != 12\n # just bump up a number\n self.date = ZDate.format_date(year_str, month + 1)\n else\n self.date = ZDate.format_date(year + 1)\n end\n end",
"def calculate_month_by_month\n return StandardError, 'Already calculated stats for period' if @calculated.include?(:month_by_month)\n check_for_dates\n\n months_list.each do |date|\n start = date.beginning_of_month\n final = date.end_of_month\n month_key = start.strftime(MONTH_KEY)\n\n calculate_stats_for(month_key, Statistic::VIEW, start, final)\n calculate_stats_for(month_key, Statistic::STREAM, start, final) if include_streaming\n calculate_stats_for(month_key, Statistic::DOWNLOAD, start, final)\n end\n @calculated << :month_by_month\n self\n end",
"def month_payment(dept)\n result = Hash.new\n credit_percent = (dept * @percent/12)\n credit_payment = (@base - credit_percent)\n result[:res_credit_payment] = credit_payment\n result[:res_credit_percent] = credit_percent\n result[:res_credit] = @base\n result[:res_remainder] = (dept - credit_payment)\n result\n end",
"def fixed_monthly_payment(amount, months, ir )\n amount*( ir * ( 1 + ir ) **months )/(( 1 + ir )**months - 1 )\nend",
"def month\n set_function_and_argument(:month, nil)\n end",
"def month\n @year = params[:year].to_i\n @month = params[:month].to_i\n @first_day = @event.first_day_of_month(@year, @month)\n @last_day_of_month = Date.new(@year, @month, 1).end_of_month\n end",
"def monthly(options = {})\n branch options.merge(every: :month)\n end",
"def monthly(options = {})\n branch options.merge(every: :month)\n end",
"def months ; self * 30.days ; end",
"def monthly_payment(salary_per_annum)\n return salary_per_annum / 12\nend",
"def month\n end",
"def create_monthly_data\n number = @slide_number.to_i + 1\n monthly_data = Nokogiri::HTML(\n open(\n \"#{ENV['API_DOMAIN_2']}#{ENV['API_DOMAIN_2_MONTHLY']}\"\n )\n ).css(\"div.shareable-section-wrapper\").last\n\n data = {\n sign: @sign_name.to_s,\n duration: \"monthly\",\n horoscope_text: monthly_data.css(\"div[#{number}]\").text.split(' ')[1..-1].join(' ')\n } if monthly_data\n Horoscope.create(data) if monthly_data and data\n end",
"def get_month(year, month)\n entries = month_entries(@pages, year, month) \n\n budget_month = BudgetMonth.new(entries, year, month)\n\n budget_month\n end",
"def rsmonth(month)\n case month\n when 1\n return 'januar'\n when 2\n return 'februar'\n when 3\n return 'mart'\n when 4\n return 'april'\n when 5\n return 'maj'\n when 6\n return 'jun'\n when 7\n return 'jul'\n when 8\n return 'avgust'\n when 9\n return 'septembar'\n when 10\n return 'oktobar'\n when 11\n return 'novembar'\n when 12\n return 'decembar'\n end\nend",
"def payment_data(period_data = 'this_month')\n res = payments.completed\n range, daily_report = period_data.to_s.report_period_to_range\n data = [[period_data.to_s.report_period_to_title] + UserGroup::PAYMENT_GOALS.values]\n range.each do |d| \n r = [d.beginning_of_day, (daily_report ? d.end_of_day : d.end_of_month.end_of_day)]\n d = [d.strftime(daily_report ? '%d' : '%Y-%m')]\n UserGroup::PAYMENT_GOALS.each{|k, v| d << res.where(payment_at: r[0]..r[1], goal: k).sum(:amount).to_f }\n data << d\n end\n data\n end",
"def month_name(number); end",
"def card_month\n card[:month].to_i\n end",
"def month_names; end",
"def calculated_spend_by_month\n return if !organisation.respond_to?(:payments) || organisation.payments.count == 0\n res_hsh = {}\n group_by = case ActiveRecord::Base.connection.adapter_name\n when 'MySQL'\n # https://github.com/django/django/blob/master/django/db/backends/mysql/base.py#L207\n \"CAST(DATE_FORMAT(date, '%Y-%m-01 00:00:00') AS DATETIME)\"\n else # PostgreSQL\n # https://github.com/django/django/blob/master/django/db/backends/postgresql_psycopg2/operations.py#L35\n \"DATE_TRUNC('month', date)\"\n end\n ft_sums = organisation.payments.sum(:value, :conditions => {:date_fuzziness => nil}, :group => group_by).to_a\n fuzzy_sums = organisation.payments.all(:select => 'SUM(value) AS value, date, date_fuzziness', :conditions => \"date_fuzziness IS NOT NULL\", :group => 'date, date_fuzziness')\n\n fuzzy_sums.each{ |fs| ft_sums += fs.averaged_date_and_value }\n\n ft_sums.each do |ft_sum|\n res_hsh[ft_sum.first.to_date.beginning_of_month] = res_hsh[ft_sum.first.to_date.beginning_of_month].to_f + ft_sum.last\n end\n\n months_with_vals = res_hsh.sort\n \n first_month, last_month = months_with_vals.first, months_with_vals.last\n spend_by_month_array(first_month.first, last_month.first, months_with_vals)\n end",
"def payments_report(period_data = 'last_month')\n res = payments.completed\n range, daily_report = period_data.to_s.report_period_to_range\n data = [[period_data.to_s.report_period_to_title, 'Tithe', 'Pledge', 'Partner', 'Donation', 'Offertory', 'Payment']]\n range.each do |d| \n r = d.beginning_of_day..(daily_report ? d.end_of_day : d.end_of_month.end_of_day)\n data << [d.strftime(daily_report ? '%d' : '%Y-%m'), \n res.where(payment_at: r, goal: 'tithe').sum(:amount).to_f,\n res.where(payment_at: r, goal: 'pledge').sum(:amount).to_f,\n res.where(payment_at: r, goal: 'partner').sum(:amount).to_f,\n res.where(payment_at: r, goal: 'donation').sum(:amount).to_f,\n res.where(payment_at: r, goal: 'offertory').sum(:amount).to_f,\n res.where(payment_at: r, goal: nil).sum(:amount).to_f\n ]\n end\n data\n end",
"def month=(value)\n @month = value\n end",
"def period_in_words\n case recurring_month\n when 12\n 'yearly'\n when 1\n 'monthly'\n when 0\n \"once\"\n else\n \"every #{recurring_month} months\"\n end\n end",
"def loan_dur_month(loan_duration)\n loan_duration.to_i * 12\nend",
"def adjust_month(m)\n months = [\"january\", \"february\", \"march\", \"april\", \"may\", \"june\", \"july\", \"august\", \"september\", \"october\", \"november\", \"december\"]\n if m.is_a? Integer\n months[m-1]\n else\n m\n end\n end",
"def month\n months = %w{January February March April May June July August September October November December}\n months[Time.now.month - 1]\n end",
"def index\n \n if @payment.nil?\n today = Date.today\n year = params[:year].to_i if params[:year]\n month = params[:month].to_i if params[:month]\n \n @date = today\n \n if year && month\n day = today.day\n if year != today.year || month != today.month\n day = 1\n end\n @date = Date.civil(year, month, day)\n end\n else\n @date = @payment.date\n end\n \n @payments = Payment.by_month(@date)\n \n respond_to do |format|\n format.html { render :action => 'index' }\n format.xml { render :xml => @payments }\n end\n end",
"def month_str\n ret = Datet.months(:trans => true)[@t_month]\n if args and args[:short]\n ret = ret.slice(0, 3)\n end\n \n return ret\n end",
"def get_monthly_payments(loan, interest, months)\n loan * (interest / (1 - (1 + interest)**(-months)))\nend",
"def refine_month(m)\n mon = check_num_str(m)\n adjust_month(mon)\n end",
"def extract_futures_contract_month(futures_contact_string)\n match = futures_contact_string.match(/([FGHJKMNQUVXZ])\\s+\\([a-zA-Z]{3}\\s+(\\d{2})\\)/)\n contract_month_letter = match[1].upcase\n year_suffix = match[2]\n month = MonthCodeToMonth[contract_month_letter]\n year = \"20#{year_suffix}\".to_i\n monthstamp(year, month)\nend",
"def set_periodo\n self.periodo = \"#{self.fecha_medicion.month}/#{self.fecha_medicion.year}\"\n end",
"def getMonthObject(transactionMonth)\n case transactionMonth\n when @month1.strftime('%Y-%m')\n monthObject = @summaryData[:month1]\n when @month2.strftime('%Y-%m')\n monthObject = @summaryData[:month2]\n when @month3.strftime('%Y-%m')\n monthObject = @summaryData[:month3]\n when @month4.strftime('%Y-%m')\n monthObject = @summaryData[:month4]\n when @month5.strftime('%Y-%m')\n monthObject = @summaryData[:month5]\n else\n monthObject = nil\n end\n monthObject\n end",
"def monthly_language_activity\n memoized_language_breakdowns = all_languages_monthly_activity\n\n MONTHS.map do |month|\n res = [Date::MONTHNAMES[month]]\n memoized_language_breakdowns.each do |lang, breakdown|\n value = breakdown.detect { |b| b.fetch(\"month\") == month }\n prs = value ? value.fetch(\"prs\") : 0\n res << prs\n end\n res\n end\n end",
"def jump_to_month(month_number)\n # find difference in months\n if month_number >= month\n ZDate.new(ZDate.format_date(year_str, month_number))\n else\n ZDate.new(ZDate.format_date(year + 1, month_number))\n end\n end",
"def add_months(months = 1)\n months = months.to_i\n cur_month = @t_month\n cur_day = @t_day\n next_month = cur_month + months.to_i\n \n #Check if we have to alter the amount of years based on the month-change.\n if next_month > 12 or next_month <= 0\n years = (next_month.to_f / 12.0).floor\n \n newmonth = next_month - (years * 12)\n if newmonth == 0\n newmonth = 12\n years -= 1\n end\n \n self.month = newmonth\n self.add_years(years) if years != 0\n else\n raise \"Invalid month: '#{next_month}'.\" if next_month <= 0 or next_month > 12\n @t_month = next_month\n @t_day = 1\n end\n \n \n #If the month changed, and the day was the last day of the previous month, and there isnt that many days in the new month, set the day to the last day of the current month.\n dim = self.days_in_month\n \n if dim < cur_day\n @t_day = dim\n else\n @t_day = cur_day\n end\n \n return self\n end",
"def total_payments_data(period_data = 'this_month')\n res = payments.completed\n range, daily_report = period_data.to_s.report_period_to_range\n data = [[period_data.to_s.report_period_to_title, I18n.t('number.currency.format.unit')]]\n range.each{|d| data << [d.strftime(daily_report ? '%d' : '%Y-%m'), res.where(payment_at: d.beginning_of_day..(daily_report ? d.end_of_day : d.end_of_month.end_of_day)).count(:id)] }\n data\n end",
"def associated_months\n result = [] # expect no months if no dates\n years = associated_years\n \n\t start_date = event_start\n\t start_date = entry_deadline if is_opportunity?\n\t \t \n start_month_year = Time.parse(\"01/#{start_date}.month/#{start_date}.year\") if !start_date.blank?\n finish_month_year = Time.parse(\"01/#{event_finish}.month/#{event_finish}.year\") if !event_finish.blank?\n \n #this is the case when we only have a start month\n if !start_month_year.blank? and finish_month_year.blank?\n result << start_date.month\n #this is the tricky one...\n elsif !start_month_year.blank? and !finish_month_year.blank?\n delta_year = event_finish.year - start_date.year # year\n \n #if the range spans an entire year we have all the months\n if (delta_year) > 1\n result = [1,2,3,4,5,6,7,8,9,10,11,12]\n #this is the case of months being in the same year\n elsif delta_year == 0\n puts start_month_year.month\n puts finish_month_year.month\n for m in start_month_year.month..finish_month_year.month\n result << m\n end\n \n #this is the annoying one, going over new year\n elsif delta_year == 1\n #add months to year end\n for month in start_month_year.month..12\n result << month\n end\n \n #add months from start of year\n for month in 1.. finish_month_year.month\n result << month\n end \n end\n result\n end\n \n \n \n \n result\n end",
"def month\n @month ||= Date::ABBR_MONTHNAMES.index(@md[1])\n end",
"def months_in_year\n 12\nend",
"def months; self * MONTH; end",
"def setup_months(start_month, end_month)\n @months = []\n while start_month <= end_month\n @months << start_month\n start_month += 1\n end\n end",
"def months ; Duration[self * 30 * 86400] ; end",
"def monthly_timesheet\n \n end",
"def month\n @month ||= Date::ABBR_MONTHNAMES.index(@md[4])\n end",
"def next_month(months = 1)\n advance(months: months)\n end",
"def months_list\n\t (Date.today-1.year..Date.today).map{|d| [d.strftime(\"%b-%Y\"), d.strftime(\"%m-%Y\")]}.uniq.reverse\n\tend",
"def next_month(month, year)\n if month == 12\n [1, year + 1]\n else\n [month + 1, year]\n end\nend",
"def by_month(year, month)\n request = @client.call(:recupera_tc_mes, message: {\n Ano: year,\n Mes: month\n })\n\n response = request.body[:recupera_tc_mes_response][:recupera_tc_mes_result][:detalle_tc][:tc]\n puts response.to_json\n response\n end",
"def add_month(age) \n GenFactor::sanitize_age((age + (1.0/12.0)))\n end",
"def advance_months(months)\n advance_to_date(to_date >> months)\n end",
"def match_month\n @month ? { 'fiscal_period_id' => @month.to_i } : {}\n end",
"def dmonth(delta=0)\n ty = Time.now.utc\n m1 = 1 + (ty.month + delta - 1) % 12\n y1 = ty.year + (ty.month + delta - 1) / 12\n m2 = 1 + (ty.month + delta) % 12\n y2 = ty.year + (ty.month + delta) / 12\n puts m1, y1, m2, y2\n {\n :from => Time.utc(y1,m1),\n :to => Time.utc(y2,m2)\n }\n end",
"def changemonth(direction)\n\t\tif direction == :backward\n\t\t\tif @month == 1 #tempting to do \"12/\".next but no corresponding previous\n\t\t\t\t@year -= 1\n\t\t\t\t@month = 12\n\t\t\telse\n\t\t\t\t@month -= 1\n\t\t\tend\n\t\tend\n\t\tif direction == :forward\n\t\t\tif @month == 12\n\t\t\t\t@year += 1\n\t\t\t\t@month = 1\n\t\t\telse\n\t\t\t\t@month += 1\n\t\t\tend\n\t\tend\n\t\tdebug(@year)\n\t\tdebug(@month)\n\t\tdownload(URL+@list+@year.to_s+\"/\"+(0 if @month < 10).to_s+@month.to_s) do |resp|\n\t\t\t@days = eval(resp.response.body)[1]\n\t\t\tdebug(@days)\n\t\t\t#@stack_cal.show\n\t\t\t#@stack_cal_nav.show\n\t\t\t@when.replace(@month.to_s, \" \", @year.to_s)\n\t\t\tdrawcalendar(@list, @year, @month, @days)\n\t\tend\n\tend",
"def month\n return @month\n end",
"def displayTransactionsMonth(month)\n displayTransactionsBlankRow\n row do\n @pastMonthDeployed = true\n column(getRuleString(@transWidth_1))\n column(getRuleString(@transWidth_2))\n column(getRuleString(@transWidth_3))\n column(\" [ #{month.upcase} ] #{getRuleString(@transWidth_4 - (month.length + 6))}\")\n column(getRuleString(@transWidth_5))\n column(getRuleString(@transWidth_6))\n column(getRuleString(@transWidth_7))\n end\n displayTransactionsBlankRow\n end",
"def linkedin_date(month)\n \tcase month\n \t\twhen 1\n \t\t\tmonth = \"January\"\n \t\twhen 2\n \t\t\tmonth = \"February\"\n \t\twhen 3\n \t\t\tmonth = \"March\"\n \t\twhen 4\n \t\t\tmonth = \"April\"\n \t\twhen 5\n \t\t\tmonth = \"May\"\n \t\twhen 6\n \t\t\tmonth = \"June\"\n \t\twhen 7\n \t\t\tmonth = \"July\"\n \t\twhen 8\n \t\t\tmonth = \"August\"\n \t\twhen 9\n \t\t\tmonth = \"September\"\n \t\twhen 10\n \t\t\tmonth = \"October\"\n \t\twhen 11\n \t\t\tmonth = \"November\"\n \t\twhen 12\n \t\t\tmonth = \"December\"\n \t\telse\n \t\t\tmonth = \"\"\n \tend\n \treturn month\n end",
"def archive\n @date = Date.parse(\"#{params[:year]}-#{params[:month]}-01\").strftime('%B, %Y')\n end",
"def month_to_name\n month = Date.new(Time.now.year, purchased_at_month.to_i)\n month.strftime(\"%B\")\n end",
"def publish_month_and_year\n [publish_on.month, publish_on.year]\n end",
"def build_date_from_year_month(data)\n dt = data['year']\n if data['month']\n dt += '-' + data['month'] + '-1'\n end\n dt\n end",
"def month_of_calendar (year, month)\n\tfirst_day_of_this_month = Time.mktime(year, month, 1, 0, 0)\n\tfirst_day_of_first_week = first_day_of_this_month - first_day_of_this_month.wday * 86400\n\tlast_day_of_this_month = Time.mktime(year, month + 1, 1, 0, 0) - 1\n\tlast_day_of_last_week = last_day_of_this_month + (6 - last_day_of_this_month.wday) * 86400\n\n\t# Make calendar\n\ttmp_day = Time.mktime(first_day_of_first_week.year,\n\t\t\t\t\t\tfirst_day_of_first_week.month,\n\t\t\t\t\t\tfirst_day_of_first_week.day, 0, 0)\n\ttmp_calendar = Array.new()\n\n\twhile tmp_day <= last_day_of_last_week\n\t\ttmp_calendar = tmp_calendar + [[Time.mktime(tmp_day.year, tmp_day.month, tmp_day.day, 0, 0),\"\"]]\n\t\ttmp_day = tmp_day + 86400\n\tend\n\t\n\t# Get this month's todo\t\n todo_list = Todo.find(:all,\n\t\t:conditions => [ \"member_id = ? AND limit_datetime >= ? AND limit_datetime <= ? \", \n\t\t@current_user.id, first_day_of_this_month, last_day_of_this_month],\n\t\t:order => 'limit_datetime')\n\n\t# Insert todos into calendar\n\ttodo_list.each do |todo|\n\t\ttmp_index = first_day_of_this_month.wday + todo.limit_datetime.day - 1\n#\t\tif todo.text.length >= 12\n# 字数制限をしない。<div><nobr>で制御しているので必要ない。\n\t\tif todo.text.length == -1\n\t\t\ttmp_calendar[tmp_index][1] = tmp_calendar[tmp_index][1] + \"<br>\" + todo.text[0,11] + \"...\"\n\t\telse\n\t\t\ttmp_calendar[tmp_index][1] = tmp_calendar[tmp_index][1] + \"<br>\" + todo.text\n\t\tend\n\tend\n\n\treturn tmp_calendar\n end",
"def months\n self.to_i * 2_592_000\n end",
"def timeframe_months\n if self.end_date.present?\n number = (self.end_date.year * 12 + self.end_date.month) - (Date.today.year * 12 + Date.today.month)\n else\n number = 0\n end\n \"#{number} #{'month'.pluralize(number).capitalize}\"\n end",
"def transactions_by_month\n date = Date.parse(params[:date])\n @transactions = Order.all_transactions_for_month(date.month, date.year)\n respond_to do |format|\n format.html\n format.csv { send_data Order.transaction_csv(@transactions), { filename: \"#{date.strftime('%Y')}_#{date.strftime('%m')}_transactional_detail.csv\" } }\n end\n end",
"def translated_month_names; end",
"def apply_function_month(scope, ast)\n scope, date = apply_ast(scope, ast.children.first)\n return scope, \"(date_part('month', #{date})::integer)\"\n end",
"def normalize_month(month)\n month % 12 + 1\n end",
"def add_month_to_db\n \n year, month = Macroval.most_recent_month \n \n new_month = (month == 12) ? 1 : month+1\n new_year = (month == 12) ? year+1 : year\n \n Macroval.create( :year_month => new_year+new_month.to_f/100 ) \n \n redirect_to :action => 'add_latest_data'\n \n end",
"def month\n self.founded.strftime(\"%B\")\n end",
"def time_month; Time.now.month; end",
"def monthly\n keys = redis.keys(\"#{prefix_monthly}:*\")\n keys.zip(redis.mget(keys)).inject({}) { |t,p| t.merge(p.first.sub(\"#{prefix_monthly}:\", '') => p.last.to_i) }\n end",
"def start_date_of_roll_period(year, month)\n # todo, to be truly accurate with respect to the description, this should figure out the date of the Tuesday prior to the settlement date, but I think subtracting one day is the real intention.\n vix_futures_settlement_date(year, month) - 1\n # prior_cboe_business_day(vix_futures_settlement_date(year, month))\nend",
"def historic_trading(region, year, month)\n region = AEMO::Region.new(region) if region.is_a?(String)\n\n month = Kernel.format('%02d', month)\n url = 'https://aemo.com.au/aemo/data/nem/priceanddemand/' \\\n \"PRICE_AND_DEMAND_#{year}#{month}_#{region}1.csv\"\n\n response = HTTParty.get(url)\n parse_response(response)\n end",
"def month_result_string(day)\n start = day.beginning_of_month.yday - 1\n finish = day.end_of_month.yday - 1\n result_string(day.year).slice(start..finish)\n end",
"def months_list\n unless @months_list\n months = []\n date = start_date\n while date <= end_date\n months << date\n date += 1.month\n end\n @month_list = months\n end\n\n @month_list\n end",
"def oz_archived_months(sep = ', ')\n year, string = 0, ''\n months = {}\n years = []\n\n Post.archived_months.map do |month| \n date = Time.parse(month)\n if date.year > year\n year = date.year\n months[year] = []\n years << year\n end\n months[year] << month_link(date.strftime('%B').downcase, month) \n end\n\n years.map { |y| \"#{y}: \" << months[year].join(sep) }.join('<br/>')\n end",
"def month_by_month_table(event)\n headers = ['Title']\n month_column_headers = months_list.map { |m| m.strftime(MONTH_KEY) }\n headers.concat(month_column_headers)\n table = [headers]\n\n each do |item|\n monthly_stats = months_list.map { |m| item.get_stat(event, m.strftime(MONTH_KEY)) }\n table << [item.document.title].concat(monthly_stats)\n end\n\n total_stats = months_list.map { |m| total_for(event, m.strftime(MONTH_KEY)) }\n table << ['Totals:'].concat(total_stats)\n\n table\n end",
"def calories_month(db, member_id)\n total_calories= []\n this_month = Time.now.strftime(\"%m\") \n calories_date= db.execute(\"SELECT * FROM calories WHERE member_id='#{member_id}' AND month='#{this_month}' \")\n calories_date.each do |cals|\n total_calories << cals['amt_burned']\n end \n total_calories.inject(:+)\nend",
"def change_month\n from_year = params[:year].to_i\n from_month = params[:month].to_i\n current_action = params[:current_action]\n _page_redirect_to(from_year, from_month, current_action)\n end",
"def billing_monthly?\n numbering_period == 'monthly'\n end",
"def month(date)\n [MONTHS[date.month - 1], year(date)].join(', ')\n end",
"def current_month\n Time.now.strftime(\"%^b\")\n end",
"def monthly_payment\n\t\tc = monthly_interest\n\t\tif interest_only?\n\t\t\tc * amount\n\t\telse\n\t\t\tn = total_payments\n\t\t\t(amount * ((c * ((1 + c)**n)) / (((1 + c)**n) - 1))).round(2)\n\t\tend\n\tend",
"def oz_archived_months(sep = ', ')\r\n year, string = 0, ''\r\n months = {}\r\n years = []\r\n\r\n Post.archived_months.map do |month|\r\n date = Time.parse(month)\r\n if date.year > year\r\n year = date.year\r\n months[year] = []\r\n years << year\r\n end\r\n months[year] << month_link(date.strftime('%B').downcase, month)\r\n end\r\n\r\n years.map { |y| \"#{y}: \" << months[year].join(sep) }.join('<br/>')\r\n end",
"def each_april( n=1); each_monthnum(self.Apr,n); end",
"def archived_months(options = {})\n months = {}\n month_format = options.delete(:month_names) || :int\n\n db_adapter = ActiveRecord::Base.configurations[Rails.env]['adapter']\n\n time_zone = ''\n\n if db_adapter == \"postgresql\"\n tz = Time.zone.utc_offset / 60 / 60\n time_zone = \" AT TIME ZONE '#{tz > 0 ? \"+#{tz.to_s}\" : tz.to_s}'\"\n end \n\n where(\"EXTRACT(YEAR FROM #{date_field}#{time_zone}) = #{options[:year] || Time.now.year}\").\n group(\"EXTRACT(MONTH FROM #{date_field}#{time_zone})\").size.sort_by{ |key, value| key.to_i }.each do |month, c|\n key = case month_format\n when :long\n Date::MONTHNAMES[month.to_i]\n when :short\n Date::ABBR_MONTHNAMES[month.to_i]\n else\n month.to_i\n end\n\n months[key] = c\n end\n\n months\n end",
"def test_monthly_duration_products_are_present_in_summary\n activity = account_activities(:one)\n price = billing_prices(:create_one_month)\n activity.update(activity_type: 'create', price: price)\n\n response = <<-XML\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <results>\n <Result Type=\"0\" Desc=\"OK\" docid=\"309902\" doctype=\"ARVE\" submit=\"Invoices\"/>\n </results>\n XML\n\n stub_request(:post, ENV['directo_invoice_url']).with do |request|\n body = CGI.unescape(request.body)\n body.include? 'month(s)'\n end.to_return(status: 200, body: response)\n\n assert_difference 'Setting.directo_monthly_number_last' do\n DirectoInvoiceForwardLegacyJob.perform_now(monthly: true, dry: false)\n end\n end"
] | [
"0.66572005",
"0.6550886",
"0.6426259",
"0.6388943",
"0.6368296",
"0.6368296",
"0.6343893",
"0.63118684",
"0.62379336",
"0.62376076",
"0.6217388",
"0.6216285",
"0.6178661",
"0.61545473",
"0.61245275",
"0.6068385",
"0.60121477",
"0.60079324",
"0.5964177",
"0.5949472",
"0.5949472",
"0.5933059",
"0.59314907",
"0.59255236",
"0.5914241",
"0.5902927",
"0.58894813",
"0.5888177",
"0.58801395",
"0.58759433",
"0.5872517",
"0.5865196",
"0.5856054",
"0.58506656",
"0.58460766",
"0.5827124",
"0.58247393",
"0.580928",
"0.58061236",
"0.5801622",
"0.57940036",
"0.57860285",
"0.57545924",
"0.57438415",
"0.5737229",
"0.57338256",
"0.5731659",
"0.57256925",
"0.57250583",
"0.5715246",
"0.5714208",
"0.5713448",
"0.5713077",
"0.57119936",
"0.5710223",
"0.56978154",
"0.5696143",
"0.56910706",
"0.5682382",
"0.5677246",
"0.5675252",
"0.56735545",
"0.56660867",
"0.56659603",
"0.5664995",
"0.56601924",
"0.565912",
"0.56520844",
"0.5644873",
"0.56303173",
"0.56083864",
"0.5599839",
"0.55965537",
"0.55865717",
"0.55848694",
"0.55839294",
"0.5580281",
"0.557953",
"0.5575082",
"0.5573104",
"0.5568275",
"0.5566711",
"0.556459",
"0.5562589",
"0.5552861",
"0.55518353",
"0.55431676",
"0.5542778",
"0.55420333",
"0.5536952",
"0.5536436",
"0.55351156",
"0.5531303",
"0.55305386",
"0.55256003",
"0.5524854",
"0.5524583",
"0.552458",
"0.5523354",
"0.5522313"
] | 0.6724994 | 0 |
Summary expenses report for calendar month +month_period+ +month_period+ A string like 'yyyyMM' that represent month of year | def get_expenses_summary(month_period)
request('getExpensesSummary', base_api_parameters.merge({ monthPeriod: month_period }))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def month() end",
"def expenses_for(m)\n d = Date.parse(m)\n exp = self.expenses.within_range(d, ((d + 1.month) - 1.day)).sum(:amount)\n exp.nil? ? 0 : exp\n end",
"def month_depot\n \"#{depot.name} \"+\"#{issue_date.strftime(\"%b\")} \"+\"#{issue_date.year}\"\n end",
"def month; end",
"def month; end",
"def monthly\n end",
"def idsr_monthly_summary\n @report_name = 'IDSR Monthly Summary'\n @logo = CoreService.get_global_property_value('logo').to_s\n @current_location_name =Location.current_health_center.name\n @obs_start_year = Observation.first.obs_datetime.year\n\n render :layout => 'report'\n end",
"def month=(_arg0); end",
"def calculate_month_by_month\n return StandardError, 'Already calculated stats for period' if @calculated.include?(:month_by_month)\n check_for_dates\n\n months_list.each do |date|\n start = date.beginning_of_month\n final = date.end_of_month\n month_key = start.strftime(MONTH_KEY)\n\n calculate_stats_for(month_key, Statistic::VIEW, start, final)\n calculate_stats_for(month_key, Statistic::STREAM, start, final) if include_streaming\n calculate_stats_for(month_key, Statistic::DOWNLOAD, start, final)\n end\n @calculated << :month_by_month\n self\n end",
"def month_by_month_table(event)\n headers = ['Title']\n month_column_headers = months_list.map { |m| m.strftime(MONTH_KEY) }\n headers.concat(month_column_headers)\n table = [headers]\n\n each do |item|\n monthly_stats = months_list.map { |m| item.get_stat(event, m.strftime(MONTH_KEY)) }\n table << [item.document.title].concat(monthly_stats)\n end\n\n total_stats = months_list.map { |m| total_for(event, m.strftime(MONTH_KEY)) }\n table << ['Totals:'].concat(total_stats)\n\n table\n end",
"def month_name(number); end",
"def change_type_list_expenses( expenses_month, year )\n HelperController.int_to_month( expenses_month )\n temporary_expense = { year => expenses_month }\n\n return temporary_expense\n end",
"def generate_month_expenses\n Expense.all.each do |expense|\n MonthExpense.create(month_id: self.id, expense_id: expense.id)\n end\n end",
"def month_names; end",
"def index\n if @expense.nil?\n today = Date.today\n year = params[:year].to_i if params[:year]\n month = params[:month].to_i if params[:month]\n \n @date = today\n \n if year && month\n day = today.day\n if year != today.year || month != today.month\n day = 1\n end\n @date = Date.civil(year, month, day)\n end\n else\n @date = @expense.date\n end\n \n @expenses = Expense.by_month(@date)\n \n respond_to do |format|\n format.html { render :action => 'index' }\n format.xml { render :xml => @expenses }\n end\n end",
"def make_month_stats(month)\n rows = Account.all(:order => \"position\").map{|account|\n items = Item.all(:conditions => {\n :account_id => account.id,\n :date => month_range(month), \n :type => [\"Expense\", \"Income\"]\n }).group_by(&:category)\n\n make_row(account.name, items)\n }\n\n return rows.push make_sum_row(rows)\n end",
"def month\n end",
"def period_in_words\n case recurring_month\n when 12\n 'yearly'\n when 1\n 'monthly'\n when 0\n \"once\"\n else\n \"every #{recurring_month} months\"\n end\n end",
"def create_monthly_data\n number = @slide_number.to_i + 1\n monthly_data = Nokogiri::HTML(\n open(\n \"#{ENV['API_DOMAIN_2']}#{ENV['API_DOMAIN_2_MONTHLY']}\"\n )\n ).css(\"div.shareable-section-wrapper\").last\n\n data = {\n sign: @sign_name.to_s,\n duration: \"monthly\",\n horoscope_text: monthly_data.css(\"div[#{number}]\").text.split(' ')[1..-1].join(' ')\n } if monthly_data\n Horoscope.create(data) if monthly_data and data\n end",
"def show\n @expenses = @expenses_file.expenses.select(\"strftime('%m', date) as month, strftime('%Y', date) as year, SUM(tax_amount) + SUM(pre_tax_amount) AS total\").\n group('month, year').order('year, month').as_json\n end",
"def months() 30 * days end",
"def month\n set_function_and_argument(:month, nil)\n end",
"def displayTransactionsMonth(month)\n displayTransactionsBlankRow\n row do\n @pastMonthDeployed = true\n column(getRuleString(@transWidth_1))\n column(getRuleString(@transWidth_2))\n column(getRuleString(@transWidth_3))\n column(\" [ #{month.upcase} ] #{getRuleString(@transWidth_4 - (month.length + 6))}\")\n column(getRuleString(@transWidth_5))\n column(getRuleString(@transWidth_6))\n column(getRuleString(@transWidth_7))\n end\n displayTransactionsBlankRow\n end",
"def rsmonth(month)\n case month\n when 1\n return 'januar'\n when 2\n return 'februar'\n when 3\n return 'mart'\n when 4\n return 'april'\n when 5\n return 'maj'\n when 6\n return 'jun'\n when 7\n return 'jul'\n when 8\n return 'avgust'\n when 9\n return 'septembar'\n when 10\n return 'oktobar'\n when 11\n return 'novembar'\n when 12\n return 'decembar'\n end\nend",
"def calculated_spend_by_month\n return if !organisation.respond_to?(:payments) || organisation.payments.count == 0\n res_hsh = {}\n group_by = case ActiveRecord::Base.connection.adapter_name\n when 'MySQL'\n # https://github.com/django/django/blob/master/django/db/backends/mysql/base.py#L207\n \"CAST(DATE_FORMAT(date, '%Y-%m-01 00:00:00') AS DATETIME)\"\n else # PostgreSQL\n # https://github.com/django/django/blob/master/django/db/backends/postgresql_psycopg2/operations.py#L35\n \"DATE_TRUNC('month', date)\"\n end\n ft_sums = organisation.payments.sum(:value, :conditions => {:date_fuzziness => nil}, :group => group_by).to_a\n fuzzy_sums = organisation.payments.all(:select => 'SUM(value) AS value, date, date_fuzziness', :conditions => \"date_fuzziness IS NOT NULL\", :group => 'date, date_fuzziness')\n\n fuzzy_sums.each{ |fs| ft_sums += fs.averaged_date_and_value }\n\n ft_sums.each do |ft_sum|\n res_hsh[ft_sum.first.to_date.beginning_of_month] = res_hsh[ft_sum.first.to_date.beginning_of_month].to_f + ft_sum.last\n end\n\n months_with_vals = res_hsh.sort\n \n first_month, last_month = months_with_vals.first, months_with_vals.last\n spend_by_month_array(first_month.first, last_month.first, months_with_vals)\n end",
"def each_month\n @all_expenses ||= Expense.find(:all, :order => 'date')\n return if @all_expenses.empty?\n date = @all_expenses.first.date.beginning_of_month\n end_date = @all_expenses.last.date\n while date <= end_date\n yield date\n date += 1.month\n end\n end",
"def index\n @expense_by_category_and_month = {}\n @expense_by_category = {}\n expenses_total_by_month = {}\n @expense_month = []\n @expense_total = []\n @expenses = current_user.expenses.all\n if @expenses.present?\n @start_date = @expenses[0].date\n end\n\n\n # hack to make sure it is not nil\n @expense_by_category_and_month['Bills & Utilities'] = []\n @expense_by_category_and_month['Food & Dining'] = []\n @expense_by_category_and_month['Auto & Transport'] = []\n @expense_by_category_and_month['Entertainment'] = []\n @expense_by_category_and_month['Health & Fitness'] = []\n @expense_by_category_and_month['Shopping'] = []\n @expense_by_category_and_month['Kids'] = []\n @expense_by_category_and_month['Pet'] = []\n @expense_by_category_and_month['Home'] = []\n @expense_by_category_and_month['Uncatagorized'] = []\n\n expense_by_month_by_category = {}\n\n current_user.expenses.select(\"to_char(expenses.date, 'YYYY-MM') as expense_month, expenses.category as expense_category, SUM(expenses.amount_cents) as total\").group(\"category, to_char(expenses.date, 'YYYY-MM')\").order(\"to_char(expenses.date, 'YYYY-MM'), category\").each do | exp |\n\n # Use for column\n if not expense_by_month_by_category.has_key?(exp.expense_month)\n expense_by_month_by_category[exp.expense_month] = {}\n end\n expense_by_month_by_category[exp.expense_month][exp.expense_category] = exp.total.to_i/100\n\n\n # Expense by category and month within category\n #if not @expense_by_category_and_month.has_key?(exp.expense_category)\n # @expense_by_category_and_month[exp.expense_category] = []\n #end\n #@expense_by_category_and_month[exp.expense_category] << exp.total.to_i/100\n\n # Use for pie chart\n if not @expense_by_category.has_key?(exp.expense_category)\n @expense_by_category[exp.expense_category] = exp.total.to_i/100\n else\n @expense_by_category[exp.expense_category] += exp.total.to_i/100\n end\n\n # Total expenses by month\n if expenses_total_by_month[exp.expense_month].present?\n expenses_total_by_month[exp.expense_month] += exp.total.to_i/100\n else\n expenses_total_by_month[exp.expense_month] = exp.total.to_i/100\n end\n end\n\n # Calculate the columns. Handle missing ones\n expense_by_month_by_category.keys.sort.each do | month |\n @expense_by_category_and_month.keys.each do | category |\n if expense_by_month_by_category[month][category].present?\n @expense_by_category_and_month[category] << expense_by_month_by_category[month][category]\n else\n @expense_by_category_and_month[category] << 0\n end\n end\n\n end\n\n\n #current_user.expenses.select(\"to_char(expenses.date, 'YYYY-MM') as expense_month, SUM(expenses.amount_cents) as total\").group(\"to_char(expenses.date, 'YYYY-MM')\").each do | exp |\n # expenses_total_by_month[exp.expense_month] = exp.total.to_i/100\n #end\n\n expenses_total_by_month.sort.map {|k,v| @expense_total << v}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n rescue\n puts \"#{$!}\"\n end",
"def monthly_summary_params\n params.require(:monthly_summary).permit(:year, :month, :begin_at, :end_at, :carryover_amount, :this_month_amount, :amount, :customer_id)\n end",
"def index\n d = Date.today\n @expenses = @household.expenses.monthly_statement(d.month, d.year).order(spent_at: :desc)\n end",
"def report_period_to_title\n case self\n when 'this_month'\n 'Days'\n when 'last_month'\n 'Days'\n when 'last_6_months'\n 'Months'\n when 'this_year'\n 'Months'\n end\n end",
"def test_yearly_by_month_loop\n parse(\n 'FREQ=YEARLY;INTERVAL=1;UNTIL=20120203T225959Z;BYMONTH=2;BYSETPOS=1;BYDAY=SU,MO,TU,WE,TH,FR,SA',\n '2012-01-01 15:45:00',\n [\n '2012-02-01 15:45:00'\n ],\n '2012-01-29 23:00:00'\n )\n end",
"def card_month\n card[:month].to_i\n end",
"def month_result_string(day)\n start = day.beginning_of_month.yday - 1\n finish = day.end_of_month.yday - 1\n result_string(day.year).slice(start..finish)\n end",
"def apply_function_month(scope, ast)\n scope, date = apply_ast(scope, ast.children.first)\n return scope, \"(date_part('month', #{date})::integer)\"\n end",
"def month_name\n report_date.strftime(\"%B\")\n end",
"def month_label\n \"#{label}\"\n end",
"def make_year_stats(months)\n rows = months.map{|month|\n items = Item.all(:conditions => {\n :date => month_range(month),\n :type => [\"Expense\", \"Income\"]\n }).group_by(&:category)\n\n make_row(month, items)\n }\n\n return rows.push make_sum_row(rows)\n end",
"def month\n return @month\n end",
"def month\n @year = params[:year].to_i\n @month = params[:month].to_i\n @first_day = @event.first_day_of_month(@year, @month)\n @last_day_of_month = Date.new(@year, @month, 1).end_of_month\n end",
"def month_payment(dept)\n result = Hash.new\n credit_percent = (dept * @percent/12)\n credit_payment = (@base - credit_percent)\n result[:res_credit_payment] = credit_payment\n result[:res_credit_percent] = credit_percent\n result[:res_credit] = @base\n result[:res_remainder] = (dept - credit_payment)\n result\n end",
"def month=(value)\n @month = value\n end",
"def month_by_month_csv\n CSV.generate do |csv|\n report_details.each { |a| csv.add_row(a) }\n csv.add_row [] # Blank row\n csv.add_row ['VIEWS']\n month_by_month_table(Statistic::VIEW).each { |a| csv.add_row(a) }\n csv.add_row [] # Blank row\n csv.add_row ['DOWNLOADS']\n month_by_month_table(Statistic::DOWNLOAD).each { |a| csv.add_row(a) }\n end\n end",
"def get_month(year, month)\n entries = month_entries(@pages, year, month) \n\n budget_month = BudgetMonth.new(entries, year, month)\n\n budget_month\n end",
"def period\n case self.recurring_month\n when 12\n 1.year # 1.year != 12.months\n else\n self.recurring_month.months\n end\n end",
"def calories_month(db, member_id)\n total_calories= []\n this_month = Time.now.strftime(\"%m\") \n calories_date= db.execute(\"SELECT * FROM calories WHERE member_id='#{member_id}' AND month='#{this_month}' \")\n calories_date.each do |cals|\n total_calories << cals['amt_burned']\n end \n total_calories.inject(:+)\nend",
"def months ; self * 30.days ; end",
"def index\n # @accounts = Account.order(:buyday).all.page(params[:page]).per(5)\n @accounts = Account.all.page(params[:page]).per(5)\n @grouped_months = @accounts.group_by { |r| r.buyday.beginning_of_month}\n\n @month_num = ['1','2','3','4','5','6','7','8','9','10','11','12']\n @month_details = []\n @month_costs = []\n (0..11).each do |i|\n @month_details[i] = Account.where([\"date_part('month',buyday) = ? and date_part('year',buyday) = ?\" , @month_num[i],2015]).order('buyday desc')\n @month_costs[i] = Account.where([\"date_part('month',buyday) = ? and date_part('year',buyday) = ?\" , @month_num[i],2015]).sum(:dollar)\n end\n # @mar = Account.where(['buyday between ? and ?', '2015-03-01', '2015-03-31' ])\n \n end",
"def months_in_year\n 12\nend",
"def monthly_timesheet\n \n end",
"def index\n @monthly_expenses = MonthlyExpense.all\n end",
"def each_may( n=1); each_monthnum(self.May,n); end",
"def add_month(age) \n GenFactor::sanitize_age((age + (1.0/12.0)))\n end",
"def title \n t = ['Natures']\n t += @period.list_months.to_abbr_with_year \n t << 'Total' \n end",
"def expdate(credit_card)\n month = format(credit_card.month, :two_digits)\n year = format((credit_card.year > 2000 ? credit_card.year - 2000 : credit_card.year), :two_digits)\n \"#{year}#{month}\"\n end",
"def month? = unit == 'month'",
"def expiration_month\n @months = [\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\"]\n end",
"def generate_month_definition_strings(rules_by_month, parsed_custom_methods)\n month_strings = []\n\n rules_by_month.each do |month, rules|\n month_string = \" #{month.to_s} => [\"\n rule_strings = []\n rules.each do |rule|\n string = '{'\n if rule[:mday]\n string << \":mday => #{rule[:mday]}, \"\n end\n\n if rule[:function]\n string << \":function => \\\"#{rule[:function].to_s}\\\", \"\n\n # We need to add in the arguments so we can know what to send in when calling the custom proc during holiday lookups.\n # NOTE: the allowed arguments are enforced in the custom methods parser.\n string << \":function_arguments => #{get_function_arguments(rule[:function], parsed_custom_methods)}, \"\n\n if rule[:function_modifier]\n string << \":function_modifier => #{rule[:function_modifier].to_s}, \"\n end\n end\n\n # This is the 'else'. It is possible for mday AND function\n # to be set but this is the fallback. This whole area\n # needs to be reworked!\n if string == '{'\n string << \":wday => #{rule[:wday]}, :week => #{rule[:week]}, \"\n end\n\n if rule[:year_ranges] && rule[:year_ranges].is_a?(Hash)\n selector = rule[:year_ranges].keys.first\n value = rule[:year_ranges][selector]\n\n string << \":year_ranges => { :#{selector} => #{value} },\"\n end\n\n if rule[:observed]\n string << \":observed => \\\"#{rule[:observed].to_s}\\\", \"\n string << \":observed_arguments => #{get_function_arguments(rule[:observed], parsed_custom_methods)}, \"\n end\n\n if rule[:type]\n string << \":type => :#{rule[:type]}, \"\n end\n\n # shouldn't allow the same region twice\n string << \":name => \\\"#{rule[:name]}\\\", :regions => [:\" + rule[:regions].uniq.join(', :') + \"]}\"\n rule_strings << string\n end\n month_string << rule_strings.join(\",\\n \") + \"]\"\n month_strings << month_string\n end\n\n return month_strings\n end",
"def calendar_month_header date\n \"#{I18n.translate('date.month_names')[date.month]} #{date.year}\"\n end",
"def timeframe_months\n if self.end_date.present?\n number = (self.end_date.year * 12 + self.end_date.month) - (Date.today.year * 12 + Date.today.month)\n else\n number = 0\n end\n \"#{number} #{'month'.pluralize(number).capitalize}\"\n end",
"def idsr_monthly_report_summary\n date = params[:year_month].split('-')\n @start_date = Date.new(date[0].to_i,date[1].to_i)\n\n @end_date = @start_date + 1.month - 1.day\n @disaggregated_diagnosis = {}\n\n idsr_monthly_set = ConceptName.where([\"name IN (?)\",[\"Idsr Monthly Summary\"]]).map(&:concept_id)\n\n\n idsr_monthly_set_members = ConceptSet.where([\"concept_set IN (?)\",idsr_monthly_set]).map(&:concept_id)\n\n concept_ids = ConceptName.where([\"concept_name.concept_id IN (?)\",\n idsr_monthly_set_members]).map(&:concept_id)\n\n observation = Observation.where([\"obs.obs_datetime >= ? AND obs.obs_datetime <= ?\n AND obs.value_coded IN (?)\",@start_date, @end_date,concept_ids]).includes({:person=>{}})\n\n observation.each do | obs|\n next if obs.person.blank?\n next if obs.answer_concept.blank?\n previous_date = obs.obs_datetime.strftime('%Y-%m-%d').to_date\n sex = obs.person.gender\n age = PatientService.age(obs.person, previous_date)\n diagnosis_name = obs.answer_concept.fullname rescue ''\n\n @disaggregated_diagnosis[diagnosis_name]={\n \"=<4\" =>0,\n \"=>5\" =>0\n }\n\n # if @disaggregated_diagnosis[diagnosis_name] != nil\n if age.to_i < 5\n @disaggregated_diagnosis[diagnosis_name][\"=<4\"]+=1\n else\n @disaggregated_diagnosis[diagnosis_name][\"=>5\"]+=1\n end\n # end\n # end\n @diaggregated_paginated = []\n @disaggregated_diagnosis.each { | diag, value |\n @diaggregated_paginated << [diag, value]\n }\n end\n #raise @diaggregated_paginated.inspect\n render :json=> @diaggregated_paginated\n end",
"def each_april( n=1); each_monthnum(self.Apr,n); end",
"def show_month\n e = Emission.find(params[:id])\n @id = params[:id]\n @site = Site.find(e.site.id)\n @year = e.year.to_i\n @month = e.month.to_i - 1\n if e.month == 1\n @year -= 1 \n @month = 12\n end\n \n @thismonth = @site.emissions.find(:first, :conditions => {:month => @month.to_s, :year => @year.to_s})\n if @month == 12\n \t@nextmonth = @site.emissions.find(:first, :conditions => {:month => (1).to_s, :year => (@year+1).to_s})\n else\n\t@nextmonth = @site.emissions.find(:first, :conditions => {:month => (@month+1).to_s, :year => @year.to_s})\n end\n if @month == 1\n \t@prevmonth = @site.emissions.find(:first, :conditions => {:month => (12).to_s, :year => (@year-1).to_s})\n else\n \t@prevmonth = @site.emissions.find(:first, :conditions => {:month => (@month-1).to_s, :year => @year.to_s})\n end\n @id = @thismonth.id\n render :partial => 'month'\n end",
"def month_str\n ret = Datet.months(:trans => true)[@t_month]\n if args and args[:short]\n ret = ret.slice(0, 3)\n end\n \n return ret\n end",
"def display_month_with_year\n puts (name_of_month + \" #{@year}\").center(20) +\" \"\n puts weeks_with_year\n end",
"def eo_month()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::EoMonth::EoMonthRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def month\n Thread.current[:datet_mode] = :months\n return @t_month\n end",
"def getEstimatedSalesReport(year, month)\n url = sprintf('https://play.google.com/apps/publish/salesreport/download?report_date=%04d_%02d&report_type=sales_report&dev_acc=%s', year, month, @dev_acc)\n try_get(url)\n return @agent.page.body\n end",
"def months; self * MONTH; end",
"def income_this_month\n Sale.past_month.sum(:total)\n end",
"def calculate_month_and_next_month(year, month)\n check_date = Time.new(year, month)\n {:actual => check_date, :next => check_date.next_month}\n end",
"def month()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Month::MonthRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def year_month_int_to_str(year_month)\n \"#{year_month / 12} #{MONTHS[year_month % 12]}\"\n end",
"def index\n @title = \"Book a Lawn\"\n @bookalawns = Bookalawn.all\n \n @month = (params[:month] || (Time.zone || Time).now.month).to_i\n @year = (params[:year] || (Time.zone || Time).now.year).to_i\n\n @shown_month = Date.civil(@year, @month)\n\n @event_strips = Bookalawn.event_strips_for_month(@shown_month)\n \n end",
"def month\n self.range('month')\n end",
"def monthly_payment(salary_per_annum)\n return salary_per_annum / 12\nend",
"def month_to_name\n month = Date.new(Time.now.year, purchased_at_month.to_i)\n month.strftime(\"%B\")\n end",
"def month\n self.founded.strftime(\"%B\")\n end",
"def translated_month_names; end",
"def amount_invoiced_for_month(m)\n d = Date.parse(m)\n self.invoices.within_range(d, ((d + 1.month) - 1.day)).sum(:total)\n end",
"def each_december( n=1); each_monthnum(self.Dec,n); end",
"def monthly_sales(report_date = Time.now)\n date = DateTime.parse report_date.to_s\n prior_months = TimeCalculator.prior_year_period(date, {:format => '%b %Y'})\n [].tap do |results|\n prior_months.each { |mon|\n short_mon = DateTime.parse(mon).strftime('%b')\n total_sales = sold_images.sum { |image| image.sale.total_image_sales(mon) }\n results << { :month => short_mon, :sales => total_sales }\n }\n end\n end",
"def DrawMonth(month, start)\r\n\r\n # Display the day of the weeks.\r\n for day_week in @day_week\r\n printf(\"%7s\", day_week)\r\n end\r\n puts ''\r\n \r\n # calulate the start point of month.\r\n for j in 1..@start\r\n printf(\"%7s\", \" \");\r\n end\r\n \r\n # Display dates\r\n for j in 1..@end_month[month]\r\n printf(\"%7d\", j);\r\n @start += 1\r\n \r\n if @start == 7\r\n @start = 0\r\n puts ''\r\n end\r\n end\r\n\r\n # Move on to next month.\r\n @cal += j;\r\n printf(\"\\n\\n\");\r\n end",
"def getMonthObject(transactionMonth)\n case transactionMonth\n when @month1.strftime('%Y-%m')\n monthObject = @summaryData[:month1]\n when @month2.strftime('%Y-%m')\n monthObject = @summaryData[:month2]\n when @month3.strftime('%Y-%m')\n monthObject = @summaryData[:month3]\n when @month4.strftime('%Y-%m')\n monthObject = @summaryData[:month4]\n when @month5.strftime('%Y-%m')\n monthObject = @summaryData[:month5]\n else\n monthObject = nil\n end\n monthObject\n end",
"def monthly(options = {})\n branch options.merge(every: :month)\n end",
"def monthly(options = {})\n branch options.merge(every: :month)\n end",
"def loan_dur_month(loan_duration)\n loan_duration.to_i * 12\nend",
"def cumulative_spending_by_month(date, category)\n Function.new do\n data = (Functions::DateTools.date_to_billing_period >>\n empty_cumulative_set >>\n current_date_line >>\n add_projected_spending).call(date)\n\n (get_daily_totals(category) >> get_cumulative_totals).call(data)\n end\n end",
"def sales_per_month\n response = get 'v1/market/private/user/earnings-and-sales-by-month.json'\n response[:'earnings-and-sales-by-month']\n end",
"def by_interval\n \"/ #{object.interval == \"month\" ? 'mois' : 'an'}\"\n end",
"def list_price_for_month(opts)\n #logger.debug 'enter list_price_for_month'\n if list_price == 0.0 || list_price.blank?\n return 0\n end\n startdate = start_date\n enddate = end_date\n month = opts[:month]\n year = opts[:year]\n days_in_month = BigDecimal(Time.days_in_month(month, year).to_s)\n\n #this month is before the start date\n return 0 if (startdate.month > month && startdate.year == year) || (startdate.year > year)\n #this month is after the end date\n return 0 if (enddate.month < month && enddate.year == year) || (enddate.year < year)\n\n if startdate.month == month && startdate.year == year\n #beginning month\n start_day = startdate.day\n else\n start_day = 1\n end\n\n if enddate.month == month && enddate.year == year\n #ending month\n end_day = enddate.day\n else\n end_day = days_in_month\n end\n\n days_covered = BigDecimal(((end_day - start_day) + 1).to_s)\n list_price * (days_covered / days_in_month) * BigDecimal(qty.to_s)\n end",
"def price_of_month\n { :\"#{Date::MONTHNAMES[Date.strptime(yearmonth, '%Y%m').mon]}\" => price(yearmonth) }\n end",
"def monthly_language_activity\n memoized_language_breakdowns = all_languages_monthly_activity\n\n MONTHS.map do |month|\n res = [Date::MONTHNAMES[month]]\n memoized_language_breakdowns.each do |lang, breakdown|\n value = breakdown.detect { |b| b.fetch(\"month\") == month }\n prs = value ? value.fetch(\"prs\") : 0\n res << prs\n end\n res\n end\n end",
"def month\r\n return @hm\r\n end",
"def test_monthly_duration_products_are_present_in_summary\n activity = account_activities(:one)\n price = billing_prices(:create_one_month)\n activity.update(activity_type: 'create', price: price)\n\n response = <<-XML\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <results>\n <Result Type=\"0\" Desc=\"OK\" docid=\"309902\" doctype=\"ARVE\" submit=\"Invoices\"/>\n </results>\n XML\n\n stub_request(:post, ENV['directo_invoice_url']).with do |request|\n body = CGI.unescape(request.body)\n body.include? 'month(s)'\n end.to_return(status: 200, body: response)\n\n assert_difference 'Setting.directo_monthly_number_last' do\n DirectoInvoiceForwardLegacyJob.perform_now(monthly: true, dry: false)\n end\n end",
"def this_month(limit: 5, markdown: false, rank: :top) \r\n \r\n puts 'inside this_mponth'.info if @debug\r\n coins = sort_coins('30d', limit: limit, rank: rank)\r\n build_table coins, markdown: markdown\r\n\r\n end",
"def match_month\n @month ? { 'fiscal_period_id' => @month.to_i } : {}\n end",
"def month\n start_on.strftime(MONTH_NAME)\n end",
"def time_month; Time.now.month; end",
"def expdate(creditcard)\n year = sprintf(\"%.4i\", creditcard.year)\n month = sprintf(\"%.2i\", creditcard.month)\n\n \"#{year[-2..-1]}#{month}\"\n end",
"def each_february( n=1); each_monthnum(self.Feb,n); end"
] | [
"0.68188566",
"0.677088",
"0.666363",
"0.66531795",
"0.66531795",
"0.6549146",
"0.63745123",
"0.63384",
"0.63263035",
"0.6311498",
"0.6289573",
"0.6287287",
"0.6285008",
"0.62812096",
"0.62656796",
"0.61824304",
"0.61760306",
"0.6157619",
"0.6134104",
"0.60981125",
"0.60656774",
"0.6024642",
"0.5998149",
"0.59848404",
"0.59718746",
"0.59572816",
"0.5956518",
"0.59521407",
"0.5927532",
"0.59269506",
"0.59264916",
"0.5900268",
"0.5880025",
"0.5877572",
"0.587618",
"0.58700144",
"0.58680516",
"0.5862085",
"0.58614886",
"0.58570033",
"0.5844122",
"0.5839733",
"0.58344704",
"0.5830231",
"0.58241427",
"0.58205783",
"0.5800061",
"0.57957023",
"0.57880336",
"0.57728434",
"0.57544935",
"0.5749124",
"0.5747278",
"0.5734779",
"0.57301855",
"0.5726007",
"0.57249975",
"0.571",
"0.5705031",
"0.5685975",
"0.56726396",
"0.5666682",
"0.5664786",
"0.5661857",
"0.5660377",
"0.56577337",
"0.56552714",
"0.5645666",
"0.5628821",
"0.56278193",
"0.5625259",
"0.5623166",
"0.5620307",
"0.5620294",
"0.5619073",
"0.56100947",
"0.56077874",
"0.56022185",
"0.5600462",
"0.55939704",
"0.5592128",
"0.55918306",
"0.5585817",
"0.55829406",
"0.55829406",
"0.5578525",
"0.5563785",
"0.55621076",
"0.55505717",
"0.5545685",
"0.5544537",
"0.55349207",
"0.5527065",
"0.55245155",
"0.55220526",
"0.55196697",
"0.5514821",
"0.55141205",
"0.55134946",
"0.5507607"
] | 0.6889355 | 0 |
Initializer that takes an XcodeTarget as an input | def initialize(target)
@target = target
@name = target.display_name
@is_test_target = target.test_target_type?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(target, test_xcconfig = false)\n @target = target\n @test_xcconfig = test_xcconfig\n end",
"def initialize(pod_name, xcode_project)\n @config = {}\n @pod_name = pod_name\n @target = xcode_project.targets\n .find{|t| t.display_name == \"Pods-#{@pod_name}\"}\n return raise \"Could not find a build target in xcodeproj\" unless target\n end",
"def initialize(target, public_xcconfig)\n @target = target\n @public_xcconfig = public_xcconfig\n end",
"def initialize_target\n end",
"def create_inject_test_target(project, test_dir, test_target_name, test_target_identifier)\n test_target = project.new(Xcodeproj::Project::PBXNativeTarget)\n test_target.name = test_target_name\n test_target.product_name = test_target_name\n test_target.build_configuration_list = Xcodeproj::Project::ProjectHelper.configuration_list project, :ios, \"9.0\"\n\n product_ref = project.products_group.new_reference(\"#{test_target_name}.xctest\", :built_products)\n product_ref.include_in_index = '0'\n product_ref.set_explicit_file_type\n test_target.product_reference = product_ref\n\n test_target_source_build_phase = project.new(Xcodeproj::Project::PBXSourcesBuildPhase)\n test_target.build_phases << test_target_source_build_phase\n test_target.build_phases << project.new(Xcodeproj::Project::PBXFrameworksBuildPhase)\n test_target.build_phases << project.new(Xcodeproj::Project::PBXResourcesBuildPhase)\n\n test_target.build_configuration_list.set_setting('INFOPLIST_FILE', File.join(test_dir, 'Info.plist'))\n test_target.build_configuration_list.set_setting('WRAPPER_EXTENSION', 'xctest')\n test_target.build_configuration_list.set_setting('TEST_HOST', '$(BUNDLE_LOADER)')\n test_target.build_configuration_list.set_setting('PRODUCT_BUNDLE_IDENTIFIER', test_target_identifier)\n test_target.build_configuration_list.set_setting('LD_RUNPATH_SEARCH_PATHS', [\n '$(inherited)',\n '@executable_path/Frameworks',\n '@loader_path/Frameworks',\n ])\n\n Dir.glob(\"#{test_dir.sub /\\/$/, ''}/*.{swift,m}\") do |test_file|\n file_ref = project.new_file test_file\n test_target_source_build_phase.add_file_reference file_ref\n end\n\n return test_target\nend",
"def initialize(target, bundle_package_type: :fmwk)\n @target = target\n @bundle_package_type = bundle_package_type\n end",
"def initialize(target)\n @target = target\n @isa, @abi, @proxy = nil, nil, nil \n end",
"def initialize(target)\n @target = target\n end",
"def initialize(target)\n @target = target\n end",
"def set_launch_target(build_target)\n launch_runnable = BuildableProductRunnable.new(build_target, 0)\n launch_action.buildable_product_runnable = launch_runnable\n\n profile_runnable = BuildableProductRunnable.new(build_target, 0)\n profile_action.buildable_product_runnable = profile_runnable\n\n macro_exp = MacroExpansion.new(build_target)\n test_action.add_macro_expansion(macro_exp)\n end",
"def initialize(target)\n @target = target\n end",
"def initialize\n self.sdk = \"iphonesimulator\" unless sdk\n self.test_output = :junit\n super\n end",
"def initialize( target )\n\t\t@target = target\n\tend",
"def initialize(target, text)\n @target = target.to_sym\n #noinspection RubyArgCount\n raise \"Unsupported docs target #@target\" unless DOC_TARGETS.member?(@target)\n @text = text\n end",
"def initialize(xcframeworks, sandbox_root, platform)\n @xcframeworks = xcframeworks\n @sandbox_root = sandbox_root\n @platform = platform\n end",
"def initialize(target)\n @target = target\n end",
"def initialize(target)\n @target = target\n end",
"def initialize(*args)\n target = args.shift\n @target = File.exists?(target) ? File.read(target) : target rescue target\n @options = args\n end",
"def initialize(framework)\n self.framework = framework\n end",
"def main\n OptionParser.new do |opts|\n opts.banner = 'Usage: xcode_tool.rb [options]'\n opts.on('-d', '--XCodeCPP.xcodeProjectDir [dir]',\n 'XCode project directory (required)') do |xcode_project_dir|\n @xcode_project_dir = xcode_project_dir\n end\n opts.on('-t', '--XCodeCPP.target [target]',\n 'Assume target to match the .xcodeproj name. (required)') do |target|\n @target_name = target\n end\n opts.on('-f', '--XCodeCPP.frameworks [frameworks]',\n 'Paths to the custom frameworks. (required)') do |frameworks|\n @frameworks = frameworks.split(\",\")\n end\n opts.on('-e', '--XCodeCPP.entitlement [entitlement_path]',\n 'Path to entitlements (optional)') do |entitlement_path|\n @entitlement_path = entitlement_path\n end\n opts.on('-i', '--XCodeCPP.include [include_path]',\n 'Path to additional include files (optional)') do |include_path|\n @include_path = include_path\n end\n end.parse!\n\n raise OptionParser::MissingArgument,'-d' if @xcode_project_dir.nil?\n raise OptionParser::MissingArgument,'-t' if @target_name.nil?\n raise OptionParser::MissingArgument,'-f' if @frameworks.nil?\n\n project_path = \"#@xcode_project_dir/integration_test.xcodeproj\"\n @project = Xcodeproj::Project.open(project_path)\n for t in @project.targets\n if t.name == @target_name\n @target = t\n puts \"Find target #@target\"\n break\n end \n end\n\n # Examine components rather than substrings to minimize false positives.\n # Note: this is not ideal. This tool should not be responsible for figuring\n # out which project it's modifying. That responsibility should belong to\n # the Python tool invoking this.\n path_components = project_path.split('/')\n if path_components.include?('FirebaseAuth')\n make_changes_for_auth\n elsif path_components.include?('FirebaseMessaging')\n make_changes_for_messaging\n elsif path_components.include?('FirebaseDynamicLinks')\n make_changes_for_dynamiclinks\n end\n\n framework_dir = \"#@xcode_project_dir/Frameworks\"\n set_build_setting('FRAMEWORK_SEARCH_PATHS', ['${inherited}', framework_dir])\n if !@include_path.nil?\n append_to_build_setting('HEADER_SEARCH_PATHS', @include_path)\n end\n\n @frameworks.each do |framework|\n add_custom_framework(framework)\n end\n\n # Bitcode is unnecessary, as we are not submitting these to the Apple store.\n # Disabling bitcode significantly speeds up builds.\n set_build_setting('ENABLE_BITCODE', 'NO')\n\n @project.save\nend",
"def initialize(framework_name, parent_directory, framework_paths)\n @framework_name = framework_name\n @framework_paths = framework_paths\n @parent_directory = parent_directory\n\n @framework_directory = File.join(\n @parent_directory,\n \"#{@framework_name}.xcframework\"\n )\n end",
"def initialize(target_class)\n @target_class = target_class\n @machine = Machine.new(target_class)\n end",
"def initialize(target_expression, options = {})\n if target_expression.to_s.length.zero?\n raise ArgumentError, 'target cannot be nil or blank'\n else\n @target = target_expression.to_s\n end\n @options = {}\n merge_options!(self.class.default_options)\n merge_options!(options)\n end",
"def build(scheme, sdk, destination, action, run_timing_tests)\n additional_args = ['true',1].include?(run_timing_tests.downcase) ? '' : 'GCC_PREPROCESSOR_DEFINITIONS=OHHTTPSTUBS_SKIP_TIMING_TESTS'\n puts <<-ANNOUNCE\n =============================\n | Xcode : #{`xcodebuild -version`.chomp.gsub(\"\\n\",'; ')}\n | Action : #{action}\n | SDK : #{sdk}\n | Scheme : \"#{scheme}\"\n | Destination: #{destination}\n | args : \"#{additional_args}\"\n =============================\n\n ANNOUNCE\n\n cmd = %W(\n xcodebuild\n -workspace OHHTTPStubs/OHHTTPStubs.xcworkspace\n -scheme \"#{scheme}\"\n -sdk #{sdk}\n -configuration Debug\n ONLY_ACTIVE_ARCH=NO\n #{additional_args}\n -destination '#{destination}'\n clean #{action}\n )\n\n sh \"set -o pipefail && #{cmd.join(' ')} | xcpretty -c\"\nend",
"def fake_out_xcode_project_loading\n fake_result = <<-EOS\nInformation about project \"Example\":\n Targets:\n Example\n ExampleUITests\n ExampleMacOS\n ExampleMacOSUITests\n Build Configurations:\n Debug\n Release\n If no build configuration is specified and -scheme is not passed then \"Release\" is used.\n Schemes:\n Example\n ExampleUITests\n ExampleMacOS\nEOS\n allow_any_instance_of(FastlaneCore::Project).to receive(:raw_info).and_return(fake_result)\nend",
"def target=(_arg0); end",
"def target=(_arg0); end",
"def initialize options\r\n super\r\n @target = options[:target]\r\n end",
"def initialize_compiler\n self.compile_tasks = [:multi, :test, :check_manifest]\n end",
"def initialize(target, starting_parameters = nil)\n @target = target\n @parameters = starting_parameters || {}\n end",
"def build_apple(rb_file, device)\n check_build_src_file(rb_file)\n\n # Check for Simple 2D framework,\n unless File.exists?('/usr/local/Frameworks/Simple2D/iOS/Simple2D.framework') && File.exists?('/usr/local/Frameworks/Simple2D/tvOS/Simple2D.framework')\n puts \"#{'Error:'.error} Simple 2D iOS and tvOS frameworks not found. Install them and try again.\\n\"\n exit\n end\n\n # Check if MRuby exists; if not, quit\n if `which mruby`.empty?\n puts \"#{'Error:'.error} Can't find MRuby, which is needed to build native Ruby 2D applications.\\n\"\n exit\n end\n\n # Add debugging information to produce backtrace\n if @debug then debug_flag = '-g' end\n\n # Assemble the Ruby 2D library in one `.rb` file and compile to bytecode\n make_lib\n `mrbc #{debug_flag} -Bruby2d_lib -obuild/lib.c build/lib.rb`\n\n # Read the provided Ruby source file, copy to build dir and compile to bytecode\n File.open('build/src.rb', 'w') { |file| file << strip_require(rb_file) }\n `mrbc #{debug_flag} -Bruby2d_app -obuild/src.c build/src.rb`\n\n # Copy over iOS project\n FileUtils.cp_r \"#{@gem_dir}/assets/#{device}\", \"build\"\n\n # Combine contents of C source files and bytecode into one file\n File.open(\"build/#{device}/main.c\", 'w') do |f|\n f << \"#define RUBY2D_IOS_TVOS 1\" << \"\\n\\n\"\n f << \"#define MRUBY 1\" << \"\\n\\n\"\n f << File.read(\"build/lib.c\") << \"\\n\\n\"\n f << File.read(\"build/src.c\") << \"\\n\\n\"\n f << File.read(\"#{@gem_dir}/ext/ruby2d/ruby2d.c\")\n end\n\n # Build the Xcode project\n `simple2d build --#{device} build/#{device}/MyApp.xcodeproj`\n\n # Clean up\n clean_up unless @debug\n\n # Success!\n puts \"App created at `build/#{device}`\"\nend",
"def initialize(target, **options)\n @target = target\n @auto_resize = options.fetch(:auto_resize, true)\n end",
"def initialize(compiler, for_source)\n raise \"no compiler\" unless compiler\n raise \"no source\" unless for_source\n @compiler = compiler\n @source = for_source\n @source_used = false\n @names = {}\n end",
"def _target\n @_target ||= @_initializer.call\n end",
"def target_init\n @scope = Scope.new('GLOBAL')\n @references = References.new\n end",
"def initialize(sandbox, pod_targets, aggregate_targets)\n @sandbox = sandbox\n @pod_targets = pod_targets\n @aggregate_targets = aggregate_targets\n end",
"def build_using_xcode\n validations\n\n framework_args = @framework_paths\n .map { |path| \"-framework #{path}\" }\n .join(\" \")\n\n FileUtils.mkdir_p(@parent_directory)\n output_path = File.join(@parent_directory, \"#{@framework_name}.xcframework\")\n output_args = \"-output #{output_path}\"\n\n logfile = Tempfile.new(['xcframework', '.log'])\n\n cmd = \"xcodebuild -create-xcframework #{framework_args} #{output_args}\"\n\n system(\"#{cmd} >#{logfile.path} 2>&1\") ||\n raise(BuildUsingXcodeFailure.new(File.read(logfile).strip))\n ensure\n if logfile\n logfile.close\n logfile.delete\n end\n end",
"def setup_target\n link_target_task project.target, (project.sources + [project.main]).map {|fn| objectsify fn }\n end",
"def initialize(target,value)\n @target = target\n @value = value\n end",
"def initialize(*args)\n super(*args)\n @target = Exercises.new\n end",
"def initialize(target, tree_root = nil)\n super(target)\n @tree_root = tree_root\n end",
"def j2objc_j2objc\n pod 'j2objc-j2objc-debug', :configuration => ['Debug'], :path => './j2objcOutputs'\nend",
"def initialize(*args)\n super\n\n self.targets.each do |tgt|\n tgt_f = application.define_task(Rake::FileTask, File.join(self.to_s, tgt))\n tgt_f.comment = \"Build #{tgt} in #{self}\"\n tgt_f.enhance([self])\n end\n end",
"def initialize(target_filename: base_filename,\n backup_sources: default_sources)\n @target_filename = target_filename\n @backup_sources = backup_sources\n end",
"def target_version=(_arg0); end",
"def j2objc_iosjava\n pod 'j2objc-iosjava-debug', :configuration => ['Debug'], :path => '../iosjava/build/j2objcOutputs'\n pod 'j2objc-iosjava-release', :configuration => ['Release'], :path => '../iosjava/build/j2objcOutputs'\nend",
"def initialize(source, options); end",
"def initialize(info={})\n super(update_info(info,\n 'Platform' => %w{ java linux osx solaris win },\n 'Payload' => { 'BadChars' => '', 'DisableNops' => true },\n 'Targets' =>\n [\n [\n 'Universal (Javascript XPCOM Shell)', {\n 'Platform' => 'firefox',\n 'Arch' => ARCH_FIREFOX\n }\n ],\n [\n 'Native Payload', {\n 'Platform' => %w{ java linux osx solaris win },\n 'Arch' => ARCH_ALL\n }\n ]\n ],\n 'DefaultTarget' => 0\n ))\n\n register_options([\n OptString.new('ADDONNAME', [ true, \"The addon name.\", \"HTML5 Rendering Enhancements\" ]),\n OptBool.new('AutoUninstall', [ true,\n \"Automatically uninstall the addon after payload execution\",\n true\n ])\n ], self.class)\n end",
"def initialize(machine, options = T.unsafe(nil)); end",
"def set_reference_target(target, override_buildable_name = false, root_project = nil)\n # note, the order of assignment here is important, it determines the order of serialization in the xml\n # this matches the order that Xcode generates\n @xml_element.attributes['BlueprintIdentifier'] = target.uuid\n self.buildable_name = construct_buildable_name(target) if override_buildable_name\n @xml_element.attributes['BlueprintName'] = target.name\n @xml_element.attributes['ReferencedContainer'] = construct_referenced_container_uri(target, root_project)\n end",
"def add_system_framework(framework)\n puts \"Adding framework to xcode project: #{framework}.\"\n @target.add_system_framework(framework);\n puts 'Finished adding framework.'\nend",
"def initialize(source); end",
"def target; end",
"def target; end",
"def target_isa(isa_module) \n @isa = isa_module\n target.const_set :Isa, @isa\n @abi = @isa.const_get :Abi\n target.const_set :Abi, @abi\n \n define_proxy_class\n define_builder_class\n augment_target\n end",
"def initialize (target_name, source_paths, logger=Logger.new($stdout))\n @target_name = File.expand_path target_name\n @source_paths = source_paths.map! {|p| File.expand_path p}\n @completed = false\n @logger = logger\n @count = 0\n end",
"def build(scheme, sdk, destination, action)\n puts <<-ANNOUNCE\n =============================\n | Action: #{action} \n | Scheme: \"#{scheme}\"\n | #{destination}\n =============================\n\n ANNOUNCE\n\n cmd = %W(\n xcodebuild\n -project OHHTTPStubs/OHHTTPStubs.xcodeproj\n -scheme \"#{scheme}\"\n -sdk #{sdk}\n -configuration Release\n ONLY_ACTIVE_ARCH=NO\n -destination '#{destination}'\n #{action}\n )\n\n sh \"set -o pipefail && #{cmd.join(' ')} | xcpretty -c\"\nend",
"def initialize\n @hook = ISAHooker.new\n @parser = ISADefParser.new\n\n @parser.set_isa_hook() do |action, args|\n if @hook.methods.include? action\n @hook.method(action).call(args)\n end\n end\n end",
"def initialize(path, target=nil)\n self.path = path\n self.target = target\n end",
"def j2objc_javalib\n pod 'j2objc-javalib-debug', :configuration => ['Debug'], :path => '../javalib/build/j2objcOutputs'\n pod 'j2objc-javalib-release', :configuration => ['Release'], :path => '../javalib/build/j2objcOutputs'\nend",
"def target(*args)\n if args.blank?\n const_defined?(:Target) ? const_get(:Target) : (@target || name[0..-5].classify.constantize)\n else\n self.target = args.first\n end\n end",
"def for_target(target)\n @target_name = target[:target_name].to_s\n return self\n end",
"def build_for_iosish_platform(sandbox, \n build_dir, \n output_path,\n target, \n device, \n simulator,\n bitcode_enabled)\n\n deployment_target = target.platform.deployment_target.to_s\n \n target_label = target.label\n Pod::UI.puts \"Prebuilding #{target_label}...\"\n \n other_options = [] \n if bitcode_enabled\n other_options += ['OTHER_CFLAGS=\"-fembed-bitcode\"']\n end\n xcodebuild(sandbox, target_label, device, deployment_target, other_options)\n xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'])\n\n root_name = target.pod_name\n module_name = target.product_module_name\n \n executable_path = \"#{build_dir}/#{root_name}\"\n device_lib = \"#{build_dir}/#{CONFIGURATION}-#{device}/#{root_name}/#{module_name}.framework/#{module_name}\"\n device_framework_lib = File.dirname(device_lib)\n simulator_lib = \"#{build_dir}/#{CONFIGURATION}-#{simulator}/#{root_name}/#{module_name}.framework/#{module_name}\"\n\n return unless File.file?(device_lib) && File.file?(simulator_lib)\n\n lipo_log = `lipo -create -output #{executable_path} #{device_lib} #{simulator_lib}`\n puts lipo_log unless File.exist?(executable_path)\n\n FileUtils.mv executable_path, device_lib, :force => true\n output_path.mkpath unless output_path.exist?\n FileUtils.mv device_framework_lib, output_path, :force => true\n FileUtils.rm simulator_lib if File.file?(simulator_lib)\n FileUtils.rm device_lib if File.file?(device_lib)\nend",
"def target_missing(target)\n raise RuntimeError, \"No target named '%s' exists in this build file.\" % target\n end",
"def devtools_identifier=(_arg0); end",
"def test_accepts_filename_in_constructor\n t = Crd::Target.new GOOD\n assert_equal( GOOD, t.filename )\n end",
"def initialize(source, namespace = T.unsafe(nil)); end",
"def initialize(app, config = T.unsafe(nil)); end",
"def define_builder_class\n if @target.const_defined? :Builder\n @builder_class = @taget.const_get :Builder\n else\n @builder_class = Class.new\n @target.const_set :Builder, @builder_class\n end\n @builder_class.send :include, Assembler::CodeBuilderBase\n end",
"def target\n @target ||= Target.find(options[:target]).new(options[:directory])\n end",
"def initialize(options = {})\n if options[:target]\n ::Kernel.raise ::ArgumentError, \"':target' option is not supported.\"\n end\n\n @indent = options[:indent].to_i\n @margin = options[:margin].to_i\n @root = options[:root] || XML::Document.new\n @encoding = options[:encoding] || \"UTF-8\"\n end",
"def assignedTarget _args\n \"assignedTarget _args;\" \n end",
"def init(name, platforms, type)\n\n # Create environment\n git_init(name)\n config(name, platforms)\n create_file_structure(name)\n\n # Create xcodeproj\n project = new_project(name)\n configure_PBXGroups(project, name)\n\n create_info_plists(name, type, platforms)\n add_info_plist_refs(project, name)\n configure_targets(project, name, type, platforms)\n configure_header(project, name, platforms)\n configure_schemes(project, name, platforms)\n configure_build_configuration_settings(project, name, platforms)\n\n # Save xcodeproj\n project.save\nend",
"def initialize(app, scope, value, target)\n @app = app\n @scope = scope\n @value = value\n @target = target\n end",
"def initialize(machine, name, options = T.unsafe(nil)); end",
"def build_ios_tvos(rb_file, device)\n check_build_src_file(rb_file)\n\n # Check if MRuby exists; if not, quit\n if `which mruby`.empty?\n puts \"#{'Error:'.error} Can't find MRuby, which is needed to build native Ruby 2D applications.\\n\"\n exit\n end\n\n # Add debugging information to produce backtrace\n if @debug then debug_flag = '-g' end\n\n # Assemble the Ruby 2D library in one `.rb` file and compile to bytecode\n make_lib\n `mrbc #{debug_flag} -Bruby2d_lib -obuild/lib.c build/lib.rb`\n\n # Read the provided Ruby source file, copy to build dir and compile to bytecode\n File.open('build/src.rb', 'w') { |file| file << strip_require(rb_file) }\n `mrbc #{debug_flag} -Bruby2d_app -obuild/src.c build/src.rb`\n\n # Copy over iOS project\n FileUtils.cp_r \"#{@gem_dir}/assets/#{device}\", \"build\"\n\n # Combine contents of C source files and bytecode into one file\n File.open(\"build/#{device}/main.c\", 'w') do |f|\n f << \"#define RUBY2D_IOS_TVOS 1\" << \"\\n\\n\"\n f << \"#define MRUBY 1\" << \"\\n\\n\"\n f << File.read(\"build/lib.c\") << \"\\n\\n\"\n f << File.read(\"build/src.c\") << \"\\n\\n\"\n f << File.read(\"#{@gem_dir}/ext/ruby2d/ruby2d.c\")\n end\n\n # TODO: Need add this functionality to the gem\n # Build the Xcode project\n `simple2d build --#{device} build/#{device}/MyApp.xcodeproj`\n\n # Clean up\n clean_up unless @debug\n\n # Success!\n puts \"App created: `build/#{device}`\"\nend",
"def target(object = nil)\n if object.nil?\n env.target\n else\n env.target = object\n end\n end",
"def target\n @target ||= if target_name != nil\n target = native_targets.find { |t| t.name == target_name }\n if target.nil?\n raise ArgumentError.new \"Unknown target '#{target_name}'. \"\n end\n target\n else\n if application_targets.count == 1\n application_targets.first\n else\n raise ArgumentError.new 'Multiple application target in project. ' \\\n 'Please select one by specifying the option `--target TARGET`.'\n end\n end\n end",
"def initialize(target)\n @state = 0\n @case_sensitive = false\n construct(target)\n end",
"def initialize(default_target, arguments)\n option_parser = OptionParser.new\n option_parser.on('--no-ivy') { @no_ivy = true }\n option_parser.on('--no-compile') { @no_compile = true }\n option_parser.on('--no-demo') { @no_demo = true }\n option_parser.on('--no-schema') { @no_schema = true }\n option_parser.on('--no-jre') { @no_jre = true }\n option_parser.on('--no-no') do \n @no_ivy = true\n @no_demo = true\n @no_schema = true\n end\n option_parser.on('--emma') do Registry[:emma] = true end\n \n @start_time = Time.now\n @basedir = FilePath.new(File.dirname(File.expand_path(__FILE__)), \"..\").canonicalize\n Registry[:basedir] = @basedir\n puts(\"Building with base directory: '#@basedir'.\")\n puts\n @default_target = default_target\n @ant = TerracottaAnt.new\n Registry[:ant] = @ant\n @platform = CrossPlatform.create_implementation(:ant => @ant)\n Registry[:platform] = @platform\n \n # The CommandLineConfigSource actually parses its arguments, and returns only the ones\n # that aren't configuration property settings (e.g., of the form 'a=b').\n arguments = option_parser.parse(arguments)\n @arguments, command_line_source = CommandLineConfigSource.from_args(arguments)\n @internal_config_source = InternalConfigSource.new\n Registry[:internal_config_source] = @internal_config_source\n @config_source = create_config_source(command_line_source, @internal_config_source)\n Registry[:config_source] = @config_source\n Registry[:command_line_config] = command_line_source\n\n @script_results = ScriptResults.new\n\n if Registry[:emma]\n Registry[:emma_home] = FilePath.new(@basedir.to_s, \"..\", \"..\", \"buildsystems\", \"emma-2.0.5312\").canonicalize.to_s\n fail(\"EMMA_HOME does not exist: #{Registry[:emma_home]}\") unless File.exists?(Registry[:emma_home])\n Registry[:emma_lib] = \"#{Registry[:emma_home]}/lib/emma.jar\"\n puts \"EMMA_HOME: #{Registry[:emma_home]}\"\n end\n\n # XXX: this is a hack to get around jruby script converting JAVA_HOME to unix path\n begin\n if `uname` =~ /CYGWIN/i\n ENV['JAVA_HOME'] = `cygpath -w #{ENV['JAVA_HOME']}`.strip\n end\n rescue\n # do nothing\n end\n\n reset\n end",
"def to_make\n Target.new(@output, @objects, [command, \"ranlib #{output}\"])\n end",
"def build_framework?; ARGV.include? '--framework'; end",
"def init\n @flavor = 'mac_os_x'\n @release = `sw_vers -productVersion`\n end",
"def flutter_ios_podfile_setup; end",
"def test(options = {:sdk => 'iphonesimulator'}) #, :parser => :OCUnit })\n cmd = xcodebuild\n cmd << \"-sdk #{options[:sdk]}\" unless options[:sdk].nil?\n cmd.env[\"TEST_AFTER_BUILD\"]=\"YES\"\n\n report = Xcode::Test::Report.new\n if block_given?\n yield(report)\n else\n report.add_formatter :stdout, { :color_output => true }\n report.add_formatter :junit, 'test-reports'\n end\n\n parser = Xcode::Test::Parsers::OCUnitParser.new report\n\n begin\n cmd.execute(false) do |line|\n parser << line\n end\n rescue Xcode::Shell::ExecutionError => e\n puts \"Test platform exited: #{e.message}\"\n ensure\n parser.flush\n end\n\n report\n end",
"def initialize(targets = [])\n @targets = targets.dup\n end",
"def doctor_project(project,target, identity, profileUuid)\n log( \"Modifiying Project FIle to sign with #{identity} identity ...\")\n\n project = ZergXcode.load(project)\n configuration = 'Release'\n build_configurations = project[\"buildConfigurationList\"][\"buildConfigurations\"]\n configuration_object = build_configurations.select { |item| item['name'] == configuration }[0]\n configuration_object[\"buildSettings\"][\"PROVISIONING_PROFILE\"] = profileUuid\n configuration_object[\"buildSettings\"][\"PROVISIONING_PROFILE[sdk=iphoneos*]\"] = profileUuid\n configuration_object[\"buildSettings\"][\"CODE_SIGN_IDENTITY\"] = identity\n configuration_object[\"buildSettings\"][\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\"] = identity\n\n target = project[\"targets\"].select {|item| item['name'] == target }[0]\n build_configurations = target[\"buildConfigurationList\"][\"buildConfigurations\"]\n configuration_object = build_configurations.select {|item|item['name'] == configuration }[0]\n configuration_object[\"buildSettings\"][\"PROVISIONING_PROFILE[sdk=iphoneos*]\"] = profileUuid\n configuration_object[\"buildSettings\"][\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\"] = identity\n\n project.save!\nend",
"def initialize(options = {})\n (options.keys - DEFAULTS.keys - LEGACY_OPTIONS)[0..1].each do |missing|\n raise ArgumentError, \"Invalid option: #{missing}\"\n end\n @options = options\n\n source = @options[:harmony] ? source_with(HarmonySourcePath) : source_with(SourcePath)\n @context = ExecJS.compile(source)\n end",
"def initialize(playground, name, id = nil)\n @playground = playground\n @name = name.to_s\n @id = (id || name.to_s.downcase.gsub(/\\W+/, '_')).to_sym\n @hooks = []\n end",
"def initialize(target)\n @target = target\n @headers = [\n Header.new(target.umbrella_header_path.basename, true),\n ]\n end",
"def initialize(argv)\n @mypodfile_path = Pathname.pwd + 'Mypodfile'\n super\n end",
"def target(name)\n Target.load_from(self.targets_path.join(name,'target.rake')).tap do |target|\n target.application = self\n end\n end",
"def j2objc_lib\n pod 'j2objc-lib-debug', :configuration => ['Debug'], :path => '../lib/build/doppel'\n pod 'j2objc-lib-release', :configuration => ['Release'], :path => '../lib/build/doppel'\nend",
"def initialize(file_path = nil)\n if file_path\n @file_path = file_path\n @doc = File.open(file_path, 'r') do |f|\n REXML::Document.new(f)\n end\n @doc.context[:attribute_quote] = :quote\n\n @scheme = @doc.elements['Scheme']\n else\n @doc = REXML::Document.new\n @doc.context[:attribute_quote] = :quote\n @doc << REXML::XMLDecl.new(REXML::XMLDecl::DEFAULT_VERSION, 'UTF-8')\n\n @scheme = @doc.add_element 'Scheme'\n @scheme.attributes['LastUpgradeVersion'] = Constants::LAST_UPGRADE_CHECK\n @scheme.attributes['version'] = Xcodeproj::Constants::XCSCHEME_FORMAT_VERSION\n\n self.build_action = BuildAction.new\n self.test_action = TestAction.new\n self.launch_action = LaunchAction.new\n self.profile_action = ProfileAction.new\n self.analyze_action = AnalyzeAction.new\n self.archive_action = ArchiveAction.new\n end\n end",
"def initialize(logger, options = T.unsafe(nil)); end",
"def flutter_additional_macos_build_settings(target)\n return unless target.platform_name == :osx\n\n # [target.deployment_target] is a [String] formatted as \"10.8\".\n deployment_target_major, deployment_target_minor = target.deployment_target.match(/(\\d+).?(\\d*)/).captures\n\n # ARC code targeting macOS 10.10 does not build on Xcode 14.3.\n force_to_arc_supported_min = !target.deployment_target.blank? &&\n (deployment_target_major.to_i < 10) ||\n (deployment_target_major.to_i == 10 && deployment_target_minor.to_i < 11)\n\n # Suppress warning when pod supports a version lower than the minimum supported by the latest stable version of Xcode (currently 10.14).\n # This warning is harmless but confusing--it's not a bad thing for dependencies to support a lower version.\n inherit_deployment_target = !target.deployment_target.blank? &&\n (deployment_target_major.to_i < 10) ||\n (deployment_target_major.to_i == 10 && deployment_target_minor.to_i < 14)\n\n # This podhelper script is at $FLUTTER_ROOT/packages/flutter_tools/bin.\n # Add search paths from $FLUTTER_ROOT/bin/cache/artifacts/engine.\n artifacts_dir = File.join('..', '..', '..', '..', 'bin', 'cache', 'artifacts', 'engine')\n debug_framework_dir = File.expand_path(File.join(artifacts_dir, 'darwin-x64'), __FILE__)\n release_framework_dir = File.expand_path(File.join(artifacts_dir, 'darwin-x64-release'), __FILE__)\n\n unless Dir.exist?(debug_framework_dir)\n # macOS artifacts have not been downloaded.\n raise \"#{debug_framework_dir} must exist. If you're running pod install manually, make sure \\\"flutter precache --macos\\\" is executed first\"\n end\n\n target.build_configurations.each do |build_configuration|\n # ARC code targeting macOS 10.10 does not build on Xcode 14.3. Force to at least macOS 10.11.\n build_configuration.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.11' if force_to_arc_supported_min\n\n # Skip other updates if it's not a Flutter plugin (transitive dependency).\n next unless target.dependencies.any? { |dependency| dependency.name == 'FlutterMacOS' }\n\n # Profile can't be derived from the CocoaPods build configuration. Use release framework (for linking only).\n configuration_engine_dir = build_configuration.type == :debug ? debug_framework_dir : release_framework_dir\n build_configuration.build_settings['FRAMEWORK_SEARCH_PATHS'] = \"\\\"#{configuration_engine_dir}\\\" $(inherited)\"\n\n # When deleted, the deployment version will inherit from the higher version derived from the 'Runner' target.\n # If the pod only supports a higher version, do not delete to correctly produce an error.\n build_configuration.build_settings.delete 'MACOSX_DEPLOYMENT_TARGET' if inherit_deployment_target\n\n # Avoid error about Pods-Runner not supporting provisioning profiles.\n # Framework signing is handled at the app layer, not per framework, so disallow individual signing.\n build_configuration.build_settings.delete 'EXPANDED_CODE_SIGN_IDENTITY'\n build_configuration.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'\n build_configuration.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'\n end\nend",
"def create_embed_frameworks_phase(project, t)\n \n t.build_phases.delete_if { |phase| \n phase.to_s == 'Embed Frameworks'\n }\n\n embed_frameworks_build_phase = project.new(\n Xcodeproj::Project::Object::PBXCopyFilesBuildPhase\n )\n\n embed_frameworks_build_phase.name = 'Embed Frameworks'\n embed_frameworks_build_phase.symbol_dst_subfolder_spec = :frameworks\n t.build_phases << embed_frameworks_build_phase\n return embed_frameworks_build_phase\nend",
"def setup_target\n log \"Setting up #{@target}\"\n\n if File.exists? @target\n raise ArgumentError, %{Target directory \"#{@target}\" already exists}\n end\n\n FileUtils.mkdir @target\n\n run \"git init .\"\n\n # TODO: Create runner file\n end",
"def getConfigAttributes(framework_target)\n default_configuration = framework_target.build_configuration_list[framework_target.build_configuration_list.default_configuration_name]\n base_configuration_reference = default_configuration.base_configuration_reference\n if !base_configuration_reference&.real_path.to_s.empty? && File.file?(base_configuration_reference.real_path)\n config = Xcodeproj::Config.new(base_configuration_reference.real_path)\n config.attributes\n else\n return nil\n end\nend",
"def initialize( *args ) # :notnew:\n throw :invalid_test unless self.class.appletclass\n super\n end"
] | [
"0.69580126",
"0.6594453",
"0.6533583",
"0.62215656",
"0.6086976",
"0.59508395",
"0.59352964",
"0.5930769",
"0.5930769",
"0.5893715",
"0.5836138",
"0.5746859",
"0.57455",
"0.57270455",
"0.57203597",
"0.5716434",
"0.5716434",
"0.5625041",
"0.55393636",
"0.54645896",
"0.54577476",
"0.54253715",
"0.5424035",
"0.5353952",
"0.5340047",
"0.5301011",
"0.5301011",
"0.5286876",
"0.5257532",
"0.52267325",
"0.52235997",
"0.51865536",
"0.5169535",
"0.51633793",
"0.5140038",
"0.5138692",
"0.5122054",
"0.5117537",
"0.51011395",
"0.508715",
"0.5076881",
"0.50732195",
"0.50654316",
"0.5043259",
"0.50282216",
"0.49988836",
"0.4993007",
"0.49865323",
"0.4949525",
"0.4941457",
"0.49345708",
"0.49337983",
"0.49334985",
"0.49334985",
"0.49299374",
"0.49122572",
"0.49039418",
"0.4897366",
"0.48846725",
"0.48813802",
"0.4876195",
"0.48706883",
"0.48701927",
"0.4868684",
"0.486861",
"0.4865092",
"0.4864401",
"0.48568016",
"0.48517329",
"0.48501393",
"0.48496595",
"0.48485214",
"0.48416418",
"0.48405826",
"0.4822865",
"0.4819918",
"0.48050365",
"0.48047656",
"0.48044053",
"0.47962093",
"0.4795464",
"0.47920385",
"0.47906098",
"0.47742572",
"0.4761326",
"0.4754314",
"0.47521055",
"0.47513732",
"0.47504595",
"0.47465825",
"0.4745937",
"0.47437203",
"0.47416097",
"0.4733031",
"0.47275245",
"0.47241727",
"0.47210664",
"0.47190934",
"0.47179338",
"0.47151658"
] | 0.5960514 | 5 |
Returns an Array of dependencies on the target | def dependency_list
@target.dependencies.map(&:display_name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dependencies\n @target_dependencies + (@parent ? @parent.dependencies : [])\n end",
"def dependencies\n @dependencies.collect { |name, dependency| dependency }\n end",
"def dependencies\n []\n end",
"def dependencies\n @dependencies.values\n end",
"def dependencies\n []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies(source, done=[])\n d_path = source.ext(\"d\") # get the dependency file\n Rake::Task[d_path].invoke # ensure the dependency file exists\n d_file = IO.read(d_path) # read the dependencies from dependency file\n d_file = d_file.split(': ')[1].gsub(\"\\n\",'').gsub('\\\\ ','').gsub(/\\s+/,' ').split(' ') # get a list of dependencies\n d_list = [] # list of dependencies\n # only save dependencies which are in our source directories\n d_file.each do |d|\n SRC_DIRS.each do |dir|\n if File.dirname(d)==dir then\n d_list << d\n end\n end\n end\n # get the dependencies of these dependencies, if we don't know them already\n done << source.ext(\"o\")\n done.uniq!\n d_list.each do |d|\n d = d.ext(\"o\")\n next if done.include? d\n done += dependencies(d, done)\n end\n done.uniq!\n return done\nend",
"def dependencies(include_parent = false)\n []\n end",
"def dependencies(include_parent = false)\n []\n end",
"def dependencies(include_parent = false)\n []\n end",
"def dependencies_for(specification)\n []\n end",
"def dependencies\n @dependencies\n end",
"def get_dependencies\n @dependencies\n end",
"def all_dependencies(targets)\n targets.to_h do |target|\n deps = target[:dependencies] || []\n deps = deps.delete_if { |dep| dep.include? '/' } # Remove subspecs\n [target[:name], deps]\n end\n end",
"def depends_on()\n if @value.nil?\n return []\n end\n unless @depends_on\n @depends_on = @value.variables.collect do |var|\n\ttmp = @parent.variable_by_name(var)\n\ttmp or raise \"Can't locate variable dependency '#{var}'!\"\n end\n end\n @depends_on\n end",
"def dependent_specs\n runtime_dependencies.map {|dep| dep.to_specs }.flatten\n end",
"def dependencies\n version_req = if options[:version]\n ::Gem::Requirement.create(options[:version])\n else\n ::Gem::Requirement.default\n end\n if gem_dir\n ::Gem.clear_paths; ::Gem.path.unshift(gem_dir)\n ::Gem.source_index.refresh!\n end\n deps = []\n ::Gem.source_index.each do |fullname, gemspec| \n if version_req.satisfied_by?(gemspec.version)\n deps << ::Gem::Dependency.new(gemspec.name, \"= #{gemspec.version}\")\n end\n end\n ::Gem.clear_paths if gem_dir\n deps.sort\n end",
"def dependent_modules\n out = [ ]\n @dependencies.each { |dependency| out << @module_set[dependency] }\n out\n end",
"def runtime_dependencies\n dependencies.select(&:runtime?)\n end",
"def dependency_paths\n @dependency_paths ||= []\n end",
"def dependencies\n manager.dependencies\n end",
"def dependencies\n self.config.depends || []\n end",
"def dependencies\n @dependencies ||= Set.new\n end",
"def dependencies\n @dependencies ||= {}\n end",
"def dependencies\n node.output[carrier].keys\n end",
"def dependencies\n EMPTY_SET\n end",
"def depends_upon(match_name) #, constraint)\n list = []\n $LEDGER.each do |name, libs|\n case libs\n when Library\n list << libs if libs.requirements.any?{ |r| match_name == r['name'] } \n else\n libs.each do |lib|\n list << lib if lib.requirements.any?{ |r| match_name == r['name'] } \n end\n end\n end\n list\n end",
"def getDependencies service\r\n deps = []\r\n Util.csprojs(service).each do |csproj|\r\n deps += getDeps(csproj) \r\n end\r\n return deps.uniq\r\nend",
"def dependencies\n return @dependencies unless @dependencies.nil?\n @dependencies = [ ]\n lockfile.each_line do |line|\n if line =~ /^\\s{4}([-\\w_.0-9]+)\\s*\\((.*)\\)/\n @dependencies << [$1, $2]\n end\n end\n @dependencies\n end",
"def dependencies( *args )\n names = args # note: for now assume all args are just names\n # e.g. 'pluto-models', 'pluto-update', etc.\n deps = @versions.select do |rec| names.include?( rec[0] ) end\n .map do |rec| [rec[0], rec[1]] end\n\n ## todo/fix: throw exception if dependency is missing!\n ## names.size == deps.size\n puts \"names.size == deps.size #{names.size} == #{deps.size}\"\n deps\n end",
"def dependencies_for(specification)\n specification.dependencies\n end",
"def makedepends\n res = []\n\n if @sources.nil?\n log.error self.to_s\n raise 'Missing sources'\n end\n\n # Generate the targets and rules for each translation unit\n expand_sources(@sources).each do |src|\n next if src =~ /\\.o$/\n cc = @project.cc\n cc.flags = [ @cflags, '-E' ]\n cc.output = '-'\n cc.sources = src\n #TODO: topdir\n cmd = cc.command + Platform.dev_null_stderr\n end\n res\n end",
"def dependencies\n members.each_with_object([]) do |attr_name, depends|\n value = send(attr_name)\n value = pipeline.objects.fetch(value) if value.is_a?(Symbol)\n depends << value.dependencies << value if value.is_a?(PipelineObject)\n end.flatten\n end",
"def dependencies\n self.class.dependencies\n end",
"def arduino_library_dependencies\n return [] unless library_properties?\n return [] if library_properties.depends.nil?\n\n library_properties.depends\n end",
"def dependencies_for(source, acc = [])\n ds = dependencies.select { |d| d.last == source }.\n map { |d| d.first }\n return acc if ds.empty?\n acc = acc | ds\n ds.each { |d| acc = acc | dependencies_for(d, acc) }\n acc\n end",
"def dependencies\n to_a.reject { |a| a.filename.eql?(self.filename) }\n end",
"def depend_upon(match_name) #, constraint)\n list = []\n each do |name, libs|\n case libs\n when Library\n list << libs if libs.requirements.any?{ |r| match_name == r['name'] } \n else\n libs.each do |lib|\n list << lib if lib.requirements.any?{ |r| match_name == r['name'] } \n end\n end\n end\n list\n end",
"def get_dependencies(_fidl, _interaction_types, _project_dependencies)\n # noop\n end",
"def dependencies\n spec.dependencies\n end",
"def dependencies\n spec.dependencies\n end",
"def getDeps csproj\r\n deps = []\r\n csproj.search(\"reference\") do |ref|\r\n deps << ref.get_attribute(\"include\").match(/^([^,]+),*/)[1]\r\n end\r\n return deps\r\nend",
"def dependencies\n if @options[:dependencies]\n deps = [] << @options[:dependencies]\n deps.flatten.collect { |item|\n item = File.join(item,'**/*') if File.directory?(item)\n Dir.glob item\n }.flatten.uniq.collect { |item|\n File.directory?(item) ? nil : item\n }.compact\n else\n false\n end\n end",
"def dependency_links\n if @dependencies.nil?\n # Build the mapping: feature identifier => feature\n features_by_id = id2features\n\n # Resolve the dependency tags\n resolve_dependencies(features_by_id)\n end\n\n return @dependencies\n end",
"def lookup_dependencies(source_or_source_key)\n source = lookup(source_or_source_key)\n result = []\n looked_up = []\n if source\n dependencies = lookup_direct_dependencies(source)\n while !((dependencies - looked_up).empty?)\n dependencies.each { |d| result << d; looked_up << d }\n dependencies = dependencies.map {|d| lookup_direct_dependencies(d).to_a }.flatten.uniq\n end\n end\n result\n end",
"def targets\n @targets ||= []\n end",
"def deps(sequence)\n return [] unless checker.valid? # Exit early if it's bad data\n all = [] # Start collecting the list.\n CeleryScript::TreeClimber.travel(tree, ->(n) {\n # Iterate over each node, looking for \"args of interest\".\n # Tools, sub sequences, etc.\n ARGS_OF_INTEREST.map do |arg, klass|\n id = n&.args&.fetch(arg, nil)&.value\n all.push(klass.find(id)) if id\n end\n })\n\n # Filter out the target sequence to prevent runaway recursion.\n # It would be impossible to delete recursive sequences otherwise.\n all.select! { |d| !(d.is_a?(Sequence) && (d.id == sequence.id)) }\n\n # Finally, output the data in a format that can directly be used by\n # SequenceDependency#create!().\n return all.uniq.map do |d|\n { sequence: sequence, dependency_type: d.class, dependency_id: d.id }\n end\n end",
"def lookup_direct_dependencies!(source)\n return [] unless source\n\n source.dependencies.map do |dependency|\n result = provides_tree.glob(\"/#{dependency}\")\n if (!result || (result.is_a?(Array) && result.empty?))\n Jsus.logger.warn \"#{source.filename} is missing #{dependency.is_a?(SourceFile) ? dependency.filename : dependency.to_s}\"\n end\n result\n end.flatten.map {|tag| lookup(tag) }\n end",
"def find_dependencies\n\t\tunless GEMDEPS_FILE.readable?\n\t\t\tself.prompt.warn \"Deps file (%s) is missing or unreadable, assuming no dependencies.\" %\n\t\t\t\t[ GEMDEPS_FILE ]\n\t\t\treturn []\n\t\tend\n\n\t\tfinder = Rake::DevEiate::GemDepFinder.new( GEMDEPS_FILE )\n\t\tfinder.load\n\t\treturn finder.dependencies\n\tend",
"def dependencies(include_parent = false)\n include_parent ? [ parent ] : []\n end",
"def targets()\n if @target then\n return [self]\n else\n return []\n end\n end",
"def dependencies(ctx)\n deps = []\n visitor = ConsCellVisitor.df_visitor(self)\n skip_children = false\n loop do\n side, cell = visitor.resume(skip_children)\n if cell.kind_of?(Core::LogVarRef)\n deps << ctx.lookup(cell.name).i_name\n skip_children = true\n else\n skip_children = false\n end\n break if side == :stop\n end\n\n Set.new(deps)\n end",
"def dependencies(name)\n dependencies = []\n submodule = submodule(name)\n if submodule.has_key?(:dependencies)\n submodule[:dependencies].each do |dependency|\n dependencies << dependency\n dependencies << dependencies(dependency)\n end\n end\n\n dependencies.flatten.uniq.sort\n end",
"def gem_requirements_to_array(*deps)\n deps.map do |dep|\n dep.requirement.requirements.map do |op, version|\n \"#{op} #{version}\"\n end.sort\n end\n end",
"def initial_dependencies\n []\n end",
"def required_dependencies\n dependencies - optional_dependencies\n end",
"def dependencies\n dependencies = parameters\n .select { |type, _name| KEYWORD_ARGS.include?(type) }\n .map(&:last)\n\n dependencies - CONTEXT_DEPENDENCIES\n end",
"def makedepends(source_file)\n res = []\n\n if @vendor == 'GNU'\n flags = @flags.join ' '\n cmd = \"#{@path} -I. #{includedirs()} #{flags} -MM #{source_file}\"\n #warn \"Generating dependencies for #{source_file}..\\n + #{cmd}\" \n tmp = `#{cmd}`\n return [] if tmp.nil?\n tmp.sub!(/^.*\\.o: /, '')\n return [] if tmp.nil?\n tmp.gsub!(/\\\\\\n/, ' ')\n res = tmp.split(/\\s+/)\n else\n throw 'Not supported -- need to use a fallback method'\n end\n\n res.push 'Makefile'\n res\n end",
"def dependents(batch_tasks)\n batch_tasks.select do |t|\n t.depend_on &&\n # Dependent tasks should have depends on set to current task\n t.depend_on.to_s == id.to_s\n end\n end",
"def declared_dependencies(ast)\n raise_unless_xpath!(ast)\n deps = ast.xpath(%q{//command[ident/@value='depends']/\n descendant::args_add/descendant::tstring_content[1]})\n # handle quoted word arrays\n var_ref = ast.xpath(%q{//command[ident/@value='depends']/\n descendant::var_ref/ident})\n unless var_ref.empty?\n deps += ast.xpath(%Q{//block_var/params/ident#{var_ref.first['value']}/\n ancestor::method_add_block/call/descendant::tstring_content})\n end\n deps.map{|dep| dep['value']}\n end",
"def add_depend_list\n list = ''\n if @depedencies.nil? or @depedencies.size == 0\n list = ''\n elsif @depedencies.class == String\n list = \"=> [:#{@depedencies}] \"\n elsif @depedencies.class == Array\n list = '=> [ '\n need_comma = false\n for element in @depedencies\n list = list + ', ' if need_comma\n list = list + \":#{element}\"\n @log.info \" - dependent from : #{element}\"\n need_comma = true\n end\n list = list + ' ] '\n else\n @log.fatal { \"Cannot parse dependencies [#{@depedencies}]\" }; exit\n end\n return list\n end",
"def get_user_deps(target)\n @user_deps[target]\n end",
"def getdeps(pkg)\n deps = []\n @pkg.each {|k, v| deps << k if v.include?(pkg) }\n\n return deps\n end",
"def find_dependencies(deps=nil, verbose=false)\n \n deps ||= all_dependencies\n\n search_list = Array(deps)\n found = []\n ret = []\n \n # if we discover a new local package via indirect dependencies then\n # it's dependencies will be fetchable one time.\n fetchable = Set.new\n \n until search_list.empty?\n name, version = search_list.shift\n\n if dup = found.find{|p| p.name == name}\n # already found, check for conflicts\n next if satisfied_by?(version, dup.version)\n raise PackageConflictError.new(name, dup.version, version)\n end\n\n pkg = locate_package(name, version, verbose)\n if pkg.nil? && fetchable.include?(name)\n fetchable.reject! { |x| x == name }\n core_fetch_dependency(name, version, :runtime, true) \n pkg = locate_package name, version, verbose\n end\n \n raise PackageNotFoundError.new(name, version) unless pkg\n\n found << pkg\n\n # Look up dependencies of dependencies\n new_deps = Array(pkg.dependencies) + Array(pkg.dependencies_build)\n if has_local_package? pkg.name\n new_deps += Array(pkg.dependencies_development)\n new_deps.each { |dep| fetchable.add dep.first }\n end\n \n search_list += new_deps\n\n ret << pkg\n end\n\n ret\n end",
"def runtime_dependencies\n @runtime_dependencies ||= []\n end",
"def runtime_dependencies\n @runtime_dependencies ||= []\n end",
"def calcImmediateDependencies(target_file)\n\t\tsrc_file = targetToSource(target_file)\n\t\tdepstr = case @compiler\n\t\t\twhen @@byteCodeCompiler \n\t\t\t\t`ocamldep #{@includesString} #{src_file}` \n\t\t\twhen @@machineCodeCompiler\n\t\t\t\t`ocamldep -native #{@includesString} #{src_file}` \n\t\t\telse \n\t\t\t\tputs \"ERROR couldn't compile to file: \" + target\n\t\tend\n\t\t#debug \"\\n*\\n*\\n\" + depstr\n\n\t\t#make an array of lines, where each line is a complete \n\t\t#\"<target>: <dep1> <dep2>\" sequence\n\t\tdeplines = depstr.gsub(\"\\\\\\n\", \" \").split(\"\\n\")\n\n\t\t#split each of these lines into an array of tokens, \n\t\t#yielding a 2-d token array\n\t\ttokens = deplines.map {|dl| dl.split(\" \")}\n\n\t\t#drop the colon on the first element of each token line, \n\t\t#it is <targetfile>:\n\t\ttokens.each {|ts| ts[0] = ts[0].chop()} \n\n\t\t#find the token line that starts with the target file we want\n\t\tdepfiles = Set.new() \n\t\ttokens.each do |tokenline|\n\t\t\tcand_target = tokenline.shift()\n\t\t\t#debug \"cand: #{cand_target}\"\n\t\t\t#debug \"target: #{target_file}\"\n\t\t\tif(target_file == cand_target)\n\t\t\t\tif(@useByteImpls && (target_file[-3,3] == 'cmo'))\n\t\t\t\t\timplsline = tokenline.map {|cmifn| changeExt(cmifn, 'cmo')}\n\t\t\t\t\timplsline.delete_if {|cmofn| cmofn == target_file}\n\t\t\t\t\tdepfiles.merge implsline\n\t\t\t\tend\n\t\t\t\tdepfiles.merge(tokenline)\n\t\t\tend\n\t\tend\n\t\texpandedSet = depfiles.map {|fn| File.expand_path(fn)}\n\t\t#debug \"ImmediateDeps:\"\n\t\t#debug setString(expandedSet)\n\t\treturn expandedSet\n\tend",
"def dependencies\n @dependencies ||= begin\n YARD::Registry.all(:dependency)\n end\nend",
"def project_deps(deps_tree)\n deps_list = Set.new\n project_deps_onto(deps_list, deps_tree)\n deps_list.to_a\n end",
"def depends(target, *user_deps)\n if target.is_a?(Builder)\n target = target.target\n end\n target = expand(target.to_s)\n user_deps = user_deps.map do |ud|\n if ud.is_a?(Builder)\n ud = ud.target\n end\n expand(ud)\n end\n @user_deps[target] ||= []\n @user_deps[target] = (@user_deps[target] + user_deps).uniq\n build_after(target, user_deps)\n end",
"def test_dependencies\n []\n end",
"def test_dependencies\n []\n end",
"def dependencies; end",
"def dependencies; end",
"def dependencies; end",
"def get_dependencies(lib_path)\n\tdeps = []\n\tentry_name_regex = /(.*)\\(compatibility version.*\\)/\n\t`otool -L '#{lib_path}'`.strip.split(\"\\n\").each do |entry|\n\t\tmatch = entry_name_regex.match(entry)\n\t\tif (match)\n\t\t\tdep_path = match[1].strip\n\n\t\t\t# Note - otool lists dependencies separately for each architecture\n\t\t\t# in a universal binary - only return the unique paths\n\t\t\tdeps << dep_path if !deps.include?(dep_path)\n\t\tend\n\tend\n\treturn deps\nend",
"def dependencies( names )\n names.each do |name|\n if calculation = fetch( name, nil )\n calculation.dependencies.each do |dependency|\n names << dependency unless names.include?( dependency )\n end\n end\n end\n end",
"def child_dependencies\n @children\n end",
"def get_dependencies(lib_path)\n\tdeps = []\n\tentry_name_regex = /(.*)\\(compatibility version.*\\)/\n\t`otool -L '#{lib_path}'`.strip.split(\"\\n\").each do |entry|\n\t\tmatch = entry_name_regex.match(entry)\n\t\tif (match)\n\t\t\tdep_path = match[1].strip\n\n\t\t\t# Note - otool lists dependencies separately for each architecture\n\t\t\t# in a universal binary - only return the unique paths\n\t\t\tdeps << dep_path if !deps.include?(dep_path)\n\t\tend\n\tend\n\treturn deps\nend",
"def calculate_deps\n SequenceDependency\n .where(ALL_SEQ_DEPS, device.id)\n .where(dependency_type: \"Point\")\n .where(dependency_id: points.pluck(:id))\n .map(&:sequence)\n end",
"def js_dependencies_array\n if scripts != :none\n get_vendor_scripts\n get_gem_scripts\n end\n @js_array\n end",
"def dependent_gems(check_dev=true)\n out = []\n Gem::Specification.each do |spec|\n deps = check_dev ? spec.dependencies : spec.runtime_dependencies\n deps.each do |dep|\n if self.satisfies_requirement?(dep)\n sats = []\n find_all_satisfiers(dep) do |sat|\n sats << sat\n end\n out << [spec, dep, sats]\n end\n end\n end\n out\n end",
"def local_deps\n @local_deps ||= build_local_dependency_list\n end",
"def direct_dependencies; end",
"def manifest_dependencies()\n as_bundle = Bundle.fromProject(self)\n as_bundle.nil? ? [] : as_bundle.bundles.collect{|b| b.resolve}.compact + as_bundle.imports.collect {|i| i.resolve}.flatten\n end",
"def cached_dependencies\n @dependencies ||= enumerate_dependencies.compact\n end",
"def DependsOn(value)\n case @DependsOn\n when nil\n @DependsOn = value\n when Array\n @DependsOn << value\n else\n @DependsOn = [@DependsOn, value]\n end\n if @DependsOn.is_a?(Array)\n @DependsOn.flatten!\n @DependsOn.uniq!\n end\n @DependsOn\n end",
"def dependency_order\n result = []\n disabled = {}\n predecessors = build_predecessors\n while disabled.size < @specs.size\n\tcandidate = @specs.find { |spec|\n\t ! disabled[spec.full_name] &&\n\t active_count(predecessors[spec.full_name], disabled) == 0\n\t}\n\tif candidate\n\t disabled[candidate.full_name] = true\n\t result << candidate\n\telsif candidate = @specs.find { |spec| ! disabled[spec.full_name] }\n\t # This case handles circular dependencies. Just choose a\n\t # candidate and move on.\n\t disabled[candidate.full_name] = true\n\t result << candidate\n\telse\n\t # We should never get here, but just in case we will terminate \n\t # the loop.\n\t break\n\tend\n end\n result\n end",
"def dependencies(options = {})\n # backward compatibility\n options = { :scopes => options } if Array === options\n\n # support symbols, but don't fidget with nil\n options[:scopes] = (options[:scopes] || SCOPES_WE_USE).map { |s| s.to_s if s }\n\n # try to cache dependencies also\n @depends_for_scopes ||= {}\n unless depends = @depends_for_scopes[options]\n declared = project['dependencies'].first['dependency'] rescue nil\n depends = (declared || [])\n depends = depends.reject { |dep| value_of(dep['optional']) =~ /true/ } unless options[:optional]\n depends = depends.map { |dep|\n spec = pom_to_hash(dep, properties)\n apply = managed(spec)\n spec = apply.merge(spec) if apply\n\n next if options[:exclusions] && options[:exclusions].any? { |ex| dep['groupId'] == ex['groupId'] && dep['artifactId'] == ex['artifactId'] }\n\n # calculate transitive dependencies\n if options[:scopes].include?(spec[:scope])\n spec.delete(:scope)\n\n exclusions = dep['exclusions'].first['exclusion'] rescue nil\n transitive_deps = POM.load(spec).dependencies(:exclusions => exclusions, :scopes => (options[:scopes_transitive] || SCOPES_TRANSITIVE) ) rescue []\n\n [Artifact.to_spec(spec)] + transitive_deps\n end\n }.flatten.compact #.uniq_by{|spec| art = spec.split(':'); \"#{art[0]}:#{art[1]}\"}\n @depends_for_scopes[options] = depends\n end\n depends\n end",
"def unused_dependencies_list\n imports = all_unique_imports.map { |import| import.split.last }\n dependency_list - imports\n end",
"def load_dependencies\n dependencies.each { |dependency| dependency }\n end",
"def declared_dependencies(ast)\n deps = ast.xpath(\"//command[ident/@value='depends']/descendant::args_add/descendant::tstring_content\")\n # handle quoted word arrays\n var_ref = ast.xpath(\"//command[ident/@value='depends']/descendant::var_ref/ident\")\n deps += ast.xpath(%Q{//block_var/params/ident#{var_ref.first['value']}/ancestor::method_add_block/\n call/descendant::tstring_content}) unless var_ref.empty?\n deps.map{|dep| dep['value']}\n end",
"def declared_dependencies(ast)\n deps = ast.xpath(\"//command[ident/@value='depends']/descendant::args_add/descendant::tstring_content\")\n # handle quoted word arrays\n var_ref = ast.xpath(\"//command[ident/@value='depends']/descendant::var_ref/ident\")\n deps += ast.xpath(%Q{//block_var/params/ident#{var_ref.first['value']}/ancestor::method_add_block/\n call/descendant::tstring_content}) unless var_ref.empty?\n deps.map{|dep| dep['value']}\n end",
"def locked_specs_as_deps\n deps = @dependencies & @locked_deps\n\n @dependencies.each do |dep|\n next if deps.include?(dep)\n deps << dep if @locked_specs.any? { |s| s.satisfies?(dep) }\n end\n\n meta_deps = @locked_specs.for(deps).map do |s|\n dep = Gem::Dependency.new(s.name, s.version)\n @locked_deps.each do |d|\n dep.source = d.source if d.name == dep.name\n end\n dep\n end\n end",
"def dependencies_for(model)\n dependencies = Set.new\n # Each association is a dependency\n model.reflect_on_all_associations.each do |ass|\n relation_name = ass.name.to_s\n class_name = ass.options[:class_name] || relation_name.singularize.camelize\n\n dependencies.add? class_name\n end\n dependencies\n end"
] | [
"0.78034174",
"0.77154183",
"0.7679972",
"0.76735425",
"0.76414096",
"0.7542985",
"0.7542985",
"0.7542985",
"0.7542985",
"0.74957013",
"0.7423224",
"0.7314318",
"0.7239806",
"0.7239806",
"0.7239806",
"0.7198187",
"0.71836644",
"0.7183548",
"0.7125391",
"0.70432097",
"0.703956",
"0.70287883",
"0.7027921",
"0.687791",
"0.68747866",
"0.6862177",
"0.6852439",
"0.68385816",
"0.6809505",
"0.68086874",
"0.6797425",
"0.6795703",
"0.67698675",
"0.67503154",
"0.67414397",
"0.6738963",
"0.67266417",
"0.6684094",
"0.66838574",
"0.66690004",
"0.66646576",
"0.6663892",
"0.6654519",
"0.6626446",
"0.65618783",
"0.65618783",
"0.6559673",
"0.6558636",
"0.65578324",
"0.65503585",
"0.65390813",
"0.6521953",
"0.65200835",
"0.6509452",
"0.6492005",
"0.6479801",
"0.64570606",
"0.64411944",
"0.6436548",
"0.6426387",
"0.6426178",
"0.64224106",
"0.6422244",
"0.6404783",
"0.6394113",
"0.6390685",
"0.638865",
"0.63812655",
"0.6381144",
"0.63806665",
"0.63806665",
"0.6371747",
"0.6368111",
"0.63617617",
"0.63491714",
"0.6343361",
"0.6343361",
"0.6325952",
"0.6325952",
"0.6325952",
"0.63259405",
"0.6325776",
"0.6324645",
"0.63239676",
"0.63038194",
"0.6296362",
"0.62867916",
"0.6271983",
"0.6254577",
"0.6240679",
"0.6226317",
"0.6204251",
"0.62023306",
"0.6200566",
"0.6199891",
"0.61985606",
"0.61939836",
"0.61939836",
"0.6190662",
"0.6184838"
] | 0.80951196 | 0 |
Returns [String] of file names | def file_name_list
@target.source_build_phase.file_display_names
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filenames\n files.map(&:filename)\n end",
"def filenames\n files.map(&:filename)\n end",
"def filenames\n files.map(&:filename)\n end",
"def filenames\n @filenames ||= files.map(&:to_s)\n end",
"def filenames\n file_stats.map(&:filename)\n end",
"def filenames\n @files.collect { |f| f.archive_filename }\n end",
"def filenames; end",
"def file_names\n file_names = []\n @bucket.objects.each do |obj|\n file_names << obj.key\n end\n file_names\n end",
"def files\n array_full_names = Dir.glob(\"#{@path}/*.mp3\")\n array_full_names.collect do |full_name|\n full_name[21..-1]\n end\n end",
"def get_files\n\tnames = Array.new\n\n\tDir.glob(\"*.xls\").each do |f| \n\t\tnames << f\n\tend\n\n\treturn names\nend",
"def files\n result = []\n @my_files.each do |f|\n result << f.fname if FileTest.file?(f.fname)\n end\n result\n end",
"def all_filenames\n\n\n # This checks for it being an array and not nil!\n # return @filenames if @filenames && !@filenames.empty?\n\n # This means we can add files to the output\n return $filenames if $filenames && $filenames.size > 5 # I guess that small numbers are errors too\n \n if @directory\n @output_directory ||= File.join(@directory, 'Build')\n $filenames = Dir.glob(File.join(@directory, \"**/*\")).map {|file|\n next if file.start_with?(@output_directory)\n next if File.directory?(file)\n file.gsub(@directory+\"/\", \"\")\n }.compact\n else\n []\n end\n end",
"def files\n array = []\n @list.each do |k,v|\n array += v.filename\n end\n array\n end",
"def get_file_names path\n Dir.entries(path).select { |file| !File.directory? File.join(path, file) }\n end",
"def all_files() = path.glob('**/*').select(&:file?).map(&:to_s)",
"def files\n Dir.glob(self.path + '**/*.mp3').collect {|file| File.basename(file)}\n end",
"def files\n @files ||= FILE_RANGE.map(&:to_sym)\n end",
"def files\n filenames || []\n end",
"def files\n ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']\n end",
"def files\n filename = Dir.entries(@path).find_all {|file| file.include?(\".mp3\")}\n # binding.pry\n # [[\"Thundercat - For Love I Come - dance.mp3\",\n # \"Real Estate - It's Real - hip-hop.mp3\",\n # \"Action Bronson - Larry Csonka - indie.mp3\",\n # \"Real Estate - Green Aisles - country.mp3\"]]\n\n #binding.pry\n end",
"def files\n @files_array = Dir.entries(self.path).select {|f| !File.directory? f}\n # This returns:\n # [\"Action Bronson - Larry Csonka - indie.mp3\",\n # \"Real Estate - Green Aisles - country.mp3\",\n # \"Real Estate - It's Real - hip-hop.mp3\",\n # \"Thundercat - For Love I Come - dance.mp3\"]\n end",
"def files\n files = Dir[\"#{path}/*.mp3\"].each {|file_name| next if File.directory? file_name}\n norm_files = files.collect {|filename| File.basename(filename)}\n norm_files\n end",
"def file_names\n names = []\n frm.table(:class=>/listHier lines/, :text=>/Title/).rows.each do |row|\n next if row.td(:class=>\"specialLink\").exist? == false\n next if row.td(:class=>\"specialLink\").link(:title=>\"Folder\").exist?\n names << row.td(:class=>\"specialLink\").link(:href=>/access.content/, :index=>1).text\n end\n return names\n end",
"def files\n filename = Dir.glob(\"#{path}/*.mp3\")\n filename = filename.collect{|a_string| a_string.sub(\"#{path}/\", \"\")}\n end",
"def takeFilesNames\nDir['result*.*'].each do |file_name|\n @files_names.push(file_name)\nend\nend",
"def files\n return get_result('files')\n end",
"def task_file_names\n return @task_file_names if @task_file_names\n error \"No #{Noop::Config.dir_path_tasks_local} directory!\" unless Noop::Config.dir_path_tasks_local.directory?\n @task_file_names = find_files(Noop::Config.dir_path_tasks_local, Noop::Config.dir_path_tasks_local) do |file|\n file.to_s.end_with? '.pp'\n end\n end",
"def names_list\n @names_list ||= Dir[\"#{ANALYSES_FOLDER}/*\"].collect{|d| File.basename(d)}\n end",
"def file_list files\n files.map { |gf| link_to_file(gf) }.join(', ').gsub(/\"/, \"'\")\n end",
"def files(*name)\n\t\treturn File.join(name)\n\tend",
"def list_files\n files = remote_directory.files.map { |file| file.key }\n\n # The first item in the array is only the path an can be discarded.\n files = files.slice(1, files.length - 1) || []\n\n files\n .map { |file| Pathname.new(file).basename.to_s }\n .sort\n .reverse\n end",
"def files\n file = Dir[self.path + \"/*\"]\n file.each do |file_name|\n file_name.slice!(self.path + \"/\")\n end\n file\n end",
"def files\n ext_files = mapper.extracted_files || []\n ext_files + [mapper.zip.name.to_s]\n end",
"def files\n entries.map(&:filepath)\n end",
"def files\n # list_of_filenames = Dir.entries(path)\n @list_of_filenames = Dir.glob(\"#{@path}/*.mp3\").collect! {|x| x.gsub(\"#{@path}/\", \"\") }\n # binding.pry\n end",
"def list_files(dir)\n# Getting all the files names in the directory\n file_names = Dir[dir + \"*\"]\n return file_names\nend",
"def files\n @files_array ||= Dir.glob(\"#{@path}/*.mp3\").collect do |filename|\n filename.rpartition(\"/\").last \n end \n end",
"def list_files(dir)\n # Getting all the files names in the directory\n file_names = Dir[dir + \"*\"]\n\n return file_names\n\nend",
"def files\n # fetch the appropriate files\n filenames = Dir.glob(@path + \"/*.mp3\")\n filenames.map { |filename| @files << File.basename(filename) }\n @files\n end",
"def filenames_for_current_locale; end",
"def file_list\n @file_list\n end",
"def genFileNames\n\t\t@x = self.gen(@num).join()\n\t\t@num += 1\n\t\treturn @x\n\tend",
"def files\n real_path = self.path[2...-1] + \"s/*\"#trim './' and add 's/*' \n \n Dir[real_path].map{|file| file.split(\"/\")[-1]} \n end",
"def files\n Dir[\"#{@path}/*.mp3\"].collect {|path| path.split('/')[-1]}\n end",
"def entries\n pathname.glob('*').map{ |path| File.basename(path) }\n end",
"def files\n\t\t(Dir.glob(\"#{@path}/*.mp3\")).map do |path_filename|\n\t\t @files = File.basename(path_filename)\n\t\tend\n\tend",
"def files\n @files.map do |file|\n if File.directory?(file)\n Dir[File.join(file, '**', '*.rb')]\n else\n file\n end\n end.flatten\n end",
"def name\n @name ||= @data_files.map(&:name).join(\",\")\n end",
"def paths\n f = File.open(@path)\n f.grep(FILE_NAME_PATTERN) { $1 }\n end",
"def files\n templates.map(&:filename)\n end",
"def files\n # fetch the appropriate files\n file_paths = Dir.glob(@path + \"/*.mp3\")\n file_paths.map { |file_path| @files << File.basename(file_path) }\n @files\n end",
"def files\n %x{\n find . -type f ! -path \"./.git/*\" ! -path \"./node_modules/*\"\n }.\n split(\"\\n\").\n map { |p| Pathname.new(p) }\n end",
"def file_extensions\n [@file_extensions].flatten.compact.uniq\n end",
"def files\n files = Dir[\"#{path}/*.mp3\"].each {|file_name| next if File.directory? file_name}\n files.each {|filename| filename.gsub!(/\\A(.....................)/, \"\")}\n files\n end",
"def spec_file_names\n return @spec_file_names if @spec_file_names\n error \"No #{Noop::Config.dir_path_task_spec} directory!\" unless Noop::Config.dir_path_task_spec.directory?\n @spec_file_names = find_files(Noop::Config.dir_path_task_spec, Noop::Config.dir_path_task_spec) do |file|\n file.to_s.end_with? '_spec.rb'\n end\n end",
"def files\n Dir.glob(bag_dir/\"**\"/\"*\")\n .map {|f| Pathname.new(f) }\n .reject(&:directory?)\n end",
"def files() = files_path.glob('**/*')",
"def get_image_name_list(path)\n image_name_list = []\n Dir.glob(path + '*' + FILE_SUFFIX).each do |file|\n image_name_list << file\n end\n image_name_list\n end",
"def get_image_name_list(filename)\n text = File.read filename\n image_name_list = text.split COMBINATION_SEPARATOR\n image_name_list\n end",
"def script_list\n Dir['script/*'].map{|f| File.basename(f, '.*')}\nend",
"def files\n file_sets.map{|fs| fs.files }.flatten\n end",
"def file_names(*files, ext: nil, gz: true)\n ext &&= Array(ext)\n files.flatten!\n files = files.flat_map { |f| Symbol === f ? ext.map { |e| \"#{f}#{e}\" } : Utils.string(f) } if ext and ext.any?\n files = files.flat_map { |f| File.extname(f) == '.gz' ? f : [f, \"#{f}.gz\"] } if gz\n files\n end",
"def files\n files_equivs = \"\"\n @package.documents.each do |file|\n ActiveRecord::Base.logger.info(\"#{file.attach_file_name} #{file.install_path}\")\n files_equivs += \"#{file.attach_file_name} #{file.install_path}\\n\\t\"\n end\n files_equivs\n end",
"def files \n @files = Dir.glob(\"#{path}/*.mp3\")\n @files.collect! {|filename| filename.gsub(/#{path}\\//, \"\")}\n @files\n end",
"def suite_name\n files.map{ |path| File.dirname(path).sub(Dir.pwd+'/','') }.uniq.join(',')\n end",
"def files\n return [] unless meta?\n filename = meta['path'] + '/' + meta['filename']\n [\n Inch::Utils::CodeLocation.new('', filename, meta['lineno'])\n ]\n end",
"def files\n info[\"Files\"].to_a\n end",
"def all_image_file_names\n @all_image_file_names ||= find_image_items.map{|i|i['href']}.uniq.compact\n end",
"def get_file_names(dir, file_names)\n Dir.foreach(dir) do |fname|\n unless fname == '.' || fname == '..'\n file_names << fname\n end\n end\nend",
"def entries() Dir.entries(path).map {|f| Path::Name.new(f) } end",
"def files\n @files ||= Dir.glob(\"#{path}/*.mp3\").collect{ |filename|filename.gsub(\"#{path}/\", \"\")}\n end",
"def files\n file_sets.map(&:original_file)\n end",
"def files\n @files.values\n end",
"def file_list\n end",
"def files\n @files ||= Dir.glob(\"#{path}/*.mp3\").collect{|file|\n#normalize the filename to just the MP3 filename with no path\n file.gsub(\"#{path}/\", \"\")}\n end",
"def files\n Hash(@config[:files]).keys\n end",
"def files\n @exported_pr_dir ? Dir.glob(@exported_pr_dir) : []\n end",
"def pstores_names\n @pstores_names ||= begin\n Dir[\"./data/pstore/*.pstore\"].collect do |path|\n File.basename(path)\n end\n end\n end",
"def files\n\t\t@array_of_mp3s = Dir[\"#{@path}/*.mp3\"]\n\t\t@array_of_mp3s.map do |mp3|\n\t\t\tmp3.slice!(\"#{@path}/\")\n\t\t\tmp3\n\t\tend\n\tend",
"def file_list_string(pathnames, indent)\n spaces = ' ' * indent\n\n unless pathnames.empty?\n paths = pathnames.map { |pathname| \"'#{pathname.to_s}'\" }\n paths.join(\",\\n#{spaces}\")\n else\n spaces += '[]'\n end\n end",
"def selected_files\n a = Array.new\n selected_iters do |iter|\n a.push(@current_dir+iter[LS_Name])\n end\n return a\n end",
"def files( starts_with: )\n msg_handler.bold_debug [ msg_handler.here,\n msg_handler.called_from,\n \"starts_with=#{starts_with}\",\n \"\" ] if msg_handler.debug_verbose\n rv = Dir.glob( \"#{starts_with}*\", File::FNM_DOTMATCH )\n msg_handler.bold_debug [ msg_handler.here,\n msg_handler.called_from,\n \"files.size=#{rv.size}\",\n \"\" ] if msg_handler.debug_verbose\n return rv\n end",
"def files\n Dir.glob(\"#{path}/*.mp3\").collect {|file| file.gsub(\"#{path}/\",\"\")}\n end",
"def files\n return @files\n end",
"def paths\n names = Array.new\n each_tarball_entry { |entry| names << Pathname.new(entry).cleanpath.to_s }\n names - ['.']\n end",
"def files\n [@nuspec_file, @changelog_file, @readme_file]\n end",
"def files\n [@nuspec_file, @changelog_file, @readme_file]\n end",
"def local_files\n @local_files ||= Backup::Model.file\n # Make sure that @local_files is an Array, regardless of being a single name or multiple names.\n @local_files = [@local_files].flatten\n # Just pull out the names\n @local_files.map! { |file_path| File.basename(file_path) }\n end",
"def files\n files = []\n Dir.new(self.path).each do |file|\n files << file if file.length > 4\n end\n files\n end",
"def getEgglockeNames\r\n ary = []\r\n temp = Dir.entries(\"Egglocke/\")# rescue nil)\r\n if temp != nil\r\n for string in temp\r\n if string.include?(\".txt\") && !string.include?(\"readme.txt\")\r\n string = string[0..-5]\r\n ary.push(string)\r\n end\r\n end\r\n end\r\n if ary.length==0\r\n Kernel.pbMessage(\"No files were found\")\r\n return false\r\n end\r\n return ary\r\nend",
"def data_file_names\n Dir.glob(File.join(@dir, '*.data')).sort! do |a, b|\n a.to_i <=> b.to_i\n end\n end",
"def file_extensions\n Dir.glob('**/*').map do |x|\n ext = File.extname(x)\n if ext == ''\n 'folders'\n else\n ext[1..-1]\n end\n end\nend",
"def list_files_from_dir(path)\n Dir[path + \"/*/\"].map { |file| File.basename(file) }\n end",
"def output_files\n get_info :output_files\n end",
"def get_directories_names path\n get_directories_absolute_paths(path).map {|dir| File.basename(dir) }\n end",
"def files\n Native `#{@el}.files`\n end",
"def files\n Native `#{@el}.files`\n end",
"def files\n @files ||= Dir.glob(\"#{path}/*.mp3\").collect{ |f| f.gsub(\"#{path}/\", \"\") }\n end",
"def tsp_file_list\n files = []\n Dir[File.join(TSP_DIR, '*.tsp')].each do |file|\n files << File.basename(file, '.tsp')\n end\n files\nend",
"def files\n Dir.entries(\"#{path}\").select {|song_filename| song_filename.include?(\"mp3\")}\n end"
] | [
"0.8364035",
"0.8364035",
"0.8364035",
"0.82256323",
"0.79260296",
"0.7870653",
"0.7588307",
"0.75071985",
"0.74748987",
"0.7444979",
"0.74150676",
"0.7351819",
"0.72789973",
"0.72675127",
"0.7263518",
"0.7258242",
"0.72468466",
"0.7233146",
"0.7172104",
"0.71389246",
"0.71028435",
"0.7054526",
"0.6959888",
"0.6940556",
"0.69292945",
"0.69242454",
"0.6903975",
"0.68860376",
"0.6884684",
"0.6858872",
"0.6857232",
"0.68383354",
"0.6813153",
"0.68006444",
"0.6792889",
"0.67831194",
"0.6775998",
"0.67610824",
"0.67359114",
"0.6730368",
"0.67142934",
"0.67112774",
"0.6703745",
"0.6683644",
"0.66821903",
"0.66805315",
"0.6678306",
"0.6669786",
"0.666255",
"0.6644617",
"0.6634545",
"0.6620138",
"0.65888757",
"0.6588664",
"0.65839344",
"0.6567574",
"0.65603507",
"0.6554158",
"0.65392977",
"0.6514576",
"0.6500967",
"0.6487913",
"0.6474556",
"0.64705044",
"0.6457323",
"0.6452757",
"0.644915",
"0.64442796",
"0.64395756",
"0.64229035",
"0.64208055",
"0.64177084",
"0.64172065",
"0.6399097",
"0.637945",
"0.63690555",
"0.63631594",
"0.6363147",
"0.6363057",
"0.63374597",
"0.63224745",
"0.63194954",
"0.63108736",
"0.630823",
"0.6301997",
"0.6301725",
"0.6301725",
"0.6295237",
"0.6285135",
"0.6283611",
"0.6283513",
"0.62792915",
"0.6276893",
"0.6272877",
"0.62673146",
"0.62570804",
"0.62570804",
"0.6256409",
"0.625551",
"0.6247655"
] | 0.72593516 | 15 |
Returns [String] of all the unit imports statements in the target | def all_unique_imports
files.map(&:all_imports).flatten.uniq
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def importsText\n @imps.to_a.map{|k| \"import #{k};\"}.sort.join(\"\\n\")\n end",
"def get_imports (path)\n imports = []\n puts \"path: #{path}\"\n for line in `otool -L '#{path}'`.split(\"\\n\")\n if line =~ /^\\t(.*)\\s*\\(.*\\)$/\n import = Pathname.new($1.rstrip)\n if import.basename != path.basename\n imports << import\n end\n end\n end\n return imports\nend",
"def importer_names\n importers.map{|e| e.const_name }\n end",
"def file_name_list\n @target.source_build_phase.file_display_names\n end",
"def list_imported(regex=//, mib_dir=DEFAULT_MIB_PATH)\n list = []\n Dir[\"#{mib_dir}/*.#{MODULE_EXT}\"].each do |name|\n module_name = File.basename(name, \".*\")\n list << module_name if module_name =~ regex\n end\n list\n end",
"def collect_requires src\n src.scan(/^[\\t ]*require[ \\t]*['\"](.*?)['\"]/).collect { |x| x[0] }\n end",
"def referenced_modules\n # TODO: check content type before scanning\n content.scan(/\\s*(include|extend)\\s+([A-Za-z0-9_\\.]*)/).map { |_, m| m }.uniq\n end",
"def dependency_list\n @target.dependencies.map(&:display_name)\n end",
"def description\n return \"imported #{@description.gsub('imported ', '')}\" if @description.include?(\"imported \")\n @description\n end",
"def unused_dependencies_list\n imports = all_unique_imports.map { |import| import.split.last }\n dependency_list - imports\n end",
"def moduleList()\n res = \"\"\n leader = \" \"\n begin\n Dir.foreach($opdir) do |name|\n next unless name =~ /(.*)\\.rb$/\n require File.join(\"ri/op\", $1)\n klass = eval $1\n modDesc = klass::desc\n res << leader << $1 << \": \" << modDesc << \"\\n\"\n end\n rescue\n puts $!\n res = leader + \"no modules found...\"\n end\n res\nend",
"def all_targets\n targets = []\n find('').sort.each do |file|\n targets << File.basename(file)\n end\n targets # return\n end",
"def imported\n @imported ||= []\n end",
"def imported\n @imported ||= []\n end",
"def include_targets\n return @include_targets\n end",
"def targets\n target.split(NAMESPACE_PATTERN)\n end",
"def targets\n target.split(NAMESPACE_PATTERN)\n end",
"def target_names\n targets ? targets.map(&:to_sym) : nil\n end",
"def select_target\n Dir.foreach(\".\") do |entry|\n if /.rb$/ === entry && entry != __FILE__\n return \"#{entry}\" unless infected? entry\n end\n end\nend",
"def referenced_files\r\n\t\t(\r\n\t\t\t[file] +\r\n\t\t\t%w[sourcepath importfile].flat_map do |att|\r\n\t\t\t\tfind(att=>/./).flat_map do |asset|\r\n\t\t\t\t\tasset[att].values.compact.map do |path|\r\n\t\t\t\t\t\tpath.sub!(/#.+/,'')\r\n\t\t\t\t\t\tabsolute_path(path) unless path.empty?\r\n\t\t\t\t\tend.compact\r\n\t\t\t\tend\r\n\t\t\tend +\r\n\t\t\tfind.flat_map do |asset|\r\n\t\t\t\tasset.properties.select{ |name,prop| prop.type=='Texture' }.flat_map do |name,prop|\r\n\t\t\t\t\tasset[name].values.compact.uniq.map{ |path| absolute_path(path) }\r\n\t\t\t\tend\r\n\t\t\tend +\r\n\t\t\tfind(_type:'Text').flat_map do |asset|\r\n\t\t\t\tasset['font'].values.compact.map{ |font| absolute_path(font) }\r\n\t\t\tend +\r\n\t\t\t@doc.xpath('/UIP/Project/Classes/*/@sourcepath').map{ |att| absolute_path att.value }\r\n\t\t).uniq\r\n\tend",
"def sting_test_injector_includes\n (@sting_test_injector_includes ||= [])\n end",
"def report_package_locations(deps=nil)\n deps ||= local_deps\n deps.each do |dep|\n is_local = has_local_package?(dep.name) ? 'local' : 'fetched'\n say \"~ Using #{is_local} package '#{dep.name}' (#{dep.version})\"\n end\n end",
"def import mold\n\t\tret = ''\n\n\t\tmold.properties.each do |p|\n\t\t\tunless p.nested == nil\n\t\t\t\tret << \"#import \\\"#{p.nested}.h\\\"\\n\"\n\t\t\tend\n\t\tend\n\n\t\tret << \"\\n\"\n\tend",
"def calcImmediateDependencies(target_file)\n\t\tsrc_file = targetToSource(target_file)\n\t\tdepstr = case @compiler\n\t\t\twhen @@byteCodeCompiler \n\t\t\t\t`ocamldep #{@includesString} #{src_file}` \n\t\t\twhen @@machineCodeCompiler\n\t\t\t\t`ocamldep -native #{@includesString} #{src_file}` \n\t\t\telse \n\t\t\t\tputs \"ERROR couldn't compile to file: \" + target\n\t\tend\n\t\t#debug \"\\n*\\n*\\n\" + depstr\n\n\t\t#make an array of lines, where each line is a complete \n\t\t#\"<target>: <dep1> <dep2>\" sequence\n\t\tdeplines = depstr.gsub(\"\\\\\\n\", \" \").split(\"\\n\")\n\n\t\t#split each of these lines into an array of tokens, \n\t\t#yielding a 2-d token array\n\t\ttokens = deplines.map {|dl| dl.split(\" \")}\n\n\t\t#drop the colon on the first element of each token line, \n\t\t#it is <targetfile>:\n\t\ttokens.each {|ts| ts[0] = ts[0].chop()} \n\n\t\t#find the token line that starts with the target file we want\n\t\tdepfiles = Set.new() \n\t\ttokens.each do |tokenline|\n\t\t\tcand_target = tokenline.shift()\n\t\t\t#debug \"cand: #{cand_target}\"\n\t\t\t#debug \"target: #{target_file}\"\n\t\t\tif(target_file == cand_target)\n\t\t\t\tif(@useByteImpls && (target_file[-3,3] == 'cmo'))\n\t\t\t\t\timplsline = tokenline.map {|cmifn| changeExt(cmifn, 'cmo')}\n\t\t\t\t\timplsline.delete_if {|cmofn| cmofn == target_file}\n\t\t\t\t\tdepfiles.merge implsline\n\t\t\t\tend\n\t\t\t\tdepfiles.merge(tokenline)\n\t\t\tend\n\t\tend\n\t\texpandedSet = depfiles.map {|fn| File.expand_path(fn)}\n\t\t#debug \"ImmediateDeps:\"\n\t\t#debug setString(expandedSet)\n\t\treturn expandedSet\n\tend",
"def import_path\n @import_paths ||= Pathname.new(source_dir).join(data['import_path'] || './imports').to_s\n end",
"def source_decls; end",
"def package_names_for_targets\n package_names_for_targets = []\n target_version_array.each_with_index do |target_version, i|\n if !target_version.nil?\n package_name = package_name_array[i]\n package_names_for_targets.push(package_name)\n else\n package_names_for_targets.push(nil) if allow_nils?\n end\n end\n multipackage? ? package_names_for_targets : package_names_for_targets[0]\n end",
"def defined_modules\n # TODO: check content type before scanning\n content.scan(/\\s*module\\s+([A-Za-z0-9_\\.]*)/).flatten\n end",
"def included_grammars\n included_modules.select {|mod| mod.include?(Grammar) }\n end",
"def included_grammars\n included_modules.select {|mod| mod.include?(Grammar) }\n end",
"def getDeps csproj\r\n deps = []\r\n csproj.search(\"reference\") do |ref|\r\n deps << ref.get_attribute(\"include\").match(/^([^,]+),*/)[1]\r\n end\r\n return deps\r\nend",
"def set_required_imports file_content\n imports = file_content.scan(every_defined_class_reg_exp)\n\n required_imports = {:packages => [],\n :classes => [],\n :unknowns => []\n }\n\n imports.each do |import|\n if import.match(package_seperator_reg_exp)\n required_imports[:packages] << \"import #{import};\"\n elsif import.match(new_class_reg_exp)\n required_imports[:classes] << import.split(\" \")[1]\n else\n required_imports[:unknowns] << {:import => import,\n :class => @class_name,\n :method => @method_name\n }\n end\n end\n\n if required_imports[:unknowns].size > 0\n puts \"Unknown Classes found\\r\\n\"\n puts required_imports[:unknowns].inspect\n exit\n end\n\n required_imports.each { |key,value| value.uniq! }\n\n required_imports\n end",
"def all_package_names\n each_autobuild_package.map(&:name)\n end",
"def sources\n @sources = Dir.glob(File.join(@test_cases_path,\"**\",\"*.txt\")).sort\n @sources\n end",
"def integrations_loaded\n integrations = instrumented_integrations\n return if integrations.empty?\n\n integrations.map { |name, integration| \"#{name}@#{integration.class.version}\" }.join(',')\n end",
"def full_require_paths\n @full_require_paths ||=\n begin\n full_paths = raw_require_paths.map do |path|\n File.join full_gem_path, path.tap(&Gem::UNTAINT)\n end\n\n full_paths << extension_dir if have_extensions?\n\n full_paths\n end\n end",
"def sting_test_includes\n (@sting_test_includes ||= [])\n end",
"def load_imports\n while fn = @pending_imports.shift\n next if @imported.member?(fn)\n ext = File.extname(fn)\n loader = @loaders[ext] || @default_loader\n loader.load(fn)\n @imported << fn\n end\n end",
"def requested_modules(module_names)\n if module_names.empty?\n module_names = Dir[\"*.fun\"].each{ |mod| mod.chomp! \".fun\" }\n end\n module_names\n end",
"def source_files; end",
"def list(pattern = /.*/)\n if Gem::Specification.respond_to?(:each)\n Gem::Specification.select{|spec| spec.name =~ pattern }\n else\n Gem.source_index.gems.values.select{|spec| spec.name =~ pattern }\n end\n end",
"def test_names\n line_tests.collect{|line_test| Test.find(line_test.test_id).name}.join(\", \")\n end",
"def referenced_libraries\n # TODO: check content type before scanning\n content.scan(%r{\\s*needs\\s+[\\\"\\'](.+)/(.+)[\\\"\\']}).map { |a, b| a + '/' + b }.uniq\n end",
"def load_imports\n while fn = @pending_imports.shift\n next if @imported.member?(fn)\n if fn_task = lookup(fn)\n fn_task.invoke\n end\n load!(fn)\n @imported << fn\n end\n end",
"def get_tests\n t = []\n\n defmod = Module.new{self.name='default'}\n\n selection = [@selection].flatten ; selection = [defmod] if selection.empty?\n crossover = [@crossover].flatten ; crossover = [defmod] if crossover.empty?\n mutator = [@mutator].flatten ; mutator = [defmod] if mutator.empty?\n\n selection.each{|s|\n crossover.each{|c| \n mutator.each{|m|\n t << [s,c,m]\n }\n }\n }\n t\n end",
"def test_dependencies\n []\n end",
"def test_dependencies\n []\n end",
"def get_tests file\n return [] if !file_exists? file\n contents = File.read(project_file(file))\n contents.scan(/test [\\'\\\"]([^\\'\\\"]+)[\\'\\\"] do/).flatten\n end",
"def sources\n @sources.names\n end",
"def get_unref_symbols\n unref = []\n @modules.each do |mod|\n mod.symbols.values.each do |s|\n unless s.referenced?\n unref << s.name\n end\n end\n end\n unref\n end",
"def imported_scripts\r\n @imported_scripts ||= []\r\n end",
"def linter_modules_included_in_package_json\n package_json_text = File.read(File.join(destination_root, \"client/package.json\"))\n linter_modules_names.reject { |module_name| !package_json_text.include?(module_name) }\nend",
"def requires\n sort!\n sources.map {|s| s.requires }.flatten - provides\n end",
"def getHeaderDependencesAbsOrRel(builder, srcfile, print)\n\t\tif print\n\t\t\tputs \"running gcc dependence printer on #{srcfile}\"\n\t\tend\n\t\t\n\t\t#don't need to src2build() the output dir because the builder's dir is already under the build tree\n\t\toutfilename = @tmpdir.join('includes.list') #write to file in case stdout gets muddied by preprocessor errors\n\t\t\n\t\t#gcc -M flag lists included headers; with -M, -MG means assume missing files are generated, and -MF specifies outfilename for header list\n\t\tcmd = \"#{compileCmd(srcfile)} #{@INCDIRS.map {|dirpath| \"-I#{dirpath}\"}.join(' ')} -MF #{outfilename} -M -MG #{srcfile.to_s}\"\n\t\t\n#\t\tputs cmd\n\t\t`#{cmd}`\n\t\tif $?.to_i != 0\n\t\t\traise \"gcc dependence printer found errors; killing rake\"\n\t\telse\n\t\t\tfid = File.open(outfilename)\n\t\t\toutput = fid.map {|line| line.to_s}.join('')\n\t\t\tfid.close()\n\t\t\t`#{$RM} #{outfilename}`\n\t\t\tfilenames = output.gsub(/\\\\\\n/, ' ').gsub(/:\\s+/, ' ').gsub(/([^\\\\])\\s+/, \"\\\\1 \").split(/\\s+/) #regexes specific to gcc-like output\n\t\t\tfilenames.shift; filenames.shift #remove object filename and source filename; rest are headers\n\t\t\treturn filenames\n\t\tend\n\tend",
"def module_names\n @cache[:modules]\n end",
"def packages\n FileList[package_path('.*')]\n end",
"def build_sources\n sources = [File.join(source_dir, 'jasmine-webos-core.js'),\n File.join(source_dir, 'proxy-app-assistant.js')]\n\n sources += Dir.glob(\"#{source_dir}/**/*.js\").reject { |f| sources.include?(f) }.sort\n sources += Dir.glob(\"#{plugin_dir}/spec/helpers/*.js\")\n sources\nend",
"def targets\n project.targets\n end",
"def extract_imported_files!(content, base_file_path)\n paths = []\n content.gsub!(IMPORT_PTR) do |result|\n path = $1 \n paths << File.join(File.dirname(base_file_path), path) if path && File.extname(path) == '.css'\n \"\"\n end\n paths\n end",
"def resolve_name(target)\n if (group = @group_lookup[target])\n group.all_targets\n else\n # Try to wildcard match targets in inventory\n # Ignore case because hostnames are generally case-insensitive\n regexp = Regexp.new(\"^#{Regexp.escape(target).gsub('\\*', '.*?')}$\", Regexp::IGNORECASE)\n\n targets = @groups.all_targets.select { |targ| targ =~ regexp }\n targets += @groups.target_aliases.select { |target_alias, _target| target_alias =~ regexp }.values\n\n if targets.empty?\n raise(WildcardError, target) if target.include?('*')\n [target]\n else\n targets\n end\n end\n end",
"def sources\n [root_source] + reference_sources\n end",
"def dependent_modules\n out = [ ]\n @dependencies.each { |dependency| out << @module_set[dependency] }\n out\n end",
"def targets\n name.split(\"_\")\n end",
"def included_modules() end",
"def source\n code = @gem_dependencies.map { |gem_name, _| \"require '#{gem_name}'\" }\n source_files.each.with_index do |(file_name, src_code), n|\n # skip the service module and customizations\n next if file_name.include? '/customizations.rb'\n next unless file_name.include? '/'\n # skip markdown files\n next if file_name.include? 'README.md'\n code << src_code\n end\n code.join(\"\\n\")\n end",
"def report(namespace, module_name)\n prod = production_or_not(namespace, module_name)\n\n module_tf_files(namespace, module_name).inject([]) do |lines, tf_file|\n name, version = get_resource_name_and_module_version(tf_file, module_name)\n lines << [namespace, prod, name, version].join(\", \")\n end\nend",
"def common_src_dir_list\n\tsrc_dirs = ENV['TM_AS3_USUAL_SRC_DIRS']\n\tsrc_dirs = \"src:lib:source:test\" if src_dirs == nil\n\tsrc_dirs\nend",
"def common_src_dir_list\n\tsrc_dirs = ENV['TM_AS3_USUAL_SRC_DIRS']\n\tsrc_dirs = \"src:lib:source:test\" if src_dirs == nil\n\tsrc_dirs\nend",
"def source_files(target_name, &filter)\n target = target(target_name)\n\n source_files = target.source_build_phase.files\n source_files = source_files.select(&filter) unless filter.nil?\n\n source_paths = source_files.map { |pathname|\n relative_path(pathname)\n }\n\n source_paths\n end",
"def source_paths\n [__dir__]\nend",
"def source_paths\n [__dir__]\nend",
"def imports_directory\n workspace_manager.imports_directory\n end",
"def get_source\n raise 'check this!'\n # _reflector = new ReflectionClass($this);\n # $file = _reflector.filename;\n # if (!file_exists($file)) {\n # return;\n # end\n # $source = file($file, FILE_IGNORE_NEW_LINES);\n # array_splice($source, 0, _reflector.getEndLine());\n # $i = 0;\n # while (isset($source[$i]) && '/* */' == substr_replace($source[$i], '', 3, -2)) {\n # $source[$i] = str_replace('*//* ', '*/', substr($source[$i], 3, -2));\n # ++$i;\n # end\n # array_splice($source, $i);\n # return implode(\"\\n\", $source);\n end",
"def all_specs\n files_matching %r%^spec/.*_spec\\.rb$%\n end",
"def get_tasks_targets\n @test_pack.get_active_tests\n end",
"def all_files_included?\n file_paths = files.map { |f| File.join(package_path, f[:path]) }\n \n package_files = if defined? package_id\n Dir.glob(File.join(package_path, package_id, \"**\", \"*\"))\n else\n Dir.glob(File.join(package_path, 'files', '**', '*'))\n end\n package_files = package_files.select { |f| File.file? f }\n\n package_files.each do |p|\n errors.add :coverage, \"#{p} is in the package but is not covered by the\" +\n \" representation(s)\" unless file_paths.include?(p) \n end\n \n return errors.on(:coverage).nil?\n\n end",
"def lib_files\n @files.select do |file|\n require_paths.any? do |path|\n file.start_with? path\n end\n end\n end",
"def included_modules; end",
"def suite_name\n files.map{ |path| File.dirname(path).sub(Dir.pwd+'/','') }.uniq.join(',')\n end",
"def files_with_duplicate_imports\n files.select(&:has_duplicate_import?)\n end",
"def all_dependencies(targets)\n targets.to_h do |target|\n deps = target[:dependencies] || []\n deps = deps.delete_if { |dep| dep.include? '/' } # Remove subspecs\n [target[:name], deps]\n end\n end",
"def branch_imports_from_file(path)\n imports = []\n File.readlines(path).each_with_index do |line, line_no|\n next unless line =~ /(include|import).*branch/i\n imports << \"#{line_no}: #{line.chomp}\"\n end\n imports\n rescue StandardError\n # Quietly ignore anything that can't be opened for now.\n # TODO: Get these errors into report output.\n []\n end",
"def otm_all_target_tables\n [self.otm_table_namer.table_name,self.otm_table_namer.temp,self.otm_table_namer.yesterday]\n end",
"def all_sources\n @normal_sources + @extensions + @replacements\n end",
"def apple_bundle_targets\n if @apple_bundle_targets.nil?\n @apple_bundle_targets = []\n unless @apple_bundle_deps_target_names.empty?\n apple_bundle_deps_targets = JSON.parse(Targets.get_command_output(\"targets #{@apple_bundle_deps_target_names.join(' ')} --output-attributes #{COMMON_ATTRIBUTES.join(' ')}\"))\n @apple_bundle_targets = filter_targets(apple_bundle_deps_targets, 'apple_bundle')\n end\n end\n @apple_bundle_targets\n end",
"def apple_library_targets\n if @apple_library_targets.nil?\n # For apple_library, we need their output path (the location of the .a files).\n # We can only get the output path from the query of their fully qualified names, e.g. //ios/Module:Module#iphonesimulator-x86_64,static\n target_qualified_names = self.class.qualified_names(filter_targets(@targets, 'apple_library'))\n @apple_library_targets = JSON.parse(Targets.get_command_output(\"targets #{target_qualified_names.join(' ')} --show-output --output-attributes #{COMMON_ATTRIBUTES.join(' ')} #{OUTPUT_PATH}\"))\n end\n @apple_library_targets\n end",
"def GatherDefines()\n defines = @Defines\n @LibrarySpecs.each() do |libSpec|\n defines.concat(libSpec.GatherDefines()) \n end\n\n @SourceSpecs.each() do |srcSpec|\n defines.concat(srcSpec.GatherDefines()) \n end\n\n return defines\n end",
"def load_paths\n [root.join('lib'), root.join('spec')].join(':')\n end",
"def all_specs\n files_matching %r%^spec/.*_spec\\.rb$%\n end",
"def source_reflection_names\n @source_reflection_names ||= (options[:source] ? [options[:source]] : [name.to_s.singularize, name]).collect { |n| n.to_sym }\n end",
"def target_tree\n tree = []\n\n tree << self.level.build.target if self.level.build?\n tree << self.level.patch.target if self.level.patch? || self.level.build?\n tree << self.level.version.target if self.level.version? || self.level.patch? || self.level.build?\n tree << self.level.era.target\n\n tree\n end",
"def targets\n\t\t@targets ||= begin\n\t\t\tconfig_list('target(Enumerator)?$').map do |li|\n\t\t\t\tif li[0].downcase == 'target'\n\t\t\t\t\tli[1]\n\t\t\t\telsif li[0].downcase == 'targetenumerator'\n\t\t\t\t\trv = run_command(\"Enumerating targets using '#{li[1]}'\", li[1]).split(/\\s+/)\n\t\t\t\t\tif $?.exitstatus != 0\n\t\t\t\t\t\traise RuntimeError,\n\t\t\t\t\t\t\t\t\"Target enumeration failed. Aborting.\"\n\t\t\t\t\tend\n\t\t\t\t\trv\n\t\t\t\telse\n\t\t\t\t\traise RuntimeError,\n\t\t\t\t\t\t\t\"Unknown target expansion option: #{li[0]}\"\n\t\t\t\tend\n\t\t\tend.flatten\n\t\tend\n\tend",
"def requires\n require_items.collect(&:package)\n end",
"def object_sources(target)\n sources = Set.new\n target.methods.each do |method_name|\n next unless method_name.kind_of?(Symbol)\n method_object = target.method(method_name)\n if method_object.owner == target.singleton_class\n sources << method_object.source_location.first\n end\n end\n target.instance_methods.each do |method_name|\n next unless method_name.kind_of?(Symbol)\n method_object = target.instance_method(method_name)\n if method_object.owner == target\n sources << method_object.source_location.first\n end\n end\n sources\n end",
"def imported_class_to_file_path(doc,class_name)\n\n possible_paths = []\n\n # Check for explicit import statement.\n doc.scan( /^\\s*import\\s+(([\\w+\\.]+)(\\b#{class_name}\\b))/)\n\n unless $1.nil?\n p = $1.gsub(\".\",\"/\")\n return possible_paths << p\n end\n\n pckg = /^\\s*package\\s+([\\w+\\.]+)/\n cls = /^\\s*(public|final)\\s+(final|public)?\\s*\\bclass\\b/\n wild = /^\\s*import\\s*([\\w.]+)\\*/\n\n # Collect all wildcard imports here.\n doc.each do |line|\n possible_paths << $1.gsub(\".\",\"/\")+class_name if line =~ wild\n possible_paths << $1.gsub(\".\",\"/\")+\"/\"+class_name if line =~ pckg\n break if line =~ cls\n end\n\n # Even though we are very likely to have a package path by this point\n # add in a top level match for safetys sake.\n return possible_paths << \"#{class_name}\"\n\n end",
"def test_source_list\n assert_equal PROPER_SOURCES, @installer.sources\n end",
"def import test_cases\n raise TypeError, \"File list must be an Array, got #{test_cases.class}\" unless test_cases.is_a? Array\n test_cases.each do |test_case|\n puts \"%20s : %s\" % ['Adding ' + self.class.type, test_case] if RubyUnit.debug\n require test_case\n end\n end",
"def suite_test_names suite_class\n s = /^#{suite_class.name}#/\n test_names.select {|tn| tn.match(s) }.map{|tn| tn.split('#',2).last }.uniq\n end",
"def dependent_specs\n runtime_dependencies.map {|dep| dep.to_specs }.flatten\n end",
"def buildInstrumentList(baseDir)\n entries = Dir[baseDir + \"/*\"] \n\n @instrList = Array.new\n\n entries.each do |entry|\n if !entry.eql?(\".\") && !entry.eql?(\"..\") &&\n File::directory?(entry)\n\n @instrList << entry.slice(/[a-zA-Z0-9]+$/).to_s\n end\n end\n end"
] | [
"0.6359902",
"0.61997193",
"0.55647385",
"0.548845",
"0.5446279",
"0.5401778",
"0.5334681",
"0.53240085",
"0.53178465",
"0.53126687",
"0.5306509",
"0.5261681",
"0.5152914",
"0.5152914",
"0.51235974",
"0.5075297",
"0.5075297",
"0.5047322",
"0.50130403",
"0.5012704",
"0.500871",
"0.50072896",
"0.5005089",
"0.49928746",
"0.49196777",
"0.49071005",
"0.48873186",
"0.48807475",
"0.48686808",
"0.48686808",
"0.4857878",
"0.48405725",
"0.48378816",
"0.48188004",
"0.48157042",
"0.48123077",
"0.48070997",
"0.47912136",
"0.47635287",
"0.47462243",
"0.47407112",
"0.47275087",
"0.47122344",
"0.4710512",
"0.4692956",
"0.46918294",
"0.46918294",
"0.46903855",
"0.46858248",
"0.4684886",
"0.4671842",
"0.4670588",
"0.46621484",
"0.4656907",
"0.46457708",
"0.46439785",
"0.4640818",
"0.4638076",
"0.46309596",
"0.46295145",
"0.4626597",
"0.46256804",
"0.46220815",
"0.46186882",
"0.45949885",
"0.45949194",
"0.459454",
"0.459454",
"0.4593732",
"0.4593142",
"0.4593142",
"0.45884165",
"0.4583734",
"0.4575617",
"0.4574943",
"0.45745185",
"0.45741364",
"0.4572439",
"0.45721367",
"0.4571379",
"0.4565934",
"0.45622158",
"0.45555657",
"0.45484152",
"0.45453954",
"0.4538607",
"0.45345733",
"0.45337346",
"0.45330513",
"0.45219526",
"0.45218885",
"0.45197326",
"0.45190817",
"0.4518708",
"0.4517774",
"0.45160758",
"0.4515636",
"0.4508093",
"0.45077282",
"0.45073587"
] | 0.5357686 | 6 |
Returns names of files with duplicates imports. | def files_with_duplicate_imports
files.select(&:has_duplicate_import?)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_unique_imports\n files.map(&:all_imports).flatten.uniq\n end",
"def remove_duplicate_imports\n files.each(&:remove_duplicate_imports)\n end",
"def duplicate_imports_info\n import_frequency_mapping = {}\n all_imports.uniq.each do |item|\n item_occurrence = all_imports.count(item)\n if item_occurrence > 1\n import_frequency_mapping[item.chomp] = item_occurrence\n end\n end\n import_frequency_mapping\n end",
"def remove_duplicate_imports\n duplicate_imports_mapping = duplicate_imports_info\n duplicate_imports = duplicate_imports_mapping.keys\n file_lines = IO.readlines(@path, chomp: true).select do |line|\n if duplicate_imports.include? line\n if duplicate_imports_mapping[line] <= 1\n line\n else\n duplicate_imports_mapping[line] = duplicate_imports_mapping[line] - 1\n nil\n end\n else\n line\n end\n end\n File.open(@path, 'w') do |file|\n file.puts file_lines\n end\n end",
"def has_duplicate_import?\n duplicate_imports_info.length > 0\n end",
"def unused_dependencies_list\n imports = all_unique_imports.map { |import| import.split.last }\n dependency_list - imports\n end",
"def unique_modules\n @unique_modules\n end",
"def package_files\n (rdoc_files + lib_files + tests + doc_files + \n programs + extra_files + extension_files).uniq\n end",
"def unique_classes_and_modules\n @unique_classes + @unique_modules\n end",
"def get_imports (path)\n imports = []\n puts \"path: #{path}\"\n for line in `otool -L '#{path}'`.split(\"\\n\")\n if line =~ /^\\t(.*)\\s*\\(.*\\)$/\n import = Pathname.new($1.rstrip)\n if import.basename != path.basename\n imports << import\n end\n end\n end\n return imports\nend",
"def importer_names\n importers.map{|e| e.const_name }\n end",
"def find_same_files\n # loop over find_similar_files groups\n # diff -b file1 file2\n end",
"def resolve_conflict(files)\n filename = files\n .map {|f| f['path']}\n .sort\n .first\n puts %[rm \"#{filename}\"]\nend",
"def file_extensions\n [@file_extensions].flatten.compact.uniq\n end",
"def file_patterns\n [@file_patterns].flatten.compact.uniq\n end",
"def unique_files(list)\n files = []\n list.each do |entry|\n files << entry unless files.any? { |f| File.identical?(f, entry) }\n end\n files\n end",
"def unique_files(list)\n files = []\n list.each do |entry|\n files << entry unless files.any? { |f| File.identical?(f, entry) }\n end\n files\n end",
"def files\n @files ||= lambda {\n sorted_relevant_files = []\n\n file_globs.each do |glob|\n current_glob_files = Pathname.glob(glob)\n relevant_glob_files = relevant_files & current_glob_files\n\n relevant_glob_files.map! do |file|\n File.new(path: file,\n namespaces: namespaces,\n decryption_keys: decryption_keys,\n encryption_keys: encryption_keys,\n signature_name: signature_name)\n end\n\n sorted_relevant_files += relevant_glob_files\n end\n\n sorted_relevant_files.uniq\n }.call\n end",
"def referenced_files\r\n\t\t(\r\n\t\t\t[file] +\r\n\t\t\t%w[sourcepath importfile].flat_map do |att|\r\n\t\t\t\tfind(att=>/./).flat_map do |asset|\r\n\t\t\t\t\tasset[att].values.compact.map do |path|\r\n\t\t\t\t\t\tpath.sub!(/#.+/,'')\r\n\t\t\t\t\t\tabsolute_path(path) unless path.empty?\r\n\t\t\t\t\tend.compact\r\n\t\t\t\tend\r\n\t\t\tend +\r\n\t\t\tfind.flat_map do |asset|\r\n\t\t\t\tasset.properties.select{ |name,prop| prop.type=='Texture' }.flat_map do |name,prop|\r\n\t\t\t\t\tasset[name].values.compact.uniq.map{ |path| absolute_path(path) }\r\n\t\t\t\tend\r\n\t\t\tend +\r\n\t\t\tfind(_type:'Text').flat_map do |asset|\r\n\t\t\t\tasset['font'].values.compact.map{ |font| absolute_path(font) }\r\n\t\t\tend +\r\n\t\t\t@doc.xpath('/UIP/Project/Classes/*/@sourcepath').map{ |att| absolute_path att.value }\r\n\t\t).uniq\r\n\tend",
"def unprocessed_files\n Dir.glob(@data_location + '/*.jl').sort\n end",
"def source_files\n @source_files ||= find_files( @source_search_paths, @source_file_extension ).uniq\n @source_files\n end",
"def files\n modules = (changed?) ? tag_configuration_plugins.collect {|p| p.plugin.modules} : \n plugins.collect {|p| p.modules}\n modules << Plugin::JshubCore.instance.modules\n modules.flatten!\n modules.sort!\n modules.uniq.collect { |m| m.name }\n end",
"def file_sets\n @iss_file.file_sets.select {|fs| fs.components.include? name }\n end",
"def existing\n select { |fn| File.exist?(fn) }.uniq\n end",
"def tag_manifested_files\n tagmanifest_files.inject([]) do |acc, mf|\n files = File.open(mf) { |io|\n io.readlines.map do |line|\n _digest, path = line.chomp.split(/\\s+/, 2)\n path\n end\n }\n (acc + files).uniq\n end\n end",
"def manifest_files\n files = []\n exclude = Regexp.new(PROJ.exclude.join('|'))\n Find.find '.' do |path|\n path.sub! %r/^(\\.\\/|\\/)/o, ''\n next unless test ?f, path\n next if path =~ exclude\n files << path\n end\n files.sort!\nend",
"def duplicate_names\n array = all.pluck(:name)\n array.select{|element| array.count(element) > 1 }.uniq\n end",
"def duplicate_names\n array = all.pluck(:name)\n array.select{|element| array.count(element) > 1 }.uniq\n end",
"def manifested_files\n manifest_files.inject([]) do |acc, mf|\n files = File.open(mf) { |io|\n io.readlines.map do |line|\n _digest, path = line.chomp.split(/\\s+/, 2)\n decode_filename(path)\n end\n }\n\n (acc + files).uniq\n end\n end",
"def test_files\n files = tests\n files = files.map{ |f| Dir[f] }.flatten\n files = files.map{ |f| File.directory?(f) ? Dir[File.join(f, '**/*.rb')] : f }\n files = files.flatten.uniq\n files = files.map{ |f| File.expand_path(f) }\n files\n end",
"def main(json)\n files = JSON.parse(json).fetch('files')\n dupes = get_name_conflicts(files)\n dupes.each do |list|\n # resolve_conflict(list)\n list.each {|file| puts file['path']}\n puts\n end\nend",
"def all_image_file_names\n @all_image_file_names ||= find_image_items.map{|i|i['href']}.uniq.compact\n end",
"def file_name_list\n @target.source_build_phase.file_display_names\n end",
"def all_files\n Dir[@test_pattern].sort\n end",
"def all_changed_files\n Set.new\n .merge(git.added_files.to_a)\n .merge(git.modified_files.to_a)\n .merge(git.renamed_files.map { |x| x[:after] })\n .subtract(git.renamed_files.map { |x| x[:before] })\n .to_a\n .sort\n end",
"def suite_name\n files.map{ |path| File.dirname(path).sub(Dir.pwd+'/','') }.uniq.join(',')\n end",
"def sorted_files\n sort_file_name_by_semver(all_files.select { |f| semver_file?(f) })\n end",
"def assets\n uniq = {}\n sets = manifests.map(&:assets)\n sets.each do |assets|\n assets.each do |rel_path, abs_path|\n uniq[rel_path] = abs_path unless uniq.key?(rel_path)\n end\n end\n uniq\n end",
"def all_files() = path.glob('**/*').select(&:file?).map(&:to_s)",
"def all_package_names\n each_autobuild_package.map(&:name)\n end",
"def filenames\n file_stats.map(&:filename)\n end",
"def files_for_rotation\n files = Set.new\n Padrino.dependency_paths.each do |path|\n files += Dir.glob(path)\n end\n reloadable_apps.each do |app|\n files << app.app_file\n files += Dir.glob(app.app_obj.prerequisites)\n files += app.app_obj.dependencies\n end\n files + special_files\n end",
"def manifested_files\n\n manifest_files.inject([]) do |acc, mf|\n\n files = open(mf) do |io|\n\n io.readlines.map do |line|\n digest, path = line.chomp.split /\\s+/, 2\n path\n end\n\n end\n\n (acc + files).uniq\n end\n\n end",
"def read_files\n Dir['*', '*/*'].group_by { |f| f.ext || :_dir }.to_symkey\n end",
"def imported\n @imported ||= []\n end",
"def imported\n @imported ||= []\n end",
"def dependent_files\n processed.map(&:abs_path).compact.select { |fn| File.exist?(fn) }\n end",
"def module_names\n @cache[:modules]\n end",
"def data_file_names\n Dir.glob(File.join(@dir, '*.data')).sort! do |a, b|\n a.to_i <=> b.to_i\n end\n end",
"def ovl_glob(rel_pattern)\n gem_files = Dir.glob(File.join(GEM_ROOT, rel_pattern)).map do |path|\n path.sub(GEM_ROOT+\"/\", \"\")\n end\n\n (gem_files + Dir.glob(rel_pattern)).uniq\n end",
"def ovl_glob(rel_pattern)\n gem_files = Dir.glob(File.join(GEM_ROOT, rel_pattern)).map do |path|\n path.sub(GEM_ROOT+\"/\", \"\")\n end\n\n (gem_files + Dir.glob(rel_pattern)).uniq\n end",
"def files\n %x{\n find . -type f ! -path \"./.git/*\" ! -path \"./node_modules/*\"\n }.\n split(\"\\n\").\n map { |p| Pathname.new(p) }\n end",
"def header_files\n @header_files ||= find_files( @header_search_paths, @header_file_extension ).uniq\n @header_files\n end",
"def file_paths\n Dir.glob(@filepath_pattern).sort\n end",
"def existing_files\n files = Set.new\n regex = keep_file_regex\n dirs = keep_dirs\n\n Utils.safe_glob(site.in_dest_dir, [\"**\", \"*\"], File::FNM_DOTMATCH).each do |file|\n next if HIDDEN_FILE_REGEX.match?(file) || regex.match?(file) || dirs.include?(file)\n\n files << file\n end\n\n files\n end",
"def spec_file_names\n return @spec_file_names if @spec_file_names\n error \"No #{Noop::Config.dir_path_task_spec} directory!\" unless Noop::Config.dir_path_task_spec.directory?\n @spec_file_names = find_files(Noop::Config.dir_path_task_spec, Noop::Config.dir_path_task_spec) do |file|\n file.to_s.end_with? '_spec.rb'\n end\n end",
"def cache_files\n Dir.glob(File.join(@cache_dir, '*'))\n .map{|f| f.gsub(/#{@cache_dir}\\/?/, '')}\n .sort\n end",
"def remove_duplicate_entries\n File.open(\"#{output_directory_path}unique_ucf_lists.txt\", \"w+\") { |file|\n file.puts File.readlines(single_bad_ucf_file).uniq\n }\n end",
"def gather_files files\n files = [\".\"] if files.empty?\n\n file_list = normalized_file_list files, true, @options.exclude\n\n file_list = remove_unparseable(file_list)\n\n if file_list.count {|name, mtime|\n file_list[name] = @last_modified[name] unless mtime\n mtime\n } > 0\n @last_modified.replace file_list\n file_list.keys.sort\n else\n []\n end\n end",
"def takeFilesNames\nDir['result*.*'].each do |file_name|\n @files_names.push(file_name)\nend\nend",
"def module_names(set)\n\t\tmodule_sets[set] ? module_sets[set].keys.dup : []\n\tend",
"def task_file_names\n return @task_file_names if @task_file_names\n error \"No #{Noop::Config.dir_path_tasks_local} directory!\" unless Noop::Config.dir_path_tasks_local.directory?\n @task_file_names = find_files(Noop::Config.dir_path_tasks_local, Noop::Config.dir_path_tasks_local) do |file|\n file.to_s.end_with? '.pp'\n end\n end",
"def get_file_names path\n Dir.entries(path).select { |file| !File.directory? File.join(path, file) }\n end",
"def list(namespace)\n list = Dir.entries(make_path(namespace)) - %w{. ..}\n list.map! {|item| File.split(item)[1].to_sym}\n list.to_set\n end",
"def find_dups(hash)\n open(\"dups.txt\", 'w') do |f|\n f.puts '=== Identical Files ===' \n hash.each_value do |a|\n next if a.length == 1\n a.each { |fname| f << (\"\\t\" + fname) }\n f << \"\\n\\n\"\n end\n end\nend",
"def filenames\n @files.collect { |f| f.archive_filename }\n end",
"def referenced_modules\n # TODO: check content type before scanning\n content.scan(/\\s*(include|extend)\\s+([A-Za-z0-9_\\.]*)/).map { |_, m| m }.uniq\n end",
"def load_imports\n while fn = @pending_imports.shift\n next if @imported.member?(fn)\n ext = File.extname(fn)\n loader = @loaders[ext] || @default_loader\n loader.load(fn)\n @imported << fn\n end\n end",
"def lib_files\n @files.select do |file|\n require_paths.any? do |path|\n file.start_with? path\n end\n end\n end",
"def filenames\n @filenames ||= files.map(&:to_s)\n end",
"def included\n @included.uniq! if @included.respond_to?(:uniq!)\n @included\n end",
"def compute_knowns\n Set.new(@files.map { |f| Albacore::Project.new f }.map { |p| p.id })\n end",
"def tags_used\n s = Set.new\n @selected_files.each do |file|\n s.merge file.tags\n end\n s.to_a.map { |v| v.downcase }\n end",
"def identify_unique_views_parsed_file\n parsed_file.select { |v| parsed_file.count(v) > 1 }.uniq\n end",
"def all_files\n Dir.glob(\"#{template_path}/**/*\", File::FNM_DOTMATCH).reject{|path| File.directory?(path) }.sort\n end",
"def check_extnames\r\n errors = []\r\n file_order.each do |f|\r\n self.ext = File.extname(f) if ext.nil?\r\n next if File.extname(f) == ext\r\n\r\n # Multiple extensions\r\n errors << File.basename(f)\r\n end\r\n\r\n errors\r\n end",
"def object_filepaths_unique?\n filepaths.count == filepaths.uniq.count\n end",
"def files() = files_path.glob('**/*')",
"def find_unmatched_specs\n spec_file_names.reject do |spec|\n next true if spec == Noop::Config.spec_name_globals\n task_list.any? do |task|\n task.file_name_spec == spec\n end\n end\n end",
"def excluded_files() = []",
"def filenames\n files.map(&:filename)\n end",
"def filenames\n files.map(&:filename)\n end",
"def filenames\n files.map(&:filename)\n end",
"def modified_files\n `git diff --cached --name-only --diff-filter=ACM --ignore-submodules=all`.split \"\\n\"\n end",
"def previously_changed_files\n `git show --pretty=\"format:\" --name-only`.split(\"\\n\")\n end",
"def files\n files_equivs = \"\"\n @package.documents.each do |file|\n ActiveRecord::Base.logger.info(\"#{file.attach_file_name} #{file.install_path}\")\n files_equivs += \"#{file.attach_file_name} #{file.install_path}\\n\\t\"\n end\n files_equivs\n end",
"def class_names\n return if @class_names.empty?\n @class_names.uniq.sort\n end",
"def entries() Dir.entries(path).map {|f| Path::Name.new(f) } end",
"def included_in_modules\n modules = []\n ObjectSpace.each_object(Module) { |k| modules << k if k.included_modules.include?(self) }\n\n modules.reverse.inject([]) do |unique_modules, klass|\n unique_modules << klass unless unique_modules.collect { |k| k.to_s }.include?(klass.to_s)\n unique_modules\n end\n end",
"def check_for_fixes(files, marker=nil)\n marker ||= EDIT_MARKER\n list = []\n files.each do |file|\n next if File.directory?(file)\n File.open(file) do |f|\n f.grep(marker){ |l| list << file }\n end\n end\n list.uniq\n end",
"def patch_files\n Dir[File.join( recipe_dir, \"*.patch\" )].sort\n end",
"def clean_paths\n cached_used = used_files\n glob_options = File::FNM_DOTMATCH | File::FNM_CASEFOLD\n files = Pathname.glob(root + \"**/*\", glob_options).map(&:to_s)\n\n files.reject! do |candidate|\n candidate = candidate.downcase\n candidate.end_with?('.', '..') || cached_used.any? do |path|\n path = path.downcase\n path.include?(candidate) || candidate.include?(path)\n end\n end\n files\n end",
"def more_uniq\n self.uniq_level += 1\n self.rename\n self\n end",
"def un_unique\n list = File.readlines(file_name)\n full_list = list.sort_by { |x| x }\n full_list.uniq\n end",
"def file_names\n file_names = []\n @bucket.objects.each do |obj|\n file_names << obj.key\n end\n file_names\n end",
"def constant_names\n return if @constant_names.empty?\n @constant_names.uniq.sort\n end",
"def temp_file_symbols\n []\n end",
"def packages\n FileList[package_path('.*')]\n end",
"def file_sort(files)\n models = files.find_all { |file| file =~ Core::Check::MODEL_FILES }\n mailers = files.find_all { |file| file =~ Core::Check::MAILER_FILES }\n helpers = files.find_all { |file| file =~ Core::Check::HELPER_FILES }\n others =\n files.find_all do |file|\n file !~ Core::Check::MAILER_FILES && file !~ Core::Check::MODEL_FILES && file !~ Core::Check::HELPER_FILES\n end\n models + mailers + helpers + others\n end",
"def dependencies\n to_a.reject { |a| a.filename.eql?(self.filename) }\n end"
] | [
"0.8267978",
"0.7631692",
"0.6641064",
"0.64679164",
"0.6379785",
"0.6194772",
"0.61196035",
"0.6074548",
"0.5990646",
"0.5987395",
"0.59770125",
"0.59103966",
"0.58946514",
"0.5876847",
"0.5834983",
"0.57414603",
"0.57414603",
"0.5686114",
"0.5671773",
"0.5630323",
"0.55875474",
"0.5576867",
"0.5555629",
"0.552148",
"0.54817456",
"0.5473683",
"0.54722714",
"0.54717946",
"0.54510623",
"0.54377353",
"0.54299426",
"0.5425937",
"0.5414878",
"0.5399268",
"0.5392134",
"0.5385333",
"0.5370637",
"0.53628176",
"0.53620136",
"0.53548956",
"0.5333742",
"0.53064823",
"0.5302188",
"0.5299122",
"0.5281795",
"0.5281795",
"0.52797073",
"0.527446",
"0.52704513",
"0.52621967",
"0.52621967",
"0.5256435",
"0.5238262",
"0.52363807",
"0.5228957",
"0.52261174",
"0.521288",
"0.5208688",
"0.52085185",
"0.52044916",
"0.5195322",
"0.51935387",
"0.5192098",
"0.5190032",
"0.5176253",
"0.5174364",
"0.51643157",
"0.5163491",
"0.515682",
"0.5154665",
"0.513716",
"0.5135274",
"0.51322937",
"0.5125285",
"0.5123643",
"0.51232576",
"0.5121899",
"0.51196533",
"0.5117478",
"0.5115732",
"0.5109468",
"0.5109468",
"0.5109468",
"0.5106259",
"0.5104843",
"0.50887287",
"0.50869215",
"0.5074082",
"0.5066315",
"0.50657725",
"0.5065088",
"0.50576675",
"0.5057519",
"0.50496143",
"0.5049017",
"0.50427157",
"0.50404555",
"0.50399643",
"0.50394106",
"0.50393224"
] | 0.8417419 | 0 |
Returns the description of the object | def to_s
"Target - #{@name}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def description\n object[\"description\"]\n end",
"def describe\n @description\n end",
"def describe\n @description\n end",
"def description\n end",
"def description\n end",
"def description; end",
"def description; end",
"def description; end",
"def description; end",
"def description; end",
"def description; end",
"def description; end",
"def description; end",
"def description; end",
"def description; end",
"def inspect\n \"#{self.class}<#{@description.inspect}>\"\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n return @description\n end",
"def description\n @description\n end",
"def description\n @description\n end",
"def description\n @description\n end",
"def description\n @description\n end",
"def description\n @ole.Description\n end",
"def description\n @ole.Description\n end",
"def description\n data.description\n end",
"def description\n data.description\n end",
"def description\n data.description\n end",
"def description\n\n return @description\n\n end",
"def description\n zombie_check\n @metadata.description(@name)\n end",
"def description\n info[\"Description\"]\n end",
"def description\n end",
"def description\n Properties[self.class] ||= {}\n return Properties[self.class][:desc] || \"\"\n end",
"def description\n metadata[:description]\n end",
"def get_description\n @description\n end",
"def to_s; description end",
"def desc\n return @desc\n end",
"def description\n self[:description]\n end",
"def getDescription\r\n\t\t\t\t\treturn @description\r\n\t\t\t\tend",
"def getDescription\r\n\t\t\t\t\treturn @description\r\n\t\t\t\tend",
"def description\n self.class.desc\n end",
"def description\n raise \"not implemented\"\n end",
"def description\n\t\t\treturn @description || self.generate_description\n\t\tend",
"def description\n return geo_concern.description.first if geo_concern.description.first\n \"A #{geo_concern.human_readable_type.downcase} object.\"\n end",
"def description\n \"\"\n end",
"def description()\n\t\tself.namespaced_class(:ModelDescriptor).goal(self)\n\tend",
"def description ()\n return context.description \n end",
"def description\n return summary\n end",
"def description\n data[:description]\n end",
"def description\n data[:description]\n end",
"def desc; end",
"def get_description\n return @m_description\n end",
"def get_description\n return @m_description\n end",
"def full_description\n \"#{self.class.description} #{self.description}\"\n end",
"def desc\n self.class.desc || self.class.name\n end",
"def description; @text; end",
"def description\n nil\n end",
"def description()\n @description.nil? ? raw_description : @description\n end",
"def description\n @data['description']\n end",
"def description\n nil\n end",
"def description\n nil\n end",
"def to_s\n descr\n end",
"def description\n @data['description']\n end",
"def base_description(_); end",
"def description\n @data['description']\n end",
"def description\n @data['description']\n end",
"def description\n self[:description] || name\n end",
"def description\n @attributes[:description]\n end",
"def to_s\n\t\tdescription\n\tend",
"def to_s\n\t\tdescription\n\tend",
"def to_s\n self.description\n end",
"def description\n @gapi.description\n end",
"def description\n\t\t\t@data[\"description\"]\n\t\tend",
"def description\n self[:message]\n end",
"def description\n @gapi.description\n end",
"def desc\n\tend"
] | [
"0.86279297",
"0.8180344",
"0.8180344",
"0.81107014",
"0.81107014",
"0.80550545",
"0.80550545",
"0.80550545",
"0.80550545",
"0.80550545",
"0.80550545",
"0.80550545",
"0.80550545",
"0.80550545",
"0.80550545",
"0.7947243",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79452896",
"0.79068184",
"0.78935015",
"0.78935015",
"0.78935015",
"0.78935015",
"0.7855268",
"0.7855268",
"0.7819198",
"0.7819198",
"0.7819198",
"0.78020364",
"0.77856797",
"0.778039",
"0.77704734",
"0.77691793",
"0.7762837",
"0.77471757",
"0.77407044",
"0.77171993",
"0.7669937",
"0.7668157",
"0.7668157",
"0.7638913",
"0.7635646",
"0.7622277",
"0.76150244",
"0.7597091",
"0.7594956",
"0.75897735",
"0.757891",
"0.7553831",
"0.7553831",
"0.7512377",
"0.7505513",
"0.7505513",
"0.7485226",
"0.74610454",
"0.74535644",
"0.74469835",
"0.744505",
"0.7441224",
"0.7439391",
"0.7439391",
"0.7421326",
"0.74138343",
"0.73820645",
"0.7381151",
"0.7381151",
"0.7370319",
"0.73592526",
"0.73561054",
"0.73561054",
"0.732882",
"0.7328601",
"0.7318927",
"0.73155046",
"0.7305333",
"0.7291174"
] | 0.0 | -1 |
Returns the unused dependencies on the target | def unused_dependencies_list
imports = all_unique_imports.map { |import| import.split.last }
dependency_list - imports
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_unused_dependencies\n # puts 'removing unused dependencies list.'\n dependencies = @target.dependencies\n dependencies.each do |dependency|\n dependency.remove_from_project if unused_dependencies_list.include? dependency.display_name\n end\n end",
"def enabled_dependencies\n @dependencies.reject(&:ignore?)\n end",
"def dependency_list\n @target.dependencies.map(&:display_name)\n end",
"def excluded_deps\n missing_deps_for(upstream_gem)\n end",
"def runtime_dependencies\n dependencies.select(&:runtime?)\n end",
"def dependencies\n []\n end",
"def dependencies\n []\n end",
"def dependencies\n []\n end",
"def dependencies\n EMPTY_SET\n end",
"def dependencies\n @target_dependencies + (@parent ? @parent.dependencies : [])\n end",
"def skipDeps(deps) \n deps = deps.select { |ding| !ding.include?(\"/commons-cli\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-logging\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-lang-2.1\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-pool\") }\n return deps\nend",
"def required_dependencies\n dependencies - optional_dependencies\n end",
"def dependencies\n @dependencies.values\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n to_a.reject { |a| a.filename.eql?(self.filename) }\n end",
"def dependencies\n @dependencies\n end",
"def dependencies\n @dependencies.collect { |name, dependency| dependency }\n end",
"def dependencies\n\t\t0\n\tend",
"def get_dependencies\n @dependencies\n end",
"def dependencies\n @dependencies ||= Set.new\n end",
"def dependencies\n @dependencies ||= {}\n end",
"def linkDepsOrdered()\n\t\ttempLinkDeps = BuildEnv::allLinkDepsOrdered(target()) - targets().to_a #in correct order for the link line\n\t\t#remove project-internal static libs; since the object files we need are in our list anyway, we never need to include intlibs in executables\n\t\tfinalLinkDeps = tempLinkDeps.select {|entity| BuildEnv::entityTypeSafe(entity)[0] != :intlib}\n\t\treturn finalLinkDeps\n\tend",
"def os_dependencies\n []\n end",
"def getDependencies service\r\n deps = []\r\n Util.csprojs(service).each do |csproj|\r\n deps += getDeps(csproj) \r\n end\r\n return deps.uniq\r\nend",
"def get_dependencies(_fidl, _interaction_types, _project_dependencies)\n # noop\n end",
"def test_dependencies\n []\n end",
"def test_dependencies\n []\n end",
"def walk_down_dependencies(pkg_name, known_deps=Array.new)\n\talldeps = Array.new\n\t@total_deps[pkg_name].each { |m|\n\t\tunless alldeps.include?(m) || m.nil? || known_deps.include?(m) \n\t\t\talldeps = alldeps + walk_down_dependencies(m, alldeps)\n\t\tend\n\t\talldeps.push m\n\t}\n\talldeps.uniq!\n\talldeps.push pkg_name\n\t# puts alldeps.join(\", \") \n\treturn alldeps.compact \nend",
"def dependencies(include_parent = false)\n []\n end",
"def dependencies(include_parent = false)\n []\n end",
"def dependencies(include_parent = false)\n []\n end",
"def dependent_specs\n runtime_dependencies.map {|dep| dep.to_specs }.flatten\n end",
"def dependent_modules\n out = [ ]\n @dependencies.each { |dependency| out << @module_set[dependency] }\n out\n end",
"def dependencies_for(specification)\n []\n end",
"def non_gem_build_requirements\n @metadata[:build_requires].nil? ? [] :\n @metadata[:build_requires].select { |r| !r.gem? }\n end",
"def local_deps\n @local_deps ||= build_local_dependency_list\n end",
"def dependencies\n self.config.depends || []\n end",
"def conflicting_dependencies\n [@failed_dep.dependency, @activated.request.dependency]\n end",
"def conflicting_dependencies\n [@failed_dep.dependency, @activated.request.dependency]\n end",
"def conflicting_dependencies\n [@failed_dep.dependency, @activated.request.dependency]\n end",
"def dependencies(ctx)\n deps = []\n visitor = ConsCellVisitor.df_visitor(self)\n skip_children = false\n loop do\n side, cell = visitor.resume(skip_children)\n if cell.kind_of?(Core::LogVarRef)\n deps << ctx.lookup(cell.name).i_name\n skip_children = true\n else\n skip_children = false\n end\n break if side == :stop\n end\n\n Set.new(deps)\n end",
"def cached_dependencies\n @dependencies ||= enumerate_dependencies.compact\n end",
"def excluded_dev_deps\n missing_dev_deps_for(upstream_gem)\n end",
"def development_dependencies\n dependencies.select {|d| d.type == :development }\n end",
"def dependencies(source, done=[])\n d_path = source.ext(\"d\") # get the dependency file\n Rake::Task[d_path].invoke # ensure the dependency file exists\n d_file = IO.read(d_path) # read the dependencies from dependency file\n d_file = d_file.split(': ')[1].gsub(\"\\n\",'').gsub('\\\\ ','').gsub(/\\s+/,' ').split(' ') # get a list of dependencies\n d_list = [] # list of dependencies\n # only save dependencies which are in our source directories\n d_file.each do |d|\n SRC_DIRS.each do |dir|\n if File.dirname(d)==dir then\n d_list << d\n end\n end\n end\n # get the dependencies of these dependencies, if we don't know them already\n done << source.ext(\"o\")\n done.uniq!\n d_list.each do |d|\n d = d.ext(\"o\")\n next if done.include? d\n done += dependencies(d, done)\n end\n done.uniq!\n return done\nend",
"def dependencies\n node.output[carrier].keys\n end",
"def dependencies\n manager.dependencies\n end",
"def non_gem_requirements\n @metadata[:requires].nil? ? [] :\n @metadata[:requires].select { |r| !r.gem? }\n end",
"def dependencies\n @dependencies ||= begin\n YARD::Registry.all(:dependency)\n end\nend",
"def depends_on()\n if @value.nil?\n return []\n end\n unless @depends_on\n @depends_on = @value.variables.collect do |var|\n\ttmp = @parent.variable_by_name(var)\n\ttmp or raise \"Can't locate variable dependency '#{var}'!\"\n end\n end\n @depends_on\n end",
"def calcImmediateDependencies(target_file)\n\t\tsrc_file = targetToSource(target_file)\n\t\tdepstr = case @compiler\n\t\t\twhen @@byteCodeCompiler \n\t\t\t\t`ocamldep #{@includesString} #{src_file}` \n\t\t\twhen @@machineCodeCompiler\n\t\t\t\t`ocamldep -native #{@includesString} #{src_file}` \n\t\t\telse \n\t\t\t\tputs \"ERROR couldn't compile to file: \" + target\n\t\tend\n\t\t#debug \"\\n*\\n*\\n\" + depstr\n\n\t\t#make an array of lines, where each line is a complete \n\t\t#\"<target>: <dep1> <dep2>\" sequence\n\t\tdeplines = depstr.gsub(\"\\\\\\n\", \" \").split(\"\\n\")\n\n\t\t#split each of these lines into an array of tokens, \n\t\t#yielding a 2-d token array\n\t\ttokens = deplines.map {|dl| dl.split(\" \")}\n\n\t\t#drop the colon on the first element of each token line, \n\t\t#it is <targetfile>:\n\t\ttokens.each {|ts| ts[0] = ts[0].chop()} \n\n\t\t#find the token line that starts with the target file we want\n\t\tdepfiles = Set.new() \n\t\ttokens.each do |tokenline|\n\t\t\tcand_target = tokenline.shift()\n\t\t\t#debug \"cand: #{cand_target}\"\n\t\t\t#debug \"target: #{target_file}\"\n\t\t\tif(target_file == cand_target)\n\t\t\t\tif(@useByteImpls && (target_file[-3,3] == 'cmo'))\n\t\t\t\t\timplsline = tokenline.map {|cmifn| changeExt(cmifn, 'cmo')}\n\t\t\t\t\timplsline.delete_if {|cmofn| cmofn == target_file}\n\t\t\t\t\tdepfiles.merge implsline\n\t\t\t\tend\n\t\t\t\tdepfiles.merge(tokenline)\n\t\t\tend\n\t\tend\n\t\texpandedSet = depfiles.map {|fn| File.expand_path(fn)}\n\t\t#debug \"ImmediateDeps:\"\n\t\t#debug setString(expandedSet)\n\t\treturn expandedSet\n\tend",
"def all_dependencies(targets)\n targets.to_h do |target|\n deps = target[:dependencies] || []\n deps = deps.delete_if { |dep| dep.include? '/' } # Remove subspecs\n [target[:name], deps]\n end\n end",
"def arduino_library_dependencies\n return [] unless library_properties?\n return [] if library_properties.depends.nil?\n\n library_properties.depends\n end",
"def dependent_files\n processed.map(&:abs_path).compact.select { |fn| File.exist?(fn) }\n end",
"def excluded_elements(used_elements)\n excluded = used_elements\n if exclude_dependent?\n excluded += used_elements.inject([]) {|m, elem| m += elem.dependencies; m}.flatten\n end\n excluded\n end",
"def outdatedness_reasons_for(obj)\n reasons = basic.outdatedness_status_for(obj).reasons\n if reasons.any?\n reasons\n elsif outdated_due_to_dependencies?(obj)\n [Reasons::DependenciesOutdated]\n else\n []\n end\n end",
"def dependencies\n if @options[:dependencies]\n deps = [] << @options[:dependencies]\n deps.flatten.collect { |item|\n item = File.join(item,'**/*') if File.directory?(item)\n Dir.glob item\n }.flatten.uniq.collect { |item|\n File.directory?(item) ? nil : item\n }.compact\n else\n false\n end\n end",
"def prune_dependencies\n class_names = @classes.map {|klass| klass.name}\n @classes.each do |klass|\n klass.dependencies = klass.dependencies.uniq.keep_if {|dep| class_names.include?(dep)}\n end\n end",
"def optional_dependencies\n optionals = parameters\n .select { |type, _name| type == OPTIONAL_ARG }\n .map(&:last)\n\n optionals - CONTEXT_DEPENDENCIES\n end",
"def dependencies\n spec.dependencies\n end",
"def dependencies\n spec.dependencies\n end",
"def still_used?(target, deleted: nil)\n modified_tree = @tree.tree.clone\n modified_tree.delete(deleted)\n\n deps_to_check = (@top_level - [Gem::Dependency.new(deleted)])\n\n while !deps_to_check.empty? do\n candidate = deps_to_check.pop.name\n\n next if candidate == deleted\n next if candidate == \"bundler\"\n return true if candidate == target\n\n if modified_tree[candidate].nil?\n warn_of_bad_tracing(candidate)\n else\n deps_to_check += modified_tree[candidate].dependencies\n end\n end\n\n false\n end",
"def get_user_deps(target)\n @user_deps[target]\n end",
"def calcDependencies(rootTargets)\n\t\t#(k,v) = (targetFilename, Set(neededTarget1, ... neededTargetN))\n\t\tdependencyHash = Hash.new()\n\n\t\tleafSet = Set.new()\n\n\t\t#targetFilenames that are part of some other target's dependencies, \n\t\t#but not yet visited and had their own dependencies added to dependencyHash\n\t\t#initialize to the main targets\n\t\tpendingTargets = Array.new()\n\t\tpendingTargets.concat(rootTargets.to_a)\n\n\t\tuntil (pendingTargets.empty?)\n\t\t\ttarget = pendingTargets.pop()\n\t\t\tdeps = calcImmediateDependencies(target)\n\t\t\tdependencyHash[target] = deps\n\t\t\tif(deps.empty?)\n\t\t\t\tleafSet << target\n\t\t\telse\n\t\t\t\tdeps.each do |dep|\n\t\t\t\t\tunless(pendingTargets.include?(dep) || \n\t\t\t\t\t\t\tdependencyHash.has_key?(dep))\n\t\t\t\t\t\tpendingTargets.push(dep)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\treturn [dependencyHash, leafSet]\n\tend",
"def runtime_dependencies\n @runtime_dependencies ||= []\n end",
"def runtime_dependencies\n @runtime_dependencies ||= []\n end",
"def direct_dependencies; end",
"def getWcfDependencies service\r\n deps = []\r\n Util.csprojs(service).each do |csproj|\r\n deps += getWcfDeps(csproj) \r\n end\r\n return deps.uniq\r\nend",
"def dependencies_have_failed?\n return @dependencies_have_failed unless @dependencies_have_failed.nil?\n failed = select do |task|\n task.failed?\n end\n debug \"Found failed dependencies: #{failed.map { |t| t.name }.join ', '}\" if failed.any?\n @dependencies_have_failed = failed.any?\n end",
"def requires\n sort!\n sources.map {|s| s.requires }.flatten - provides\n end",
"def check_dependencies\n fetch_module_dependencies.map do |dependency, constraint|\n dependency = dependency.sub('-', '/')\n current = dependency == @updated_module ? SemanticPuppet::Version.parse(@updated_module_version) : @forge.get_current_version(dependency)\n [dependency, constraint, current, constraint.include?(current)]\n end\n end",
"def dependencies( names )\n names.each do |name|\n if calculation = fetch( name, nil )\n calculation.dependencies.each do |dependency|\n names << dependency unless names.include?( dependency )\n end\n end\n end\n end",
"def dependencies\n return @dependencies unless @dependencies.nil?\n @dependencies = [ ]\n lockfile.each_line do |line|\n if line =~ /^\\s{4}([-\\w_.0-9]+)\\s*\\((.*)\\)/\n @dependencies << [$1, $2]\n end\n end\n @dependencies\n end",
"def validate_dependencies_are_present!\n if @podfile_dependency_cache.target_definition_list.all?(&:empty?)\n add_warning 'The Podfile does not contain any dependencies.'\n end\n end",
"def find_dependencies\n\t\tunless GEMDEPS_FILE.readable?\n\t\t\tself.prompt.warn \"Deps file (%s) is missing or unreadable, assuming no dependencies.\" %\n\t\t\t\t[ GEMDEPS_FILE ]\n\t\t\treturn []\n\t\tend\n\n\t\tfinder = Rake::DevEiate::GemDepFinder.new( GEMDEPS_FILE )\n\t\tfinder.load\n\t\treturn finder.dependencies\n\tend",
"def initial_dependencies\n []\n end",
"def dependencies( *args )\n names = args # note: for now assume all args are just names\n # e.g. 'pluto-models', 'pluto-update', etc.\n deps = @versions.select do |rec| names.include?( rec[0] ) end\n .map do |rec| [rec[0], rec[1]] end\n\n ## todo/fix: throw exception if dependency is missing!\n ## names.size == deps.size\n puts \"names.size == deps.size #{names.size} == #{deps.size}\"\n deps\n end",
"def get_unref_symbols\n unref = []\n @modules.each do |mod|\n mod.symbols.values.each do |s|\n unless s.referenced?\n unref << s.name\n end\n end\n end\n unref\n end",
"def getDeps csproj\r\n deps = []\r\n csproj.search(\"reference\") do |ref|\r\n deps << ref.get_attribute(\"include\").match(/^([^,]+),*/)[1]\r\n end\r\n return deps\r\nend",
"def dependent_gems(check_dev=true)\n out = []\n Gem::Specification.each do |spec|\n deps = check_dev ? spec.dependencies : spec.runtime_dependencies\n deps.each do |dep|\n if self.satisfies_requirement?(dep)\n sats = []\n find_all_satisfiers(dep) do |sat|\n sats << sat\n end\n out << [spec, dep, sats]\n end\n end\n end\n out\n end",
"def dependency_tags\n dep_tags = tags.select { |t| t =~ DependencyPrefix }\n return dep_tags.map { |t| t.sub(DependencyPrefix, '') }\n end",
"def dependency_backward_names\n names = []\n each_backward_dependency do |task|\n names << task.to_s\n end\n names.sort\n end",
"def dependencies_for(specification)\n specification.dependencies\n end",
"def dependencies; end",
"def dependencies; end",
"def dependencies; end",
"def get_dependencies(lib_path)\n\tdeps = []\n\tentry_name_regex = /(.*)\\(compatibility version.*\\)/\n\t`otool -L '#{lib_path}'`.strip.split(\"\\n\").each do |entry|\n\t\tmatch = entry_name_regex.match(entry)\n\t\tif (match)\n\t\t\tdep_path = match[1].strip\n\n\t\t\t# Note - otool lists dependencies separately for each architecture\n\t\t\t# in a universal binary - only return the unique paths\n\t\t\tdeps << dep_path if !deps.include?(dep_path)\n\t\tend\n\tend\n\treturn deps\nend",
"def get_dependencies(lib_path)\n\tdeps = []\n\tentry_name_regex = /(.*)\\(compatibility version.*\\)/\n\t`otool -L '#{lib_path}'`.strip.split(\"\\n\").each do |entry|\n\t\tmatch = entry_name_regex.match(entry)\n\t\tif (match)\n\t\t\tdep_path = match[1].strip\n\n\t\t\t# Note - otool lists dependencies separately for each architecture\n\t\t\t# in a universal binary - only return the unique paths\n\t\t\tdeps << dep_path if !deps.include?(dep_path)\n\t\tend\n\tend\n\treturn deps\nend",
"def dependencies\n self.class.dependencies\n end",
"def test_no_build_deps\n c = Control.new(__method__)\n c.parse!\n assert_equal(nil, c.source.fetch('build-depends', nil),\n \"Found a build dep #{c.source.fetch('build-depends', nil)}\")\n end",
"def missing_dev_deps_for(gem)\n # Same note as in #missing_deps_for above\n gem.dev_deps.select { |dep| build_requirements_for_gem(dep.name).empty? }\n end",
"def missing_deps_for(gem)\n # Comparison by name here assuming if it is in existing spec,\n # spec author will have ensured versions are correct for their purposes\n gem.deps.select { |dep| requirements_for_gem(dep.name).empty? }\n end",
"def find_non_local_dependencies(deps, verbose)\n search_list = Array(deps)\n seen = []\n ret = {}\n\n until search_list.empty?\n name, version = search_list.shift\n next if seen.include?(name)\n seen << name\n\n package_root = locate_local_package(name)\n if package_root\n pkg = BPM::Package.new(package_root)\n pkg.load_json\n\n unless satisfied_by?(version, pkg.version)\n raise LocalPackageConflictError.new(pkg.name, version, pkg.version)\n end\n\n search_list += Array(pkg.dependencies)\n search_list += Array(pkg.dependencies_development)\n search_list += Array(pkg.dependencies_build)\n else\n ret[name] = version\n end\n end\n\n ret\n end",
"def getdeps(pkg)\n deps = []\n @pkg.each {|k, v| deps << k if v.include?(pkg) }\n\n return deps\n end",
"def dependencies\n cached_dependencies\n .reject { |d| ignored?(d) }\n .each { |d| add_additional_terms_from_configuration(d) }\n end",
"def lookup_direct_dependencies!(source)\n return [] unless source\n\n source.dependencies.map do |dependency|\n result = provides_tree.glob(\"/#{dependency}\")\n if (!result || (result.is_a?(Array) && result.empty?))\n Jsus.logger.warn \"#{source.filename} is missing #{dependency.is_a?(SourceFile) ? dependency.filename : dependency.to_s}\"\n end\n result\n end.flatten.map {|tag| lookup(tag) }\n end"
] | [
"0.75177723",
"0.7088838",
"0.6891703",
"0.68696356",
"0.6738311",
"0.6725072",
"0.66946477",
"0.66920424",
"0.6681482",
"0.6672426",
"0.66719073",
"0.6666976",
"0.66294324",
"0.6573338",
"0.65641856",
"0.65641856",
"0.65641856",
"0.65641856",
"0.6527892",
"0.64535195",
"0.64527726",
"0.64282703",
"0.6411801",
"0.6382588",
"0.6344923",
"0.6323369",
"0.62908447",
"0.6236199",
"0.6210768",
"0.6208544",
"0.6208544",
"0.62081146",
"0.62002254",
"0.62002254",
"0.62002254",
"0.6198422",
"0.61947805",
"0.6193955",
"0.6180373",
"0.6156686",
"0.61552745",
"0.6152104",
"0.6152104",
"0.6152104",
"0.61471975",
"0.61376345",
"0.6125456",
"0.61228544",
"0.6119168",
"0.6100676",
"0.609191",
"0.6079707",
"0.60698575",
"0.6042543",
"0.60357547",
"0.6025861",
"0.5989511",
"0.5989385",
"0.59662914",
"0.5964308",
"0.59570056",
"0.5935454",
"0.5930957",
"0.59125954",
"0.59125954",
"0.59087455",
"0.59032613",
"0.5900803",
"0.589416",
"0.589416",
"0.5882888",
"0.58651865",
"0.5855412",
"0.5855115",
"0.5850089",
"0.58449876",
"0.58377385",
"0.58294326",
"0.5806637",
"0.57999724",
"0.5798915",
"0.57893944",
"0.5786254",
"0.57846576",
"0.5782815",
"0.57789534",
"0.57751423",
"0.57663655",
"0.57663655",
"0.57663655",
"0.5752489",
"0.5751612",
"0.5717742",
"0.57169455",
"0.5715433",
"0.57135224",
"0.57124156",
"0.571042",
"0.5706019",
"0.5702508"
] | 0.7489569 | 1 |
Removed the unused target dependencies on the target. | def remove_unused_dependencies
# puts 'removing unused dependencies list.'
dependencies = @target.dependencies
dependencies.each do |dependency|
dependency.remove_from_project if unused_dependencies_list.include? dependency.display_name
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_dependencies\n raise 'Not implemented'\n end",
"def prune_dependencies\n class_names = @classes.map {|klass| klass.name}\n @classes.each do |klass|\n klass.dependencies = klass.dependencies.uniq.keep_if {|dep| class_names.include?(dep)}\n end\n end",
"def remove_from_dependencies\n dependencies.each do |dependency|\n dependency.dependents.delete(self)\n end\n dependencies.clear\n end",
"def remove_duplicate_dependencies(installer)\n \n applicationTargets = [\n 'Pods-Base-Project',\n ]\n libraryTargets = [\n 'Pods-AnalyticsManager',\n ]\n\n embedded_targets = installer.aggregate_targets.select { |aggregate_target|\n libraryTargets.include? aggregate_target.name\n }\n embedded_pod_targets = embedded_targets.flat_map { |embedded_target| embedded_target.pod_targets }\n host_targets = installer.aggregate_targets.select { |aggregate_target|\n applicationTargets.include? aggregate_target.name\n }\n\n # We only want to remove pods from Application targets, not libraries\n host_targets.each do |host_target|\n host_target.xcconfigs.each do |config_name, config_file|\n host_target.pod_targets.each do |pod_target|\n if embedded_pod_targets.include? pod_target\n pod_target.specs.each do |spec|\n if spec.attributes_hash['ios'] != nil\n frameworkPaths = spec.attributes_hash['ios']['vendored_frameworks']\n else\n frameworkPaths = spec.attributes_hash['vendored_frameworks']\n end\n if frameworkPaths != nil\n frameworkNames = Array(frameworkPaths).map(&:to_s).map do |filename|\n extension = File.extname filename\n File.basename filename, extension\n end\n frameworkNames.each do |name|\n puts \"Removing #{name} from OTHER_LDFLAGS of target #{host_target.name}\"\n config_file.frameworks.delete(name)\n end\n end\n end\n end\n end\n xcconfig_path = host_target.xcconfig_path(config_name)\n config_file.save_as(xcconfig_path)\n end\n end\n\nend",
"def clean()\n\t\tSystem::clean target()\n\tend",
"def clean()\n\t\tSystem::clean target()\n\tend",
"def remove\n unrealize\n remove_from_dependencies\n remove_from_dependents\n end",
"def enabled_dependencies\n @dependencies.reject(&:ignore?)\n end",
"def delete_all_targets\n\t\tTarget.delete_all\n\tend",
"def RemoveObsoleteResolvables\n Builtins.y2milestone(\"--------- removing obsolete selections ---------\")\n\n # this removes only information about selections and applied patches\n # it doesn't remove any package\n Builtins.y2milestone(\n \"Removing all information about selections and patches in %1\",\n Installation.destdir\n )\n Pkg.TargetStoreRemove(Installation.destdir, :selection)\n\n # disabled by FATE #301990, bugzilla #238488\n # Pkg::TargetStoreRemove (Installation::destdir, `patch);\n\n Builtins.y2milestone(\"--------- removing obsolete selections ---------\")\n\n nil\n end",
"def clean(*includes)\n Rake.application.IncludeCleanTargets(includes)\n end",
"def excluded_deps\n missing_deps_for(upstream_gem)\n end",
"def remove_dependencies(package_names, verbose=false)\n\n hard_deps = dependencies.dup\n old_deps = build_local_dependency_list(false)\n\n package_names.each do |pkg_name|\n raise \"'#{pkg_name}' is not a dependency\" if hard_deps[pkg_name].nil?\n hard_deps.delete pkg_name\n end\n\n @dependencies = hard_deps\n rebuild_dependency_list hard_deps, verbose\n\n old_deps.each do |dep|\n next if local_deps.find { |pkg| (pkg.name == dep.name) && (pkg.version == dep.version) }\n say \"Removed package '#{dep.name}' (#{dep.version})\"\n end\n\n save!\n\n end",
"def reset\n @dependencies_are_ready = nil\n @dependencies_have_failed = nil\n reset_forward\n end",
"def clean()\n rels = releases()\n rels.pop()\n\n unless rels.empty?\n rm = ['rm', '-rf'].concat(rels.map {|r| release_dir(r)})\n rm << release_dir('skip-*')\n cmd.ssh(rm)\n end\n end",
"def remove_from_dependents\n dependents.each do |dependent|\n dependent.dependencies.delete(self)\n end\n former_dependents = dependents.dup\n dependents.clear\n propagate_remove(former_dependents)\n end",
"def clean\n build addl_cmake_bld_args: '--target clean'\n end",
"def no_project_dependencies\n @project_dependencies = false\n end",
"def remove_package_deps(pkg_name)\n if @index[:packages].key?(pkg_name) &&\n !@index[:packages][pkg_name].empty?\n @index[:packages][pkg_name].each do |dep|\n @index[:deps][dep].delete(pkg_name)\n end\n end\n end",
"def cleanup_nontarget_files\n\n delete_dir = File.expand_path(File.join(app.build_dir, 'Resources/', 'Base.lproj/', 'assets/', 'images/'))\n\n puts_blue \"Cleaning up excess image files from target '#{options.Target}'\"\n puts_red \"Images for the following targets are being deleted from the build directory:\"\n\n (options.Targets.keys - [options.Target]).each do |target|\n\n puts_red \"#{target.to_s}\"\n Dir.glob(\"#{delete_dir}/**/#{target}-*.{jpg,png,gif}\").each do |f|\n puts_red \" Deleting #{File.basename(f)}\"\n File.delete(f)\n end\n end\n\n puts_red \"\\nImages prefixed all- are being deleted if a corresponding #{options.Target}- exists.\"\n\n Dir.glob(\"#{delete_dir}/**/all-*.{jpg,png,gif}\").each do |f|\n if File.exist?( f.sub(\"all-\", \"#{options.Target}-\") )\n puts_red \" Deleting #{File.basename(f)}\"\n File.delete(f)\n end\n end\n\n\n end",
"def unused_dependencies_list\n imports = all_unique_imports.map { |import| import.split.last }\n dependency_list - imports\n end",
"def clear_targets\n @builder_sets.clear\n end",
"def delete_all\n target.clear\n end",
"def delete_all_targets\n\t\tWmapTarget.delete_all\n\tend",
"def orphan_tasks\n each_task.reject do |task|\n task.dependency_backward_any? or task.dependency_forward_any?\n end\n end",
"def remove()\n CCProcess.start(\"sdk-manage --target --remove '#{@name}'\", (_ :removing_target) + \" #{@name}\", 60*15)\n @@targets.delete(@name)\n end",
"def skipDeps(deps) \n deps = deps.select { |ding| !ding.include?(\"/commons-cli\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-logging\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-lang-2.1\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-pool\") }\n return deps\nend",
"def clear_dependencies\n if self == ActiveRecord::Base.acl_manager.initial_destroy\n ActiveRecord::Base.acl_manager.destroy_pool = []\n ActiveRecord::Base.acl_manager.initial_destroy = nil\n end\n end",
"def remove_dependencies(dependencies: required(\"dependencies\"), options: {}, **data)\n with_params = data.merge(dependencies: dependencies).reject { |_,v| v.nil? || Array(v).empty? }\n Collection.new(parse(client.post(\"/tasks/#{gid}/removeDependencies\", body: with_params, options: options)), type: self.class, client: client)\n end",
"def remove_nim_resources\n Log.log_info('In remove_nim_resources')\n @targets.each do |target|\n Log.log_debug('target=' + target)\n nim_lpp_source_resource = get_flrtvc_name(:NIM_res, target)\n exists = Nim.lpp_source_exists?(nim_lpp_source_resource)\n Log.log_debug('exists=' +\n exists.to_s)\n if exists\n Nim.remove_lpp_source(nim_lpp_source_resource)\n Log.log_debug('Removing NIM resource ' +\n nim_lpp_source_resource)\n else\n Log.log_debug('Already removed NIM resource ' +\n nim_lpp_source_resource)\n end\n end\n end",
"def configure_phase\n self.project.targets.each do |target|\n begin\n phase = target.sources_build_phase\n next unless phase\n rescue NoMethodError\n next\n end\n\n \n bundle = target.copy_bundle_recources\n\n # remove zombie build files\n phase.files_references.each do |file|\n begin\n file.real_path\n rescue\n phase.files.each do |build_file|\n phase.files.delete(build_file) if build_file.file_ref == file\n end\n end\n end\n \n # remove zombie bundle files\n bundle.files_references.each do |file|\n begin\n file.real_path\n rescue\n bundle.files.each do |bundle_file|\n bundle.files.delete(bundle_file) if bundle_file.file_ref == file\n end\n end\n end\n\n removings = [] # name of seeds going to be removed from the target\n addings = [] # name of seeds going to be added to the target\n\n self.targets.keys.sort.each do |seed_name|\n target_names = self.targets[seed_name]\n if not target_names.include?(target.name)\n removings << seed_name if not removings.include?(seed_name)\n else\n addings << seed_name if not addings.include?(seed_name)\n end\n end\n\n\n self.file_references.each do |file|\n\n removings.each do |seed_names|\n next if not seed_names.include?(file.parent.name)\n \n bundle.files.each do |bundle_file|\n bundle.files.delete(bundle_file) if bundle_file.file_ref == file \n end\n \n phase.files.each do |build_file|\n phase.files.delete(build_file) if build_file.file_ref == file\n end\n end\n\n addings.each do |seed_names|\n next if file.name.end_with? \".h\"\n next if not seed_names.include?(file.parent.name)\n uuid = Xcodeproj::uuid_with_name \"#{target.name}:#{file.name}\"\n \n if self.seeds[seed_names].resources.any? { |s| file.name.end_with? s }\n bundle.add_file_reference_with_uuid(file, uuid, true)\n else \n phase.add_file_reference_with_uuid(file, uuid, true)\n end\n\n end\n end\n end\n end",
"def target_exclude_files() = ['terraform.tfstate']",
"def remove_files_we_dont_need\n say 'Remove files we don\\'t need'\n build :remove_public_index\n build :remove_readme_rdoc\n end",
"def clear\n lazy_load # lazy load so that targets are always orphaned\n super\n end",
"def clear\n lazy_load # lazy load so that targets are always orphaned\n super\n end",
"def unrealize_dependents\n dependents.each do |dependents|\n dependents.unrealize\n end\n end",
"def clean_pod_sources\n return unless installation_options.clean?\n return if installed_specs.empty?\n pod_installers.each(&:clean!)\n end",
"def destroy_dependents\n @old_namings.each do |naming|\n naming.observation = nil # (tells it not to recalc consensus)\n naming.destroy\n end\n end",
"def clean!\n Cleaner.remove_package(package)\n end",
"def no_nuget_dependencies\n @nuget_dependencies = false\n end",
"def unload_target!\n listeners_for(:before_load_target).each(&:before_load_target)\n clear_dynamic_resources\n clear_dynamic_resources(:static)\n Origen::Pins.clear_pin_aliases\n $dut = nil\n end",
"def remove_has_target_statements\n remove_predicate_and_its_object_statements RDF::Vocab::OA.hasTarget\n end",
"def remove_target(target)\n @cache[\"targets\"].delete(target)\n end",
"def destroy_dependents\n self.clouds.each do |cloud| cloud.destroy end\n self.groups.each do |group| group.destroy end\n self.roles.each do |role| role.destroy end\n self.recipes.each do |recipe| recipe.destroy end\n self.questions.each do |question| question.destroy end\n end",
"def remove_materialized_artifacts\n Dir.glob(\"#{Terraspace.cache_root}/**/*\").each do |path|\n next unless within_env?(path)\n next if path.include?(\".tfstate\")\n FileUtils.rm_f(path) if File.file?(path)\n end\n end",
"def pkg_clean\n sysprint \"#{@name} clean\"\n\n FileUtils::rm_rf(@objdir, :secure => true)\n end",
"def clear_ignored\n invalidate_ignored_package_names\n ignored_packages.clear\n end",
"def forget_dependencies_for(object)\n @graph.delete_edges_to(object)\n end",
"def exclude_dependencies!(exclusions)\n included, excluded = dependencies.partition { |d| !exclusions.include? d.name }\n self.dependencies = included\n excluded\n end",
"def remove_copy_xcframeworks_script_phase_from_target(native_target)\n remove_script_phase_from_target(native_target, COPY_XCFRAMEWORKS_PHASE_NAME)\n end",
"def destroy_all\n objs = target\n source.update_attribute(source_attribute, nil)\n objs.each(&:destroy)\n end",
"def remove_structure\n rm_rf target_dir\n end",
"def cleanup_packages\n print_result do\n cleanup_packages_in\n end\n end",
"def unbuild(verbose=false)\n say \"Removing stale assets...\" if verbose\n\n pipeline = BPM::Pipeline.new self\n asset_root = File.join root_path, 'assets'\n pipeline.buildable_assets.each do |asset|\n next if asset.logical_path =~ /^bpm_/\n asset_path = File.join asset_root, asset.logical_path\n next unless File.exists? asset_path\n say \"~ Removing #{asset.logical_path}\" if verbose\n FileUtils.rm asset_path\n\n # cleanup empty directories\n while !File.exists?(asset_path)\n asset_path = File.dirname asset_path\n FileUtils.rmdir(asset_path) if File.directory?(asset_path)\n if verbose && !File.exists?(asset_path)\n say \"~ Removed empty directory #{File.basename asset_path}\"\n end\n end\n end\n\n say \"\\n\" if verbose\n end",
"def reset\n @targets_run = [ ]\n end",
"def kernel_clean\n rm_f Dir[\"**/*.rbc\",\n \"**/.*.rbc\",\n \"kernel/**/signature.rb\",\n \"spec/capi/ext/*.{o,sig,#{$dlext}}\",\n \"runtime/**/load_order.txt\",\n \"runtime/platform.conf\"],\n :verbose => $verbose\nend",
"def forget_removed\n action = branch_merge ? :remove : :forget\n working_changeset.deleted.each do |file|\n act action, file unless target_changeset[file]\n end\n\n unless branch_merge\n working_changeset.removed.each do |file|\n forget file unless target_changeset[file]\n end\n end\n end",
"def delete_all\n objs = target\n source.update_attribute(source_attribute, nil)\n objs.each(&:delete)\n end",
"def excluded_dev_deps\n missing_dev_deps_for(upstream_gem)\n end",
"def propagate_remove(former_dependents)\n former_dependents.each do |former_dependent|\n former_dependent.remove\n end\n end",
"def dependencies\n to_a.reject { |a| a.filename.eql?(self.filename) }\n end",
"def delete_packages\n return unless ask_confirmation\n\n delete_libvirt_pool\n delete_vagrant_plugins\n delete_terraform\n @dependency_manager.delete_dependencies\n end",
"def dependencies\n @target_dependencies + (@parent ? @parent.dependencies : [])\n end",
"def ending_tasks\n each_task.reject do |task|\n task.dependency_forward_any?\n end\n end",
"def remove_from_project\n build_files.each(&:remove_from_project)\n super\n end",
"def remove_dead_symlinks\n base_paths.each do |path|\n command = \"find #{path} -xtype l -delete\"\n Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)\n end\n end",
"def delete_unused_associations_files\n _delete_unused_associations_file(@unused_associations_coverage_file)\n _delete_unused_associations_file(@unused_associations_file)\n end",
"def reset_target_buffer\n @buffer_targets = false\n @targets = []\n end",
"def resolve_dependencies\n _pt_resolve_dependencies\n\n puts \"plugin hook after resolve_dependencies\"\n\n pt_internal = PT_internal.instance\n\n\n specifications = analysis_result.specifications\n specs_to_modify = specifications.select do |s|\n pt_internal.l_names_using_binary.index(s.name)\n end\n\n specs_to_modify.map do |s|\n # :exclude_files has no getter\n exclude_files = [s.attributes_hash[\"exclude_files\"]]\n\n s.exclude_files = [exclude_files, PT::EXCLUDE_SOURCE_PATTERN].flatten\n\n s.subspecs.each do |subs|\n exclude_files = [subs.attributes_hash[\"exclude_files\"]]\n subs.exclude_files = [exclude_files, PT::EXCLUDE_SOURCE_PATTERN].flatten\n end\n\n end\n end",
"def remove_remaining_project_group_links\n source_project.reset.project_group_links.destroy_all # rubocop: disable DestroyAll\n end",
"def starting_tasks\n each_task.reject do |task|\n task.dependency_backward_any?\n end\n end",
"def process_project_dependencies\n BRIX11.log_warning(\"missing #process_project_dependencies implementation for #{self.to_s}\")\n end",
"def linkDepsOrdered()\n\t\ttempLinkDeps = BuildEnv::allLinkDepsOrdered(target()) - targets().to_a #in correct order for the link line\n\t\t#remove project-internal static libs; since the object files we need are in our list anyway, we never need to include intlibs in executables\n\t\tfinalLinkDeps = tempLinkDeps.select {|entity| BuildEnv::entityTypeSafe(entity)[0] != :intlib}\n\t\treturn finalLinkDeps\n\tend",
"def reset_forward\n return unless dependency_forward_any?\n each_forward_dependency do |task|\n task.reset\n end\n end",
"def delete_all_dependency(id, dependant)\n id = id.object_id unless id.kind_of?(Integer)\n method = method.intern unless method.kind_of?(Integer)\n for assoc in @dependency[id]\n\tassoc.delete_if do\n\t |d, m, *o|\n\t d == dependant\n\tend\n\t@dependency.delete(id) if assoc.empty?\n end\n end",
"def nuke(project_id)\n remove_all_tasks(project_id)\n remove_all_columns(project_id)\n end",
"def calcImmediateDependencies(target_file)\n\t\tsrc_file = targetToSource(target_file)\n\t\tdepstr = case @compiler\n\t\t\twhen @@byteCodeCompiler \n\t\t\t\t`ocamldep #{@includesString} #{src_file}` \n\t\t\twhen @@machineCodeCompiler\n\t\t\t\t`ocamldep -native #{@includesString} #{src_file}` \n\t\t\telse \n\t\t\t\tputs \"ERROR couldn't compile to file: \" + target\n\t\tend\n\t\t#debug \"\\n*\\n*\\n\" + depstr\n\n\t\t#make an array of lines, where each line is a complete \n\t\t#\"<target>: <dep1> <dep2>\" sequence\n\t\tdeplines = depstr.gsub(\"\\\\\\n\", \" \").split(\"\\n\")\n\n\t\t#split each of these lines into an array of tokens, \n\t\t#yielding a 2-d token array\n\t\ttokens = deplines.map {|dl| dl.split(\" \")}\n\n\t\t#drop the colon on the first element of each token line, \n\t\t#it is <targetfile>:\n\t\ttokens.each {|ts| ts[0] = ts[0].chop()} \n\n\t\t#find the token line that starts with the target file we want\n\t\tdepfiles = Set.new() \n\t\ttokens.each do |tokenline|\n\t\t\tcand_target = tokenline.shift()\n\t\t\t#debug \"cand: #{cand_target}\"\n\t\t\t#debug \"target: #{target_file}\"\n\t\t\tif(target_file == cand_target)\n\t\t\t\tif(@useByteImpls && (target_file[-3,3] == 'cmo'))\n\t\t\t\t\timplsline = tokenline.map {|cmifn| changeExt(cmifn, 'cmo')}\n\t\t\t\t\timplsline.delete_if {|cmofn| cmofn == target_file}\n\t\t\t\t\tdepfiles.merge implsline\n\t\t\t\tend\n\t\t\t\tdepfiles.merge(tokenline)\n\t\t\tend\n\t\tend\n\t\texpandedSet = depfiles.map {|fn| File.expand_path(fn)}\n\t\t#debug \"ImmediateDeps:\"\n\t\t#debug setString(expandedSet)\n\t\treturn expandedSet\n\tend",
"def remove_dependency_group!\n @dependency_groups.pop\n end",
"def uninstall_children! options={}\n return unless @dependency_lib\n\n options = options.dup\n\n @children.each do |dep|\n options.delete(:remove_children) unless\n options[:remove_children] == :recursive\n\n @dependency_lib.get(dep, options).uninstall!(options)\n end\n end",
"def clean_remote\n to_delete = remote_assets - local_compiled_assets\n to_delete.each do |f|\n delete_remote_asset(bucket.files.get(f))\n end\n end",
"def still_used?(target, deleted: nil)\n modified_tree = @tree.tree.clone\n modified_tree.delete(deleted)\n\n deps_to_check = (@top_level - [Gem::Dependency.new(deleted)])\n\n while !deps_to_check.empty? do\n candidate = deps_to_check.pop.name\n\n next if candidate == deleted\n next if candidate == \"bundler\"\n return true if candidate == target\n\n if modified_tree[candidate].nil?\n warn_of_bad_tracing(candidate)\n else\n deps_to_check += modified_tree[candidate].dependencies\n end\n end\n\n false\n end",
"def uninstall(assets); end",
"def purge_nested_form\n self.target_hostnames.find_all{|r| r.marked_for_destruction?}.each do |c|\n c.delete\n end\n end",
"def clean\n #rm_r(srcdir)\n rm_r(blddir)\n #rm_r(libdir)\n end",
"def preclean_project\n # Clean-up non-useful files (if any)\n clean_msg = `make clean 2>&1`\n @log_file.puts \"\\nNettoyage du répertoire :\\n\\n#{clean_msg}\"\n \n # I want to be sure...\n FileUtils::rm_f Dir.glob(\"*.o\")\n FileUtils::rm_f Dir.glob(\"*~\")\n end",
"def no_arc_files(target_name)\n source_files(target_name) do |file|\n has_compiler_flag(file, '-fno-objc-arc')\n end\n end",
"def remove_packaging(model)\n Logger.info \"Cleaning up the temporary files...\"\n FileUtils.rm_rf(File.join(Config.tmp_path, model.trigger))\n end",
"def IncludeCleanTargets(*includes)\n @ProjectFileLoader.CurrentlyLoadedProjectFile().CleanList.include(includes)\n end",
"def depends(target, *user_deps)\n if target.is_a?(Builder)\n target = target.target\n end\n target = expand(target.to_s)\n user_deps = user_deps.map do |ud|\n if ud.is_a?(Builder)\n ud = ud.target\n end\n expand(ud)\n end\n @user_deps[target] ||= []\n @user_deps[target] = (@user_deps[target] + user_deps).uniq\n build_after(target, user_deps)\n end",
"def remove_target\n options[:remove_target]\n end",
"def get_dependencies(_fidl, _interaction_types, _project_dependencies)\n # noop\n end",
"def excluded_elements(used_elements)\n excluded = used_elements\n if exclude_dependent?\n excluded += used_elements.inject([]) {|m, elem| m += elem.dependencies; m}.flatten\n end\n excluded\n end",
"def clear\n return self if length.zero? # forces load_target if it hasn't happened already\n\n if @reflection.options[:dependent] && @reflection.options[:dependent] == :destroy\n destroy_all\n else \n delete_all\n end\n\n @owner.send(:cache_write, @reflection, self) if @reflection.options[:cached]\n\n self\n end",
"def destroy\n FileUtils.rm_rf(target)\n end",
"def dependencies\n EMPTY_SET\n end",
"def doNotifyFutureRemove(sourceComp,targetComp,rootTx,depMgr)\n logger = depMgr.logger\n hostComp = depMgr.compObj.identifier\n port = depMgr.compObj.componentVersionPort\n key = hostComp + \":\" + port.to_s\n logger.debug \"#{hostComp}.vc.doNotifyFutureRemove #{sourceComp} --> #{targetComp} rootTx: #{rootTx}\"\n \n inDepRegistry = depMgr.inDepRegistry\n inDepRegistry.removeDependence(FUTURE_DEP, rootTx, sourceComp, targetComp)\n logger.debug \"#{hostComp} after removeDep(Future) , inDepRegistry = #{inDepRegistry}\"\n \n txDepRegistry = NodeManager.instance.getTxDepMonitor(key).txDepRegistry\n \n result = removeFutureEdges4(targetComp,rootTx,depMgr,txDepRegistry)\n result \n end",
"def remove_embed_frameworks_script_phase_from_target(native_target)\n remove_script_phase_from_target(native_target, EMBED_FRAMEWORK_PHASE_NAME)\n end",
"def all_dependencies(targets)\n targets.to_h do |target|\n deps = target[:dependencies] || []\n deps = deps.delete_if { |dep| dep.include? '/' } # Remove subspecs\n [target[:name], deps]\n end\n end",
"def cleanup_oldies\n debug_msg \"Removing old builds\"\n to_remove = []\n @builds.simple_builds.each do |build|\n current = nil\n build.versioned_builds.sort.each do |versioned|\n to_remove << current if current && current.same_minor?(versioned)\n current = versioned\n end\n end\n to_remove.each do |build|\n debug_msg \" - #{build}\"\n FileUtils.rm_rf File.join(@public_dir, build.to_s)\n end\n @builds.merged_builds.each do |merged|\n to_remove.each do |build|\n if merged.include? build\n debug_msg \" - #{merged}\"\n FileUtils.rm_rf File.join(@public_dir, merged.to_s) \n end\n end\n end\n \n end",
"def clear_exclude\n @exclude_patterns = []\n calculate_exclude_regexp if ! @pending\n end"
] | [
"0.6889047",
"0.6659218",
"0.6656846",
"0.653687",
"0.647297",
"0.647297",
"0.63622",
"0.6326725",
"0.6312936",
"0.6293903",
"0.62418056",
"0.62074286",
"0.61986613",
"0.6183366",
"0.6173584",
"0.61659145",
"0.6149706",
"0.6058918",
"0.60501415",
"0.60405105",
"0.6039996",
"0.60279554",
"0.60116255",
"0.59728134",
"0.59500486",
"0.5947637",
"0.58850867",
"0.58660233",
"0.583699",
"0.58285093",
"0.5818717",
"0.57988137",
"0.57881063",
"0.5769127",
"0.5769127",
"0.5748368",
"0.5746456",
"0.57450193",
"0.5743997",
"0.57394016",
"0.57326144",
"0.57238376",
"0.5706292",
"0.5664091",
"0.5656861",
"0.564974",
"0.5649146",
"0.5647964",
"0.5624543",
"0.56218433",
"0.56179893",
"0.55687094",
"0.5559678",
"0.55573434",
"0.5549524",
"0.5538022",
"0.5525346",
"0.5500642",
"0.54841983",
"0.5479931",
"0.54689676",
"0.5466288",
"0.5449904",
"0.5442255",
"0.5419502",
"0.54094386",
"0.5405398",
"0.5397537",
"0.53751886",
"0.5368106",
"0.5354554",
"0.53485835",
"0.5344756",
"0.5340931",
"0.5337979",
"0.5335553",
"0.5322211",
"0.5309221",
"0.53074473",
"0.52935606",
"0.52905697",
"0.5288851",
"0.52806365",
"0.5276373",
"0.52731323",
"0.527141",
"0.5261646",
"0.5261401",
"0.5244049",
"0.524332",
"0.5233686",
"0.52291614",
"0.5219459",
"0.5219148",
"0.5217328",
"0.52160794",
"0.5210729",
"0.5210492",
"0.52097154",
"0.52057296"
] | 0.85026187 | 0 |
Removes all the duplicate import statements from all the files linked to the target | def remove_duplicate_imports
files.each(&:remove_duplicate_imports)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_duplicate_imports\n duplicate_imports_mapping = duplicate_imports_info\n duplicate_imports = duplicate_imports_mapping.keys\n file_lines = IO.readlines(@path, chomp: true).select do |line|\n if duplicate_imports.include? line\n if duplicate_imports_mapping[line] <= 1\n line\n else\n duplicate_imports_mapping[line] = duplicate_imports_mapping[line] - 1\n nil\n end\n else\n line\n end\n end\n File.open(@path, 'w') do |file|\n file.puts file_lines\n end\n end",
"def all_unique_imports\n files.map(&:all_imports).flatten.uniq\n end",
"def files_with_duplicate_imports\n files.select(&:has_duplicate_import?)\n end",
"def clear\n @autoloaded_classes.to_a.reverse_each do |klass|\n RubyCodeAutoreloader::ClassLoader.remove_constant(klass)\n @autoloaded_classes.delete(klass)\n end\n\n @existing_modules_before_load.clear\n @autoloaded_files = []\n ActiveSupport::DescendantsTracker.clear\n ActiveSupport::Dependencies.clear\n end",
"def tidy_up\n Dir[\"*nin\"].each do |file|\n File.delete(file)\n end\n Dir[\"*nhr\"].each do |file|\n File.delete(file)\n end\n Dir[\"*nsq\"].each do |file|\n File.delete(file)\n end\n Dir[\"*blast\"].each do |file|\n File.delete(file)\n end\n end",
"def clear_import_cache\n self.import_cache = {}\n self.import_errors = false\n end",
"def fix_imports\n reload_config\n eslint_result = run_eslint_command\n\n return if eslint_result.empty?\n\n unused_variables = {}\n undefined_variables = Set.new\n\n eslint_result.each do |line|\n match = REGEX_ESLINT_RESULT.match(line)\n next unless match\n if match[:type] == 'is defined but never used'\n unused_variables[match[:variable_name]] ||= Set.new\n unused_variables[match[:variable_name]].add match[:line].to_i\n else\n undefined_variables.add match[:variable_name]\n end\n end\n\n return if unused_variables.empty? && undefined_variables.empty?\n\n old_imports = find_current_imports\n\n # Filter out unused variables that do not appear within the imports block.\n unused_variables.select! do |_, line_numbers|\n any_numbers_within_range?(line_numbers, old_imports[:range])\n end\n\n new_imports = old_imports[:imports].clone\n new_imports.delete_variables!(unused_variables.keys)\n\n undefined_variables.each do |variable|\n js_module = find_one_js_module(variable)\n next unless js_module\n new_imports << js_module.to_import_statement(variable, @config)\n end\n\n replace_imports(old_imports[:range], new_imports)\n end",
"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",
"def delete_all\n @loaded_constants.each do |const_name|\n if Object.const_defined?(const_name)\n Object.send(:remove_const, const_name)\n end\n end\n Ichiban::HTMLCompiler::Context.clear_user_defined_helpers\n end",
"def remove_moved_files\n scan_for_merges.each do |file|\n if File.amp_lexist?(@repo.working_join(file))\n UI.debug(\"removing #{file}\")\n File.unlink(@repo.working_join(file))\n end\n end\n end",
"def remove_unused_dependencies\n # puts 'removing unused dependencies list.'\n dependencies = @target.dependencies\n dependencies.each do |dependency|\n dependency.remove_from_project if unused_dependencies_list.include? dependency.display_name\n end\n end",
"def clear_all\n clear_modules\n end",
"def disable_imports_from(name)\n Autoproj.workspace.manifest.disable_imports_from(name)\nend",
"def clear_import_errors!\n update!(import_errors: nil)\n end",
"def delete_unused_associations_files\n _delete_unused_associations_file(@unused_associations_coverage_file)\n _delete_unused_associations_file(@unused_associations_file)\n end",
"def cleanup\n reshaper_orig_cleanup\n\n # remove some unwanted pages\n pages.delete_if do |page|\n path = page.destination(source)\n path =~ /shared\\/layouts/ or\n path =~ /shared\\/includes/\n end\n\n # remove some unwanted static files\n static_files.delete_if do |file|\n file.path =~ /shared\\/includes/ or\n file.path =~ /\\.styl$/ or # stylus files should be generated into site.css\n file.path =~ /readme\\./ # readme files are for github\n end\n\n end",
"def remove_non_base_statements\n remove_has_target_statements\n remove_has_body_statements\n end",
"def remove_jcl_over_slf\n dir_glob = Dir.glob(File.join @app_dir, 'WEB-INF', 'lib', 'jcl-over-slf4*.jar')\n dir_glob.each do |f|\n File.delete f\n end\n end",
"def remove_python_compiled_files path\n logger.debug(\"Now removing python object and compiled files from the virtualenv\")\n Find.find(path) do |path|\n if path.end_with? '.pyc' or path.end_with? '.pyo'\n FileUtils.rm path\n end\n end\n end",
"def reshuffle_jars()\n FileUtils.mkdir_p(\"#{self.build_dir()}/src/edit-webapp/WEB-INF/lib/\")\n FileUtils.cp(Dir[\"#{UcbDeployer::RESOURCES_DIR}/soulwing-casclient-*\"],\n \"#{self.build_dir()}/src/edit-webapp/WEB-INF/lib/\")\n # These have been placed in $CATALINA_HOME/lib\n [\"mail\", \"activation\", \"javamail\", \"commons-logging\", \"log4j\"].each do |jar|\n FileUtils.rm_rf(Dir[\"#{self.build_dir()}/src/webapp/WEB-INF/lib/#{jar}-*\"])\n end\n end",
"def clean_arb_named_files(src)\n\n clean_list = $config[\"clean\"][\"remove_named\"].split(/,/)\n\n Find.find(src) do |path|\n next if File.basename(path) =~ /^\\._/\n clean_list.each do |name|\n next if path !~ /#{name}\\./\n FileUtils.rm(path,$options) if File.exists? path\n end\n\n end\nend",
"def prune_dependencies\n class_names = @classes.map {|klass| klass.name}\n @classes.each do |klass|\n klass.dependencies = klass.dependencies.uniq.keep_if {|dep| class_names.include?(dep)}\n end\n end",
"def unused_dependencies_list\n imports = all_unique_imports.map { |import| import.split.last }\n dependency_list - imports\n end",
"def resolve_conflict(files)\n filename = files\n .map {|f| f['path']}\n .sort\n .first\n puts %[rm \"#{filename}\"]\nend",
"def merge(import_statement)\n if import_statement.default_import &&\n @default_import != import_statement.default_import\n @default_import = import_statement.default_import\n clear_import_string_cache\n end\n\n if import_statement.named_imports?\n @named_imports ||= []\n original_named_imports = @named_imports.clone\n @named_imports.concat(import_statement.named_imports)\n @named_imports.sort!.uniq!\n clear_import_string_cache if original_named_imports != @named_imports\n end\n\n if @declaration_keyword != import_statement.declaration_keyword\n @declaration_keyword = import_statement.declaration_keyword\n clear_import_string_cache\n end\n end",
"def fix_import(version_name, file)\n tempfile = file + '.tmp'\n outfile = File.new(tempfile, 'w')\n File.open(file, 'r') do |infile|\n infile.each do |line|\n if (line =~ /require.*Service.*\\.rb/)\n outfile << line.gsub(/require '(.*)Service(.*)\\.rb'/,\n \"require 'adwords4r/#{version_name}/\\\\1Service\\\\2'\")\n else\n outfile << line\n end\n end\n end\n outfile.close\n File.rename(tempfile, file)\nend",
"def clear_ignored\n invalidate_ignored_package_names\n ignored_packages.clear\n end",
"def remove_old_package\n template_files.clear\n test_cases.clear\n self.import_job = nil\n end",
"def remove_dead_symlinks\n base_paths.each do |path|\n command = \"find #{path} -xtype l -delete\"\n Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)\n end\n end",
"def remove_files_we_dont_need\n say 'Remove files we don\\'t need'\n build :remove_public_index\n build :remove_readme_rdoc\n end",
"def clear_exclusions\n automatic_exclusions.clear\n manifest_exclusions.clear\n end",
"def clean(*includes)\n Rake.application.IncludeCleanTargets(includes)\n end",
"def remove_classes_and_modules\n initialize_classes_and_modules\n end",
"def strip_require(file)\n output = ''\n File.foreach(file) do |line|\n output << line unless line =~ /require ('|\")ruby2d('|\")/\n end\n return output\nend",
"def strip_require(file)\n output = ''\n File.foreach(file) do |line|\n output << line unless line =~ /require ('|\")ruby2d('|\")/\n end\n return output\nend",
"def remove_duplicate_dependencies(installer)\n \n applicationTargets = [\n 'Pods-Base-Project',\n ]\n libraryTargets = [\n 'Pods-AnalyticsManager',\n ]\n\n embedded_targets = installer.aggregate_targets.select { |aggregate_target|\n libraryTargets.include? aggregate_target.name\n }\n embedded_pod_targets = embedded_targets.flat_map { |embedded_target| embedded_target.pod_targets }\n host_targets = installer.aggregate_targets.select { |aggregate_target|\n applicationTargets.include? aggregate_target.name\n }\n\n # We only want to remove pods from Application targets, not libraries\n host_targets.each do |host_target|\n host_target.xcconfigs.each do |config_name, config_file|\n host_target.pod_targets.each do |pod_target|\n if embedded_pod_targets.include? pod_target\n pod_target.specs.each do |spec|\n if spec.attributes_hash['ios'] != nil\n frameworkPaths = spec.attributes_hash['ios']['vendored_frameworks']\n else\n frameworkPaths = spec.attributes_hash['vendored_frameworks']\n end\n if frameworkPaths != nil\n frameworkNames = Array(frameworkPaths).map(&:to_s).map do |filename|\n extension = File.extname filename\n File.basename filename, extension\n end\n frameworkNames.each do |name|\n puts \"Removing #{name} from OTHER_LDFLAGS of target #{host_target.name}\"\n config_file.frameworks.delete(name)\n end\n end\n end\n end\n end\n xcconfig_path = host_target.xcconfig_path(config_name)\n config_file.save_as(xcconfig_path)\n end\n end\n\nend",
"def remove_nodoc_children\n prefix = self.full_name + '::'\n\n modules_hash.each_key do |name|\n full_name = prefix + name\n modules_hash.delete name unless @store.modules_hash[full_name]\n end\n\n classes_hash.each_key do |name|\n full_name = prefix + name\n classes_hash.delete name unless @store.classes_hash[full_name]\n end\n end",
"def merge(srcfs)\n @fs.merge!( srcfs.fs )\n @fs = Cleanfs.killdupl(@@loader.source,@fs,srcfs.fs)\n end",
"def purgeFiles\n Dir[\"#{@pagespath}/*\"].reject{ |f| f[\"#{@pagespath}/.keep\"] }.each do |filename|\n File.delete filename\n end\n\n Dir[\"#{@assetpath}/*\"].reject{ |f| f[\"#{@pagespath}/.keep\"] }.each do |filename|\n File.delete filename\n end\n end",
"def referenced_modules\n # TODO: check content type before scanning\n content.scan(/\\s*(include|extend)\\s+([A-Za-z0-9_\\.]*)/).map { |_, m| m }.uniq\n end",
"def unmerge(*files)\n files.each do |f|\n f = check_for_file(f)\n @unmerged << f\n end\n end",
"def force_load_set\n each_module { |name, mod| }\n end",
"def remove_all_static_forwardings\n super\n end",
"def remove_virus_affected_file()\n @import.destroy\n end",
"def remove_unloadable_constants!\n log(\"removing unloadable constants\")\n autoloaded_constants.each { |const| remove_constant const }\n autoloaded_constants.clear\n Reference.clear!\n explicitly_unloadable_constants.each { |const| remove_constant const }\n end",
"def initialize_clean\n self.clean_globs ||= %w[diff diff.txt TAGS ri deps .source_index\n *.gem **/*~ **/.*~ **/*.rbc]\n end",
"def delete_coffeescript source_path\n if not File.exists?(File.dirname(File.expand_path(source_path, __FILE__)))\n return\n end\n \n generated_directory = File.dirname(File.expand_path(source_path, __FILE__))\n Dir.foreach(generated_directory) do |file|\n if file != generated_directory && file == '.' && file == '..'\n if File.directory?(file)\n FileUtils.rm_rf(file)\n else\n FileUtils.rm(file)\n end\n end\n end\n end",
"def update_extends\n extends.reject! do |ext|\n mod = ext.module\n\n !(String === mod) && @store.modules_hash[mod.full_name].nil?\n end\n\n extends.uniq!\n end",
"def process (file, original_path =nil)\n log \"-- #{file} ...\"\n for import in get_imports(file) do\n path = import.to_s\n unless path.start_with?(\"/usr/lib/\") || path.start_with?(\"/System/\")\n dst = copy_lib(import, (original_path || file))\n unless dst.absolute?\n dst = '@loader_path/' + dst.relative_path_from(file.dirname).to_s\n end\n change_import(file.to_s, import.to_s, dst.to_s)\n end\n end\n log \"\\tend #{file}\"\nend",
"def clean_arb_dot_files(src)\n clean_list = $config[\"clean\"][\"remove_extentions\"].split(/,/)\n\n Find.find(src) do |path|\n next if File.basename(path) =~ /^\\._/\n clean_list.each do |ext|\n next if path !~ /\\.#{ext}/\n FileUtils.rm(path,$options) if File.exists? path\n end\n\n end\nend",
"def configure_phase\n self.project.targets.each do |target|\n begin\n phase = target.sources_build_phase\n next unless phase\n rescue NoMethodError\n next\n end\n\n \n bundle = target.copy_bundle_recources\n\n # remove zombie build files\n phase.files_references.each do |file|\n begin\n file.real_path\n rescue\n phase.files.each do |build_file|\n phase.files.delete(build_file) if build_file.file_ref == file\n end\n end\n end\n \n # remove zombie bundle files\n bundle.files_references.each do |file|\n begin\n file.real_path\n rescue\n bundle.files.each do |bundle_file|\n bundle.files.delete(bundle_file) if bundle_file.file_ref == file\n end\n end\n end\n\n removings = [] # name of seeds going to be removed from the target\n addings = [] # name of seeds going to be added to the target\n\n self.targets.keys.sort.each do |seed_name|\n target_names = self.targets[seed_name]\n if not target_names.include?(target.name)\n removings << seed_name if not removings.include?(seed_name)\n else\n addings << seed_name if not addings.include?(seed_name)\n end\n end\n\n\n self.file_references.each do |file|\n\n removings.each do |seed_names|\n next if not seed_names.include?(file.parent.name)\n \n bundle.files.each do |bundle_file|\n bundle.files.delete(bundle_file) if bundle_file.file_ref == file \n end\n \n phase.files.each do |build_file|\n phase.files.delete(build_file) if build_file.file_ref == file\n end\n end\n\n addings.each do |seed_names|\n next if file.name.end_with? \".h\"\n next if not seed_names.include?(file.parent.name)\n uuid = Xcodeproj::uuid_with_name \"#{target.name}:#{file.name}\"\n \n if self.seeds[seed_names].resources.any? { |s| file.name.end_with? s }\n bundle.add_file_reference_with_uuid(file, uuid, true)\n else \n phase.add_file_reference_with_uuid(file, uuid, true)\n end\n\n end\n end\n end\n end",
"def purge_output\n Dir.glob dir(\"output/**/*\") do |item|\n next if File.directory? item\n File.delete item unless @touchedfiles.include? undir(item)\n end\n end",
"def process_exclusions(globs); end",
"def run\n require 'find'\n\n # Get compiled files\n # FIXME: requires #build_reps to have been called\n all_raw_paths = site.compiler.reps.map(&:raw_path)\n compiled_files = all_raw_paths.flatten.compact.select { |f| File.file?(f) }\n\n # Get present files and dirs\n present_files = []\n present_dirs = []\n Find.find(site.config[:output_dir] + '/') do |f|\n present_files << f if File.file?(f)\n present_dirs << f if File.directory?(f)\n end\n\n # Remove stray files\n stray_files = (present_files - compiled_files)\n stray_files.each do |f|\n next if filename_excluded?(f)\n delete_file(f)\n end\n\n # Remove empty directories\n present_dirs.reverse_each do |dir|\n next if Dir.foreach(dir) { |n| break true if n !~ /\\A\\.\\.?\\z/ }\n next if filename_excluded?(dir)\n delete_dir(dir)\n end\n end",
"def tidy\n # project_root: /tmp/jets/demo/stage/code/\n # /tmp/jets/demo/stage/code/bundled\n tidy_gems(\"#{@options[:project_root]}/bundled/gems/ruby/*/gems/*\")\n tidy_gems(\"#{@options[:project_root]}/bundled/gems/ruby/*/bundler/gems/*\")\n end",
"def remove_unimported_pages\n end",
"def patch_facets\n cp_r Dir.glob('lib/{core,more}/*'), 'lib'\n rm_r Dir.glob('lib/{core,more}')\n end",
"def cleanup_nontarget_files\n\n delete_dir = File.expand_path(File.join(app.build_dir, 'Resources/', 'Base.lproj/', 'assets/', 'images/'))\n\n puts_blue \"Cleaning up excess image files from target '#{options.Target}'\"\n puts_red \"Images for the following targets are being deleted from the build directory:\"\n\n (options.Targets.keys - [options.Target]).each do |target|\n\n puts_red \"#{target.to_s}\"\n Dir.glob(\"#{delete_dir}/**/#{target}-*.{jpg,png,gif}\").each do |f|\n puts_red \" Deleting #{File.basename(f)}\"\n File.delete(f)\n end\n end\n\n puts_red \"\\nImages prefixed all- are being deleted if a corresponding #{options.Target}- exists.\"\n\n Dir.glob(\"#{delete_dir}/**/all-*.{jpg,png,gif}\").each do |f|\n if File.exist?( f.sub(\"all-\", \"#{options.Target}-\") )\n puts_red \" Deleting #{File.basename(f)}\"\n File.delete(f)\n end\n end\n\n\n end",
"def redo_include_and_extend\n reinclude + reextend\n end",
"def remove_from_project\n build_files.each(&:remove_from_project)\n super\n end",
"def prune_duplicate_patterns(song)\n pattern_replacements = determine_pattern_replacements(song.patterns)\n\n # Update flow to remove references to duplicates\n new_flow = song.flow\n pattern_replacements.each do |duplicate, replacement|\n new_flow = new_flow.map do |pattern_name|\n (pattern_name == duplicate) ? replacement : pattern_name\n end\n end\n song.flow = new_flow\n\n # This isn't strictly necessary, but makes resulting songs easier to read for debugging purposes.\n song.remove_unused_patterns\n\n song\n end",
"def remove_superfluous_destination_files\n # join mirror_file and dest_file and delete everything from dest_file which isn't in mirror_file\n # because mirror_file should represent the current state of the source mogile files\n Log.instance.info('Joining destination and mirror tables to determine files that have been deleted from source repo.')\n DestFile.where('mirror_file.dkey IS NULL').joins('LEFT OUTER JOIN mirror_file ON mirror_file.dkey = file.dkey').find_in_batches(batch_size: 1000) do |batch|\n batch.each do |file|\n # Quit if program exit has been requested.\n break if SignalHandler.instance.should_quit\n\n # Delete all files from our destination domain which no longer exist in the source domain.\n begin\n Log.instance.debug(\"key [ #{file.dkey} ] should not exist. Deleting.\")\n @dest_mogile.delete(file.dkey)\n @removed += 1\n @freed_bytes += file.length\n rescue => e\n @failed += 1\n Log.instance.error(\"Error deleting [ #{file.dkey} ]: #{e.message}\\n#{e.backtrace}\")\n end\n end\n\n # Print a summary to the user.\n summarize\n\n # Quit if program exit has been requested.\n return true if SignalHandler.instance.should_quit\n end\n end",
"def reset_file_whitelist\n @file_whitelist.clear\n @file_whitelist.include_all_files = true\n end",
"def unreference_source_files\n set_reference_source_file(@encoding_job, false)\n redirect_to play_encoding_job_path(@encoding_job)\n end",
"def cleanup_unused_schemas!\n schemas_string = JSON.generate(schemas)\n used_references = schemas_string.scan(/\\{\\\"\\$ref\\\":\\\"#\\/components\\/schemas\\/(.*?)\\\"/).flatten.uniq\n existing_references = schemas.keys.select { |x| x.include?(\"Reference\") }\n unused_references = existing_references - used_references\n\n schemas.except!(*unused_references)\n end",
"def unique_modules\n @unique_modules\n end",
"def clear_shared_folders\n end",
"def clean\n disable_referential_integrity do\n tables_cache.keys.reverse_each do |table|\n ActiveRecord::Base.connection.execute %(\n DELETE FROM #{table}\n )\n end\n end\n end",
"def clean_paths\n cached_used = used_files\n glob_options = File::FNM_DOTMATCH | File::FNM_CASEFOLD\n files = Pathname.glob(root + \"**/*\", glob_options).map(&:to_s)\n\n files.reject! do |candidate|\n candidate = candidate.downcase\n candidate.end_with?('.', '..') || cached_used.any? do |path|\n path = path.downcase\n path.include?(candidate) || candidate.include?(path)\n end\n end\n files\n end",
"def remove_jekyll_assets(files)\n files.each {|f| f.remove_jekyll_asset }\n end",
"def reload_asset_classes\n list = [:Asset, :AssetPublic, :AssetPrivate]\n list.each do |sym|\n Object.send(:remove_const, sym)\n end\n list.each do |sym|\n Object.send(:load, sym.to_s.underscore)\n end\n\n end",
"def unique_classes_and_modules\n @unique_classes + @unique_modules\n end",
"def clean_referenced_patterns\n refs = [:referenced_patterns]\n # refs << :referenced_subroutine_patterns if Origen.tester.v93k?\n refs.each do |ref|\n var = send(ref)\n var = var.uniq.map do |pat|\n pat = pat.sub(/\\..*/, '')\n pat unless pat =~ /_part\\d+$/\n end.uniq.compact\n singleton_class.class_variable_set(\"@@#{ref}\", var)\n end\n end",
"def force_load_set\n\t\teach_module { |name, mod|\n\t\t}\n\tend",
"def finalize!\n all_files.each { |f| Kernel.require f } if eager_load\n all_files.clear\n self\n end",
"def delete_all\n target.clear\n end",
"def clobber\n rm_r(srcdir)\n rm_r(blddir)\n rm_r(libdir)\n rm_r(config_file)\n end",
"def clear_ignore_patterns\n\t@exclude_patterns = [ /^$/ ]\n end",
"def has_duplicate_import?\n duplicate_imports_info.length > 0\n end",
"def rails_mark_classes_for_reload\n ActiveSupport::DescendantsTracker.clear\n ActiveSupport::Dependencies.clear\n end",
"def delete_all_files\n @import.delete_all_files\n head :no_content\n end",
"def cleanup(file)\n Dir.glob(@options[:output].sub(/\\./, '*')).each do |item|\n if File.basename(item) != File.basename(file)\n info \"Stitch \" + \"deleted \".red + item.sub(\"#{Dir.pwd}/\", '')\n FileUtils.rm(item)\n @deleted << item\n end\n end\n end",
"def unmodulize_modules(*mod_consts)\n mod_consts.each { |mod_const| unmodulize *(mod_const.instance_methods) }\n end",
"def IncludeCleanTargets(*includes)\n @ProjectFileLoader.CurrentlyLoadedProjectFile().CleanList.include(includes)\n end",
"def temporarily_merge_migration_files(explanation=nil)\n copy_files = []\n Rails.application.config.paths[\"db/migrate\"].expanded.each do |specified_migration_dir|\n if migrations_dir.to_s != specified_migration_dir\n Dir[File.join(specified_migration_dir, '*')].each do |file_name|\n copy_files.push([file_name, migrations_dir.join(File.basename(file_name)).to_s])\n end\n end\n end\n if explanation && copy_files.any?\n puts \"SequelRails: Detected migration files outside of the main db/migrate directory. Copying them to db/migrate temporarily to #{explanation}:\"\n copy_files.each { |o, _| puts \" - #{o}\"}\n end\n copy_files.each { |original, destination| FileUtils.cp(original, destination) }\n yield\n ensure\n copy_files.each { |_, destination| FileUtils.rm_f(destination) }\n end",
"def load_imports\n while fn = @pending_imports.shift\n next if @imported.member?(fn)\n ext = File.extname(fn)\n loader = @loaders[ext] || @default_loader\n loader.load(fn)\n @imported << fn\n end\n end",
"def reset_package_sets\n @package_sets.clear\n end",
"def preclean_project\n # Clean-up non-useful files (if any)\n clean_msg = `make clean 2>&1`\n @log_file.puts \"\\nNettoyage du répertoire :\\n\\n#{clean_msg}\"\n \n # I want to be sure...\n FileUtils::rm_f Dir.glob(\"*.o\")\n FileUtils::rm_f Dir.glob(\"*~\")\n end",
"def clear_ignore_patterns\n @exclude_patterns = [ /^$/ ]\n end",
"def without_duplicates(bindings); end",
"def clean(paths)\n paths.uniq!\n paths.compact!\n populate_test_files\n paths = paths.select { |p| test_file?(p) }\n clear_tests_files_list\n paths\n end",
"def isolate_constants\n existing_constants = Object.constants\n yield\nensure\n (Object.constants - existing_constants).each do |constant|\n Object.send(:remove_const, constant)\n end\nend",
"def isolate_constants\n existing_constants = Object.constants\n yield\nensure\n (Object.constants - existing_constants).each do |constant|\n Object.send(:remove_const, constant)\n end\nend",
"def clear\n @include = []\n @exclude = []\n @sources = FileList[]\n @mapper = Mapper.new\n self\n end",
"def clobber(*includes)\n Rake.application.IncludeClobberTargets(includes)\n end",
"def delete_all\n objs = target\n source.update_attribute(source_attribute, nil)\n objs.each(&:delete)\n end",
"def all_files_except_git\n Dir.glob('*', File::FNM_DOTMATCH).delete_if { |file| file =~ /\\A\\.{1,2}\\z|\\A\\.git\\z/ }\n end",
"def reset_gem_specs!\n return unless Gem.loaded_specs.keys.include?('locomotivecms_wagon')\n\n core_gems = %w(did_you_mean).freeze\n\n Gem.loaded_specs.values.each do |spec|\n next if core_gems.include?(spec.name)\n spec.full_require_paths.each do |path|\n $LOAD_PATH.delete(path)\n end\n\n # Without this statement, bundler will raise the infamous \"You have already activated ...\"\n Gem.loaded_specs.delete(spec.name)\n end\nend",
"def cleanup_packages\n print_result do\n cleanup_packages_in\n end\n end",
"def clear_diff_cache\n if Dor::Config.stacks.local_workspace_root.nil?\n raise ArgumentError, 'Missing Dor::Config.stacks.local_workspace_root' \n end\n druid = DruidTools::Druid.new(self.pid, Dor::Config.stacks.local_workspace_root)\n diff_pattern = File.join(druid.temp_dir, DIFF_FILENAME + '.*')\n FileUtils.rm_f Dir.glob(diff_pattern)\n end"
] | [
"0.6893452",
"0.67451614",
"0.6592932",
"0.60712755",
"0.60682005",
"0.59842294",
"0.5977443",
"0.5866538",
"0.5861052",
"0.5858443",
"0.58310634",
"0.58169115",
"0.578584",
"0.57832396",
"0.5782469",
"0.5743226",
"0.572319",
"0.5685762",
"0.56426513",
"0.56395173",
"0.56240135",
"0.5604043",
"0.55993277",
"0.5598189",
"0.55951893",
"0.55675995",
"0.5562231",
"0.55611426",
"0.5554449",
"0.5518762",
"0.54848313",
"0.546097",
"0.5435284",
"0.54234064",
"0.54234064",
"0.537309",
"0.5370196",
"0.53635496",
"0.5359933",
"0.534741",
"0.53457534",
"0.53451216",
"0.53408235",
"0.5322057",
"0.531557",
"0.5307003",
"0.5306532",
"0.52861446",
"0.5281732",
"0.52794075",
"0.5277482",
"0.52743393",
"0.52736974",
"0.5273279",
"0.52608705",
"0.524123",
"0.5223744",
"0.52133",
"0.5206534",
"0.5185641",
"0.51823336",
"0.51808226",
"0.51807463",
"0.51773936",
"0.51680577",
"0.51664793",
"0.5166416",
"0.5163947",
"0.5162241",
"0.5155485",
"0.5154358",
"0.5149765",
"0.5127184",
"0.5122608",
"0.51197433",
"0.511073",
"0.51061034",
"0.5105054",
"0.5103887",
"0.5094525",
"0.5083455",
"0.50831896",
"0.5080406",
"0.50792617",
"0.50769705",
"0.50732124",
"0.5063911",
"0.5061497",
"0.50534534",
"0.5051952",
"0.50477767",
"0.50432885",
"0.50432885",
"0.50349957",
"0.50344956",
"0.5030887",
"0.5024552",
"0.50170237",
"0.5014603",
"0.50133127"
] | 0.83346874 | 0 |
GET /businessbooks GET /businessbooks.json | def index
@businessbooks = Businessbook.search(params[:search]).paginate(:per_page => 18, :page => params[:page])
respond_to do |format|
format.html # index.html.erb
format.json { render :json => @businessbooks }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @businessbook = Businessbook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @businessbook }\n end\n end",
"def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend",
"def index\n @books = Book.all\n render json: @books\n end",
"def list_books\n books = Book.all\n \n if books.count > 0\n render json: books\n else\n render json: {e:\"No books added\"}, :status => :error\n end\n end",
"def index\n @bookings = Booking.all\n\n render json: @bookings\n end",
"def index\n @books = Book.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"def index\n @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @bookings }\n end\n end",
"def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end",
"def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end",
"def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end",
"def index\n @books = Book.find_all_by_user_id(current_user)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n end",
"def book\n @book = Book.published.find(params[:id])\n render json: @book\n end",
"def index\n @book_pages = @book.book_pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @book_pages }\n end\n end",
"def index\n @user_books = UserBook.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_books }\n end\n end",
"def new\n @businessbook = Businessbook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @businessbook }\n end\n end",
"def get_book(search)\n\trequest_string = \"https://www.googleapis.com/books/v1/volumes?q=#{search.gsub(\" \",\"+\")}\"\n\t\n\tsample_uri = URI(request_string) #opens a portal to the data at that link\n\tsample_response = Net::HTTP.get(sample_uri) #go grab the data in the portal\n\tsample_parsedResponse = JSON.parse(sample_response) #makes data easy to read\n\tsample_parsedResponse[\"items\"]\nend",
"def index\n @cookbooks = Cookbook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cookbooks }\n end\n end",
"def index\n books = current_user.books.all\n render json: { books: books }\n end",
"def get_books(response)\n response[\"items\"]\nend",
"def index\n @service_bookings = ServiceBooking.all\n\n render json: @service_bookings\n end",
"def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end",
"def get_address_books\n self.class.get('https://api.yesgraph.com/v0/address-books', :headers => @options)\n end",
"def index\n @user_businesses = Business.where({user_id: current_user.id})\n render json: JSONAPI::Serializer.serialize(@user_businesses, is_collection: true)\n end",
"def index\n bookings = Booking.all\n\n if bookings\n render json: { status: 'SUCCESS', message: 'Successfuly got all bookings', data: bookings }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Something went wrong' }, status: :unprocessable_entity\n end\n end",
"def index\n @bookings = Booking.all.map { |b| [b, b.contact, b.persons.first] }\n respond_to do |format|\n format.html\n format.json { render json: @bookings }\n end\n end",
"def index\r\n @books = Book.paginate(:page => params[:page], :per_page => 30)\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @books }\r\n end\r\n end",
"def index\n @books = @collection.books\n #original: @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"def index\n @businesses = Business.all.offset(offset).limit(limit)\n render json: @businesses\n end",
"def index\n @books = []\n if (params[:q])\n @books = Book.where(params[:q])\n end\n render :json => @books\n end",
"def get_books()\n @books_out\n end",
"def get_books()\n @books_out\n end",
"def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end",
"def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend",
"def show\n @library_book = LibraryBook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @library_book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n\n format.json { render json: @book }\n end\n end",
"def index\n respond_with Biblebook.all\n end",
"def index\n @books = Book.order('created_at DESC').page(params[:page]).per_page(10).search(params[:search], params[:id])\n respond_to do |format|\n format.json\n format.html\n end\n end",
"def show\n @business = Business.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business }\n end\n end",
"def show\n @business = Business.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business }\n end\n end",
"def show\n @business = Business.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business }\n end\n end",
"def index\n if current_user\n @books = current_user.books\n render json: @books, status: 201\n end\n end",
"def index\n @books = Book.get_avaible_books\n end",
"def fetch_book_info\n url = \"#{BASE_URL}/#{book_id}\"\n resp = RestClient::Request.execute(url: url, method: \"GET\")\n resp_obj = JSON.parse(resp)\n\n {\n id: book_id,\n title: resp_obj[\"volumeInfo\"][\"title\"],\n author: resp_obj[\"volumeInfo\"][\"authors\"][0],\n image: resp_obj[\"volumeInfo\"][\"imageLinks\"] ? resp_obj[\"volumeInfo\"][\"imageLinks\"][\"thumbnail\"] : DEFAULT_IMAGE\n }\n end",
"def show\n render json: @api_book\n end",
"def index\n authorize! :query, Book\n @books = Book.order(:title)\n respond_to do |format|\n format.html\n format.json {render text: @books.to_json}\n format.xml {render text: @books.to_xml}\n end\n end",
"def index\n @bookings = Booking.all\n respond_with(@bookings)\n end",
"def index\n response = RestClient.get 'http://api.bitvalor.com/v1/order_book.json'\n data = JSON.parse(response.body)[\"bids\"]\n @fox = data.select {|element| element[0] == \"FOX\"}\n @b2u = data.select {|element| element[0] == \"B2U\"}\n @mbt = data.select {|element| element[0] == \"MBT\"}\n end",
"def index\n @books = Book.extended_details\n\n render json: @books.as_json(\n only: [:id, :title, :author, :created_at, :total_income_cents, :copies_count, :remaining_copies_count, :loaned_copies_count]\n )\n end",
"def index\n @books = Book.all\n do_response @books\n #\n #respond_to do |format|\n # format.html # index.html.erb\n #format.json { render :json => @books }\n #end\n end",
"def fetch_books(term)\n response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{term}\")\n\n JSON.parse(response.body)\nend",
"def show\n render json: @book\n end",
"def index\n @title = \"List Books\"\n @books = Book.paginate :page=>params[:page], :per_page => 100, :order => 'title'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"def get_brandings\n request :get, \"/v3/brandings.json\"\n end",
"def fetch_books(term)\n response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{term}\")\n\n JSON.parse(response.body)\n end",
"def book\n fetch('harry_potter.books')\n end",
"def get_user_books\n user = User.find_by_id(params[:user_id])\n shelves = user.bookshelves\n \n @books = Array.new\n \n shelves.each do |s|\n s.books.each do |book|\n @books << book\n end\n end\n \n #books = Book.where(user_id: params[:user_id])\n \n render json: @books\n end",
"def index\n # @bookings = Booking.all\n begin\n @response = Booking.get_bookings\n rescue RestClient::Exception => exception\n @error = exception.response\n end\n # binding.pry\n end",
"def business(business_id)\n url = \"#{API_HOST}#{BUSINESS_PATH}#{business_id}\"\n\n response = HTTP.auth(\"Bearer #{API_KEY}\").get(url)\n response.parse\n end",
"def show\n render json: @business\n end",
"def index\n if params[:book_id]\n @book = Book.find(params[:book_id])\n recipes = @book.recipes\n render json: RecipeSerializer.new(recipes).to_serialized_json\n else \n recipes = Recipe.all.order(:name)\n render json: RecipeSerializer.new(recipes).to_serialized_json\n end\n end",
"def search\n book = Book.new(params)\n render json: book.search\n end",
"def order_book(params)\n Client.current.get(\"#{resource_url}/book\", params)\n end",
"def business(business_id)\n begin\n get_hash_by_object(@client.business(business_id))\n rescue Exception => e\n {:application_code => 400}\n end\n end",
"def index\n @resumes = Resume.where(:book_id => params[:book_id])\n\n render json: @resumes\n end",
"def show\n\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def index\n render json: { bookings: @site.bookings.order(datetime: :asc) }, status: 200\n end",
"def index\n @rulebooks = Rulebook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rulebooks }\n end\n end",
"def index\n @bids = Bid.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bids }\n end\n end",
"def index\n @bookmarks = Bookmark.all\n render json: { bookmarks: @bookmarks }, status: :ok\n end",
"def all_booking_of_client\n\t\t@bookings = Booking.where(client_id: params[:client_id])\n\t\trender json: @bookings, status: 200\n\tend",
"def index\n @kbs = Kb.search(params[:q]).page(params[:page]).order(\"id desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @kbs }\n end\n end",
"def index\n\t\tif (params[:data] != nil)\n\t\t\t@book = Book.new\n\t\t\t@client = Goodreads::Client.new(api_key: \"rSkvvZY8Wx27zcj4AfHA\", api_secret: \"S5WOpmY8pVtaEu1IwNn51DBafjoEIbjuxZdE6sNM\")\n\t\t\t@search = @client.search_books(params[:data])\n\t\t\t#@search = @client.search_books(\"the lord of the rings\")\n\t\t\t@results = @search.results.work\n\t\t\t#https://image.tmdb.org/t/p/w300_and_h450_bestv2\n\t\tend\n\n @books = Book.all\n end",
"def show\n @book = Book.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def index\n @bobs = Bob.paginate(:page => params[:page], :order => 'created_at DESC',:per_page => 30)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bobs }\n end\n end",
"def show\n @booking = Booking.find(params[:id])\n render json: @booking\nend",
"def index\n @borrowed_books = BorrowedBook.all\n end",
"def index\n @borrowed_books = BorrowedBook.all\n end",
"def index\n @borrowed_books = BorrowedBook.all\n end",
"def show\r\n @book = Book.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @book }\r\n end\r\n end",
"def show\n @bb = Bb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bb }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @book }\n end\n end",
"def get_bib(bibnum)\n cbn = clean_bibnum(bibnum)\n if cbn.empty?\n Rails.logger.error \"ERROR: OpacRecordService#get_bib called with invalid bib number #{bibnum}\"\n raise InvalidOpacRecordNumber, 'invalid bib number'\n else\n begin\n response = token.get(\"#{@path}/bibs/#{cbn}\")\n rescue OAuth2::Error => e\n Rails.logger.error \"ERROR: OpacRecordService#get_bib #{e}\"\n raise OpacConnectionError, 'error connecting or authenticating with the opac'\n else\n # It may seem like we should just return the unparsed (json) body, since\n # the controller will pull from here and then need to turn it into json again.\n # But I expect to do lots of data processing here in /services; therefore\n # controller should expect the hash and convert it back to json for consumption.\n response.parsed\n end\n end\n end",
"def getbatteries\n puts params\n buildid = params[\"buildingid\"]\n\n batteries = Battery.where(:building_id => buildid)\n\n puts batteries.inspect\n puts \"#################################################\"\n \n respond_to do |format|\n format.json { render json: batteries }\n end\n end",
"def get_book_with_api(title)\n uri = URI.parse(URI.encode(\"https://www.googleapis.com/books/v1/volumes?q=#{title}\"))\n service = Books::ApiConnectService.new(uri)\n book_response = service.execute[\"items\"].first[\"volumeInfo\"]\n .select{ |key, value| key == \"title\" || key == \"description\" || key == \"publisher\" || key == \"publishedDate\" || key == \"imageLinks\"}\n @book_info_hash = book_response.inject({}) do |hash, (key, value)|\n if key.underscore == \"image_links\"\n hash[key.underscore] = book_response[\"imageLinks\"][\"smallThumbnail\"]\n else\n hash[key.underscore] = value\n end\n hash\n end\n end",
"def call(params)\n @books = BookRepository.all\n self.body = JSON.dump(@books)\n end",
"def index\n @bids = Bid.where(\"auction_id = ?\", params[:auction_id])\n\n render json: @bids\n end",
"def index\n render jsonapi: Book.search(params), include: [:genre, :author, :libraries]\n end",
"def get_book( book_id )\n response = if book_id.to_s.length >= 10\n Amazon::Ecs.item_lookup( book_id, :id_type => 'ISBN', :search_index => 'Books', \n :response_group => 'Large,Reviews,Similarities,AlternateVersions' )\n else\n Amazon::Ecs.item_lookup( book_id, :response_group => 'Large,Reviews,Similarities' )\n end\n response.items.each do |item|\n binding = item.get('ItemAttributes/Binding')\n next if binding.match(/Kindle/i)\n return Book.new( item )\n end\n return nil\n end",
"def show\n find_book(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end"
] | [
"0.7298897",
"0.70421624",
"0.695971",
"0.69306314",
"0.68328303",
"0.67693084",
"0.672795",
"0.66955805",
"0.66766506",
"0.66766506",
"0.66766506",
"0.6676336",
"0.6658967",
"0.6612253",
"0.6606977",
"0.6593214",
"0.65840733",
"0.6574277",
"0.65341747",
"0.6504094",
"0.6503924",
"0.6502345",
"0.64988303",
"0.64973944",
"0.64881",
"0.64696425",
"0.6466241",
"0.6450122",
"0.64476514",
"0.64202905",
"0.64031476",
"0.64031476",
"0.64026123",
"0.6395031",
"0.6381604",
"0.63670367",
"0.63656306",
"0.63651216",
"0.63566357",
"0.63566357",
"0.63566357",
"0.63415724",
"0.63328743",
"0.63266206",
"0.63233435",
"0.6323085",
"0.63214254",
"0.6317602",
"0.6304725",
"0.63029003",
"0.63001114",
"0.63000244",
"0.6284426",
"0.62842894",
"0.62740487",
"0.62551135",
"0.6251548",
"0.6239166",
"0.6227559",
"0.621918",
"0.62106735",
"0.61991817",
"0.6191615",
"0.6178608",
"0.61732775",
"0.6167417",
"0.6167417",
"0.61669606",
"0.61669606",
"0.61669606",
"0.61669606",
"0.61669606",
"0.61669606",
"0.61669606",
"0.61669606",
"0.61669606",
"0.61644274",
"0.6160377",
"0.6157489",
"0.61565536",
"0.61498845",
"0.6142218",
"0.6132856",
"0.6116416",
"0.6113975",
"0.6106612",
"0.609963",
"0.609963",
"0.609963",
"0.60973233",
"0.60963887",
"0.6088893",
"0.60837317",
"0.60788554",
"0.60758996",
"0.606729",
"0.6064746",
"0.60559833",
"0.6053518",
"0.60425305"
] | 0.7229365 | 1 |
GET /businessbooks/1 GET /businessbooks/1.json | def show
@businessbook = Businessbook.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @businessbook }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend",
"def index\n @businessbooks = Businessbook.search(params[:search]).paginate(:per_page => 18, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @businessbooks }\n end\n end",
"def index\n @books = Book.all\n render json: @books\n end",
"def book\n @book = Book.published.find(params[:id])\n render json: @book\n end",
"def index\n @bookings = Booking.all\n\n render json: @bookings\n end",
"def index\n @books = Book.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"def index\n @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"def new\n @businessbook = Businessbook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @businessbook }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n\n format.json { render json: @book }\n end\n end",
"def show\n @business = Business.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business }\n end\n end",
"def show\n @business = Business.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business }\n end\n end",
"def show\n @business = Business.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business }\n end\n end",
"def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end",
"def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end",
"def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end",
"def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @bookings }\n end\n end",
"def index\n @cookbooks = Cookbook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cookbooks }\n end\n end",
"def list_books\n books = Book.all\n \n if books.count > 0\n render json: books\n else\n render json: {e:\"No books added\"}, :status => :error\n end\n end",
"def index\n @bookings = Booking.all.map { |b| [b, b.contact, b.persons.first] }\n respond_to do |format|\n format.html\n format.json { render json: @bookings }\n end\n end",
"def index\n @books = Book.find_all_by_user_id(current_user)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n end",
"def get_book(search)\n\trequest_string = \"https://www.googleapis.com/books/v1/volumes?q=#{search.gsub(\" \",\"+\")}\"\n\t\n\tsample_uri = URI(request_string) #opens a portal to the data at that link\n\tsample_response = Net::HTTP.get(sample_uri) #go grab the data in the portal\n\tsample_parsedResponse = JSON.parse(sample_response) #makes data easy to read\n\tsample_parsedResponse[\"items\"]\nend",
"def show\n @library_book = LibraryBook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @library_book }\n end\n end",
"def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end",
"def index\n @book_pages = @book.book_pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @book_pages }\n end\n end",
"def show\n @book = Book.find_by_sql(\"SELECT * FROM Books B WHERE B.id = \" + params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend",
"def show\n render json: @api_book\n end",
"def index\n @books = @collection.books\n #original: @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"def show\n @booking = Booking.find(params[:id])\n render json: @booking\nend",
"def index\n @service_bookings = ServiceBooking.all\n\n render json: @service_bookings\n end",
"def get_books(response)\n response[\"items\"]\nend",
"def fetch_book_info\n url = \"#{BASE_URL}/#{book_id}\"\n resp = RestClient::Request.execute(url: url, method: \"GET\")\n resp_obj = JSON.parse(resp)\n\n {\n id: book_id,\n title: resp_obj[\"volumeInfo\"][\"title\"],\n author: resp_obj[\"volumeInfo\"][\"authors\"][0],\n image: resp_obj[\"volumeInfo\"][\"imageLinks\"] ? resp_obj[\"volumeInfo\"][\"imageLinks\"][\"thumbnail\"] : DEFAULT_IMAGE\n }\n end",
"def show\r\n @book = Book.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @book }\r\n end\r\n end",
"def index\n @user_books = UserBook.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_books }\n end\n end",
"def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end",
"def show\n @bb = Bb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bb }\n end\n end",
"def show\n @book = Book.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def index\n @businesses = Business.all.offset(offset).limit(limit)\n render json: @businesses\n end",
"def index\r\n @books = Book.paginate(:page => params[:page], :per_page => 30)\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @books }\r\n end\r\n end",
"def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @book }\n end\n end",
"def show\n\t\t@booking = Booking.find(params[:id])\n\t\trender json: @booking, status: 200\n\tend",
"def show\n find_book(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"def show\n render json: @book\n end",
"def index\n @books = Book.extended_details\n\n render json: @books.as_json(\n only: [:id, :title, :author, :created_at, :total_income_cents, :copies_count, :remaining_copies_count, :loaned_copies_count]\n )\n end",
"def index\n @resumes = Resume.where(:book_id => params[:book_id])\n\n render json: @resumes\n end",
"def index\n @books = Book.order('created_at DESC').page(params[:page]).per_page(10).search(params[:search], params[:id])\n respond_to do |format|\n format.json\n format.html\n end\n end",
"def show\n business_id = params[:_id]\n result = Business.find(business_id) rescue nil\n \n if (result == nil)\n result = ErrorMessage.new(:bad_request, \"Id #{business_id} doesn't exist.\")\n status = :bad_request\n else\n status = :ok\n end\n \n render json: result, :status => status\n end",
"def index\n bookings = Booking.all\n\n if bookings\n render json: { status: 'SUCCESS', message: 'Successfuly got all bookings', data: bookings }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Something went wrong' }, status: :unprocessable_entity\n end\n end",
"def fetch_books(term)\n response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{term}\")\n\n JSON.parse(response.body)\nend",
"def show\n render json: @business\n end",
"def index\n @bookmarks = Bookmark.all\n render json: { bookmarks: @bookmarks }, status: :ok\n end",
"def business(business_id)\n begin\n get_hash_by_object(@client.business(business_id))\n rescue Exception => e\n {:application_code => 400}\n end\n end",
"def index\n # @bookings = Booking.all\n begin\n @response = Booking.get_bookings\n rescue RestClient::Exception => exception\n @error = exception.response\n end\n # binding.pry\n end",
"def index\n @title = \"List Books\"\n @books = Book.paginate :page=>params[:page], :per_page => 100, :order => 'title'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"def getbatteries\n puts params\n buildid = params[\"buildingid\"]\n\n batteries = Battery.where(:building_id => buildid)\n\n puts batteries.inspect\n puts \"#################################################\"\n \n respond_to do |format|\n format.json { render json: batteries }\n end\n end",
"def index\n books = current_user.books.all\n render json: { books: books }\n end",
"def index\n @user_businesses = Business.where({user_id: current_user.id})\n render json: JSONAPI::Serializer.serialize(@user_businesses, is_collection: true)\n end",
"def show\n @book_shelf = BookShelf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_shelf }\n end\n end",
"def show\n @cookbook = Cookbook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cookbook }\n end\n end",
"def index\n authorize! :query, Book\n @books = Book.order(:title)\n respond_to do |format|\n format.html\n format.json {render text: @books.to_json}\n format.xml {render text: @books.to_xml}\n end\n end",
"def show\n @business_type = BusinessType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business_type }\n end\n end",
"def index\n if params[:book_id]\n @book = Book.find(params[:book_id])\n recipes = @book.recipes\n render json: RecipeSerializer.new(recipes).to_serialized_json\n else \n recipes = Recipe.all.order(:name)\n render json: RecipeSerializer.new(recipes).to_serialized_json\n end\n end",
"def index\n @books = []\n if (params[:q])\n @books = Book.where(params[:q])\n end\n render :json => @books\n end",
"def show\n begin\n @response = Booking.get_booking(params[:id])\n rescue RestClient::Exception => exception\n @error = exception.response\n end\n end",
"def index\n @bids = Bid.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bids }\n end\n end",
"def show\n @boat = Boat.find(params[:id])\n\n render json: @boat\n end",
"def show\n @cook_book = CookBook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cook_book }\n end\n end",
"def index\n @books = Book.all\n do_response @books\n #\n #respond_to do |format|\n # format.html # index.html.erb\n #format.json { render :json => @books }\n #end\n end",
"def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end",
"def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end",
"def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end",
"def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end",
"def show\n @book = Book.find_by_id(params[:id])\n if @book.present?\n render json: {\n type: 'success',\n result: @book\n }, status: :ok\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",
"def get_book( book_id )\n response = if book_id.to_s.length >= 10\n Amazon::Ecs.item_lookup( book_id, :id_type => 'ISBN', :search_index => 'Books', \n :response_group => 'Large,Reviews,Similarities,AlternateVersions' )\n else\n Amazon::Ecs.item_lookup( book_id, :response_group => 'Large,Reviews,Similarities' )\n end\n response.items.each do |item|\n binding = item.get('ItemAttributes/Binding')\n next if binding.match(/Kindle/i)\n return Book.new( item )\n end\n return nil\n end",
"def business(business_id)\n url = \"#{API_HOST}#{BUSINESS_PATH}#{business_id}\"\n\n response = HTTP.auth(\"Bearer #{API_KEY}\").get(url)\n response.parse\n end",
"def get_address_books\n self.class.get('https://api.yesgraph.com/v0/address-books', :headers => @options)\n end",
"def index\n respond_with Biblebook.all\n end",
"def show\n render \"api/v1/bounties/show\"\n end",
"def get_book_with_api(title)\n uri = URI.parse(URI.encode(\"https://www.googleapis.com/books/v1/volumes?q=#{title}\"))\n service = Books::ApiConnectService.new(uri)\n book_response = service.execute[\"items\"].first[\"volumeInfo\"]\n .select{ |key, value| key == \"title\" || key == \"description\" || key == \"publisher\" || key == \"publishedDate\" || key == \"imageLinks\"}\n @book_info_hash = book_response.inject({}) do |hash, (key, value)|\n if key.underscore == \"image_links\"\n hash[key.underscore] = book_response[\"imageLinks\"][\"smallThumbnail\"]\n else\n hash[key.underscore] = value\n end\n hash\n end\n end",
"def get_bib(bibnum)\n cbn = clean_bibnum(bibnum)\n if cbn.empty?\n Rails.logger.error \"ERROR: OpacRecordService#get_bib called with invalid bib number #{bibnum}\"\n raise InvalidOpacRecordNumber, 'invalid bib number'\n else\n begin\n response = token.get(\"#{@path}/bibs/#{cbn}\")\n rescue OAuth2::Error => e\n Rails.logger.error \"ERROR: OpacRecordService#get_bib #{e}\"\n raise OpacConnectionError, 'error connecting or authenticating with the opac'\n else\n # It may seem like we should just return the unparsed (json) body, since\n # the controller will pull from here and then need to turn it into json again.\n # But I expect to do lots of data processing here in /services; therefore\n # controller should expect the hash and convert it back to json for consumption.\n response.parsed\n end\n end\n end",
"def show\n render json: { booking: @booking }, status: 200\n end",
"def get_brandings\n request :get, \"/v3/brandings.json\"\n end",
"def index\n @notebooks = Notebook.all\n render json: @notebooks\n end",
"def index\n @bids = Bid.where(\"auction_id = ?\", params[:auction_id])\n\n render json: @bids\n end",
"def index\n @books = Book.get_avaible_books\n end",
"def index\n books_with_isbn = Book.where(isbn: params[:search])\n if books_with_isbn.any? and not request.format.json?\n redirect_to books_with_isbn.first\n return\n else\n search\n @books = @books.first(params[:limit].to_i) if params[:limit]\n @query = params[:search]\n unless request.format.json?\n @books = @books.paginate(page: params['page'])\n end\n end\n respond_to do |format|\n format.html\n format.json { 'show' }\n end\n end",
"def show\n @boat = Boat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json {render json: @boat}\n end\n end",
"def index\n @bookings = Booking.all\n respond_with(@bookings)\n end",
"def fetch_books(term)\n response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{term}\")\n\n JSON.parse(response.body)\n end"
] | [
"0.699776",
"0.6908427",
"0.6835466",
"0.6817468",
"0.6666077",
"0.66522855",
"0.66353226",
"0.66289055",
"0.6626388",
"0.6619751",
"0.6619751",
"0.6619751",
"0.6552016",
"0.6552016",
"0.6552016",
"0.6543199",
"0.65218496",
"0.65097106",
"0.64712507",
"0.6463741",
"0.6460948",
"0.64609283",
"0.6440174",
"0.6431381",
"0.64251435",
"0.64068",
"0.64068",
"0.6397528",
"0.6397528",
"0.6397528",
"0.6397528",
"0.6397528",
"0.6397528",
"0.6397528",
"0.6397528",
"0.6397528",
"0.63885397",
"0.63874215",
"0.6381176",
"0.63784355",
"0.63611424",
"0.6359713",
"0.63527614",
"0.6351471",
"0.63495934",
"0.6345613",
"0.63413095",
"0.6336753",
"0.6329348",
"0.6321269",
"0.63201565",
"0.6302554",
"0.63016146",
"0.62969255",
"0.62943786",
"0.62697697",
"0.62662494",
"0.62608814",
"0.6250295",
"0.6249967",
"0.6243851",
"0.6237596",
"0.62302196",
"0.6225559",
"0.62162864",
"0.6214636",
"0.6212919",
"0.62089795",
"0.6202178",
"0.6200215",
"0.6197021",
"0.61946964",
"0.6194534",
"0.61924946",
"0.6192451",
"0.6179384",
"0.6168369",
"0.61674553",
"0.6161479",
"0.6156847",
"0.6156847",
"0.6156847",
"0.6156847",
"0.6154249",
"0.615116",
"0.61471564",
"0.61459655",
"0.6140216",
"0.613157",
"0.61293954",
"0.6123475",
"0.6112854",
"0.6107943",
"0.6102774",
"0.60923886",
"0.60827965",
"0.6080215",
"0.6077721",
"0.60774803",
"0.60753983"
] | 0.7402133 | 0 |
GET /businessbooks/new GET /businessbooks/new.json | def new
@businessbook = Businessbook.new
respond_to do |format|
format.html # new.html.erb
format.json { render :json => @businessbook }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @book = Book.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @title = \"New Book\"\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n load_data\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @book }\n end\n end",
"def new\n @business = Business.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @business }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\r\n @book = Book.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @book }\r\n end\r\n end",
"def new\n @business = Business.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @business }\n end\n end",
"def new\n\t\t@book = Book.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render :json => @book }\n\t\tend\n\tend",
"def new\n @bb = Bb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bb }\n end\n end",
"def new\n @boat = Boat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json {render json: @boat}\n end\n end",
"def new\n @business_type = BusinessType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @business_type }\n end\n end",
"def new\n @cookbook = Cookbook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cookbook }\n end\n end",
"def new\n @borrow = Borrow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrow }\n end\n end",
"def new\n @library_book = LibraryBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @library_book }\n end\n end",
"def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"def new\n @business_object = BusinessObject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @business_object }\n end\n end",
"def new\n # @collection = Collection.find(params[:collection_id])\n @book = @collection.books.build\n #original: @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @cook_book = CookBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cook_book }\n end\n end",
"def new\n @breadcrumb = 'create'\n @bank = Bank.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end",
"def new\n @booking = Booking.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @booking }\n end\n end",
"def new\n @booking = Booking.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @booking }\n end\n end",
"def new\n @bookwork = Bookwork.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bookwork }\n end\n end",
"def new\r\n @page_title = '書籍情報作成'\r\n @book = Book.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @book }\r\n end\r\n end",
"def new\n @bl = Bl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bl }\n end\n end",
"def new\n @book_shelf = BookShelf.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book_shelf }\n end\n end",
"def new\n @b = B.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @b }\n end\n end",
"def create\n @businessbook = Businessbook.new(params[:businessbook])\n\n respond_to do |format|\n if @businessbook.save\n format.html { redirect_to @businessbook, :notice => 'Businessbook was successfully created.' }\n format.json { render :json => @businessbook, :status => :created, :location => @businessbook }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @businessbook.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @title = t('view.banks.new_title')\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end",
"def new\n @bookmark = Bookmark.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @bookmark }\n end\n end",
"def new\n @borrower = Borrower.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrower }\n end\n end",
"def new\n @borrower = Borrower.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrower }\n end\n end",
"def new\n @book_of_class = BookOfClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book_of_class }\n end\n end",
"def new\n @usersbook = Usersbook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usersbook }\n end\n end",
"def new\n @borrow_request = BorrowRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrow_request }\n end\n end",
"def new\n @book = current_user.books.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @billcategory = Billcategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @billcategory }\n end\n end",
"def new\n @book = Book.new\n @publishers = Publisher.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"def new\n @look_book = LookBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @look_book }\n end\n end",
"def new\n @confirmation_book = ConfirmationBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @confirmation_book }\n end\n end",
"def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @book }\n format.json { render json: @book }\n end\n end",
"def new\n @b_category = BCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @b_category }\n end\n end",
"def new\n @book = Book.new\n\n do_response @book\n end",
"def new\n @company = Company.new(:name => 'default')\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @company }\n end\n end",
"def new\n @death_record_book = DeathRecordBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @death_record_book }\n end\n end",
"def new\n @business_sector = BusinessSector.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @business_sector }\n end\n end",
"def new\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @basin = Basin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @basin }\n end\n end",
"def new\n @authors_book = AuthorsBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @authors_book }\n end\n end",
"def new\n @baggage = Baggage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @baggage }\n end\n end",
"def new\n @broad = Broad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @broad }\n end\n end",
"def new\n @book_page = @book.book_pages.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book_page }\n end\n end",
"def new\n @book_catalog_entrie = BookCatalogEntrie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book_catalog_entrie }\n end\n end",
"def new\n @newapp = Newapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newapp }\n end\n end",
"def new\n @notebook = Notebook.new\n render json: @notebook\n end",
"def new\n @bounty = Bounty.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @bounty }\n end\n end",
"def new\n @book = Book.new :copies => 1\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"def new\n @bagtype = Bagtype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bagtype }\n end\n end",
"def new\n @holy_book = HolyBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @holy_book }\n end\n end",
"def new\n @book_format = BookFormat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book_format }\n end\n end",
"def new\n @bid = Bid.new\n @item = Item.find(params[:id])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"def new\n @bob = Bob.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bob }\n end\n end",
"def new\n @bill = Bill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bill }\n end\n end",
"def new\n @bill = Bill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bill }\n end\n end",
"def new\n @cat = Cat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cat }\n end\n end",
"def new\n @cat = Cat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cat }\n end\n end",
"def new\n @biz_company = BizCompany.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @biz_company }\n end\n end",
"def new\n @library = Library.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @library }\n end\n end",
"def new\n @library = Library.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @library }\n end\n end",
"def new\n @bookself = Bookself.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bookself }\n end\n end",
"def new\r\n @company = Company.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @company }\r\n end\r\n end",
"def new\n @new_status = NewStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_status }\n end\n end",
"def new\n @guestbook = Guestbook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guestbook }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rulebook }\n end\n end",
"def new\n @ebook = Ebook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ebook }\n end\n end",
"def new\n @baton = Baton.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @baton }\n end\n end",
"def new\n @brother = Brother.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brother }\n end\n end",
"def new\n @basket = Basket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @basket }\n end\n end"
] | [
"0.7581938",
"0.7581938",
"0.7566873",
"0.75459146",
"0.75042427",
"0.7498681",
"0.7498681",
"0.7498681",
"0.7498681",
"0.7498681",
"0.7498681",
"0.7498681",
"0.7498681",
"0.7498681",
"0.7498681",
"0.7498681",
"0.7489435",
"0.747616",
"0.74659175",
"0.7336534",
"0.73196006",
"0.72637177",
"0.7255175",
"0.7254423",
"0.7241786",
"0.7231443",
"0.720183",
"0.720183",
"0.7174863",
"0.7166079",
"0.71631545",
"0.7153016",
"0.71366554",
"0.71366554",
"0.71329",
"0.7127085",
"0.71113205",
"0.71070665",
"0.71023864",
"0.707721",
"0.7073635",
"0.70647186",
"0.7064223",
"0.7064223",
"0.70422345",
"0.70317566",
"0.7031566",
"0.7015672",
"0.6998238",
"0.6991919",
"0.6990061",
"0.698999",
"0.69763845",
"0.6957431",
"0.6954516",
"0.6895277",
"0.68927854",
"0.688202",
"0.6871677",
"0.6866933",
"0.6866933",
"0.6866933",
"0.6866933",
"0.6866933",
"0.6866933",
"0.6866933",
"0.6866933",
"0.6866933",
"0.6866933",
"0.68566775",
"0.68564194",
"0.6854789",
"0.68531054",
"0.6852481",
"0.6849363",
"0.6846555",
"0.6845652",
"0.6843567",
"0.6839496",
"0.68304265",
"0.6827375",
"0.6823676",
"0.68098813",
"0.6809445",
"0.68080616",
"0.68080616",
"0.6806421",
"0.6806421",
"0.6803352",
"0.6790148",
"0.6790148",
"0.6788417",
"0.6788146",
"0.6784486",
"0.6772512",
"0.6771685",
"0.6766445",
"0.67657506",
"0.676171",
"0.67612"
] | 0.7909274 | 0 |
POST /businessbooks POST /businessbooks.json | def create
@businessbook = Businessbook.new(params[:businessbook])
respond_to do |format|
if @businessbook.save
format.html { redirect_to @businessbook, :notice => 'Businessbook was successfully created.' }
format.json { render :json => @businessbook, :status => :created, :location => @businessbook }
else
format.html { render :action => "new" }
format.json { render :json => @businessbook.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @book = Book.new(book_params)\n\n if @book.save\n render json: @book, status: :created, location: @book\n else\n render json: @book.errors, status: :unprocessable_entity\n end\n end",
"def create\n @api_book = Api::Book.new(api_book_params)\n\n if @api_book.save\n render json: @api_book, status: :created, location: @api_book\n else\n render json: @api_book.errors, status: :unprocessable_entity\n end\n end",
"def create\n @business = Business.new(params[:business])\n\n respond_to do |format|\n if @business.save\n format.html { redirect_to action: \"index\"}\n format.json { render json: @business, status: :created, location: @business }\n else\n format.html { render action: \"new\" }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @business = Business.new(business_params)\n respond_to do |format|\n if @business.save\n format.html { redirect_to businesses_path, notice: I18n.t('commons.successfully_created') }\n format.json { render json: @business, status: :created, location: @business }\n else\n format.html { render action: \"new\" }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @businessbook = Businessbook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @businessbook }\n end\n end",
"def create\n booking = Booking.create(booking_params)\n render json: booking\n end",
"def create\n @business = Business.new(business_params)\n respond_to do |format|\n if @business.save\n format.html { redirect_to root_path, notice: 'Business was successfully created.' }\n format.json { render :show, status: :created, location: @business }\n else\n format.html { render :new }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @business = Business.new(business_params)\n\n respond_to do |format|\n if @business.save\n format.html { redirect_to @business, notice: 'Business was successfully created.' }\n format.json { render :show, status: :created, location: @business }\n else\n format.html { render :new }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @business = current_user.owned_businesses.new(business_params)\n\n respond_to do |format|\n if @business.save\n format.html { redirect_to business_path(@business), notice: 'Business was successfully created.' }\n format.json { render json: @business, status: :created, location: @business }\n else\n format.html { render action: \"new\" }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @business = @user.businesses.build(business_params)\n\n respond_to do |format|\n if @business.save\n format.html { redirect_to root_path(@user), notice: 'Business was successfully created.' }\n format.json { render :show, status: :created, location: @business }\n else\n format.html { render :new }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to \"/books\", notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.create( params[:book] )\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to books_path, notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(params[:book])\n \n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @boat = Boat.new(boat_params)\n\n if @boat.save\n render json: @boat, status: :created, location: @boat\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end",
"def create\n @boc = Boc.new(boc_params)\n\n respond_to do |format|\n if @boc.save\n format.html { redirect_to new_boc_path, notice: 'Boc was successfully created.' }\n format.json { render :show, status: :created, location: @boc }\n else\n format.html { render :new }\n format.json { render json: @boc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @business = Business.new(business_params)\n @num = 1\n while Business.where([\"business_id = ?\", @num]).size > 0\n @num = @num + 1\n end\n @business.business_id = @num\n @business.user_email = current_user.email\n respond_to do |format|\n if @business.save\n format.html { redirect_to @business, notice: 'Business was successfully created.' }\n format.json { render :show, status: :created, location: @business }\n else\n format.html { render :new }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bookmark = Bookmark.new(params[:bookmark])\n# req = ActiveSupport::JSON.decode(request.body)\n# @bookmark = Bookmark.new(req)\n\n respond_to do |format|\n if @bookmark.save\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully created.' }\n format.json { render json: @bookmark, status: :created, location: @bookmarks }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = @collection.books.build(params[:book])\n #original: @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to book_series_collection_books_url(@book_series, @collection), notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @borrowed_book = BorrowedBook.new(borrowed_book_params)\n\n respond_to do |format|\n if @borrowed_book.save\n format.html { redirect_to @borrowed_book, notice: \"Borrowed book was successfully created.\" }\n format.json { render :show, status: :created, location: @borrowed_book }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @borrowed_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to manage_books_path, notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submit_business_api_call(date, begin_time, budget, location, itinerary)\n preferences_request_biz = current_user.supplemental_preferences\n designated_preference_biz = preferences_request_biz.sample\n category_request_biz = designated_preference_biz.business_categories.sample\n business_search_term = designated_preference_biz.keywords.sample\n open_date_time = user_input_to_unix(date, begin_time)\n user_budget = convert_to_yelp_budget(budget)\n y = YelpResponse.new\n response = y.get_businesses_response({term: business_search_term, categories: category_request_biz, location: location, price: user_budget, open_at: open_date_time, limit: 20})\n response_container = []\n response_container << response[\"businesses\"].sample\n response_convert_hash = {}\n response_convert_hash[\"businesses\"] = response_container\n handle_businesses_response(response_convert_hash, y, itinerary)\n end",
"def create\n @book = Book.find(book_request_params[:book_id])\n @account = Account.find(params[:account_id])\n @book_request = BookRequest.new(book: @book, reader: @account, holder: @book.account)\n respond_to do |format|\n if @book_request.save\n format.json {\n render json:\n {\n book_id: @book_request.book_id,\n book_request_state: @book_request.state_name\n }\n }\n else\n format.json { render json: @book_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n @categories = Category.all.order('name asc')\n respond_to do |format|\n if @book.save\n format.html { redirect_to books_url, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n @categories = Category.all.order('name asc')\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @library_book = LibraryBook.new(params[:library_book])\n\n respond_to do |format|\n if @library_book.save\n format.html { redirect_to @library_book, notice: 'Library book was successfully created.' }\n format.json { render json: @library_book, status: :created, location: @library_book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @library_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tboat = Boat.new(boat_params)\n \tif boat.save\n \t\trender json: boat, status: 201\n \tend\n\tend",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: \"Book was successfully created.\" }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: \"Book was successfully created.\" }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n puts @book.as_json \n format.json { render :show, status: :created, location: @book }\n else\n \n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @boat_document = BoatDocument.new(boat_document_params)\n\n respond_to do |format|\n if @boat_document.save\n format.html { redirect_to @boat_document, notice: 'Boat document was successfully created.' }\n format.json { render :show, status: :created, location: @boat_document }\n else\n format.html { render :new }\n format.json { render json: @boat_document.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: t('common.message.created_success')}\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @booksinlist = Booksinlist.new(booksinlist_params)\n\n respond_to do |format|\n if @booksinlist.save\n format.html { redirect_to @booksinlist, notice: 'Booksinlist was successfully created.' }\n format.json { render :show, status: :created, location: @booksinlist }\n else\n format.html { render :new }\n format.json { render json: @booksinlist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @business_listing = BusinessListing.new(business_listing_params)\n\n respond_to do |format|\n if @business_listing.save\n format.html { redirect_to @business_listing, notice: 'Business listing was successfully created.' }\n format.json { render :show, status: :created, location: @business_listing }\n else\n format.html { render :new }\n format.json { render json: @business_listing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tbooking = Booking.new(booking_params)\n\n\t if booking.save\n\t \tPeekBooker.use_a_boat(booking.size, booking.timeslot_id)\n\t \tPeekBooker.delete_overlap_assignments(booking.timeslot_id)\n\t \tPeekBooker.upd_availability(booking.timeslot_id)\n\t \t\n\t \trender json: booking, status: 201\n\t end\n\tend",
"def create\n @business = Business.new(params[:business])\n\n @business.user_id = current_user.id\n @business.label_id = current_label.id\n @business.subscription = sub \n \n if @business.save \n sub.transaction_event.setup_business(@business) \n\n respond_to do |format| \n format.json { render :json => @business.id } \n end \n #redirect_to congratulations_path\n else \n STDERR.puts @business.errors.inspect\n respond_to do |format| \n format.html { render \"new\" } \n format.json { render :json => @business, :status => 400 } \n end \n end \n end",
"def create\n @business_category = BusinessCategory.new(business_category_params)\n\n respond_to do |format|\n if @business_category.save\n format.html { redirect_to @business_category, notice: 'Business category was successfully created.' }\n format.json { render :show, status: :created, location: @business_category }\n else\n format.html { render :new }\n format.json { render json: @business_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @business = Business.new(business_params)\n\n respond_to do |format|\n if @business.save\n session[:business_id] = @business.id\n format.html { redirect_to businesses_path, success: 'Thanks for adding your business!' }\n format.json { render action: 'show', status: :created, location: @business }\n else\n format.html { render action: 'new' }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @borrowed_book = BorrowedBook.new(borrowed_book_params)\n respond_to do |format|\n if @borrowed_book.save\n borrow(@borrowed_book)\n format.html { redirect_to @borrowed_book, notice: 'Borrowed book was successfully created.' }\n format.json { render :show, status: :created, location: @borrowed_book }\n else\n format.html { render :new }\n format.json { render json: @borrowed_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @business_object = BusinessObject.new(params[:business_object])\n\n respond_to do |format|\n if @business_object.save\n format.html { redirect_to @business_object, :notice => 'Business object was successfully created.' }\n format.json { render :json => @business_object, :status => :created, :location => @business_object }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @business_object.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @biography_book = current_user.biography_books.build(biography_book_params)\n\n respond_to do |format|\n if @biography_book.save\n format.html { redirect_to @biography_book, notice: \"Biography review was successfully created.\" }\n format.json { render :show, status: :created, location: @biography_book }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @biography_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render action: 'show', status: :created, location: @book }\n else\n format.html { render action: 'new' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @business_type = BusinessType.new(params[:business_type])\n\n respond_to do |format|\n if @business_type.save\n format.html { redirect_to @business_type, notice: 'Business type was successfully created.' }\n format.json { render json: @business_type, status: :created, location: @business_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @business_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @book = Book.new(book_params)\r\n\r\n respond_to do |format|\r\n if @book.save\r\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\r\n format.json { render :show, status: :created, location: @book }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @book.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @bookitem = Bookitem.new(bookitem_params)\n\n respond_to do |format|\n if @bookitem.save\n format.html { redirect_to @bookitem, notice: \"Bookitem was successfully created.\" }\n format.json { render :show, status: :created, location: @bookitem }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @bookitem.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @library_book = LibraryBook.new(library_book_params)\n\n respond_to do |format|\n if @library_book.save\n format.html { redirect_to @library_book, notice: 'Library book was successfully created.' }\n format.json { render :show, status: :created, location: @library_book }\n else\n format.html { render :new }\n format.json { render json: @library_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book }\n format.json { render action: 'show', status: :created, location: @book }\n else\n format.html { render action: 'new' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def store\n @book = Book.new(book_params)\n if @book.save\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 end",
"def create\n @mybusiness = Mybusiness.new(mybusiness_params)\n\n respond_to do |format|\n if @mybusiness.save\n format.html { redirect_to @mybusiness, notice: 'Mybusiness was successfully created.' }\n format.json { render :show, status: :created, location: @mybusiness }\n else\n format.html { render :new }\n format.json { render json: @mybusiness.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(get_book_with_api(book_params[:title]))\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: '本を新規登録しました。' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.xml { head :ok }\n format.json { render json: @book, status: :created, location: @book }\n\n else\n format.html { render action: \"new\" }\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",
"def create\n # business = Business.create(business_params)\n # current_user.businesss << business\n # business = current_user.businesses.create(business_params)\n # redirect_to business_path(business)\n \n business = current_user.businesses.new(business_params)\n if business.save\n flash[:notice] = \"Successfully created business.\"\n redirect_to business_path(business)\n else\n flash[:error] = business.errors.full_messages.join(\", \")\n redirect_to new_business_path\n end\n end",
"def create\n logger.debug \"#{book_params}\"\n @book = Book.new(book_params)\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = params[:book]\n add(@book)\n end",
"def create\n @title = \"Create New Book\"\n\n process_publisher\n\n all_book_params= params[:book]\n\n @book = Book.new(params[:book])\n\n process_authors\n\n process_subjects\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to edit_book_path(@book), notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @business_sector = BusinessSector.new(params[:business_sector])\n\n respond_to do |format|\n if @business_sector.save\n format.html { redirect_to @business_sector, notice: 'Business sector was successfully created.' }\n format.json { render json: @business_sector, status: :created, location: @business_sector }\n else\n format.html { render action: \"new\" }\n format.json { render json: @business_sector.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bookitem = Bookitem.new(bookitem_params)\n\n respond_to do |format|\n if @bookitem.save\n format.html { redirect_to @bookitem, notice: 'Bookitem was successfully created.' }\n format.json { render :show, status: :created, location: @bookitem }\n else\n format.html { render :new }\n format.json { render json: @bookitem.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n respond_to do |format|\n if @company_business.save\n format.html { redirect_to @company_business, notice: 'Company business was successfully created.' }\n format.json { render json: @company_business, status: :created, location: @company_business }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company_business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @booking = Booking.new(params[:booking])\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n format.json { render json: @booking, status: :created, location: @booking }\n else\n format.html { render action: \"new\" }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @booking = Booking.new(params[:booking])\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n format.json { render json: @booking, status: :created, location: @booking }\n else\n format.html { render action: \"new\" }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bookcabinet = Bookcabinet.new(bookcabinet_params)\n\n respond_to do |format|\n if @bookcabinet.save\n format.html { redirect_to @bookcabinet, notice: 'Bookcabinet was successfully created.' }\n format.json { render :show, status: :created, location: @bookcabinet }\n else\n format.html { render :new }\n format.json { render json: @bookcabinet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @businessbooks = Businessbook.search(params[:search]).paginate(:per_page => 18, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @businessbooks }\n end\n end",
"def create\n @cook_book = CookBook.new(params[:cook_book])\n\n respond_to do |format|\n if @cook_book.save\n format.html { redirect_to @cook_book, notice: 'Cook book was successfully created.' }\n format.json { render json: @cook_book, status: :created, location: @cook_book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cook_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bb = Bb.new(params[:bb])\n\n respond_to do |format|\n if @bb.save\n format.html { redirect_to @bb, notice: 'Bb was successfully created.' }\n format.json { render json: @bb, status: :created, location: @bb }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book}\n format.json { render action: 'show', status: :created, location: @book }\n else\n format.html { render action: 'new' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @order_book = OrderBook.new(order_book_params)\n\n respond_to do |format|\n if @order_book.save\n format.html { redirect_to @order_book, notice: 'Order book was successfully created.' }\n format.json { render :show, status: :created, location: @order_book }\n else\n format.html { render :new }\n format.json { render json: @order_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @address_book = AddressBook.new(address_book_params)\n\n respond_to do |format|\n if @address_book.save\n format.html { redirect_to @address_book, notice: 'Address book was successfully created.' }\n format.json { render :show, status: :created, location: @address_book }\n else\n format.html { render :new }\n format.json { render json: @address_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n #flash[:notice] = 'Book was successfully created.'\n format.html { redirect_to @book, :notice => 'Book was successfully created.' }\n format.json { render :json => @book, :status => :created, :location => @book }\n else\n load_data\n\n format.html { render :action => \"new\" }\n format.json { render :json => @book.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def call(params)\n @books = BookRepository.all\n self.body = JSON.dump(@books)\n end",
"def create\n @book_label = BookLabel.new(book_label_params)\n\n respond_to do |format|\n if @book_label.save\n format.html { redirect_to @book_label, notice: 'Book label was successfully created.' }\n format.json { render :show, status: :created, location: @book_label }\n else\n format.html { render :new }\n format.json { render json: @book_label.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @usersbook = Usersbook.new(params[:usersbook])\n\n respond_to do |format|\n if @usersbook.save\n format.html { redirect_to @usersbook, notice: 'Registro criado com sucesso!' }\n format.json { render json: @usersbook, status: :created, location: @usersbook }\n else\n format.html { render action: \"new\" }\n format.json { render json: @usersbook.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n getBookId = Book.where(name:@book.name)\n getBookId.each do |id_book|\n params[:amount_code].each do |value|\n Amount.new(code: value, book_id: id_book.id, active: 0).save\n end\n end\n end",
"def create\n @borrowed_book = BorrowedBook.new(borrowed_book_params)\n\n respond_to do |format|\n if @borrowed_book.save\n format.html { redirect_to @borrowed_book, notice: 'The book was successfully checked out.' }\n format.json { render :show, status: :created, location: @borrowed_book }\n else\n @borrowers = Borrower.order('name ASC')\n @borrower_count = Borrower.count\n format.html { render :new }\n format.json { render json: @borrowed_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @business = Business.new(params[:business])\n\n respond_to do |format|\n if @business.save\n flash[:notice] = \"#{@business.name} Was Successfully Created\"\n format.html { redirect_to business_path(@business) }\n format.xml { head :created, :location => business_url(@business) }\n else\n format.html { render :action => business_path(@business) }\n format.xml { render :xml => @business.errors.to_xml }\n end\n end\n end",
"def create\n @booking = Booking.new(booking_params)\n begin\n @response = Booking.create_booking(booking_options)\n @booking.log = @response\n @booking.picap_id = @response[\"_id\"]\n notice = \"Booking was successfully created.\"\n rescue RestClient::Exception => exception\n @booking.log = exception.response\n alert = exception.response\n end\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to root_path, notice: notice, alert: alert }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params_create)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: '添加成功!' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new\n @book.isbn = params[:book][:isbn]\n @book.title = params[:book][:title]\n @book.language = params[:book][:language]\n @book.author = params[:book][:author]\n @book.published = params[:book][:published]\n @book.edition = params[:book][:edition]\n @book.image = params[:book][:image]\n @book.subject = params[:book][:subject]\n @book.summary = params[:book][:summary]\n @book.special = params[:book][:special]\n \n respond_to do |format|\n if @book.save\n @book_library_mapping = BookLibraryMapping.new \n @book_library_mapping.book_id = @book.id\n @book_library_mapping.quantity = params[:quantity]\n @book_library_mapping.library_id = params[:library]\n @book_library_mapping.save\n\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @loan = Loan.new(loan_params)\n @book = Book.find_by( params[:book_id] )\n\n respond_to do |format|\n if @loan.save\n format.html { redirect_to @loan, notice: 'Book successfully borrowed' }\n format.json { render :show, status: :created, location: @loan }\n else\n format.html { redirect_to books_path, alert: 'Book not available' }\n end\n end\n end",
"def create\n @library_book = current_user.books.new(library_book_params)\n\n respond_to do |format|\n if @library_book.save\n format.html { redirect_to @library_book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @library_book }\n else\n format.html { render :new }\n format.json { render json: @library_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cash_book = CashBook.new(params[:cash_book])\n\n respond_to do |format|\n if @cash_book.save\n flash[:notice] = 'CashBook was successfully created.'\n format.html { redirect_to(@cash_book) }\n format.xml { render :xml => @cash_book, :status => :created, :location => @cash_book }\n format.json\n format.jsonrs\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cash_book.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @bidding = Bidding.new(params[:bidding])\n\n respond_to do |format|\n if @bidding.save\n format.html { redirect_to @bidding, notice: 'Bidding was successfully created.' }\n format.json { render json: @bidding, status: :created, location: @bidding }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bidding.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bnpb = Bnpb.new(bnpb_params)\n\n respond_to do |format|\n if @bnpb.save\n format.html { redirect_to @bnpb, notice: 'Bnpb was successfully created.' }\n format.json { render :show, status: :created, location: @bnpb }\n else\n format.html { render :new }\n format.json { render json: @bnpb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to books_path }\n else\n format.html { render :new, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.65611285",
"0.6463056",
"0.6416757",
"0.64146",
"0.6325686",
"0.62910694",
"0.6285444",
"0.62647307",
"0.61569035",
"0.6153173",
"0.61375266",
"0.61241496",
"0.6092917",
"0.6091869",
"0.60832745",
"0.6066547",
"0.60340077",
"0.6032788",
"0.6032788",
"0.6032788",
"0.6032788",
"0.6032788",
"0.602",
"0.59957033",
"0.59897465",
"0.5985564",
"0.59847784",
"0.598103",
"0.59759074",
"0.5971307",
"0.59607494",
"0.59607494",
"0.5949794",
"0.5943184",
"0.5941386",
"0.5927161",
"0.59172326",
"0.5909095",
"0.5909095",
"0.5909095",
"0.5909095",
"0.5909095",
"0.5909095",
"0.5909095",
"0.5909095",
"0.5909095",
"0.5909095",
"0.5909095",
"0.5909095",
"0.5909095",
"0.5902859",
"0.58961535",
"0.5889018",
"0.58868957",
"0.5877656",
"0.5875344",
"0.5873845",
"0.58641326",
"0.58455247",
"0.5843408",
"0.5842304",
"0.5842154",
"0.583672",
"0.5828784",
"0.582856",
"0.58267325",
"0.582672",
"0.5822888",
"0.5813615",
"0.5812394",
"0.5809372",
"0.5805932",
"0.58054984",
"0.58028656",
"0.5799763",
"0.57969624",
"0.57969624",
"0.5795525",
"0.57954276",
"0.57933956",
"0.5787368",
"0.57820296",
"0.5771465",
"0.5754603",
"0.5750892",
"0.57466835",
"0.5745815",
"0.5740961",
"0.5726672",
"0.5724742",
"0.5724281",
"0.57199156",
"0.5715018",
"0.57125443",
"0.5709503",
"0.57063526",
"0.5704052",
"0.5703363",
"0.5702655",
"0.5695313"
] | 0.7194014 | 0 |
PUT /businessbooks/1 PUT /businessbooks/1.json | def update
@businessbook = Businessbook.find(params[:id])
respond_to do |format|
if @businessbook.update_attributes(params[:businessbook])
format.html { redirect_to @businessbook, :notice => 'Businessbook was successfully updated.' }
format.json { head :no_content }
else
format.html { render :action => "edit" }
format.json { render :json => @businessbook.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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",
"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",
"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",
"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",
"def update\n @business = Business.find(params[:id])\n\n respond_to do |format|\n if @business.update_attributes(params[:business])\n format.html { redirect_to aciton: \"index\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def update\n @business = Business.find(params[:id])\n\n respond_to do |format|\n if @business.update_attributes(business_params)\n format.html { redirect_to businesses_path, notice: I18n.t('commons.successfully_updated') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def update\n @business = Business.find(params[:id])\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @booking = Booking.find(params[:id])\n\n if @booking.update(booking_params)\n head :no_content\n else\n render json: @booking.errors, status: :unprocessable_entity\n end\n end",
"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",
"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",
"def putBusiness( name, building_number, branch_name, address1, address2, address3, district, town, county, province, postcode, country, latitude, longitude, timezone, telephone_number, additional_telephone_number, email, website, category_id, category_type, do_not_display, referrer_url, referrer_name, destructive, delete_mode, master_entity_id)\n params = Hash.new\n params['name'] = name\n params['building_number'] = building_number\n params['branch_name'] = branch_name\n params['address1'] = address1\n params['address2'] = address2\n params['address3'] = address3\n params['district'] = district\n params['town'] = town\n params['county'] = county\n params['province'] = province\n params['postcode'] = postcode\n params['country'] = country\n params['latitude'] = latitude\n params['longitude'] = longitude\n params['timezone'] = timezone\n params['telephone_number'] = telephone_number\n params['additional_telephone_number'] = additional_telephone_number\n params['email'] = email\n params['website'] = website\n params['category_id'] = category_id\n params['category_type'] = category_type\n params['do_not_display'] = do_not_display\n params['referrer_url'] = referrer_url\n params['referrer_name'] = referrer_name\n params['destructive'] = destructive\n params['delete_mode'] = delete_mode\n params['master_entity_id'] = master_entity_id\n return doCurl(\"put\",\"/business\",params)\n end",
"def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to businesses_path, notice: 'Business was successfully updated.' }\n format.json { render :index, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @business_object = BusinessObject.find(params[:id])\n\n respond_to do |format|\n if @business_object.update_attributes(params[:business_object])\n format.html { redirect_to @business_object, :notice => 'Business object was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @business_object.errors, :status => :unprocessable_entity }\n end\n end\n end",
"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",
"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",
"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",
"def update\n respond_to do |format|\n if @boc.update(boc_params)\n format.html { redirect_to @boc, notice: 'Boc was successfully updated.' }\n format.json { render :show, status: :ok, location: @boc }\n else\n format.html { render :edit }\n format.json { render json: @boc.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def update\n req = ActiveSupport::JSON.decode(request.body)\n @bookmark = Bookmark.find(req)\n\n respond_to do |format|\n if @bookmark.update_attributes(params[:id])\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully updated.' }\n format.json { render json: @bookmark, status: :created, location: @bookmarks }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def update\n if @boat.update(boat_params)\n head :no_content\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end",
"def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"def update\n @business = @user.businesses.find(params[:id])\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to edit_user_business_path(@user, @business), notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"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",
"def ajax_book_update\r\n @book = Book.find(params[:id])\r\n @book.isbn = params[:isbn]\r\n @book.title = params[:title]\r\n @book.save\r\n end",
"def update\n @business = Business.find(params[:id])\n authorize! :update, @business\n\n respond_to do |format|\n if @business.update_attributes(business_params || {})\n format.html { redirect_to business_path(@business), notice: 'Business was successfully updated.' }\n format.json do\n respond_with_bip(@business.becomes(Business), param: param_key)\n end\n else\n format.html { render action: \"edit\" }\n format.json do\n respond_with_bip(@business.becomes(Business), param: param_key)\n end\n end\n end\n end",
"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",
"def update\n @booking = Booking.find(params[:id])\n @booking.update_attributes(params[:booking])\n respond_with(@booking)\n end",
"def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"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",
"def update\n @business = Business.find(params[:id])\n\n respond_to do |format|\n if @business.update_attributes(params[:business])\n format.html { redirect_to admin_business_path(@business), notice: 'Business was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def update\n @library_book = LibraryBook.find(params[:id])\n\n respond_to do |format|\n if @library_book.update_attributes(params[:library_book])\n format.html { redirect_to @library_book, notice: 'Library book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @library_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def update\n @business_type = BusinessType.find(params[:id])\n\n respond_to do |format|\n if @business_type.update_attributes(params[:business_type])\n format.html { redirect_to @business_type, notice: 'Business type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @business_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"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",
"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",
"def update\n @book = Book.find(params[:id])\n @book.update(book_params)\n redirect_to root_path\n end",
"def set_api_v1_booking\n @api_v1_booking = Booking.find(params[:id])\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"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",
"def update\n respond_to do |format|\n if @boat_document.update(boat_document_params)\n format.html { redirect_to @boat_document, notice: 'Boat document was successfully updated.' }\n format.json { render :show, status: :ok, location: @boat_document }\n else\n format.html { render :edit }\n format.json { render json: @boat_document.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"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",
"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",
"def update\n book = Book.find(params[:id])\n book.update_attributes(params[:book])\n redirect_to(book)\n end",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"def update\n respond_to do |format|\n if @library_book.update(library_book_params)\n format.html { redirect_to @library_book, notice: 'Library book was successfully updated.' }\n format.json { render :show, status: :ok, location: @library_book }\n else\n format.html { render :edit }\n format.json { render json: @library_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def update\n respond_to do |format|\n if @library_book.update(library_book_params)\n format.html { redirect_to @library_book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @library_book }\n else\n format.html { render :edit }\n format.json { render json: @library_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @businesstype = Businesstype.find(params[:id])\n\n respond_to do |format|\n if @businesstype.update_attributes(params[:businesstype])\n format.html { redirect_to @businesstype, notice: 'Businesstype was successfully updated.' }\n format.json { render :show, status: :ok, location: @businesstype }\n else\n format.html { render :edit }\n format.json { render json: @businesstype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @company_business.update_attributes(params[:company_business])\n format.html { redirect_to @company_business, notice: 'Company business was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company_business.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"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"
] | [
"0.6816322",
"0.68015784",
"0.6615512",
"0.64487374",
"0.64161587",
"0.6367759",
"0.63424164",
"0.6319049",
"0.6302526",
"0.6262543",
"0.6261328",
"0.6230062",
"0.6225963",
"0.62095773",
"0.6199712",
"0.6150143",
"0.6147326",
"0.61428815",
"0.6136365",
"0.61291105",
"0.61208934",
"0.6119501",
"0.61129636",
"0.61098146",
"0.6104201",
"0.6104201",
"0.6104201",
"0.6104201",
"0.6104201",
"0.6104201",
"0.6104201",
"0.6104201",
"0.6104201",
"0.6095832",
"0.60797",
"0.6070015",
"0.6068675",
"0.60555243",
"0.6044873",
"0.60379666",
"0.6021931",
"0.6021931",
"0.6021931",
"0.6021931",
"0.60213566",
"0.5975859",
"0.5973296",
"0.5969223",
"0.5968278",
"0.5951959",
"0.5941086",
"0.5937685",
"0.5919043",
"0.59186155",
"0.59186155",
"0.5916843",
"0.5915652",
"0.5913509",
"0.5908636",
"0.5908382",
"0.58988166",
"0.5893364",
"0.58922476",
"0.5889895",
"0.58749235",
"0.586139",
"0.5857807",
"0.5853388",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58517957",
"0.58516085",
"0.584871",
"0.5845522",
"0.58354735",
"0.5834295",
"0.5819901",
"0.5811182"
] | 0.69470376 | 0 |
DELETE /businessbooks/1 DELETE /businessbooks/1.json | def destroy
@businessbook = Businessbook.find(params[:id])
@businessbook.destroy
respond_to do |format|
format.html { redirect_to businessbooks_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @api_book.destroy\n\n head :no_content\n end",
"def destroy\n @business = Business.find(params[:id])\n @business.destroy\n\n respond_to do |format|\n format.html { redirect_to businesses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business = Business.find(params[:id])\n @business.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_businesses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @boc.destroy\n respond_to do |format|\n format.html { redirect_to bocs_url, notice: 'Boc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n book = Book.find(params[:id])\n book.destroy\n \n render json: {}, status: 204\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n \n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n \n format.json { render json: @book, status: :created, location: @book }\n end\n end",
"def destroy\n @b = B.find(params[:id])\n @b.destroy\n\n respond_to do |format|\n format.html { redirect_to bs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @business_object = BusinessObject.find(params[:id])\n @business_object.destroy\n\n respond_to do |format|\n format.html { redirect_to business_objects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find_by_sql(\"SELECT * FROM Books B WHERE B.id = \" + params[:id]).first()\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/books\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end \n end",
"def destroy\n @bl = Bl.find(params[:id])\n @bl.destroy\n\n respond_to do |format|\n format.html { redirect_to bls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @book = Book.find(params[:id])\r\n @book.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to books_url }\r\n format.json { head :ok }\r\n end\r\n end",
"def destroy\n @bb = Bb.find(params[:id])\n @bb.destroy\n\n respond_to do |format|\n format.html { redirect_to bbs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @book = Book.find(params[:id])\r\n @book.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to books_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @book_shelf = BookShelf.find(params[:id])\n @book_shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to book_shelves_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business = @user.businesses.find(params[:id])\n \n @business.destroy\n respond_to do |format|\n format.html { redirect_to root_path(@user), notice: 'Business was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @title = \"Destroy Book\"\n\n # @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bread.destroy\n respond_to do |format|\n format.html { redirect_to breads_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Company.delete(params[\"id\"])\n end",
"def destroy\n @business.destroy\n respond_to do |format|\n format.html { redirect_to businesses_url, notice: 'Business was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business.destroy\n respond_to do |format|\n format.html { redirect_to businesses_url, notice: 'Business was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business.destroy\n respond_to do |format|\n format.html { redirect_to businesses_url, notice: 'Business was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business.destroy\n respond_to do |format|\n format.html { redirect_to businesses_url, notice: 'Business was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business.destroy\n respond_to do |format|\n format.html { redirect_to businesses_url, notice: 'Business was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business.destroy\n respond_to do |format|\n format.html { redirect_to businesses_url, notice: 'Business was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business.destroy\n respond_to do |format|\n format.html { redirect_to businesses_url, notice: 'Business was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.xml { head :ok }\n format.json { head :no_content }\n end\n end",
"def destroy\n @boat_document.destroy\n respond_to do |format|\n format.html { redirect_to boat_documents_url, notice: 'Boat document was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n @lob.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business = Business.find_by_permalink(params[:id])\n @business.destroy\n\n respond_to do |format|\n format.html { redirect_to businesses_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to user_books_url }\n format.json { head :no_content }\n end\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy\n @ebooks.destroy :id\n respond_to do |format|\n format.html { redirect_to ebooks_url, notice: 'Ebook was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business_type = BusinessType.find(params[:id])\n @business_type.destroy\n\n respond_to do |format|\n format.html { redirect_to business_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cookbook = Cookbook.find(params[:id])\n @cookbook.destroy\n\n respond_to do |format|\n format.html { redirect_to cookbooks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @basin = Basin.find(params[:id])\n @basin.destroy\n\n respond_to do |format|\n format.html { redirect_to basins_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url, notice: 'Book was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url, notice: 'Book was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url, notice: 'Book was successfully deleted.' }\n format.json { head :no_content }\n end \n end",
"def destroy\n @business_sector = BusinessSector.find(params[:id])\n @business_sector.destroy\n\n respond_to do |format|\n format.html { redirect_to business_sectors_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n head :no_content\n end",
"def destroy\n @bowl = Bowl.find(params[:id])\n @bowl.destroy\n\n respond_to do |format|\n format.html { redirect_to bowls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business = Business.find(params[:id])\n @business.destroy\n\n respond_to do |format|\n format.html { redirect_to businesses_url, notice: I18n.t('commons.successfully_deleted') }\n format.js#\n format.json { head :no_content }\n end\n end",
"def destroy\n @bid = Bid.find(params[:id])\n @bid.destroy\n\n respond_to do |format|\n format.html { redirect_to bids_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bid = Bid.find(params[:id])\n @bid.destroy\n\n respond_to do |format|\n format.html { redirect_to bids_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bow.destroy\n respond_to do |format|\n format.html { redirect_to bows_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business = current_user.owned_businesses.find(params[:id])\n @business.destroy\n\n respond_to do |format|\n format.html { redirect_to businesses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bbhk.destroy\n respond_to do |format|\n format.html { redirect_to bbhks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cook_book = CookBook.find(params[:id])\n @cook_book.destroy\n\n respond_to do |format|\n format.html { redirect_to cook_books_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mybusiness.destroy\n respond_to do |format|\n format.html { redirect_to mybusinesses_url, notice: 'Mybusiness was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ebook.destroy\n respond_to do |format|\n format.html { redirect_to ebooks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @biography_book.destroy\n respond_to do |format|\n format.html { redirect_to biography_books_url, notice: \"Biography review was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Item.delete(params[\"id\"])\n end",
"def destroy\n @readbook.destroy\n respond_to do |format|\n format.html { redirect_to readbooks_url, notice: 'Readbook was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cookbook.destroy\n respond_to do |format|\n format.html { redirect_to cookbooks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @addbook = Addbook.find(params[:id])\n @addbook.destroy\n\n respond_to do |format|\n format.html { redirect_to(addbooks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @bacon.destroy\n respond_to do |format|\n format.html { redirect_to bacons_url }\n format.json { head :no_content }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @bb.destroy\n respond_to do |format|\n format.html { redirect_to bbs_url, notice: 'Bb was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book = Book.find(params[:id])\n @book.destroy\n \n respond_to do |format|\n format.html { redirect_to(books_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @book = Book.find_by_id(params[:id])\n if @book.present?\n if @book.destroy\n render json: {\n type: 'success',\n result: {}\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",
"def destroy\n @bicicletum.destroy\n respond_to do |format|\n format.html { redirect_to bicicleta_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @bookitem.destroy\n respond_to do |format|\n format.html { redirect_to bookitems_url, notice: \"Bookitem was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bookitem.destroy\n respond_to do |format|\n format.html { redirect_to bookitems_url, notice: 'Bookitem was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @operation.destroy\n respond_to do |format|\n format.html { redirect_to bank_books_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bookcabinet.destroy\n respond_to do |format|\n format.html { redirect_to bookcabinets_url, notice: 'Bookcabinet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book1.destroy\n respond_to do |format|\n format.html { redirect_to book1s_url, notice: \"Book1 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_uri, notice: '本を削除しました。' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bidding = Bidding.find(params[:id])\n @bidding.destroy\n\n respond_to do |format|\n format.html { redirect_to biddings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bob = Bob.find(params[:id])\n @bob.destroy\n\n respond_to do |format|\n format.html { redirect_to bobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url, notice: '削除されました。' }\n format.json { head :no_content }\n end\n end"
] | [
"0.72218",
"0.7198506",
"0.7082027",
"0.7044859",
"0.6987978",
"0.6974579",
"0.6963525",
"0.6953768",
"0.6933736",
"0.6933736",
"0.6932949",
"0.69251823",
"0.69176364",
"0.69176364",
"0.69176364",
"0.69176364",
"0.69176364",
"0.69176364",
"0.69176364",
"0.69176364",
"0.69176364",
"0.69176364",
"0.69176364",
"0.69176364",
"0.6910351",
"0.6903573",
"0.6894569",
"0.68894124",
"0.6885215",
"0.68775225",
"0.6863383",
"0.68593496",
"0.6840846",
"0.6823813",
"0.6823813",
"0.6823813",
"0.6823813",
"0.6823813",
"0.6823813",
"0.6823813",
"0.6822031",
"0.6802966",
"0.67988104",
"0.67988104",
"0.67988104",
"0.67988104",
"0.67988104",
"0.67988104",
"0.67988104",
"0.6794772",
"0.6793119",
"0.67808807",
"0.67805284",
"0.6774094",
"0.67732245",
"0.67722625",
"0.67699677",
"0.67699677",
"0.67699677",
"0.67699677",
"0.6749174",
"0.6746708",
"0.6734796",
"0.6733607",
"0.6732579",
"0.6732579",
"0.6729252",
"0.672309",
"0.67225266",
"0.6708947",
"0.670572",
"0.670439",
"0.670439",
"0.67015845",
"0.6696466",
"0.66958773",
"0.669003",
"0.66854584",
"0.6684769",
"0.6674083",
"0.6664069",
"0.66627574",
"0.6659302",
"0.66511345",
"0.6647013",
"0.66416097",
"0.6634459",
"0.66296047",
"0.66289294",
"0.6628722",
"0.66239506",
"0.6623426",
"0.66222984",
"0.6621032",
"0.661801",
"0.6612701",
"0.66100746",
"0.66097414",
"0.66096765",
"0.6607348"
] | 0.77143854 | 0 |
GET /admin/digersayfas GET /admin/digersayfas.json | def index
@admin_digersayfas = Admin::Digersayfa.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_admin_digersayfa\n @admin_digersayfa = Admin::Digersayfa.find(params[:id])\n end",
"def index\n return if !current_user.admin?\n @disfrazs = Disfraz.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @disfrazs }\n end\n end",
"def update\n respond_to do |format|\n if @admin_digersayfa.update(admin_digersayfa_params)\n format.html { redirect_to @admin_digersayfa, notice: 'Digersayfa was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_digersayfa }\n else\n format.html { render :edit }\n format.json { render json: @admin_digersayfa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @plan = Plan.find(params[:id])\n @plan_days = @plan.plan_days\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plan }\n end\n end",
"def destroy\n @admin_digersayfa.destroy\n respond_to do |format|\n format.html { redirect_to admin_digersayfas_url, notice: 'Digersayfa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @admin_pricing_foams = Admin::Pricing::Foam.all.paginate(page: params[:page])\n\n respond_to do |format|\n format.html\n format.json { render json: @admin_pricing_foams.map { |i| { value: i.id, text: i.to_s } }, status: :ok }\n end\n end",
"def index\n @admin_pricing_fabrics = Admin::Pricing::Fabric.all.paginate(page: params[:page])\n\n respond_to do |format|\n format.html\n format.json { render json: @admin_pricing_fabrics.map { |i| { value: i.id, text: i.to_s } }, status: :ok }\n end\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def index\n @frais_annexes = FraisAnnex.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_annexes }\n end\n end",
"def index\n @appraisal_fees = AppraisalFee.all\n end",
"def get_all_taxes\n self.class.get(\"/aldebaran-taxes/v2/taxes\", :basic_auth => @auth)\n end",
"def index\n @taxes = Tax.all\n\n render json: @taxes\n end",
"def index\n @days = @trip.days.order(trip_day: :asc)\n render json: @days, include: [:activities]\n end",
"def index\r\n @classdays = Classday.all\r\n\r\n render json: @classdays\r\n end",
"def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end",
"def index\n @disfrazs = Disfraz.all\n end",
"def index\n # @weekdays = Weekday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Oj.dump(@weekdays, mode: :compat) }\n end\n end",
"def employee_vacations\n #vacaciones de este año\n vacations = Employee.find(params[:id]).get_vacation_days\n\n respond_to do |format|\n format.json { render json: vacations }\n end\n end",
"def index\n @pendaftaran_kelas = PendaftaranKela.all\n end",
"def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end",
"def index\n\n respond_to do |format| \n format.html do\n @days = Day.all\n # Movement.permitted_for_user(@current_user).pluck(day)\n\n end\n format.json do\n end\n\n end\n\n end",
"def show\n @kf_diary = Kf::Diary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kf_diary }\n end\n end",
"def flights_fields\n render json: Search.getFlightsFieldInfo()\n end",
"def index\n @kegiatans = Kegiatan.all\n end",
"def index\n @shipping_fees = ShippingFee.all\n end",
"def index\n @funds = Fund.all\n\n render json: @funds\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @devans }\n end\n end",
"def show\n @admin_fund = Fund.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_fund }\n end\n end",
"def index\n @dnas = Dna.all\n\n render json: @dnas\n end",
"def show\n @transportadora_fiscal_pass = Transportadora::FiscalPasse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @transportadora_fiscal_pass }\n end\n end",
"def index\n @daps = @farmer.daps.page(params[:page]).per(20)\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb (no data required)\n f = find_budgets\n format.ext_json { render :json => f.to_ext_json(:class => :budget, \n :count => f.length,\n :methods=>[:total_budget_costs,:total_budget_invoices,:total_budget_pricings],\n :include=>{:user=>{:only=>\"login\"}}) }\n \n end\n end",
"def index\n @fdsbanks = Fdsbank.all\n #초기 화면에서 hyperledger 데이터 호출\n @hyperledger_response = JSON.parse(query_from_hyperledger(\"fdsGetAllFraudEntries\",nil))\n logger.debug \"hyperledger_response$$$$$$$$$$$$$ #{@hyperledger_response}\"\n @hyperledger_result_list = @hyperledger_response[\"result\"][\"message\"]\n logger.debug \"hyperledger_response_message$$$$$$$$$$$$$ #{@hyperledger_result_list}\"\n @parsed_hyperledger_result_list = JSON.parse(@hyperledger_result_list.tr(\"\\\\\", \"\"))\n logger.debug \"parsed_hyperledger_response_message$$$$$$$$$$$$$ #{@parsed_hyperledger_result_list}\"\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @parsed_hyperledger_result_list}\n end\n end",
"def index\n @departamentos = Departamento.all\n\n render json: @departamentos\n end",
"def index \n fans = Fan.all \n render json: fans \n end",
"def index\n puts session[:_csrf_token]\n @departments = Department.all\n render json: @departments, status: :ok\n end",
"def index\n @tenant_fees = current_account.tenant_fees\n end",
"def index\n @karyalay_caterers = KaryalayCaterer.all\n render json: @karyalay_caterers\n end",
"def index\n @frais_repas = FraisRepa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_repas }\n end\n end",
"def index\n @sgda_seller_goal_days = SgdaSellerGoalDay.all\n end",
"def show\n json = self.as_json(only: [:created_at, :version])\n json['url'] = doi_url\n json\n end",
"def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end",
"def show\n @gaz_assay = GazAssay.find(params[:id])\n @authorized_user = User.find(session[:user_id])\n respond_to do |format|\n format.html {render layout: false}\n format.json { render json: @gaz_assay }\n end\n end",
"def index\n @essays = Essay.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @essays }\n end\n end",
"def arrivals(lang = 'is')\n Apis.client.get(\"/flight?type=arrivals&language=#{lang}\")\n end",
"def admin_digersayfa_params\n params.require(:admin_digersayfa).permit(:baslik, :metin, :tur, :dosya) \n end",
"def index\n @dias_semanas_vagas = DiasSemanasVaga.all\n end",
"def consultarFtp\n #Antes de procesar las ordenes, se actualiza la Bodega\n IniciarBodega.new('grupo7').actualizarBodega\n #Se consulta las ordenes\n ordenesConsultadas= ConsultarPedidosFtp.new.consultarOcsFTP\n render json: ordenesConsultadas\nend",
"def index\n render json: @fiestas\n end",
"def index\n @desafios = Desafio.all\n end",
"def index\n @admin_selling_config_days_to_completes = Admin::Selling::Config::DaysToComplete.all.paginate(page: params[:page])\n\n respond_to do |format|\n format.html\n format.json { render json: @admin_selling_config_days_to_completes.map { |i| { value: i.id, text: i.to_s } }, status: :ok }\n end\n end",
"def index\n @f_dzakirs = FDzakir.all\n end",
"def index\n @charges = Charge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @charges }\n end\n end",
"def create\n @admin_digersayfa = Admin::Digersayfa.new(admin_digersayfa_params)\n @turad = { 0 => \"Bilim İnsanları\", 1 => \"Resmi Evraklar\", 2 => \"İlginç Bilgiler\", 3 => \"Motivasyon\", 4 => \"Sınav Sistemi\"}\n @tur = { 0 => \"biliminsanlari\", 1 => \"resmievraklar\", 2 => \"ilgincbilgiler\", 3 => \"motivasyon\", 4 => \"sinavsistemi\"}\n\n respond_to do |format|\n if @admin_digersayfa.save\n Admin::Duyuru.create(aciklama: @admin_digersayfa.created_at.to_s.split(\" \")[0] + \" \" + @turad[@admin_digersayfa.tur] + \" \" + @admin_digersayfa.baslik + \" yazısı eklenmiştir.<a href=/\" + @tur[@admin_digersayfa.tur] + \"> Yazıya ulaşmak için tıklayınız. </a>\", tur: 0)\n format.html { redirect_to @admin_digersayfa, notice: 'Yazı başarılı bir şekilde oluşturuldu.' }\n format.json { render :show, status: :created, location: @admin_digersayfa }\n else\n format.html { render :new }\n format.json { render json: @admin_digersayfa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @service_development_costs }\n end\n end",
"def show\n return if !current_user.admin?\n @disfraz = Disfraz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @disfraz }\n end\n end",
"def index\n @feiras = Feira.all\n end",
"def index\n @dacs = @farmer.dacs.page(params[:page]).per(20)\n end",
"def index\n @calificaciones = Calificacion.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @calificaciones }\n end\n end",
"def index\n @asignaciones = Asignacione.all\n end",
"def index\n @daw_alianzas = DawAlianza.all\n end",
"def index\n @frais_hebergements = FraisHebergement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_hebergements }\n end\n end",
"def dayIndex\n render json: Restaurant.restaurantsDay\n end",
"def index\n @faltas = Falta.all\n end",
"def index\n @filials = Filial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @filials }\n end\n end",
"def show\n @frais_annex = FraisAnnex.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @frais_annex }\n end\n end",
"def index\n\t\tvendas = Venda.all\n\t\trender json: vendas, status: :ok\n\tend",
"def show\n #@klass_fee = KlassFee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @klass_fee }\n end\n end",
"def index\n @dia_eventos = DiaEvento.all\n render json: @dia_eventos\n end",
"def index\n @notadedebito = Notadedebito.find(params[:notadedebito_id])\n @renglon_nddndcs = @notadedebito.renglon_nddndcs\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_nddndcs }\n end\n end",
"def index\n @fretes = Frete.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fretes }\n end\n end",
"def index\n @unidades_federativas = UnidadeFederativa.all\n end",
"def index\n @adversaires = Adversaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @adversaires }\n end\n end",
"def index\n @dfacturas = Dfactura.all\n end",
"def index\n @holidays = Holiday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidays }\n end\n end",
"def index\n @plan_de_venta = PlanDeVentum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plan_de_venta }\n end\n end",
"def index\n @ra_khoi_dangs = RaKhoiDang.all\n end",
"def list_backoffice_information_for_arrays_for_tenant(args = {}) \n get(\"/tenants.json/backoffice/arrays/#{args[:tenantId]}\", args)\nend",
"def index\n @degres = Degre.all\n end",
"def index\n find_dependencias\n respond_to do |format|\n format.html\n format.json { render :json => @dependencias.to_json(:methods => :alias_or_fullname, :only => [:id, :codigo, :nombre])}\n\n end\n end",
"def show\n @assay = Assay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assay }\n end\n end",
"def index\n @funcionalidads = Funcionalidad.all\n end",
"def index\n @gifdays = Gifday.all\n \n end",
"def index\n @attendees = Attendees.all\n render json: @attendees\n end",
"def index\n @finance_leads = FinanceLead.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @finance_leads }\n end\n end",
"def index\n @pay_fees = PayFee.all\n end",
"def show\n @hack = Hack.find(params[:id])\n @hacks = Hack.all\n @voters = Voter.all\n @departments = ['Analytics','Rails','WEB TEAM','Clients','Core Services','Infrastructure','Other','Product','UX']\n @vote_directions = Vote.select(\"id AS x,direction AS y\").order(\"created_at\").limit(40).to_json\n @vote_times = Vote.select(\"created_at\").order(\"created_at\").to_json\n\n respond_to do |format|\n format.html # show.html.erb}\n format.json { render json: @hack }\n end\n end",
"def index\n @spoofers = Spoofer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spoofers }\n end\n end",
"def index\n @gpsds = Gpsd.all\n #respond_to do |format|\n # format.json { render }\n #end\n end",
"def index\n @funkces = Funkce.all\n end",
"def index\n @entries = Entry.order(\"created_at DESC\").includes(:user)\n @days_left = ( Date.new( 2013, 06, 23 ) - Date.today ).to_i\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entries }\n end\n end",
"def index\n @asignaturas = Asignatura.all\n end",
"def show\n render json: @fund\n end",
"def index\n @flights = Flight.all\n render json: @flights\n end",
"def index\n @zayavks = Zayavk.all\n end",
"def index\n @planificaciones = Planificacion.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @planificaciones }\n end\n end",
"def index\n @flyer_infos = FlyerInfo.all(:select => \"id, topimg, sideimg, capacity, speed, stormresist, multiplier, price, tier, load_time, disabled\")\n @language = ApplicationHelper.preferred_language(request.headers[\"Accept-Language\"])\n\n @complete_flyers = @flyer_infos.collect { |flyer_info|\n flyer_info.as_json.merge(FlyerInfosHelper.getflyerloc(flyer_info, @language).first.as_json)\n }\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @complete_flyers }\n end\n end",
"def index\n @pendaftarans = Pendaftaran.all\n end",
"def index\n @ways_of_admissions = WaysOfAdmission.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ways_of_admissions }\n end\n end",
"def entries\n uri = URI(BASE_URL + ENTRIES_ENDPOINT + days_query)\n\n make_request(uri)\n end"
] | [
"0.6332812",
"0.5838458",
"0.5823415",
"0.5746072",
"0.5675711",
"0.5658039",
"0.5600863",
"0.55869013",
"0.5580449",
"0.5578242",
"0.5536106",
"0.5519336",
"0.5491851",
"0.5478802",
"0.54681295",
"0.54366094",
"0.5430967",
"0.54264057",
"0.5415979",
"0.54115105",
"0.5406339",
"0.53944105",
"0.538999",
"0.53897154",
"0.5382546",
"0.5381569",
"0.5380485",
"0.53757393",
"0.53600276",
"0.53522605",
"0.5351924",
"0.5350489",
"0.534888",
"0.5347326",
"0.5343595",
"0.53366244",
"0.53281873",
"0.5321264",
"0.5319094",
"0.5318119",
"0.53125083",
"0.53123003",
"0.5310452",
"0.5309728",
"0.53041375",
"0.5300643",
"0.5296371",
"0.5288543",
"0.52877384",
"0.52874094",
"0.52855587",
"0.52837235",
"0.528347",
"0.5280324",
"0.5271955",
"0.52597576",
"0.52582425",
"0.5254121",
"0.5250221",
"0.5246252",
"0.5245056",
"0.52448505",
"0.52373725",
"0.5234828",
"0.52280253",
"0.5227046",
"0.5217811",
"0.5213511",
"0.5210492",
"0.5204438",
"0.519873",
"0.5191474",
"0.51914114",
"0.51894766",
"0.51894766",
"0.51845384",
"0.51819956",
"0.5181834",
"0.51789933",
"0.51785326",
"0.5174077",
"0.51737434",
"0.5171967",
"0.5167546",
"0.5166638",
"0.51635927",
"0.51493216",
"0.51477474",
"0.5139649",
"0.51379865",
"0.51348543",
"0.513459",
"0.51312655",
"0.5130176",
"0.5129007",
"0.5127147",
"0.51248336",
"0.51183295",
"0.51177156",
"0.51140684"
] | 0.7174638 | 0 |
GET /admin/digersayfas/1 GET /admin/digersayfas/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @admin_digersayfas = Admin::Digersayfa.all\n end",
"def set_admin_digersayfa\n @admin_digersayfa = Admin::Digersayfa.find(params[:id])\n end",
"def show\n @plan = Plan.find(params[:id])\n @plan_days = @plan.plan_days\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plan }\n end\n end",
"def index\n return if !current_user.admin?\n @disfrazs = Disfraz.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @disfrazs }\n end\n end",
"def update\n respond_to do |format|\n if @admin_digersayfa.update(admin_digersayfa_params)\n format.html { redirect_to @admin_digersayfa, notice: 'Digersayfa was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_digersayfa }\n else\n format.html { render :edit }\n format.json { render json: @admin_digersayfa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @admin_fund = Fund.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_fund }\n end\n end",
"def index\n @taxes = Tax.all\n\n render json: @taxes\n end",
"def index\n @admin_pricing_fabrics = Admin::Pricing::Fabric.all.paginate(page: params[:page])\n\n respond_to do |format|\n format.html\n format.json { render json: @admin_pricing_fabrics.map { |i| { value: i.id, text: i.to_s } }, status: :ok }\n end\n end",
"def show\n json = self.as_json(only: [:created_at, :version])\n json['url'] = doi_url\n json\n end",
"def index\n @admin_pricing_foams = Admin::Pricing::Foam.all.paginate(page: params[:page])\n\n respond_to do |format|\n format.html\n format.json { render json: @admin_pricing_foams.map { |i| { value: i.id, text: i.to_s } }, status: :ok }\n end\n end",
"def show\n @kf_diary = Kf::Diary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kf_diary }\n end\n end",
"def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end",
"def index\n @days = @trip.days.order(trip_day: :asc)\n render json: @days, include: [:activities]\n end",
"def employee_vacations\n #vacaciones de este año\n vacations = Employee.find(params[:id]).get_vacation_days\n\n respond_to do |format|\n format.json { render json: vacations }\n end\n end",
"def index\r\n @classdays = Classday.all\r\n\r\n render json: @classdays\r\n end",
"def destroy\n @admin_digersayfa.destroy\n respond_to do |format|\n format.html { redirect_to admin_digersayfas_url, notice: 'Digersayfa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @service_development_costs }\n end\n end",
"def index\n # @weekdays = Weekday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Oj.dump(@weekdays, mode: :compat) }\n end\n end",
"def dayIndex\n render json: Restaurant.restaurantsDay\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @devans }\n end\n end",
"def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end",
"def show\n return if !current_user.admin?\n @disfraz = Disfraz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @disfraz }\n end\n end",
"def index\n @karyalay_caterers = KaryalayCaterer.all\n render json: @karyalay_caterers\n end",
"def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb (no data required)\n f = find_budgets\n format.ext_json { render :json => f.to_ext_json(:class => :budget, \n :count => f.length,\n :methods=>[:total_budget_costs,:total_budget_invoices,:total_budget_pricings],\n :include=>{:user=>{:only=>\"login\"}}) }\n \n end\n end",
"def index\n\n respond_to do |format| \n format.html do\n @days = Day.all\n # Movement.permitted_for_user(@current_user).pluck(day)\n\n end\n format.json do\n end\n\n end\n\n end",
"def show\n @gaz_assay = GazAssay.find(params[:id])\n @authorized_user = User.find(session[:user_id])\n respond_to do |format|\n format.html {render layout: false}\n format.json { render json: @gaz_assay }\n end\n end",
"def show\n @essay = Essay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @essay }\n end\n end",
"def index\n @essays = Essay.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @essays }\n end\n end",
"def show\n @tenant = keystone.get_tenant(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tenant }\n end\n end",
"def index\n @charges = Charge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @charges }\n end\n end",
"def show\n @assay = Assay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assay }\n end\n end",
"def show\n #@klass_fee = KlassFee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @klass_fee }\n end\n end",
"def index\n @frais_annexes = FraisAnnex.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_annexes }\n end\n end",
"def index\n @funds = Fund.all\n\n render json: @funds\n end",
"def index\n @admin_selling_config_days_to_completes = Admin::Selling::Config::DaysToComplete.all.paginate(page: params[:page])\n\n respond_to do |format|\n format.html\n format.json { render json: @admin_selling_config_days_to_completes.map { |i| { value: i.id, text: i.to_s } }, status: :ok }\n end\n end",
"def show\n render json: @diet, status: 200, root: true\n end",
"def show\n @transportadora_fiscal_pass = Transportadora::FiscalPasse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @transportadora_fiscal_pass }\n end\n end",
"def index\n @adversaires = Adversaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @adversaires }\n end\n end",
"def index\n data = get_index_data\n @dayoffs = data.page(params[:current_page]).per(PER_PAGE)\n respond_to do |format|\n format.html {\n render \"dashboards/admin_dashboard\"\n }\n\n format.json {\n render json: {\n total_page: @data.total_page,\n data: ActiveModel::SerializableResource.new(@dayoffs, each_serializer: AdminDayoffSerializer)\n }, status: :ok\n }\n end\n end",
"def show\n @hack = Hack.find(params[:id])\n @hacks = Hack.all\n @voters = Voter.all\n @departments = ['Analytics','Rails','WEB TEAM','Clients','Core Services','Infrastructure','Other','Product','UX']\n @vote_directions = Vote.select(\"id AS x,direction AS y\").order(\"created_at\").limit(40).to_json\n @vote_times = Vote.select(\"created_at\").order(\"created_at\").to_json\n\n respond_to do |format|\n format.html # show.html.erb}\n format.json { render json: @hack }\n end\n end",
"def details\n @daily_deal = DailyDeal.find(params[:id])\n respond_to do |format|\n format.json do\n render with_api_version\n end\n end\n end",
"def index\n @digital_editions = DigitalEdition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @digital_editions }\n end\n end",
"def index\n @calificaciones = Calificacion.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @calificaciones }\n end\n end",
"def index\n @notadedebito = Notadedebito.find(params[:notadedebito_id])\n @renglon_nddndcs = @notadedebito.renglon_nddndcs\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_nddndcs }\n end\n end",
"def index\n @dnas = Dna.all\n\n render json: @dnas\n end",
"def show\n render json: @tax\n end",
"def index\n @admin_guests = Guest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_guests }\n end\n end",
"def index\n @planificaciones = Planificacion.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @planificaciones }\n end\n end",
"def index\n @plan_de_venta = PlanDeVentum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plan_de_venta }\n end\n end",
"def get_all_taxes\n self.class.get(\"/aldebaran-taxes/v2/taxes\", :basic_auth => @auth)\n end",
"def show\n @fund = Fund.friendly.find(params[:id])\n\n render json: @fund\n end",
"def index \n fans = Fan.all \n render json: fans \n end",
"def show\n @aliexpress = Aliexpress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aliexpress }\n end\n end",
"def show\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotelstaticdatagd }\n end\n end",
"def index\n @dia_eventos = DiaEvento.all\n render json: @dia_eventos\n end",
"def index\n @departamentos = Departamento.all\n\n render json: @departamentos\n end",
"def show\n @nguoi_dung = NguoiDung.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nguoi_dung }\n end\n end",
"def show\n @admin_payment_method = Admin::AccountsPaymentMethod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_payment_method }\n end\n end",
"def list_backoffice_information_for_arrays_for_tenant(args = {}) \n get(\"/tenants.json/backoffice/arrays/#{args[:tenantId]}\", args)\nend",
"def index\n @ways_of_admissions = WaysOfAdmission.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ways_of_admissions }\n end\n end",
"def index\n @kegiatans = Kegiatan.all\n end",
"def show\n @frais_annex = FraisAnnex.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @frais_annex }\n end\n end",
"def show\n @kalplan_tltle = KalplanTltle.find(params[:id])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kalplan_tltle }\n end\n end",
"def index\n @flyer_infos = FlyerInfo.all(:select => \"id, topimg, sideimg, capacity, speed, stormresist, multiplier, price, tier, load_time, disabled\")\n @language = ApplicationHelper.preferred_language(request.headers[\"Accept-Language\"])\n\n @complete_flyers = @flyer_infos.collect { |flyer_info|\n flyer_info.as_json.merge(FlyerInfosHelper.getflyerloc(flyer_info, @language).first.as_json)\n }\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @complete_flyers }\n end\n end",
"def show\n render json: @fund\n end",
"def show\n render json: @vat\n end",
"def show\n @all_type=Api::V1::AdminType.all\n render json: @all_type\n end",
"def index\n @taxes = params['item_id'] ? Item.find(params['item_id']).taxes : Tax.all\n render json: @taxes\n end",
"def show\n @days_since_visit = DaysSinceVisit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @days_since_visit }\n end\n end",
"def index\n @admin_versions = Admin::Version.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_versions }\n end\n end",
"def index\n find_dependencias\n respond_to do |format|\n format.html\n format.json { render :json => @dependencias.to_json(:methods => :alias_or_fullname, :only => [:id, :codigo, :nombre])}\n\n end\n end",
"def index\n @admin_agencies = Admin::Agency.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_agencies }\n end\n end",
"def show\n @denuncia_tipo = DenunciaTipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denuncia_tipo }\n end\n end",
"def index\n @appraisal_fees = AppraisalFee.all\n end",
"def show\n @aliquotum = Aliquotum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aliquotum }\n end\n end",
"def index\n @frais_repas = FraisRepa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_repas }\n end\n end",
"def index\n @diaries = current_user.diaries.all\n respond_to do |format|\n format.html {render :index}\n format.json { render json: @diaries }\n end\n end",
"def show\n @vital_sign = VitalSign.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vital_sign }\n end\n end",
"def show\n @tenant = Tenant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tenant }\n end\n end",
"def index\n puts session[:_csrf_token]\n @departments = Department.all\n render json: @departments, status: :ok\n end",
"def show\n @fundraiser = Fundraiser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundraiser }\n end\n end",
"def show\n @fundraiser = Fundraiser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundraiser }\n end\n end",
"def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end",
"def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end",
"def show\n respond_to do |format|\n format.html \n # format.json { render json: @day_availability }\n end\n end",
"def show\n @daily_price = DailyPrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @daily_price }\n end\n end",
"def index\n\t\tvendas = Venda.all\n\t\trender json: vendas, status: :ok\n\tend",
"def index\n @attendees = Attendees.all\n render json: @attendees\n end",
"def show\n @gpath = Gpath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gpath }\n end\n end",
"def index\n # Retrieve kpis templates from impac api.\n # TODO: improve request params to work for strong parameters\n attrs = params.slice('metadata', 'opts')\n auth = { username: MnoEnterprise.tenant_id, password: MnoEnterprise.tenant_key }\n\n response = begin\n MnoEnterprise::ImpacClient.send_get('/api/v2/kpis', attrs, basic_auth: auth)\n rescue => e\n return render json: { message: \"Unable to retrieve kpis from Impac API | Error #{e}\" }\n end\n\n # customise available kpis\n kpis = (response['kpis'] || []).map do |kpi|\n kpi = kpi.with_indifferent_access\n kpi[:watchables].map do |watchable|\n kpi.merge(\n name: \"#{kpi[:name]} #{watchable.capitalize unless kpi[:name].downcase.index(watchable)}\".strip,\n watchables: [watchable],\n target_placeholders: {watchable => kpi[:target_placeholders][watchable]},\n )\n end\n end\n .flatten\n\n render json: { kpis: kpis }\n end",
"def show\n @calificacion_servicio = CalificacionServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calificacion_servicio }\n end\n end",
"def show\n @gowalla_total_checkin = GowallaTotalCheckin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gowalla_total_checkin }\n end\n end",
"def show\n @daily_exercise = DailyExercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @daily_exercise }\n end\n end",
"def index\n @disfrazs = Disfraz.all\n end",
"def show\n @deporte= set_deporte\n render json: @deporte, status: :ok\n\n end",
"def index\n @daps = @farmer.daps.page(params[:page]).per(20)\n end",
"def show\n @dayoff = Dayoff.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dayoff }\n end\n end",
"def index\n @dossiers = Dossier.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dossiers }\n end\n end",
"def show\n @dataload_ga = DataloadGa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dataload_ga }\n end\n end"
] | [
"0.70862883",
"0.6558961",
"0.6136362",
"0.59907556",
"0.5906217",
"0.5857102",
"0.57937604",
"0.5792702",
"0.5788913",
"0.57844335",
"0.5750954",
"0.5741722",
"0.57402575",
"0.5707392",
"0.569033",
"0.5659121",
"0.5651803",
"0.56509614",
"0.5648965",
"0.5644548",
"0.56415737",
"0.56306636",
"0.5622333",
"0.5614289",
"0.5606878",
"0.5606715",
"0.5604266",
"0.55963135",
"0.5596278",
"0.5594485",
"0.55872947",
"0.5585124",
"0.5575844",
"0.5572231",
"0.5557391",
"0.55455816",
"0.5535734",
"0.55140597",
"0.5511183",
"0.5502639",
"0.5498917",
"0.5497705",
"0.5486616",
"0.54778576",
"0.54689574",
"0.5468161",
"0.5457221",
"0.5456994",
"0.5455333",
"0.5450468",
"0.5448966",
"0.54488856",
"0.54487044",
"0.5446911",
"0.5440082",
"0.54388404",
"0.54361534",
"0.5436056",
"0.54354477",
"0.54279286",
"0.5427891",
"0.542756",
"0.54236436",
"0.5422329",
"0.5420102",
"0.5415133",
"0.54081666",
"0.5407836",
"0.54057425",
"0.5403026",
"0.5395237",
"0.53950155",
"0.539386",
"0.5389599",
"0.5388317",
"0.5387502",
"0.5385161",
"0.5381286",
"0.5380759",
"0.53744113",
"0.5369961",
"0.5366947",
"0.53655285",
"0.53655285",
"0.53644615",
"0.53644615",
"0.5363021",
"0.535727",
"0.5352814",
"0.53522515",
"0.53487724",
"0.53443974",
"0.5343271",
"0.5343151",
"0.5339427",
"0.5337087",
"0.5337068",
"0.5335667",
"0.5335168",
"0.5333715",
"0.5333249"
] | 0.0 | -1 |
POST /admin/digersayfas POST /admin/digersayfas.json | def create
@admin_digersayfa = Admin::Digersayfa.new(admin_digersayfa_params)
@turad = { 0 => "Bilim İnsanları", 1 => "Resmi Evraklar", 2 => "İlginç Bilgiler", 3 => "Motivasyon", 4 => "Sınav Sistemi"}
@tur = { 0 => "biliminsanlari", 1 => "resmievraklar", 2 => "ilgincbilgiler", 3 => "motivasyon", 4 => "sinavsistemi"}
respond_to do |format|
if @admin_digersayfa.save
Admin::Duyuru.create(aciklama: @admin_digersayfa.created_at.to_s.split(" ")[0] + " " + @turad[@admin_digersayfa.tur] + " " + @admin_digersayfa.baslik + " yazısı eklenmiştir.<a href=/" + @tur[@admin_digersayfa.tur] + "> Yazıya ulaşmak için tıklayınız. </a>", tur: 0)
format.html { redirect_to @admin_digersayfa, notice: 'Yazı başarılı bir şekilde oluşturuldu.' }
format.json { render :show, status: :created, location: @admin_digersayfa }
else
format.html { render :new }
format.json { render json: @admin_digersayfa.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def admin_digersayfa_params\n params.require(:admin_digersayfa).permit(:baslik, :metin, :tur, :dosya) \n end",
"def update\n respond_to do |format|\n if @admin_digersayfa.update(admin_digersayfa_params)\n format.html { redirect_to @admin_digersayfa, notice: 'Digersayfa was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_digersayfa }\n else\n format.html { render :edit }\n format.json { render json: @admin_digersayfa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend",
"def create\n @gaz_assay = GazAssay.new(params[:gaz_assay])\n @authorized_user = User.find(session[:user_id])\n respond_to do |format|\n if @gaz_assay.save\n format.html { redirect_to gaz_assays_url, notice: 'Данные нового анализа газа успешно записаны.' }\n format.json { render json: @gaz_assay, status: :created, location: @gaz_assay }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gaz_assay.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @admin_digersayfas = Admin::Digersayfa.all\n end",
"def create\n @sanchaypatra = current_user.sanchaypatras.new(sanchaypatra_params)\n @sanchaypatra.generate_tokens\n\n respond_to do |format|\n if @sanchaypatra.save\n format.html { redirect_to sanchaypatras_url, notice: 'Sanchaypatra was successfully created.' }\n format.json { render :show, status: :created, location: @sanchaypatra }\n else\n format.html { render :new }\n format.json { render json: @sanchaypatra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_despesa = TipoDespesa.new(tipo_despesa_params)\n\n respond_to do |format|\n if @tipo_despesa.save\n format.html { redirect_to tenant_tipo_despesas_path(tenant_id: @tenant.id), notice: 'Tipo despesa was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_despesa }\n else\n format.html { render :new }\n format.json { render json: @tipo_despesa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @shipping_fee = ShippingFee.new(shipping_fee_params)\n\n respond_to do |format|\n if @shipping_fee.save\n format.html { redirect_to action: :index, notice: 'Create Success.' }\n format.json { render action: :index, status: :created }\n else\n format.html { render action: :new }\n format.json { render json: @shipping_fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @admin_digersayfa.destroy\n respond_to do |format|\n format.html { redirect_to admin_digersayfas_url, notice: 'Digersayfa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @sgda_seller_goal_day = SgdaSellerGoalDay.new(sgda_seller_goal_day_params)\n\n respond_to do |format|\n if @sgda_seller_goal_day.save\n format.html { redirect_to @sgda_seller_goal_day, notice: 'Sgda seller goal day was successfully created.' }\n format.json { render :show, status: :created, location: @sgda_seller_goal_day }\n else\n format.html { render :new }\n format.json { render json: @sgda_seller_goal_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_admin_digersayfa\n @admin_digersayfa = Admin::Digersayfa.find(params[:id])\n end",
"def tank_fuelday_params\n params.require(:tank_fuelday).permit(:day, :data_asset_id, :user_id, :employee_id, :site_asset_id, asset_fueldays_attributes: AssetFuelday.attribute_names.map(&:to_sym).push(:_destroy))\n end",
"def create\n @masut_assay = MasutAssay.new(params[:masut_assay])\n\n respond_to do |format|\n if @masut_assay.save\n format.html { redirect_to masut_assays_url, notice: 'Данные нового анализа мазута успешно записаны.' }\n format.json { render json: @masut_assay, status: :created, location: @masut_assay }\n else\n format.html { render action: \"new\" }\n format.json { render json: @masut_assay.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pendaftaran_kela = PendaftaranKela.new(pendaftaran_kela_params)\n\n respond_to do |format|\n if @pendaftaran_kela.save\n format.html { redirect_to @pendaftaran_kela, notice: 'Pendaftaran kela was successfully created.' }\n format.json { render :show, status: :created, location: @pendaftaran_kela }\n else\n format.html { render :new }\n format.json { render json: @pendaftaran_kela.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n dns_entry_response = RestClient.post('https://api.cloudflare.com/client/v4/zones/:zone_identifier/dns_records',:content_type => :json, :accept => :json, :'x-auth-key' => session[:key] :'x-auth-email' => session[:email])\n\n if JSON.parse(dns_entry_response)[\"success\"]\n @dns_entry = DnsEntry.new(dns_entry_params)\n\n respond_to do |format|\n if @dns_entry.save\n format.html { redirect_to @dns_entry, notice: \"Dns entry was successfully created.\" }\n format.json { render :show, status: :created, location: @dns_entry }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @dns_entry.errors, status: :unprocessable_entity }\n end\n end \n\n end\n\n\n end",
"def create\n @disfraz = Disfraz.new(disfraz_params)\n\n respond_to do |format|\n if @disfraz.save\n format.html { redirect_to @disfraz, notice: 'Disfraz was successfully created.' }\n format.json { render :show, status: :created, location: @disfraz }\n else\n format.html { render :new }\n format.json { render json: @disfraz.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @hospitalization_day = @adverse_event.hospitalization_days.create(hospitalization_day_params)\n\n respond_to do |format|\n if @hospitalization_day.save\n format.html { redirect_to adverse_event_path(@adverse_event), notice: 'Día de estancia ingresado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @hospitalization_day }\n else\n format.html { render :new }\n format.json { render json: @hospitalization_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kegiatan = Kegiatan.new(kegiatan_params)\n\n respond_to do |format|\n if @kegiatan.save\n format.html { redirect_to @kegiatan, notice: 'Kegiatan was successfully created.' }\n format.json { render :show, status: :created, location: @kegiatan }\n else\n format.html { render :new }\n format.json { render json: @kegiatan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @frais_annex = FraisAnnex.new(params[:frais_annex])\n\n respond_to do |format|\n if @frais_annex.save\n format.html { redirect_to @frais_annex, :notice => 'Le frais annexe a bien été créé' }\n format.json { render :json => @frais_annex, :status => :created, :location => @frais_annex }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @frais_annex.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @appraisal_fee = AppraisalFee.new(appraisal_fee_params)\n @appraisal_fee.loan_id = session[:current_loan_id]\n\n respond_to do |format|\n if @appraisal_fee.save\n # format.html { redirect_to appraisal_fees_path, notice: 'Appraisal fee was successfully created.' }\n format.html { redirect_to Loan.find(@appraisal_fee.loan) }\n format.json { render action: 'show', status: :created, location: @appraisal_fee }\n else\n format.html { render action: 'new' }\n format.json { render json: @appraisal_fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pay_fee = PayFee.new(pay_fee_params)\n\n respond_to do |format|\n if @pay_fee.save\n format.html { redirect_to @pay_fee, notice: 'Pay fee was successfully created.' }\n format.json { render :show, status: :created, location: @pay_fee }\n else\n format.html { render :new }\n format.json { render json: @pay_fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pendaftaran = Pendaftaran.new(pendaftaran_params)\n\n respond_to do |format|\n if @pendaftaran.save\n format.html { redirect_to @pendaftaran, notice: \"Pendaftaran was successfully created.\" }\n format.json { render :show, status: :created, location: @pendaftaran }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @pendaftaran.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @taxfree = Taxfree.new(taxfree_params)\n\n respond_to do |format|\n if @taxfree.save\n format.html { redirect_to @taxfree, notice: 'Taxfree was successfully created.' }\n format.json { render :show, status: :created, location: @taxfree }\n else\n format.html { render :new }\n format.json { render json: @taxfree.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #raise penduduk_params.to_yaml\n @penduduk = Penduduk.new(penduduk_params)\n @golongan_darahs = GolonganDarah.all\n @agamas = Agama.all\n @pekerjaans= Pekerjaan.all\n @status_keluargas = StatusKeluarga.all\n @pendidikans = Pendidikan.all\n @kelurahans = Kelurahan.all\n @kecamatans = Kecamatan.all\n @kabupatens = Kabupaten.all\n @penghasilans = Penghasilan.all \n respond_to do |format|\n if @penduduk.save\n format.html { redirect_to @penduduk, notice: 'Penduduk was successfully created.' }\n format.json { render :show, status: :created, location: @penduduk }\n else\n format.html { render :new }\n format.json { render json: @penduduk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dias_semanas_vaga = DiasSemanasVaga.new(dias_semanas_vaga_params)\n\n respond_to do |format|\n if @dias_semanas_vaga.save\n format.html { redirect_to @dias_semanas_vaga, notice: 'Dias semanas vaga was successfully created.' }\n format.json { render :show, status: :created, location: @dias_semanas_vaga }\n else\n format.html { render :new }\n format.json { render json: @dias_semanas_vaga.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #@klass_fee = KlassFee.new(params[:klass_fee])\n ap params[:fee]\n begin\n params[:fee].each do |fee_type_id, amount|\n puts \"=======xx==========\"\n ap KlassFee.create({klass_id: @klass.id, fee_type_id: fee_type_id, amount: amount[:amount]})\n end\n \n redirect_to klass_klass_fees_path(@klass), notice: 'Klass fee was successfully created.'\n #rescue Exception => e\n # render action: \"new\" \n end\n end",
"def create\n @essay = Essay.new(params[:essay])\n\n respond_to do |format|\n if @essay.save\n format.html { redirect_to @essay, notice: 'Essay was successfully created.' }\n format.json { render json: @essay, status: :created, location: @essay }\n else\n format.html { render action: \"new\" }\n format.json { render json: @essay.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @zayavk = Zayavk.new(zayavk_params)\n\n respond_to do |format|\n if @zayavk.save\n format.html { redirect_to @zayavk, notice: 'Заявка была успешно создана.' }\n format.json { render :show, status: :created, location: @zayavk }\n else\n format.html { render :new }\n format.json { render json: @zayavk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @assay = Assay.new(params[:assay])\n\n respond_to do |format|\n if @assay.save\n format.html { redirect_to @assay, notice: 'Assay was successfully created.' }\n format.json { render json: @assay, status: :created, location: @assay }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assay.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @fee_structure = FeeStructure.new(fee_structure_params)\n\n respond_to do |format|\n if @fee_structure.save\n format.html { redirect_to fee_structures_path, notice: 'Fee structure was successfully created.' }\n format.json { render :show, status: :created, location: @fee_structure }\n else\n format.html { render :new }\n format.json { render json: @fee_structure.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @falta = Falta.new(falta_params)\n\n respond_to do |format|\n if @falta.save\n format.html { redirect_to @falta, notice: \"Falta was successfully created.\" }\n format.json { render :show, status: :created, location: @falta }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @falta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ra_khoi_dang = RaKhoiDang.new(ra_khoi_dang_params)\n\n respond_to do |format|\n if @ra_khoi_dang.save\n format.html { redirect_to @ra_khoi_dang, notice: 'Ra khoi dang was successfully created.' }\n format.json { render :show, status: :created, location: @ra_khoi_dang }\n else\n format.html { render :new }\n format.json { render json: @ra_khoi_dang.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @f_dzakir = FDzakir.new(f_dzakir_params)\n\n respond_to do |format|\n if @f_dzakir.save\n format.html { redirect_to @f_dzakir, notice: 'F dzakir was successfully created.' }\n format.json { render :show, status: :created, location: @f_dzakir }\n else\n format.html { render :new }\n format.json { render json: @f_dzakir.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @currentgwamokid = params[:currentgwamokid]\n @sigan = Sigan.new(sigan_params)\n\n respond_to do |format|\n if @sigan.save\n format.html { redirect_to @sigan, notice: 'Sigan was successfully created.' }\n format.json { render :show, status: :created, location: @sigan }\n else\n format.html { render :new }\n format.json { render json: @sigan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @desafio = Desafio.new(desafio_params)\n\n respond_to do |format|\n if @desafio.save\n format.html { redirect_to @desafio, notice: 'Desafio was successfully created.' }\n format.json { render :show, status: :created, location: @desafio }\n else\n format.html { render :new }\n format.json { render json: @desafio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @enfermedade = Enfermedade.new(enfermedade_params)\n\n respond_to do |format|\n if @enfermedade.save\n format.html { redirect_to new_padecimiento_path, notice: 'Ahora, por favor dinos a qué eres alérgico' }\n\n else\n format.html { render action: 'new' }\n format.json { render json: @enfermedade.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_selling_config_days_to_complete = Admin::Selling::Config::DaysToComplete.new(admin_selling_config_days_to_complete_params)\n\n respond_to do |format|\n if @admin_selling_config_days_to_complete.save\n format.html { redirect_to admin_selling_config_days_to_completes_path, notice: mk_notice(@admin_selling_config_days_to_complete, :id, 'Days to complete', :create) }\n format.json { render json: @admin_selling_config_days_to_complete, status: :created, location: admin_selling_config_days_to_completes_path }\n else\n format.html { render :new }\n format.json { render json: @admin_selling_config_days_to_complete.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sender = params[:sender]\n @destination = params[:destination]\n @package = params[:package]\n @notification = params[:notification]\n @preferences = params[:preferences]\n @settlement_info = params[:settlement_info]\n @request = {\n sender: @sender,\n destination: @destination,\n package: @package,\n notification: @notification,\n preferences: @preferences,\n settlement_info: @settlement_info,\n group_id: '5241556',\n mailing_date: Date.today,\n contract_number: '0042956527',\n service_code: params[:service_code],\n mobo: {\n customer_number: params[:mobo],\n username: 'bc02d6bd3733555c',\n password: '111d1a0d29fc00aa47b66a',\n contract_number: '0042956527'\n }\n }\n puts \"**** #{@request}\"\n\n @response = CANADA_POST_SERVICE.create(\n sender: @sender,\n destination: @destination,\n package: @package,\n notification: @notification,\n preferences: @preferences,\n settlement_info: @settlement_info,\n group_id: '5241556',\n mailing_date: Date.today,\n contract_id: '0042956527',\n service_code: params[:service_code],\n mobo: {\n customer_number: params[:mobo],\n username: 'bc02d6bd3733555c',\n password: '111d1a0d29fc00aa47b66a',\n contract_number: '0042956527'\n }\n )\n puts \"Full Response: #{@response}\"\n unless @response[:create_shipping][:errors].present?\n Shipping.track_shipping(@response)\n end\n respond_to do |format|\n format.js {}\n end\n end",
"def create\n @admin_pricing_foam = Admin::Pricing::Foam.new(admin_pricing_foam_params)\n\n respond_to do |format|\n if @admin_pricing_foam.save\n format.html { redirect_to admin_pricing_foams_path, notice: mk_notice(@admin_pricing_foam, @admin_pricing_foam.type.name, 'قیمت ابر', :create) }\n format.json { render json: @admin_pricing_foam, status: :created, location: admin_pricing_foams_path }\n else\n format.html { render :new }\n format.json { render json: @admin_pricing_foam.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dapi = Dapi.new(dapi_params)\n\n respond_to do |format|\n if @dapi.save\n format.html { redirect_to @dapi, notice: 'Dapi was successfully created.' }\n format.json { render :show, status: :created, location: @dapi }\n else\n format.html { render :new }\n format.json { render json: @dapi.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_fund\n invoice = Spree::PaymentMethod::BitPayment.first.create_invoice(add_fund_params)\n @invoice_url = \"#{invoice['url']}\"\n render json: @invoice_url.to_json\n end",
"def create\n @unidade_federativa = UnidadeFederativa.new(unidade_federativa_params)\n\n respond_to do |format|\n if @unidade_federativa.save\n format.html { redirect_to @unidade_federativa, notice: 'Unidade federativa was successfully created.' }\n format.json { render :show, status: :created, location: @unidade_federativa }\n else\n format.html { render :new }\n format.json { render json: @unidade_federativa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @fee = Fee.new(params[:fee])\n\n respond_to do |format|\n if @fee.save\n format.html { redirect_to fees_path, notice: 'Fee was successfully created.' }\n format.json { render json: @fee, status: :created, location: @fee }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @asignacione = Asignacione.new(asignacione_params)\n\n respond_to do |format|\n if @asignacione.save\n format.html { redirect_to asignaciones_url, notice: 'Asignacione Se creó correctamente.' }\n format.json { render :index, status: :created, location: @asignacione }\n else\n format.html { render :new }\n format.json { render json: @asignacione.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @asignatura = Asignatura.new(asignatura_params)\n\n respond_to do |format|\n if @asignatura.save\n format.json { render json: \"Asignatura Creada\", status: :created, location: @asignatura }\n else\n format.json { render json: @asignatura.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @f_dpetra = FDpetra.new(f_dpetra_params)\n\n respond_to do |format|\n if @f_dpetra.save\n format.html { redirect_to @f_dpetra, notice: 'F dpetra was successfully created.' }\n format.json { render :show, status: :created, location: @f_dpetra }\n else\n format.html { render :new }\n format.json { render json: @f_dpetra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kecamatan = Kecamatan.new(kecamatan_params)\n @kabupatens = Kabupaten.all\n @admins = Admin.all\n respond_to do |format|\n if @kecamatan.save\n format.html { redirect_to @kecamatan, notice: 'Kecamatan was successfully created.' }\n format.json { render :show, status: :created, location: @kecamatan }\n else\n format.html { render :new }\n format.json { render json: @kecamatan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dfactura = Dfactura.new(dfactura_params)\n\n respond_to do |format|\n if @dfactura.save\n format.html { redirect_to @dfactura, notice: 'Detalle de factura creado con éxito.' }\n format.json { render :show, status: :created, location: @dfactura }\n else\n format.html { render :new }\n format.json { render json: @dfactura.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @palabra = Palabra.new(params[:palabra])\n @palabra.significados = params[:significados] \n respond_to do |format|\n if @palabra.save\n format.html { redirect_to @palabra, notice: 'La palabra fue guardada correctamente.' }\n format.json { render json: @palabra, status: :created, location: @palabra }\n else\n format.html { render action: \"new\" }\n format.json { render json: @palabra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @departamento = Departamento.new(departamento_params)\n\n if @departamento.save\n render json: @departamento, status: :created, location: @departamento\n else\n render json: @departamento.errors, status: :unprocessable_entity\n end\n end",
"def create\n @fixed_exp = FixedExp.new(fixed_exp_params)\n\n respond_to do |format|\n if @fixed_exp.save\n format.html { redirect_to @fixed_exp, notice: 'Fixed exp was successfully created.' }\n format.json { render :show, status: :created, location: @fixed_exp }\n else\n format.html { render :new }\n format.json { render json: @fixed_exp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @fund = Fund.new(fund_params)\n\n if @fund.save\n render json: @fund, status: :created, location: @fund\n else\n render json: @fund.errors, status: :unprocessable_entity\n end\n end",
"def create\n fax_request = FaxRequest.new(fax_params)\n fax_request.client_receipt_date = Time.now\n fax_request.save!\n response = send_fax(fax_params)\n update_fax_request(fax_request,response)\n end",
"def create\n @tax = Tax.new(tax_params)\n\n if @tax.save\n render json: @tax, status: :created, location: @tax\n else\n render json: @tax.errors, status: :unprocessable_entity\n end\n end",
"def create\n @docderivacione = Docderivacione.new(docderivacione_params)\n\n respond_to do |format|\n if @docderivacione.save\n format.html { redirect_to @docderivacione, notice: 'Docderivacione was successfully created.' }\n format.json { render :show, status: :created, location: @docderivacione }\n else\n format.html { render :new }\n format.json { render json: @docderivacione.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @budget_for_order = BudgetForOrder.new(budget_for_order_params)\n @budget_for_order.total=0\n respond_to do |format|\n if @budget_for_order.save\n format.html { redirect_to budget_new_add_path(@budget_for_order.id), notice: 'Favor de agregar los detalles' }\n format.json { render :show, status: :created, location: @budget_for_order }\n else\n format.html { render :new }\n format.json { render json: @budget_for_order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if !@karyalay_list.nil?\n @karyalay_attribute = KaryalayAttribute.new(karyalay_attribute_params)\n @karyalay_attribute.karyalay_list = @karyalay_list\n if @karyalay_attribute.save\n render json: @karyalay_attribute\n else\n render json: { id: nil,\n message: 'Karyalay Attributes Not Saved, Try Again' }\n end\n else\n render json: { id: nil, message: 'Karyalay Not Found, Try Again' }\n end\n end",
"def create\n @dia_evento = DiaEvento.new(dia_evento_params)\n\n if @dia_evento.save\n render json: @dia_evento, status: :created, location: @dia_evento\n else\n render json: @dia_evento.errors, status: :unprocessable_entity\n end\n end",
"def create\n @daily_step = DailyStep.new(daily_step_params)\n\n respond_to do |format|\n if @daily_step.save\n format.html { redirect_to @daily_step, notice: 'Daily step was successfully created.' }\n format.json { render :show, status: :created, location: @daily_step }\n else\n format.html { render :new }\n format.json { render json: @daily_step.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @daily_data_payment = DailyDataPayment.new(daily_data_payment_params)\n\n respond_to do |format|\n if @daily_data_payment.save\n format.html { redirect_to @daily_data_payment, notice: 'Daily data payment was successfully created.' }\n format.json { render action: 'show', status: :created, location: @daily_data_payment }\n else\n format.html { render action: 'new' }\n format.json { render json: @daily_data_payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @daw_alianza = DawAlianza.new(daw_alianza_params)\n\n respond_to do |format|\n if @daw_alianza.save\n format.html { redirect_to @daw_alianza, notice: 'Daw alianza was successfully created.' }\n format.json { render :show, status: :created, location: @daw_alianza }\n else\n format.html { render :new }\n format.json { render json: @daw_alianza.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @plan = Plan.new(params[:plan])\n @plan.user = current_user\n @plan.request = Request.find( params[:request_id] )\n\n respond_to do |format|\n if @plan.save\n @plan.request.days.times do |day|\n @plan.plan_days << PlanDay.create( { plan_id: @plan.id, day: day+1 } )\n end\n\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render json: @plan, status: :created, location: @plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kontoumsatz = Kontoumsatz.new(kontoumsatz_params)\n\n respond_to do |format|\n if @kontoumsatz.save\n format.html { redirect_to @kontoumsatz, notice: 'Kontoumsatz was successfully created.' }\n format.json { render :show, status: :created, location: @kontoumsatz }\n else\n format.html { render :new }\n format.json { render json: @kontoumsatz.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @satish = Satish.new(satish_params)\n\n respond_to do |format|\n if @satish.save\n format.html { redirect_to @satish, notice: 'Satish was successfully created.' }\n format.json { render :show, status: :created, location: @satish }\n else\n format.html { render :new }\n format.json { render json: @satish.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @despesa = Despesa.new(despesa_params)\n\n respond_to do |format|\n if @despesa.save\n format.html { redirect_to @despesa, notice: \"Despesa was successfully created.\" }\n format.json { render :show, status: :created, location: @despesa }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @despesa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @archdiocese = Archdiocese.new(archdiocese_params)\n\n if @archdiocese.save\n render json: @archdiocese, status: :created, location: @archdiocese\n else\n render json: @archdiocese.errors, status: :unprocessable_entity\n end\n end",
"def create\n @app_request = AppRequest.new(app_request_params)\n @app_request.order_uid = SecureRandom.uuid\n\n tm_response = faraday.post do |req|\n req.url uri.path\n req.headers['Content-Type'] = 'application/json'\n req.headers['X-API-KEY'] = @app_request.public_key\n req.body = @app_request.to_json\n end\n\n if tm_response.success? && @app_request.save\n redirect_to tm_response.body\n else\n errors = JSON.parse(tm_response.body)['errors']\n errors.each do |e|\n @app_request.errors.add(:base, e)\n end\n\n respond_to do |format|\n format.html {\n render :new, error: tm_response.body\n }\n end\n end\n end",
"def create\n @dang_vien = DangVien.new(dang_vien_params)\n\n respond_to do |format|\n if @dang_vien.save\n format.html { redirect_to @dang_vien, notice: 'Dang vien was successfully created.' }\n format.json { render :show, status: :created, location: @dang_vien }\n else\n format.html { render :new }\n format.json { render json: @dang_vien.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kehadiran = Kehadiran.new(kehadiran_params)\n\n respond_to do |format|\n if @kehadiran.save\n format.html { redirect_to @kehadiran, notice: 'Kehadiran was successfully created.' }\n format.json { render :show, status: :created, location: @kehadiran }\n else\n format.html { render :new }\n format.json { render json: @kehadiran.errors, status: :unprocessable_entity }\n end\n end\n end",
"def sanchaypatra_params\n #params.require(:sanchaypatra).permit(:reg_number, :issue_date, :amount, :profit_per_lac, :active_date, :expire_date, :profilt_percentage,:interval_month)\n params.require(:sanchaypatra).permit!\n end",
"def create\n @fedex_bill_check = FedexBillCheck.new(fedex_bill_check_params)\n\n respond_to do |format|\n if @fedex_bill_check.save\n format.html { redirect_to @fedex_bill_check, notice: 'Fedex bill check was successfully created.' }\n format.json { render :show, status: :created, location: @fedex_bill_check }\n else\n format.html { render :new }\n format.json { render json: @fedex_bill_check.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @penyata_kehadiran = PenyataKehadiran.new(penyata_kehadiran_params)\n\n respond_to do |format|\n if @penyata_kehadiran.save\n format.html { redirect_to @penyata_kehadiran, notice: 'Penyata kehadiran was successfully created.' }\n format.json { render :show, status: :created, location: @penyata_kehadiran }\n else\n format.html { render :new }\n format.json { render json: @penyata_kehadiran.errors, status: :unprocessable_entity }\n end\n end\n end",
"def process_post\n service.sign_up_fisherman(\n JSON.parse(request.body.to_s).symbolize_keys\n ).on(\n fishing_application_succeeded: ->(result) {\n response.headers['Content-Type'] = \"application/json\"\n response.body = result.to_json\n true\n },\n fishing_application_conflicts: ->(result) {\n render_json_error_response(\n error: \"command_failed_validation\", message: result.fetch(:message)\n )\n 409\n },\n fishing_application_invalid: ->(result) {\n render_json_error_response(\n error: \"command_failed_validation\", message: result.fetch(:message)\n )\n 422\n }\n )\n end",
"def create_deposit_using_post_with_http_info(daily_deposit_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FundingApi.create_deposit_using_post ...'\n end\n # verify the required parameter 'daily_deposit_request' is set\n if @api_client.config.client_side_validation && daily_deposit_request.nil?\n fail ArgumentError, \"Missing the required parameter 'daily_deposit_request' when calling FundingApi.create_deposit_using_post\"\n end\n # resource path\n local_var_path = '/deposit'\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(daily_deposit_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 => 'DailyDeposit')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FundingApi#create_deposit_using_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @diet = Diet.new(diet_params)\n @diet.user = @current_user\n\n if @diet.save\n render json: @diet, status: 201, location: @diet, root: true\n else\n render json: @diet.errors, status: 422\n end\n end",
"def post(path, type, options)\n response = HTTParty.post(\n root_url(type) + path,\n headers: {\n 'X-Api-Key' => api_key.to_s,\n 'Content-Type' => 'application/json'\n },\n body: options.to_json\n )\n\n return response unless response.code >= 500\n\n raise BadGatewayError.new(\n gateway: AccesstypeAdyen::PAYMENT_GATEWAY,\n path: path,\n response_code: response.code,\n response_body: response.parsed_response\n )\n end",
"def create\r\n @fixed_deposit_investment = FixedDepositInvestment.new(fixed_deposit_investment_params)\r\n\r\n respond_to do |format|\r\n if @fixed_deposit_investment.save\r\n format.html { redirect_to @fixed_deposit_investment, notice: 'Fixed deposit investment was successfully created.' }\r\n format.json { render :show, status: :created, location: @fixed_deposit_investment }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @fixed_deposit_investment.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @admin_pricing_fabric = Admin::Pricing::Fabric.new(admin_pricing_fabric_params)\n\n respond_to do |format|\n if @admin_pricing_fabric.save\n format.html { redirect_to admin_pricing_fabrics_path, notice: mk_notice(@admin_pricing_fabric, @admin_pricing_fabric.brand.name, 'قیمت برای برند پارچه', :create) }\n format.json { render json: @admin_pricing_fabric, status: :created, location: admin_pricing_fabrics_path }\n else\n format.html { render :new }\n format.json { render json: @admin_pricing_fabric.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @accounting_entry = AccountingEntry.new(accounting_entry_params)\n #@accounting_entry.cuenta=\"hola\"\n respond_to do |format|\n if @accounting_entry.save\n \n format.html { redirect_to accounting_entries_path, notice: 'El asiento ha sido agregado con exito' }\n format.json { render :show, status: :created, location: @accounting_entry }\n else\n format.html { render :new }\n format.json { render json: @accounting_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @enfermeras_paciente = EnfermerasPaciente.new(enfermeras_paciente_params)\n\n respond_to do |format|\n if @enfermeras_paciente.save\n format.html { redirect_to @enfermeras_paciente, notice: 'Enfermeras paciente was successfully created.' }\n format.json { render :show, status: :created, location: @enfermeras_paciente }\n else\n format.html { render :new }\n format.json { render json: @enfermeras_paciente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipoenfermedad = Tipoenfermedad.new(tipoenfermedad_params)\n\n respond_to do |format|\n if @tipoenfermedad.save\n format.html { redirect_to @tipoenfermedad, notice: 'Tipoenfermedad was successfully created.' }\n format.json { render :show, status: :created, location: @tipoenfermedad }\n else\n format.html { render :new }\n format.json { render json: @tipoenfermedad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @zabydovnuk = Zabydovnuk.new(zabydovnuk_params)\n\n respond_to do |format|\n if @zabydovnuk.save\n format.html { redirect_to @zabydovnuk, notice: 'Zabydovnuk was successfully created.' }\n format.json { render :show, status: :created, location: @zabydovnuk }\n else\n format.html { render :new }\n format.json { render json: @zabydovnuk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @fax = Fax.new(fax_params)\n\n respond_to do |format|\n if @fax.save\n format.html { redirect_to @fax, notice: 'Fax was successfully created.' }\n format.json { render :show, status: :created, location: @fax }\n else\n format.html { render :new }\n format.json { render json: @fax.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @shipping_fee = ShippingFee.new(params[:shipping_fee])\n\n respond_to do |format|\n if @shipping_fee.save\n format.html { redirect_to(@shipping_fee, :notice => '创建成功!') }\n format.xml { render :xml => @shipping_fee, :status => :created, :location => @shipping_fee }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @shipping_fee.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @feira = Feira.new(feira_params)\n\n respond_to do |format|\n if @feira.save\n format.html { redirect_to @feira, notice: 'Feira was successfully created.' }\n format.json { render :show, status: :created, location: @feira }\n else\n format.html { render :new }\n format.json { render json: @feira.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # Вызвать такси\n @order_number = Taxirequest.call_a_taxi(params[:taxirequest])\n # Разместить заявку на такси в таблице taxirequests\n @taxirequest = Taxirequest.add_request(params[:taxirequest], session[:employee_id], @order_number)\n #@taxirequest = Taxirequest.new(params[:taxirequest])\n\n respond_to do |format|\n if @taxirequest.save\n format.html { redirect_to @taxirequest, notice: 'Taxirequest was successfully created.'+@response }\n format.json { render json: @taxirequest, status: :created, location: @taxirequest }\n else\n format.html { render action: \"new\" }\n format.json { render json: taxirequest.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create\n @tenant = keystone.create_tenant({:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n \n format.html { redirect_to @tenant, :notice => 'Tenant was successfully created.' }\n format.json { render :json => @tenant, :status => :created, :location => @tenant }\n \n end\n end",
"def create\n @outra_nota_fiscal = OutraNotaFiscal.new(outra_nota_fiscal_params)\n\n respond_to do |format|\n if @outra_nota_fiscal.save\n format.html { redirect_to @outra_nota_fiscal, notice: 'Outra nota fiscal was successfully created.' }\n format.json { render :show, status: :created, location: @outra_nota_fiscal }\n else\n format.html { render :new }\n format.json { render json: @outra_nota_fiscal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ga_datum = GaDatum.new(ga_datum_params)\n\n respond_to do |format|\n if @ga_datum.save\n format.html { redirect_to @ga_datum, notice: 'Ga datum was successfully created.' }\n format.json { render :show, status: :created, location: @ga_datum }\n else\n format.html { render :new }\n format.json { render json: @ga_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(path, options = {})\n nonce, signature = generate_signature\n options = options.merge(key: @api_key, nonce: nonce, signature: signature)\n result = @connection.post(\"#{path}/\", options).body\n JSON.parse(result)\n end",
"def create\n if !current_user.admin?\n flash.now[:error] = 'No eres administrador'\n return\n end\n @disfraz = Disfraz.new(params[:disfraz])\n\n respond_to do |format|\n if @disfraz.save\n format.html { redirect_to @disfraz, notice: 'Disfraz was successfully created.' }\n format.json { render json: @disfraz, status: :created, location: @disfraz }\n else\n format.html { render action: \"new\" }\n format.json { render json: @disfraz.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_arrays_to_tenant(args = {}) \n post(\"/tenants.json/#{args[:tenantId]}/arrays\", args)\nend",
"def create\n @spec_day = SpecDay.new(spec_day_params)\n\n drop_page_title(\"新增假日\")\n drop_breadcrumb\n respond_to do |format|\n if @spec_day.save\n format.html { redirect_to spec_days_path, notice: '添加成功.' }\n format.json { render :show, status: :created, location: @spec_day }\n else\n flash.now[:alert] = @spec_day.errors.full_messages\n format.html { render :new }\n format.json { render json: @spec_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exam = Exam.new(exam_params)\n @exam.patient = @patient\n\n if @exam.save\n render json: @exam, include: [:point_po, :point_or, :point_n, :point_a], methods: :maxillary_depth_angle, status: :created\n else\n render json: @exam.errors, status: :unprocessable_entity\n end\n end",
"def create\n @asistencia_domingo = AsistenciaDomingo.new(asistencia_domingo_params)\n\n asistencia_reunion_evangelist_id = asistencia_reunion_evangelist_param[:asistencia_reunion_evangelist_id]\n asistencia_reunion_planificacion_id = asistencia_reunion_planificacion_param[:asistencia_reunion_planificacion_id]\n\n if @asistencia_domingo.save\n redirect_to controller: 'reporte_semanal_celulas', action: 'new', asistencia_domingo_id: @asistencia_domingo.id, asistencia_reunion_evangelist_id: asistencia_reunion_evangelist_id, asistencia_reunion_planificacion_id: asistencia_reunion_planificacion_id , notice: 'Asistencia domingos was successfully created.'\n return\n end\n\n respond_to do |format|\n if !@asistencia_domingo.save\n format.html { render :new }\n format.json { render json: @asistencia_domingo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n Rails.logger.debug \"Creating a FAX\"\n @fax_job = FaxJob.new(fax_job_params)\n\n respond_to do |format|\n if @fax_job.save\n\t@fax_job.send_fax\n format.html { redirect_to @fax_job, notice: 'Fax job was successfully created.' }\n format.json { render :show, status: :created, location: @fax_job }\n else\n format.html { render :new }\n format.json { render json: @fax_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_doge_token_dropin\r\n if current_user then\r\n tokens = params[:num_tokens]\r\n # CREATE TEST TRANSACTION TODO Make it work\r\n # Handle Taxes for Taxcloud\r\n customer = @current_user\r\n # TODO Change this to retrieved destination\r\n test_destination = TaxCloud::Address.new(\r\n address1: '317 112th Ave NE',\r\n address2: 'Room 1016',\r\n city: 'Bellevue',\r\n state: 'WA',\r\n zip5: '98004'\r\n )\r\n transaction = TaxCloud::Transaction.new(\r\n customer_id: customer.customer_id,\r\n cart_id: '1',\r\n origin: DogeTaxCloud.doge_origin,\r\n destination: test_destination\r\n )\r\n transaction.cart_items << DogeTaxCloud.doge_token(tokens)\r\n session[:transaction] = transaction\r\n #lookup = transaction.lookup # Returns a TaxCloud::Responses::Lookup\r\n puts \"TAX AMOUNT:\"\r\n# puts lookup.tax_amount\r\n\r\n # Error if no transaction is in the process\r\n if session[:transaction] == nil then\r\n render json: {error: \"Transaction Not Properly Set Up\"}, status: 401\r\n return\r\n else\r\n transaction = session[:transaction]\r\n end\r\n\r\n # Process payment base cost, add sales tax amount\r\n amount = calculate_base_cost(tokens) #+ lookup.tax_amount\r\n\r\n # Transaction.sale and create a new Customer id if none is specified\r\n if @current_user.customer_id == nil then\r\n result = Braintree::Customer.create\r\n if result.success? then\r\n # If there was no customer ID, add customer id\r\n if @current_user.customer_id == nil then\r\n @current_user.customer_id = result.customer.id\r\n @current_user.save\r\n end\r\n else\r\n # Handle customer creation failure\r\n render json: {error: result.message}, status: 401\r\n session[:transaction] = nil\r\n return\r\n end\r\n end\r\n\r\n result = Braintree::Transaction.sale(\r\n payment_method_nonce: params[:payment_method_nonce],\r\n amount: amount,\r\n customer_id: @current_user.customer_id,\r\n options: {\r\n submit_for_settlement: true,\r\n store_in_vault_on_success: true\r\n }\r\n )\r\n\r\n if result.success? then\r\n # Transaction customer ID should be the same as user customer ID\r\n if result.transaction.customer_details.id.to_i != @current_user.customer_id.to_i then\r\n flash[:error] = \"Unexpected Error\"\r\n session[:transaction] = nil\r\n raise \"Customer ID Mismatch\"\r\n else\r\n # Handle Taxes for Taxcloud\r\n transaction.order_id = result.transaction.order_id\r\n transaction.authorized_with_capture # returns \"OK\" or raises error \r\n end\r\n else\r\n # Deal with the settlement errors\r\n render json: {error: result.message}, status: 401\r\n return\r\n end\r\n render json: {success: \"Purchase Success!\"}, status: 200\r\n else\r\n render json: {error: \"Not Logged In\"}, status: 401\r\n end\r\n end",
"def create\n @deposito = Deposito.new(deposito_params)\n\n respond_to do |format|\n if @deposito.save\n format.html { redirect_to @deposito, notice: 'Deposito guardado correctamente.' }\n format.json { render :show, status: :created, location: @deposito }\n else\n format.html { render :new }\n format.json { render json: @deposito.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @daw_encuest = DawEncuest.new(daw_encuest_params)\n\n respond_to do |format|\n if @daw_encuest.save\n format.html { redirect_to @daw_encuest, notice: 'Daw encuest was successfully created.' }\n format.json { render :show, status: :created, location: @daw_encuest }\n else\n format.html { render :new }\n format.json { render json: @daw_encuest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kiban = Kiban.new(kiban_params)\n @Maker= MakerDeadline.find_by(メーカー: @kiban.メーカー)\n @approaching_deadline = (@kiban.最終注文日 + (@Maker.期限*365) - Date.today).to_i\n @kiban.経過日 = @approaching_deadline;\n respond_to do |format|\n if @kiban.save\n format.html { redirect_to @kiban, notice: 'Kiban was successfully created.' }\n format.json { render :show, status: :created, location: @kiban }\n else\n format.html { render :new}\n format.json { render json: @kiban.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.59678805",
"0.58623284",
"0.5756909",
"0.5643321",
"0.55046505",
"0.54953986",
"0.5492916",
"0.54927695",
"0.54807836",
"0.5457218",
"0.5453056",
"0.5415985",
"0.535122",
"0.5335929",
"0.53337973",
"0.5330513",
"0.5296965",
"0.5279655",
"0.5257377",
"0.52537113",
"0.52519494",
"0.52122545",
"0.52028686",
"0.5200855",
"0.5197822",
"0.51896465",
"0.5175817",
"0.5156104",
"0.51527995",
"0.51477444",
"0.5139735",
"0.51117885",
"0.5110509",
"0.50843126",
"0.508223",
"0.50812316",
"0.50717473",
"0.5071715",
"0.5057802",
"0.5021376",
"0.5018198",
"0.5017015",
"0.50151426",
"0.5005916",
"0.50035715",
"0.49955148",
"0.49935246",
"0.49664408",
"0.49647748",
"0.49623784",
"0.4961123",
"0.49500728",
"0.49493712",
"0.49478906",
"0.49476698",
"0.49458525",
"0.49413702",
"0.4941266",
"0.49392933",
"0.4936977",
"0.49330932",
"0.49327752",
"0.49315438",
"0.491552",
"0.490508",
"0.4901788",
"0.48995465",
"0.48980194",
"0.4896754",
"0.4896287",
"0.48939124",
"0.48938575",
"0.4891294",
"0.4891283",
"0.48904902",
"0.48890585",
"0.48813286",
"0.4881096",
"0.4880473",
"0.48764825",
"0.4873465",
"0.48731607",
"0.48660266",
"0.48659766",
"0.48625425",
"0.48611018",
"0.48568317",
"0.48558694",
"0.48558098",
"0.48533043",
"0.48531595",
"0.48531055",
"0.48514998",
"0.4848679",
"0.48474064",
"0.48467565",
"0.4834756",
"0.4829936",
"0.48270845",
"0.48266083"
] | 0.6569528 | 0 |
PATCH/PUT /admin/digersayfas/1 PATCH/PUT /admin/digersayfas/1.json | def update
respond_to do |format|
if @admin_digersayfa.update(admin_digersayfa_params)
format.html { redirect_to @admin_digersayfa, notice: 'Digersayfa was successfully updated.' }
format.json { render :show, status: :ok, location: @admin_digersayfa }
else
format.html { render :edit }
format.json { render json: @admin_digersayfa.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def update\r\n respond_to do |format|\r\n @egresso.skip_fields_validation = false\r\n if @egresso.update(egresso_params)\r\n if current_admin.try(:adm?)\r\n format.html { redirect_to egressos_path, notice: 'Egresso atualizado com sucesso.' }\r\n format.json { render :show, status: :ok, location: egressos_path }\r\n else\r\n format.html { redirect_to :back, notice: 'Dados atualizados com sucesso.' }\r\n format.json { render :show, status: :ok, location: :back }\r\n end\r\n\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @egresso.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @tenant_fee.update(tenant_fee_params)\n format.html { redirect_to @tenant_fee, notice: 'Tenant fee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @tenant_fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def update\n data = tenant_update_params\n tookan = {\"api_key\": \"50646180f541481e4c422b614c5825431be3c2f82fd57936541c03\",\"customer_id\": @tenant.customer_id,\"user_type\": 0,\"name\": data[:name],\"phone\": data[:phone1],\"email\": data[:email],\"address\": data[:address],\"latitude\": data[:latitude],\"longitude\": data[:longitude]}\n response = RestClient.post \"https://api.tookanapp.com/v2/customer/edit\", tookan.to_json, :content_type => \"application/json\"\n response = JSON.parse(response)\n respond_to do |format|\n if response[\"status\"] == 200\n if @tenant.update(tenant_update_params)\n food_category = FoodCategory.find_or_create_by(name: \"Veg\")\n @tenant.tenant_details.update(food_category_id: food_category.id)\n if @tenant.active == true\n end\n end\n @tenant.update(:updated_by=>session[:kitchen_user_id])\n format.html { redirect_to tenants_url, notice: 'Tenant was successfully updated.' }\n format.json { render :show, status: :ok, location: @tenant }\n else\n format.html { redirect_to tenants_url, notice: 'Tenant was not updated.' }\n format.json { render json: @tenant.errors, status: :unprocessable_entity }\n end\n end\nend",
"def update_user_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/users/{userId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def update\n respond_to do |format|\n if @tipo_despesa.update(tipo_despesa_params)\n format.html { redirect_to tenant_tipo_despesas_path(tenant_id: @tenant.id), notice: 'Tipo despesa was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_despesa }\n else\n format.html { render :edit }\n format.json { render json: @tipo_despesa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @appraisal_fee.update(appraisal_fee_params)\n format.html { redirect_to appraisal_fees_path, notice: 'Appraisal fee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @appraisal_fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_current_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n format.xml { head :method_not_allowed }\n format.json { head :method_not_allowed }\n end\n end",
"def update\n authorize! :update_almacen,Sigesp::Solicitud\n if @sigesp_solicitud.update(sigesp_solicitud_alamcen_params)\n return render json: { url: sigesp_solicitudsalmacen_path(@sigesp_solicitud)} \n else\n return render json:@sigesp_solicitud.errors ,status: :unprocessable_entity\n end \n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update_array_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/arrays/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n if @adminwenhua.update(adminwenhuas_paths)\n format.html { redirect_to adminwenhuas_path, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @adminwenhua }\n else\n format.html { render :edit }\n format.json { render json: @adminwenhuas.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n @request_for_change.set_manager(force: true)\n @request_for_change.set_security_officer(force: true)\n\n respond_to do |format|\n if @request_for_change.update(request_for_change_params)\n format.html { redirect_to edit_request_for_change_path(@request_for_change), notice: 'Request for change was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @request_for_change.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n @admin = Admin.find(params[:id])\n\n if @admin.update(admin_params)\n head :no_content\n else\n render json: @admin.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @admin_pricing_fabric.update(admin_pricing_fabric_params)\n format.html { redirect_to admin_pricing_fabrics_path, notice: mk_notice(@admin_pricing_fabric, @admin_pricing_fabric.brand.name, 'قیمت برای برند پارچه', :update) }\n format.json { render json: @admin_pricing_fabric, status: :ok, location: admin_pricing_fabrics_path }\n else\n format.html { render :edit }\n format.json { render json: @admin_pricing_fabric.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @gaz_assay = GazAssay.find(params[:id])\n @authorized_user = User.find(session[:user_id])\n respond_to do |format|\n if @gaz_assay.update_attributes(params[:gaz_assay])\n format.html { redirect_to gaz_assays_url, notice: 'Данные качественного анализа газа успешно скорректированы.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gaz_assay.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @tenant.update(tenant_params)\n p_id = Property.searchSecond(@tenant.tenantbuildinginfo)\n Property.find_by(id: p_id).tenants << @tenant\n format.html { redirect_to @tenant, notice: 'Tenant was successfully updated.' }\n format.json { render :show, status: :ok, location: @tenant }\n else\n format.html { render :edit }\n format.json { render json: @tenant.errors, status: :unprocessable_entity }\n end\n end\n\n if params[:generate_lease]\n generate_lease(@tenant)\n elsif params[:expense_add]\n expense_addendum(@tenant)\n else\n #do nothing\n end\n\n end",
"def update\n respond_to do |format|\n if @admin_recurso.update(admin_recurso_params)\n format.html { redirect_to @admin_recurso, notice: 'Recurso was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_recurso }\n else\n format.html { render :edit }\n format.json { render json: @admin_recurso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_admin_type.update(api_v1_admin_type_params)\n format.html { redirect_to @api_v1_admin_type, notice: 'Admin type was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_admin_type }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_admin_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def update\n respond_to do |format|\n if @admin_post.update(super_strong_params)\n format.html { redirect_to admin_post_path(@admin_post), notice: 'Публикация успешно обновлена' }\n format.json { render action: 'show', status: :ok, location: @admin_post }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @flag = Flag.find(params[:id])\n\n respond_to do |format|\n if @flag.update_attributes(params[:flag])\n format.html { redirect_to [:admin,@flag], notice: 'Flag atualizado com sucesso!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @flag.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @rest_api.update(rest_api_params)\n format.html { redirect_to @rest_api, notice: 'Rest api was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rest_api.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @aliexpress = Aliexpress.find(params[:id])\n\n respond_to do |format|\n if @aliexpress.update_attributes(params[:aliexpress])\n format.html { redirect_to @aliexpress, notice: 'Aliexpress was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aliexpress.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n @doc.refused = false\n @doc.logs += \"Документ отредактирован #{DateTime.now}. <br> Документ повторно отправлен на подпись #{@doc.signer.name_with_initial}<br>\"\n respond_to do |format|\n if @doc.update(doc_params)\n format.html { redirect_to @doc, notice: 'Doc was successfully updated.' }\n format.json { render :show, status: :ok, location: @doc }\n else\n format.html { render :edit }\n format.json { render json: @doc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tenant = Tenant.find(params[:id])\n\n respond_to do |format|\n if @tenant.update_attributes(params[:tenant])\n format.html { redirect_to @tenant, notice: 'Tenant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tenant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @spoofer = Spoofer.find(params[:id])\n\n respond_to do |format|\n if @spoofer.update_attributes(params[:spoofer])\n format.html { redirect_to @spoofer, notice: 'Spoofer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spoofer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @chef.update(chef_params)\n format.html { redirect_to [:admin, @chef], notice: t('messages.updated', model:Chef.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @chef.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n begin\n @admin_obj.update!(admin_params)\n flash[:success] = 'Admin was successfully updated.'\n format.html { redirect_to admin_admin_url(@admin_obj) }\n format.json { render :show, status: :ok, location: @admin_obj }\n rescue Exception => e \n flash[:danger] = \"Error: #{e.message}\"\n format.html { render :edit }\n end\n end\n end",
"def update\n @field = Field.find(params[:id])\n @field.update_attributes(params[:field])\n respond_with :admin, @field\n end",
"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 [:admin, @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",
"def update\n respond_to do |format|\n if @enfermedade.update(enfermedade_params)\n format.html { redirect_to root_path, notice: 'Enfermedade was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @enfermedade.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n respond_to do |format|\n if @admin_pricing_foam.update(admin_pricing_foam_params)\n format.html { redirect_to admin_pricing_foams_path, notice: mk_notice(@admin_pricing_foam, @admin_pricing_foam.type.name, 'قیمت ابر', :update) }\n format.json { render json: @admin_pricing_foam, status: :ok, location: admin_pricing_foams_path }\n else\n format.html { render :edit }\n format.json { render json: @admin_pricing_foam.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_advertise.update(admin_advertise_params)\n format.html { redirect_to @admin_advertise, notice: 'Advertise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_advertise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @kela.update(kela_params)\n format.html { redirect_to @kela, notice: 'Kela was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kela.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_plant\n @plant.deleted = false\n\n respond_to do |format|\n if set_attributes_from_filemaker(@plant)\n format.json do\n render status: :created,\n json: {\n id: @plant.id,\n botanical_name: @plant.botanical_name,\n alternative_names: @plant.alternative_names,\n updated_at: @plant.updated_at,\n visible: (!@plant.deleted).to_s\n }\n end\n else\n format.json do\n render json: @plant.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"def update\n @fee = Fee.find(params[:id])\n\n respond_to do |format|\n if @fee.update_attributes(params[:fee])\n format.html { redirect_to fees_path, notice: 'Fee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @fabrica.update(fabrica_params)\n format.html { redirect_to @fabrica, notice: 'Fabrica was successfully updated.' }\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",
"def pro_farm_update\n respond_to do |format|\n activo = params[:pro_far][:activo_produc]\n farmacia_id = session[:farmacia_id]\n id = params[:id]\n ProFar.where(producto_id: id, farmacium_id:farmacia_id).update_all(activo_produc: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"def update\n respond_to do |format|\n if @gatha.update(gatha_params)\n format.html { redirect_to @gatha, notice: 'Gatha was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gatha.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n \n end\n end",
"def update\n sub_cluster = params[\"dtcstaff\"][\"sub_cluster\"]\n @dtc_staff.subcluster(sub_cluster) \n respond_to do |format|\n if @dtc_staff.update(params[:dtc_staff])\n format.html { redirect_to dtc_staffs_url, notice: 'Route Updated' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @dtc_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n# respond_to do |format|\n# if @req.update(req_params)\n format.json { render :json => {:status => 'success'}}\n# format.html { redirect_to @req, notice: 'Req was successfully updated.' }\n# format.json { render :show, status: :ok, location: @req }\n# else\n format.json { render :json => {:status => 'failed'}}\n# format.html { render :edit }\n# format.json { render json: @req.errors, status: :unprocessable_entity }\n# end\n# end\n end",
"def update\n respond_to do |format|\n if @fee.update(fee_params)\n format.html { redirect_to @fee, notice: 'Fee was successfully updated.' }\n format.json { render :show, status: :ok, location: @fee }\n else\n format.html { render :edit }\n format.json { render json: @fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @fee.update(fee_params)\n format.html { redirect_to @fee, notice: 'Fee was successfully updated.' }\n format.json { render :show, status: :ok, location: @fee }\n else\n format.html { render :edit }\n format.json { render json: @fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(request)\n end",
"def update(request)\n end",
"def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_employee.update(admin_employee_params)\n format.html { redirect_to admin_employees_path, notice: 'Funcionário foi editado com sucesso.' }\n else\n format.html { render :edit }\n format.json { render json: @admin_employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @rest.update(rest_params)\n format.html { redirect_to @rest, notice: 'Rest was successfully updated.' }\n format.json { render :show, status: :ok, location: @rest }\n else\n format.html { render :edit }\n format.json { render json: @rest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sanchaypatra.update(sanchaypatra_params)\n format.html { redirect_to sanchaypatras_url, notice: 'Sanchaypatra was successfully updated.' }\n format.json { render :show, status: :ok, location: @sanchaypatra }\n else\n format.html { render :edit }\n format.json { render json: @sanchaypatra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @admin_bait = Bait.find(params[:id])\n\n respond_to do |format|\n if @admin_bait.update_attributes(params[:admin_bait])\n format.html { redirect_to @admin_bait, notice: 'Bait was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_bait.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @api_version = ApiVersion.find(params[:id])\n\n respond_to do |format|\n if @api_version.update_attributes(params[:api_version])\n format.html { redirect_to admin_api_versions_path, flash: {success: t('app.msgs.success_updated', :obj => t('mongoid.models.api_version.one'))} }\n format.json { head :no_content }\n else\n set_tabbed_translation_form_settings('advanced')\n format.html { render action: \"edit\" }\n format.json { render json: @api_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @fabricante.update(fabricante_params)\r\n format.html { redirect_to fabricante_path(@fabricante), notice: 'Fabricante atualizada com sucesso.' }\r\n format.json { render :show, status: :ok, location: @fabricante }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @fabricante.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @admin_agency = Admin::Agency.find(params[:id])\n\n respond_to do |format|\n if @admin_agency.update_attributes(params[:admin_agency])\n format.html { redirect_to @admin_agency, notice: 'Agency was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin.update(admin_params)\n format.html { redirect_to @admin, notice: 'Admin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @demanda = Demanda.find(params[:id])\n\n respond_to do |format|\n if @demanda.update_attributes(params[:demanda])\n if @demanda.tipo_demanda == '1' || @demanda.tipo_demanda == 1\n format.html { redirect_to \"/consultas/list/1\", :notice => 'Consulta atualizada com sucesso.'}\n format.json { head :no_content }\n elsif @demanda.tipo_demanda == '2' || @demanda.tipo_demanda == 2\n format.html { redirect_to \"/consultas/list/2\", :notice => 'Levantamento atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { redirect_to \"/consultas/list/3\", :notice => 'Flagrante atualizado com sucesso.' }\n format.json { head :no_content }\n end\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @demanda.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @admin_fund = Fund.find(params[:id])\n\n respond_to do |format|\n if @admin_fund.update_attributes(params[:admin_fund])\n format.html { redirect_to @admin_fund, notice: 'Fund was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_fund.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @demanda.update(demanda_params)\n format.html { redirect_to @demanda, notice: 'Demanda was successfully updated.' }\n format.json { render :show, status: :ok, location: @demanda }\n else\n format.html { render :edit }\n format.json { render json: @demanda.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @essay = Essay.find(params[:id])\n\n respond_to do |format|\n if @essay.update_attributes(params[:essay])\n format.html { redirect_to @essay, notice: 'Essay was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @essay.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end",
"def tenant_update(name, description, id)\n\t\n\t\tif(name.length != 0 and description.length != 0 and id.length != 0)\n\t\t\ttenant = {\"tenant\" => {\"name\" => name, \"description\" => description, \"enabled\" => true}}\n\t\tend\n\t\n\t\tjson_string = JSON.generate(tenant)\n\t\n\t\tpost_call = Curl::Easy.http_post(\"#{@ip_address}:#{@port_2}/tenants/#{id}\", json_string\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['Content-Type'] = 'application/json'\n\t\tend\n\t\tparsed_json = JSON.parse(post_call.body_str)\n\t\t\n\t\tputs parsed_json\n\t\treturn parsed_json\n\tend",
"def update\n respond_to do |format|\n if @adminkefu.update(kefu_params)\n format.html { redirect_to adminkefus_path, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @adminkefu }\n else\n format.html { render :edit }\n format.json { render json: @adminkefu.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n put :update\n end",
"def update\n respond_to do |format|\n if @request.update(admin_request_params)\n format.html { redirect_to [:admin, @request], notice: 'Request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @fabric = Fabric.find(params[:id])\n\n respond_to do |format|\n if @fabric.update_attributes(params[:fabric])\n format.html { redirect_to @fabric, notice: 'Fabric was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fabric.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def update\n respond_to do |format|\n\n format.json { render json: Axis.find(params[:id]).update( name: params[:name]) }\n end\n\n # end\n end",
"def update\n @safra_verdoso = SafraVerdoso.find(params[:id])\n\n respond_to do |format|\n if @safra_verdoso.update_attributes(params[:safra_verdoso])\n format.html { redirect_to \"/safra_produtos/#{@safra_verdoso.safra_produto_id}/descontos\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @safra_verdoso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @kota_stone.update(kota_stone_params)\n format.html { redirect_to kota_stones_url, notice: 'Kota stone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kota_stone.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\n end",
"def update\n respond_to do |format|\n if @docs_ponto.update(docs_ponto_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: @docs_ponto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tutorial = Tutorial.find(params[:id])\n editUpdate = params[:tutorial]\n hideUpdate = editUpdate.extract_keys!([:hidden])\n adminUpdate = editUpdate.extract_keys!([:featured])\n success = false\n \n #EDIT REQUEST\n if can_edit?(@tutorial) \n success = @tutorial.update_attributes(editUpdate)\n end\n \n #HIDE REQUEST\n if can_hide?(@tutorial) \n success = @tutorial.update_attributes(hideUpdate)\n end\n \n #ADMIN REQUEST\n if can_admin?(@tutorial)\n if adminUpdate.has_key?(:featured)\n if adminUpdate['featured'] == true\n adminUpdate['featured_at'] = Time.now()\n else\n adminUpdate['featured_at'] = nil\n end\n end\n \n success = @tutorial.update_attributes(adminUpdate)\n end\n\n respond_to do |format|\n if success\n format.html { redirect_to @tutorial, notice: 'Tutorial was successfully updated.' }\n format.json { render json: {}, status: :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tutorial.errors.full_messages(), status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @slashdot_posting.update(slashdot_posting_params)\n format.html { redirect_to @slashdot_posting, notice: 'Slashdot posting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @slashdot_posting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_key.update(api_key_params)\n format.html { redirect_to [:admin, @api_key], notice: 'Api key was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_key }\n else\n format.html { render :edit }\n format.json { render json: @api_key.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def update\n respond_to do |format|\n if @bracket_golfer.update(bracket_golfer_params)\n format.html { redirect_to @bracket_golfer, notice: 'Bracket golfer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bracket_golfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subadmin.update(subadmin_params)\n format.html { redirect_to @subadmin, notice: 'Subadmin was successfully updated.' }\n format.json { render :show, status: :ok, location: @subadmin }\n else\n format.html { render :edit }\n format.json { render json: @subadmin.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tenant_detail.update(tenant_detail_params)\n format.html { redirect_to @tenant_detail, notice: \"Tenant detail was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tenant_detail }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tenant_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @stalkee.update(stalkee_params)\n format.html { redirect_to @stalkee, notice: 'Stalkee was successfully updated.' }\n format.json { render :show, status: :ok, location: @stalkee }\n else\n format.html { render :edit }\n format.json { render json: @stalkee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, **args); end",
"def update\n respond_to do |format|\n if @admin_foundation.update(admin_foundation_params)\n format.html { redirect_to @admin_foundation, notice: 'Foundation was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_foundation }\n else\n format.html { render :edit }\n format.json { render json: @admin_foundation.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6654816",
"0.6445601",
"0.62220114",
"0.6175265",
"0.61671823",
"0.6163973",
"0.6111223",
"0.60848165",
"0.603647",
"0.6017741",
"0.6017741",
"0.5998265",
"0.5995518",
"0.59791595",
"0.5892284",
"0.5880789",
"0.58544594",
"0.58405834",
"0.58374256",
"0.5806576",
"0.5792266",
"0.57700634",
"0.5769394",
"0.5759633",
"0.57514185",
"0.57189304",
"0.57141125",
"0.5705195",
"0.5700815",
"0.5700815",
"0.5698209",
"0.56866413",
"0.5684409",
"0.567652",
"0.5674801",
"0.5657396",
"0.5652379",
"0.56490254",
"0.5648863",
"0.5647943",
"0.5645219",
"0.56444556",
"0.5644346",
"0.5623979",
"0.56238914",
"0.561443",
"0.56122446",
"0.56081533",
"0.5605448",
"0.560221",
"0.5600882",
"0.560025",
"0.56002015",
"0.5598473",
"0.5593028",
"0.5592653",
"0.5591147",
"0.5587986",
"0.5584466",
"0.55814207",
"0.55814207",
"0.55786514",
"0.55786514",
"0.5578239",
"0.55735725",
"0.5572629",
"0.55710775",
"0.55682206",
"0.5566456",
"0.556459",
"0.5560904",
"0.55592704",
"0.5556748",
"0.55560416",
"0.5555752",
"0.5552879",
"0.5551674",
"0.55516315",
"0.5551245",
"0.5547767",
"0.55457467",
"0.5543771",
"0.5542522",
"0.55382067",
"0.55379164",
"0.5537235",
"0.5536957",
"0.5536285",
"0.5535381",
"0.5534637",
"0.55323946",
"0.5529974",
"0.55245274",
"0.55245274",
"0.55233604",
"0.5522998",
"0.55208355",
"0.5518602",
"0.55182457",
"0.55166423"
] | 0.68653923 | 0 |
DELETE /admin/digersayfas/1 DELETE /admin/digersayfas/1.json | def destroy
@admin_digersayfa.destroy
respond_to do |format|
format.html { redirect_to admin_digersayfas_url, notice: 'Digersayfa was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete\n request(:delete)\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def delete\n api(\"Delete\")\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @gaz_assay = GazAssay.find(params[:id])\n @gaz_assay.destroy\n\n respond_to do |format|\n format.html { redirect_to gaz_assays_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def delete!\n request! :delete\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end",
"def delete_data\n response = WebPay.client.delete([path, 'data'].join('/'))\n response['deleted']\n end",
"def delete endpoint\n do_request :delete, endpoint\n end",
"def delete(path)\n\t\trequest(path, :delete)\n\tend",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end",
"def delete\n\n end",
"def destroy\n @aliquotum = Aliquotum.find(params[:id])\n @aliquotum.destroy\n\n respond_to do |format|\n format.html { redirect_to aliquota_url }\n format.json { head :no_content }\n end\n end",
"def delete\n api_client.delete(url)\n end",
"def delete\n \n end",
"def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\n end\n end",
"def delete\n \n end",
"def cfa_delete\n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : Entered in cfa titles cfa_delete method\"\n begin\n id=params[\"format\"] \n cfa=RestClient.delete $api_service+'/cfa_titles/'+id\n rescue =>e\n Rails.logger.custom_log.error { \"#{e} Cfa controller delete method\" }\n end\n redirect_to action: \"index\"\n end",
"def destroy\n @aliexpress = Aliexpress.find(params[:id])\n @aliexpress.destroy\n\n respond_to do |format|\n format.html { redirect_to aliexpresses_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n request(:delete, path)\n end",
"def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend",
"def destroy\n dns_entry_response = RestClient.delete('https://api.cloudflare.com/client/v4/zones/:zone_identifier/dns_records/:identifier',:content_type => :json, :accept => :json, :'x-auth-key' => session[:key] :'x-auth-email' => session[:email])\n @dns_entry.destroy\n respond_to do |format|\n format.html { redirect_to dns_entries_url, notice: \"Dns entry was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end",
"def deletef\n url = prefix + \"deletef\" + id_param\n return response(url)\n end",
"def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end",
"def destroy\n @admin.destroy\n\n render json: { operation: 'OK' }, status: :ok\n end",
"def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def delete(path)\n request 'DELETE', path\n end",
"def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end",
"def destroy\n @dataload_ga = DataloadGa.find(params[:id])\n @dataload_ga.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_gas_url }\n format.json { head :no_content }\n end\n end",
"def delete!( opts = {} )\n http_action :delete, nil, opts\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def delete(options={})\n connection.delete(\"/\", @name)\n end",
"def destroy\n @dapi.destroy\n respond_to do |format|\n format.html { redirect_to dapis_url, notice: 'Dapi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(*args)\n request(:delete, *args)\n end",
"def destroy\n @dailystat.destroy\n respond_to do |format|\n format.html { redirect_to dailystats_url, notice: 'Dailystat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @essay = Essay.find(params[:id])\n @essay.destroy\n\n respond_to do |format|\n format.html { redirect_to essays_url }\n format.json { head :ok }\n end\n end",
"def DeleteView id\n \n APICall(path: \"views/#{id}.json\",method: 'DELETE')\n \n end",
"def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end",
"def delete(*rest) end",
"def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fabrica.destroy\n respond_to do |format|\n format.html { redirect_to fabricas_url }\n format.json { head :no_content }\n end\n end",
"def delete\n start { |connection| connection.request http :Delete }\n end",
"def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end",
"def delete(payload = {})\n request! do\n options = {payload: to_payload(payload)}\n api(options)[url.path].delete(API_HEADERS)\n end\n end",
"def delete(path, params = {})\n Chirpy.request params.merge({:path => path, :method => 'delete'}.merge(authentication))\n end",
"def delete(path, data = {})\n self.class.delete path, :body => data.merge(:u => access_token)\n end",
"def deleteRequest\n\n end",
"def delete\n supprimer = SondageService.instance.supprimerSondage(params[:id])\n (supprimer) ? (render json: true, status: :ok) : (render json: false, status: :not_found)\nend",
"def delete(path, params)\n parse_response @client[path].delete(:params => params)\n end",
"def delete(path)\n path = format_path(path)\n bucket_path = get_bucket_path(path)\n date = gmtdate\n headers = {\n 'Host' => @aliyun_upload_host,\n 'Date' => date,\n 'Authorization' => sign('DELETE', bucket_path, '', '', date)\n }\n url = path_to_url(path)\n response = RestClient.delete(url, headers)\n response.code == 204 ? url : nil\n end",
"def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end",
"def delete\n\n\tend",
"def delete(path)\n request(:delete, path)\n end",
"def destroy\n @three60.destroy\n respond_to do |format|\n format.html { redirect_to edit_admin_good_url(@good, anchor: \"three60\") }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daily_data_payment.destroy\n respond_to do |format|\n format.html { redirect_to daily_data_payments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @early_access_request.destroy\n respond_to do |format|\n format.html { redirect_to early_access_requests_url, notice: 'Anfrage wurde gelöscht.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subway.destroy\n respond_to do |format|\n format.html { redirect_to subways_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n repository = path.split(/\\//)[2]\n objectid = path.split(/\\//)[3]\n if storage_fetch(repository, objectid) && storage_delete(repository, objectid)\n ['200', {}, []]\n else\n ['404', {}, [\"Repository #{repository} or ObjectID #{objectid} not found: #{path}\"]]\n end\n end",
"def destroy\n @taxirequest = Taxirequest.find(params[:id])\n @taxirequest.destroy\n\n respond_to do |format|\n format.html { redirect_to taxirequests_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Company.delete(params[\"id\"])\n end",
"def destroy\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n @gethotelstaticdatagd.destroy\n\n respond_to do |format|\n format.html { redirect_to gethotelstaticdatagds_url }\n format.json { head :no_content }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def deletes_to(path,opts={},&block) #:nodoc: \n crud_to(:delete,path,opts[:params] || {},opts,&block)\n end",
"def destroy\n @tipo_despesa.destroy\n respond_to do |format|\n format.html { redirect_to tenant_tipo_despesas_path(tenant_id: @tenant.id), notice: 'Tipo despesa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n checar_egresso_super\r\n @egresso.destroy\r\n respond_to do |format|\r\n format.html { redirect_to egressos_url, notice: 'Egresso excluído com sucesso.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @diagnoz = Diagnoz.find(params[:id])\n @diagnoz.destroy\n\n respond_to do |format|\n format.html { redirect_to diagnozs_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def delete_demo(id)\n delete_record \"/demos/#{id}\"\n end",
"def destroy\n @docderivacione.destroy\n respond_to do |format|\n format.html { redirect_to docderivaciones_url, notice: 'Docderivacione was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_fund = Fund.find(params[:id])\n @admin_fund.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_funds_url }\n format.json { head :no_content }\n end\n end",
"def delete_array_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/arrays/#{args[:arrayId]}\", args)\nend",
"def delete(path, params = {})\n post(path, params.merge(\"_method\" => \"delete\"))\n end",
"def destroy\n if @short_url.destroy\n render json: { status: \"Deleted\" }\n else\n render json: { head: \"no content\" }\n end \n end"
] | [
"0.74236",
"0.7324176",
"0.7195265",
"0.71433914",
"0.71433914",
"0.71433914",
"0.71433914",
"0.70854354",
"0.7054274",
"0.69827485",
"0.6969745",
"0.6968206",
"0.6907897",
"0.6904587",
"0.68939435",
"0.68937755",
"0.68937755",
"0.6888857",
"0.6878041",
"0.68323946",
"0.6807762",
"0.67919606",
"0.6791511",
"0.6785738",
"0.6770234",
"0.6755147",
"0.67380315",
"0.6736664",
"0.67296535",
"0.6719949",
"0.67162323",
"0.67155784",
"0.6708372",
"0.67018706",
"0.6701561",
"0.6701561",
"0.66991174",
"0.66988486",
"0.66988486",
"0.66988486",
"0.66988486",
"0.66988486",
"0.66988486",
"0.66988486",
"0.6697897",
"0.6694523",
"0.66944814",
"0.66937345",
"0.66837656",
"0.6659391",
"0.6650617",
"0.66412634",
"0.663933",
"0.66348916",
"0.66296285",
"0.66271174",
"0.6611414",
"0.6608664",
"0.6595756",
"0.6594647",
"0.6588027",
"0.6581997",
"0.6578748",
"0.65763795",
"0.65763795",
"0.6574664",
"0.65670013",
"0.65652436",
"0.6560263",
"0.6557853",
"0.6554912",
"0.655347",
"0.6546873",
"0.6546678",
"0.6543899",
"0.6543151",
"0.6542771",
"0.6535649",
"0.6535512",
"0.6532992",
"0.65315765",
"0.6526883",
"0.65216136",
"0.65212435",
"0.65163517",
"0.65163124",
"0.6515695",
"0.6514896",
"0.65145594",
"0.6514141",
"0.65132946",
"0.6507836",
"0.6505472",
"0.65039504",
"0.649802",
"0.6497942",
"0.6497772",
"0.6497144",
"0.64956266",
"0.6494634"
] | 0.75525564 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_admin_digersayfa
@admin_digersayfa = Admin::Digersayfa.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"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",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"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",
"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",
"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",
"def setup_handler\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"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",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"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",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"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",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"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",
"def determine_valid_action\n\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"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",
"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",
"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",
"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",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def action\n end",
"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",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"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",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"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",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"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",
"def setup_signals; end",
"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",
"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",
"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",
"def initialize(*args)\n super\n @action = :set\nend",
"def setup\n #implement in subclass;\n end",
"def after_set_callback; end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"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",
"def release_actions; end",
"def around_hooks; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def save_action; end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"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",
"def before_setup\n # do nothing by default\n end",
"def setup(&blk)\n @setup_block = blk\n end",
"def default_action; end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"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",
"def call\n setup_context\n super\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end"
] | [
"0.6165094",
"0.60450804",
"0.5944413",
"0.5915806",
"0.58885634",
"0.5835225",
"0.5775847",
"0.5700531",
"0.5700531",
"0.56543404",
"0.56209993",
"0.54238355",
"0.5410386",
"0.5410386",
"0.5410386",
"0.5394892",
"0.5377769",
"0.53559244",
"0.5339896",
"0.53388095",
"0.5330087",
"0.5311993",
"0.5297402",
"0.5296789",
"0.52957207",
"0.52596015",
"0.5245442",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5235431",
"0.5231888",
"0.5226663",
"0.52220625",
"0.5217086",
"0.52137345",
"0.5208314",
"0.5205469",
"0.5175606",
"0.5174914",
"0.5173361",
"0.51662856",
"0.5161792",
"0.51572216",
"0.5153063",
"0.5152982",
"0.5152632",
"0.51435786",
"0.5139829",
"0.51346594",
"0.511372",
"0.511372",
"0.51136476",
"0.51083213",
"0.5108011",
"0.5091935",
"0.5089297",
"0.5081576",
"0.50807106",
"0.50656676",
"0.50548106",
"0.50537366",
"0.505074",
"0.505074",
"0.5033361",
"0.5025158",
"0.5020441",
"0.5015611",
"0.50142473",
"0.5000281",
"0.50001067",
"0.49989453",
"0.4989465",
"0.4989465",
"0.4985425",
"0.49805096",
"0.49795893",
"0.49783278",
"0.49676263",
"0.49656346",
"0.49579078",
"0.4955427",
"0.49554235",
"0.49536413",
"0.49523768",
"0.49457142",
"0.49433607",
"0.4933641",
"0.49320185",
"0.49265638",
"0.49262375",
"0.49259067",
"0.4922456",
"0.49201223",
"0.49165115",
"0.49158815",
"0.49151883",
"0.49149552",
"0.4914386"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def admin_digersayfa_params
params.require(:admin_digersayfa).permit(:baslik, :metin, :tur, :dosya)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"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",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"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",
"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",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"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",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"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",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"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",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"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",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"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",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"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",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"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",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"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",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"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",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"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",
"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",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"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",
"def url_whitelist; end",
"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",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"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",
"def secure_params\n params.require(:location).permit(:name)\n end",
"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",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"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",
"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",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"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",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] | [
"0.6978086",
"0.6780264",
"0.6742658",
"0.6738813",
"0.67338693",
"0.65908474",
"0.6501793",
"0.6495506",
"0.64796513",
"0.64755446",
"0.6454826",
"0.6437561",
"0.6377127",
"0.63722163",
"0.6364058",
"0.63178706",
"0.62979764",
"0.62968165",
"0.62913024",
"0.6289789",
"0.6289145",
"0.62875307",
"0.6280997",
"0.62420976",
"0.62388235",
"0.6216686",
"0.62122375",
"0.6208949",
"0.619173",
"0.6176307",
"0.6173907",
"0.6170346",
"0.616111",
"0.6150513",
"0.6150023",
"0.61446756",
"0.6120429",
"0.6112975",
"0.6104845",
"0.6102966",
"0.6087884",
"0.6079323",
"0.60699135",
"0.60602236",
"0.60191786",
"0.60170597",
"0.60100305",
"0.6009527",
"0.60052776",
"0.60052776",
"0.600042",
"0.5999317",
"0.59933805",
"0.5991528",
"0.5991221",
"0.5990094",
"0.5979497",
"0.5966058",
"0.5958738",
"0.59579456",
"0.5957759",
"0.5956938",
"0.5951788",
"0.59511644",
"0.59423065",
"0.59373474",
"0.59361076",
"0.59361076",
"0.59331447",
"0.5928005",
"0.5924882",
"0.5924011",
"0.59169155",
"0.5908037",
"0.5907541",
"0.59061426",
"0.59056246",
"0.5897408",
"0.58960444",
"0.58951247",
"0.5893136",
"0.5892312",
"0.5890385",
"0.58853275",
"0.58801144",
"0.58784765",
"0.5872648",
"0.58682626",
"0.5867028",
"0.58661693",
"0.586578",
"0.58643955",
"0.5863193",
"0.58609086",
"0.5859997",
"0.5858935",
"0.5858632",
"0.5853379",
"0.5852741",
"0.584806",
"0.5847703"
] | 0.0 | -1 |
GET /instituicoes GET /instituicoes.json | def index
@instituicoes = Instituicao.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @instituicoes }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @instituicao = Instituicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instituicao }\n end\n end",
"def index\n @instancia = Instancium.all\n end",
"def show\n @institucional = Institucional.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institucional }\n end\n end",
"def show\n @incucai = Incucai.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incucai }\n end\n end",
"def new\n @instituicao = Instituicao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @instituicao }\n end\n end",
"def index\n @institutos = Instituto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @institutos }\n end\n end",
"def dame_institucion\n i = Metamares::Institucion.new\n i.nombre_institucion = params[:nombre_institucion]\n\n respond_to do |format|\n format.json { render json: i.busca_institucion.map{ |i| { id: i.id, value: i.nombre_institucion } } }\n format.html { @institucion = i }\n end\n end",
"def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end",
"def show\n @inscrito = Inscrito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inscrito }\n end\n end",
"def index\n @institucions = Institucion.search(params[:search], params[:page])\n end",
"def index\n @ivas = Iva.all\n\n render json: @ivas\n end",
"def show\n @instituicao = Instituicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instituicao }\n end\n end",
"def show\n @indicativo = Indicativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicativo }\n end\n end",
"def show\n @iniciativa = Iniciativa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @iniciativa }\n end\n end",
"def index\n @institucion = Institucion.where(:id => params[:institucion_id]).first\n @institucioncatalogos = Institucioncatalogo.where(:institucion_id => params[:institucion_id])\n end",
"def index\n @itineraires = Itineraire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @itineraires }\n end\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"def show\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio_entrega }\n end\n end",
"def show\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio }\n end\n end",
"def index\n @instituicao_responsavels = InstituicaoResponsavel.all\n end",
"def index\n @inventarios = Inventario.all\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tecnico }\n end\n end",
"def index\n @integrantes = Integrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @integrantes }\n end\n end",
"def show\n @institucion = Institucion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @institucion }\n end\n end",
"def index\n @inscricaos = Inscricao.all\n end",
"def index\n @inscripcions = Inscripcion.all\n end",
"def index\n @instituicao_cursos = InstituicaoCurso.all\n end",
"def show\n @entrada_inventario = EntradaInventario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrada_inventario }\n end\n end",
"def show\n @indicacao = Indicacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicacao }\n end\n end",
"def show\r\n @imobiliaria = Imobiliaria.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.json { render json: @imobiliaria }\r\n end\r\n end",
"def index\n @asociados = Asociado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asociados }\n end\n end",
"def show\n @impuesto = Impuesto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @impuesto }\n end\n end",
"def index\n @socios = Socio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socios }\n end\n end",
"def show\n @inspiration = Inspiration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inspiration }\n end\n end",
"def index\n \n @controles_asistencias = ControlAsistencia.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @controles_asistencias }\n end\n end",
"def index\n @ginasios = Ginasio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ginasios }\n end\n end",
"def index\n @status_de_la_inscripcions = StatusDeLaInscripcion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_inscripcions }\n end\n end",
"def new\n @institucional = Institucional.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institucional }\n end\n end",
"def index\n @anuncios = Anuncio.all\n render json: @anuncios, status: :ok\n end",
"def index\n @invitations = Invitation.all\n\n render json: @invitations, except: [:created_at, :updated_at], \n include: [:event => {include: [:host => {except: [:password_digest, :created_at, :updated_at]}]}]\n end",
"def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end",
"def new\n @incucai = Incucai.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incucai }\n end\n end",
"def index\n @iscriziones = Iscrizione.all\n end",
"def show\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @servicio }\n end\n end",
"def show\n @inspiration = Inspiration.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inspiration }\n end\n end",
"def index\r\n @imobiliarias = Imobiliaria.all\r\n\r\n respond_to do |format|\r\n # format.html # index.html.erb\r\n format.json { render json: @imobiliarias }\r\n end\r\n end",
"def index\n @eicons = Eicon.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eicons }\n end\n end",
"def index\n # Retrieve kpis templates from impac api.\n # TODO: improve request params to work for strong parameters\n attrs = params.slice('metadata', 'opts')\n auth = { username: MnoEnterprise.tenant_id, password: MnoEnterprise.tenant_key }\n\n response = begin\n MnoEnterprise::ImpacClient.send_get('/api/v2/kpis', attrs, basic_auth: auth)\n rescue => e\n return render json: { message: \"Unable to retrieve kpis from Impac API | Error #{e}\" }\n end\n\n # customise available kpis\n kpis = (response['kpis'] || []).map do |kpi|\n kpi = kpi.with_indifferent_access\n kpi[:watchables].map do |watchable|\n kpi.merge(\n name: \"#{kpi[:name]} #{watchable.capitalize unless kpi[:name].downcase.index(watchable)}\".strip,\n watchables: [watchable],\n target_placeholders: {watchable => kpi[:target_placeholders][watchable]},\n )\n end\n end\n .flatten\n\n render json: { kpis: kpis }\n end",
"def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end",
"def index\n @insts = Inst.all\n end",
"def index\n @noise = Noise.new\n @noises = Noise.all\n params[:page] ||= 1\n\n respond_to do |format|\n format.html { @noises = Noise.paginate(per_page: 20, page: params[:page]) }\n format.json do \n list = @noises.map\n render json: Noise.all.select('id, sounds, icon') \n end\n end\n end",
"def index\n #binding.pry\n @insta = Instum.all.includes(:user)\n end",
"def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end",
"def show\n @itineraire = Itineraire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @itineraire }\n end\n end",
"def index\n @ingenieros = Ingeniero.all\n end",
"def show\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @veiculo }\n end\n end",
"def show\n @asociado = Asociado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asociado }\n end\n end",
"def show\n @anuncio = Anuncio.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @anuncio }\n end\n end",
"def show\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegio }\n end\n end",
"def index\n @ativo_outros = AtivoOutro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ativo_outros }\n end\n end",
"def expiracion\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @usuario }\n end\n end",
"def show\n @calificacion_servicio = CalificacionServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calificacion_servicio }\n end\n end",
"def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end",
"def index\n @interessados = Interessado.all\n @interessados = Interessado.paginate(:page => params[:page], :per_page => 20)\n end",
"def show\n @ejercicio = Ejercicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ejercicio }\n end\n end",
"def show\r\n @asistencia = Asistencia.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @asistencia }\r\n end\r\n end",
"def show\n @ativo_outro = AtivoOutro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ativo_outro }\n end\n end",
"def show\n @colegiatura = Colegiatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegiatura }\n end\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def index\n @preparatoria_o_universidad_de_origens = PreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origens }\n end\n end",
"def show\n @integrante = Integrante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @integrante }\n end\n end",
"def index\n render json: @fiestas\n end",
"def index\n @cofis = Cofi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cofis }\n end\n end",
"def index\n @status_de_la_notificacions = StatusDeLaNotificacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_notificacions }\n end\n end",
"def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end",
"def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end",
"def create\n @instituicao = Instituicao.new(params[:instituicao])\n\n respond_to do |format|\n if @instituicao.save\n format.html { redirect_to @instituicao, notice: 'Instituicao was successfully created.' }\n format.json { render json: @instituicao, status: :created, location: @instituicao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instituicao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @uchronias = Uchronia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uchronias }\n end\n end",
"def index\n @one_reg_institutions = OneRegInstitution.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @one_reg_institutions }\n end\n end",
"def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end",
"def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"def index\n @instances = Instance.all\n render json: @instances\n end",
"def show\n @noto = Noto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @noto }\n end\n end",
"def index\n @ips = Ip.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ips }\n end\n end",
"def show\n @bico = Bico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bico }\n end\n end",
"def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end",
"def index\n @innings = Inning.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @innings }\n end\n end",
"def show\n @situacoes_juridica = SituacoesJuridica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @situacoes_juridica }\n end\n end",
"def index\n @tipo_usuarios = TipoUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipo_usuarios }\n end\n end",
"def show\n @leito = Leito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leito }\n end\n end",
"def show\n @status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_la_inscripcion }\n end\n end",
"def show\n @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etnia }\n end\n end",
"def index\n @icons = Icon.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @icons }\n end\n end",
"def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end",
"def show\n @uchronia = Uchronia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uchronia }\n end\n end",
"def index\n @iscrivitis = Iscriviti.all\n end",
"def show\n @cofi = Cofi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cofi }\n end\n end",
"def show\n @administrativo = Administrativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @administrativo }\n end\n end",
"def show\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @asiento }\n end\n end"
] | [
"0.751949",
"0.6958533",
"0.68788326",
"0.68244416",
"0.6755332",
"0.6747474",
"0.67021245",
"0.6619203",
"0.6611335",
"0.66074824",
"0.6586544",
"0.65787476",
"0.64574796",
"0.64278275",
"0.641245",
"0.6407009",
"0.640509",
"0.640509",
"0.63766575",
"0.63558304",
"0.634916",
"0.6342545",
"0.63383824",
"0.63339275",
"0.63058066",
"0.627389",
"0.6253505",
"0.6242972",
"0.6240181",
"0.6233277",
"0.62311333",
"0.6221803",
"0.6211988",
"0.6193197",
"0.6190426",
"0.618796",
"0.61771846",
"0.61767536",
"0.6160965",
"0.6158459",
"0.6134838",
"0.61319953",
"0.6119007",
"0.61188906",
"0.6113491",
"0.61030793",
"0.60954326",
"0.6090478",
"0.6088148",
"0.6086598",
"0.6074739",
"0.6064459",
"0.606304",
"0.60556495",
"0.60547525",
"0.60522467",
"0.6049673",
"0.6045521",
"0.6043934",
"0.60335404",
"0.6033449",
"0.6032294",
"0.60197645",
"0.60188365",
"0.6014567",
"0.6014285",
"0.6013757",
"0.601274",
"0.6005507",
"0.5999499",
"0.5997914",
"0.59876007",
"0.59841067",
"0.5983425",
"0.5980101",
"0.5979857",
"0.5979857",
"0.59733284",
"0.5972794",
"0.5969575",
"0.59673727",
"0.5966702",
"0.5963277",
"0.5963087",
"0.59593576",
"0.5957921",
"0.5954839",
"0.595123",
"0.59499615",
"0.5946894",
"0.5946724",
"0.5944076",
"0.5943593",
"0.594208",
"0.5939712",
"0.5939058",
"0.5930336",
"0.592913",
"0.59215885",
"0.591539"
] | 0.7875285 | 0 |
GET /instituicoes/1 GET /instituicoes/1.json | def show
@instituicao = Instituicao.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @instituicao }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"def show\n @institucional = Institucional.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institucional }\n end\n end",
"def dame_institucion\n i = Metamares::Institucion.new\n i.nombre_institucion = params[:nombre_institucion]\n\n respond_to do |format|\n format.json { render json: i.busca_institucion.map{ |i| { id: i.id, value: i.nombre_institucion } } }\n format.html { @institucion = i }\n end\n end",
"def index\n @instancia = Instancium.all\n end",
"def show\n @incucai = Incucai.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incucai }\n end\n end",
"def new\n @instituicao = Instituicao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @instituicao }\n end\n end",
"def show\n @instituicao = Instituicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instituicao }\n end\n end",
"def index\n @institucion = Institucion.where(:id => params[:institucion_id]).first\n @institucioncatalogos = Institucioncatalogo.where(:institucion_id => params[:institucion_id])\n end",
"def show\n @inscrito = Inscrito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inscrito }\n end\n end",
"def show\n @indicativo = Indicativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicativo }\n end\n end",
"def index\n @institutos = Instituto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @institutos }\n end\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"def show\n @iniciativa = Iniciativa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @iniciativa }\n end\n end",
"def show\n @institucion = Institucion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @institucion }\n end\n end",
"def show\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio_entrega }\n end\n end",
"def show\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio }\n end\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tecnico }\n end\n end",
"def show\r\n @imobiliaria = Imobiliaria.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.json { render json: @imobiliaria }\r\n end\r\n end",
"def show\n @indicacao = Indicacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicacao }\n end\n end",
"def show\n @entrada_inventario = EntradaInventario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrada_inventario }\n end\n end",
"def index\n @institucions = Institucion.search(params[:search], params[:page])\n end",
"def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end",
"def index\n @ivas = Iva.all\n\n render json: @ivas\n end",
"def show\n @impuesto = Impuesto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @impuesto }\n end\n end",
"def new\n @institucional = Institucional.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institucional }\n end\n end",
"def show\n @inspiration = Inspiration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inspiration }\n end\n end",
"def show\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @servicio }\n end\n end",
"def show\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @veiculo }\n end\n end",
"def index\n @integrantes = Integrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @integrantes }\n end\n end",
"def show\n @inspiration = Inspiration.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inspiration }\n end\n end",
"def show\n @integrante = Integrante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @integrante }\n end\n end",
"def index\n @itineraires = Itineraire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @itineraires }\n end\n end",
"def show\n @itineraire = Itineraire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @itineraire }\n end\n end",
"def show\n @status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_la_inscripcion }\n end\n end",
"def show\n @anuncio = Anuncio.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @anuncio }\n end\n end",
"def show\n @tipo_convenio = TipoConvenio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_convenio }\n end\n end",
"def show\n @bico = Bico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bico }\n end\n end",
"def index\n @inventarios = Inventario.all\n end",
"def show\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegio }\n end\n end",
"def show\n @uchronia = Uchronia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uchronia }\n end\n end",
"def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end",
"def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end",
"def show\n @asociado = Asociado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asociado }\n end\n end",
"def show\n @interruption = Interruption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interruption }\n end\n end",
"def show\n @colegiatura = Colegiatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegiatura }\n end\n end",
"def show\n @calificacion_servicio = CalificacionServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calificacion_servicio }\n end\n end",
"def show\n @leito = Leito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leito }\n end\n end",
"def show\r\n @asistencia = Asistencia.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @asistencia }\r\n end\r\n end",
"def show\n @ativo_outro = AtivoOutro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ativo_outro }\n end\n end",
"def new\n @incucai = Incucai.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incucai }\n end\n end",
"def show\n @sezione = Sezione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sezione }\n end\n end",
"def show\n @cofi = Cofi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cofi }\n end\n end",
"def show\n @ejercicio = Ejercicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ejercicio }\n end\n end",
"def show\n @instancia_item = InstanciaItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instancia_item }\n end\n end",
"def index\n @status_de_la_inscripcions = StatusDeLaInscripcion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_inscripcions }\n end\n end",
"def show\n @noto = Noto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @noto }\n end\n end",
"def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end",
"def show\n @tipo_negocio = TipoNegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_negocio }\n end\n end",
"def show\n @vnic = Vnic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vnic }\n end\n end",
"def show\n @institution = Institution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institution }\n end\n end",
"def show\n @institution = Institution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institution }\n end\n end",
"def index\n @one_reg_institutions = OneRegInstitution.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @one_reg_institutions }\n end\n end",
"def show\n @institution = Institution.find(params[:id])\n\n render json: @institution\n\n rescue ActiveRecord::RecordNotFound\n render json: {message: 'Resource not found'}, status: 404\n\n end",
"def index\n @asociados = Asociado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asociados }\n end\n end",
"def show\n @giang_vien = GiangVien.find(params[:id])\n\n respond_to do |format| \n format.json { render json: @giang_vien }\n end\n end",
"def expiracion\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @usuario }\n end\n end",
"def show\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solicitud_servicio }\n end\n end",
"def show\n @estatuto = Estatuto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estatuto }\n end\n end",
"def index\n @inscricaos = Inscricao.all\n end",
"def show\n @nguoi_dung = NguoiDung.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nguoi_dung }\n end\n end",
"def show\n @proyecto_imagen = ProyectoImagen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proyecto_imagen }\n end\n end",
"def index\n @socios = Socio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socios }\n end\n end",
"def show\n @tipo_atendimento = TipoAtendimento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_atendimento }\n end\n end",
"def show\n @odontologia1 = Odontologia1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @odontologia1 }\n end\n end",
"def show\n @articulo = Articulo.find(params[:id])\n @noticias = Articulo.where(\"tipo = 'noticia'\").order(\"created_at desc\")\n @title = @articulo.titulo\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end",
"def show\n @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etnia }\n end\n end",
"def index\n @insts = Inst.all\n end",
"def index\n @ginasios = Ginasio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ginasios }\n end\n end",
"def show\n @administrativo = Administrativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @administrativo }\n end\n end",
"def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end",
"def index\n @inscripcions = Inscripcion.all\n end",
"def show\n @control_asistencia = ControlAsistencia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @control_asistencia }\n end\n end",
"def index\n @instituicao_responsavels = InstituicaoResponsavel.all\n end",
"def show\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @asiento }\n end\n end",
"def show\n @serv_adicionale = ServAdicionale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @serv_adicionale }\n end\n end",
"def index\n #binding.pry\n @insta = Instum.all.includes(:user)\n end",
"def show\n @consumo = Consumo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @consumo }\n end\n end",
"def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end",
"def show\n @empresa_servicio = EmpresaServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empresa_servicio }\n end\n end",
"def show\n @situacoes_juridica = SituacoesJuridica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @situacoes_juridica }\n end\n end",
"def show\n @continent = Continent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @continent }\n end\n end",
"def show\n @usuario = Usuario.find(params[:id])\n\n render json: @usuario\n end",
"def index\n @instituicao_cursos = InstituicaoCurso.all\n end",
"def show\n @interes = Interes.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interes }\n format.json { render :json => @interes }\n end\n end",
"def show\n @concurso = Concurso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concurso }\n end\n end",
"def index\r\n @imobiliarias = Imobiliaria.all\r\n\r\n respond_to do |format|\r\n # format.html # index.html.erb\r\n format.json { render json: @imobiliarias }\r\n end\r\n end",
"def show\n @icome = Icome.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @icome }\n end\n end",
"def show\n @ci = Ci.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ci }\n end\n end",
"def show\n @ingridient = Ingridient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ingridient }\n end\n end"
] | [
"0.7704511",
"0.70620894",
"0.69456315",
"0.68963146",
"0.6868936",
"0.685834",
"0.6730599",
"0.66842204",
"0.6682483",
"0.6668672",
"0.66208",
"0.65291506",
"0.65291506",
"0.6524573",
"0.65057886",
"0.65046215",
"0.65035135",
"0.64633906",
"0.64383066",
"0.6434014",
"0.6391661",
"0.6387585",
"0.63863957",
"0.6347882",
"0.6347221",
"0.6334777",
"0.63069344",
"0.63044155",
"0.62984186",
"0.6263851",
"0.6253603",
"0.6250643",
"0.6241762",
"0.6237679",
"0.6234891",
"0.62262684",
"0.61973584",
"0.6187553",
"0.61872596",
"0.61859953",
"0.6179888",
"0.6177211",
"0.6177211",
"0.61736333",
"0.6170264",
"0.6160638",
"0.6158265",
"0.6144258",
"0.6140101",
"0.61322325",
"0.6129604",
"0.6126946",
"0.6118586",
"0.61119163",
"0.610842",
"0.61079836",
"0.6094877",
"0.6086048",
"0.60858405",
"0.6085119",
"0.6074456",
"0.6074456",
"0.6072541",
"0.60705286",
"0.6064272",
"0.6060456",
"0.60586745",
"0.6056225",
"0.6054712",
"0.6054379",
"0.6047332",
"0.6047017",
"0.60387367",
"0.6034549",
"0.60332763",
"0.60321206",
"0.602952",
"0.60285354",
"0.6028126",
"0.6026446",
"0.602562",
"0.60185164",
"0.60177714",
"0.6016287",
"0.6016172",
"0.6015378",
"0.6014436",
"0.6012877",
"0.60039264",
"0.6002317",
"0.5999773",
"0.5997327",
"0.59964937",
"0.59959924",
"0.5995171",
"0.5987441",
"0.5984487",
"0.5983496",
"0.59774804",
"0.5977456"
] | 0.766338 | 1 |
GET /instituicoes/new GET /instituicoes/new.json | def new
@instituicao = Instituicao.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @instituicao }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @indicativo = Indicativo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indicativo }\n end\n end",
"def new\n @sitio_entrega = SitioEntrega.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sitio_entrega }\n end\n end",
"def new\n @tecnico = Tecnico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tecnico }\n end\n end",
"def new\n @sitio = Sitio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sitio }\n end\n end",
"def new\n @noto = Noto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @noto }\n end\n end",
"def new\n @indicacao = Indicacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indicacao }\n end\n end",
"def new\n @tecnico = Tecnico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @tecnico }\n end\n end",
"def new\n @instituicao = Instituicao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instituicao }\n end\n end",
"def new\n @institucional = Institucional.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institucional }\n end\n end",
"def new\n @sezione = Sezione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sezione }\n end\n end",
"def new\n @asociado = Asociado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @asociado }\n end\n end",
"def create\n @instituicao = Instituicao.new(params[:instituicao])\n\n respond_to do |format|\n if @instituicao.save\n format.html { redirect_to @instituicao, notice: 'Instituicao was successfully created.' }\n format.json { render json: @instituicao, status: :created, location: @instituicao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instituicao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instituto }\n end\n end",
"def new\n @nabe = Nabe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nabe }\n end\n end",
"def new\n @veiculo = Veiculo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @veiculo }\n end\n end",
"def new\n @tipo_negocio = TipoNegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_negocio }\n end\n end",
"def new\n @tipo_convenio = TipoConvenio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_convenio }\n end\n end",
"def new\n @tenni = Tenni.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tenni }\n end\n end",
"def new\n @institucion = Institucion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @institucion }\n end\n end",
"def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recurso }\n end\n end",
"def new\n @asignatura = Asignatura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @asignatura }\n end\n end",
"def new\n puts 'NEW METHOD'\n @pessoa = Pessoa.new\n @pessoa.enderecos.build\n 2.times { @pessoa.telefones.build }\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pessoa }\n end\n end",
"def new\n @estatuto = Estatuto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estatuto }\n end\n end",
"def new\n @inspiration = Inspiration.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inspiration }\n end\n end",
"def new\n @mi = Mi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mi }\n end\n end",
"def new\n @publicidad = Publicidad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publicidad }\n end\n end",
"def new\n @coisa = Coisa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @coisa }\n end\n end",
"def new\n @ci = Ci.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ci }\n end\n end",
"def new\n @servicio = Servicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @servicio }\n end\n end",
"def new\n @status_de_la_inscripcion = StatusDeLaInscripcion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_de_la_inscripcion }\n end\n end",
"def new\n @sotrudniki = Sotrudniki.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sotrudniki }\n end\n end",
"def new\n @publicidade = Publicidade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publicidade }\n end\n end",
"def new\n @hasil = Hasil.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hasil }\n end\n end",
"def new\n @etnia = Etnia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @etnia }\n end\n end",
"def new\n @colegio = Colegio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @colegio }\n end\n end",
"def new\n @cita = Cita.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cita }\n end\n end",
"def new\n @selecao = Selecao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @selecao }\n end\n end",
"def new\n @entrada_inventario = EntradaInventario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entrada_inventario }\n end\n end",
"def new\n @caixa = Caixa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @caixa }\n end\n end",
"def new\n @lei = Lei.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lei }\n end\n end",
"def new\n @tipo_atendimento = TipoAtendimento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_atendimento }\n end\n end",
"def new\n @incucai = Incucai.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incucai }\n end\n end",
"def new\n @caracteristica_imovel = CaracteristicaImovel.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @caracteristica_imovel }\n end\n end",
"def new\n @itype = Itype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @itype }\n end\n end",
"def new\n @peso = Peso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @peso }\n end\n end",
"def new\n @utente = Utente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @utente }\n end\n end",
"def new\n @iniciativa = Iniciativa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @iniciativa }\n end\n end",
"def new\n @estudiante = Estudiante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estudiante }\n end\n end",
"def new\n @contacter = Contacter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contacter }\n end\n end",
"def new\n @idiom = Idiom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @idiom }\n end\n end",
"def new\n @colegiatura = Colegiatura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @colegiatura }\n end\n end",
"def new\n @tipo_usuario = TipoUsuario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_usuario }\n end\n end",
"def new\n @new = true\n @administrativo = Administrativo.new\n @administrativo.build_user\n atributos\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @administrativo }\n end\n end",
"def new\n @suplente = Suplente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @suplente }\n end\n end",
"def new\n @attri = Attri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attri }\n end\n end",
"def new\n @institution = Institution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institution }\n end\n end",
"def new\n unless possui_acesso?()\n return\n end\n @aviso = Aviso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aviso }\n end\n end",
"def new\n @requerimiento = Requerimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requerimiento }\n end\n end",
"def new\n @capacidad = Capacidad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @capacidad }\n end\n end",
"def new\n @activite = Activite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @activite }\n end\n end",
"def new\n @cliente = Cliente.new\n localidad_new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"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",
"def new\n @control_asistencia = ControlAsistencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @control_asistencia }\n end\n end",
"def new\n @status_de_la_notificacion = StatusDeLaNotificacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_de_la_notificacion }\n end\n end",
"def new\n @tiezi = Tiezi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tiezi }\n end\n end",
"def new\n @premio = Premio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @premio }\n end\n end",
"def new\n @ip = Ip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ip }\n end\n end",
"def new\n @integrante = Integrante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @integrante }\n end\n end",
"def new\n @itineraire = Itineraire.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @itineraire }\n end\n end",
"def new\n @vnic = Vnic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vnic }\n end\n end",
"def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interest }\n end\n end",
"def new\n @icome = Icome.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @icome }\n end\n end",
"def new\n @inning = Inning.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inning }\n end\n end",
"def new\n @lieu = Lieu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lieu }\n end\n end",
"def new\n @bico = Bico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bico }\n end\n end",
"def new\n @estacionamiento = Estacionamiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estacionamiento }\n end\n end",
"def new\n @cofi = Cofi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cofi }\n end\n end",
"def new\n @tipo_pensum = TipoPensum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_pensum }\n end\n end",
"def create\n @instituto = Instituto.new(instituto_params)\n\n respond_to do |format|\n if @instituto.save\n format.html { redirect_to @instituto, notice: 'O instituto foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @instituto }\n else\n format.html { render :new }\n format.json { render json: @instituto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @sistema = Sistema.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sistema }\n end\n end",
"def new\n redirect_to new_prospecto_path, :flash => { :info => \"No es posible crear Inscritos sin antes seguir el proceso\" } \n @inscrito = Inscrito.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inscrito }\n end\n end",
"def new\n @premio = Premio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @premio }\n end\n end",
"def new\n @concurso = Concurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @concurso }\n end\n end",
"def new\n @areco = Areco.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @areco }\n end\n end",
"def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @ejercicio = Ejercicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ejercicio }\n end\n end",
"def new\n @comentario = Comentario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comentario }\n end\n end",
"def new\n @activo = Activo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @activo }\n end\n end",
"def new\n @ativo_outro = AtivoOutro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ativo_outro }\n end\n end",
"def new\n @clasificacion_pegi = ClasificacionPegi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clasificacion_pegi }\n end\n end",
"def new\n @interest = Interest.new\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end",
"def create\n @instituicao = Instituicao.new(params[:instituicao])\n\n respond_to do |format|\n if @instituicao.save\n format.html { redirect_to(@instituicao, :notice => 'Instituicao was successfully created.') }\n format.xml { render :xml => @instituicao, :status => :created, :location => @instituicao }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @instituicao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interest }\n end\n end",
"def new\n @tipo_vehiculo = TipoVehiculo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_vehiculo }\n end\n end",
"def new\n @socio = Socio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @socio }\n end\n end",
"def new\n @soil = Soil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @soil }\n end\n end"
] | [
"0.7481899",
"0.74592733",
"0.7392899",
"0.7371191",
"0.7345058",
"0.7335122",
"0.7324422",
"0.72810566",
"0.727145",
"0.72610426",
"0.7247983",
"0.7228057",
"0.72174495",
"0.71782017",
"0.7171193",
"0.7157048",
"0.7149544",
"0.71336293",
"0.71280897",
"0.71144384",
"0.70921487",
"0.7088236",
"0.7087868",
"0.70860994",
"0.70846593",
"0.7081903",
"0.7079993",
"0.7073579",
"0.70719343",
"0.7069585",
"0.70677346",
"0.70637304",
"0.7063632",
"0.706029",
"0.7053085",
"0.7052099",
"0.705195",
"0.70498663",
"0.7046966",
"0.7039535",
"0.7039364",
"0.70352167",
"0.70272857",
"0.70196784",
"0.701799",
"0.7013967",
"0.701211",
"0.70050997",
"0.70049596",
"0.7000879",
"0.6995609",
"0.6986142",
"0.6985198",
"0.6975125",
"0.6971978",
"0.6964534",
"0.69600105",
"0.6959168",
"0.69585806",
"0.695714",
"0.6949798",
"0.69449127",
"0.6944368",
"0.6936776",
"0.69354296",
"0.6935348",
"0.6933285",
"0.69292",
"0.6929122",
"0.6925348",
"0.692414",
"0.6912965",
"0.69129217",
"0.690868",
"0.6904816",
"0.6903639",
"0.6901851",
"0.6900396",
"0.6898538",
"0.68938345",
"0.6891776",
"0.6885586",
"0.6882739",
"0.68775195",
"0.6877117",
"0.6877117",
"0.6877117",
"0.6877117",
"0.6877117",
"0.6875738",
"0.68742216",
"0.6868606",
"0.6863643",
"0.6861591",
"0.68566245",
"0.68546295",
"0.6854308",
"0.68511844",
"0.6850978",
"0.6845973"
] | 0.79367125 | 0 |
POST /instituicoes POST /instituicoes.json | def create
@instituicao = Instituicao.new(params[:instituicao])
respond_to do |format|
if @instituicao.save
format.html { redirect_to @instituicao, notice: 'Instituicao was successfully created.' }
format.json { render json: @instituicao, status: :created, location: @instituicao }
else
format.html { render action: "new" }
format.json { render json: @instituicao.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @instituto = Instituto.new(instituto_params)\n\n respond_to do |format|\n if @instituto.save\n format.html { redirect_to @instituto, notice: 'O instituto foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @instituto }\n else\n format.html { render :new }\n format.json { render json: @instituto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @institucion = Institucion.new(institucion_params)\n\n respond_to do |format|\n if @institucion.save\n format.html { redirect_to @institucion, notice: 'Empresa se ha creado correctamente.' }\n format.json { render :show, status: :created, location: @institucion }\n else\n format.html { render :new }\n format.json { render json: @institucion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @instituicao = Instituicao.new(params[:instituicao])\n\n respond_to do |format|\n if @instituicao.save\n format.html { redirect_to(@instituicao, :notice => 'Instituicao was successfully created.') }\n format.xml { render :xml => @instituicao, :status => :created, :location => @instituicao }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @instituicao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @instancium = Instancium.new(instancium_params)\n\n respond_to do |format|\n if @instancium.save\n format.html { redirect_to @instancium, notice: 'Instancium was successfully created.' }\n format.json { render :show, status: :created, location: @instancium }\n else\n format.html { render :new }\n format.json { render json: @instancium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def dame_institucion\n i = Metamares::Institucion.new\n i.nombre_institucion = params[:nombre_institucion]\n\n respond_to do |format|\n format.json { render json: i.busca_institucion.map{ |i| { id: i.id, value: i.nombre_institucion } } }\n format.html { @institucion = i }\n end\n end",
"def create\n @instituicao_responsavel = InstituicaoResponsavel.new(instituicao_responsavel_params)\n\n respond_to do |format|\n if @instituicao_responsavel.save\n format.html { redirect_to @instituicao_responsavel, notice: 'Instituicao responsavel was successfully created.' }\n format.json { render :show, status: :created, location: @instituicao_responsavel }\n else\n format.html { render :new }\n format.json { render json: @instituicao_responsavel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @institucional = Institucional.new(params[:institucional])\n\n respond_to do |format|\n if @institucional.save\n format.html { redirect_to @institucional, notice: 'Institucional was successfully created.' }\n format.json { render json: @institucional, status: :created, location: @institucional }\n else\n format.html { render action: \"new\" }\n format.json { render json: @institucional.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @instituicao = Instituicao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @instituicao }\n end\n end",
"def create\n @inscripcion = Inscripcion.new(inscripcion_params)\n\n respond_to do |format|\n if @inscripcion.save\n format.html { redirect_to @inscripcion, notice: 'Inscripcion was successfully created.' }\n format.json { render :show, status: :created, location: @inscripcion }\n else\n format.html { render :new }\n format.json { render json: @inscripcion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @incucai = Incucai.new(params[:incucai])\n\n respond_to do |format|\n if @incucai.save\n format.html { redirect_to @incucai, notice: 'Incucai was successfully created.' }\n format.json { render json: @incucai, status: :created, location: @incucai }\n else\n format.html { render action: \"new\" }\n format.json { render json: @incucai.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @institucion = Institucion.new(params[:institucion])\n\n respond_to do |format|\n if @institucion.save\n flash[:notice] = 'Institucion se ha creado con exito.'\n format.html { redirect_to(admin_institucions_url) }\n format.xml { render :xml => @institucion, :status => :created, :location => @institucion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @institucion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @inventario = Inventario.new(inventario_params)\n\n respond_to do |format|\n if @inventario.save\n format.html { redirect_to @inventario, notice: 'Inventario was successfully created.' }\n format.json { render :show, status: :created, location: @inventario }\n else\n format.html { render :new }\n format.json { render json: @inventario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def instituto_params\n params.require(:instituto).permit(:nome, :sigla, :local)\n end",
"def instituicao_params\n params.require(:instituicao).permit(:nome, :cod_mec, :mantenedora_id, :site, :sigla, :telefone, :org, :emails, :categoria, :endereco_id)\n end",
"def create\n @instituicao_curso = InstituicaoCurso.new(instituicao_curso_params)\n\n @instituicao_curso.instituicao = Instituicao.find(@instituicao_curso.instituicao_id)\n @instituicao_curso.curso = Curso.find(@instituicao_curso.curso_id)\n\n respond_to do |format|\n if @instituicao_curso.save\n format.html { redirect_to @instituicao_curso, notice: 'Instituicao curso was successfully created.' }\n format.json { render :show, status: :created, location: @instituicao_curso }\n else\n format.html { render :new }\n format.json { render json: @instituicao_curso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @insumo = Insumo.new(insumo_params)\n\n respond_to do |format|\n if @insumo.save\n format.html { redirect_to insumos_url, notice: 'Insumo was successfully created.' }\n format.json { render :show, status: :created, location: @insumo }\n else\n format.html { render :new }\n format.json { render json: @insumo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @infraccion = Infraccion.new(infraccion_params)\n\n respond_to do |format|\n if @infraccion.save\n format.html { redirect_to @infraccion, notice: 'Infraccion was successfully created.' }\n format.json { render :show, status: :created, location: @infraccion }\n else\n format.html { render :new }\n format.json { render json: @infraccion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @iscrizione = Iscrizione.new(iscrizione_params)\n\n respond_to do |format|\n if @iscrizione.save\n format.html { redirect_to @iscrizione, notice: \"Iscrizione was successfully created.\" }\n format.json { render :show, status: :created, location: @iscrizione }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @iscrizione.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"def create\n\n @instum = current_user.insta.build(instum_params)\n # @instum.user_id = current_user.id\n\n respond_to do |format|\n if @instum.valid?\n @instum.save\n # binding.pry\n # redirect_to insta_path, notice: \"写真を投稿しました!\"\n # NoticeMailer.sendmail_insta(@instum).deliver\n format.html { redirect_to @instum, notice: '投稿が成功しました!' }\n format.json { render :show, status: :created, location: @instum }\n else\n format.html { render :new }\n format.json { render json: @instum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tecnica_de_impresion = TecnicaDeImpresion.new(tecnica_de_impresion_params)\n\n respond_to do |format|\n if @tecnica_de_impresion.save\n format.html { redirect_to @tecnica_de_impresion, notice: 'Tecnica de impresion was successfully created.' }\n format.json { render :show, status: :created, location: @tecnica_de_impresion }\n else\n format.html { render :new }\n format.json { render json: @tecnica_de_impresion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n respond_to do |format|\n if @instituto.save\n format.html { redirect_to(@instituto, :notice => 'Instituto fue creado exitosamente.') }\n format.xml { render :xml => @instituto, :status => :created, :location => @instituto }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @instituto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @instagrampic = Instagrampic.new(instagrampic_params)\n\n respond_to do |format|\n if @instagrampic.save\n format.html { redirect_to @instagrampic, notice: 'Instagrampic was successfully created.' }\n format.json { render :show, status: :created, location: @instagrampic }\n else\n format.html { render :new }\n format.json { render json: @instagrampic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n self.validar_admin\n @inventario = Inventario.new(inventario_params)\n\n respond_to do |format|\n if @inventario.save\n format.html { redirect_to @inventario, notice: 'Inventario was successfully created.' }\n format.json { render :show, status: :created, location: @inventario }\n else\n format.html { render :new }\n format.json { render json: @inventario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def creacion\n fiesta = Fiesta.new (params[:id])\n if Fiesta.save\n puts \"su fiesta a sido registrada\"\n else \n puts \"su fiesta no a sido registrada\"\n end\n render = json: fiesta \n end",
"def create\n @instance_eni = InstanceEni.new(instance_eni_params)\n\n respond_to do |format|\n if @instance_eni.save\n format.html { redirect_to @instance_eni, notice: 'Instance eni was successfully created.' }\n format.json { render :show, status: :created, location: @instance_eni }\n else\n format.html { render :new }\n format.json { render json: @instance_eni.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @inscricao = Inscricao.new(inscricao_params)\n\n respond_to do |format|\n if @inscricao.save\n format.html { redirect_to @inscricao, notice: \"Inscricao was successfully created.\" }\n format.json { render :show, status: :created, location: @inscricao }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @inscricao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully created.' }\n format.json { render :json => @tecnico, :status => :created, :location => @tecnico }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @insta_post = InstaPost.new(insta_post_params)\n\n respond_to do |format|\n if @insta_post.save\n format.html { redirect_to @insta_post, notice: 'Insta post was successfully created.' }\n format.json { render :show, status: :created, location: @insta_post }\n else\n format.html { render :new }\n format.json { render json: @insta_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @interesado = Interesado.new(interesado_params)\n\n respond_to do |format|\n if @interesado.save\n format.html { redirect_to @interesado, notice: 'Interesado was successfully created.' }\n format.json { render :show, status: :created, location: @interesado }\n else\n format.html { render :new }\n format.json { render json: @interesado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @iniciativa = Iniciativa.new(params[:iniciativa])\n\n respond_to do |format|\n if @iniciativa.save\n format.html { redirect_to @iniciativa, notice: 'Iniciativa was successfully created.' }\n format.json { render json: @iniciativa, status: :created, location: @iniciativa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @iniciativa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @inicio = Inicio.new(inicio_params)\n\n respond_to do |format|\n if @inicio.save\n format.html { redirect_to @inicio, notice: 'Inicio was successfully created.' }\n format.json { render :show, status: :created, location: @inicio }\n else\n format.html { render :new }\n format.json { render json: @inicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def instituicao_responsavel_params\n params.require(:instituicao_responsavel).permit(:instituicao_id, :nome, :inseridoPor, :dataDeInsercao, :atualizadoPor, :dataDeAtualizacao)\n end",
"def create\r\n @imobiliaria = Imobiliaria.new(imobiliaria_params)\r\n\r\n respond_to do |format|\r\n if @imobiliaria.save\r\n format.json { render json: @imobiliaria, status: :created }\r\n else \r\n format.json { render json: @imobiliaria.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @utenti = Utenti.new(utenti_params)\n\n respond_to do |format|\n if @utenti.save\n format.html { redirect_to @utenti, notice: \"Utenti was successfully created.\" }\n format.json { render :show, status: :created, location: @utenti }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @utenti.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ingeniero = Ingeniero.new(ingeniero_params)\n\n respond_to do |format|\n if @ingeniero.save\n format.html { redirect_to @ingeniero, notice: 'Ingeniero was successfully created.' }\n format.json { render :show, status: :created, location: @ingeniero }\n else\n format.html { render :new }\n format.json { render json: @ingeniero.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sitio = Sitio.new(params[:sitio])\n\n respond_to do |format|\n if @sitio.save\n format.html { redirect_to @sitio, notice: 'Sitio was successfully created.' }\n format.json { render json: @sitio, status: :created, location: @sitio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sitio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @indicativo = Indicativo.new(params[:indicativo])\n\n respond_to do |format|\n if @indicativo.save\n format.html { redirect_to @indicativo, notice: 'Indicativo was successfully created.' }\n format.json { render json: @indicativo, status: :created, location: @indicativo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @indicativo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sitio_entrega = SitioEntrega.new(params[:sitio_entrega])\n\n respond_to do |format|\n if @sitio_entrega.save\n format.html { redirect_to @sitio_entrega, notice: 'Sitio entrega was successfully created.' }\n format.json { render json: @sitio_entrega, status: :created, location: @sitio_entrega }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sitio_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @oiseau = Oiseau.new(oiseau_params)\n\n respond_to do |format|\n if @oiseau.save\n format.html { redirect_to @oiseau, notice: 'Oiseau was successfully created.' }\n format.json { render :show, status: :created, location: @oiseau }\n else\n format.html { render :new }\n format.json { render json: @oiseau.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, notice: 'Tecnico criado com sucesso.' }\n format.json { render json: @tecnico, status: :created, location: @tecnico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def institucion_params\n params.require(:institucion).permit(:cod, :nombre, :email, :direccion, :telefono)\n end",
"def create\n @inscrito = Inscrito.new(params[:inscrito])\n\n respond_to do |format|\n if @inscrito.save\n format.html { redirect_to @inscrito, notice: 'Inscrito was successfully created.' }\n format.json { render json: @inscrito, status: :created, location: @inscrito }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inscrito.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ingresso = Ingresso.new(ingresso_params)\n\n respond_to do |format|\n if @ingresso.save\n format.html { redirect_to @ingresso, notice: 'Ingresso was successfully created.' }\n format.json { render :show, status: :created, location: @ingresso }\n else\n format.html { render :new }\n format.json { render json: @ingresso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @insta_account = InstaAccount.new(insta_account_params)\n\n respond_to do |format|\n if @insta_account.save\n format.html { redirect_to @insta_account, notice: 'Insta account was successfully created.' }\n format.json { render :show, status: :created, location: @insta_account }\n else\n format.html { render :new }\n format.json { render json: @insta_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @iglesia = Iglesia.new(iglesia_params)\n\n respond_to do |format|\n if @iglesia.save\n format.html { redirect_to iglesias_path, notice: \"La iglesia #{@iglesia.nombre} ha sido creada.\" }\n format.json { render action: 'show', status: :created, location: @iglesia }\n else\n format.html { render action: 'new' }\n format.json { render json: @iglesia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @inventario.user_id = current_user.id\n respond_to do |format|\n if @inventario.save\n format.html { redirect_to @inventario, notice: 'Inventario was successfully created.' }\n format.json { render :show, status: :created, location: @inventario }\n else\n format.html { render :new }\n format.json { render json: @inventario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @seihinn = Seihinn.new(seihinn_params)\n\n respond_to do |format|\n if @seihinn.save\n format.html { redirect_to @seihinn, notice: \"Seihinn was successfully created.\" }\n format.json { render :show, status: :created, location: @seihinn }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @seihinn.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @niche = current_user.niches.new(processed_params)\n if @niche.save\n render json: { status: 'ok' }\n else\n render json: { status: @niche.errors.to_a.join('base') }\n end\n end",
"def create\n @instarter = Instarter.new(instarter_params)\n\n respond_to do |format|\n if @instarter.save\n format.html { redirect_to @instarter, notice: 'Instarter was successfully created.' }\n format.json { render :show, status: :created, location: @instarter }\n else\n format.html { render :new }\n format.json { render json: @instarter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @situacoes_juridica = SituacoesJuridica.new(params[:situacoes_juridica])\n\n respond_to do |format|\n if @situacoes_juridica.save\n format.html { redirect_to(@situacoes_juridica, :notice => 'Situação jurídica cadastrada com sucesso.') }\n format.xml { render :xml => @situacoes_juridica, :status => :created, :location => @situacoes_juridica }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @situacoes_juridica.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @inscripcione = Inscripcione.new(params[:inscripcione])\n\n respond_to do |format|\n if @inscripcione.save\n format.html { redirect_to(@inscripcione, :notice => 'Inscripcione was successfully created.') }\n format.xml { render :xml => @inscripcione, :status => :created, :location => @inscripcione }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @inscripcione.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @impuesto = Impuesto.new(params[:impuesto])\n\n respond_to do |format|\n if @impuesto.save\n format.html { redirect_to @impuesto, :notice => 'Impuesto was successfully created.' }\n format.json { render json: @impuesto, status: :created, location: @impuesto }\n else\n format.html { render :action => \"new\" }\n format.json { render json: @impuesto.errors }\n end\n end\n end",
"def create\n @inventario_cosa = InventarioCosa.new(inventario_cosa_params)\n\n respond_to do |format|\n if @inventario_cosa.save\n format.html { redirect_to @inventario_cosa, notice: 'Inventario cosa was successfully created.' }\n format.json { render :show, status: :created, location: @inventario_cosa }\n else\n format.html { render :new }\n format.json { render json: @inventario_cosa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @inspiration = Inspiration.new(params[:inspiration])\n \n respond_to do |format|\n if @inspiration.save\n format.html { redirect_to @inspiration, notice: 'Inspiration was successfully created.' }\n format.json { render json: @inspiration, status: :created, location: @inspiration }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inspiration.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @iine = Iine.new(iine_params)\n\n respond_to do |format|\n if @iine.save\n format.html { redirect_to @iine, notice: 'Iine was successfully created.' }\n format.json { render :show, status: :created, location: @iine }\n else\n format.html { render :new }\n format.json { render json: @iine.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @servicio = Servicio.new(params[:servicio])\n\n respond_to do |format|\n if @servicio.save\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully created.' }\n format.json { render :json => @servicio, :status => :created, :location => @servicio }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @interno_unidad = InternoUnidad.new(interno_unidad_params)\n\n respond_to do |format|\n if @interno_unidad.save\n format.html { redirect_to @interno_unidad, notice: 'Interno unidad was successfully created.' }\n format.json { render :show, status: :created, location: @interno_unidad }\n else\n format.html { render :new }\n format.json { render json: @interno_unidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @valores = Catalogo.all\n @institucion = Institucion.where(:id => institucioncatalogo_params['institucion_id']).first\n @institucioncatalogo = Institucioncatalogo.new(institucioncatalogo_params)\n\n respond_to do |format|\n if @institucioncatalogo.save\n format.html { redirect_to institucion_institucioncatalogos_url(@institucion), notice: 'El registro se ha creado exitosamente.' }\n format.json { render :show, status: :created, location: @institucioncatalogo }\n else\n format.html { render :new }\n format.json { render json: @institucioncatalogo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @recipe = current_user.recipes.new(recipe_params)\n\n respond_to do |format|\n if @recipe.save\n if params[:lista].present?\n params[:lista].each do |(c,ingrediente)|\n Ingredient.create(name: ingrediente, recipe_id:@recipe.id) if ingrediente != \"\"\n end\n end\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render :show, status: :created, location: @recipe }\n format.js {flash.now[:notice] = 'La receta se ha creado de forma exitosa.'} #ajax\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n format.js {flash.now[:alert] = 'Error al crear la receta.'} #ajax\n end\n end\n end",
"def create\n @ulica = Ulica.new(ulica_params)\n\n respond_to do |format|\n if @ulica.save\n format.html { redirect_to @ulica, notice: 'Ulica was successfully created.' }\n format.json { render :show, status: :created, location: @ulica }\n else\n format.html { render :new }\n format.json { render json: @ulica.errors, status: :unprocessable_entity }\n end\n end\n end",
"def instituicao_de_ensino_params\n params.require(:instituicao_de_ensino).permit(:nome, :cnpj, :tipo)\n end",
"def create\n @tecnico = Tecnico.new(params[:tecnico])\n @tecnico.user = current_user\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, notice: 'Técnico foi criado com sucesso.' }\n format.json { render json: @tecnico, status: :created, location: @tecnico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @inspiration = Inspiration.new(inspiration_params)\n\n respond_to do |format|\n if @inspiration.save\n format.html { redirect_to @inspiration, notice: 'Inspiration was successfully created.' }\n format.json { render action: 'show', status: :created, location: @inspiration }\n else\n format.html { render action: 'new' }\n format.json { render json: @inspiration.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sotrudniki = Sotrudniki.new(params[:sotrudniki])\n\n respond_to do |format|\n if @sotrudniki.save\n format.html { redirect_to @sotrudniki, notice: 'Sotrudniki was successfully created.' }\n format.json { render json: @sotrudniki, status: :created, location: @sotrudniki }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sotrudniki.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @nitrou = Nitrou.new(nitrou_params)\n\n respond_to do |format|\n if @nitrou.save\n format.html { redirect_to @nitrou, notice: 'Nitrou was successfully created.' }\n format.json { render :show, status: :created, location: @nitrou }\n else\n format.html { render :new }\n format.json { render json: @nitrou.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @asignatura = Asignatura.new(asignatura_params)\n\n respond_to do |format|\n if @asignatura.save\n format.json { render json: \"Asignatura Creada\", status: :created, location: @asignatura }\n else\n format.json { render json: @asignatura.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @indicacao = Indicacao.new(params[:indicacao])\n\n respond_to do |format|\n if @indicacao.save\n format.html { redirect_to @indicacao, notice: 'A Indicação de Condutor foi criada com sucesso.' }\n format.json { render json: @indicacao, status: :created, location: @indicacao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @indicacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @asignatura = Asignatura.new(params[:asignatura])\n\n respond_to do |format|\n if @asignatura.save\n format.html { redirect_to @asignatura, notice: 'Asignatura was successfully created.' }\n format.json { render json: @asignatura, status: :created, location: @asignatura }\n else\n format.html { render action: \"new\" }\n format.json { render json: @asignatura.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @iscriviti = Iscriviti.new(iscriviti_params)\n\n respond_to do |format|\n if @iscriviti.save\n format.html { redirect_to @iscriviti, notice: \"Iscriviti was successfully created.\" }\n format.json { render :show, status: :created, location: @iscriviti }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @iscriviti.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @anuncio = Anuncio.new(anuncio_params)\n\n if @anuncio.save\n render :show, status: :created, location: @anuncio\n else\n render json: @anuncio.errors, status: :unprocessable_entity\n end\n end",
"def create\n @veiculo = Veiculo.new(params[:veiculo])\n\n respond_to do |format|\n if @veiculo.save\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully created.' }\n format.json { render :json => @veiculo, :status => :created, :location => @veiculo }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post_spoonacular\n # %encode ingredients to url\n encoded_ingr = URI.escape(@translated_recipe[:ingredients_list])\n # post call block :\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/parseIngredients?includeNutrition=true\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = \"application/x-www-form-urlencoded\"\n request[\"x-rapidapi-key\"] = ENV[\"X_RAPIDAPI_KEY\"]\n request[\"x-rapidapi-host\"] = \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\"\n # body of the call with ingredients and servings\n request.body = \"ingredientList=#{encoded_ingr}&#{@recipe_hash[:servings]}\"\n # response\n response = http.request(request)\n end",
"def create\n @etnia = Etnia.new(params[:etnia])\n\n respond_to do |format|\n if @etnia.save\n format.html { redirect_to @etnia, notice: 'Etnia was successfully created.' }\n format.json { render json: @etnia, status: :created, location: @etnia }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etnia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sinh_vien = SinhVien.new(params[:sinh_vien])\n\n respond_to do |format|\n if @sinh_vien.save \n format.json { render json: @sinh_vien, status: :created, location: @sinh_vien }\n else \n format.json { render json: @sinh_vien.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @incident = Incident.new(incident_params)\n @incident.status = \"abierto\"\n @incident.user ||= current_user\n\n respond_to do |format|\n if @incident.save\n format.html { redirect_to @incident, notice: 'Incidencia registrada' }\n format.json { render :show, status: :created, location: @incident }\n else\n format.html { render :new }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @itineraire = Itineraire.new(params[:itineraire])\n\n respond_to do |format|\n if @itineraire.save\n format.html { redirect_to @itineraire, :notice => 'L\\'itinéraire a bien été créé' }\n format.json { render :json => @itineraire, :status => :created, :location => @itineraire }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @itineraire.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @institucional = Institucional.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institucional }\n end\n end",
"def criar_sobrevivente\n @suvivor = Sobrevivente.create(\n name: params[:name], genero: params[:genero], idade: params[:idade],\n lat: params[:lat], lon: params[:lon],\n agua: params[:agua], comida: params[:comida], medicamento: params[:medicamento],\n municao: params[:municao]\n )\n render json: @suvivor\n end",
"def create\n @imposto = Imposto.new(imposto_params)\n\n respond_to do |format|\n if @imposto.save\n format.html { redirect_to @imposto, notice: 'Imposto criado com sucesso.' }\n format.json { render :show, status: :created, location: @imposto }\n else\n format.html { render :new }\n format.json { render json: @imposto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @utensil = Utensil.new(utensil_params)\n\n respond_to do |format|\n if @utensil.save\n format.html { redirect_to @utensil, notice: 'Utensil was successfully created.' }\n format.json { render :show, status: :created, location: @utensil }\n else\n format.html { render :new }\n format.json { render json: @utensil.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @aviso = Aviso.new(aviso_params)\n \n @aviso.dataDeInsercao = Time.now\n @aviso.inseridoPor = \"Gustavo Soares\" #adicionar gem devise\n\n @aviso.atualizadoPor = \"Gustavo Soares\" #adicionar gem devise\n @aviso.dataDeAtualizacao = Time.now\n\n respond_to do |format|\n if @aviso.save\n format.html { redirect_to @aviso, notice: 'Aviso was successfully created.' }\n format.json { render :show, status: :created, location: @aviso }\n else\n format.html { render :new }\n format.json { render json: @aviso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @nippou = Nippou.new(nippou_params)\n\n respond_to do |format|\n if @nippou.save\n format.html { redirect_to @nippou, notice: 'Nippou was successfully created.' }\n format.json { render action: 'show', status: :created, location: @nippou }\n else\n format.html { render action: 'new' }\n format.json { render json: @nippou.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @instancia_item = InstanciaItem.new(params[:instancia_item])\n\n respond_to do |format|\n if @instancia_item.save\n format.html { redirect_to(@instancia_item, :notice => 'Instancia item was successfully created.') }\n format.xml { render :xml => @instancia_item, :status => :created, :location => @instancia_item }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @instancia_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @icerik = Icerik.new(icerik_params)\n\n respond_to do |format|\n if @icerik.save\n format.html { redirect_to @icerik, notice: 'Icerik was successfully created.' }\n format.json { render :show, status: :created, location: @icerik }\n else\n format.html { render :new }\n format.json { render json: @icerik.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @noticium = Noticium.new(noticium_params)\n\n respond_to do |format|\n if @noticium.save\n format.html { redirect_to @noticium, notice: 'Noticium was successfully created.' }\n format.json { render :show, status: :created, location: @noticium }\n else\n format.html { render :new }\n format.json { render json: @noticium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def instancium_params\n params.require(:instancium).permit(:name, :votos, :disponible, :descripcion, :winner, :otherx)\n end",
"def create\n @estatuto = Estatuto.new(params[:estatuto])\n\n respond_to do |format|\n if @estatuto.save\n format.html { redirect_to @estatuto, notice: 'Estatuto was successfully created.' }\n format.json { render json: @estatuto, status: :created, location: @estatuto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @estatuto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cio = Cio.new(cio_params)\n\n respond_to do |format|\n if @cio.save\n format.html { redirect_to @cio, notice: 'Cio cadastrado com sucesso.' }\n format.json { render :show, status: :created, location: @cio }\n else\n format.html { render :new }\n format.json { render json: @cio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @coin_ico = CoinIco.new(coin_ico_params)\n\n respond_to do |format|\n if @coin_ico.save\n format.html { redirect_to coin_icos_path, notice: 'Coin ico was successfully created.' }\n format.json { render :show, status: :created, location: @coin_ico }\n else\n format.html { render :new }\n format.json { render json: @coin_ico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n respond_to do |format|\n format.json { render :json => { :code => \"201\", :description => \"Created incidents\"} }\n end\n end",
"def create\n @iniciador = Iniciador.new(iniciador_params)\n\n respond_to do |format|\n if @iniciador.save\n format.html { redirect_to @iniciador, notice: 'Iniciador was successfully created.' }\n format.json { render :show, status: :created, location: @iniciador }\n format.js {render(template:'iniciadores/asignar')}\n else\n format.html { render :new }\n format.json { render json: @iniciador.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @platillo = Platillo.new(platillo_params)\n @ingredients = platillo_params[:ingredients_attributes]\n debug @ingredients\n\n @platilloIngrendiente = Ingredient.new(@ingredients)\n @platilloIngrendiente.save\n respond_to do |format|\n if @platillo.save\n format.html { redirect_to @platillo, notice: 'Platillo creado exitosamente' }\n format.json { render :show, status: :created, location: @platillo }\n else\n format.html { render :new }\n format.json { render json: @platillo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @asiento_de_servicio = AsientoDeServicio.new(asiento_de_servicio_params)\n\n respond_to do |format|\n if @asiento_de_servicio.save\n format.html { redirect_to @asiento_de_servicio, notice: 'Asiento de servicio was successfully created.' }\n format.json { render :show, status: :created, location: @asiento_de_servicio }\n else\n format.html { render :new }\n format.json { render json: @asiento_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @itinerario_realizado = ItinerarioRealizado.new(itinerario_realizado_params)\n\n respond_to do |format|\n if @itinerario_realizado.save\n format.html { redirect_to @itinerario_realizado, notice: 'Itinerario realizado was successfully created.' }\n format.json { render action: 'show', status: :created, location: @itinerario_realizado }\n else\n format.html { render action: 'new' }\n format.json { render json: @itinerario_realizado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ejercicio = Ejercicio.new(params[:ejercicio])\n\n respond_to do |format|\n if @ejercicio.save\n format.html { redirect_to @ejercicio, notice: 'Ejercicio was successfully created.' }\n format.json { render json: @ejercicio, status: :created, location: @ejercicio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ejercicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ativo = Ativo.new(ativo_params)\n\n respond_to do |format|\n if @ativo.save\n format.html { redirect_to @ativo, notice: \"#{type} was successfully created.\" }\n format.json { render :show, status: :created, location: @ativo }\n else\n format.html { render :new }\n format.json { render json: @ativo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @indivisual = Indivisual.new(indivisual_params)\n\n respond_to do |format|\n if @indivisual.save\n format.html { redirect_to @indivisual, notice: 'Indivisual was successfully created.' }\n format.json { render :show, status: :created, location: @indivisual }\n else\n format.html { render :new }\n format.json { render json: @indivisual.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n respond_to do |format|\n if @especialidad.save\n format.html { redirect_to @especialidad, notice: 'Servicio creado exitosamente.' }\n format.json { render :show, status: :created, location: @especialidad }\n else\n format.html { render :new }\n format.json { render json: @especialidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def acessar_instituicao_page\n cadastro_btn.click\n instituicao_btn.click\n incluir_btn.click\n end"
] | [
"0.70578986",
"0.68975914",
"0.6834867",
"0.6772598",
"0.67714244",
"0.6739272",
"0.661475",
"0.6461626",
"0.64222103",
"0.641717",
"0.6408052",
"0.640658",
"0.64003813",
"0.63718206",
"0.6368992",
"0.6346715",
"0.6300704",
"0.6297224",
"0.6296384",
"0.62830585",
"0.62819237",
"0.62807095",
"0.6275996",
"0.6263828",
"0.62380576",
"0.622548",
"0.622294",
"0.6213001",
"0.62123185",
"0.61935514",
"0.6183811",
"0.6172096",
"0.61709404",
"0.61674505",
"0.6162787",
"0.6160502",
"0.6139119",
"0.6137535",
"0.61358327",
"0.612124",
"0.61067575",
"0.6085931",
"0.60844445",
"0.60515887",
"0.6008476",
"0.6005459",
"0.6002885",
"0.59859765",
"0.5983043",
"0.59821117",
"0.59515214",
"0.59509665",
"0.59469146",
"0.5946492",
"0.5938692",
"0.59348094",
"0.59308946",
"0.59244335",
"0.5909971",
"0.59034985",
"0.58983624",
"0.5895268",
"0.5894028",
"0.58734244",
"0.58679265",
"0.5857864",
"0.58426434",
"0.5839461",
"0.5831658",
"0.5830385",
"0.58284867",
"0.58257157",
"0.58237714",
"0.5823381",
"0.5823377",
"0.5820074",
"0.5817237",
"0.58135426",
"0.5802699",
"0.5801398",
"0.5799365",
"0.57992136",
"0.57940805",
"0.579124",
"0.5780723",
"0.5777205",
"0.57724273",
"0.5765167",
"0.57646424",
"0.5757995",
"0.57528615",
"0.5751588",
"0.5749326",
"0.5746462",
"0.5745929",
"0.57440317",
"0.57410145",
"0.57404435",
"0.57360584",
"0.5733736"
] | 0.7440674 | 0 |
PUT /instituicoes/1 PUT /instituicoes/1.json | def update
@instituicao = Instituicao.find(params[:id])
respond_to do |format|
if @instituicao.update_attributes(params[:instituicao])
format.html { redirect_to @instituicao, notice: 'Instituicao was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @instituicao.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @instituicao = Instituicao.find(params[:id])\n\n respond_to do |format|\n if @instituicao.update_attributes(params[:instituicao])\n format.html { redirect_to(@instituicao, :notice => 'Instituicao was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instituicao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @instituto.update(instituto_params)\n format.html { redirect_to @instituto, notice: 'O instituto foi atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @instituto }\n else\n format.html { render :edit }\n format.json { render json: @instituto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @institucion.update(institucion_params)\n format.html { redirect_to @institucion, notice: 'Empresa se ha actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @institucion }\n else\n format.html { render :edit }\n format.json { render json: @institucion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end",
"def update\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n if @sitio.update_attributes(params[:sitio])\n format.html { redirect_to @sitio, notice: 'Sitio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sitio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inventario.update(inventario_params)\n format.html { redirect_to @inventario, notice: 'Inventario was successfully updated.' }\n format.json { render :show, status: :ok, location: @inventario }\n else\n format.html { render :edit }\n format.json { render json: @inventario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inventario.update(inventario_params)\n format.html { redirect_to @inventario, notice: 'Inventario was successfully updated.' }\n format.json { render :show, status: :ok, location: @inventario }\n else\n format.html { render :edit }\n format.json { render json: @inventario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @institucional = Institucional.find(params[:id])\n\n respond_to do |format|\n if @institucional.update_attributes(params[:institucional])\n format.html { redirect_to @institucional, notice: 'Institucional was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @institucional.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @instituicao_curso.update(instituicao_curso_params)\n format.html { redirect_to @instituicao_curso, notice: 'Instituicao curso was successfully updated.' }\n format.json { render :show, status: :ok, location: @instituicao_curso }\n else\n format.html { render :edit }\n format.json { render json: @instituicao_curso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_instituto\n @instituto = Instituto.find(params[:id])\n end",
"def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @instituto.update_attributes(params[:instituto])\n format.html { redirect_to(@instituto, :notice => 'Instituto fue modificado exitosamente.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instituto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @institucion = Institucion.find(params[:id])\n\n respond_to do |format|\n if @institucion.update_attributes(params[:institucion])\n flash[:notice] = 'Institucion se ha actualizado con exito.'\n format.html { redirect_to(admin_institucions_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @institucion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @incucai = Incucai.find(params[:id])\n\n respond_to do |format|\n if @incucai.update_attributes(params[:incucai])\n format.html { redirect_to @incucai, notice: 'Incucai was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @incucai.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_inventario\n @inventario = Inventario.find(params[:id])\n end",
"def set_inventario\n @inventario = Inventario.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @inventario_cosa.update(inventario_cosa_params)\n format.html { redirect_to @inventario_cosa, notice: 'Inventario cosa was successfully updated.' }\n format.json { render :show, status: :ok, location: @inventario_cosa }\n else\n format.html { render :edit }\n format.json { render json: @inventario_cosa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n if @sitio_entrega.update_attributes(params[:sitio_entrega])\n format.html { redirect_to @sitio_entrega, notice: 'Sitio entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sitio_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @infraccion.update(infraccion_params)\n format.html { redirect_to @infraccion, notice: 'Infraccion was successfully updated.' }\n format.json { render :show, status: :ok, location: @infraccion }\n else\n format.html { render :edit }\n format.json { render json: @infraccion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inicio.update(inicio_params)\n format.html { redirect_to @inicio, notice: 'Inicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @inicio }\n else\n format.html { render :edit }\n format.json { render json: @inicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @inventario = Inventario.find(params[:id])\n @foto = @inventario.foto\n \n @service = InventarioService.new(@inventario, @foto)\n respond_to do |format|\n\n if @inventario.update_attributes(params[:inventario],params[:foto_file])\n format.html { redirect_to(@inventario, :notice => 'Inventario was successfully updated.') }\n format.xml { head :ok }\n else\n\t @foto = @service.foto\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inventario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n if @veiculo.update_attributes(params[:veiculo])\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inscricao.update(inscricao_params)\n format.html { redirect_to @inscricao, notice: 'Inscricao was successfully updated.' }\n format.json { render :show, status: :ok, location: @inscricao }\n else\n format.html { render :edit }\n format.json { render json: @inscricao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n if @tecnico.update_attributes(params[:tecnico])\n format.html { redirect_to @tecnico, notice: 'Tecnico atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n if @sitio.update_attributes(params[:sitio])\n format.html { redirect_to(@sitio, :notice => 'Sitio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sitio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @valores = Catalogo.all\n @institucion = Institucion.where(:id => institucioncatalogo_params['institucion_id']).first\n respond_to do |format|\n if @institucioncatalogo.update(institucioncatalogo_params)\n format.html { redirect_to institucion_institucioncatalogos_url(@institucion), notice: 'El registro se ha actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @institucioncatalogo }\n else\n format.html { render :edit }\n format.json { render json: @institucioncatalogo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inscricao.update(inscricao_params)\n format.html { redirect_to @inscricao, notice: \"Inscricao was successfully updated.\" }\n format.json { render :show, status: :ok, location: @inscricao }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @inscricao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @topico.update(topico_params)\n format.html { redirect_to set_path, notice: 'Tópico atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @topico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @entrada_inventario = EntradaInventario.find(params[:id])\n\n respond_to do |format|\n if @entrada_inventario.update_attributes(params[:entrada_inventario])\n format.html { redirect_to @entrada_inventario, notice: 'Entrada inventario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @entrada_inventario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n if @tecnico.update_attributes(params[:tecnico])\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @indicativo = Indicativo.find(params[:id])\n\n respond_to do |format|\n if @indicativo.update_attributes(params[:indicativo])\n format.html { redirect_to @indicativo, notice: 'Indicativo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @indicativo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @instance_eni.update(instance_eni_params)\n format.html { redirect_to @instance_eni, notice: 'Instance eni was successfully updated.' }\n format.json { render :show, status: :ok, location: @instance_eni }\n else\n format.html { render :edit }\n format.json { render json: @instance_eni.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @inscripcione = Inscripcione.find(params[:id])\n\n respond_to do |format|\n if @inscripcione.update_attributes(params[:inscripcione])\n format.html { redirect_to(@inscripcione, :notice => 'Inscripcione was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inscripcione.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @iniciativa = Iniciativa.find(params[:id])\n\n respond_to do |format|\n if @iniciativa.update_attributes(params[:iniciativa])\n format.html { redirect_to @iniciativa, notice: 'Iniciativa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @iniciativa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @nossos_servico = NossosServico.find(params[:id])\n\n respond_to do |format|\n if @nossos_servico.update_attributes(params[:nossos_servico])\n format.html { redirect_to(@nossos_servico, :notice => 'Nossos servico was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nossos_servico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @inscrito = Inscrito.find(params[:id])\n\n respond_to do |format|\n if @inscrito.update_attributes(params[:inscrito])\n format.html { redirect_to @inscrito, notice: 'Inscrito was successfully updated. #{undo_link}' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inscrito.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @asistencia = Asistencia.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @asistencia.update_attributes(params[:asistencia])\r\n format.html { redirect_to @asistencia, notice: 'Asistencia was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @asistencia.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @instancium.update(instancium_params)\n format.html { redirect_to @instancium, notice: 'Instancium was successfully updated.' }\n format.json { render :show, status: :ok, location: @instancium }\n else\n format.html { render :edit }\n format.json { render json: @instancium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inst.update(inst_params)\n format.html { redirect_to @inst, notice: 'Inst was successfully updated.' }\n format.json { render :show, status: :ok, location: @inst }\n else\n format.html { render :edit }\n format.json { render json: @inst.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n self.validar_admin\n respond_to do |format|\n if @inventario.update(inventario_params)\n format.html { redirect_to @inventario, notice: 'Inventario was successfully updated.' }\n format.json { render :show, status: :ok, location: @inventario }\n else\n format.html { render :edit }\n format.json { render json: @inventario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to servicos_url, notice: 'Serviço atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tecnica_de_impresion.update(tecnica_de_impresion_params)\n format.html { redirect_to @tecnica_de_impresion, notice: 'Tecnica de impresion was successfully updated.' }\n format.json { render :show, status: :ok, location: @tecnica_de_impresion }\n else\n format.html { render :edit }\n format.json { render json: @tecnica_de_impresion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sinh_vien = SinhVien.find(params[:id])\n\n respond_to do |format|\n if @sinh_vien.update_attributes(params[:sinh_vien]) \n format.json { head :no_content }\n else \n format.json { render json: @sinh_vien.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @situacoes_juridica = SituacoesJuridica.find(params[:id])\n\n respond_to do |format|\n if @situacoes_juridica.update_attributes(params[:situacoes_juridica])\n format.html { redirect_to(@situacoes_juridica, :notice => 'Situação jurídica atualizada com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @situacoes_juridica.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @instituicao_responsavel.update(instituicao_responsavel_params)\n format.html { redirect_to @instituicao_responsavel, notice: 'Instituicao responsavel was successfully updated.' }\n format.json { render :show, status: :ok, location: @instituicao_responsavel }\n else\n format.html { render :edit }\n format.json { render json: @instituicao_responsavel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @iscrizione.update(iscrizione_params)\n format.html { redirect_to @iscrizione, notice: \"Iscrizione was successfully updated.\" }\n format.json { render :show, status: :ok, location: @iscrizione }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @iscrizione.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ginasio = Ginasio.find(params[:id])\n\n respond_to do |format|\n if @ginasio.update_attributes(params[:ginasio])\n format.html { redirect_to @ginasio, :flash => { :success => 'Dados do ginasio alterados com successo!' } }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @ginasio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_institucion\n @institucion = Institucion.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @imposto.update_attributes(imposto_params)\n format.html { redirect_to @imposto, notice: 'Imposto atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @imposto }\n else\n format.html { render :edit }\n format.json { render json: @imposto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @oiseau.update(oiseau_params)\n format.html { redirect_to @oiseau, notice: 'Oiseau was successfully updated.' }\n format.json { render :show, status: :ok, location: @oiseau }\n else\n format.html { render :edit }\n format.json { render json: @oiseau.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @instituicao = Instituicao.new(params[:instituicao])\n\n respond_to do |format|\n if @instituicao.save\n format.html { redirect_to @instituicao, notice: 'Instituicao was successfully created.' }\n format.json { render json: @instituicao, status: :created, location: @instituicao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instituicao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @socio = Socio.find(params[:id])\n\n respond_to do |format|\n if @socio.update_attributes(params[:socio])\n format.html { redirect_to @socio, :notice => 'Socio atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @socio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tecnico = Tecnico.find(params[:id])\n @tecnico.user = current_user\n\n respond_to do |format|\n if @tecnico.update_attributes(params[:tecnico])\n format.html { redirect_to @tecnico, notice: 'Técnico foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @interessado.update(interessado_params)\n \n\n format.html { redirect_to @interessado, notice: 'Interessado was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @interessado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @instum.update(instum_params)\n format.html { redirect_to @instum, notice: '投稿が更新されました' }\n format.json { render :show, status: :ok, location: @instum }\n else\n format.html { render :edit }\n format.json { render json: @instum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @impuesto = Impuesto.find(params[:id])\n\n respond_to do |format|\n if @impuesto.update_attributes(params[:impuesto])\n format.html { redirect_to @impuesto, :notice => 'Impuesto was successfully updated.' }\n format.json { render json: @impuesto }\n else\n format.html { render :action => \"edit\" }\n format.json { render json: @impuesto.errors }\n end\n end\n end",
"def update\n respond_to do |format|\n if @iine.update(iine_params)\n format.html { redirect_to @iine, notice: 'Iine was successfully updated.' }\n format.json { render :show, status: :ok, location: @iine }\n else\n format.html { render :edit }\n format.json { render json: @iine.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n if @asiento.update_attributes(params[:asiento])\n format.html { redirect_to @asiento, :notice => 'El apunte fue cambiado.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n if @solicitud_servicio.update_attributes(params[:solicitud_servicio])\n format.html { redirect_to @solicitud_servicio, notice: 'Solicitud servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @solicitud_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @estatuto = Estatuto.find(params[:id])\n\n respond_to do |format|\n if @estatuto.update_attributes(params[:estatuto])\n format.html { redirect_to @estatuto, notice: 'Estatuto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estatuto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inscripcion.update(inscripcion_params)\n format.html { redirect_to @inscripcion, notice: 'Inscripcion was successfully updated.' }\n format.json { render :show, status: :ok, location: @inscripcion }\n else\n format.html { render :edit }\n format.json { render json: @inscripcion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @inspiration = Inspiration.find(params[:id])\n \n respond_to do |format|\n if @inspiration.update_attributes(params[:inspiration])\n format.html { redirect_to @inspiration, notice: 'Inspiration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inspiration.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @control_asistencia = ControlAsistencia.find(params[:id])\n\n respond_to do |format|\n if @control_asistencia.update_attributes(params[:control_asistencia])\n format.html { redirect_to @control_asistencia, notice: 'Control asistencia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @control_asistencia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @oficio.update(oficio_params)\n format.html { redirect_to oficios_url, notice: 'Oficio actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: oficios_url }\n else\n format.html { render :edit }\n format.json { render json: @oficio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @nota_tecnica.update(nota_tecnica_params)\n format.html { redirect_to @nota_tecnica, notice: 'Nota tecnica was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @nota_tecnica.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n respond_to do |format|\n if @insumo.update(insumo_params)\n format.html { redirect_to insumos_url , notice: 'Insumo was successfully updated.' }\n format.json { render :show, status: :ok, location: @insumo }\n else\n format.html { render :edit } \n format.json { render json: @insumo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @indicacao = Indicacao.find(params[:id])\n\n respond_to do |format|\n if @indicacao.update_attributes(params[:indicacao])\n format.html { redirect_to @indicacao, notice: 'A Indicação do Condutor foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @indicacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ejercicio = Ejercicio.find(params[:id])\n\n respond_to do |format|\n if @ejercicio.update_attributes(params[:ejercicio])\n format.html { redirect_to @ejercicio, notice: 'Ejercicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ejercicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @instancia_item = InstanciaItem.find(params[:id])\n\n respond_to do |format|\n if @instancia_item.update_attributes(params[:instancia_item])\n format.html { redirect_to(@instancia_item, :notice => 'Instancia item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instancia_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @iglesia.update(iglesia_params)\n format.html { redirect_to @iglesia, notice: 'La iglesia #{@iglesia.nombre} ha sido actualizada.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @iglesia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @estagio = Estagio.find(params[:id])\n\n respond_to do |format|\n if @estagio.update_attributes(params[:estagio])\n flash[:notice] = 'Estagio was successfully updated.'\n format.html { redirect_to(@estagio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t@clinica = Clinica.find(params[:id])\n\t\t id = @clinica.id\n\t\t@usuario = Usuario.find_by_datos_id(id, :conditions => \"datos_type = 'Clinica'\")\n\n # @clinica.sitioWeb = \"http://#{@clinica.sitioWeb}\"\n\n respond_to do |format|\n if @clinica.valid? && @usuario.valid?\n\t\t\t\t@clinica.update_attributes(params[:clinica])\n\t\t\t\t@usuario.update_attributes(params[:usuario])\n flash[:notice] = 'La clinica fue actualizada satisfactoriamente'\n format.html { redirect_to :back }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @clinica.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @ativo_outro = AtivoOutro.find(params[:id])\n\n respond_to do |format|\n if @ativo_outro.update_attributes(params[:ativo_outro])\n format.html { redirect_to @ativo_outro, notice: 'Ativo foi salvo com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ativo_outro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @instagrampic.update(instagrampic_params)\n format.html { redirect_to @instagrampic, notice: 'Instagrampic was successfully updated.' }\n format.json { render :show, status: :ok, location: @instagrampic }\n else\n format.html { render :edit }\n format.json { render json: @instagrampic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @anuncio = Anuncio.find params[:id]\n if @anuncio.update(anuncio_params)\n render :show, status: :ok, location: @anuncio\n else\n render json: @anuncio.errors, status: :unprocessable_entity\n end\n end",
"def update\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n if @asignatura.update_attributes(params[:asignatura])\n format.html { redirect_to @asignatura, notice: 'Asignatura was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asignatura.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n h = {\n cuerpo: noticium_params[:cuerpo],\n bajada: noticium_params[:bajada],\n titular: noticium_params[:titular]\n }\n if @noticium.update(h)\n format.html { redirect_to @noticium, notice: 'Noticium was successfully updated.' }\n format.json { render :show, status: :ok, location: @noticium }\n else\n format.html { render :edit }\n format.json { render json: @noticium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @registro_servicio.update(registro_servicio_params)\n format.html { redirect_to @registro_servicio, notice: 'Servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro_servicio }\n else\n format.html { render :edit }\n format.json { render json: @registro_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_de_imposto.update(tipo_de_imposto_params)\n format.html { redirect_to @empresa, notice: 'Tipo de imposto actualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @tipo_de_imposto }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_imposto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_de_servicio.update(tipo_de_servicio_params)\n format.html { redirect_to @tipo_de_servicio, notice: 'Tipo de servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_de_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_inventario_cosa\n @inventario_cosa = InventarioCosa.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @clientes_servico.update(clientes_servico_params)\n format.html { redirect_to @clientes_servico, notice: 'Clientes servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @clientes_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sindicato.update(sindicato_params)\n format.html { redirect_to @sindicato, notice: 'Sindicato fue actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @sindicato }\n else\n format.html { render :edit }\n format.json { render json: @sindicato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @interesado.update(interesado_params)\n format.html { redirect_to @interesado, notice: 'Interesado was successfully updated.' }\n format.json { render :show, status: :ok, location: @interesado }\n else\n format.html { render :edit }\n format.json { render json: @interesado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @apoio.update(apoio_params)\n format.html { redirect_to @apoio, notice: 'Apoio was successfully updated.' }\n format.json { render :show, status: :ok, location: @apoio }\n else\n format.html { render :edit }\n format.json { render json: @apoio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n @aviso.atualizadoPor = \"Gustavo Soares\" #adicionar gem devise\n @aviso.dataDeAtualizacao = Time.now\n\n respond_to do |format|\n if @aviso.update(aviso_params)\n format.html { redirect_to @aviso, notice: 'Aviso was successfully updated.' }\n format.json { render :show, status: :ok, location: @aviso }\n else\n format.html { render :edit }\n format.json { render json: @aviso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @coisa = Coisa.find(params[:id])\n\n respond_to do |format|\n if @coisa.update_attributes(params[:coisa])\n format.html { redirect_to @coisa, :notice => 'Coisa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @coisa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_negocio = TipoNegocio.find(params[:id])\n\n respond_to do |format|\n if @tipo_negocio.update_attributes(params[:tipo_negocio])\n format.html { redirect_to @tipo_negocio, notice: 'Tipo negocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_negocio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @seihinn.update(seihinn_params)\n format.html { redirect_to @seihinn, notice: \"Seihinn was successfully updated.\" }\n format.json { render :show, status: :ok, location: @seihinn }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @seihinn.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_servico\n @servico = Servico.find(params[:id])\n end",
"def set_servico\n @servico = Servico.find(params[:id])\n end",
"def set_instancium\n @instancium = Instancium.find(params[:id])\n end",
"def update\n @usuario = Usuario.find(params[:id])\n #@sitio=@usuario.sitio\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to(@usuario, :notice => t('exitom')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @asiento_de_servicio.update(asiento_de_servicio_params)\n format.html { redirect_to @asiento_de_servicio, notice: 'Asiento de servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @asiento_de_servicio }\n else\n format.html { render :edit }\n format.json { render json: @asiento_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def dame_institucion\n i = Metamares::Institucion.new\n i.nombre_institucion = params[:nombre_institucion]\n\n respond_to do |format|\n format.json { render json: i.busca_institucion.map{ |i| { id: i.id, value: i.nombre_institucion } } }\n format.html { @institucion = i }\n end\n end",
"def put(*args)\n request :put, *args\n end",
"def update\n @selecao = Selecao.find(params[:id])\n\n respond_to do |format|\n if @selecao.update_attributes(params[:selecao])\n format.html { redirect_to @selecao, notice: 'Selecao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @selecao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\n end"
] | [
"0.6810022",
"0.6726203",
"0.6404884",
"0.63641167",
"0.636172",
"0.6285308",
"0.6285308",
"0.6281354",
"0.62721556",
"0.62643033",
"0.6262745",
"0.625416",
"0.6218062",
"0.62179774",
"0.6217759",
"0.6217759",
"0.6208347",
"0.6200834",
"0.6161696",
"0.6144672",
"0.6143541",
"0.61388874",
"0.6121636",
"0.61123884",
"0.6101549",
"0.609833",
"0.60949814",
"0.6081268",
"0.60787684",
"0.6076496",
"0.6060888",
"0.6060582",
"0.6057268",
"0.6040019",
"0.6033071",
"0.6030344",
"0.6028727",
"0.60255325",
"0.60249406",
"0.6005043",
"0.6002269",
"0.59911823",
"0.59885347",
"0.5974301",
"0.59730524",
"0.5969074",
"0.59595865",
"0.5940015",
"0.59369355",
"0.5926917",
"0.5925729",
"0.5907708",
"0.59075564",
"0.58933735",
"0.58873105",
"0.5880546",
"0.58795774",
"0.5879217",
"0.58740056",
"0.5873825",
"0.5871432",
"0.58659875",
"0.5841767",
"0.58387756",
"0.5832731",
"0.5827453",
"0.5824628",
"0.58168477",
"0.5806133",
"0.58053946",
"0.5804764",
"0.58014786",
"0.5799691",
"0.57829994",
"0.57773715",
"0.5775756",
"0.5775069",
"0.57731587",
"0.5769032",
"0.57570446",
"0.5755153",
"0.5750606",
"0.5750118",
"0.57495975",
"0.57448614",
"0.57437676",
"0.57423794",
"0.5741065",
"0.57380366",
"0.57333535",
"0.5727365",
"0.57270956",
"0.57270956",
"0.57265157",
"0.5722361",
"0.57178015",
"0.5716252",
"0.571523",
"0.57148033",
"0.571088"
] | 0.71600014 | 0 |
DELETE /instituicoes/1 DELETE /instituicoes/1.json | def destroy
@instituicao = Instituicao.find(params[:id])
@instituicao.destroy
respond_to do |format|
format.html { redirect_to instituicoes_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @instancium.destroy\n respond_to do |format|\n format.html { redirect_to instancia_url, notice: 'Instancium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @instituto.destroy\n respond_to do |format|\n format.html { redirect_to institutos_url, notice: 'O instituto foi deletado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @instituicao = Instituicao.find(params[:id])\n @instituicao.destroy\n\n respond_to do |format|\n format.html { redirect_to(instituicoes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @institucion.destroy\n respond_to do |format|\n format.html { redirect_to institucions_url, notice: 'Empresa se ha eliminado correctamente.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @indicativo = Indicativo.find(params[:id])\n @indicativo.destroy\n\n respond_to do |format|\n format.html { redirect_to indicativos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @servicio = Servicio.find(params[:id])\n @servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to servicios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @instituto.destroy\n\n respond_to do |format|\n format.html { redirect_to(institutos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sitio_entrega = SitioEntrega.find(params[:id])\n @sitio_entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to sitio_entregas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @indicacao = Indicacao.find(params[:id])\n @indicacao.destroy\n\n respond_to do |format|\n format.html { redirect_to indicacoes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @institucional = Institucional.find(params[:id])\n @institucional.destroy\n\n respond_to do |format|\n format.html { redirect_to institucionals_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @interessado.destroy\n respond_to do |format|\n format.html { redirect_to interessados_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end",
"def destroy\n @infraccion.destroy\n respond_to do |format|\n format.html { redirect_to infraccions_url, notice: 'Infraccion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sitio = Sitio.find(params[:id])\n @sitio.destroy\n\n respond_to do |format|\n format.html { redirect_to sitios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @instum.destroy\n respond_to do |format|\n format.html { redirect_to insta_url, notice: '投稿が削除されました' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nota_tecnica.destroy\n respond_to do |format|\n format.html { redirect_to nota_tecnicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inicio.destroy\n respond_to do |format|\n format.html { redirect_to inicios_url, notice: 'Inicio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inventario.destroy\n respond_to do |format|\n format.html { redirect_to inventarios_url, notice: 'Inventario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inventario.destroy\n respond_to do |format|\n format.html { redirect_to inventarios_url, notice: 'Inventario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @entrada_inventario = EntradaInventario.find(params[:id])\n @entrada_inventario.destroy\n\n respond_to do |format|\n format.html { redirect_to entrada_inventarios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @veiculo = Veiculo.find(params[:id])\n @veiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to veiculos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asociado = Asociado.find(params[:id])\n @asociado.destroy\n\n respond_to do |format|\n format.html { redirect_to asociados_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @instituicao_curso.destroy\n respond_to do |format|\n format.html { redirect_to instituicao_cursos_url, notice: 'Instituicao curso was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inventario_cosa.destroy\n respond_to do |format|\n format.html { redirect_to inventario_cosas_url, notice: 'Inventario cosa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estatuto = Estatuto.find(params[:id])\n @estatuto.destroy\n\n respond_to do |format|\n format.html { redirect_to estatutos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @oficio.destroy\n respond_to do |format|\n format.html { redirect_to oficios_url, notice: 'Oficio eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @iglesia.destroy\n respond_to do |format|\n format.html { redirect_to iglesias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n self.validar_admin\n @inventario.destroy\n respond_to do |format|\n format.html { redirect_to inventarios_url, notice: 'Inventario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @incucai = Incucai.find(params[:id])\n @incucai.destroy\n\n respond_to do |format|\n format.html { redirect_to incucais_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sivic_discipulo.destroy\n respond_to do |format|\n format.html { redirect_to sivic_discipulos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inventario = Inventario.find(params[:id])\n @inventario.destroy\n\n respond_to do |format|\n format.html { redirect_to(inventarios_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\r\n @sivic_contcelula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_contcelulas_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @itinerario_realizado.destroy\n respond_to do |format|\n format.html { redirect_to itinerario_realizados_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tecnica_de_impresion.destroy\n respond_to do |format|\n format.html { redirect_to tecnicas_de_impresion_url, notice: 'Tecnica de impresion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cio.destroy\n respond_to do |format|\n format.html { redirect_to cios_url, notice: 'Cio excluido.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @especialidad.destroy\n respond_to do |format|\n format.html { redirect_to especialidads_url, notice: 'Servicio eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n @agronomiaquimica.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiaquimicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @instituicao_responsavel.destroy\n respond_to do |format|\n format.html { redirect_to instituicao_responsavels_url, notice: 'Instituicao responsavel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @odontologia1 = Odontologia1.find(params[:id])\n @odontologia1.destroy\n\n respond_to do |format|\n format.html { redirect_to odontologia1s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clientes_servico.destroy\n respond_to do |format|\n format.html { redirect_to clientes_servicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sindicato.destroy\n respond_to do |format|\n format.html { redirect_to sindicatos_url, notice: 'Sindicato fue eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exura = Exura.find(params[:id])\n @exura.destroy\n\n respond_to do |format|\n format.html { redirect_to exuras_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @iscrizione.destroy\n respond_to do |format|\n format.html { redirect_to iscriziones_url, notice: \"Iscrizione was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sinh_vien = SinhVien.find(params[:id])\n @sinh_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"def destroy\n @situacoes_juridica = SituacoesJuridica.find(params[:id])\n @situacoes_juridica.destroy\n\n respond_to do |format|\n format.html { redirect_to(situacoes_juridicas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @inscricao.destroy\n respond_to do |format|\n format.html { redirect_to inscricaos_url, notice: 'Inscricao was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @institucion = Institucion.find(params[:id])\n @institucion.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_institucions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @inscricao.destroy\n respond_to do |format|\n format.html { redirect_to inscricaos_url, notice: \"Inscricao was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @colegio = Colegio.find(params[:id])\n @colegio.destroy\n\n respond_to do |format|\n format.html { redirect_to colegios_url }\n format.json { head :no_content }\n end\n end",
"def orchio_delete\n response = client.send_request :delete, inst_args\n orchio_status response, 204\n end",
"def delete\n unless possui_acesso?()\n return\n end\n @aviso = Aviso.find(params[:id])\n @aviso.destroy\n\n respond_to do |format|\n format.html { redirect_to avisos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ginasio = Ginasio.find(params[:id])\n @ginasio.destroy\n\n respond_to do |format|\n format.html { redirect_to ginasios_url, :flash => { :notice => 'Ginasio apagado.' } }\n format.json { head :ok }\n end\n end",
"def destroy\r\n @imobiliaria = Imobiliaria.find(params[:id])\r\n @imobiliaria.destroy\r\n\r\n respond_to do |format|\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n #@clinica.destroy\n @clinica.update(:status => 0)\n respond_to do |format|\n format.html { redirect_to clinicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @informacao_ged.destroy\n respond_to do |format|\n format.html { redirect_to informacoes_ged_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inst.destroy\n respond_to do |format|\n format.html { redirect_to insts_url, notice: 'Inst was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @instancia_item = InstanciaItem.find(params[:id])\n @instancia_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(instancia_items_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @giang_vien = GiangVien.find(params[:id])\n @giang_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"def destroy\n @asiento = Asiento.find(params[:id])\n @asiento.destroy\n\n respond_to do |format|\n format.html { redirect_to asientos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n @solicitud_servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to solicitudes_servicios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reconocimiento = Reconocimiento.find(params[:id])\n @reconocimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to reconocimientos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sezione = Sezione.find(params[:id])\n @sezione.destroy\n\n respond_to do |format|\n format.html { redirect_to sezioni_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @it_inscripcion_registro.destroy\n respond_to do |format|\n format.html { redirect_to it_inscripcion_registros_url, notice: 'El registro de inscripción se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_convenio = TipoConvenio.find(params[:id])\n @tipo_convenio.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_convenios_url }\n format.json { head :no_content }\n end\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy\n @tipo_de_imposto.destroy\n respond_to do |format|\n format.html { redirect_to @empresa, notice: 'Tipo de imposto removido com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @institucion = Institucion.find(params[:institucion_id])\n @institucioncatalogo.destroy\n respond_to do |format|\n format.html { redirect_to institucion_institucioncatalogos_url(@institucion), notice: 'El registro se ha eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @iniciativa = Iniciativa.find(params[:id])\n @iniciativa.destroy\n\n respond_to do |format|\n format.html { redirect_to iniciativas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ejercicio = Ejercicio.find(params[:id])\n @ejercicio.destroy\n\n respond_to do |format|\n format.html { redirect_to ejercicios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sotrudniki = Sotrudniki.find(params[:id])\n @sotrudniki.destroy\n\n respond_to do |format|\n format.html { redirect_to sotrudnikis_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cargo_eleicao = CargoEleicao.find(params[:id])\n @cargo_eleicao.destroy\n\n respond_to do |format|\n format.html { redirect_to cargo_eleicaos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @relogio = Relogio.find(params[:id])\n @relogio.destroy\n\n respond_to do |format|\n format.html { redirect_to relogios_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @dynamique = Dynamique.find(params[:id])\n @dynamique.destroy\n\n respond_to do |format|\n format.html { redirect_to dynamiques_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ocorrencia.destroy\n respond_to do |format|\n format.html { redirect_to ocorrencias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @servico_pacote.destroy\n respond_to do |format|\n format.html { redirect_to servico_pacotes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @insumo.destroy\n respond_to do |format|\n format.html { redirect_to insumos_url, notice: 'Insumo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asistencium.destroy\n respond_to do |format|\n format.html { redirect_to admin_asistencias_path, notice: 'Asistencium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @apologetic.destroy\n respond_to do |format|\n format.html { redirect_to apologetics_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @instagrampic.destroy\n respond_to do |format|\n format.html { redirect_to instagrampics_url, notice: 'Instagrampic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @serv_adicionale = ServAdicionale.find(params[:id])\n @serv_adicionale.destroy\n\n respond_to do |format|\n format.html { redirect_to serv_adicionales_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @notificaciones_admin_actualouse = NotificacionesAdminActualouse.find(params[:id])\n @notificaciones_admin_actualouse.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asiento_de_servicio.destroy\n respond_to do |format|\n format.html { redirect_to asiento_de_servicios_url, notice: 'Asiento de servicio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidades_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @informacao.destroy\n respond_to do |format|\n format.html { redirect_to informacoes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inscripcion.destroy\n respond_to do |format|\n format.html { redirect_to inscripcions_url, notice: 'Inscripcion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.7370825",
"0.73668385",
"0.73220986",
"0.73165035",
"0.7307515",
"0.7260004",
"0.71701807",
"0.71200705",
"0.7117085",
"0.7117085",
"0.7085163",
"0.7083893",
"0.7060684",
"0.7056958",
"0.7053504",
"0.70364827",
"0.7032805",
"0.7027775",
"0.70275205",
"0.701552",
"0.70151556",
"0.70139253",
"0.7012865",
"0.7012865",
"0.7006869",
"0.6998561",
"0.6994908",
"0.6992323",
"0.6990851",
"0.6990851",
"0.6990851",
"0.6990029",
"0.69872546",
"0.69846463",
"0.69814193",
"0.69743055",
"0.69672924",
"0.696364",
"0.69522053",
"0.69503146",
"0.6948245",
"0.6946391",
"0.69381446",
"0.69339436",
"0.6930356",
"0.69272494",
"0.692724",
"0.6927155",
"0.6925462",
"0.69241184",
"0.6920902",
"0.6920451",
"0.69165015",
"0.69125557",
"0.69074047",
"0.69062954",
"0.69047403",
"0.6899556",
"0.68994707",
"0.6885127",
"0.6883935",
"0.6882872",
"0.6880372",
"0.6877721",
"0.687638",
"0.6876248",
"0.68762",
"0.68759304",
"0.6873605",
"0.6863714",
"0.68563086",
"0.68557894",
"0.6855462",
"0.68541396",
"0.68541396",
"0.68541396",
"0.68541396",
"0.68537074",
"0.685269",
"0.684915",
"0.684583",
"0.6843674",
"0.6840984",
"0.68396175",
"0.68369085",
"0.6833954",
"0.68308824",
"0.6826761",
"0.68229437",
"0.68224394",
"0.6820913",
"0.6820087",
"0.6820047",
"0.68112826",
"0.68112826",
"0.68112826",
"0.68100345",
"0.6809473",
"0.68089604",
"0.6805368"
] | 0.7671489 | 0 |
GET /data_items GET /data_items.json | def index
@data_items = DataItem.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getItems()\n return mergeWithAPI(@item_json)['data']\n end",
"def index\n #@items = Item.find_by_user_id(Session[user_id])\n @items = Item.all\n render json: @items\n end",
"def show\n @items = Item.find(params[:id])\n render json: @items\n end",
"def index\n @api_v1_items = Item.all\n render json: @api_v1_items\n end",
"def items\n\t\tresponse = self.get('items').body\n\t\titems = JSON.parse(response)\n\t\tparse_items(items)\n\t\treturn items\n\tend",
"def item_data(data)\r\n BnetApi.make_request(\"/d3/data/item/#{data}\")\r\n end",
"def items\n load\n @data\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.find(:all, :order => 'id ASC')\n # @items = Item.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @items }\n end\n end",
"def index\n render json: RequestItem.all\n end",
"def show\n @item_datum = ItemData.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_datum }\n end\n end",
"def items\n \tbegin\n \t@categories = Category.all.includes(items: [:dimensions])\n \t@ingredients = Ingredient.actives\n \trender 'api/v1/home/items', status: :ok\n \trescue Exception => e\n \t\terror_handling_bad_request(e)\n \tend\n\n\tend",
"def index\n @items = Item.found\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def item_all(data_version = nil)\n item_list = get(resource_path('item'), @version, itemListData: 'all', version: data_version)\n RiotGamesApi::LOL::Model::StaticData::ItemList.new item_list\n end",
"def index\n @items = current_user.items\n respond_to do |format|\n format.html\n format.json { render json: @items }\n end\n end",
"def items\n response[\"items\"]\n end",
"def get_item( item )\n @session.base_url = \"http://cl.ly\"\n resp = @session.get( \"/\" + item )\n \n raise ItemNotFound if resp.status == 404\n Crack::JSON.parse(resp.body)\n end",
"def getdata\r\n\t\titem_name_selected= params[:data_value]\r\n\t\tselected_values=Item.find_by item_name: item_name_selected\r\n\t\trender json: selected_values\r\n\tend",
"def items\n @items ||= items_from_response\n end",
"def path\n \"/{databaseId}/items/list/\"\n end",
"def index\n @items = Admin::Item.by_agency(@current_agency.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_items }\n end\n end",
"def item(uuid)\n http.get \"/items/#{uuid}\"\n end",
"def index\n @items = @deal.items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def list_items( args={} )\n @session.base_url = \"http://my.cl.ly\"\n \n url = \"/items\"\n args.each do |k, v|\n # probably a nicer way to do this\n if url == \"/items\"\n url << \"?#{k.to_s}=#{v.to_s}\"\n else\n url << \"&#{k.to_s}=#{v.to_s}\"\n end\n end\n resp = @session.get( url )\n \n raise AuthorizationError if resp.status == 401\n Crack::JSON.parse(resp.body)\n end",
"def show\n authenticate\n list = List.find(params[:id])\n items = list.items\n render json: {\n items: items,\n id: list.id\n }\n end",
"def get_items\n @items\n end",
"def index\n @items = Item.includes(:user).order(created_at: :desc).all\n render json: @items\n end",
"def index\n @rentable_items = RentableItem.all\n render json: @rentable_items\n end",
"def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def item\n # Url generated from Js script function => getitem() of _form.html.erb file under Views of different controllers\n @item = Report.where(\"user_id = ?\" , current_user.id).pluck(:item_name )\n # send item_names' in form of json\n render json: @item\n end",
"def show\n item = Item.find(params[:id])\n render json: item\n end",
"def index\n @section = Section.find(params[:section_id])\n @items = @section.items\n render json: ItemSerializer.new(@items)\n end",
"def fetch\n result = WebApi.json!('ITFItems_440', 'GetPlayerItems', 1, { :SteamID => @steam_id64 })\n\n @items = []\n result[:items][:item].each do |item_data|\n unless item_data.nil?\n item = TF2Item.new(item_data)\n @items[item.backpack_position - 1] = item\n end\n end\n end",
"def show\n render json: Item.find(params[:id])\n end",
"def request\n data = [\n exact_queries(%w[name user type]),\n switch_queries(%w[stable reviewed]),\n array_queries(%w[tags]),\n range_condition_queries(%w[downloads rating version]),\n sort_query,\n range_query\n ].reduce({}, :merge)\n\n url = \"/items/#{data.empty? ? '' : '?'}#{URI.encode_www_form(data)}\"\n @data = @api.request(url).map do |hash|\n hash['id'] = @api.normalize_id(hash['id'])\n hash\n end\n end",
"def items\n @beverages = Beverage.available\n respond_to do |format|\n format.json { render :json => @beverages.to_json(methods: :image_url)}\n end\n end",
"def show\n @item = Item.all.where(collection_id: params[:id])\n render :json => @item\n end",
"def index\n respond_to do |format|\n format.html\n format.json { render :json => Item.all}\n end\n\n end",
"def fetch\n data = WebApi.json! \"IEconItems_#{app_id}\", 'GetSchema', 1, language: language\n\n @attributes = {}\n data[:attributes].each do |attribute|\n @attributes[attribute[:defindex]] = attribute\n @attributes[attribute[:name]] = attribute\n end\n\n @effects = {}\n data[:attribute_controlled_attached_particles].each do |effect|\n @effects[effect[:id]] = effect[:name]\n end\n\n @items = {}\n @item_names = {}\n data[:items].each do |item|\n @items[item[:defindex]] = item\n @item_names[item[:name]] = item[:defindex]\n end\n\n @item_levels = {}\n data[:item_levels].each do |item_level_type|\n @item_levels[item_level_type[:name]] = {}\n item_level_type[:levels].each do |level|\n @item_levels[item_level_type[:name]][level[:level]] = level[:name]\n end\n end if data.key? :item_levels\n\n @item_sets = {}\n data[:item_sets].each do |item_set|\n @item_sets[item_set[:item_set]] = item_set\n end\n\n @origins = []\n data[:originNames].each do |origin|\n @origins[origin[:origin]] = origin[:name]\n end\n\n @qualities = []\n data[:qualities].keys.each_with_index do |key, index|\n @qualities[index] = data[:qualityNames][key] || key.to_s.capitalize\n end\n end",
"def show\n render json: Item.find(params[\"id\"])\n end",
"def index\n if params[:uid]\n @current_user = User.find_by(uid: params[:uid])\n render json: {\n status: 'SUCCESS',\n message: 'Loaded users',\n value: @current_user.items\n }\n else\n items = Item.order(created_at: :desc)\n render json: { status: 'SUCCESS', message: 'Loaded items', value: items }\n end\n end",
"def index\n @list_items = List.find(params[:list_id]).list_items\n\n render json: @list_items\n end",
"def get_items(product_id, params={})\n self.client.get(\"products/#{product_id}/items\", params)\n end",
"def items(); @items || CrateAPI::Items.new(); end",
"def fetch\n result = WebApi.json!(\"IEconItems_#{app_id}\", 'GetPlayerItems', 1, { :SteamID => @steam_id64 })\n item_class = self.class.send :class_variable_get, :@@item_class\n\n @items = []\n result[:items].each do |item_data|\n unless item_data.nil?\n item = item_class.new(self, item_data)\n @items[item.backpack_position - 1] = item\n end\n end\n end",
"def my\n items = current_user.items\n render json: items\n end",
"def index\n @item_type = params[:type] = \"C\"\n \n params[:id] = nil\n \n # 찜한 상품, 콜렉션\n @collections = Collection.itemList(params)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collections }\n end\n \n end",
"def show\n \n render status: 200, :json => @item\n\n end",
"def index\r\n datatable = ItemDatatable.new(view_context)\r\n respond_to do |format|\r\n format.html\r\n format.json { render json: datatable}\r\n end\r\n end",
"def items\n raise Nanoc3::Errors::DataNotYetAvailable.new('Items', true) unless @items_loaded\n @items\n end",
"def index\n if params[:cart_id]\n get_cart\n @items = Item.where(cart: @cart)\n elsif params[:order_id]\n get_order\n @items = Item.where(order: @order)\n end\n render json: @items, status: 200\n end",
"def show\n render json: @item\n end",
"def index\n render json: Item.paginate(page: params[:page], per_page: 25)\n end",
"def index\n# @items = Item.all\n store_location\n @items = @items.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def item\n @items = Item.select {|k,v| k.product_type_id != 4 }\n\n respond_to do |format|\n #format.html # index.html.erb\n format.json { render json: @items, :only => [:id, :name, :description, :price, :time], :include => {:product_type => { :only => [:id, :name]}}}\n end\n end",
"def index\n @items = Item.all\n\n render :json => @items, :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 end",
"def items\n @item_data ||= @active_domain.nil? ? EMPTY_ITEM_DATA : get_items(@query)\n @item_data[:items]\n end",
"def index\n self.identify_user\n @items = @user.items\n @itemlist = @items.map do |item|\n convert_to_json(item)\n end\n respond_to do |format|\n format.json { render :json => @itemlist }\n format.xml { render :xml => @items }\n format.html { render text: \"Unsupported Format\", status: 404 }\n end\n end",
"def index\n @order_items = OrderItem.all\n # render json: @order_item, status: :created\n # render json: @order_item.as_json(include: :item)\n\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item.to_json() }\n end\n end",
"def show\n @itemstable = Itemstable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itemstable }\n end\n end",
"def get_items(cdm_url, collection_alias)\n cdm_items_url = cdm_url + \"dmQuery/#{collection_alias}/0/title/title/2000/1/0/0/0/0/0/0/json\"\n items = JSON.parse(open(cdm_items_url).read)\n end",
"def itemized_data\n data\n end",
"def get_items\n response_xml = http_get(@client, \"#{xero_url}/Items\")\n parse_response(response_xml, {}, {:request_signature => 'GET/items'})\n end",
"def items\n @backlog = Backlog.find(params[:id])\n if cannot? :read, @backlog\n deny_access\n end\n render :json => @backlog.backlog_items\n end",
"def show\n render json: @request_item\n end",
"def get_items(response, item_page)\n items = []\n response = response.to_h\n if response.key?('ItemSearchResponse') &&\n response['ItemSearchResponse'].key?('Items') &&\n response['ItemSearchResponse']['Items'].key?('Item')\n response['ItemSearchResponse']['Items']['Item'].each_with_index do |item, pos|\n items << { position: (item_page - 1) * ITEMS_PER_PAGE + pos + 1, data: item }\n end\n end\n items\n end",
"def index\n\t\t@auction_items = @auction.auction_items\n\t\trender json: @auction_items.as_json\n\tend",
"def show\n render json: @list_item\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def items\n if @items.nil?\n raise NoData.new(\"No data has been retrieved yet.\", self)\n else\n @items.collect do |hsh|\n item = self.class.item_class.new\n item.store_result(:attrs => hsh)\n item\n end\n end\n end",
"def index\n @items_locations = ItemsLocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items_locations }\n end\n end"
] | [
"0.7674954",
"0.71355444",
"0.7094214",
"0.6972444",
"0.6931706",
"0.6926581",
"0.6859299",
"0.68276066",
"0.68276066",
"0.68276066",
"0.68276066",
"0.6809148",
"0.6802287",
"0.67980635",
"0.67876524",
"0.67678326",
"0.676121",
"0.67236555",
"0.6714538",
"0.6663792",
"0.66573316",
"0.6644847",
"0.66129804",
"0.6596316",
"0.6596156",
"0.65691257",
"0.65677446",
"0.6549934",
"0.6541178",
"0.65336573",
"0.6532831",
"0.65303725",
"0.65223026",
"0.64747065",
"0.6463534",
"0.64555746",
"0.64527744",
"0.64392537",
"0.6403943",
"0.6400301",
"0.6400129",
"0.63941115",
"0.6381448",
"0.6375604",
"0.6355752",
"0.63454854",
"0.63208914",
"0.6320678",
"0.6310805",
"0.63034207",
"0.62706435",
"0.6258606",
"0.6256012",
"0.62536013",
"0.62526906",
"0.6252166",
"0.62478316",
"0.6243344",
"0.623146",
"0.6217995",
"0.6212812",
"0.6210506",
"0.620136",
"0.6198951",
"0.61979526",
"0.61940014",
"0.6183739",
"0.6180953",
"0.61743945",
"0.61738324",
"0.6167365",
"0.61651915",
"0.6160311",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6154758",
"0.6153074",
"0.6150319"
] | 0.70302844 | 3 |
GET /data_items/1 GET /data_items/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getItems()\n return mergeWithAPI(@item_json)['data']\n end",
"def index\n @api_v1_items = Item.all\n render json: @api_v1_items\n end",
"def show\n @items = Item.find(params[:id])\n render json: @items\n end",
"def get_item( item )\n @session.base_url = \"http://cl.ly\"\n resp = @session.get( \"/\" + item )\n \n raise ItemNotFound if resp.status == 404\n Crack::JSON.parse(resp.body)\n end",
"def index\n #@items = Item.find_by_user_id(Session[user_id])\n @items = Item.all\n render json: @items\n end",
"def show\n @item_datum = ItemData.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_datum }\n end\n end",
"def item(uuid)\n http.get \"/items/#{uuid}\"\n end",
"def index\n @items = Item.find(:all, :order => 'id ASC')\n # @items = Item.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @data_items = DataItem.all\n end",
"def show\n item = Item.find(params[:id])\n render json: item\n end",
"def item_data(data)\r\n BnetApi.make_request(\"/d3/data/item/#{data}\")\r\n end",
"def index\n render json: RequestItem.all\n end",
"def show\n render json: Item.find(params[:id])\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def show\n @item = Item.all.where(collection_id: params[:id])\n render :json => @item\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @items }\n end\n end",
"def index\n @items = Item.found\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def show\n render json: Item.find(params[\"id\"])\n end",
"def path\n \"/{databaseId}/items/list/\"\n end",
"def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def getdata\r\n\t\titem_name_selected= params[:data_value]\r\n\t\tselected_values=Item.find_by item_name: item_name_selected\r\n\t\trender json: selected_values\r\n\tend",
"def item\n $data_items[1]\n end",
"def show\n \n render status: 200, :json => @item\n\n end",
"def index\n @items = Admin::Item.by_agency(@current_agency.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_items }\n end\n end",
"def item\n # Url generated from Js script function => getitem() of _form.html.erb file under Views of different controllers\n @item = Report.where(\"user_id = ?\" , current_user.id).pluck(:item_name )\n # send item_names' in form of json\n render json: @item\n end",
"def get_item\n @item = Item.find_by_id(params[:id])\n if @item\n return @item\n else \n render json: {\"message\": {\"type\": \"error\", \"content\": \"The item could not be found!\"}}\n end\n end",
"def index\n @items = @deal.items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item.to_json() }\n end\n end",
"def show\n authenticate\n list = List.find(params[:id])\n items = list.items\n render json: {\n items: items,\n id: list.id\n }\n end",
"def index\n @items = current_user.items\n respond_to do |format|\n format.html\n format.json { render json: @items }\n end\n end",
"def show\n# @item = Item.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def index\n respond_to do |format|\n format.html\n format.json { render :json => Item.all}\n end\n\n end",
"def item_all(data_version = nil)\n item_list = get(resource_path('item'), @version, itemListData: 'all', version: data_version)\n RiotGamesApi::LOL::Model::StaticData::ItemList.new item_list\n end",
"def fetch\n result = WebApi.json!('ITFItems_440', 'GetPlayerItems', 1, { :SteamID => @steam_id64 })\n\n @items = []\n result[:items][:item].each do |item_data|\n unless item_data.nil?\n item = TF2Item.new(item_data)\n @items[item.backpack_position - 1] = item\n end\n end\n end",
"def show\n @itemstable = Itemstable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itemstable }\n end\n end",
"def items\n \tbegin\n \t@categories = Category.all.includes(items: [:dimensions])\n \t@ingredients = Ingredient.actives\n \trender 'api/v1/home/items', status: :ok\n \trescue Exception => e\n \t\terror_handling_bad_request(e)\n \tend\n\n\tend",
"def index\n @items = Item.includes(:user).order(created_at: :desc).all\n render json: @items\n end",
"def index\n @rentable_items = RentableItem.all\n render json: @rentable_items\n end",
"def index\n @item_type = params[:type] = \"C\"\n \n params[:id] = nil\n \n # 찜한 상품, 콜렉션\n @collections = Collection.itemList(params)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collections }\n end\n \n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n render json: @item\n end",
"def request\n data = [\n exact_queries(%w[name user type]),\n switch_queries(%w[stable reviewed]),\n array_queries(%w[tags]),\n range_condition_queries(%w[downloads rating version]),\n sort_query,\n range_query\n ].reduce({}, :merge)\n\n url = \"/items/#{data.empty? ? '' : '?'}#{URI.encode_www_form(data)}\"\n @data = @api.request(url).map do |hash|\n hash['id'] = @api.normalize_id(hash['id'])\n hash\n end\n end",
"def show\n @item = ActiveRecord::Base.connection.execute(\"\n SELECT * \n FROM items \n WHERE iid = #{params[:id]} \n LIMIT 1\").first\n\n @games = ActiveRecord::Base.connection.execute(\"\n SELECT g.*\n FROM games g\n JOIN game_items gi\n ON g.gid = gi.gid\n WHERE iid = #{params[:id]}\")\n\n respond_to do |format|\n format.html\n format.json {render json: Item.find(@item[0])}\n end\n end",
"def show\n render json: @request_item\n end",
"def items\n load\n @data\n end",
"def show\n @item_info = ItemInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_info }\n end\n end",
"def index\n @list_items = List.find(params[:list_id]).list_items\n\n render json: @list_items\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json\n end\n end",
"def show\n @item = TodoItem.find(params[:id])\n \n respond_to do |format|\n format.html\n format.json {render json: {\n success:true, \n data: [@item],\n message: \"TodoItem found.\"\n }}\n end\n end",
"def show\n @feed_item = Item.find(params[:id])\n\n render json: @feed_item\n end",
"def index\n if params[:cart_id]\n get_cart\n @items = Item.where(cart: @cart)\n elsif params[:order_id]\n get_order\n @items = Item.where(order: @order)\n end\n render json: @items, status: 200\n end",
"def item\n @items = Item.select {|k,v| k.product_type_id != 4 }\n\n respond_to do |format|\n #format.html # index.html.erb\n format.json { render json: @items, :only => [:id, :name, :description, :price, :time], :include => {:product_type => { :only => [:id, :name]}}}\n end\n end",
"def index\r\n datatable = ItemDatatable.new(view_context)\r\n respond_to do |format|\r\n format.html\r\n format.json { render json: datatable}\r\n end\r\n end",
"def show\n @item = @deal.items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n render json: @item, status: :ok\n end",
"def index\n @apiv1_items = Item.all.order(:name)\n end",
"def item\n @item = Item.find(params[:id])\n end",
"def findItem\n item = Item.find(params[:id])\n if item\n return item\n else\n return render json: {data: \"Failure, could not find this item.\"}, status: :not_found\n end\n end",
"def items\n\t\tresponse = self.get('items').body\n\t\titems = JSON.parse(response)\n\t\tparse_items(items)\n\t\treturn items\n\tend",
"def show\n render json: @list_item\n end",
"def json_index_items_designs_by_item_id\n\n respond_to do |format|\n if ItemsDesign.exists?(item_id:params[:item_id])\n @items_designs = ItemsDesign.where('item_id=?',params[:item_id]).order(\"id\")\n\n format.json { render json: @items_designs }\n else\n format.json { render json: 'not found item id' , status: :not_found }\n end\n end\n end",
"def items\n @beverages = Beverage.available\n respond_to do |format|\n format.json { render :json => @beverages.to_json(methods: :image_url)}\n end\n end",
"def index\n @section = Section.find(params[:section_id])\n @items = @section.items\n render json: ItemSerializer.new(@items)\n end",
"def show\n respond_to do |format|\n format.html { render layout: false }\n format.json do\n batches = Batch.where(item_id: params[:id])\n render json: batches\n end\n end\n end",
"def show\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(params[:list_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_item }\n end\n end",
"def index\n render json: Item.paginate(page: params[:page], per_page: 25)\n end",
"def getitem\n\n int_parent = params[:parent]\n @items = Item.where(\"manifestation_id = ?\", int_parent).order(\"item_siglum ASC\")\n @items_master = Array.new\n @items.each do |it|\n @holding_institution = HoldingInstitution.find(it.holding_institution_id)\n str_it_string = \"(\" + it.item_siglum + \") \" + @holding_institution.holding_institution_name + \" [\" + it.item_shelfmark + \"]\"\n @it_item = [str_it_string, it.id]\n @items_master.push(@it_item)\n end\n\n\n respond_to do |format|\n format.html { render json: @items_master }\n format.json { render json: @items_master }\n end\n end",
"def show\n require 'net/http'\n require 'json'\n\n response = Net::HTTP.get_response( URI.parse( \"http://freeshit.firebaseio.com/items/%s.json\" % [ params[:id] ] ) );\n\n begin\n @fb_item = JSON.parse(response.body)\n rescue\n render :status => 404, :text => 'Item not found.'\n return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fb_item }\n end\n end",
"def show\n @weather_item = WeatherItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @weather_item }\n end\n end",
"def index\n @items = Item.all\n\n render :json => @items, :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 end",
"def index\n# @items = Item.all\n store_location\n @items = @items.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @order_items = OrderItem.all\n # render json: @order_item, status: :created\n # render json: @order_item.as_json(include: :item)\n\n end",
"def load_item_data\n\n \n @product = CurrentInventory.find_by(product_id: params[:product_id])\n \n \n render :json => [@product.product.price, @product.current_quantity,@product.product.unit]\n end",
"def fetch\n result = WebApi.json!(\"IEconItems_#{app_id}\", 'GetPlayerItems', 1, { :SteamID => @steam_id64 })\n item_class = self.class.send :class_variable_get, :@@item_class\n\n @items = []\n result[:items].each do |item_data|\n unless item_data.nil?\n item = item_class.new(self, item_data)\n @items[item.backpack_position - 1] = item\n end\n end\n end",
"def index\n if params[:uid]\n @current_user = User.find_by(uid: params[:uid])\n render json: {\n status: 'SUCCESS',\n message: 'Loaded users',\n value: @current_user.items\n }\n else\n items = Item.order(created_at: :desc)\n render json: { status: 'SUCCESS', message: 'Loaded items', value: items }\n end\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @item }\n end\n end",
"def show \n #get the item id from the url params\n item_id = params[:id]\n #use `item_id` to find the item in the database\n #and save it to an instance variable\n @item = Item.find_by_id(item_id)\n render json: @item\n # @item = City.find(params[:id])\n # @item = Item.joins(:posts).includes(:posts).find(params[:id])\n # puts @item\n # render json: {\n # item: @item\n # }\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @shared_item = SharedItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shared_item }\n end\n end",
"def load_item_data\n item = Item.find_by_id(params[:id]).present? ? Item.find(params[:id]) : Item.unscoped.find_by_id(params[:id])\n render :plain => [item.item_description || \"\", item.unit_cost.to_f || 1, item.quantity.to_f || 1, item.tax_1 || 0, item.tax_2 || 0, item.item_name || \"\", item.tax1_name || \"\", item.tax2_name || \"\", item.tax1_percentage || 0, item.tax2_percentage || 0 ]\n end"
] | [
"0.71674293",
"0.70160764",
"0.6945815",
"0.6910274",
"0.68650216",
"0.6845848",
"0.671658",
"0.6709465",
"0.6671654",
"0.66532034",
"0.6628087",
"0.6614325",
"0.65953165",
"0.6592836",
"0.6592836",
"0.6592836",
"0.6592836",
"0.65753603",
"0.6569559",
"0.65677476",
"0.65668553",
"0.651099",
"0.6497019",
"0.646055",
"0.64179397",
"0.6413324",
"0.63965213",
"0.63828444",
"0.63522315",
"0.6345426",
"0.6334818",
"0.6328737",
"0.63132864",
"0.6294412",
"0.62795657",
"0.6276821",
"0.62761873",
"0.62696904",
"0.6264029",
"0.62483495",
"0.6243156",
"0.6241731",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6226058",
"0.6225436",
"0.6210628",
"0.61676025",
"0.61624587",
"0.6156791",
"0.61558163",
"0.61543334",
"0.6139467",
"0.613174",
"0.6117888",
"0.61173975",
"0.6113991",
"0.6103322",
"0.6088642",
"0.6086909",
"0.6084954",
"0.60827595",
"0.6058202",
"0.60405463",
"0.60405314",
"0.6036992",
"0.6035364",
"0.60324216",
"0.602841",
"0.6014413",
"0.6012299",
"0.6007085",
"0.59971523",
"0.5995872",
"0.59956753",
"0.59947705",
"0.59905887",
"0.5988961",
"0.5985674",
"0.5983739",
"0.5983157",
"0.5973915",
"0.59690386",
"0.5965781",
"0.59614605"
] | 0.0 | -1 |
POST /data_items POST /data_items.json | def create
@data_item = DataItem.new(data_item_params)
respond_to do |format|
if @data_item.save
format.html { redirect_to @data_item, notice: 'Data item was successfully created.' }
format.json { render :show, status: :created, location: @data_item }
else
format.html { render :new }
format.json { render json: @data_item.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n item = list.items.create!(item_params)\n render json: item, status: 201\n end",
"def create\n @request_item = RequestItem.new(request_item_params)\n @request_item.item = Item.new(name: params[:request_item][:item][:name])\n\n if @request_item.save\n render json: @request_item \n else\n render json: @request_item.errors, status: :bad_request\n end\n end",
"def create_item(user_id, data) \n data = data.just(SETTABLE_ITEM_FIELDS)\n data[:user_id] = user_id\n data[:title] ||= 'item'\n data[:price] ||= 5\n data[:price] = data[:price].to_i\n data[:slug] = get_unique_slug($items,:slug,data[:title])\n\n data[:imgs] = data[:imgs].to_a.map {|link| {link: link}}\n data[:videos] = data[:videos].to_a.map {|link| {link: link}}\n data[:status] = :pending\n item = $items.add(data)\nend",
"def create\n item = Item.new(item_params)\n item.done = \"0\"\n item.trash = \"0\"\n\n if item.save\n render json: {data:item}, status: :created\n else\n render json: {data:item}, status: :unprocessable_entity\n end\n end",
"def save_items_data\n @parsed[\"order_items\"].each do |i| \n external_code = i['item']['id']\n item = Item.find_or_create_by(external_code: external_code)\n item.order_id = @order.id\n item.external_code = i['item']['id']\n item.name = i['item']['title']\n item.price = i['unit_price']\n item.quantity = i['quantity']\n item.total = i['full_unit_price']\n @subItems = []\n item.save\n end\n end",
"def create\n @item_datum = ItemData.new(params[:item_datum])\n\n respond_to do |format|\n if @item_datum.save\n format.html { redirect_to @item_datum, notice: 'Item datum was successfully created.' }\n format.json { render json: @item_datum, status: :created, location: @item_datum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n create_params = item_params\n item = Item.new(\n name: create_params[:name], \n is_complete: false, #create_params[:is_complete], \n list_id: create_params[:list_id])\n\n item.save!\n render json: item\n end",
"def data_item_params\n params.require(:data_item).permit(:name, :data_class_id, :data_source_id)\n end",
"def create\n\t\titem = Item.create(item_params)\n\t\trender json: item\n\tend",
"def writeItem(app, repo_url, item)\n headers = defaultHeaders(app[\"token\"])\n data = item.to_json\n response = HTTParty.post(repo_url,\n headers: headers,\n body: data)\n response\nend",
"def create\n item = Item.new(item_params)\n item.user = current_user\n if item.save\n render json: item\n else\n render json: {errors: item.errors}, status: :unprocessable_entity\n end\n end",
"def item_data(data)\r\n BnetApi.make_request(\"/d3/data/item/#{data}\")\r\n end",
"def create\n @item = Item.new(item_params)\n if @item.save\n @items = Item.all\n render status: 201, :json => @item\n \n else\n render status: 404, json: { message: @item.errors}.to_json\n end\n \n \n end",
"def create\n @item = @client.items.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully added.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save\n @items.to_json\n end",
"def postEntityBulkJson( data)\n params = Hash.new\n params['data'] = data\n return doCurl(\"post\",\"/entity/bulk/json\",params)\n end",
"def item(data, question_ids)\n xml = xml_root(\"items\")\n\n questions = question_ids.inject(XML::Node.new(\"questions\")) do |doc, id|\n question = XML::Node.new(\"question\")\n question[\"id\"] = id.to_s\n doc << question\n end\n\n arrayed(data).each do |name|\n xml.root << (XML::Node.new(\"item\") << (XML::Node.new(\"data\") << name) << questions.copy(true))\n end\n\n send_and_process('items/add', 'items/item', xml)\n end",
"def create\n # defined object to receive strict item_params including :description, :price, :stockQty ; else return 400\n @item = Item.new(item_params)\n \n if @item.save\n render json: @item.to_json, status: 201\n else\n head 400\n end\n end",
"def bulk_item_data\n prm = manifest_item_bulk_post_params\n items = prm[:data]\n raise_failure(\"not an Array: #{items.inspect}\") unless items.is_a?(Array)\n raise_failure('no item data') unless items.present?\n row = prm[:row].to_i\n delta = prm[:delta].to_i\n items.map do |item|\n raise_failure(\"not a Hash: #{item.inspect}\") unless item.is_a?(Hash)\n item[:manifest_id] = item.delete(:manifest) if item.key?(:manifest)\n if item[:manifest_id].blank?\n item[:manifest_id] = manifest_id\n elsif item[:manifest_id] != manifest_id\n raise_failure(\"invalid manifest_id for #{item.inspect}\")\n end\n row = (item[:row] ||= row)\n delta = (item[:delta] ||= delta + 1)\n ManifestItem.normalize_attributes(item).except!(:attr_opt)\n end\n end",
"def post(payload, request_opts={})\n if payload.is_a?(Hash)\n payload = self.class.item_class.new(payload) # apply data type conversion\n end\n qs = payload.query_string_params\n payload = payload.as_hash\n response = http(request_opts).post(resolved_path + qs, payload)\n new_item = self.class.item_class.new\n new_item.store_result(response)\n new_item\n end",
"def create_item()\n\n request_body = {\n 'name' => 'Milkshake',\n 'variations' => [\n {\n 'name' => 'Small',\n 'pricing_type' => 'FIXED_PRICING',\n 'price_money' => {\n 'currency_code' => 'USD',\n 'amount' => 400\n }\n }\n ]\n }\n\n response = Unirest.post CONNECT_HOST + '/v1/' + LOCATION_ID + '/items',\n headers: REQUEST_HEADERS,\n parameters: request_body.to_json\n\n if response.code == 200\n puts 'Successfully created item:'\n puts JSON.pretty_generate(response.body)\n return response.body\n else\n puts 'Item creation failed'\n puts response.body\n return nil\n end\nend",
"def create\n @item = build_item\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to items_path, notice: 'アップロードしたでー' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n @item.save\n respond_with @item\n end",
"def create\n @itemtipo = Itemtipo.new(itemtipo_params)\n\n if @itemtipo.save\n render json: @itemtipo, status: :created, location: @itemtipo\n else\n render json: @itemtipo.errors, status: :unprocessable_entity\n end\n end",
"def attributes_for_new_item(data)\n { data: data }\n end",
"def item_params\n params.require(:item).permit(:item, :body)\n end",
"def add_multiple_food_items(items)\n items.each do |item|\n item['_id'] = FoodItem.create_id item[:api_key], item[:item_id]\n FoodItem.new_item item\n end\n items\n end",
"def create\n @item = Item.new(item_params)\n if @item.save\n render json: ItemSerializer.new(@item)\n else\n render json: @section.errors, status: :unprocessable_entity\n end\n end",
"def create(item_attrs = {})\n body = { value: item_attrs }\n Iterable.request(conf, base_path).put(body)\n end",
"def create\n \n #debug\n write_log(\n Const::SL::LOG_PATH_SL,\n \"items_controller#create(params[:item] => #{params[:item]})\",\n # __FILE__,\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n \n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api_post(method: nil, item: [], params: {})\n raise ArgumentError, 'Missing method in API request' unless method\n\n login(@host) if Time.new.to_i > @session_timeout\n\n request = {}\n request[:method] = method\n request[:params] = [[item || []], params.to_h]\n # This is how we create request params once all methods use structs\n # request[:params] = [[item || []], params.to_h]\n # We use a StandardError since it is based on the HTTP response code with a JSON payload definition\n begin\n resp = @http.post(@uri, request.to_json, @headers)\n JSON.parse(resp.body)['result']['result']\n rescue StandardError\n puts \"The following error has occurred #{JSON.parse(resp.body)['error']['message']}\"\n end\n end",
"def create\n @item = Item.new(item_params)\n\n if @item.save\n render json: @item\n else\n render json: { error: t('story_create_error') }, status: :unprocessable_entity\n end\n end",
"def create\n json_response(current_restaurant.restaurant_food_items.create!(food_item_params), :created)\n end",
"def create\n ListItem.transaction do\n item = Item.new(item_params)\n item.save\n\n @list_item = ListItem.new(list_item_params)\n @list_item.item_id = item.id\n @list_item.list_id = params[:list_id]\n\n\n if @list_item.save\n render json: @list_item, status: :created\n else\n render json: @list_item.errors, status: :unprocessable_entity\n end\n end\n end",
"def create\n @api_v1_item = Item.new(api_v1_item_params)\n\n if @api_v1_item.save\n render json: @api_v1_item\n else\n render json: @api_v1_item.errors\n end\n end",
"def create \n #whitelist params and save them to a variable \n item_params = params.require(:item).permit(:name, :category, :image, :price)\n #create a new item from 'item_params'\n @item = Item.new(item_params)\n #if item saves, render the new item in JSON\n if @item.save \n render json: @item\n end\n end",
"def create\n @item = current_owner.items.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to items_path, notice: 'Item was created successfully' }\n format.json { render :show, status: :created, location: items_path }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def item_params\n params.require(:item).permit!\n end",
"def add_item_to_project\n @project = Project.find(params[:id])\n @item = Item.find(params[:item_id])\n\n @project.items << @item\n\n render json: @project, include: :items\n end",
"def change_multiple_items\n @items = params[:items]\n\n @items.each do |item|\n @current_item = Item.find(item[:id])\n @current_item.update(quantity: item[:quantity])\n end\n\n render :json => @items.to_json\n end",
"def item_params\n params.require(:item).permit(:name, :value)\n end",
"def create\n\n @item = Item.new(item_params)\n #まだView設定がまだのため仮の登録データ、あとでViewからのデータをitem_paramsで定義します。\n atai = 1\n watasi = \"hoge\"\n\n @item.status = atai\n @item.upper_category = watasi\n @item.middle_category = watasi\n @item.lower_category = watasi\n @item.seller = watasi\n @item.size_type = watasi\n \n \n @item.save\n redirect_to root_path\n # respond_to do |format|\n # if @item.save\n # format.html { redirect_to @item, notice: 'Item was successfully created.' }\n # format.json { render :show, status: :created, location: @item }\n # else\n # format.html { render :new }\n # format.json { render json: @item.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def createItemOfList\n results1 = checkUser(params[:target_account]) #userid user to give the money\n if results1.code == 200\n parameters={user_id: (@current_user[\"id\"]).to_i, description: (params[:description]), date_pay: params[:date_pay], cost: params[:cost], target_account: params[:target_account], state_pay:params[:state_pay]}\n options = {\n :body => parameters.to_json,\n :headers => {\n 'Content-Type' => 'application/json'\n }\n }\n results = HTTParty.post(\"http://192.168.99.101:4055/lists\", options)\n if results.code == 201\n head 201\n else\n render json: results.parsed_response, status: results.code\n end\n elsif results1.code == 404\n renderError(\"Not Found\", 404, \"The resource does not exist\")\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to root_url, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, item: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def item_params\n params.require(:item).permit(:name, :price, :date, :user_id, :group_id, :item_type, { tag_ids: [] })\n end",
"def order_items_create_with_http_info(data, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: OrderItemsApi.order_items_create ...'\n end\n # verify the required parameter 'data' is set\n if @api_client.config.client_side_validation && data.nil?\n fail ArgumentError, \"Missing the required parameter 'data' when calling OrderItemsApi.order_items_create\"\n end\n # resource path\n local_var_path = '/order-items/'\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[:body] || @api_client.object_to_http_body(data) \n\n # return_type\n return_type = opts[:return_type] || 'OrderItem' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic', 'Token']\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, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OrderItemsApi#order_items_create\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def item_params\n params.require(:item).permit(:number, :release_date, :name, :batch, :description, :style, :abv, :case_vol, :can_limit, :price, :price_four_pack, :additional, :canning_date, :canning_phrase, :label_inspiration, :instagram_url, :instagram_embed, :instagram_image, :release_date_difference_seconds, :company_id, hop_ids: [])\n end",
"def item_params\n params.require(:item).permit(:name, :tag_list, :type_list, :description)\n end",
"def create\n @invoice_data_item = InvoiceDataItem.new(invoice_data_item_params)\n\n respond_to do |format|\n if @invoice_data_item.save\n format.html { redirect_to @invoice_data_item, notice: 'Invoice data item was successfully created.' }\n format.json { render :show, status: :created, location: @invoice_data_item }\n else\n format.html { render :new }\n format.json { render json: @invoice_data_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def item_params\n params.require(:item).permit(:name, :type_id, :user_id)\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to lists_path, :notice => 'Item was successfully created.' }\n format.json { render :json => lists_path, :status => :created, :location => lists_path }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_item = Admin::Item.new(params[:admin_item])\n @admin_item.agency_id = @current_agency.id\n fields = params[:item][:field]\n\n respond_to do |format|\n if @admin_item.save\n \n fields.each do |key, value|\n Admin::FieldValue.create(:item_id => @admin_item.id, :field_id => key, :value => value)\n end\n \n format.html { redirect_to edit_admin_item_path(@admin_item), notice: 'Item was successfully created.' }\n format.json { render json: @admin_item, status: :created, location: @admin_item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ProcessDataItemsPostAggregation(dataitems, agentId)\n # Remove all invalid dataitems\n dataitems.delete_if{|x| !IsValidDataItem?(x)}\n for x in dataitems\n x.delete(DI_KEY_IPNAME)\n x[DI_KEY_AGENTGUID] = agentId\n x[DI_KEY_TYPE] = DI_TYPE_JSON\n end\n end",
"def ProcessDataItemsPostAggregation(dataitems, agentId)\n # Remove all invalid dataitems\n dataitems.delete_if{|x| !IsValidDataItem?(x)}\n for x in dataitems\n x.delete(DI_KEY_IPNAME)\n x[DI_KEY_AGENTGUID] = agentId\n x[DI_KEY_TYPE] = DI_TYPE_JSON\n end\n end",
"def item_params\n params.require(:item).permit!\n end",
"def update\n\n #update the item of request_item\n if (params[:request_item].present?)\n @request_item.item = params[:request_item][:item].present? ? Item.new(name: params[:request_item][:item][:name]) : @request_item.item\n end\n #update all other parameters\n if @request_item.update(request_item_params)\n render json: @request_item\n else\n render json: @request_item.errors, status: :bad_request\n end\n\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: \"Item was successfully created.\" }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def item_params\n params.require(:item).permit(:pedido_id, :modelo_id, :cantidad)\n end",
"def save(item_id = @raw_data[\"id\"])\n r = chef_server_rest\n begin\n if Chef::Config[:why_run]\n Chef::Log.warn(\"In why-run mode, so NOT performing data bag item save.\")\n else\n r.put(\"data/#{data_bag}/#{item_id}\", self)\n end\n rescue Net::HTTPClientException => e\n raise e unless e.response.code == \"404\"\n\n r.post(\"data/#{data_bag}\", self)\n end\n self\n end",
"def item_params\n params.require(:item).permit(:name, :url, :price, :container)\n end",
"def create\n\n @item = Item.new(params[:item])\n @item.user_id = current_user.id\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to '/main', :notice => 'Item was successfully created.' }\n format.json { render :json => @item, :status => :created, :location => @item }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to :items, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @slot }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_save_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n # @item.build_note\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n respond_with(@items)\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to '/items', notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def updateItem(app, repo_url, item, id)\n headers = defaultHeaders(app[\"token\"])\n data = id.merge(item).to_json\n response = HTTParty.post(repo_url,\n headers: headers,\n body: data)\n response \nend",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n @item.save_info\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end \n end",
"def item_params\n params.require(:item).permit(:title, :body)\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def processItemsOrder\n @id = params[:itemID]\n @description = params[:description]\n @price = params[:price]\n @award = params[:award]\n @item = Item.find_by(id: @id)\n \n if @item.save\n head 204\n else\n # test\n render json: @item.to_json, status: 400\n # originally\n #head 400\n end\n end",
"def create\n cart_uuid = params[:cart_id]\n @item = Item.new(item_params.merge(cart_uuid: cart_uuid))\n if @item.save\n render json: @item, status: 201\n else\n render_errors 400, @item.errors.full_messages\n end\n end",
"def add_item\n #params[item_id]\n end",
"def create\n @item = Item.new(item_params)\n \n respond_to do |format|\n if @item.save \n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = @list.items.create(item_params)\n redirect_to @list\n end",
"def item_params\n params.require(:item).permit(:name, :phone, :address, :quantity, :description, :price, :sku)\n end",
"def create\n @user = User.find(current_user.id)\n @item = @user.items.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to '/items', notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6995797",
"0.6736687",
"0.67053056",
"0.662083",
"0.660447",
"0.6530322",
"0.64518636",
"0.64164734",
"0.6386439",
"0.6361424",
"0.63582677",
"0.63432807",
"0.62786186",
"0.6271697",
"0.62401927",
"0.62266135",
"0.61705756",
"0.61504644",
"0.61439097",
"0.6133691",
"0.61323947",
"0.6121007",
"0.61142045",
"0.61101514",
"0.6083331",
"0.60808355",
"0.607985",
"0.6079417",
"0.60624224",
"0.6061215",
"0.6061015",
"0.6057899",
"0.6056495",
"0.6034874",
"0.6031668",
"0.60210836",
"0.6011937",
"0.59749925",
"0.5971161",
"0.59573025",
"0.59524554",
"0.5951487",
"0.5945627",
"0.59430534",
"0.59131587",
"0.5905953",
"0.58981186",
"0.5898062",
"0.58924764",
"0.58879614",
"0.5885954",
"0.58859485",
"0.5877598",
"0.5877433",
"0.5877433",
"0.5877433",
"0.5877433",
"0.5877433",
"0.5877433",
"0.5877433",
"0.58769184",
"0.58769184",
"0.58706963",
"0.58690107",
"0.58587605",
"0.5858188",
"0.58569086",
"0.58565784",
"0.5855047",
"0.58534515",
"0.58487755",
"0.5848545",
"0.58450353",
"0.5841002",
"0.5833647",
"0.58318",
"0.5824727",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823976",
"0.5823433",
"0.58151937",
"0.5804774",
"0.5801738",
"0.57980144",
"0.57976466",
"0.5791226"
] | 0.6744072 | 1 |
PATCH/PUT /data_items/1 PATCH/PUT /data_items/1.json | def update
respond_to do |format|
if @data_item.update(data_item_params)
format.html { redirect_to @data_item, notice: 'Data item was successfully updated.' }
format.json { render :show, status: :ok, location: @data_item }
else
format.html { render :edit }
format.json { render json: @data_item.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: Item.update(params[\"id\"], params[\"item\"])\n end",
"def update\n\n #update the item of request_item\n if (params[:request_item].present?)\n @request_item.item = params[:request_item][:item].present? ? Item.new(name: params[:request_item][:item][:name]) : @request_item.item\n end\n #update all other parameters\n if @request_item.update(request_item_params)\n render json: @request_item\n else\n render json: @request_item.errors, status: :bad_request\n end\n\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update\n\n if @api_v1_item.update(api_v1_item_params)\n render json: @api_v1_item\n else\n render json: @api_v1_item.errors\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def order_items_partial_update_with_http_info(id, data, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: OrderItemsApi.order_items_partial_update ...'\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 OrderItemsApi.order_items_partial_update\"\n end\n # verify the required parameter 'data' is set\n if @api_client.config.client_side_validation && data.nil?\n fail ArgumentError, \"Missing the required parameter 'data' when calling OrderItemsApi.order_items_partial_update\"\n end\n # resource path\n local_var_path = '/order-items/{id}/'.sub('{' + 'id' + '}', CGI.escape(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 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[:body] || @api_client.object_to_http_body(data) \n\n # return_type\n return_type = opts[:return_type] || 'OrderItem' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic', 'Token']\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OrderItemsApi#order_items_partial_update\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update(data, &block)\n request :patch, @data[:id], data, &block\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @request_id = args[:request_id] if args.key?(:request_id)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @request_id = args[:request_id] if args.key?(:request_id)\n end",
"def updateItem(app, repo_url, item, id)\n headers = defaultHeaders(app[\"token\"])\n data = id.merge(item).to_json\n response = HTTParty.post(repo_url,\n headers: headers,\n body: data)\n response \nend",
"def update\n json_response(@food_item.update!(food_item_params))\n end",
"def update\n if @item.update(item_params)\n render json: @item, status: :ok\n else\n render json: @item.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @item.update_attributes(item_params)\n render json: @item, status: :ok\n else\n render_error(@item, :unprocessable_entity)\n end\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def change_multiple_items\n @items = params[:items]\n\n @items.each do |item|\n @current_item = Item.find(item[:id])\n @current_item.update(quantity: item[:quantity])\n end\n\n render :json => @items.to_json\n end",
"def update\n @item = Item.find(params[:id])\n @item.update_attributes(params[:item])\n respond_with @item\n end",
"def update(data = :object || :json)\n end",
"def update\n @item_datum = ItemData.find(params[:id])\n\n respond_to do |format|\n if @item_datum.update_attributes(params[:item_datum])\n format.html { redirect_to @item_datum, notice: 'Item datum was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_item(item_id)\n request_body = {\n 'name' => 'Malted Milkshake'\n }\n\n response = Unirest.put CONNECT_HOST + '/v1/' + LOCATION_ID + '/items/' + item_id,\n headers: REQUEST_HEADERS,\n parameters: request_body.to_json\n\n if response.code == 200\n puts 'Successfully updated item:'\n puts JSON.pretty_generate(response.body)\n return response.body\n else\n puts 'Item update failed'\n puts response.body\n return nil\n end\nend",
"def update\n item = Item.find(params[:id])\n if item.user == current_user\n if item.update(item_params)\n render json: item\n else\n render json: {errors: item.errors}, status: :unprocessable_entity\n end\n else\n render json: {errors: \"you can't do it\"}, status: :unprocessable_entity\n end\n end",
"def update\n Rails.logger.debug params.inspect\n @item = Item.find(params[:id])\n respond_to do |format|\n if @item.update_attributes(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n respond_with(@items)\n end\n end\n end",
"def editing_update(item = nil, **attr)\n rec = edit_record(item)\n file = attr.key?(:file_status) || attr.key?(:file_data)\n data = attr.key?(:data_status) || attr.except(*RECORD_KEYS).present?\n ready = attr.key?(:ready_status) || file || data\n attr[:attr_opt] = { file: file, data: data, ready: ready }\n update_record(rec, **attr, editing: false)\n Hash(\n items: { rec.id => rec.fields.except(*NON_DATA_KEYS) },\n pending: (rec.manifest.pending_items_hash if file || data || ready),\n problems: rec.errors.to_hash,\n )\n end",
"def update\n \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 :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @item = @client.items.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def update\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",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to items_path, 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",
"def update\n respond_to do |format|\n if @apiv1_item.update(apiv1_item_params)\n format.html { redirect_to @apiv1_item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @apiv1_item }\n else\n format.html { render :edit }\n format.json { render json: @apiv1_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(item_attrs = {})\n body = { update: item_attrs }\n Iterable.request(conf, base_path).patch(body)\n end",
"def update\n# @item = Item.get(params[:id])\n\n respond_to do |format|\n if @item.update(params[:item])\n format.html { redirect_to({action: :show, id: @item}, notice: 'Item was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(data, &block)\n request :put, @data[:id], data, &block\n end",
"def update\n @item = @collection.items.get(params[:id])\n @collection.schema.each do |field|\n if params[:item][field.to_s].blank? && !field.is_file\n @item[field.name]=nil\n elsif field.is_file\n #do nothing\n unless params[:item][field.to_s].nil?\n new_file = @file_collection.items.new()\n new_file.file =params[:item][field.to_s]\n new_file.save\n @item[field.name]='{\"project\":{\"id\": \"'+@project.id+'\"}, \"collection\":{\"id\": \"'+@file_collection.id+'\"},\"item\":{\"id\": \"'+new_file.id.to_s+'\", \"display\": \"'+new_file.original_filename+'\"}}'\n end\n else\n @item[field.name] = params[:item][field.to_s]\n end\n end\n if @item.save\n update_associated_fields(@item, @collection, @project)\n respond_to do |format|\n format.html do\n flash[:notice] = \"Item Updated Successfully!\"\n end\n #format.json { render json: @item.to_json, status: :updated}\n format.js { render :js => '$(\"#message\").html(\"<h2>Item updated. Close window and refresh your page.</h2>\").attr(\"class\",\"message notice\"); $(\"html, body\").animate({scrollTop: \"0px\"})' }\n end\n else\n respond_to do |format|\n format.html do\n flash[:error] = [\"Item failed to save! Errors:\", @item.errors.full_messages].flatten.join(' ')\n end\n format.json { render json: @item.to_json, status: :error}\n format.js { render :js => '$(\"#message\").html(\"<h2>Item failed update.</h2>\").attr(\"class\",\"message error\").scrollTop(0); $(\"html, body\").animate({scrollTop: \"0px\"})' }\n end\n end\n redirect_to :back\n end",
"def update\n @item = Item.find(params[:id])\n\n logger.info \"Item: #{@item}\\nw/ param attr: #{params[:item].inspect}\"\n respond_to do |format|\n @item.attributes = params[:item].select{|k,v| ![:item_photos, :item_photos_attributes, :location].include?(k.to_sym) }\n\n @item.load_item_photos_with_params(params[:item] )\n\n if @item.save\n\n @item.set_by_user(auth_user)\n\n logger.info \" C) after save: attr: #{@item.attributes}\"\n\n if manage_item_photos(@item).present? || @item.changed?\n @item.save\n logger.info \" D) attr: #{@item.attributes}\"\n end\n\n format.html {\n redirect_to inventory_approve_item_path(:user_id => \"#{@item.owner.id}\")\n }\n format.json { render json:{ item: @item, success: true} }\n else\n set_flash_messages_from_errors(@item)\n format.html { render action: \"edit\" }\n format.json { render json: { error: @item.errors.first.join(' ') }, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to '/items', 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",
"def order_items_update_with_http_info(id, data, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: OrderItemsApi.order_items_update ...'\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 OrderItemsApi.order_items_update\"\n end\n # verify the required parameter 'data' is set\n if @api_client.config.client_side_validation && data.nil?\n fail ArgumentError, \"Missing the required parameter 'data' when calling OrderItemsApi.order_items_update\"\n end\n # resource path\n local_var_path = '/order-items/{id}/'.sub('{' + 'id' + '}', CGI.escape(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 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[:body] || @api_client.object_to_http_body(data) \n\n # return_type\n return_type = opts[:return_type] || 'OrderItem' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic', 'Token']\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(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OrderItemsApi#order_items_update\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n item = @list.list_items.find(params[:id])\n\n if item.update_attributes(params[:list_item])\n render json: item\n else\n error(t('messages.list_item.errors.update'))\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to lists_path, :notice => 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"def update\n @item = Item.find(params[:id])\n\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 { respond_with_bip(@item) }\n else\n format.html { render action: 'edit' }\n format.json { respond_with_bip(@item) }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\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",
"def update\n respond_to do |format|\n if @item.update(item_params)\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",
"def update\n respond_to do |format|\n if @item.update(item_params)\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",
"def update\n respond_to do |format|\n if @item.update(item_params)\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",
"def update\n respond_to do |format|\n if @item.update(item_params)\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",
"def update\n respond_to do |format|\n if @item.update(item_params)\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",
"def update\n respond_to do |format|\n if @item.update(item_params)\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",
"def update\n respond_to do |format|\n if @item.update(item_params)\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",
"def update\n respond_to do |format|\n if @item.update(item_params)\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",
"def update\n @item = Item.find(params[:id])\n\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 :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n task\n if @item.update(item_params)\n render json: @list.as_json, status: :ok\n else\n render json: {list: @item.errors, status: :unprocessable_entity}\n end\n end",
"def patch(path, data, params = {}, request_options = {})\n request(:patch, path, data, params)\n end",
"def update\n @item.update!(item_params)\n end",
"def update\n @item = Item.find(params[:id])\n\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",
"def update\n @item = Item.find(params[:id])\n\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",
"def update\n @item = Item.find(params[:id])\n\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",
"def update\n @item = Item.find(params[:id])\n\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",
"def update\n @item = Item.find(params[:id])\n\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",
"def update\n @item = Item.find(params[:id])\n\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",
"def update\n @item = Item.find(params[:id])\n\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",
"def update\n @item = Item.find(params[:id])\n\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",
"def update\n @item = Item.find(params[:id])\n\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",
"def update\n @item = Item.find(params[:id])\n\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",
"def update\n @item = Item.find(params[:id])\n\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",
"def update!(**args)\n @errors = args[:errors] if args.key?(:errors)\n @etag = args[:etag] if args.key?(:etag)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update(data, params={})\n send_request @opts[:update_path], params, data\n end",
"def update!(**args)\n @etag = args[:etag] if args.key?(:etag)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n @item = Item.find(params[:id])\n\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 :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\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 :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = \"Item has been updated\"\n format.json { render :json => @item.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { render :action => :edit }\n else\n format.json { render :text => \"Could not update item\", :status => :unprocessable_entity } #placeholder\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n format.html { render :action => :edit, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: t('controller.successfully_updated', model: t('activerecord.models.item')) }\n format.json { head :no_content }\n else\n prepare_options\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def updated(item)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n @status = args[:status] if args.key?(:status)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(item_params)\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",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n respond_to do |format|\n if @operation_item.update(operation_item_params)\n format.html { redirect_to :action => :index, notice: 'Operation item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @operation_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @budget.update(budget_params)\n Item.where([\"budget_id = #{params[:id]}\"]).update_all(budget_id: nil)\n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: params[:id])\n end\n end\n format.html { redirect_to budgets_path, notice: \"Budget was successfully updated.\" }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = @user.items.find(params[:id])\n\n @item.update(:type_list => \"\", :tag_list => \"\")\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to [@user, @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\n\n end",
"def update_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @item_usage.update_attributes(params[:item_usage])\n flash[:notice] = 'ItemUsage was successfully updated.'\n format.html { redirect_to(@item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\r\n @item = Item.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @item.update_attributes(params[:item])\r\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\r\n format.json { head :ok }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @item.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def item_update\n @item = Item.find(params[:id])\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to item_show_path(@item), notice: 'O item foi atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = TodoItem.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:todo_item])\n format.html { redirect_to @item, notice: 'TodoItem was successfully updated.' }\n format.json {render json: {\n success: true,\n data: [],\n message: \"TodoItem was successfully updated.\"\n }}\n else\n format.html { render action: \"edit\" }\n format.json { render json: {\n success: false,\n data: [],\n message: @item.errors\n }}\n end\n end\n end",
"def update\n \n @list_item = ListItem.find(params[:id])\n\n if @list_item.update(list_item_params)\n head :no_content\n else\n render json: @list_item.errors, status: :unprocessable_entity\n end\n end",
"def update\n do_patch { return } # check if patch and do submission and return early if it is a patch (submission)\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = if @resource\n DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user) # update dataset\n else\n DatasetParser.new(hash: params['dataset'], user: @user, id_string: params[:id]) # upsert dataset with identifier\n end\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end",
"def update\n @itemtipo = Itemtipo.find(params[:id])\n\n if @itemtipo.update(itemtipo_params)\n head :no_content\n else\n render json: @itemtipo.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to items_path, notice: 'Item was updated successfully' }\n format.json { render :show, status: :ok, location: items_path }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.694055",
"0.6755574",
"0.6690445",
"0.66534823",
"0.66378695",
"0.6612555",
"0.65406156",
"0.64654404",
"0.6451686",
"0.6451686",
"0.6436183",
"0.64320207",
"0.64165103",
"0.63948464",
"0.6345789",
"0.6326775",
"0.630687",
"0.6281748",
"0.62702966",
"0.62285125",
"0.6197557",
"0.6192071",
"0.6191756",
"0.61794865",
"0.6168789",
"0.61684823",
"0.6139181",
"0.61342937",
"0.61248",
"0.61225647",
"0.61208063",
"0.61128503",
"0.61040837",
"0.6102911",
"0.6100711",
"0.610013",
"0.6088021",
"0.6086349",
"0.60810363",
"0.607967",
"0.60779953",
"0.60779953",
"0.60779953",
"0.60779953",
"0.60779953",
"0.60779953",
"0.60779953",
"0.60779953",
"0.60779953",
"0.6077145",
"0.60757035",
"0.60729283",
"0.6072819",
"0.6070895",
"0.6070895",
"0.6070895",
"0.6070895",
"0.6070895",
"0.6070895",
"0.6070895",
"0.6070895",
"0.6070895",
"0.6070895",
"0.6070895",
"0.6062614",
"0.6058934",
"0.6054547",
"0.6039761",
"0.60389525",
"0.60389525",
"0.6033129",
"0.6024362",
"0.6012962",
"0.60069233",
"0.59982306",
"0.59982306",
"0.59982306",
"0.59982306",
"0.59982306",
"0.59982306",
"0.59982306",
"0.59982306",
"0.59982306",
"0.59982306",
"0.59982306",
"0.59982306",
"0.59982306",
"0.59982264",
"0.5990925",
"0.59842247",
"0.59800535",
"0.5979462",
"0.5978234",
"0.59734255",
"0.59708184",
"0.5967208",
"0.59614515",
"0.5946329",
"0.5942894",
"0.59424704"
] | 0.6610714 | 6 |
DELETE /data_items/1 DELETE /data_items/1.json | def destroy
@data_item.destroy
respond_to do |format|
format.html { redirect_to data_items_url, notice: 'Data item was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n render json: Item.delete(params[\"id\"])\n end",
"def delete_item(item_id)\n response = Unirest.delete CONNECT_HOST + '/v1/' + LOCATION_ID + '/items/' + item_id,\n headers: REQUEST_HEADERS\n\n if response.code == 200\n puts 'Successfully deleted item'\n return response.body\n else\n puts 'Item deletion failed'\n puts response.body\n return nil\n end\nend",
"def delete_item(id)\n record \"/todos/delete_item/#{id}\"\n end",
"def destroy\n @item_datum = ItemData.find(params[:id])\n @item_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to item_datum_url }\n format.json { head :ok }\n end\n end",
"def delete(items)\n item_ids = items.collect { |item| item.id }\n args = {ids: item_ids.to_json}\n return @client.api_helper.command(args, \"item_delete\")\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def delete_item\n item_id = params[\"item_id\"]\n\n item = TextItem.find_by_id(item_id)\n item = Image.find_by_id(item_id) if item.nil?\n item = Collection.find_by_id(item_id) if item.nil?\n render_json :status => :not_found, :messages => \"Could not find the item with id #{item_id}.\" and return if item.nil?\n\n if item.class == Collection\n if params[\"id\"].nil?\n render_json :status => :bad_request, :messages => \"Can't delete a collection reference without providing the parent collection id. Please use the longer url for item deletion.\" and return\n end\n collection = Collection.find_by_id(params[\"id\"])\n else\n collection = Ownership.find_by_item_id(item_id).parent\n end\n;\n render_json :status => :not_found, :messages => \"Could not find parent collection for the item.\" and return if (collection.nil?)\n render_json :status => :forbidden, :messages => \"The user is not allowed to delete from this collection.\" and return if (!collection.delete?(@user, @client))\n\n collection.delete_item(item_id)\n render_json :entry => {} and return\n end",
"def delete_data\n response = WebPay.client.delete([path, 'data'].join('/'))\n response['deleted']\n end",
"def destroy\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n render status: 200, json: @request_item.destroy\n end",
"def delete_item(item)\n @get_items.delete(item)\n end",
"def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def destroy\n# @item = Item.get(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to({action: :index}, notice: 'Item was successfully deleted.') }\n format.json { head :ok }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @apiv1_item.destroy\n respond_to do |format|\n format.html { redirect_to apiv1_items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_item.destroy\n render json: {message: 'deletado com sucesso'}\n end",
"def destroy\n item = @item.name\n @item.deleted = true\n @item.deleted_at = Time.now\n @item.save\n\n respond_to do |format|\n format.html { redirect_to items_url, notice: \"#{item} was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url}\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = @client.items.find(params[:id])\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully removed from Inventory.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end",
"def delete_item\n\nend",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def destroy\n @itemstable = Itemstable.find(params[:id])\n @itemstable.destroy\n\n respond_to do |format|\n format.html { redirect_to itemstables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to '/items', notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n end\n end",
"def delete(path, *data, &block)\n map(path, R3::DELETE, *data, &block)\n end",
"def destroy\n @item = @user.items.find(params[:id])\n @item.destroy\n\n\n respond_to do |format|\n format.html { redirect_to user_items_path(@user) }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\tif Rails.env.production?\n\t\t\tRestClient.patch(\"https://lensshift-drive.firebaseio.com/resources_deleted/#{@resource_item.google_doc_id}.json\", @resource_item.to_json)\n\t\t\tRestClient.delete(\"https://lensshift-drive.firebaseio.com/resources/#{@resource_item.google_doc_id}.json\")\n\t\tend\n\t\t@resource_item.destroy\n\t respond_to do |format|\n\t format.html { redirect_to fellow_resource_items_url, notice: 'Resource item was successfully destroyed.' }\n\t format.json { head :no_content }\n\t end\n\tend",
"def item_destroy\n @item = Item.find(params[:id])\n @item.destroy\n respond_to do |format|\n format.html { redirect_to item_index_path, notice: 'O item foi removido com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n head :no_content\n end",
"def destroy\n @test_item.destroy\n respond_to do |format|\n format.html { redirect_to test_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_item = Admin::Item.find(params[:id])\n @admin_item.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_item = Admin::Item.find(params[:id])\n @admin_item.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_items_url }\n format.json { head :no_content }\n end\n end",
"def deleted(item)\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @sub1_line_item.destroy\n respond_to do |format|\n format.html { redirect_to sub1_line_items_url, notice: 'Sub1 line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item1 = LineItem1.find(params[:id])\n @line_item1.destroy\n\n respond_to do |format|\n format.html { redirect_to line_item1s_url }\n format.json { head :no_content }\n end\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def destroy\n # @item.destroy\n # respond_to do |format|\n # format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end",
"def destroy\n @resource_item.destroy\n respond_to do |format|\n format.html { redirect_to resource_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy#\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"def destroy\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @item ||= Item.find_by_id_or_name(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rackitem = Rackitem.find(params[:id])\n @rackitem.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Rackitem removed' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fooditem = Fooditem.find(params[:id])\n @fooditem.destroy\n\n respond_to do |format|\n format.html { redirect_to fooditems_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: '削除に成功しました。' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice_data_item.destroy\n respond_to do |format|\n format.html { redirect_to invoice_data_items_url, notice: 'Invoice data item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_item(db, item_name, current_user)\r\n db.execute(\"DELETE FROM items WHERE item_name = ? AND user_id = ?\", [item_name, current_user])\r\nend",
"def destroy\n @item_info = ItemInfo.find(params[:id])\n @item_info.destroy\n\n respond_to do |format|\n format.html { redirect_to item_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = current_user.items.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n # format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(path, data = {})\n self.class.delete path, :body => data.merge(:u => access_token)\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_path, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(path, data={})\n request(:delete, path, data)\n end",
"def destroy_rest\n @item_usage = ItemUsage.find(params[:id])\n @item_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_usages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.7269818",
"0.71858126",
"0.71617115",
"0.71258295",
"0.69620955",
"0.6937723",
"0.6899765",
"0.6875788",
"0.6805055",
"0.68046165",
"0.6790078",
"0.6788352",
"0.67852485",
"0.6779539",
"0.6773469",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.6773081",
"0.676779",
"0.67666644",
"0.67666644",
"0.67666644",
"0.67666644",
"0.67666644",
"0.67666644",
"0.67666644",
"0.67666644",
"0.67666644",
"0.67666644",
"0.6759593",
"0.6757327",
"0.67538285",
"0.6744708",
"0.6740149",
"0.6734333",
"0.67074996",
"0.6701619",
"0.67003626",
"0.66927904",
"0.66604066",
"0.6647714",
"0.66383284",
"0.66368955",
"0.66287625",
"0.6625647",
"0.6615321",
"0.66054827",
"0.66010535",
"0.65970576",
"0.65970576",
"0.6582661",
"0.657996",
"0.65768564",
"0.6551838",
"0.65518177",
"0.6550877",
"0.6550571",
"0.6541546",
"0.65388936",
"0.6537937",
"0.65302706",
"0.6525917",
"0.65222484",
"0.65199846",
"0.6519831",
"0.6517338",
"0.65033793",
"0.64993024",
"0.6491301",
"0.64912266",
"0.6486004",
"0.64807874",
"0.6479615",
"0.6478093",
"0.6475159",
"0.6470922",
"0.6470606",
"0.6470606",
"0.6470606",
"0.6470606",
"0.6470606",
"0.6470606",
"0.6470606",
"0.6470606",
"0.6470606",
"0.6470606",
"0.6470606",
"0.6470606"
] | 0.7018578 | 4 |
Use callbacks to share common setup or constraints between actions. | def set_data_item
@data_item = DataItem.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"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",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"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",
"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",
"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",
"def setup_handler\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"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",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"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",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"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",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"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",
"def determine_valid_action\n\n end",
"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",
"def startcompany(action)\n @done = true\n action.setup\n end",
"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",
"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",
"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",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"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",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"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",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"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",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"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",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"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",
"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",
"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",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"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",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"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",
"def before_setup\n # do nothing by default\n end",
"def default_action; end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"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"
] | [
"0.6163927",
"0.6046165",
"0.59465253",
"0.59167755",
"0.58904207",
"0.58346355",
"0.577713",
"0.5703502",
"0.5703502",
"0.56531286",
"0.56215113",
"0.54224145",
"0.5410795",
"0.5410795",
"0.5410795",
"0.53924775",
"0.5379919",
"0.53580743",
"0.53401667",
"0.53397506",
"0.5332605",
"0.5312215",
"0.5296594",
"0.52965283",
"0.52957606",
"0.5259903",
"0.52443177",
"0.523896",
"0.523896",
"0.523896",
"0.523896",
"0.523896",
"0.52329034",
"0.52322394",
"0.5227445",
"0.5222394",
"0.5220348",
"0.5212759",
"0.5207747",
"0.5205933",
"0.5176468",
"0.5173833",
"0.5171983",
"0.51663405",
"0.5159596",
"0.5158247",
"0.51526845",
"0.5152398",
"0.5151361",
"0.5145775",
"0.5140135",
"0.51338995",
"0.51127726",
"0.5112607",
"0.5112607",
"0.5110613",
"0.51067513",
"0.5092337",
"0.508788",
"0.5081578",
"0.5080434",
"0.50679874",
"0.50567716",
"0.5051213",
"0.5048352",
"0.5048352",
"0.5035347",
"0.5026666",
"0.5023127",
"0.5016081",
"0.50129867",
"0.5000684",
"0.4999752",
"0.49979812",
"0.499026",
"0.499026",
"0.49866846",
"0.49800366",
"0.49795717",
"0.49771172",
"0.4968475",
"0.4965813",
"0.4958072",
"0.49561292",
"0.4954901",
"0.49536785",
"0.4953058",
"0.49468648",
"0.49424478",
"0.4932989",
"0.49291888",
"0.49273813",
"0.49271655",
"0.4925948",
"0.49236968",
"0.49203572",
"0.49181753",
"0.49173692",
"0.4916862",
"0.49161318",
"0.49155986"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def data_item_params
params.require(:data_item).permit(:name, :data_class_id, :data_source_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"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",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"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",
"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",
"def valid_params_request?; end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"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",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"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",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"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",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"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",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"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",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"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",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"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",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"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",
"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",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"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",
"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",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"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",
"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",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"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",
"def secure_params\n params.require(:location).permit(:name)\n end",
"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",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"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",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"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",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"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"
] | [
"0.6980384",
"0.6782743",
"0.6746196",
"0.6742575",
"0.6736",
"0.6594004",
"0.65037984",
"0.6496699",
"0.64819324",
"0.64791185",
"0.6456292",
"0.64403296",
"0.63795286",
"0.6375975",
"0.6365291",
"0.63210756",
"0.6300542",
"0.6299717",
"0.62943304",
"0.6292561",
"0.6290683",
"0.6290449",
"0.6282986",
"0.6241265",
"0.62392694",
"0.62192893",
"0.621427",
"0.62099457",
"0.6195319",
"0.61785376",
"0.61747766",
"0.6172739",
"0.6162921",
"0.6152228",
"0.6152062",
"0.6148811",
"0.6122391",
"0.6117956",
"0.61083806",
"0.6106195",
"0.609274",
"0.60815483",
"0.60710186",
"0.6064253",
"0.60213476",
"0.6018128",
"0.60146624",
"0.601063",
"0.60068774",
"0.60068774",
"0.60026145",
"0.6000521",
"0.59987193",
"0.5992379",
"0.59922844",
"0.5991889",
"0.59803206",
"0.5966244",
"0.5959778",
"0.5959708",
"0.59588563",
"0.5956974",
"0.5953329",
"0.59528023",
"0.59439695",
"0.59413165",
"0.59397036",
"0.59397036",
"0.5933782",
"0.59323835",
"0.59258395",
"0.59253365",
"0.5917244",
"0.59111005",
"0.59093463",
"0.5907942",
"0.59047514",
"0.58979666",
"0.58971125",
"0.589613",
"0.5895083",
"0.5893643",
"0.5892825",
"0.5887658",
"0.5883417",
"0.5878839",
"0.5874345",
"0.5869008",
"0.5868205",
"0.58672875",
"0.5867031",
"0.58662426",
"0.5864551",
"0.5863614",
"0.5862626",
"0.5861952",
"0.58596134",
"0.5855716",
"0.58536863",
"0.5851665",
"0.5850823"
] | 0.0 | -1 |
Return the beginning of the shape | def first
@range.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shape_lowest_left_point(shape)\n check_pre((\n shape?(shape)\n ))\n\n if shape.range1d?\n return shape.first\n elsif shape.range2d?\n return shape_lowest_left_point(shape.x_range)\n elsif shape.union1d? or shape.union2d?\n return shape_lowest_left_point(shape.left)\n else\n check_pre(false)\n end\nend",
"def getStartPoint()\n geoObject().firstPoint() ;\n end",
"def start_point\n o = st_start_point\n [o.y, o.x]\n end",
"def starting_position; end",
"def first_offset; end",
"def first_offset; end",
"def start_point\n raise Error::UnsupportedOperation, \"Method Curve#start_point not defined.\"\n end",
"def begin_pos=(_); end",
"def start\n @parts.first.start\n end",
"def get_start(processed_maze)\n # start_horizontal; start_vertical = nil\n processed_maze.each_with_index do |row, vertical_index|\n row.each_with_index do |item, horizontal_index|\n if item == 'o'\n @start_vertical = vertical_index\n @start_horizontal = horizontal_index\n end\n end\n end\n end",
"def start_coords\n marker_coords('S')\n end",
"def line_start(matrix_elements = [0])\n return self if self[matrix_elements[0]] == 0\n beginning = self.dup\n matrix_elements.each { |dimension| beginning[dimension] = 0 }\n beginning\n end",
"def zero_start\n @chr_start - 1\n end",
"def chech_first_corner_edge()\n\t\tposition = 4\n\t\treturn position\n\tend",
"def chech_first_corner_edge()\n\t\tposition = 4\n\t\treturn position\n\tend",
"def starting_location\n generate if @sectors.empty?\n sectors.first\n end",
"def begin_pos; end",
"def start_at(x, y = nil)\n from.coord x, y\n end",
"def first_line_in_view()\n\t\tcoord_to_line_num(contents_y)\n\tend",
"def startpos(nr)\n case @art\n when 0:\n case nr\n when 0:\n return @x/4,@y/2,0\n when 1:\n return 3*@x/4,@y/2,2\n when 2:\n return @x/2,@y/4,1\n when 3:\n return @x/2,3*@y/4,3\n else\n raise \"Für dieses Feld sind nur 4 Positionen definiert!\"\n end\n else\n raise \"Art #{art} ist noch nicht definiert!\"\n end\n end",
"def head\n @positions.last\n end",
"def head\n @positions.last\n end",
"def starting_position=(_arg0); end",
"def head\n return @positions.last\n end",
"def get_start_coordinates\n start = @matrix.select { |k, v| v.type.eql?(Cell::TYPES[:start])}\n raise \"Start case not found\" unless start\n start.keys.first\n end",
"def start_symbol()\n return sets.first.entries[0].vertex.non_terminal\n end",
"def begin(p0) end",
"def locate_head\n snake_matrix.first\n end",
"def lowest_extent(shape)\n lowest = 0\n shape.each do |point|\n if point[1] > lowest\n then lowest = point[1]\n end\n end\n lowest\n end",
"def starting_position\n if n.even?\n Position.new(0,0)\n else\n Position.new(square_root - 1, square_root - 1)\n end\n end",
"def start_angle\n MSPhysics::Newton::Hinge.get_start_angle(@address)\n end",
"def start\n return self.seq_region_start\n end",
"def first\n self.slice(0)\n end",
"def initpos_1\n return [0,0]\n end",
"def start\n @range.start\n end",
"def get_start_p()\n frame_start\n label(:a) do\n puts \"Zadaj pociatocny bod: X(0-#{@width-1}) Y(0-#{@height-1})\"\n begin\n @start_p = convert_s_array_to_i_array(gets.split(\" \"))\n raise(ArgumentError) if @start_p[0] < 0 or @start_p[0] >= @width or @start_p[1] < 0 or @start_p[1] >= @height\n rescue ArgumentError\n puts \"Chybný vstup. Skús znova.\\n\"\n\n # znovu nacitanie vstupu\n goto :a\n end\n end\n frame_end\n end",
"def start_angle\n end",
"def start(begin_offset = 0)\n super\n @on = resolve(@on)\n @origin = resolve(@origin)\n @base = @origin\n @end = resolve(@end)\n @delta = resolve(@end) - @origin + 1\n @end, @origin = @origin, @end if @end < @origin\n @factor = resolve(@factor)\n end",
"def start; @sequence[0]; end",
"def x_offset; end",
"def set_left_start_point\n @leading_x = 0\n @leading_y = find_left_entry\n end",
"def start_of_line\n self.cursor = 0\n end",
"def origin\n Position.new(0,0)\n end",
"def pos() end",
"def pos() end",
"def pos() end",
"def pos() end",
"def start_line\n attributes.fetch(:startLine)\n end",
"def before_origin(point, axis)\n point.dot(axis) <= 0\n end",
"def first_line; end",
"def first_line; end",
"def first_line; end",
"def first_line; end",
"def first_line; end",
"def first_line; end",
"def first_line; end",
"def first_line; end",
"def first_line; end",
"def first_line; end",
"def first_axis_index(index, coordinate_system=:row_col)\n case coordinate_system\n when :row_col\n (index / 9)\n when :col_row\n index % 9\n when :box\n (index / 27) * 3 + (index / 3) % 3\n end\n end",
"def range_start; range.first; end",
"def start(begin_offset = 0)\n super\n @on = resolve(@on)\n @origin_x = resolve(@origin_x)\n @origin_y = resolve(@origin_y)\n @delta_x = resolve(@end_x) - @origin_x\n @delta_y = resolve(@end_y) - @origin_y\n end",
"def start(begin_offset = 0)\n super\n @on = resolve(@on)\n @origin_x = resolve(@origin_x)\n @origin_y = resolve(@origin_y)\n @delta_x = resolve(@end_x) - @origin_x\n @delta_y = resolve(@end_y) - @origin_y\n end",
"def begin\n @ranges.size == 1 ? @ranges[0].begin : nil\n end",
"def get_start_position(floor_array) \r\n floor_array.index(\"*\") \r\nend",
"def head\n if @head.nil?\n nil\n else\n at_index(0)\n end\n end",
"def span_start=(_); end",
"def node_first\n @head\n end",
"def whats_in_front\n @array[0]\n end",
"def rows\n shape[0]\n end",
"def next_starting_position\n\t\tpos = @starting_positions[@pos_idx]\n\t\t@pos_idx = (@pos_idx + 1) % @starting_positions.length\n\t\tpos\n\tend",
"def remove_shape\n\t\t@shapes.delete_at(0)\n\tend",
"def array_start\n []\n end",
"def reset\n self.x, self.y, self.o = self.sequence.first\n end",
"def left\n Point.new(@x - 1, @y)\n end",
"def left\n Point.new(@x - 1, @y)\n end",
"def position\n first.position\n end",
"def midleft; return self[0], self.centery; end",
"def start\n @start ||= operands.detect {|op| op.is_a?(Start)}\n end",
"def home\n pen_up\n self.xy = ORIGIN\n self.heading = 0.0\n end",
"def start_at(x, y = nil)\n @anchor.start_at x, y\n @anchor.from\n end",
"def min_x\n @pos.x\n end",
"def start\n start = []\n self.children.each { |c| \n start.push(c.start) unless c.start.nil?\n start.push(c.end) unless c.end.nil?\n }\n start.sort.first\n end",
"def accessor_start(node); end",
"def position; end",
"def position; end",
"def position; end",
"def position; end",
"def position; end",
"def position; end",
"def position; end",
"def position; end",
"def range_start\n @character_range[0]\n end",
"def begin_line kind\n end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end"
] | [
"0.67880446",
"0.65469706",
"0.64268476",
"0.6409094",
"0.632319",
"0.632319",
"0.6167918",
"0.6119286",
"0.61112297",
"0.60929847",
"0.6032626",
"0.5998835",
"0.59533006",
"0.59425807",
"0.59425807",
"0.5931039",
"0.5919909",
"0.59024453",
"0.5901155",
"0.58757156",
"0.5844898",
"0.5844898",
"0.58436036",
"0.5814287",
"0.5738927",
"0.5734361",
"0.5715528",
"0.5697071",
"0.56801057",
"0.5665993",
"0.5650109",
"0.56400377",
"0.563757",
"0.56366175",
"0.56110865",
"0.56088275",
"0.558782",
"0.5585464",
"0.5579611",
"0.55588245",
"0.55430603",
"0.55385673",
"0.5538183",
"0.55329597",
"0.55329597",
"0.55329597",
"0.55329597",
"0.5493586",
"0.54932564",
"0.54774225",
"0.54774225",
"0.54774225",
"0.54774225",
"0.54774225",
"0.54774225",
"0.54774225",
"0.54774225",
"0.54774225",
"0.54774225",
"0.5475166",
"0.54744023",
"0.5469192",
"0.5469192",
"0.5463084",
"0.5462961",
"0.54485875",
"0.54452485",
"0.5441197",
"0.5435891",
"0.5435596",
"0.5428604",
"0.5409376",
"0.53942126",
"0.5389753",
"0.5380257",
"0.5380257",
"0.5375781",
"0.53753906",
"0.53705394",
"0.53632534",
"0.53616005",
"0.535257",
"0.53499496",
"0.5348164",
"0.5343421",
"0.5343421",
"0.5343421",
"0.5343421",
"0.5343421",
"0.5343421",
"0.5343421",
"0.5343421",
"0.5343279",
"0.5340922",
"0.5338478",
"0.5338478",
"0.5338478",
"0.5338478",
"0.5338478",
"0.5338478"
] | 0.5488898 | 49 |
Return the end of the shape | def last
@range.last
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def y_end\n y_end_dependencies = [calculated_height, default_y?, !default_y? && y]\n if y_end_dependencies != @y_end_dependencies\n # avoid recalculation of dependencies\n calculated_height, is_default_y, y = @y_end_dependencies = y_end_dependencies\n shape_height = calculated_height.to_f\n shape_y = is_default_y ? 0 : y.to_f\n @y_end = shape_y + shape_height\n end\n @y_end\n end",
"def end; self.begin + self.size - 1; end",
"def getEndPoint()\n geoObject().lastPoint() ;\n end",
"def end\n empty? ? 0 : last.end\n end",
"def endRow; @row + @height - 1; end",
"def end_point\n raise Error::UnsupportedOperation, \"Method Curve#end_point not defined.\"\n end",
"def end_row\n strict_position.end_row\n end",
"def x_end\n x_end_dependencies = [calculated_width, default_x?, !default_x? && x]\n if x_end_dependencies != @x_end_dependencies\n # avoid recalculation of dependencies\n calculated_width, is_default_x, x = @x_end_dependencies = x_end_dependencies\n shape_width = calculated_width.to_f\n shape_x = is_default_x ? 0 : x.to_f\n @x_end = shape_x + shape_width\n end\n @x_end\n end",
"def nontrivial_end_line\n if successor\n successor.line_numbers.begin - 1\n else\n @document.last_non_empty_line\n end\n end",
"def last\n self[*Array.new(self.dim, -1)]\n end",
"def end\n regions.max.end\n end",
"def last\n self.get_geometry_n(self.num_geometries - 1) if self.num_geometries > 0\n end",
"def last\n self.get_geometry_n(self.num_geometries - 1) if self.num_geometries > 0\n end",
"def end_pos; end",
"def end_pos; end",
"def end\n attributes.fetch(:end)\n end",
"def last\n at(-1)\n end",
"def end_at(x, y = nil)\n to.coord x, y\n end",
"def end_pos=(_); end",
"def tail\n \t@array[-1]\n end",
"def tail\n node_at(size - 1)\n end",
"def get_last\n return @position\n end",
"def last_point\n path_points.last\n end",
"def end\n @range.end\n end",
"def last\n @tail\n end",
"def last_i\n size - 1\n end",
"def last_line_in_view()\n\t\tcoord_to_line_num(contents_y + height)\n\tend",
"def end\n @ranges.size == 1 ? @ranges[0].end : nil\n end",
"def set_end\n if @orientation == 0\n @rowEnd = @rowStart\n @colEnd = @colStart + @length\n elsif @orientation == 1\n @rowEnd = @rowStart + @length\n @colEnd = @colStart\n end\n end",
"def end\n j_instance.getEnd\n end",
"def lastof(arr)\n return arr[arr.length - 1]\nend",
"def bottom_right\n @position + @dimensions\n end",
"def second_last\n return nil if (size-2) < 0\n self[size-2]\n end",
"def end_line\n attributes.fetch(:endLine)\n end",
"def last_of(array)\n return array[-1]\nend",
"def last_specified_position\n tree.dimensions.length.downto(1) do |index|\n return index - 1 if conditions[tree.dimensions[index - 1]] != '*'\n end\n\n return -1\n end",
"def realLast\n\t\tdc = (@first.col - @last.col).abs\n\t\tdr = (@first.row - @last.row).abs\n\t\tif dc < dr # then the selection vertical\n\t\t\treturn @cells[@last.row][@first.col]\n\t\telse # the selection is horizontal\n\t\t\treturn @cells[@first.row][@last.col]\n\t\tend\n\tend",
"def bottom!\n self.ox = self.width/2\n self.oy = self.height\n end",
"def last_row\n @data.length - 1\n end",
"def tail\n @values[1..-1]\n end",
"def zero_end\n @chr_end\n end",
"def end_line kind\n end",
"def last_of(arr)\n return arr[-1]\nend",
"def last_of(arr)\n return arr[arr.length-1]\nend",
"def last\n self.slice(self.size - 1)\n end",
"def other_end(vertex)\n if self.vertices[0] == vertex\n self.vertices[1]\n else\n self.vertices[0]\n end\n end",
"def last_of(array)\n return array[array.length - 1]\nend",
"def last_of(array)\n return array[array.length - 1]\nend",
"def lastElement\n return @stk[@count]\n end",
"def last\n self[-1]\n end",
"def last\r\n self[-1]\r\n end",
"def last() end",
"def size\n shape[0] > 1 ? shape[0] : shape[1]\n end",
"def last_of(arr)\n output = arr[-1]\n return output\nend",
"def end_of_word; end",
"def last?\n self.index == (self.array.length - 1)\n end",
"def bottom\n @ole.Bottom\n end",
"def bottom\n @ole.Bottom\n end",
"def last\n left = @left_generator.last\n right = @right_generator.last\n\n if right.nil?\n left\n else\n right\n end\n end",
"def endCol; @col + @width - 1; end",
"def last(array)\n array[-1]\nend",
"def last\n all[all.size - 1]\n end",
"def last\n self[-1]\n end",
"def end(p0) end",
"def last?\n index == size - 1\n end",
"def last?\n index == size - 1\n end",
"def peek_last\n raise 'No such element' if @size == 0\n @tail.value\n end",
"def last\n @tail.val\n end",
"def cursor_end\n blen = @buffer.rstrip.length\n if blen < @width\n set_form_col blen\n else\n # there is a problem here FIXME. \n @pcol = blen-@width\n #set_form_col @width-1\n set_form_col blen\n end\n @curpos = blen # this is position in array where editing or motion is to happen regardless of what you see\n # regardless of pcol (panning)\n # $log.debug \" crusor END cp:#{@curpos} pcol:#{@pcol} b.l:#{@buffer.length} d_l:#{@width} fc:#{@form.col}\"\n #set_form_col @buffer.length\n end",
"def end_character\n attributes.fetch(:endCharacter)\n end",
"def range_end\n @character_range[1]\n end",
"def bottom\n self.ox = self.src_rect.width/2\n self.oy = self.src_rect.height\n end",
"def head\n return @positions.last\n end",
"def square_to_defend(marker)\r\n WINNING_LINES.each do |line|\r\n index_to_defend = find_blocking_square(@squares.values_at(*line), marker)\r\n return line[index_to_defend] if index_to_defend\r\n end\r\n nil\r\n end",
"def last_row\n row( maxrow )\n end",
"def end_node\n if !tss.empty?\n return self\n else\n return snd.first.end_node\n end\nend",
"def stop\n return self.seq_region_end\n end",
"def last(n=nil)\n return self[-1] if n.nil?\n \n start = length-n\n start = 0 if start < 0\n self[start, n]\n end",
"def last_of(arr)\n index = arr.length\n return arr[index -1]\nend",
"def ends\n ends = []\n vertices.each { |x| ends << x if x.neighbors.empty? }\n ends\n end",
"def last_element(array)\n array[-1]\nend",
"def length\n @end - @start + 1\n end",
"def ending_period\n start_period = self.period\n length = self.length\n return nil if start_period.nil?\n return start_period if length.nil? or length <= 1\n return start_period.find_following(length).last\n end",
"def end_of_word?\n @end_of_word\n end",
"def last\n @rarray.reverse.first \n end",
"def bottom\n @x_max\n end",
"def cursor_end\n blen = @buffer.rstrip.length\n if blen < @width\n set_col_offset blen\n else\n @pcol = blen-@width\n #set_form_col @width-1\n set_col_offset blen\n end\n @curpos = blen # this is position in array where editing or motion is to happen regardless of what you see\n # regardless of pcol (panning)\n end",
"def last_line; end",
"def last_line; end",
"def last_line; end",
"def last_line; end",
"def last_line; end",
"def last_line; end",
"def last_line; end",
"def lastElement(arr)\n return arr[arr.length - 1]\nend",
"def head\n @positions.last\n end",
"def head\n @positions.last\n end",
"def find_end_points\r\n vec = @wall.endpt - @wall.origin\r\n case @obj.justify\r\n when \"left\"\r\n # do nothing\r\n when \"center\"\r\n @offset -= @obj.width/2\r\n when \"right\"\r\n @offset -= @obj.width\r\n else\r\n UI.messagebox \"invalid justification\"\r\n end\r\n \r\n # make sure we have not extended beyond the end of the wall\r\n if ((@offset + @obj.width) > @wall.length - MIN_WALL)\r\n @offset = @wall.length - @obj.width - MIN_WALL\r\n end\r\n \r\n # make sure we have not extended beyond the beginning of the wall\r\n if (@offset <= MIN_WALL)\r\n vec.length = MIN_WALL\r\n @start_pt = @wall.origin + vec\r\n else\r\n vec.length = @offset\r\n @start_pt = @wall.origin + vec\r\n end\r\n vec.length = @obj.width\r\n @end_pt = @start_pt + vec\r\nend",
"def bottom\n return @bottom\n end",
"def end_of_line\n self.cursor = :end\n end"
] | [
"0.6816561",
"0.6777623",
"0.6483366",
"0.6433626",
"0.6347916",
"0.63038546",
"0.62767774",
"0.6275276",
"0.62249285",
"0.61872923",
"0.6144535",
"0.61403805",
"0.61403805",
"0.61074334",
"0.61074334",
"0.6072441",
"0.60670936",
"0.6049944",
"0.60099554",
"0.6002715",
"0.5976773",
"0.597608",
"0.5972024",
"0.5922436",
"0.59078115",
"0.5890776",
"0.5886574",
"0.58821416",
"0.5853914",
"0.58441526",
"0.5840248",
"0.5833583",
"0.582596",
"0.5824116",
"0.58125496",
"0.5804",
"0.5787515",
"0.57689744",
"0.5767521",
"0.5749813",
"0.57472974",
"0.5737592",
"0.5736586",
"0.57273394",
"0.5704568",
"0.5701312",
"0.5701023",
"0.5701023",
"0.5690904",
"0.5687627",
"0.5678293",
"0.5672043",
"0.56668735",
"0.5666581",
"0.56641835",
"0.56565255",
"0.56512326",
"0.56512326",
"0.5647574",
"0.5644496",
"0.5643475",
"0.5635731",
"0.56343895",
"0.56311995",
"0.5627268",
"0.5627268",
"0.56214577",
"0.5619116",
"0.5617808",
"0.5607423",
"0.5600843",
"0.55992556",
"0.55976176",
"0.5593636",
"0.5592268",
"0.55892855",
"0.558797",
"0.5586646",
"0.55808026",
"0.55781657",
"0.55523556",
"0.5542408",
"0.5537935",
"0.5531413",
"0.5522193",
"0.5522186",
"0.5512878",
"0.55019414",
"0.55019414",
"0.55019414",
"0.55019414",
"0.55019414",
"0.55019414",
"0.55019414",
"0.5483675",
"0.54751796",
"0.54751796",
"0.5474682",
"0.54606426",
"0.5456691"
] | 0.57270813 | 44 |
Return the size of the shape | def size
@range.size
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size\n shape[0] > 1 ? shape[0] : shape[1]\n end",
"def shape_count\n\t\treturn @shapes.length\n\tend",
"def length\n grid_shape.length\n end",
"def size(shape)\n shape = [shape,shape] unless shape.is_a?(Array)\n (0...shape.size).inject(1) { |x,i| x * shape[i] }\n end",
"def get_width()\n Shape.api_not_implemented(self)\n end",
"def size\n (@x2-@x1)*(@y2-@y1)\n end",
"def size\n NMatrix.size(self.shape)\n end",
"def size\n @vertices.length\n end",
"def size\n\t\t@w * @h\n\tend",
"def dimensions\n self.coords.count\n end",
"def size\n width * height\n end",
"def size\n @size.size\n end",
"def size\n self.points.count\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n SizableLocation.new(location).size\n end",
"def size\n end",
"def size\n end",
"def size\n\n end",
"def size\n @axis_object.size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n end",
"def size\n [width, height]\n end",
"def size\n [width, height]\n end",
"def size\n @size ||= raster_size\n end",
"def length\n @dim\n end",
"def size\n @points.size\n end",
"def size\n @size\n end",
"def size\n num_geometries\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n length\n end",
"def size\n\tend",
"def size\n @length / 4\n end",
"def size; @size end",
"def size\n return instance_get(:size)\n end",
"def size\n @size\n end",
"def size\n return @size\n end",
"def size\n return @size\n end",
"def size\n return @size\n end",
"def size\n return @size\n end",
"def size\n @size \n end",
"def size\n @size \n end",
"def length\n size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n raise NotImplementedError\n end",
"def size\n\t\t@graph.size\n\tend",
"def size\n\n\n end",
"def size\nend",
"def size\n @structure.size\n end",
"def length\n size\n end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end"
] | [
"0.86689067",
"0.7864447",
"0.7726246",
"0.77138525",
"0.7670339",
"0.7522366",
"0.74911857",
"0.74640006",
"0.73924553",
"0.7375954",
"0.73192847",
"0.72641647",
"0.7232112",
"0.7202787",
"0.7202787",
"0.7202787",
"0.71853995",
"0.7174909",
"0.7174909",
"0.71597326",
"0.71593004",
"0.71453065",
"0.71453065",
"0.71453065",
"0.7142973",
"0.71423894",
"0.71423894",
"0.71410465",
"0.7116284",
"0.7114476",
"0.7111796",
"0.709577",
"0.7079851",
"0.7079851",
"0.7079851",
"0.7079851",
"0.7079851",
"0.7079851",
"0.7079851",
"0.7053683",
"0.7043764",
"0.70418674",
"0.7041718",
"0.7012287",
"0.70037955",
"0.6992487",
"0.6992487",
"0.6990532",
"0.6990532",
"0.69895273",
"0.69895273",
"0.6980563",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.6977584",
"0.69757175",
"0.69737303",
"0.6972242",
"0.69680244",
"0.696484",
"0.6942727",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846",
"0.6941846"
] | 0.0 | -1 |
Add method readers for members | def method_missing(m, *arg, &block)
return @members[m] if @members && @members[m]
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_reader_tags(klass, new_method, member); end",
"def add_reader_tags(klass, new_method, member)\n member_tag = member_tag_for_member(klass, member, :read)\n return_type = return_type_from_tag(member_tag)\n getter_doc_text = member_tag ? member_tag.text : \"Returns the value of attribute #{member}\"\n new_method.docstring.replace(getter_doc_text)\n new_method.add_tag YARD::Tags::Tag.new(:return, \"the current value of #{member}\", return_type)\n end",
"def create_reader(klass, member)\n new_meth = register MethodObject.new(klass, member, :instance) do |o|\n o.signature ||= \"def #{member}\"\n o.source ||= \"#{o.signature}\\n @#{member}\\nend\"\n end\n add_reader_tags(klass, new_meth, member)\n klass.attributes[:instance][member][:read] = new_meth\n end",
"def create_reader(klass, member); end",
"def define_reader_method(mod)\n reader_method_name = name\n attribute = self\n\n mod.send(:define_method, reader_method_name) { attribute.get(self) }\n mod.send(reader_visibility, reader_method_name)\n\n self\n end",
"def define_reader_method(mod)\n mod.define_reader_method(self, name, @reader_visibility)\n self\n end",
"def method_missing(method, *args)\n return @reader.send(method, *args) if @reader.respond_to? method\n super\n end",
"def metaattr_reader(*meths)\n metaclass.instance_eval{attr_reader(*meths)}\n end",
"def key_reader *keys\n keys.each do |method|\n key = method.to_s\n define_method method do\n self[key]\n end\n end\n end",
"def make_readers!(fields, prefix = '_')\n fields.each do |key,field|\n self.define_singleton_method(\"#{prefix}#{key}\".to_sym) { fields[key] }\n end\n end",
"def members(*) end",
"def private_attr_reader(*method_names)\n attr_reader(*method_names)\n private(*method_names)\n end",
"def read_methods #:nodoc:\n @read_methods ||= Set.new\n end",
"def define_reader_method(attribute, method_name, visibility)\n define_method(method_name) { attribute.get(self) }\n send(visibility, method_name)\n self\n end",
"def attr_reader(*)\n end",
"def needs(*methods)\n parent_readers.push(*methods).uniq!\n end",
"def methods() end",
"def attr_reader(*fields)\n check_fields(fields)\n added_fields = jiak.data.readable(*fields)\n added_fields.each do |field|\n class_eval <<-EOM\n def #{field}\n @jiak.object.data.#{field}\n end\n EOM\n end\n nil\n end",
"def add_writer_tags(klass, new_method, member); end",
"def define_delegate_readers\n # Create delegate methods for polymorphic attributes/methods\n all_polymorph_readers.each do |attr|\n class_eval <<-END_EVAL\n def #{attr.to_s}\n return polymorph.#{attr.to_s}\n end\n END_EVAL\n end\n end",
"def attr_reader(sym, *more) end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def delegate_object_reader_method; end",
"def read_members(member_paths, options={})\n member_paths.map{|f| read_member(f, options) }\n end",
"def key_attr_reader(key)\n define_method key do\n self[key]\n end\n end",
"def method_missing(symbol, *args, &block)\n load_members\n if @member_class.instance_methods.include? symbol.to_s\n @members.inject([]) { |a, x| a << x.send(symbol) }.flatten\n else\n @members.send(symbol, *args, &block)\n end\n end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def define_methods_for(field)\n generic_reader(field)\n case field.type\n when Symbol\n send(\"#{field.type}_writer\", field)\n when String\n typed_writer(field)\n end\n end",
"def define_read_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}; read_attribute('#{attr_name}'); end\" \n end",
"def define_readers(attr_names)\n attr_names.each do |attr_name|\n if respond_to?(attr_name)\n if self.class.is_an_association?(attr_name)\n # lazy instantiate associated records\n association_writer = method(\"#{attr_name}=\")\n association_reader = method(attr_name)\n define_singleton_method(attr_name) do\n association_writer.(attributes[attr_name])\n association_reader.()\n end\n else\n raise \"Cannot define accessor: #{attr_name}\"\n end\n else\n define_singleton_method(attr_name) do\n attributes[attr_name]\n end\n end\n end\n end",
"def readers\n keys = self.class.cookie_index\n Module.new do\n keys.each_pair do |method_name, key|\n define_method method_name do\n @cookie[key]\n end\n end\n end\n end",
"def attr_reader(*attrs)\n attrs.each do |attr|\n define_attribute_method(attr)\n define_predicate_method(attr)\n end\n end",
"def read_member(member_path, options={})\n raise NotImplementedError\n end",
"def add_reader(arg)\n chg_permission(readers, arg, :add)\n end",
"def define_attr_reader(name)\n define_method(name) do\n instance_variable_get(\"@#{name}\")\n end\n end",
"def define_read_methods\n self.class.columns_hash.each do |name, column|\n unless respond_to_without_attributes?(name)\n define_read_method(name.to_sym, name, column)\n end\n\n unless respond_to_without_attributes?(\"#{name}?\")\n define_question_method(name)\n end\n end\n end",
"def mattr_reader( *syms )\n syms.flatten.each do |sym|\n module_eval(<<-EOS, __FILE__, __LINE__)\n unless defined? @@#{sym}\n @@#{sym} = nil\n end\n\n def self.#{sym}\n @@#{sym}\n end\n\n def #{sym}\n @@#{sym}\n end\n EOS\n end\n return syms\n end",
"def getters; end",
"def create_accessors(name, meth, options = {})\n field = fields[name]\n create_field_getter(name, meth, field)\n create_field_setter(name, meth, field)\n end",
"def attr_reader?(name)\n (instance_methods | private_instance_methods).include?(name)\n end",
"def create_accessors(name, meth, options = {})\n field = fields[name]\n generated_field_methods.module_eval do\n if field.cast_on_read?\n define_method(meth) do\n field.get(read_attribute(name))\n end\n else\n define_method(meth) do\n read_attribute(name)\n end\n end\n define_method(\"#{meth}=\") do |value|\n write_attribute(name, value)\n end\n define_method(\"#{meth}?\") do\n attr = read_attribute(name)\n (options[:type] == Boolean) ? attr == true : attr.present?\n end\n end\n end",
"def my_attr_reader(*args)\n\targs.each do |a|\n\t\tself.class_eval do\n\t\t\tinstance_variable_set \"@#{a}\", nil\n\t\t\tdefine_method a do\n\t\t\t\tinstance_variable_get \"@#{a}\"\n\t\t\tend\n\t\tend\n\tend\nend",
"def sig_attr_reader(*attr_names, &block)\n if !block\n attr_reader *attr_names\n else\n p = lambda { () >> block.call }\n attr_names.each do |a|\n HasType.set_last_proc(self, p)\n attr_reader a\n end\n end\n end",
"def readonly(*syms)\nreturn if syms.size == 0 # If no arguments, do nothing\ncode = \"\"\n# Start with an empty string of code\n# Generate a string of Ruby code to define attribute reader methods.\n# Notice how the symbol is interpolated into the string of code.\nsyms.each do |s|\n# For each symbol\ncode << \"def #{s}; @#{s}; end\\n\"\n# The method definition\nend\n# Finally, class_eval the generated code to create instance method\nclass_eval code\nend",
"def create_reader\n reader_name = name.to_s\n\n return if source_model.resource_method_defined?(reader_name)\n\n source_model.class_eval <<-RUBY, __FILE__, __LINE__ + 1\n #{reader_visibility} # public\n def #{reader_name}(query = nil) # def author(query = nil)\n relationships[#{name.inspect}].get(self, query) # relationships[:author].get(self, query)\n end # end\n RUBY\n end",
"def create_member_method?(klass, member, type = :read)\n return true if (klass.tags(:attr) + klass.tags(:attr_reader) + klass.tags(:attr_writer)).empty?\n return true if member_tag_for_member(klass, member, type)\n return !member_tag_for_member(klass, member, :write) if type == :read\n !member_tag_for_member(klass, member, :read)\n end",
"def accessors\n self.class.accessors\n end",
"def add_methods(item)\n item.meths(inherited: false).each do |meth|\n next if @hide_private && meth.visibility == :private\n count_method\n\n # If the method is an alias, skip it so we don't define it as a\n # separate method.\n if meth.is_alias?\n next\n end\n\n # If the method is an attribute, it'll be handled by add_attributes\n if meth.is_attribute?\n next\n end\n\n # If the method has YARD's \"@overload\" tags, the information of the\n # first one is merged into meth object\n # NOTE: This code does not handle the second and subsequent @overload tags\n if meth.tag(\"overload\")\n meth.parameters = meth.tag(\"overload\").parameters\n meth.tag(\"overload\").tags.each { |tag| meth.add_tag(tag) }\n meth.docstring += meth.tag(\"overload\").docstring\n end\n \n # Sort parameters\n meth.parameters.reverse.sort! { |pair1, pair2| sort_params(pair1, pair2) }\n\n # This is better than iterating over YARD's \"@param\" tags directly\n # because it includes parameters without documentation\n # (The gsubs allow for better splat-argument compatibility)\n parameter_names_and_defaults_to_tags = meth.parameters.map do |name, default|\n [[name, fix_default_if_unary_minus(default)], method_tags(meth, 'param')\n .find { |p| p.name&.gsub('*', '')&.gsub(':', '') == name.gsub('*', '').gsub(':', '') }]\n end.to_h\n\n # Add block param if there is no named param but YARD tags are present\n if !parameter_names_and_defaults_to_tags.any? { |((name, _), _)| name.start_with? '&' } \\\n && (method_tags(meth, 'yieldparam').any? || method_tag(meth, 'yieldreturn'))\n parameter_names_and_defaults_to_tags[['&blk']] = nil\n end\n\n parameter_types = parameter_names_and_defaults_to_tags.map do |name_and_default, tag|\n name = name_and_default.first\n\n if tag\n TypeConverter.yard_to_parlour(tag.types, meth, @type_converter_config)\n elsif name.start_with? '&'\n # Find yieldparams and yieldreturn\n yieldparams = method_tags(meth, 'yieldparam')\n yieldreturn = method_tag(meth, 'yieldreturn')&.types\n yieldreturn = nil if yieldreturn&.length == 1 &&\n yieldreturn&.first&.downcase == 'void'\n\n # Create strings\n params = yieldparams.map.with_index do |param, i|\n Parlour::Types::Proc::Parameter.new(\n param.name&.gsub('*', '') || \"arg#{i}\",\n TypeConverter.yard_to_parlour(param.types, meth, @type_converter_config)\n )\n end\n returns = TypeConverter.yard_to_parlour(yieldreturn, meth, @type_converter_config)\n\n # Create proc types, if possible\n if yieldparams.empty? && yieldreturn.nil?\n Parlour::Types::Untyped.new\n else\n Parlour::Types::Proc.new(params, yieldreturn.nil? ? nil : returns)\n end\n elsif meth.path.end_with? '='\n # Look for the matching getter method\n getter_path = meth.path[0...-1]\n getter = item.meths.find { |m| m.path == getter_path }\n\n unless getter\n if parameter_names_and_defaults_to_tags.length == 1 \\\n && method_tags(meth, 'param').length == 1 \\\n && method_tag(meth, 'param').types\n\n Logging.infer(\"argument name in single @param inferred as #{parameter_names_and_defaults_to_tags.first.first.first.inspect}\", meth)\n next TypeConverter.yard_to_parlour(method_tag(meth, 'param').types, meth, @type_converter_config)\n else\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", meth)\n next Parlour::Types::Untyped.new\n end\n end\n\n return_types = method_tags(getter, 'return').flat_map(&:types)\n unless return_types.any?\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", meth)\n next Parlour::Types::Untyped.new\n end\n inferred_type = TypeConverter.yard_to_parlour(\n return_types, meth, @type_converter_config)\n\n Logging.infer(\"inferred type of parameter #{name.inspect} as #{inferred_type.describe} using getter's return type\", meth)\n inferred_type\n else\n # Is this the only argument, and was a @param specified without an\n # argument name? If so, infer it\n if parameter_names_and_defaults_to_tags.length == 1 \\\n && method_tags(meth, 'param').length == 1 \\\n && method_tag(meth, 'param').types\n\n Logging.infer(\"argument name in single @param inferred as #{parameter_names_and_defaults_to_tags.first.first.first.inspect}\", meth)\n TypeConverter.yard_to_parlour(method_tag(meth, 'param').types, meth, @type_converter_config)\n else\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", meth)\n Parlour::Types::Untyped.new\n end\n end\n end\n\n return_tags = method_tags(meth, 'return')\n returns = if meth.name == :initialize && !@use_original_initialize_return\n nil\n elsif return_tags.length == 0\n Logging.omit(\"no YARD return type given, using untyped\", meth)\n Parlour::Types::Untyped.new\n elsif return_tags.length == 1 && %w{void nil}.include?(return_tags&.first&.types&.first&.downcase)\n nil\n else\n TypeConverter.yard_to_parlour(method_tag(meth, 'return').types, meth, @type_converter_config)\n end\n\n rbs_block = nil\n parlour_params = parameter_names_and_defaults_to_tags\n .zip(parameter_types)\n .map do |((name, default), _), type|\n # If the default is \"nil\" but the type is not nilable, then it\n # should become nilable\n # (T.untyped can include nil, so don't alter that)\n type = Parlour::Types::Nilable.new(type) \\\n if default == 'nil' && !type.is_a?(Parlour::Types::Nilable) && !type.is_a?(Parlour::Types::Untyped)\n\n case @mode\n when :rbi\n Parlour::RbiGenerator::Parameter.new(\n name.to_s,\n type: type,\n default: default\n )\n when :rbs\n if name.start_with?('&')\n rbs_block = type\n nil\n else\n Parlour::RbsGenerator::Parameter.new(\n name.to_s,\n type: type,\n required: default.nil?\n )\n end\n end\n end\n .compact\n\n if @exclude_untyped && parlour_params.all? { |p| p.type.is_a?(Parlour::Types::Untyped) } && returns.is_a?(Parlour::Types::Untyped)\n Logging.omit(\"excluding untyped\", meth, immediate: true)\n next\n end\n\n case @mode\n when :rbi\n @current_object.create_method(\n meth.name.to_s,\n parameters: parlour_params,\n returns: returns,\n class_method: meth.scope == :class\n ) do |m|\n add_comments(meth, m)\n end\n when :rbs\n @current_object.create_method(\n meth.name.to_s,\n [Parlour::RbsGenerator::MethodSignature.new(\n parlour_params, returns, block: rbs_block && !rbs_block.is_a?(Parlour::Types::Untyped) \\\n ? Parlour::RbsGenerator::Block.new(rbs_block, false)\n : nil\n )],\n class_method: meth.scope == :class\n ) do |m|\n add_comments(meth, m)\n end\n end\n end\n end",
"def define_read_method(symbol, attr_name, column)\n cast_code = column.type_cast_code('v') if column\n access_code = cast_code ? \"(v=@attributes['#{attr_name}']) && #{cast_code}\" : \"@attributes['#{attr_name}']\"\n\n unless attr_name.to_s == self.class.primary_key.to_s\n access_code = access_code.insert(0, \"raise NoMethodError, 'missing attribute: #{attr_name}', caller unless @attributes.has_key?('#{attr_name}'); \")\n self.class.read_methods << attr_name\n end\n\n evaluate_read_method attr_name, \"def #{symbol}; #{access_code}; end\"\n end",
"def define_accessor_methods(mod)\n define_reader_method(mod)\n define_writer_method(mod)\n self\n end",
"def inherited_reader(*attributes)\r\n attributes.each do |attribute|\r\n line = __LINE__ + 1\r\n class_eval %Q{\r\n def raw_#{attribute} # def raw_css_dir\r\n @#{attribute} # @css_dir\r\n end # end\r\n def #{attribute}_without_default # def css_dir_without_default\r\n read_without_default(#{attribute.inspect}) # read_without_default(:css_dir)\r\n end # end\r\n def #{attribute} # def css_dir\r\n read(#{attribute.inspect}) # read(:css_dir)\r\n end # end\r\n }, __FILE__, line\r\n end\r\n end",
"def parsed_methods\n parsed_include(:method)\n end",
"def define_reader_for_role(rolekey)\n attr_reader rolekey\n private rolekey\n end",
"def custom_reader(key); end",
"def attr_reader(name)\n meth = Rubinius::AccessVariable.get_ivar name\n @method_table.store name, meth, :public\n Rubinius::VM.reset_method_cache name\n nil\n end",
"def attr_accessor_sybling(method)\n attr_reader?(method) ? to_attr_writer(method) : to_attr_reader(method)\n end",
"def helper_methods\n members - PREDICATE_FIELDS + PREDICATE_FIELDS.map { |f| \"#{f}?\".to_sym }\n end",
"def create_model_design_doc_reader\n model.instance_eval \"def #{method}; @#{method}; end\"\n end",
"def dataset_reader(*attributes)\n attributes.flatten.each do |attr_name|\n next if method_defined?(attr_name)\n\n class_eval <<-RUBY, __FILE__, __LINE__ + 1\n def #{attr_name}\n dataset_get(:#{attr_name})\n end\n RUBY\n end\n end",
"def add_accessors(name, opts)\n name_equals = (name.to_s + \"=\").to_sym\n\n self.send(:define_method,name_equals) do |arg|\n attribute_set(name, arg)\n end\n self.send(:define_method,name) do \n attribute_get(name)\n end\n\n end",
"def define_attribute_methods(attrs, access_level)\n self.attribute_method_module.module_eval do\n attrs.each do |attr|\n # Normalize for attributes without types\n attr_name = Array.wrap(attr).first\n # Define reader and huh methods\n self.module_eval <<-EOE, __FILE__, __LINE__ + 1\n def #{attr_name}\n read_attribute(:#{attr_name})\n end\n\n def #{attr_name}?\n read_attribute(:#{attr_name}).present?\n end\n EOE\n # Define a writer if this is public\n if access_level == :public\n self.module_eval <<-EOE, __FILE__, __LINE__ + 1\n def #{attr_name}=(new_val)\n write_attribute(:#{attr_name}, new_val)\n end\n EOE\n end\n end\n end\n\n # Now we get all the attribute names as symbols\n # and define_attribute_methods for dirty tracking\n attrs = attrs.collect do |a|\n Array.wrap(a).first.to_sym\n end\n\n super(attrs)\n true\n end",
"def inject_acl_object_getter_setter(method_name)\n inject_acl_object_check(method_name, :read)\n inject_acl_object_check(\"#{method_name}=\",:write)\n end",
"def member_names; end",
"def create_reader\n return if source_model.resource_method_defined?(name.to_s)\n\n source_model.class_eval <<-RUBY, __FILE__, __LINE__ + 1\n def #{name}(query = nil) # def paragraphs(query = nil)\n relationships[#{name.inspect}].get(self, query) # relationships[:paragraphs].get(self, query)\n end # end\n RUBY\n end",
"def methods\n delegated_instance_methods + old_methods\n end",
"def methods\n delegated_instance_methods + old_methods\n end",
"def field_accessors(name)\n field_reader(name)\n attr_writer(name)\n end",
"def add_attr_reader(attr_name, column_type)\n=begin\n\t\t\t\t\tif column_type == :text then\n\t\t\t\t\t\tdefine_method(\"#{attr_name}\") do\n\t\t\t\t\t\t\tvalue = read_attribute(attr_name.to_s)\n\t\t\t\t\t\t\t# if the value de-serialized is false, it means a \"\"\n\t\t\t\t\t\t\tif value == false || value == 0 then\n\t\t\t\t\t\t\t\tvalue = \"\"\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n=end\n\t\t\t\tend",
"def readers\n raise Locomotive::Mounter::ImplementationIsMissingException.new('readers are missing')\n end",
"def singleton_attr_reader( *names )\n\n singleton_class.instance_eval { attr_reader *names }\n \n return self\n\n end",
"def member\n super\n end",
"def member\n super\n end",
"def member; end",
"def member; end",
"def member; end",
"def member; end",
"def member; end",
"def members\n self.class.members\n end",
"def create_getter!\n @target.class_eval <<-EOS\n #{reader_visibility.to_s}\n def #{name}\n attribute_get(#{name.inspect})\n end\n EOS\n \n if type == TrueClass\n @target.class_eval <<-EOS\n #{reader_visibility.to_s}\n def #{name.to_s.ensure_ends_with('?')}\n attribute_get(#{name.inspect})\n end\n EOS\n end\n rescue SyntaxError\n raise SyntaxError.new(column)\n end",
"def add_attr_accessors_to_self\n instance_variables.each do |name|\n method_name = name[1..-1].to_sym\n MetricFu::Configuration.send(:attr_accessor, method_name)\n end\n end",
"def rewrite_members members\n (fspath + '.members').open('w') {|f| members.each {|m| f.puts(m)}}\n return\n end",
"def add_attr_accessors(p_attributes, p_type = :both)\n p_type.to_h.assert_valid_keys(:read, :write, :both) #validate type\n\n #loop through the accessors to be added\n Array(p_attributes).flatten.each do |k|\n\n #lets set the write reader if needed\n if [:read, :both].include?(p_type) && !self.respond_to?(k.to_s) #is there already one defined\n self.class.send(:define_method, k.to_sym) do #lets create one as requested\n instance_variable_get('@' + k.to_s) # equivalent of an attr_reader is created here\n end\n end\n\n # Lets set the write accessor if needed\n if [:write, :both].include?(p_type) && !self.respond_to?(\"#{k.to_s}=\") #is there already one defined\n self.class.send(:define_method, \"#{k}=\".to_sym) do |value| #lets create one as requested\n instance_variable_set(\"@\" + k.to_s, value) # equivalent of an attr_writer is created here\n end\n end\n\n end # end p_attributes..do\n self #all done return self\n end",
"def create_getter(name, meth)\n define_method(meth) do\n read_attribute(name)\n end\n end",
"def set_up_readers can_walk\n\t\t@walk = can_walk\n\tend",
"def add_reader(obj, *args)\n if obj.is_a? Class\n @readers << obj.new(*args, callback)\n elsif obj.kind_of? Pants::Readers::BaseReader\n @readers << obj\n else\n raise Pants::Error, \"Don't know how to add a reader of type #{obj}\"\n end\n\n @convenience_block.call(@readers.last) if @convenience_block\n\n @readers.last\n end",
"def inheriting_cattr_reader(*names)\n receiver =\n if self.class == Module\n self\n else\n singleton_class\n end\n\n names_with_defaults = (names.pop if names.last.is_a?(Hash)) || {}\n\n (names + names_with_defaults.keys).each do |name|\n ivar_name = \"@#{name}\"\n block = names_with_defaults[name]\n\n receiver.send(:define_method, name) do\n if instance_variable_defined? ivar_name\n instance_variable_get(ivar_name)\n else\n superclass.respond_to?(name) && superclass.send(name) ||\n block && begin\n result = block.is_a?(Proc) ? block.call(self) : block\n instance_variable_set(ivar_name, result) if result\n end\n end\n end\n end\n end",
"def methods=(_arg0); end",
"def getter_method_names; end",
"def runnable_methods; end",
"def runnable_methods; end",
"def create_getter\n @model.class_eval <<-EOS, __FILE__, __LINE__\n #{reader_visibility}\n def #{@getter}\n self[#{name.inspect}]\n end\n EOS\n end"
] | [
"0.76274425",
"0.7350206",
"0.7028912",
"0.6969812",
"0.68382114",
"0.6684393",
"0.66162676",
"0.64602625",
"0.63911843",
"0.6338285",
"0.6327019",
"0.6314934",
"0.6304813",
"0.6235577",
"0.6219303",
"0.6113826",
"0.6091826",
"0.60864615",
"0.60807836",
"0.60737973",
"0.59811115",
"0.59736156",
"0.59736156",
"0.59736156",
"0.59736156",
"0.59736156",
"0.59736156",
"0.59736156",
"0.5928545",
"0.59266895",
"0.5911603",
"0.58993345",
"0.58953154",
"0.58953154",
"0.58953154",
"0.58953154",
"0.58791053",
"0.5872168",
"0.5841845",
"0.5835741",
"0.5799681",
"0.5750964",
"0.5743404",
"0.5730236",
"0.567706",
"0.565164",
"0.56123316",
"0.55864406",
"0.5583701",
"0.557222",
"0.5550805",
"0.5529589",
"0.5516639",
"0.5507251",
"0.5506144",
"0.5501914",
"0.5489652",
"0.5482504",
"0.54778874",
"0.5467149",
"0.5455773",
"0.54436886",
"0.5433814",
"0.54300374",
"0.5415254",
"0.54070777",
"0.54068327",
"0.53992164",
"0.5397267",
"0.5387122",
"0.53836155",
"0.5381562",
"0.5375841",
"0.5374844",
"0.5374844",
"0.5372341",
"0.537209",
"0.5364187",
"0.5343283",
"0.5334682",
"0.5334682",
"0.53339297",
"0.53339297",
"0.53339297",
"0.53339297",
"0.53339297",
"0.532176",
"0.5319465",
"0.53192365",
"0.5313388",
"0.5312301",
"0.53034365",
"0.52958673",
"0.52925044",
"0.52909374",
"0.52873194",
"0.52865356",
"0.52858067",
"0.52858067",
"0.5274975"
] | 0.56935984 | 44 |
Specify the size of the underlying type | def type_size=(sz)
t = eval "Int#{sz}"
raise "unsupported enum size #{sz}" unless t
@type = t
return sz
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type_size\n @type.size\n end",
"def size\n @type.size\n end",
"def size(size)\n @value[:size] = size\n self\n end",
"def size=(size)\n end",
"def size #:nodoc:\n 1\n end",
"def size #:nodoc:\n 1\n end",
"def size=(value)\n @size = value\n end",
"def size=(value)\n @size = value\n end",
"def my_size\n 1\n end",
"def size=(size)\n instance_set(:size, size)\n end",
"def size; @size end",
"def interpret_size(size); end",
"def size\n raise NotImplementedError.new\n end",
"def size\n raise NotImplementedError\n end",
"def size(*) end",
"def size(*) end",
"def record_size(s)\n @size = s\n end",
"def size(new_size = nil)\n new_size.nil? ? @size : @size = new_size\n end",
"def set_type_size(sz, signed = false)\n tname = \"#{signed ? \"\" : \"U\"}Int#{sz}\"\n t = eval tname\n raise \"unsupported bitfield type #{tname}\" unless t\n @type = t\n @signed = signed\n return sz\n end",
"def initialize(type, size)\n @type = type\n @size = size\n end",
"def size\n raise NotImplementedError\n end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size\n super\n end",
"def size\n super\n end",
"def size= length\n #This is a stub, used for indexing\n end",
"def size\n self[:size]\n end",
"def add_size( size )\n\n @size << size\n\n end",
"def add_size( size )\n\n @size << size\n\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def add_size (size)\n @size << size\n end",
"def size=(_); end",
"def size=(_); end",
"def size\n @size \n end",
"def size\n @size \n end",
"def to_size\n self\n end",
"def size\n if self.class.const_defined?(:BYTESIZE)\n self.class.const_get(:BYTESIZE)\n else\n raise NotImplementedError.new(\"#{self.class}#size\")\n end\n end",
"def size=(arg)\n @view__.size = arg.is_a?(Vector) ? arg.getInternal__ : arg\n arg\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size size = nil\n @size = size.to_i if size\n @size\n end",
"def specific_max_size(number); end",
"def size\n end",
"def size\n end",
"def size\n 4\n end",
"def size\n\n self.to_h.size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size!\n @size = nil\n self.size\n end",
"def set_Size(value)\n set_input(\"Size\", value)\n end",
"def size\n @size\n end",
"def size\n @size\n end"
] | [
"0.71337533",
"0.7121552",
"0.7009567",
"0.6971352",
"0.6910903",
"0.6910903",
"0.6780521",
"0.6780521",
"0.67725265",
"0.6764291",
"0.6749171",
"0.67126745",
"0.67017245",
"0.6658731",
"0.6657285",
"0.6657285",
"0.6653677",
"0.662732",
"0.6607625",
"0.66043025",
"0.6562318",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65593857",
"0.65534997",
"0.65534997",
"0.653372",
"0.65051174",
"0.6456882",
"0.6456882",
"0.64378655",
"0.64378655",
"0.64378655",
"0.6429789",
"0.64155567",
"0.64155567",
"0.64065826",
"0.64065826",
"0.63869035",
"0.63791233",
"0.6352158",
"0.63475835",
"0.63475835",
"0.63475835",
"0.63475835",
"0.63475835",
"0.63475835",
"0.63475835",
"0.6325205",
"0.6324785",
"0.63219523",
"0.63219523",
"0.63141364",
"0.631292",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.63045824",
"0.62987775",
"0.62952894",
"0.6293617",
"0.6293617"
] | 0.67347133 | 11 |
Get the underlying type size in bits | def type_size
@type.size
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size\n (@bit_length*@length*@count)/8.0\n end",
"def size\n @type.size\n end",
"def sizeof(type)\n size_ptr = Pointer.new(:ulong_long)\n align_ptr = Pointer.new(:ulong_long)\n NSGetSizeAndAlignment(type, size_ptr, align_ptr)\n size_ptr[0]\n end",
"def raw_num_bytes\n @type.num_bytes\n end",
"def size\n BitCounter.count(@val)\n end",
"def byte_size()\n @value.length * 4\n end",
"def byte_size()\n @value.length * 4\n end",
"def size\n if self.class.const_defined?(:BYTESIZE)\n self.class.const_get(:BYTESIZE)\n else\n raise NotImplementedError.new(\"#{self.class}#size\")\n end\n end",
"def bit_set_size\n @bit_set.size\n end",
"def size_in_byte\n return @size_in_byte\n end",
"def byte_size()\n if @record and RECORD_INFO[@record.type].size > 0 then\n RECORD_INFO[@record.type].size * @value.length\n else\n sum = 0\n @value.each do |val|\n sum += (val.length % 2 == 0) ? val.length : val.length + 1\n end\n sum\n end\n end",
"def bit_length\n @bit_length ||= ECDSA.bit_length(field.prime)\n end",
"def size\r\n @pack.size\r\n end",
"def bLength\n self[:bLength]\n end",
"def get_length_size\n return false if @data.empty?\n\n # High bits used for length type\n # Low bits used as first bits of length\n \n # 0xxxxxxx = 7 bit length\n # 10xxxxxx = 14 bit length\n # 110xxxxx = 21 bit length\n # 1110xxxx = 28 bit length\n # 11110000 = 32 bit length follows\n\n t = @data.unpack('C').first\n\n return 7 if t & 0b10000000 == 0\n return 14 if t & 0b01000000 == 0\n return 21 if t & 0b00100000 == 0\n return 28 if t & 0b00010000 == 0\n return 32 if t == 0b11110000\n\n raise ArgumentError, \"Invalid length type encoding\"\n end",
"def sizeof_type(type)\n if is_pointer_type?(type)\n return pointer_size\n end\n\n if type.kind_of? String\n if is_array_type?(type)\n element_type, length = split_array_type(type)\n return length * sizeof_type(element_type)\n else\n return sizeof_type(type.to_sym)\n end\n end\n\n if is_struct_type?(type)\n return sizeof_struct(type)\n end\n\n if TYPE_DEFINITIONS.has_key?(type)\n primitive = TYPE_DEFINITIONS[type]\n\n if primitive == :pointer\n return pointer_size\n end\n\n if PRIMITIVE_TYPE_SIZES.has_key?(primitive)\n return PRIMITIVE_TYPE_SIZES[primitive]\n else\n raise \"Type #{type} was mapped to non-existent primitive #{primitive}\"\n end\n end\n\n raise \"Unable to determine size for type #{type}.\"\n end",
"def size64_high\n @ole.Size64High\n end",
"def size\n\n clib.tcmaprnum(pointer_or_raise)\n end",
"def type_size=(sz)\n t = eval \"Int#{sz}\"\n raise \"unsupported enum size #{sz}\" unless t\n @type = t\n return sz\n end",
"def size\n\n self.to_h.size\n end",
"def size\n @structure.size\n end",
"def header_size\n TYPE_SIZE\n end",
"def size #:nodoc:\n 1\n end",
"def size #:nodoc:\n 1\n end",
"def short_binary_type; end",
"def getBits(binary)\n length = binary[0].length\n return length\n end",
"def size\n return instance_get(:size)\n end",
"def set_type_size(sz, signed = false)\n tname = \"#{signed ? \"\" : \"U\"}Int#{sz}\"\n t = eval tname\n raise \"unsupported bitfield type #{tname}\" unless t\n @type = t\n @signed = signed\n return sz\n end",
"def size\n\n clib.tclistnum(@pointer)\n end",
"def determine_bit_depth\n case size\n when 1..2 then 1\n when 3..4 then 2\n when 5..16 then 4\n when 17..256 then 8\n end\n end",
"def size_of(val)\n case val \n when (val == 'long' )\n return(4)\n when (val == 'longlong' )\n return(8)\n when (val == 'char' )\n return(1)\n when (val == 'double' )\n return(8)\n when (val == 'float' )\n return(4)\n when (val == 'int' )\n return(4)\n when (val == 'short' )\n return(2)\n else\n return(1)\n end\nend",
"def size\n\t\t@db.llen @type\n\tend",
"def fbe_size\n 8\n end",
"def fbe_size\n 8\n end",
"def fbe_size\n 8\n end",
"def fbe_size\n 8\n end",
"def bit_length\n (negative? ? -self : self + ONE).log2.ceil\n end",
"def size_in_bytes\n to_i description['SizeInBytes']\n end",
"def size\n Float::MAX.to_i\n end",
"def d_size\n uint64(header, 'size') / @blockSize\n end",
"def sizeof_struct(struct)\n offsets = struct_offsets(struct, 0)\n last_data_size = sizeof_type(struct.last[1])\n size_no_padding = offsets.last + last_data_size\n\n return size_no_padding + calc_padding(size_no_padding)\n end",
"def num_types\n return @num_types unless @num_types.nil?\n @num_types = ((num_types_m1 + 1) % 65536)\n @num_types\n end",
"def size\n @size.size\n end",
"def getSize() \n @obj.getSize()\n end",
"def pointer_size\n is_64bit ? 8 : 4\n end",
"def get_size\n\t\tend",
"def wBytesPerInterval\n self[:wBytesPerInterval]\n end",
"def header_size\n FFI::Type::ULONG.size + FFI::Type::USHORT.size + FFI::Type::USHORT.size\n end",
"def size\n @data.bytesize\n end",
"def size\n @info[:size]\n end",
"def length\n @bin_data.length\n end",
"def bytesize_of(member)\n self::MEMBERS_HASH[member].size\n end",
"def fbe_size\n 4\n end",
"def fbe_size\n 4\n end",
"def fbe_size\n 4\n end",
"def fbe_size\n 4\n end",
"def fbe_size\n 4\n end",
"def fbe_size\n 4\n end",
"def fbe_size\n 4\n end",
"def fbe_size\n 4\n end",
"def fbe_size\n 4\n end",
"def fbe_size\n 4\n end",
"def exact_size(reg_or_val, _options = {})\n if real_reg?(reg_or_val) # if real register\n size = reg_or_val.size # use register size\n else\n size = reg_or_val.to_s(2).size # get number of bits in value\n end\n size\n end",
"def get_size\n\t\treturn @size\n\tend",
"def size\n @size \n end",
"def size\n @size \n end",
"def size_of attr\n @ref.size_of TRANSLATOR.cocoaify attr\n end",
"def byte_size(); @data.byte_size + 4; end",
"def size64_low\n @ole.Size64Low\n end",
"def size\n self[:size]\n end",
"def to_size\n self\n end",
"def size_in_bytes\n @grpc.size_bytes\n end",
"def sz\n self.to_s.size\n end",
"def raw_size\n valid_blobs.map(&:raw_size).sum\n end",
"def size\n return @size\n end",
"def size\n return @size\n end",
"def num_bytes\n return @num_bytes\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n 4\n end",
"def win_size\n @binhdr[14, 2].unpack(\"n\").pop\n end",
"def d_size\n @desc[:size].to_i\n end",
"def length_in_long_words\n return @bits.attr_length\n end",
"def length\n pack.length\n end",
"def size\n @info.size\n end",
"def size\n @info.size\n end",
"def size\n @info.size\n end",
"def size\n @gapi[\"size\"]\n end",
"def size_in_bytes\n ( file_length * 16 ) / 8\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end",
"def size\n @size\n end"
] | [
"0.7705189",
"0.7467742",
"0.7450963",
"0.7417675",
"0.734754",
"0.70911944",
"0.70911944",
"0.7063093",
"0.70573896",
"0.68974715",
"0.6862758",
"0.6853569",
"0.67551893",
"0.66868585",
"0.6642069",
"0.6633071",
"0.660719",
"0.6605012",
"0.657718",
"0.6556635",
"0.65282625",
"0.65013146",
"0.649749",
"0.649749",
"0.64924526",
"0.6450709",
"0.6434521",
"0.64323753",
"0.6424624",
"0.642229",
"0.6407413",
"0.64072615",
"0.63815886",
"0.63815886",
"0.63815886",
"0.63815886",
"0.6375501",
"0.6373283",
"0.63504565",
"0.63306624",
"0.6309421",
"0.6307914",
"0.6293427",
"0.62902284",
"0.62894464",
"0.627544",
"0.6275097",
"0.6247242",
"0.6246932",
"0.6235153",
"0.6227051",
"0.6222307",
"0.62124383",
"0.62124383",
"0.62124383",
"0.62124383",
"0.62124383",
"0.62124383",
"0.62124383",
"0.62124383",
"0.62124383",
"0.62124383",
"0.6187197",
"0.6184729",
"0.61796576",
"0.61796576",
"0.61687905",
"0.6166689",
"0.61627567",
"0.61470544",
"0.6146338",
"0.614424",
"0.6139449",
"0.6118346",
"0.6116454",
"0.6116454",
"0.60881674",
"0.60870016",
"0.60870016",
"0.60870016",
"0.607578",
"0.60720754",
"0.6064878",
"0.6060627",
"0.6056496",
"0.6051562",
"0.6051562",
"0.6051562",
"0.6050707",
"0.6036484",
"0.60271096",
"0.60271096",
"0.60271096",
"0.60271096",
"0.60271096",
"0.60271096",
"0.60271096",
"0.60271096",
"0.60271096",
"0.60271096"
] | 0.7743193 | 0 |
Set the size and signedness of the underlying type | def set_type_size(sz, signed = false)
tname = "#{signed ? "" : "U"}Int#{sz}"
t = eval tname
raise "unsupported bitfield type #{tname}" unless t
@type = t
@signed = signed
return sz
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type_size=(sz)\n t = eval \"Int#{sz}\"\n raise \"unsupported enum size #{sz}\" unless t\n @type = t\n return sz\n end",
"def initialize\n @type = LENGTH\n @value = UNSET\n @value_list = [SHORT, LONG].freeze\n end",
"def size=(size)\n instance_set(:size, size)\n end",
"def size=(size)\n end",
"def size(size)\n @value[:size] = size\n self\n end",
"def set_size!(size) \n @transforms << SIZES[size]\n self \n end",
"def set_integer!(value)\n @objects = nil\n @memory = nil\n\n if value < 0\n self[:type] = :negative_integer\n self[:values][:i64] = value\n else\n self[:type] = :positive_integer\n self[:values][:u64] = value\n end\n end",
"def set_size(nwords)\n newbits = Array.typed(::Java::Long).new(nwords) { 0 }\n n = Math.min(nwords, @bits.attr_length)\n System.arraycopy(@bits, 0, newbits, 0, n)\n @bits = newbits\n end",
"def attr_set_ub8(attr_type, attr_value)\n #This is a stub, used for indexing\n end",
"def size=(size)\n self.width = self.height = @size = size\n end",
"def size=(value)\n @size = value\n end",
"def size=(value)\n @size = value\n end",
"def adjust(type)\n case type\n when :Byte, :byte, :b, :B\n primitive_max = 2**7 - 1\n primitive_min = -2**7\n when :Short, :short, :s, :S\n primitive_max = 2**15 - 1\n primitive_min = -2**15\n when :Integer, :Int, :int, :i, :I\n primitive_max = 2**31 - 1\n primitive_min = -2**31\n when :Long, :long, :l, :L\n primitive_max = 2**63 - 1\n primitive_min = -2**63\n when :Nibble, :nibble, :n, :N\n primitive_max = 2**4 - 1\n primitive_min = -2**4\n else\n primitive_max = 2**31 - 1\n primitive_min = -2**31\n end\n self < -primitive_max ? -1 * (-self & primitive_max) : self\n self > primitive_min ? (self & primitive_max) : self\n end",
"def type=(new_type)\n self[:type_flags] = (flags | TYPES[new_type])\n end",
"def size=(size)\n check_is_a!(size, Integer)\n check_gt!(size, 0)\n @attributes[:Size] = size\n end",
"def initialize(type, size)\n @type = type\n @size = size\n end",
"def set_binary_mode size=nil\n set_text_mode size\n end",
"def short_binary_type; end",
"def set_size\n self.size = attachment.size if attachment.size\n end",
"def size=(arg)\n @view__.size = arg.is_a?(Vector) ? arg.getInternal__ : arg\n arg\n end",
"def attr_set_integer(attr_type, number)\n #This is a stub, used for indexing\n end",
"def setSize _obj, _args\n \"_obj setSize _args;\" \n end",
"def size=(size)\n throw ArgumentError.new('new size is negative') if size.negative?\n size -= data.size\n if size.positive?\n @data += '\\0' * size\n elsif size.negative?\n @data = @data[0...size]\n end\n @data.size\n end",
"def attr_set_binary(attr_type, attr_value)\n #This is a stub, used for indexing\n end",
"def value=(val)\n if(val.nil?)\n self[:length] = 0\n self[:value] = val\n elsif(val.is_a?(String))\n buff = FFI::MemoryPointer.from_string(val)\n self[:length] = val.length\n self[:value] = buff\n elsif(val.is_a?(Fixnum))\n buff = FFI::MemoryPointer.new :OM_uint32\n buff.write_int val\n self[:length] = FFI::type_size :OM_uint32\n self[:value] = buff\n else\n raise StandardError, \"Can't handle type #{val.class.name}\"\n end\n end",
"def attr_set_sb8(attr_type, attr_value)\n #This is a stub, used for indexing\n end",
"def st_type=(type)\n header.st_info = (header.st_info & (~0xf)) | (type.to_i & 0xf)\n end",
"def record_size(s)\n @size = s\n end",
"def initialize(size)\n @bits = 0\n @size = size\n end",
"def size= (x)\n change_options({\"size\" => x})\n end",
"def size=(*values)\n values = values[0] if values.size == 1 && values[0].is_a?(Array)\n @peer.set_size_styles(values[0], values[1])\n end",
"def type=(val)\n if (val.kind_of?(Integer))\n @type = val & 0xff\n elsif(val.kind_of?(String))\n raise ArgumentError, \"Value should be 1-byte, but was #{val.length}.\" if (val.length != 1) \n @type = val.unpack('C')[0]\n else\n raise ArgumentError, \"Expected String or Integer, but #{val.class} provided.\" \n end\n end",
"def setType _obj, _args\n \"_obj setType _args;\" \n end",
"def resize(typemap)\n typemap = typemap.map_key do |type, size|\n validate_type_argument(type)\n end\n each_type_topological do |t|\n min_size = t.apply_resize(typemap)\n explicit_size = typemap[t]\n if min_size && explicit_size && explicit_size < min_size\n raise InvalidSizeSpecifiedError, \"#{explicit_size} specified as new size for #{t}, but this type has to be at least of size #{min_size}\"\n end\n if explicit_size\n t.size = explicit_size\n elsif min_size\n t.size = min_size\n end\n typemap[t] = t.size\n end\n end",
"def resize_type(type, to_size)\n resize(type => to_size)\n end",
"def size=(size)\n @size = size\n resize\n end",
"def set_type\n end",
"def size=(size)\n validator = EnumAttributeValidator.new('String', [\"8.75x3.75\"])\n unless validator.valid?(size)\n fail ArgumentError, \"invalid value for \\\"size\\\", must be one of #{validator.allowable_values}.\"\n end\n @size = size\n end",
"def size!\n @size = nil\n self.size\n end",
"def is_signed=(value)\n @is_signed = value\n end",
"def set_Size(value)\n set_input(\"Size\", value)\n end",
"def interpret_size(size); end",
"def attr_set_ub1(attr_type, attr_value)\n #This is a stub, used for indexing\n end",
"def set_sizeofcmds(size)\n fmt = (endianness == :little) ? \"L<\" : \"L>\"\n new_size = [size].pack(fmt)\n @raw_data[20..23] = new_size\n end",
"def add_size (size)\n @size << size\n end",
"def add_size( size )\n\n @size << size\n\n end",
"def add_size( size )\n\n @size << size\n\n end",
"def size(new_size = nil)\n new_size.nil? ? @size : @size = new_size\n end",
"def type= new_type\n frozen_check!\n @gapi.type = new_type\n end",
"def type= new_type\n frozen_check!\n @gapi.type = new_type\n end",
"def size=(width, height)\n end",
"def compute_pack_code(size: self.size, integer: self.integer?, unsigned: self.unsigned?)\n if integer\n INTEGER_PACK_CODES[[size, unsigned, ModelKit::Types.big_endian?]]\n else\n FLOAT_PACK_CODES[[size, ModelKit::Types.big_endian?]]\n end\n end",
"def small=(value)\n @small = value\n end",
"def setLightFlareSize _obj, _args\n \"_obj setLightFlareSize _args;\" \n end",
"def size size = nil\n @size = size.to_i if size\n @size\n end",
"def setMarkerSizeLocal _obj, _args\n \"_obj setMarkerSizeLocal _args;\" \n end",
"def normalize_size_to(integer)\n until size >= integer\n unshift 0\n end\n self\n end",
"def scale!(type, size)\n @transforms << \"#{SCALE_TYPES[type]}#{size}\"\n self\n end",
"def attr_set_ub4(attr_type, attr_value)\n #This is a stub, used for indexing\n end",
"def small\n @request[:size] = 'small'\n self\n end",
"def type=(type)\n @type = type\n @signed = type.name.split('::').last[0] != \"U\"\n type\n end",
"def set_logical_flags_from(actual_value, size)\n\t\t@flags.set_bit_at(OVERFLOW_FLAG, 0)\n\t\t@flags.set_bit_at(CARRY_FLAG, 0)\n\t\tset_zero_flag_from actual_value\n\t\tset_sign_flag_from actual_value, size - 1\n\t\tset_parity_flag_from actual_value, size\n\tend",
"def initialize(value)\n if value.is_a?(self.class)\n @value = value.value\n return\n end\n\n unless value.bson_int32?\n raise RangeError.new(\"#{value} cannot be stored in 32 bits\")\n end\n @value = value.freeze\n end",
"def []=(x, v)\n old_size = size\n super(x, v)\n expand(old_size, size - 2) if size - old_size > 1\n end",
"def signed; end",
"def mark_signed!\n @signed = true\n end",
"def size=(size)\n validator = EnumAttributeValidator.new('String', ['Full', 'Half', 'Quarter'])\n unless validator.valid?(size)\n fail ArgumentError, 'invalid value for \"size\", must be one of #{validator.allowable_values}.'\n end\n @size = size\n end",
"def update!(**args)\n @size = args[:size] if args.key?(:size)\n @type = args[:type] if args.key?(:type)\n end",
"def type=(type); end",
"def initialize(size)\n @data = 0\n @size = size\n end",
"def set_kind(kind)\n\t\tend",
"def size\n @type.size\n end",
"def size=(size)\n dif = size - @size\n dif < 0 ? @weights.pop(-dif) : @weights.push(Array.new(dif, 0)).flatten!\n dif < 0 ? @inputs.pop(-dif) : @inputs.push(Array.new(dif, 0)).flatten!\n @size = size\n end",
"def type_size\n @type.size\n end",
"def size\n super\n end",
"def size\n super\n end",
"def set_type(v)\n self.type = v\n self\n end",
"def set_SizeClass(value)\n set_input(\"SizeClass\", value)\n end",
"def set_SizeClass(value)\n set_input(\"SizeClass\", value)\n end",
"def build\n type.size ||= current_size\n registry.register(type)\n end",
"def add_size!\n input_html_options[:size] ||= nil\n end",
"def o_type\n 8 \n end",
"def setSize(szX,szY,scale,centerp=FALSE)\n @device.setSize(szX,szY,scale,centerp) ;\n end",
"def setMarkerSize _obj, _args\n \"_obj setMarkerSize _args;\" \n end",
"def status=(status)\n instance_set(:size, status)\n end",
"def size #:nodoc:\n 1\n end",
"def size #:nodoc:\n 1\n end",
"def mutate!(type)\n set_type(type)\n end",
"def add_option(size, value)\n struct = PacketWriter.TypeValueStruct.new 1, 1\n struct.type = size\n struct.value = value\n struct.length = value.length + 2\n self.options << struct.encode\n end",
"def set_unsigned_short(pos=nil,s=nil)\n if pos.class == Fixnum && s.class == Fixnum && !block_given?\n @j_del.java_method(:setUnsignedShort, [Java::int.java_class,Java::int.java_class]).call(pos,s)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling set_unsigned_short(pos,s)\"\n end",
"def size=(size)\n if !size.nil? && size.to_s.length > 20\n fail ArgumentError, 'invalid value for \"size\", the character length must be smaller than or equal to 20.'\n end\n\n @size = size\n end",
"def set_endianness(e=nil)\n unless [:little, :big].include? e\n raise ArgumentError, \"Unknown endianness (#{e}) for #{self.class}\"\n end\n @int64 = e == :little ? Int64le : Int64be\n @int32 = e == :little ? Int32le : Int32be\n @int16 = e == :little ? Int16le : Int16be\n return e\n end",
"def attr_set_sb4(attr_type, attr_value)\n #This is a stub, used for indexing\n end",
"def size_in_byte=(value)\n @size_in_byte = value\n end",
"def visual_size(value)\n @ole.VisualSize = value\n nil\n end",
"def length=(length)\n end",
"def size=(val)\n v = val.is_a?(Array)\n v &&= val.length == 2\n v &&= val.all? {|item| item.to_s =~ /^\\d+$/ }\n raise InvalidSize unless v\n @width = val.first.to_i\n @height = val.last.to_i\n end",
"def set_raw!(value)\n value = value.to_s\n\n @objects = nil\n @memory = FFI::MemoryPointer.new(:uchar, value.length) \n @memory.write_bytes(value)\n\n self[:type] = :raw\n\n raw = self[:values][:raw]\n raw[:size] = value.length\n raw[:ptr] = @memory\n end",
"def user_len=(val)\n if (val.kind_of?(Integer))\n @user_len = val & 0xff\n elsif(val.kind_of?(String))\n raise ArgumentError, \"Value must be 1-byte, but was #{val.length}.\" if (val.length != 1) \n @user_len = val.unpack('C')[0]\n else\n raise ArgumentError, \"Expected String or Integer, but #{val.class} provided.\" \n end\n return(nil)\n end",
"def slot_size (size)\r\n @slot_size = size\r\n end"
] | [
"0.6069003",
"0.59874624",
"0.5922158",
"0.58663684",
"0.5863692",
"0.5747521",
"0.57346654",
"0.5697523",
"0.5636921",
"0.562953",
"0.55702984",
"0.55702984",
"0.5555129",
"0.55262977",
"0.55237573",
"0.552178",
"0.5498379",
"0.54919183",
"0.5478183",
"0.544552",
"0.5405694",
"0.5395475",
"0.5390508",
"0.53831744",
"0.53745383",
"0.53569347",
"0.5354836",
"0.53489137",
"0.53426856",
"0.53167975",
"0.53158903",
"0.53130925",
"0.5273436",
"0.525959",
"0.5254272",
"0.52439904",
"0.5209349",
"0.5180654",
"0.5171745",
"0.51571727",
"0.5144972",
"0.51321596",
"0.5097516",
"0.5089294",
"0.50886434",
"0.5076494",
"0.5076494",
"0.50637835",
"0.50420225",
"0.50420225",
"0.5036398",
"0.5027243",
"0.50234294",
"0.502245",
"0.5011618",
"0.50083756",
"0.5003859",
"0.49916986",
"0.4988647",
"0.49686584",
"0.49537927",
"0.49519902",
"0.49505976",
"0.49498183",
"0.4943676",
"0.49383813",
"0.49353534",
"0.49329942",
"0.4930109",
"0.49175915",
"0.49162865",
"0.49155504",
"0.49111953",
"0.49084806",
"0.49068713",
"0.49068713",
"0.49004602",
"0.48935747",
"0.48935747",
"0.48898047",
"0.48839742",
"0.4882685",
"0.48780653",
"0.4864397",
"0.48507577",
"0.48418733",
"0.48418733",
"0.48407707",
"0.48314306",
"0.4830438",
"0.48182198",
"0.4818092",
"0.47970328",
"0.47946098",
"0.47803983",
"0.47789487",
"0.47778827",
"0.47705",
"0.47684407",
"0.47663453"
] | 0.75745386 | 0 |
Set the underlying type | def type=(type)
@type = type
@signed = type.name.split('::').last[0] != "U"
type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_type\n end",
"def set_type(v)\n self.type = v\n self\n end",
"def set_type(val)\n self.type = val\n self\n end",
"def type(val); @type = val; self; end",
"def type=(type); end",
"def type_setter\n @type_setter ||= type.__setter__\n end",
"def record_type(t)\n @type = t\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def type= new_type\n frozen_check!\n @gapi.type = new_type\n end",
"def type= new_type\n frozen_check!\n @gapi.type = new_type\n end",
"def type=(type)\n write_attr :type, type\n end",
"def type=(type)\n @type = type\n end",
"def type=(type)\n @type = type\n end",
"def set_type(name)\n @type = name\n ProcessRecord::TYPE_TABLE[name] = self\n end",
"def type=(type)\n @@type = type\n end",
"def type=(type)\n type = type.intern\n super type\n end",
"def type=(type)\n @type = type\n end",
"def type=(new_type)\n @type = new_type.to_sym\n end",
"def class_type=(value)\n\t\tself[:type] = value\n\tend",
"def set_instance_type( type )\n raise \"type must be type #{type}\" unless type.is_a?(Type)\n self.instance_type = type\n end",
"def set_instance_type( type )\n raise \"type must be type #{type}\" unless type.is_a?(Type)\n self.instance_type = type\n end",
"def type=(type)\n self['type'] = type\n end",
"def type=(type)\n Munson.register_type(type, self)\n munson.type = type\n end",
"def type=(type)\n validate_type_values(type)\n @type = type\n end",
"def of_type(type)\n options[:type] = type\n self\n end",
"def type=(value)\n @type = value.to_sym\n end",
"def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end",
"def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end",
"def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end",
"def type=(type)\n @type = type.to_sym\n end",
"def type=(val)\n @type = val.to_sym\n end",
"def set_type sym, type\n @types[sym] = type\n end",
"def type=(type)\n if type && !VALID_TYPES.include?(type.to_sym)\n raise ArgumentError, \"Invalid Type (#{type}), use: #{VALID_TYPES*' '}\"\n end\n write_attr :type, type\n end",
"def type=(type)\n if type && !VALID_TYPES.include?(type.to_sym)\n raise ArgumentError, \"Invalid Type (#{type}), use: #{VALID_TYPES*' '}\"\n end\n write_attr :type, type\n end",
"def type=(type)\n @type = type\n\n setOption('type', @type)\n end",
"def set_type(qualified_name, type)\n @types[qualified_name] = type\n end",
"def set_instance_type( type )\n self.instance_type = type\n end",
"def set_Type(value)\n set_input(\"Type\", value)\n end",
"def set_Type(value)\n set_input(\"Type\", value)\n end",
"def data_type=(value)\n @data_type = value\n end",
"def type=(_); end",
"def type=(_); end",
"def type=(_); end",
"def type=(_); end",
"def type=(_); end",
"def type=(new_type)\n self[:type_flags] = (flags | TYPES[new_type])\n end",
"def type value\n @settings[:type] = value\n return self\n end",
"def set_Type(value)\n set_input(\"Type\", value)\n end",
"def set_Type(value)\n set_input(\"Type\", value)\n end",
"def type(type)\n opts[:type] = type\n end",
"def assign_type(content_type)\n self.type = self.class.class_type_from(content_type)\n end",
"def type(value_=nil)\n if value_\n @type = value_\n else\n @type\n end\n end",
"def type= new_type\n @gapi.update! type: verify_type(new_type)\n end",
"def set_type(opts)\n opts = check_params(opts,[:types])\n super(opts)\n end",
"def value_type=(value)\n @value_type = value\n end",
"def device_type=(s)\n self[:type] = s\n end",
"def set_typecode(v)\n @typecode = v\n end",
"def set_type\n @type = Type.find(params[:id])\n end",
"def set_type\n @type = Type.find(params[:id])\n end",
"def set_type\n @type = Type.find(params[:id])\n end",
"def _type=(_)\n end",
"def type=(type)\n allowed_values = [\"STRING\", \"BOOLEAN\", \"DECIMAL\", \"INTEGER\", \"DATE_TIME\", \"REFERENCE\", \"COMPLEX\"]\n if type && !allowed_values.include?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{allowed_values}.\"\n end\n @type = type\n end",
"def set_type\n raise Error::NotFoundError unless (@type = Type.find(params[:id]))\n end",
"def type=(type)\n raise ArgumentError, \"Invalid Type (#{type}), use: #{VALID_TYPES*' '}\" if type && !VALID_TYPES.include?(type.to_sym)\n super\n end",
"def type=(type)\n raise ArgumentError, \"Invalid Type (#{type}), use: #{VALID_TYPES*' '}\" if type && !VALID_TYPES.include?(type.to_sym)\n super\n end",
"def type=(type)\n if type && !VALID_TYPES.include?(type.to_sym)\n raise ArgumentError, \"Invalid Type (#{type}), use: #{VALID_TYPES*' '}\"\n end\n super\n end",
"def type=(sObjType)\n return self if self.empty?\n @data[:object_type] = sObjType\n self\n end",
"def device_type=(s)\n self[:type] = s\n end",
"def assign_type(content_type)\n self.type = MimeMapping.class_type_from(content_type).name\n end",
"def device_type=(s)\n self[:type] = s\n end",
"def type=(val)\n if (val.kind_of?(Integer))\n @type = val & 0xff\n elsif(val.kind_of?(String))\n raise ArgumentError, \"Value should be 1-byte, but was #{val.length}.\" if (val.length != 1) \n @type = val.unpack('C')[0]\n else\n raise ArgumentError, \"Expected String or Integer, but #{val.class} provided.\" \n end\n end",
"def setType _obj, _args\n \"_obj setType _args;\" \n end",
"def type=(v)\n RestrictionValidator.validate :storage_type, TYPES.values, v\n @type = v\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['Shape', 'Chart', 'Table', 'PictureFrame', 'VideoFrame', 'AudioFrame', 'SmartArt', 'OleObjectFrame', 'GroupShape', 'GraphicalObject', 'Connector', 'SmartArtShape', 'ZoomFrame', 'SectionZoomFrame', 'SummaryZoomFrame', 'SummaryZoomSection'])\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",
"def set_type\n @type = Type.find(params[:id])\n\n end",
"def set_annotation_type(type)\n set(annotation_type: type)\n end",
"def mutate!(type)\n set_type(type)\n end",
"def target_type=(value)\n @target_type = value\n end",
"def set_type_of_value\n @type_of_value = TypeOfValue.find(params[:id])\n end",
"def changeType(newType)\n\t\t\t#remove accessors for old type\n\t\t\tremoveAccessors()\n\t\t\t@type = newType\n\n\t\t\t#produce accessors for the newly set type\n\t\t\tproduceAccessors()\n\t\tend",
"def set_subclass_type\n return if send(type_attribute)\n write_attribute(type_attribute, subclass_types.detect{|s| send(s)}.to_s.classify)\n end",
"def reference_type=(value)\n write_attribute(:reference_type, value) unless value.blank?\n end",
"def type(type); end",
"def set_type\n new_type = [sport.name, \"Infrastructure\"].join('')\n\n begin\n new_type.constantize\n self.type = new_type\n rescue NameError\n self.type = nil\n end\n\n end",
"def notable_type=(class_name)\n super(class_name.constantize.base_class.to_s)\n end",
"def _type\n special_attribute('@type'.freeze)\n end",
"def type= (type)\n self.tweet_type = type\n end",
"def set(object)\n object.nil? ? default : type.set(object)\n end",
"def type_klass=(_arg0); end",
"def type=(val)\n\n dtype = val\n #return self if @chars_allowed # disallow changing\n # send in a regexp, we just save it.\n if dtype.is_a? Regexp \n @chars_allowed = dtype\n return self\n end\n dtype = dtype.to_s.downcase.to_sym if dtype.is_a? String\n case dtype # missing to_sym would have always failed due to to_s 2011-09-30 1.3.1\n when :integer, Integer\n @chars_allowed = /\\d/\n when :numeric, :float, Numeric, Float\n @chars_allowed = /[\\d\\.]/ \n when :alpha\n @chars_allowed = /[a-zA-Z]/ \n when :alnum\n @chars_allowed = /[a-zA-Z0-9]/ \n else\n raise ArgumentError, \"Field type: invalid datatype specified. Use :integer, :numeric, :float, :alpha, :alnum \"\n end\n self\n end",
"def type_name=(val)\n self['type_name'] = val\n end",
"def type\n @type ||= options[:type] || Object\n end",
"def set_type\n puts \"set_type: #{params[:id]}\"\n @type = Type.where(id: params[:id]).first\n puts \"set_type, find: #{@type.id}\"\n end",
"def bar_type=(s)\n self[:type] = s\n end",
"def type=(val)\n @type = val.to_sym if %w(UNSPECIFIED MEDIA MASTER).include? val.to_s\n end"
] | [
"0.82642114",
"0.8020331",
"0.79599285",
"0.7660267",
"0.7605883",
"0.7446298",
"0.74407166",
"0.7422211",
"0.7422211",
"0.7422211",
"0.7422211",
"0.7422211",
"0.7422211",
"0.7422211",
"0.7347063",
"0.7347063",
"0.7326029",
"0.73197496",
"0.7261865",
"0.7258958",
"0.72404414",
"0.7225757",
"0.7177806",
"0.7173901",
"0.7153738",
"0.7140944",
"0.7140944",
"0.71400064",
"0.7138406",
"0.71215284",
"0.70772636",
"0.70649457",
"0.70242643",
"0.70242643",
"0.70242643",
"0.69884664",
"0.69705856",
"0.6886473",
"0.68468493",
"0.68408996",
"0.6837708",
"0.6834851",
"0.68301517",
"0.68294966",
"0.68294966",
"0.6828389",
"0.6819179",
"0.6819179",
"0.6819179",
"0.6819179",
"0.6819179",
"0.6795979",
"0.679523",
"0.67629206",
"0.67629206",
"0.67305183",
"0.67046964",
"0.66124743",
"0.659824",
"0.65609676",
"0.6549895",
"0.6538832",
"0.6533594",
"0.65017164",
"0.65017164",
"0.65017164",
"0.64702046",
"0.64462256",
"0.6445491",
"0.643338",
"0.643338",
"0.6422222",
"0.64054656",
"0.64050555",
"0.6395562",
"0.6395448",
"0.637724",
"0.63715565",
"0.63697594",
"0.63696724",
"0.6343482",
"0.6334613",
"0.63315517",
"0.63128036",
"0.6309341",
"0.6292742",
"0.62655574",
"0.6251861",
"0.62471354",
"0.62439543",
"0.6240333",
"0.62315774",
"0.6216652",
"0.6216339",
"0.6215371",
"0.62099165",
"0.6204208",
"0.6195642",
"0.6194491",
"0.6192561",
"0.61903775"
] | 0.0 | -1 |
Set the bitfield's field names and number of bits Creates accessor to fields for instance of this class | def map=(m)
raise "map already set" if @map
@map = m.each.collect { |k, v| [k, [v, k.to_sym, :"#{k}="]] }.to_h
m.each_key { |k|
attr_accessor k
}
m
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bit_field name, width\n raise \"'bit_field' can be used only inside a 'field' block.\" if @_current_bit_fields.nil?\n \n # Register the bit field definition\n @_current_bit_fields << [name, width, bit_mask(width)]\n \n # Define the attribute accessor\n bits_attr_accessor(name)\n \n if width == 1 or name.to_s =~ /_flag$/\n # Define a question mark method if the size is 1 bit\n class_eval \"def #{name}?; self.attributes[#{name.inspect}] != 0; end\\n\", __FILE__, __LINE__\n \n # returns nil if no substitution happens...\n if flag_method_name = name.to_s.gsub!(/_flag$/, '?')\n # Define another question mark method if ends with \"_flag\"\n class_eval \"alias #{flag_method_name} #{name}?\\n\", __FILE__, __LINE__\n end\n end\n \n end",
"def field name, unpack_recipe = 'C', &bit_fields_definitions_block\n include InstanceMethods # when used we include instance methods\n \n # Setup class \"instance\" vars\n @fields ||= []\n @bit_fields ||= {}\n @unpack_recipe ||= \"\"\n \n # Register the field definition\n @unpack_recipe << unpack_recipe\n @fields << name\n \n # Define the attribute accessor\n bits_attr_accessor(name)\n \n # There's a bit-structure too?\n if block_given?\n @_current_bit_fields = []\n \n bit_fields_definitions_block.call\n \n @bit_fields[name] = @_current_bit_fields\n @_current_bit_fields = nil\n end\n end",
"def bitfield(bitbuf, len, &blk)\n if @endian==:little\n unless len==16||len==32||len==64\n raise RuntimeError, \"Binstruct: Bitfield: Don't know how to endian swap #{len} bits. :(\"\n end\n instr=bitbuf.slice!(0,len).scan(/.{8}/).reverse.join\n else\n instr=bitbuf.slice!(0,len)\n end\n new=Bitfield.new([instr].pack('B*'), &blk)\n if @endian==:little\n # This is so we know to flip the bytes back in #to_s\n new.instance_variable_set :@endian_flip_hack, true\n end\n @fields << new\n # Add direct references and accessor methods to the containing Binstruct\n new.fields.each {|f| \n unless f.is_a? Fields::Field\n raise RuntimeError, \"Binstruct: Construction: Illegal content #{f.class} in bitfield - use only Fields\"\n end\n @hash_references[f.name]=f\n meta_def f.name do f.get_value end\n meta_def (f.name.to_s + '=').to_sym do |val| f.set_value(val) end\n }\n end",
"def pack_bit_fields\n @unpacked = []\n \n self.class.fields.each_with_index do |name, position|\n \n if bit_fields = self.class.bit_fields[name]\n \n bit_value = 0\n bit_fields.each do |(bit_name, bits_number, bit_mask)|\n masked = @attributes[bit_name] & bit_mask\n \n raise ValueOverflow, \n \"the value #{@attributes[bit_name]} \"+\n \"is too big for #{bits_number} bits\" if masked != @attributes[bit_name]\n \n bit_value = bit_value << bits_number\n bit_value |= masked\n end\n \n # Value of fields composed by binary fields is always overwritten\n # by the composition of the latter\n attributes[name] = bit_value\n end\n \n @unpacked[position] = @attributes[name] || 0\n \n end\n \n @raw = @unpacked.pack( self.class.unpack_recipe )\n end",
"def parse_bit_fields raw\n @raw = raw\n \n # Setup\n @unpacked = @raw.unpack( self.class.unpack_recipe )\n @attributes ||= {}\n \n self.class.fields.each_with_index do |name, position|\n \n @attributes[name] = @unpacked[position]\n \n if bit_fields = self.class.bit_fields[name]\n \n bit_value = attributes[name]\n \n # We must extract bits from end since \n # ruby doesn't have types (and fixed lengths)\n bit_fields.reverse.each do |(bit_name, bits_number, bit_mask)|\n @attributes[bit_name] = bit_value & bit_mask\n bit_value = bit_value >> bits_number\n end\n end\n end\n end",
"def read_field(*args)\n m = 0\n args.flatten.each_with_index do |bit, i|\n if bit.is_a?(Integer)\n m |= ((@value[bit] || 0) << i)\n end\n end\n m\n end",
"def bitfield_args\n @bitfield_args ||= []\n end",
"def define_field(type, name, number, options = {})\n fields[name] = type.__protofield__(type, name, number, options)\n field_accessors(name)\n end",
"def reset_bitfields column_name, *fields\n mask = reset_mask_for column_name, *fields\n update_all \"#{column_name} = #{column_name} & #{mask}\"\n end",
"def add_accessors(column, name, position, default)\n mask = (1 << position)\n self.bitflags[name] = mask\n if default \n self.default_mask += mask\n end\n \n # now the instance accessors\n # return true/false\n define_method( (name + '?').to_sym ) do\n bits = self[column] ||= 0\n bits[position].eql? 1\n end\n \n # set with true/false \n define_method( (name + '=').to_sym ) do |v|\n bits = self[column] ||= 0\n flag = [ \"true\", '1', 'yes', 'ok' ].include? v.to_s.downcase\n self[column] = flag ? bits |= mask : bits &= ~mask\n end\n \n # make this easy for the form builders like 'check_box' to use standard accessors\n define_method( name.to_sym ) do\n bits = self[column] ||= 0\n bits[position].eql? 1\n end\n \n end",
"def send_bitfield(socket)\n if $verb\n puts \"Sent bitfield message\"\n end\n bitfield_length = (@fileio.getBitfield.get_num_of_bits + 7) / 8\n bitfield_data = @fileio.getBitfield.to_binary_data\n socket.write([(1 + bitfield_length), 5].pack(\"Nc\") + bitfield_data)\n end",
"def initialize\n initialize__bit_set(BITS)\n end",
"def to_bitfields(lens,byte_endianness=:little_endian, bits_little_endian=false)\n fields = []\n i = to_i(byte_endianness,bits_little_endian)\n for len in lens\n mask = (1<<len)-1\n fields << (i&mask)\n i >>= len\n end\n fields\n end",
"def increment_bitfields column_name, *fields\n mask = self.class.increment_mask_for column_name, *fields\n self[column_name] = self[column_name] += mask\n save\n end",
"def bits_for(*field_names)\n bits = []\n \n field_names.flatten.each do |i|\n if i.is_a?(Integer)\n bits << i\n next\n end\n \n if i.respond_to?(:to_sym) and @field_list[i.to_sym]\n bits << @field_list[i.to_sym]\n end\n end\n \n bits.flatten\n end",
"def bits=(bits)\n @bits = bits\n init_vars\n end",
"def bitfields column_name\n @@bitfields[column_name].keys\n end",
"def set_fields(fbe_value)\n byte0.set(fbe_value.byte0)\n byte1.set(fbe_value.byte1)\n byte2.set(fbe_value.byte2)\n byte3.set(fbe_value.byte3)\n byte4.set(fbe_value.byte4)\n byte5.set(fbe_value.byte5)\n char0.set(fbe_value.char0)\n char1.set(fbe_value.char1)\n char2.set(fbe_value.char2)\n char3.set(fbe_value.char3)\n char4.set(fbe_value.char4)\n char5.set(fbe_value.char5)\n wchar0.set(fbe_value.wchar0)\n wchar1.set(fbe_value.wchar1)\n wchar2.set(fbe_value.wchar2)\n wchar3.set(fbe_value.wchar3)\n wchar4.set(fbe_value.wchar4)\n wchar5.set(fbe_value.wchar5)\n int8b0.set(fbe_value.int8b0)\n int8b1.set(fbe_value.int8b1)\n int8b2.set(fbe_value.int8b2)\n int8b3.set(fbe_value.int8b3)\n int8b4.set(fbe_value.int8b4)\n int8b5.set(fbe_value.int8b5)\n uint8b0.set(fbe_value.uint8b0)\n uint8b1.set(fbe_value.uint8b1)\n uint8b2.set(fbe_value.uint8b2)\n uint8b3.set(fbe_value.uint8b3)\n uint8b4.set(fbe_value.uint8b4)\n uint8b5.set(fbe_value.uint8b5)\n int16b0.set(fbe_value.int16b0)\n int16b1.set(fbe_value.int16b1)\n int16b2.set(fbe_value.int16b2)\n int16b3.set(fbe_value.int16b3)\n int16b4.set(fbe_value.int16b4)\n int16b5.set(fbe_value.int16b5)\n uint16b0.set(fbe_value.uint16b0)\n uint16b1.set(fbe_value.uint16b1)\n uint16b2.set(fbe_value.uint16b2)\n uint16b3.set(fbe_value.uint16b3)\n uint16b4.set(fbe_value.uint16b4)\n uint16b5.set(fbe_value.uint16b5)\n int32b0.set(fbe_value.int32b0)\n int32b1.set(fbe_value.int32b1)\n int32b2.set(fbe_value.int32b2)\n int32b3.set(fbe_value.int32b3)\n int32b4.set(fbe_value.int32b4)\n int32b5.set(fbe_value.int32b5)\n uint32b0.set(fbe_value.uint32b0)\n uint32b1.set(fbe_value.uint32b1)\n uint32b2.set(fbe_value.uint32b2)\n uint32b3.set(fbe_value.uint32b3)\n uint32b4.set(fbe_value.uint32b4)\n uint32b5.set(fbe_value.uint32b5)\n int64b0.set(fbe_value.int64b0)\n int64b1.set(fbe_value.int64b1)\n int64b2.set(fbe_value.int64b2)\n int64b3.set(fbe_value.int64b3)\n int64b4.set(fbe_value.int64b4)\n int64b5.set(fbe_value.int64b5)\n uint64b0.set(fbe_value.uint64b0)\n uint64b1.set(fbe_value.uint64b1)\n uint64b2.set(fbe_value.uint64b2)\n uint64b3.set(fbe_value.uint64b3)\n uint64b4.set(fbe_value.uint64b4)\n uint64b5.set(fbe_value.uint64b5)\n end",
"def increment_bitfields column_name, *fields\n mask = increment_mask_for column_name, *fields\n update_all \"#{column_name} = #{column_name} + #{mask}\"\n end",
"def set_field_number(field_number)\n raise NotImplementedError, \"Implement this method in a child class\"\n end",
"def get_binary_field(field_name)\n\t\tend",
"def bits_attr_accessor name\n class_eval \"def #{name}; self.attributes[#{name.inspect}]; end;\", __FILE__, __LINE__\n class_eval \"def #{name}=(val); self.attributes[#{name.inspect}]=val; end;\", __FILE__, __LINE__\n end",
"def set_fields(fbe_value)\n fbe_current_offset = 0\n fbe_current_size = 0\n\n byte0.fbe_offset = fbe_current_offset\n fbe_field_size = byte0.set(fbe_value.byte0)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n byte1.fbe_offset = fbe_current_offset\n fbe_field_size = byte1.set(fbe_value.byte1)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n byte2.fbe_offset = fbe_current_offset\n fbe_field_size = byte2.set(fbe_value.byte2)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n byte3.fbe_offset = fbe_current_offset\n fbe_field_size = byte3.set(fbe_value.byte3)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n byte4.fbe_offset = fbe_current_offset\n fbe_field_size = byte4.set(fbe_value.byte4)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n byte5.fbe_offset = fbe_current_offset\n fbe_field_size = byte5.set(fbe_value.byte5)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n char0.fbe_offset = fbe_current_offset\n fbe_field_size = char0.set(fbe_value.char0)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n char1.fbe_offset = fbe_current_offset\n fbe_field_size = char1.set(fbe_value.char1)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n char2.fbe_offset = fbe_current_offset\n fbe_field_size = char2.set(fbe_value.char2)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n char3.fbe_offset = fbe_current_offset\n fbe_field_size = char3.set(fbe_value.char3)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n char4.fbe_offset = fbe_current_offset\n fbe_field_size = char4.set(fbe_value.char4)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n char5.fbe_offset = fbe_current_offset\n fbe_field_size = char5.set(fbe_value.char5)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n wchar0.fbe_offset = fbe_current_offset\n fbe_field_size = wchar0.set(fbe_value.wchar0)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n wchar1.fbe_offset = fbe_current_offset\n fbe_field_size = wchar1.set(fbe_value.wchar1)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n wchar2.fbe_offset = fbe_current_offset\n fbe_field_size = wchar2.set(fbe_value.wchar2)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n wchar3.fbe_offset = fbe_current_offset\n fbe_field_size = wchar3.set(fbe_value.wchar3)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n wchar4.fbe_offset = fbe_current_offset\n fbe_field_size = wchar4.set(fbe_value.wchar4)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n wchar5.fbe_offset = fbe_current_offset\n fbe_field_size = wchar5.set(fbe_value.wchar5)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int8b0.fbe_offset = fbe_current_offset\n fbe_field_size = int8b0.set(fbe_value.int8b0)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int8b1.fbe_offset = fbe_current_offset\n fbe_field_size = int8b1.set(fbe_value.int8b1)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int8b2.fbe_offset = fbe_current_offset\n fbe_field_size = int8b2.set(fbe_value.int8b2)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int8b3.fbe_offset = fbe_current_offset\n fbe_field_size = int8b3.set(fbe_value.int8b3)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int8b4.fbe_offset = fbe_current_offset\n fbe_field_size = int8b4.set(fbe_value.int8b4)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int8b5.fbe_offset = fbe_current_offset\n fbe_field_size = int8b5.set(fbe_value.int8b5)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint8b0.fbe_offset = fbe_current_offset\n fbe_field_size = uint8b0.set(fbe_value.uint8b0)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint8b1.fbe_offset = fbe_current_offset\n fbe_field_size = uint8b1.set(fbe_value.uint8b1)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint8b2.fbe_offset = fbe_current_offset\n fbe_field_size = uint8b2.set(fbe_value.uint8b2)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint8b3.fbe_offset = fbe_current_offset\n fbe_field_size = uint8b3.set(fbe_value.uint8b3)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint8b4.fbe_offset = fbe_current_offset\n fbe_field_size = uint8b4.set(fbe_value.uint8b4)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint8b5.fbe_offset = fbe_current_offset\n fbe_field_size = uint8b5.set(fbe_value.uint8b5)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int16b0.fbe_offset = fbe_current_offset\n fbe_field_size = int16b0.set(fbe_value.int16b0)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int16b1.fbe_offset = fbe_current_offset\n fbe_field_size = int16b1.set(fbe_value.int16b1)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int16b2.fbe_offset = fbe_current_offset\n fbe_field_size = int16b2.set(fbe_value.int16b2)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int16b3.fbe_offset = fbe_current_offset\n fbe_field_size = int16b3.set(fbe_value.int16b3)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int16b4.fbe_offset = fbe_current_offset\n fbe_field_size = int16b4.set(fbe_value.int16b4)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int16b5.fbe_offset = fbe_current_offset\n fbe_field_size = int16b5.set(fbe_value.int16b5)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint16b0.fbe_offset = fbe_current_offset\n fbe_field_size = uint16b0.set(fbe_value.uint16b0)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint16b1.fbe_offset = fbe_current_offset\n fbe_field_size = uint16b1.set(fbe_value.uint16b1)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint16b2.fbe_offset = fbe_current_offset\n fbe_field_size = uint16b2.set(fbe_value.uint16b2)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint16b3.fbe_offset = fbe_current_offset\n fbe_field_size = uint16b3.set(fbe_value.uint16b3)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint16b4.fbe_offset = fbe_current_offset\n fbe_field_size = uint16b4.set(fbe_value.uint16b4)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint16b5.fbe_offset = fbe_current_offset\n fbe_field_size = uint16b5.set(fbe_value.uint16b5)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int32b0.fbe_offset = fbe_current_offset\n fbe_field_size = int32b0.set(fbe_value.int32b0)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int32b1.fbe_offset = fbe_current_offset\n fbe_field_size = int32b1.set(fbe_value.int32b1)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int32b2.fbe_offset = fbe_current_offset\n fbe_field_size = int32b2.set(fbe_value.int32b2)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int32b3.fbe_offset = fbe_current_offset\n fbe_field_size = int32b3.set(fbe_value.int32b3)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int32b4.fbe_offset = fbe_current_offset\n fbe_field_size = int32b4.set(fbe_value.int32b4)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int32b5.fbe_offset = fbe_current_offset\n fbe_field_size = int32b5.set(fbe_value.int32b5)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint32b0.fbe_offset = fbe_current_offset\n fbe_field_size = uint32b0.set(fbe_value.uint32b0)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint32b1.fbe_offset = fbe_current_offset\n fbe_field_size = uint32b1.set(fbe_value.uint32b1)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint32b2.fbe_offset = fbe_current_offset\n fbe_field_size = uint32b2.set(fbe_value.uint32b2)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint32b3.fbe_offset = fbe_current_offset\n fbe_field_size = uint32b3.set(fbe_value.uint32b3)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint32b4.fbe_offset = fbe_current_offset\n fbe_field_size = uint32b4.set(fbe_value.uint32b4)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint32b5.fbe_offset = fbe_current_offset\n fbe_field_size = uint32b5.set(fbe_value.uint32b5)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int64b0.fbe_offset = fbe_current_offset\n fbe_field_size = int64b0.set(fbe_value.int64b0)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int64b1.fbe_offset = fbe_current_offset\n fbe_field_size = int64b1.set(fbe_value.int64b1)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int64b2.fbe_offset = fbe_current_offset\n fbe_field_size = int64b2.set(fbe_value.int64b2)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int64b3.fbe_offset = fbe_current_offset\n fbe_field_size = int64b3.set(fbe_value.int64b3)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int64b4.fbe_offset = fbe_current_offset\n fbe_field_size = int64b4.set(fbe_value.int64b4)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n int64b5.fbe_offset = fbe_current_offset\n fbe_field_size = int64b5.set(fbe_value.int64b5)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint64b0.fbe_offset = fbe_current_offset\n fbe_field_size = uint64b0.set(fbe_value.uint64b0)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint64b1.fbe_offset = fbe_current_offset\n fbe_field_size = uint64b1.set(fbe_value.uint64b1)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint64b2.fbe_offset = fbe_current_offset\n fbe_field_size = uint64b2.set(fbe_value.uint64b2)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint64b3.fbe_offset = fbe_current_offset\n fbe_field_size = uint64b3.set(fbe_value.uint64b3)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint64b4.fbe_offset = fbe_current_offset\n fbe_field_size = uint64b4.set(fbe_value.uint64b4)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n uint64b5.fbe_offset = fbe_current_offset\n fbe_field_size = uint64b5.set(fbe_value.uint64b5)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n # noinspection RubyUnnecessaryReturnValue\n fbe_current_size\n end",
"def bit\n self\n end",
"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",
"def get_I16_field(field_name)\n\t\tend",
"def named_bits(options = {})\n options = {\n include_spacers: false\n }.merge(options)\n result = []\n\n # Shows the bits that have changed from the reset value of the register/bits.\n # Currently logs it to the console window using Origen logger.\n def changed_bits(options = {})\n temp = named_bits.select { |name, bits| bits.data != bits.reset_val }\n temp.each do |r|\n Origen.log.info \"\\t\\t#{self.name}.#{r[0]} : #{r[1].value.to_hex}\".bold.blue\n end\n Origen.log.info ' '\n end\n\n # test if @lookup has any values stored as an array\n # if so it means there is a split group of bits\n # process that differently to a single bit or continuous range of bits\n # which are typically stored in a hash\n\n split_bits = false\n @lookup.each { |_k, v| split_bits = true if v.is_a? Array }\n\n if split_bits == false\n current_pos = size\n\n # Sort by position\n @lookup.sort_by { |_name, details| -details[:pos] }.each do |name, details|\n pos = details[:bits] + details[:pos]\n if options[:include_spacers] && (pos != current_pos)\n collection = BitCollection.dummy(self, nil, size: current_pos - pos, pos: pos)\n unless collection.size == 0\n if block_given?\n yield nil, collection\n else\n result << [nil, collection]\n end\n end\n end\n collection = BitCollection.new(self, name)\n details[:bits].times do |i|\n collection << @bits[details[:pos] + i]\n end\n unless collection.size == 0\n if block_given?\n yield name, collection\n else\n result << [name, collection]\n end\n end\n current_pos = details[:pos]\n end\n if options[:include_spacers] && (current_pos != 0)\n collection = BitCollection.dummy(self, nil, size: current_pos, pos: 0)\n unless collection.size == 0\n if block_given?\n yield nil, collection\n else\n result << [nil, collection]\n end\n end\n end\n elsif split_bits == true # if there are split bits, need to convert all register bit values to array elements to allow sorting\n\n # if the register has bits split up across it, then store the bits in order of decreasing reg position\n # but first, stuff all the bits in a simple array, as single bits, or ranges of bits\n\n @lookup_splits = []\n @lookup.each do |k, v|\n tempbit = {}\n bitcounter = {}\n if v.is_a? Hash\n # then this is already a single bit or a continuous range so just stuff it into the array\n tempbit[k] = v\n @lookup_splits << tempbit.clone\n elsif v.is_a? Array\n # if the bitgroup is split, then decompose into single bits and continuous ranges\n v.each_with_index do |bitdetail, _i|\n if bitcounter.key?(k)\n bitcounter[k] = bitcounter[k] + bitdetail[:bits]\n else\n bitcounter[k] = bitdetail[:bits]\n end\n tempbit[k] = bitdetail\n @lookup_splits << tempbit.clone\n end\n end\n if v.is_a? Array\n @lookup_splits.each_with_index do |_e, q|\n groupname = @lookup_splits[q].to_a[0][0]\n if groupname == k\n @lookup_splits[q][groupname][:bitgrouppos] = bitcounter[groupname] if groupname == k\n bitcounter[groupname] = bitcounter[groupname] - @lookup_splits[q][groupname][:bits]\n end\n end\n end\n end\n # Now sort the array in descending order\n # Does adding the bitgrouppos need to happen after the sort ?\n @lookup_splits = @lookup_splits.sort do |a, b|\n b.to_a[0][1][:pos] <=> a.to_a[0][1][:pos]\n end\n\n current_pos = size\n countbits = {} # if countbits.method == nil\n\n @master = {}\n bitgroup = {}\n bitinfo = {}\n info = {}\n\n @lookup_splits.each_with_index do |hash, _i|\n name = hash.to_a[0][0]\n details = hash.to_a[0][1]\n bitcounter = hash.to_a[0][1][:bitgrouppos]\n pos = details[:bits] + details[:pos]\n if options[:include_spacers] && (pos != current_pos)\n collection = BitCollection.dummy(self, nil, size: current_pos - pos, pos: pos)\n unless collection.size == 0\n if block_given?\n yield nil, collection, bitcounter\n else\n result << [nil, collection, bitcounter]\n end\n end\n end\n collection = BitCollection.new(self, name)\n details[:bits].times do |i|\n collection << @bits[details[:pos] + i]\n end\n unless collection.size == 0\n if block_given?\n yield name, collection, bitcounter\n else\n result << [name, collection, bitcounter]\n end\n end\n current_pos = details[:pos]\n end\n if options[:include_spacers] && current_pos != 0\n collection = BitCollection.dummy(self, nil, size: current_pos, pos: 0)\n unless collection.size == 0\n if block_given?\n yield nil, collection, bitcounter\n else\n result << [nil, collection, bitcounter]\n end\n end\n end\n end\n unless block_given?\n result\n end\n end",
"def bit\n Component.bit_for(self.class)\n end",
"def set_fields(params=nil)\n params ||= {}\n if params[:bits] and params[:addr]\n raise( ::ArgumentError, \n \"Don't use :addr and :bits fields together. \"+\n \"Just use :addr => 'x.x.x.x/nn' where nn are the bits.\" )\n else\n super(params)\n end\n end",
"def field_accessors(name)\n field_reader(name)\n attr_writer(name)\n end",
"def get_U16_field(field_name)\n\t\tend",
"def increment_mask_for column_name, *fields\n fields = bitfields if fields.empty?\n column = @@bitfields[column_name]\n raise ArgumentError, \"Unknown column for bitfield: #{column_name}\" if column.nil?\n fields.sum do |field_name|\n raise ArugmentError, \"Unknown field: #{field_name} for column #{column_name}\" if column[field_name].nil?\n 2 ** (bitfield_max(column_name) - column[field_name].last)\n end\n end",
"def fields(fields = {})\n fields.each do |k,v|\n define_accessor(k.underscore, v)\n end\n end",
"def initialize(field_type, field_size, id)\n @field_type = field_type\n @field_size = field_size\n @id = id\n @@all_fields << self \n end",
"def set_field(name, options = {})\n meth = options.delete(:as) || name\n fields[name] = Field.new(name, options)\n create_accessors(name, meth, options)\n end",
"def set_field(name, options = {})\n meth = options.delete(:as) || name\n Field.new(name, options).tap do |field|\n fields[name] = field\n create_accessors(name, meth, options)\n add_dirty_methods(name)\n process_options(field)\n end\n end",
"def get_fields(fbe_value, fbe_struct_size)\n fbe_current_size = 4 + 4\n\n if (fbe_current_size + byte0.fbe_size) <= fbe_struct_size\n fbe_value.byte0 = byte0.get(EnumByte.ENUM_VALUE_0)\n else\n fbe_value.byte0 = EnumByte.ENUM_VALUE_0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte0.fbe_size\n\n if (fbe_current_size + byte1.fbe_size) <= fbe_struct_size\n fbe_value.byte1 = byte1.get(EnumByte.ENUM_VALUE_1)\n else\n fbe_value.byte1 = EnumByte.ENUM_VALUE_1\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte1.fbe_size\n\n if (fbe_current_size + byte2.fbe_size) <= fbe_struct_size\n fbe_value.byte2 = byte2.get(EnumByte.ENUM_VALUE_2)\n else\n fbe_value.byte2 = EnumByte.ENUM_VALUE_2\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte2.fbe_size\n\n if (fbe_current_size + byte3.fbe_size) <= fbe_struct_size\n fbe_value.byte3 = byte3.get(EnumByte.ENUM_VALUE_3)\n else\n fbe_value.byte3 = EnumByte.ENUM_VALUE_3\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte3.fbe_size\n\n if (fbe_current_size + byte4.fbe_size) <= fbe_struct_size\n fbe_value.byte4 = byte4.get(EnumByte.ENUM_VALUE_4)\n else\n fbe_value.byte4 = EnumByte.ENUM_VALUE_4\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte4.fbe_size\n\n if (fbe_current_size + byte5.fbe_size) <= fbe_struct_size\n fbe_value.byte5 = byte5.get(EnumByte.ENUM_VALUE_5)\n else\n fbe_value.byte5 = EnumByte.ENUM_VALUE_5\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte5.fbe_size\n\n if (fbe_current_size + char0.fbe_size) <= fbe_struct_size\n fbe_value.char0 = char0.get(EnumChar.ENUM_VALUE_0)\n else\n fbe_value.char0 = EnumChar.ENUM_VALUE_0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char0.fbe_size\n\n if (fbe_current_size + char1.fbe_size) <= fbe_struct_size\n fbe_value.char1 = char1.get(EnumChar.ENUM_VALUE_1)\n else\n fbe_value.char1 = EnumChar.ENUM_VALUE_1\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char1.fbe_size\n\n if (fbe_current_size + char2.fbe_size) <= fbe_struct_size\n fbe_value.char2 = char2.get(EnumChar.ENUM_VALUE_2)\n else\n fbe_value.char2 = EnumChar.ENUM_VALUE_2\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char2.fbe_size\n\n if (fbe_current_size + char3.fbe_size) <= fbe_struct_size\n fbe_value.char3 = char3.get(EnumChar.ENUM_VALUE_3)\n else\n fbe_value.char3 = EnumChar.ENUM_VALUE_3\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char3.fbe_size\n\n if (fbe_current_size + char4.fbe_size) <= fbe_struct_size\n fbe_value.char4 = char4.get(EnumChar.ENUM_VALUE_4)\n else\n fbe_value.char4 = EnumChar.ENUM_VALUE_4\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char4.fbe_size\n\n if (fbe_current_size + char5.fbe_size) <= fbe_struct_size\n fbe_value.char5 = char5.get(EnumChar.ENUM_VALUE_5)\n else\n fbe_value.char5 = EnumChar.ENUM_VALUE_5\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char5.fbe_size\n\n if (fbe_current_size + wchar0.fbe_size) <= fbe_struct_size\n fbe_value.wchar0 = wchar0.get(EnumWChar.ENUM_VALUE_0)\n else\n fbe_value.wchar0 = EnumWChar.ENUM_VALUE_0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar0.fbe_size\n\n if (fbe_current_size + wchar1.fbe_size) <= fbe_struct_size\n fbe_value.wchar1 = wchar1.get(EnumWChar.ENUM_VALUE_1)\n else\n fbe_value.wchar1 = EnumWChar.ENUM_VALUE_1\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar1.fbe_size\n\n if (fbe_current_size + wchar2.fbe_size) <= fbe_struct_size\n fbe_value.wchar2 = wchar2.get(EnumWChar.ENUM_VALUE_2)\n else\n fbe_value.wchar2 = EnumWChar.ENUM_VALUE_2\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar2.fbe_size\n\n if (fbe_current_size + wchar3.fbe_size) <= fbe_struct_size\n fbe_value.wchar3 = wchar3.get(EnumWChar.ENUM_VALUE_3)\n else\n fbe_value.wchar3 = EnumWChar.ENUM_VALUE_3\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar3.fbe_size\n\n if (fbe_current_size + wchar4.fbe_size) <= fbe_struct_size\n fbe_value.wchar4 = wchar4.get(EnumWChar.ENUM_VALUE_4)\n else\n fbe_value.wchar4 = EnumWChar.ENUM_VALUE_4\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar4.fbe_size\n\n if (fbe_current_size + wchar5.fbe_size) <= fbe_struct_size\n fbe_value.wchar5 = wchar5.get(EnumWChar.ENUM_VALUE_5)\n else\n fbe_value.wchar5 = EnumWChar.ENUM_VALUE_5\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar5.fbe_size\n\n if (fbe_current_size + int8b0.fbe_size) <= fbe_struct_size\n fbe_value.int8b0 = int8b0.get(EnumInt8.ENUM_VALUE_0)\n else\n fbe_value.int8b0 = EnumInt8.ENUM_VALUE_0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b0.fbe_size\n\n if (fbe_current_size + int8b1.fbe_size) <= fbe_struct_size\n fbe_value.int8b1 = int8b1.get(EnumInt8.ENUM_VALUE_1)\n else\n fbe_value.int8b1 = EnumInt8.ENUM_VALUE_1\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b1.fbe_size\n\n if (fbe_current_size + int8b2.fbe_size) <= fbe_struct_size\n fbe_value.int8b2 = int8b2.get(EnumInt8.ENUM_VALUE_2)\n else\n fbe_value.int8b2 = EnumInt8.ENUM_VALUE_2\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b2.fbe_size\n\n if (fbe_current_size + int8b3.fbe_size) <= fbe_struct_size\n fbe_value.int8b3 = int8b3.get(EnumInt8.ENUM_VALUE_3)\n else\n fbe_value.int8b3 = EnumInt8.ENUM_VALUE_3\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b3.fbe_size\n\n if (fbe_current_size + int8b4.fbe_size) <= fbe_struct_size\n fbe_value.int8b4 = int8b4.get(EnumInt8.ENUM_VALUE_4)\n else\n fbe_value.int8b4 = EnumInt8.ENUM_VALUE_4\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b4.fbe_size\n\n if (fbe_current_size + int8b5.fbe_size) <= fbe_struct_size\n fbe_value.int8b5 = int8b5.get(EnumInt8.ENUM_VALUE_5)\n else\n fbe_value.int8b5 = EnumInt8.ENUM_VALUE_5\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b5.fbe_size\n\n if (fbe_current_size + uint8b0.fbe_size) <= fbe_struct_size\n fbe_value.uint8b0 = uint8b0.get(EnumUInt8.ENUM_VALUE_0)\n else\n fbe_value.uint8b0 = EnumUInt8.ENUM_VALUE_0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b0.fbe_size\n\n if (fbe_current_size + uint8b1.fbe_size) <= fbe_struct_size\n fbe_value.uint8b1 = uint8b1.get(EnumUInt8.ENUM_VALUE_1)\n else\n fbe_value.uint8b1 = EnumUInt8.ENUM_VALUE_1\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b1.fbe_size\n\n if (fbe_current_size + uint8b2.fbe_size) <= fbe_struct_size\n fbe_value.uint8b2 = uint8b2.get(EnumUInt8.ENUM_VALUE_2)\n else\n fbe_value.uint8b2 = EnumUInt8.ENUM_VALUE_2\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b2.fbe_size\n\n if (fbe_current_size + uint8b3.fbe_size) <= fbe_struct_size\n fbe_value.uint8b3 = uint8b3.get(EnumUInt8.ENUM_VALUE_3)\n else\n fbe_value.uint8b3 = EnumUInt8.ENUM_VALUE_3\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b3.fbe_size\n\n if (fbe_current_size + uint8b4.fbe_size) <= fbe_struct_size\n fbe_value.uint8b4 = uint8b4.get(EnumUInt8.ENUM_VALUE_4)\n else\n fbe_value.uint8b4 = EnumUInt8.ENUM_VALUE_4\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b4.fbe_size\n\n if (fbe_current_size + uint8b5.fbe_size) <= fbe_struct_size\n fbe_value.uint8b5 = uint8b5.get(EnumUInt8.ENUM_VALUE_5)\n else\n fbe_value.uint8b5 = EnumUInt8.ENUM_VALUE_5\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b5.fbe_size\n\n if (fbe_current_size + int16b0.fbe_size) <= fbe_struct_size\n fbe_value.int16b0 = int16b0.get(EnumInt16.ENUM_VALUE_0)\n else\n fbe_value.int16b0 = EnumInt16.ENUM_VALUE_0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b0.fbe_size\n\n if (fbe_current_size + int16b1.fbe_size) <= fbe_struct_size\n fbe_value.int16b1 = int16b1.get(EnumInt16.ENUM_VALUE_1)\n else\n fbe_value.int16b1 = EnumInt16.ENUM_VALUE_1\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b1.fbe_size\n\n if (fbe_current_size + int16b2.fbe_size) <= fbe_struct_size\n fbe_value.int16b2 = int16b2.get(EnumInt16.ENUM_VALUE_2)\n else\n fbe_value.int16b2 = EnumInt16.ENUM_VALUE_2\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b2.fbe_size\n\n if (fbe_current_size + int16b3.fbe_size) <= fbe_struct_size\n fbe_value.int16b3 = int16b3.get(EnumInt16.ENUM_VALUE_3)\n else\n fbe_value.int16b3 = EnumInt16.ENUM_VALUE_3\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b3.fbe_size\n\n if (fbe_current_size + int16b4.fbe_size) <= fbe_struct_size\n fbe_value.int16b4 = int16b4.get(EnumInt16.ENUM_VALUE_4)\n else\n fbe_value.int16b4 = EnumInt16.ENUM_VALUE_4\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b4.fbe_size\n\n if (fbe_current_size + int16b5.fbe_size) <= fbe_struct_size\n fbe_value.int16b5 = int16b5.get(EnumInt16.ENUM_VALUE_5)\n else\n fbe_value.int16b5 = EnumInt16.ENUM_VALUE_5\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b5.fbe_size\n\n if (fbe_current_size + uint16b0.fbe_size) <= fbe_struct_size\n fbe_value.uint16b0 = uint16b0.get(EnumUInt16.ENUM_VALUE_0)\n else\n fbe_value.uint16b0 = EnumUInt16.ENUM_VALUE_0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b0.fbe_size\n\n if (fbe_current_size + uint16b1.fbe_size) <= fbe_struct_size\n fbe_value.uint16b1 = uint16b1.get(EnumUInt16.ENUM_VALUE_1)\n else\n fbe_value.uint16b1 = EnumUInt16.ENUM_VALUE_1\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b1.fbe_size\n\n if (fbe_current_size + uint16b2.fbe_size) <= fbe_struct_size\n fbe_value.uint16b2 = uint16b2.get(EnumUInt16.ENUM_VALUE_2)\n else\n fbe_value.uint16b2 = EnumUInt16.ENUM_VALUE_2\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b2.fbe_size\n\n if (fbe_current_size + uint16b3.fbe_size) <= fbe_struct_size\n fbe_value.uint16b3 = uint16b3.get(EnumUInt16.ENUM_VALUE_3)\n else\n fbe_value.uint16b3 = EnumUInt16.ENUM_VALUE_3\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b3.fbe_size\n\n if (fbe_current_size + uint16b4.fbe_size) <= fbe_struct_size\n fbe_value.uint16b4 = uint16b4.get(EnumUInt16.ENUM_VALUE_4)\n else\n fbe_value.uint16b4 = EnumUInt16.ENUM_VALUE_4\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b4.fbe_size\n\n if (fbe_current_size + uint16b5.fbe_size) <= fbe_struct_size\n fbe_value.uint16b5 = uint16b5.get(EnumUInt16.ENUM_VALUE_5)\n else\n fbe_value.uint16b5 = EnumUInt16.ENUM_VALUE_5\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b5.fbe_size\n\n if (fbe_current_size + int32b0.fbe_size) <= fbe_struct_size\n fbe_value.int32b0 = int32b0.get(EnumInt32.ENUM_VALUE_0)\n else\n fbe_value.int32b0 = EnumInt32.ENUM_VALUE_0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b0.fbe_size\n\n if (fbe_current_size + int32b1.fbe_size) <= fbe_struct_size\n fbe_value.int32b1 = int32b1.get(EnumInt32.ENUM_VALUE_1)\n else\n fbe_value.int32b1 = EnumInt32.ENUM_VALUE_1\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b1.fbe_size\n\n if (fbe_current_size + int32b2.fbe_size) <= fbe_struct_size\n fbe_value.int32b2 = int32b2.get(EnumInt32.ENUM_VALUE_2)\n else\n fbe_value.int32b2 = EnumInt32.ENUM_VALUE_2\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b2.fbe_size\n\n if (fbe_current_size + int32b3.fbe_size) <= fbe_struct_size\n fbe_value.int32b3 = int32b3.get(EnumInt32.ENUM_VALUE_3)\n else\n fbe_value.int32b3 = EnumInt32.ENUM_VALUE_3\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b3.fbe_size\n\n if (fbe_current_size + int32b4.fbe_size) <= fbe_struct_size\n fbe_value.int32b4 = int32b4.get(EnumInt32.ENUM_VALUE_4)\n else\n fbe_value.int32b4 = EnumInt32.ENUM_VALUE_4\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b4.fbe_size\n\n if (fbe_current_size + int32b5.fbe_size) <= fbe_struct_size\n fbe_value.int32b5 = int32b5.get(EnumInt32.ENUM_VALUE_5)\n else\n fbe_value.int32b5 = EnumInt32.ENUM_VALUE_5\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b5.fbe_size\n\n if (fbe_current_size + uint32b0.fbe_size) <= fbe_struct_size\n fbe_value.uint32b0 = uint32b0.get(EnumUInt32.ENUM_VALUE_0)\n else\n fbe_value.uint32b0 = EnumUInt32.ENUM_VALUE_0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b0.fbe_size\n\n if (fbe_current_size + uint32b1.fbe_size) <= fbe_struct_size\n fbe_value.uint32b1 = uint32b1.get(EnumUInt32.ENUM_VALUE_1)\n else\n fbe_value.uint32b1 = EnumUInt32.ENUM_VALUE_1\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b1.fbe_size\n\n if (fbe_current_size + uint32b2.fbe_size) <= fbe_struct_size\n fbe_value.uint32b2 = uint32b2.get(EnumUInt32.ENUM_VALUE_2)\n else\n fbe_value.uint32b2 = EnumUInt32.ENUM_VALUE_2\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b2.fbe_size\n\n if (fbe_current_size + uint32b3.fbe_size) <= fbe_struct_size\n fbe_value.uint32b3 = uint32b3.get(EnumUInt32.ENUM_VALUE_3)\n else\n fbe_value.uint32b3 = EnumUInt32.ENUM_VALUE_3\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b3.fbe_size\n\n if (fbe_current_size + uint32b4.fbe_size) <= fbe_struct_size\n fbe_value.uint32b4 = uint32b4.get(EnumUInt32.ENUM_VALUE_4)\n else\n fbe_value.uint32b4 = EnumUInt32.ENUM_VALUE_4\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b4.fbe_size\n\n if (fbe_current_size + uint32b5.fbe_size) <= fbe_struct_size\n fbe_value.uint32b5 = uint32b5.get(EnumUInt32.ENUM_VALUE_5)\n else\n fbe_value.uint32b5 = EnumUInt32.ENUM_VALUE_5\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b5.fbe_size\n\n if (fbe_current_size + int64b0.fbe_size) <= fbe_struct_size\n fbe_value.int64b0 = int64b0.get(EnumInt64.ENUM_VALUE_0)\n else\n fbe_value.int64b0 = EnumInt64.ENUM_VALUE_0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b0.fbe_size\n\n if (fbe_current_size + int64b1.fbe_size) <= fbe_struct_size\n fbe_value.int64b1 = int64b1.get(EnumInt64.ENUM_VALUE_1)\n else\n fbe_value.int64b1 = EnumInt64.ENUM_VALUE_1\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b1.fbe_size\n\n if (fbe_current_size + int64b2.fbe_size) <= fbe_struct_size\n fbe_value.int64b2 = int64b2.get(EnumInt64.ENUM_VALUE_2)\n else\n fbe_value.int64b2 = EnumInt64.ENUM_VALUE_2\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b2.fbe_size\n\n if (fbe_current_size + int64b3.fbe_size) <= fbe_struct_size\n fbe_value.int64b3 = int64b3.get(EnumInt64.ENUM_VALUE_3)\n else\n fbe_value.int64b3 = EnumInt64.ENUM_VALUE_3\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b3.fbe_size\n\n if (fbe_current_size + int64b4.fbe_size) <= fbe_struct_size\n fbe_value.int64b4 = int64b4.get(EnumInt64.ENUM_VALUE_4)\n else\n fbe_value.int64b4 = EnumInt64.ENUM_VALUE_4\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b4.fbe_size\n\n if (fbe_current_size + int64b5.fbe_size) <= fbe_struct_size\n fbe_value.int64b5 = int64b5.get(EnumInt64.ENUM_VALUE_5)\n else\n fbe_value.int64b5 = EnumInt64.ENUM_VALUE_5\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b5.fbe_size\n\n if (fbe_current_size + uint64b0.fbe_size) <= fbe_struct_size\n fbe_value.uint64b0 = uint64b0.get(EnumUInt64.ENUM_VALUE_0)\n else\n fbe_value.uint64b0 = EnumUInt64.ENUM_VALUE_0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b0.fbe_size\n\n if (fbe_current_size + uint64b1.fbe_size) <= fbe_struct_size\n fbe_value.uint64b1 = uint64b1.get(EnumUInt64.ENUM_VALUE_1)\n else\n fbe_value.uint64b1 = EnumUInt64.ENUM_VALUE_1\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b1.fbe_size\n\n if (fbe_current_size + uint64b2.fbe_size) <= fbe_struct_size\n fbe_value.uint64b2 = uint64b2.get(EnumUInt64.ENUM_VALUE_2)\n else\n fbe_value.uint64b2 = EnumUInt64.ENUM_VALUE_2\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b2.fbe_size\n\n if (fbe_current_size + uint64b3.fbe_size) <= fbe_struct_size\n fbe_value.uint64b3 = uint64b3.get(EnumUInt64.ENUM_VALUE_3)\n else\n fbe_value.uint64b3 = EnumUInt64.ENUM_VALUE_3\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b3.fbe_size\n\n if (fbe_current_size + uint64b4.fbe_size) <= fbe_struct_size\n fbe_value.uint64b4 = uint64b4.get(EnumUInt64.ENUM_VALUE_4)\n else\n fbe_value.uint64b4 = EnumUInt64.ENUM_VALUE_4\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b4.fbe_size\n\n if (fbe_current_size + uint64b5.fbe_size) <= fbe_struct_size\n fbe_value.uint64b5 = uint64b5.get(EnumUInt64.ENUM_VALUE_5)\n else\n fbe_value.uint64b5 = EnumUInt64.ENUM_VALUE_5\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b5.fbe_size\n end",
"def attr_accessor(*fields)\n attr_reader *fields\n attr_writer *fields\n end",
"def fields=(value)\n @fields = value\n end",
"def only_mask_for column_name, *fields\n fields = bitfields if fields.empty?\n column = @@bitfields[column_name]\n max = bitfield_max(column_name)\n raise ArgumentError, \"Unknown column for bitfield: #{column_name}\" if column.nil?\n\n column.sum do |field_name, range|\n fields.include?(field_name) ? range.invert(max).sum{|i| 2 ** i} : 0\n end\n \n # fields.inject(\"0\" * (bitfield_max(column_name) + 1)) do |mask, field_name|\n # raise ArugmentError, \"Unknown field: #{field_name} for column #{column_name}\" if column[field_name].nil?\n # range = column[field_name]\n # mask[range] = \"1\" * range.count\n # mask\n # end.to_i(2)\n end",
"def any_of_number(*field_names)\n self.bits_for(*field_names).reduce(0) { |m, bit| m | (1 << bit) }\n end",
"def set_fields(fbe_value)\n fbe_current_offset = 0\n fbe_current_size = 0\n\n id.fbe_offset = fbe_current_offset\n fbe_field_size = id.set(fbe_value.id)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n symbol.fbe_offset = fbe_current_offset\n fbe_field_size = symbol.set(fbe_value.symbol)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n side.fbe_offset = fbe_current_offset\n fbe_field_size = side.set(fbe_value.side)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n type.fbe_offset = fbe_current_offset\n fbe_field_size = type.set(fbe_value.type)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n price.fbe_offset = fbe_current_offset\n fbe_field_size = price.set(fbe_value.price)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n volume.fbe_offset = fbe_current_offset\n fbe_field_size = volume.set(fbe_value.volume)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n # noinspection RubyUnnecessaryReturnValue\n fbe_current_size\n end",
"def bits_set\n (\"%b\" % self).count('1')\n #to_s(2).count('1') # alternative\n #count = 0 # alternative\n #byte = self.abs\n #count += byte & 1 and byte >>= 1 until byte == 0 # cf. http://snippets.dzone.com/posts/show/4233\n #count\n end",
"def setbit(key, offset, value); end",
"def setbit(key, offset, value); end",
"def field_m(op)\n (op & 0xfc000000) >> 26\nend",
"def field(name)\n attr_accessor name\n end",
"def set(index, numBits, value)\n andMask = 2**numBits - 1 # 000000001111\n andMask = andMask << (index % @@wordBits) # 000011110000\n andMask = andMask ^ @xorMask # 111100001111\n @bits[index/@@wordBits] &= andMask # bbbb0000bbbb\n valMask = value << (index % @@wordBits) # 0000vvvv0000\n @bits[index/@@wordBits] |= valMask # bbbbvvvvbbbb\n end",
"def initialize(bits_)\n @bits = nil\n @bits = bits_\n end",
"def bits\n raise \"A VoidCube cannot be modified.\"\n end",
"def _field_types\n special_attribute('@fieldTypes'.freeze)\n end",
"def fields=(fields)\n\n h.fields = fields\n end",
"def get_I32_field(field_name)\n\t\tend",
"def fields\n fc = FFI::MemoryPointer.new(:uint)\n rc = NWRFCLib.get_field_count(@desc, fc, @error)\n NWRFC.check_error(@error) if rc > 0\n fc = fc.read_uint\n fd = NWRFCLib::RFCFieldDesc.new\n # Make a list of field names\n fc.times.inject([]) {|array, index|\n rc = NWRFCLib.get_field_desc_by_index(@desc, index, fd.to_ptr, @error.to_ptr)\n NWRFC.check_error(@error) if rc > 0\n #@todo WARNING! our get_str method did not handle getting the name of the RESPTEXT parameter in STFC_DEEP_TABLE correctly\n # As a workaround, we use our read_string_dn method; do we need to use this elsewhere?\n #array << fd[:name].get_str.to_sym #<-The code with good intentions\n array << fd[:name].to_ptr.read_string_dn.uC.to_sym #<- Workaround; the way of the future?\n }\n end",
"def set_fields!(fields)\n @fields = fields\n make_readers!(self.fields)\n end",
"def init_fields(args={})\n args[:type] = @int32.new(args[:type] || PcapNG::IDB_TYPE.to_i)\n args[:block_len] = @int32.new(args[:block_len] || MIN_SIZE)\n args[:link_type] = @int16.new(args[:link_type] || 1)\n args[:reserved] = @int16.new(args[:reserved] || 0)\n args[:snaplen] = @int32.new(args[:snaplen] || 0)\n args[:options] = StructFu::String.new(args[:options] || '')\n args[:block_len2] = @int32.new(args[:block_len2] || MIN_SIZE)\n args\n end",
"def bits\n super.to_i\n end",
"def ndp_set_flags=(bits)\n case bits\n when \"000\"\n self.ndp_reserved = 0x00000000\n when \"001\"\n self.ndp_reserved = 0x20000000\n when \"010\"\n self.ndp_reserved = 0x40000000\n when \"011\"\n self.ndp_reserved = 0x60000000\n when \"100\"\n self.ndp_reserved = 0x80000000\n when \"101\"\n self.ndp_reserved = 0xa0000000\n when \"110\"\n self.ndp_reserved = 0xc0000000\n when \"111\"\n self.ndp_reserved = 0xe0000000\n end\n end",
"def field(name)\n _unique(name)\n value = _field(name)\n fields[name] = field_class.new(self, name, value)\n end",
"def get_F32_field(field_name)\n\t\tend",
"def set_fields(fbe_value)\n fbe_current_offset = 0\n fbe_current_size = 0\n\n id.fbe_offset = fbe_current_offset\n fbe_field_size = id.set(fbe_value.id)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n name.fbe_offset = fbe_current_offset\n fbe_field_size = name.set(fbe_value.name)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n state.fbe_offset = fbe_current_offset\n fbe_field_size = state.set(fbe_value.state)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n wallet.fbe_offset = fbe_current_offset\n fbe_field_size = wallet.set(fbe_value.wallet)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n asset.fbe_offset = fbe_current_offset\n fbe_field_size = asset.set(fbe_value.asset)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n orders.fbe_offset = fbe_current_offset\n fbe_field_size = orders.set(fbe_value.orders)\n # noinspection RubyUnusedLocalVariable\n fbe_current_offset += fbe_field_size\n fbe_current_size += fbe_field_size\n\n # noinspection RubyUnnecessaryReturnValue\n fbe_current_size\n end",
"def bit(index, name, attrs = {})\n if index.is_a?(Range)\n msb = index.first\n lsb = index.last\n msb, lsb = lsb, msb if lsb > msb\n pos = lsb\n bits = (msb - lsb).abs + 1\n elsif index.is_a?(Numeric)\n pos = index\n bits = 1\n else\n fail 'No valid index supplied when defining a register bit!'\n end\n\n # Traynor, this could be more elegant\n # its just a dirty way to make the value of the\n # key in @new_reg_atts hash array (ie name) tie to\n # a value that is an array of hashes describing\n # data for each scrambled bit\n attrs = attrs.merge(pos: pos, bits: bits)\n temparray = []\n if @new_reg_attrs[name].nil?\n @new_reg_attrs[name] = attrs\n else\n if @new_reg_attrs[name].is_a? Hash\n temparray.push(@new_reg_attrs[name])\n else\n temparray = @new_reg_attrs[name]\n end\n temparray.push(attrs)\n # added the sort so that the order the registers bits is described is not important\n @new_reg_attrs[name] = temparray.sort { |a, b| b[:pos] <=> a[:pos] }\n\n end\n end",
"def get_fields(fbe_value, fbe_struct_size)\n fbe_current_size = 4 + 4\n\n if (fbe_current_size + currency.fbe_size) <= fbe_struct_size\n fbe_value.currency = currency.get\n else\n fbe_value.currency = ''\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += currency.fbe_size\n\n if (fbe_current_size + amount.fbe_size) <= fbe_struct_size\n fbe_value.amount = amount.get(0.0)\n else\n fbe_value.amount = 0.0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += amount.fbe_size\n end",
"def write(bits)\n @role.send(:packed=, bits, false)\n end",
"def field(name, options={})\n (@value[:fields] ||= {}).update name.to_sym => options\n end",
"def fields\n @fields ||= self.class.fields.collect { |f| f.clone_for(self) }\n end",
"def to_s\n bits=\"\"\n @fields.each {|f| \n if f.kind_of? Fields::Field\n bits << f.bitstring\n else\n bits << f.to_bitstring\n end\n }\n [bits].pack('B*')\n end",
"def bit_length\n @bit_length ||= ECDSA.bit_length(field.prime)\n end",
"def field_named(name)\n ensure_setup!\n field_set.field_named(name)\n end",
"def bits\n self.class.bits.select { |bit, _| include? bit }.keys\n end",
"def set_subfields\n subfield = Struct.new(:code, :text)\n subfield_list = []\n @subfield_info.keys.sort.each { |k|\n code = @subfield_info[k][:code]\n value = @subfield_info[k][:value]\n subfield_list << subfield.new(code,value)\n }\n subfield_list\n end",
"def field(name); end",
"def get_U32_field(field_name)\n\t\tend",
"def []=(position, value)\n if value == 1\n @field[position / ELEMENT_WIDTH] |= 1 << (position % ELEMENT_WIDTH)\n elsif (@field[position / ELEMENT_WIDTH]) & (1 << (position % ELEMENT_WIDTH)) != 0\n @field[position / ELEMENT_WIDTH] ^= 1 << (position % ELEMENT_WIDTH)\n end\n end",
"def field(name, type = :string)\n type = type.to_sym\n type = :integer if type == :int\n\n class_name = marshal_class_name(name, type)\n\n fields << {:name => name.to_s, :type => type}\n if type == :string\n class_eval \"def #{name}; @#{name} ||= redis[field_key('#{name}')]; end\"\n class_eval \"def #{name}=(value); @#{name} = redis[field_key('#{name}')] = value; end\"\n else\n class_eval \"def #{name}; @#{name} ||= Marshal::#{class_name}.load(redis[field_key('#{name}')]); end\"\n class_eval \"def #{name}=(value); @#{name} = value; redis[field_key('#{name}')] = Marshal::#{class_name}.dump(value) end\"\n end\n end",
"def protocol_bits\n raise NotImplementedError\n end",
"def bits\n self.class.bits.select { |bit, _| include? bit }.keys\n end",
"def fields; end",
"def fields; end",
"def fields; end",
"def set_field(name, value)\n field = user_api.mdi.storage.tracking_fields_info.get_by_name(name, self.account)\n if field == nil\n RAGENT.api.mdi.tools.log.warn(\"set_field: Field #{name} not found in local configuration, abort\")\n return self.fields_data\n end\n\n # verify value type\n case field['field_type']\n when 'integer'\n raise \"#{value} is not an integer\" if \"#{value}\" != \"#{value.to_i}\"\n when 'string'\n # NOP\n when 'boolean'\n raise \"#{value} is not a boolean\" if (\"#{value}\" != 'true' and \"#{value}\" != 'false')\n when 'double'\n raise \"#{value} is not a double\" if \"#{value}\" != \"#{value.to_f}\"\n end\n\n raw_value = value\n # decode if Ragent. In VM mode, raw_value = value, nothing else to do\n # let's reproduce the device encoding\n if RAGENT.running_env_name == 'ragent'\n case field['field_type']\n when 'integer'\n # field['value'] = v.to_s.unpack('B*').first.to_i(2)\n # reverse: b64_value = Base64.strict_encode64([demo].pack(\"N\").unpack(\"cccc\").pack('c*'))\n raw_value = [value.to_i].pack(\"N\").unpack(\"cccc\").pack('c*')\n when 'string'\n # field['value'] = v.to_s\n raw_value = value\n when 'boolean'\n # field['value'] = v.to_s == \"\\x01\" ? true : false\n raw_value = value ? \"\\x01\" : \"\\x00\"\n when 'double'\n # field['value'] = v.unpack('E').first # little endian\n raw_value = [value.to_f].pack('E')\n end\n end\n\n field['name'] = name\n field['raw_value'] = raw_value\n field['value'] = value\n field['fresh'] = true\n self.recorded_at = Time.now.to_i\n self.fields_data << field\n self.id = nil # invalid track because some field has changed\n end",
"def fields\n @fields ||= FieldList.new\n end",
"def initialize\n @fields = []\n end",
"def number_field(object_name, method, options = T.unsafe(nil)); end",
"def field(sym, options={})\n options[:type] ||= Integer\n @fields[sym.to_sym] = options\n end",
"def []=(field_name, value); end",
"def create_accessors(field_name)\n define_singleton_method(field_name) { read_attribute(field_name) }\n define_singleton_method(\"#{field_name}=\") { |value| write_attribute(field_name, value) }\n end",
"def has_bits(*flags)\n options = flags.last.is_a?(Hash) ? flags.pop : {}\n options = { scopes: true, column: 'bits' }.merge(options)\n\n if options[:scopes]\n flags.each_with_index do |flag, index|\n define_scopes flag, options[:column], 1 << index\n end\n end\n\n mod = Module.new do\n define_method :bitten_bits do\n send options[:column]\n end\n\n define_method :bitten_bits= do |val|\n send :\"#{options[:column]}=\", val\n end\n\n flags.each_with_index do |flag, index|\n bit = 1 << index\n\n define_method :\"#{flag}?\" do\n bitten_bits & bit != 0\n end\n\n define_method :\"#{flag}=\" do |value|\n if TRUE_VALUES.include? value.to_s.downcase\n self.bitten_bits |= bit\n else\n self.bitten_bits &= ~bit\n end\n end\n end\n end\n\n include mod\n end",
"def flags=(flags)\n self.flag_attr = flags.map{|flag| flag.to_s}.join(\", \");\n end",
"def get_fields(fbe_value, fbe_struct_size)\n fbe_current_size = 4 + 4\n\n if (fbe_current_size + id.fbe_size) <= fbe_struct_size\n fbe_value.id = id.get\n else\n fbe_value.id = 0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += id.fbe_size\n\n if (fbe_current_size + symbol.fbe_size) <= fbe_struct_size\n fbe_value.symbol = symbol.get\n else\n fbe_value.symbol = ''\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += symbol.fbe_size\n\n if (fbe_current_size + side.fbe_size) <= fbe_struct_size\n fbe_value.side = side.get\n else\n fbe_value.side = OrderSide.new\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += side.fbe_size\n\n if (fbe_current_size + type.fbe_size) <= fbe_struct_size\n fbe_value.type = type.get\n else\n fbe_value.type = OrderType.new\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += type.fbe_size\n\n if (fbe_current_size + price.fbe_size) <= fbe_struct_size\n fbe_value.price = price.get(0.0)\n else\n fbe_value.price = 0.0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += price.fbe_size\n\n if (fbe_current_size + volume.fbe_size) <= fbe_struct_size\n fbe_value.volume = volume.get(0.0)\n else\n fbe_value.volume = 0.0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += volume.fbe_size\n end",
"def field(name, options = {})\n @fields ||= {}.with_indifferent_access\n @defaults ||= {}.with_indifferent_access\n @fields[name.to_s] = Field.new(name.to_s, options)\n @defaults[name.to_s] = options[:default] if options[:default]\n define_method(name) { read_attribute(name) }\n define_method(\"#{name}=\") { |value| write_attribute(name, value) }\n end",
"def initialize bit_string_or_hash\n if bit_string_or_hash.kind_of?(Hash)\n @attributes = bit_string_or_hash\n pack_bit_fields\n else\n parse_bit_fields(bit_string_or_hash) #.dup.freeze REMOVED: seems useless\n end\n end",
"def register_boolean_fields(*names)\n names.each do |name|\n boolean_fields[name.to_s] = {}\n boolean_fields[name.to_s][\"label\"] = name.to_s\n boolean_fields[name.to_s][\"value\"] = BOOLEAN_VALUE_FOR_ALL\n end\n end",
"def field(name, options = {})\n define_field name, Fields.adjust_field_options(self, options)\n end",
"def []=(position, value)\n value == 1 ? @field[position / ELEMENT_WIDTH] |= 1 << (position % ELEMENT_WIDTH) : @field[position / ELEMENT_WIDTH] ^= 1 << (position % ELEMENT_WIDTH)\n end",
"def set_field_names\n @field_names = nil\n @field_names = @upload.get_field_names if @upload\n end",
"def get_fields(fbe_value, fbe_struct_size)\n fbe_current_size = 4 + 4\n\n if (fbe_current_size + id.fbe_size) <= fbe_struct_size\n fbe_value.id = id.get\n else\n fbe_value.id = 0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += id.fbe_size\n\n if (fbe_current_size + name.fbe_size) <= fbe_struct_size\n fbe_value.name = name.get\n else\n fbe_value.name = ''\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += name.fbe_size\n\n if (fbe_current_size + state.fbe_size) <= fbe_struct_size\n fbe_value.state = state.get(State.initialized | State.bad)\n else\n fbe_value.state = State.initialized | State.bad\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += state.fbe_size\n\n if (fbe_current_size + wallet.fbe_size) <= fbe_struct_size\n fbe_value.wallet = wallet.get\n else\n fbe_value.wallet = Balance.new\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wallet.fbe_size\n\n if (fbe_current_size + asset.fbe_size) <= fbe_struct_size\n fbe_value.asset = asset.get\n else\n fbe_value.asset = nil\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += asset.fbe_size\n\n if (fbe_current_size + orders.fbe_size) <= fbe_struct_size\n orders.get(fbe_value.orders)\n else\n fbe_value.orders.clear\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += orders.fbe_size\n end",
"def value_fields\n %w(fields value).freeze\n end",
"def set(position)\n # duplicated code to avoid a method call\n @field[position / ELEMENT_WIDTH] |= 1 << (position % ELEMENT_WIDTH)\n end",
"def set_fields(fields)\n fields.each_pair do |name, value|\n set_field(name, value)\n end\n fields\n end",
"def field(name, *args)\n ensure_setup!\n field_set.field(name, *args)\n end"
] | [
"0.733397",
"0.6757972",
"0.6720495",
"0.65162027",
"0.6454409",
"0.61054504",
"0.6092267",
"0.60400337",
"0.60252166",
"0.58620846",
"0.58527654",
"0.57844204",
"0.5783991",
"0.57760525",
"0.5770837",
"0.57628065",
"0.57351655",
"0.5724615",
"0.5721556",
"0.5642044",
"0.5610001",
"0.5586454",
"0.55506235",
"0.5550409",
"0.5493617",
"0.5472074",
"0.5411984",
"0.54117376",
"0.5371428",
"0.53370637",
"0.53340346",
"0.53283024",
"0.52861345",
"0.52770996",
"0.52702034",
"0.5256195",
"0.52496576",
"0.5244005",
"0.52299535",
"0.52222514",
"0.5217141",
"0.52171034",
"0.5211795",
"0.5203128",
"0.5203128",
"0.51840174",
"0.51807237",
"0.5179678",
"0.5175016",
"0.51685894",
"0.51679575",
"0.516249",
"0.5161849",
"0.5139631",
"0.5138234",
"0.5135576",
"0.5135358",
"0.51319766",
"0.51212955",
"0.5120719",
"0.51107776",
"0.51060224",
"0.510456",
"0.5101071",
"0.508873",
"0.5073361",
"0.5070603",
"0.50591874",
"0.50510913",
"0.50471175",
"0.50272894",
"0.5023287",
"0.5005101",
"0.50041544",
"0.50021577",
"0.4999492",
"0.4998878",
"0.4998548",
"0.4998548",
"0.4998548",
"0.49975684",
"0.49939516",
"0.49851424",
"0.4980014",
"0.49743846",
"0.4971468",
"0.4970268",
"0.4964359",
"0.49621585",
"0.49611858",
"0.49598598",
"0.49453956",
"0.49384865",
"0.49364412",
"0.4920093",
"0.49198332",
"0.4917843",
"0.4908164",
"0.49077174",
"0.49006253",
"0.48990652"
] | 0.0 | -1 |
set only the unused bits of the underlying value | def __remainder=(v) # only keep relevant bits of the remainder
if v != 0
num_bits = self.class.type.size * 8
num_used_bits = self.class.map.value.collect { |v, _, _| v }.select { |v| v > 0 }.sum(:+)
if num_used_bits < num_bits
v &= ((( 1 << (num_bits - num_used_bits)) - 1) << num_used_bits)
else
v = 0
end
end
@__remainder = v
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_only(value)\n shift_out_with_index { |bit, i| bit.set_only = (value[i] == 0b1) }\n self\n end",
"def set_bits\n bits = []\n 0.upto(63) {|i| bits << i if set?(i)}\n bits\n end",
"def not\n ~@bits\n end",
"def []=(i,b)\n b = (b && b!=0) ? 1 : 0\n @v &= ~(1 << i)\n @v |= (b << i)\n b\n end",
"def set(index, numBits, value)\n andMask = 2**numBits - 1 # 000000001111\n andMask = andMask << (index % @@wordBits) # 000011110000\n andMask = andMask ^ @xorMask # 111100001111\n @bits[index/@@wordBits] &= andMask # bbbb0000bbbb\n valMask = value << (index % @@wordBits) # 0000vvvv0000\n @bits[index/@@wordBits] |= valMask # bbbbvvvvbbbb\n end",
"def reset_bitfields column_name, *fields\n mask = reset_mask_for column_name, *fields\n update_all \"#{column_name} = #{column_name} & #{mask}\"\n end",
"def setbit(key, offset, value); end",
"def setbit(key, offset, value); end",
"def unknown=(val)\n each { |bit| bit.unknown = val }\n end",
"def clr_only(value)\n shift_out_with_index { |bit, i| bit.clr_only = (value[i] == 0b1) }\n self\n end",
"def set(bit, value = true)\n if value\n @bits = union convert_bit(bit)\n @set_indexes << bit unless @set_indexes.include?(bit)\n elsif set?(bit)\n @bits = xor convert_bit(bit)\n @set_indexes.delete(bit)\n end\n\n @bits\n end",
"def []=(index, value)\n if value == 1\n @bits[index/@@wordBits] |= @bitMask[index % @@wordBits]\n else\n @bits[index/@@wordBits] &= (@bitMask[index % @@wordBits] ^ @xorMask)\n end\n end",
"def clearBitsIthrough0(num, i)\n mask = -1 << i\n mask & num\n end",
"def reset_flags\n @flags = { :zero => false , :plus => false ,\n :minus => false , :overflow => false }\n end",
"def setting(value)\n result = 0\n shift_out_with_index do |bit, i|\n result |= bit.setting(value[i])\n end\n result\n end",
"def not_in_place(min_bit, max_bit)\n # make sure that we have room for maxBit\n grow_to_include(max_bit)\n i = min_bit\n while i <= max_bit\n n = word_number(i)\n @bits[n] ^= bit_mask(i)\n i += 1\n end\n end",
"def unpad!()\n @value = unpad\n end",
"def ~()\n newval = (~ @value) & self.mask\n bounded? ? self.class.new(newval, @length) : self.class.new(newval)\n end",
"def reset_mask_for column_name, *fields\n fields = bitfields if fields.empty?\n max = bitfield_max(column_name)\n (0..max).sum{|i| 2 ** i} - only_mask_for(column_name, *fields)\n end",
"def bits_set\n (\"%b\" % self).count('1')\n #to_s(2).count('1') # alternative\n #count = 0 # alternative\n #byte = self.abs\n #count += byte & 1 and byte >>= 1 until byte == 0 # cf. http://snippets.dzone.com/posts/show/4233\n #count\n end",
"def set_zero_flag_from(actual_value)\n\t\t@flags.set_bit_at(ZERO_FLAG, (actual_value.zero? ? 1 : 0))\n\tend",
"def flags_clear!()\n @flags = 0\n end",
"def []=(i, v)\n raise ArgumentError, 'Invalid bit index' unless i >= 0 && i < size\n byte_i = i / 8\n bit_i = i % 8\n if !v || v == 0\n # clear bit\n @bytes[byte_i] = @bytes[byte_i] & (0xff ^ (0x80 >> bit_i))\n else\n # set bit\n @bytes[byte_i] = @bytes[byte_i] | (0x80 >> bit_i)\n end\n v\n end",
"def unaltered(value)\n value\n end",
"def unaltered(value)\n value\n end",
"def retain=(arg)\n @flags[0] = arg.is_a?(Integer) ? (arg == 0x1) : arg\n end",
"def opaque!(value)\n value | 0x000000ff\n end",
"def opaque!(value)\n value | 0x000000ff\n end",
"def unset_mask\n @masking_key = nil\n end",
"def unset_mask\n @masking_key = nil\n end",
"def test_006_clear()\n TestVals.each do |sVal|\n bs = BitString.new(sVal)\n tbs = bs.clear\n assert_equal(sVal.to_i(2),\n bs.to_i,\n \"Test that '#{sVal}'.clear() leaves original set\")\n assert_equal(0,\n tbs.to_i,\n \"Test that '#{sVal}'.clear() returns cleared bitstring\")\n bs.clear!\n assert_equal(0,\n bs.to_i,\n \"Test that '#{sVal}'.clear!() clears original bitstring\")\n end\n end",
"def set_bit integer, i\n integer | 0x80000000 >> i\n end",
"def set_logical_flags_from(actual_value, size)\n\t\t@flags.set_bit_at(OVERFLOW_FLAG, 0)\n\t\t@flags.set_bit_at(CARRY_FLAG, 0)\n\t\tset_zero_flag_from actual_value\n\t\tset_sign_flag_from actual_value, size - 1\n\t\tset_parity_flag_from actual_value, size\n\tend",
"def initialize\n initialize__bit_set(BITS)\n end",
"def general_purpose_flags\n 0b0000000000000000\n end",
"def clear(bit)\n set(bit, false)\n end",
"def empty_bits(_options = {})\n array_span = (0..(size - 1)).to_a\n empty_bits = array_span - used_bits\n empty_bits\n end",
"def not_in_place(max_bit)\n not_in_place(0, max_bit)\n end",
"def unset(position)\n # duplicated code to avoid a method call\n @field[position / ELEMENT_WIDTH] &= ~(1 << (position % ELEMENT_WIDTH))\n end",
"def delete(o)\n @val &= ~(1 << o) if valid_member?(o)\n self\n end",
"def set_all(hash)\n set_restricted(hash, false, false)\n end",
"def off!(indexes)\n Array(indexes).each do |index|\n validate_index(index)\n @bits &= ~(1 << index)\n end\n end",
"def |(value)\n value = _arg2int(value)\n value &= self.mask if (bounded?)\n bs = dup\n bs.from_i(value | bs.to_i)\n bs\n end",
"def []=(index, value)\n raise ArgumentError, \"index must be < #{size}\" if index >= size\n mask = 1 << index\n @number = value && value != 0 ? number | mask : number & ~mask\n end",
"def true_offset=(val)\n self.offset_flags = (offset_flags & 0xffff) | (val << 16)\n end",
"def all_no=(val)\n BOOL_ATTRIBUTES.each do |attr|\n self.instance_variable_set(\"@#{attr}\",val)\n end\n end",
"def immutable=(bool)\n nil\n end",
"def flags=(val)\n self.offset_flags = (offset_flags & 0xffffffffffff0000) | val\n end",
"def ndp_set_flags=(bits)\n case bits\n when \"000\"\n self.ndp_reserved = 0x00000000\n when \"001\"\n self.ndp_reserved = 0x20000000\n when \"010\"\n self.ndp_reserved = 0x40000000\n when \"011\"\n self.ndp_reserved = 0x60000000\n when \"100\"\n self.ndp_reserved = 0x80000000\n when \"101\"\n self.ndp_reserved = 0xa0000000\n when \"110\"\n self.ndp_reserved = 0xc0000000\n when \"111\"\n self.ndp_reserved = 0xe0000000\n end\n end",
"def set_auxiliary_carry_flag_from(expected_value)\n\t\t@flags.set_bit_at(AUX_CARRY_FLAG, (expected_value & 0xFFFFFFFF) > 0xF ? 1 : 0)\n\tend",
"def set(attr, value)\n raise ArgumentError, \"unknown attribute: #{attr}\" unless @masks[attr]\n case value\n when true\n @data |= @masks[attr]\n when false\n @data &= ~@masks[attr]\n end\n self\n end",
"def bitnot(b)\n (~b)&1\nend",
"def set\n false\n end",
"def no_scale_mask=(scale_mask)\n end",
"def []=(j, v)\n\t\tif (v & 1) == 1\n\t\t\t@bits |= 1 << j\n\t\telse\n\t\t\t@bits &= ~(1 << j)\n\t\tend\n\tend",
"def sweep!\n Array(flagged).each { |key| values.delete(key) }\n flagged.clear\n end",
"def reset_data(value = nil)\n # This method was originally setup to set the reset value by passing an argument\n if value\n shift_out_with_index { |bit, i| bit.reset_val = value[i] }\n self\n else\n data = 0\n shift_out_with_index do |bit, i|\n return bit.reset_data if bit.reset_data.is_a?(Symbol)\n\n data |= bit.reset_data << i\n end\n data\n end\n end",
"def clear_flags\n @regs.each(&:clear_flags)\n end",
"def set_mask\n raise WebSocket::Error::Frame::MaskTooShort if bytesize < 4\n @masking_key = self[0..3].bytes.to_a\n end",
"def ^(value)\n value = _arg2int(value)\n value &= self.mask if (bounded?)\n bs = dup\n bs.from_i(value ^ bs.to_i)\n bs\n end",
"def set_integer!(value)\n @objects = nil\n @memory = nil\n\n if value < 0\n self[:type] = :negative_integer\n self[:values][:i64] = value\n else\n self[:type] = :positive_integer\n self[:values][:u64] = value\n end\n end",
"def set_attrs(start, length, bits)\n updated = false\n for i in start ... (start+length)\n if (@exclusive & @attrs[i]) == 0 || (@exclusive & bits) != 0\n @attrs[i] |= bits\n updated = true\n end\n end\n updated\n end",
"def []=(position, value)\n if value == 1\n @field[position / ELEMENT_WIDTH] |= 1 << (position % ELEMENT_WIDTH)\n elsif (@field[position / ELEMENT_WIDTH]) & (1 << (position % ELEMENT_WIDTH)) != 0\n @field[position / ELEMENT_WIDTH] ^= 1 << (position % ELEMENT_WIDTH)\n end\n end",
"def []=(position, value)\n value == 1 ? @field[position / ELEMENT_WIDTH] |= 1 << (position % ELEMENT_WIDTH) : @field[position / ELEMENT_WIDTH] ^= 1 << (position % ELEMENT_WIDTH)\n end",
"def bit_small; @bit_small ||= gbit(8) end",
"def a(value)\n value & 0x000000ff\n end",
"def a(value)\n value & 0x000000ff\n end",
"def with_msb0\n @with_bit_order = :msb0\n self\n end",
"def []=(position, value)\n if value == 1\n @field.setbyte(position >> 3, @field.getbyte(position >> 3) | (1 << (byte_position(position) % 8)))\n else\n @field.setbyte(position >> 3, @field.getbyte(position >> 3) & ~(1 << (byte_position(position) % 8)))\n end\n end",
"def set?(num, mask)\n (num & mask) != 0\nend",
"def clear_damage_values\n mrts_conditional_drops_clear_damage_values\n @element = 0\n end",
"def data_b\n ~data & ((1 << size) - 1)\n end",
"def duplicate=(arg)\n @flags[3] = arg.is_a?(Integer) ? (arg == 0x1) : arg\n end",
"def mask\n raw_value\n end",
"def write pin, value\n if value == 0\n set_int_at(GPCLR0 + PI_BANK(pin), PI_BIT(pin))\n else\n set_int_at(GPSET0 + PI_BANK(pin), PI_BIT(pin))\n end\n end",
"def general_purpose_flags\n 0b0000000000000001\n end",
"def masked_val(value, mask)\n \nend",
"def to_set_bit_position_array\n BitMapping.number_to_set_bit_positions_array(number)\n end",
"def set_arithmetic_flags_except_cf_from(source_value, destination_value, expected_value, actual_value, size)\n\t\tmsb_index = size - 1\n\t\tset_zero_flag_from actual_value\n\t\tset_sign_flag_from actual_value, msb_index\n\t\tset_parity_flag_from actual_value, size\n\t\tset_overflow_flag_from source_value, destination_value, expected_value, actual_value, msb_index\n\tend",
"def clear_flags\n @flags = 0\n write\n end",
"def _zero_iv_bits(iv)\n iv = iv.dup\n iv.setbyte(8, iv.getbyte(8) & 0x7f)\n iv.setbyte(12, iv.getbyte(12) & 0x7f)\n iv\n end",
"def setbit(key, offset, value)\n node_for(key).setbit(key, offset, value)\n end",
"def reset_state\n @hidden.data = @hidden.data.fill(0) if @hidden.data\n end",
"def masking?; true; end",
"def not_available\n (0...@size).reject { |index| bit_on?(index) }\n end",
"def toggle_param_binary(obj)\n if obj.value.to_s == \"1\"\n obj.value = nil\n else\n obj.value = \"1\"\n end\n return obj\n end",
"def masking?; false; end",
"def with_bit_order\n @with_bit_order\n end",
"def set_parity_flag_from(actual_value, size)\n\t\tbits_set = 1 # Start at one because the PF is 1 if even and 0 if odd\n\t\tactual_value.each_bit(8) { |bit| bits_set += bit }\n\t\t@flags.set_bit_at(PARITY_FLAG, bits_set & 1)\n\tend",
"def set_bits(n, m, i, j)\n #Reset N's bits to zero from i to j(backwards starting with 0)\n #Set M's bit to N starting from j\n\n max = ~0\n #1's till position j, then zeroes\n left_bits = max - ((1<<j)-1)\n right_bits = ((1<<i)-1)\n mask = left_bits | right_bits\n (n & mask) | (m << i)\nend",
"def reset\n @assigned = false\n end",
"def bits=(bits)\n @bits = bits\n init_vars\n end",
"def clear_flags\n each(&:clear_flags)\n self\n end",
"def zero\n 0.upto(@words-1) do |w|\n @bits[w] = 0\n end\n end",
"def []=(position, value)\n if value == 1\n @field[position / ELEMENT_WIDTH] |= 1 << (position % ELEMENT_WIDTH)\n elsif (@field[position / ELEMENT_WIDTH]) & (1 << (position % ELEMENT_WIDTH)) != 0\n @field[position / ELEMENT_WIDTH] ^= 1 << (position % ELEMENT_WIDTH)\n end\n end",
"def mask_with_a_care!(mask)\n original_addr = @addr\n mask_without_a_care!(mask)\n @addr = original_addr unless self.class.mask_by_default\n return self\n end",
"def flags=(val)\n @val = val\n end",
"def non_blocking=(p1)\n #This is a stub, used for indexing\n end",
"def changed_bits(options = {})\n temp = named_bits.select { |name, bits| bits.data != bits.reset_val }\n temp.each do |r|\n Origen.log.info \"\\t\\t#{self.name}.#{r[0]} : #{r[1].value.to_hex}\".bold.blue\n end\n Origen.log.info ' '\n end",
"def set_all!(key)\n @klass.update_all(\"#{@column} = COALESCE(#{@column}, 0) | #{@maps[key]}\")\n end"
] | [
"0.6862802",
"0.6576071",
"0.6468951",
"0.64213556",
"0.63843465",
"0.63731176",
"0.62672704",
"0.62672704",
"0.6264778",
"0.6260983",
"0.62445617",
"0.6222784",
"0.6080633",
"0.60455716",
"0.59848833",
"0.5951321",
"0.5946551",
"0.5943943",
"0.59142035",
"0.5889624",
"0.5882466",
"0.5873423",
"0.5859952",
"0.58588773",
"0.58588773",
"0.585426",
"0.5837958",
"0.5837958",
"0.5820866",
"0.5820866",
"0.5815402",
"0.57802445",
"0.57728237",
"0.5763081",
"0.5744983",
"0.5733265",
"0.5727868",
"0.57087594",
"0.56189084",
"0.56035995",
"0.559336",
"0.559298",
"0.5586104",
"0.558401",
"0.5561736",
"0.55543196",
"0.5539159",
"0.55341667",
"0.55101115",
"0.5507872",
"0.55072135",
"0.5505681",
"0.54984885",
"0.54855114",
"0.54820985",
"0.5470997",
"0.5465878",
"0.5459704",
"0.5458586",
"0.54528046",
"0.5445018",
"0.5436996",
"0.54308593",
"0.54240453",
"0.5423185",
"0.5419606",
"0.5419606",
"0.54135114",
"0.5384816",
"0.5379675",
"0.5368232",
"0.5365607",
"0.53646356",
"0.53584075",
"0.53533596",
"0.53506017",
"0.5339721",
"0.53263766",
"0.53184485",
"0.5311937",
"0.5304842",
"0.52992773",
"0.52821726",
"0.5281533",
"0.52810085",
"0.5279091",
"0.52701956",
"0.5269829",
"0.52688795",
"0.52562195",
"0.5254981",
"0.5253933",
"0.52512944",
"0.52469695",
"0.52433383",
"0.5236437",
"0.5236164",
"0.5225247",
"0.52245843",
"0.52219546"
] | 0.6020718 | 14 |
When people refer to a mountain they can use Mount Name, Name Mountain, Mt. Name, Name mtn ...etc | def aliases
myAliases = ""
if ['Mount ',' Mountain',' Peak'].any? {|word| self.name.include?(word)}
short = shortname
myAliases = "#{short} Mountain, Mount #{short}, Mt. #{short}, Mt #{short}, #{shortname} mt, #{shortname} mtn, #{short} mtn., #{short} Peak"
end
myAliases
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_name\n \"#{brand.name} #{name} (#{vehicle_type.name})\"\n \n end",
"def snake_name\n @mountain.name.gsub(/./,'').gsub(/ /,'_').downcase\n end",
"def name\n 'occupant'\n end",
"def human_from_name; end",
"def appellant_fullname_readable\n appellant_name&.titleize\n end",
"def name; termid;end",
"def three_word_name; end",
"def name\n \"Lord Admiral #{@name}\"\n end",
"def full_name(patient)\n return unless patient\n\n if patient.family_name.blank? && patient.animal_type.present?\n return [patient.given_name,\n patient.middle_name,\n \"(#{animal_species_name(patient.animal_type)})\"].join(' ').squish\n end\n\n [patient.given_name,\n patient.middle_name,\n patient.family_name,\n patient.family_name2,\n patient.partner_name].join(' ').squish\n end",
"def spy_alias2 full_name\n alphabet = {\n vowels: ['a','e','i','o','u'],\n consonants: ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']\n }\n alias_name = full_name.downcase.split(' ').reverse!.join(' ').split(//)\n alias_name.map! do |letter|\n next_letter=letter\n if alphabet[:vowels].include?(letter)\n index=alphabet[:vowels].index(letter)\n if letter==alphabet[:vowels][-1]\n next_letter=alphabet[:vowels][0]\n else\n next_letter=alphabet[:vowels][index+1]\n end\n elsif alphabet[:consonants].include?(letter)\n index = alphabet[:consonants].index(letter)\n if letter==alphabet[:consonants][-1]\n next_letter=alphabet[:consonants][0]\n else\n next_letter=alphabet[:consonants][index+1]\n end\n end\n next_letter\n end\n alias_name=alias_name.join('').split(' ').map! {|name| name.capitalize}.join(' ')\nend",
"def display_name\n phylum_name\n end",
"def middle_name; end",
"def name\n return 'AedgSmallToMediumOfficeRoofConstruction'\n end",
"def name; \"#{accidental.name}f\"; end",
"def fullname()\n\t\t[self.name(), self.sport().titleize, self.variety().titleize].join(\" \")\n\tend",
"def name; nutrdesc; end",
"def name_with_middle; end",
"def display_name\n kingdom_name\n end",
"def alias_manager(name)\n name = name.downcase\n name = name.split(\" \").reverse.join(\" \")\n name = name.split(\"\")\n index = 0\n consonant = \"bcdfghjklmnpqrstvwqyz\"\n vowel = \"aeiou\"\n while index < name.length\n if\n !consonant.index(name[index]) && !vowel.index(name[index])\n elsif\n index_of_letter = vowel.index(name[index])\n new_letter = vowel[index_of_letter + 1]\n name[index] = new_letter\n else\n index_of_letter = consonant.index(name[index])\n new_letter = consonant[index_of_letter + 1]\n name[index]= new_letter\n end\n index += 1\n end\n name.join(\"\")\nend",
"def masculine_name; end",
"def ou_to_short(name)\n name = name.upcase\n\n case name\n when \"DSS IT SERVICE CENTER\", \"DSS IT SHARED SERVICE CENTER\"\n return \"IT\"\n when \"DSS HR/PAYROLL SERVICE CENTER\"\n return \"HR\"\n when \"CALIFORNIA HISTORY SS PROJECT\"\n return \"CHP\"\n when \"UC CENTER SACRAMENTO\"\n return \"UCCS\"\n when \"HEMISPHERIC INSTITUTE-AMERICAS\"\n return \"PHE\"\n when \"HISTORY PROJECT\", \"HISTORY PROJECT UCD\"\n return \"HP\"\n when \"SOCIAL SCIENCES PROGRAM\"\n return \"SSP\"\n when \"PHYSICAL EDUCATION PROGRAM\"\n return \"PHE\"\n when \"DSS RESEARCH SERVICE CENTER\"\n return \"RSC\"\n when \"GEOGRAPHY\"\n return \"GEO\"\n when \"ANTHROPOLOGY\"\n return \"ANT\"\n when \"COMMUNICATION\"\n return \"CMN\"\n when \"ECONOMICS\"\n return \"ECN\"\n when \"HISTORY\"\n return \"HIS\"\n when \"LINGUISTICS\"\n return \"LIN\"\n when \"MILITARY SCIENCE\"\n return \"MSC\"\n when \"PHILOSOPHY\"\n return \"PHI\"\n when \"POLITICAL SCIENCE\"\n return \"POL\"\n when \"PSYCHOLOGY\"\n return \"PSC\"\n when \"EASTERN ASIAN STUDIES\"\n return \"EAS\"\n when \"INTERNATIONAL RELATIONS\"\n return \"IRE\"\n when \"MIDDLE EAST/SOUTH ASIA STUDIES\", \"MIDDLE EAST/SOUTH ASIA PROGRAM\"\n return \"MSA\"\n when \"SCIENCE & TECHNOLOGY STUDIES\"\n return \"STS\"\n when \"CENTER FOR MIND AND BRAIN\", \"CENTER FOR MIND & BRAIN\"\n return \"CMB\"\n when \"SOCIOLOGY\"\n return \"SOC\"\n when \"COM, PHIL & LIN RED CLUSTER\"\n return \"RED\"\n when \"POLI SCI, IR ORANGE CLUSTER\", \"SOCIAL SCIENCE ORANGE CLUSTER\"\n return \"ORANGE\"\n when \"ECON, HIS, MS BLUE CLUSTER\", \"SOCIAL SCIENCES BLUE CLUSTER\"\n return \"BLUE\"\n when \"ANT, SOC GREEN CLUSTER\", \"SOCIAL SCIENCES GREEN CLUSTER\"\n return \"GREEN\"\n when \"L&S DEANS - SOCIAL SCIENCES\"\n return \"DEANS\"\n when \"PSYCH, CMB YELLOW CLUSTER\", \"SOCIAL SCIENCE YELLOW CLUSTER\"\n return \"YELLOW\"\n when \"EDUCATION - PH.D.\"\n return \"EDU\"\n when \"COMMUNITY DEVELOPMENT\"\n return \"ComDev\"\n when \"NEUROSCIENCE\", \"CENTER FOR NEUROSCIENCE\"\n return \"NueroSci\"\n when \"CENTER FOR INNOVATION STUDIES\"\n return \"CSIS\"\n when \"ASUCD\", \"UC DAVIS\", \"ASIAN AMERICAN\", \"UNIVERSITY EXTENSION\", \"CHEDDAR\", \"STUDENT EMPLOYMENT CENTER\",\n \"TEMPORARY EMPLOYMENT SERVICE\", \"CAMPUS RECREATION AND UNIONS\", \"CRESS DEPARTMENT\", \"LIBRARY\", \"POLICE\",\n \"COMPARATIVE LITERATURE\", \"PRIMATE CENTER\", \"L&S DEANS - U/G ED & ADVISING\", \"STATISTICS\",\n \"AGR & ENV SCI DEANS OFFICE\", \"OFFICE OF THE CHANCELLOR\", \"UNDERGRADUATE ADMISSIONS\",\n \"UNIVERSITY WRITING PROGRAM\", \"TEXTILES & CLOTHING\", \"STUDENT HOUSING\", \"ENGLISH\", \"ANIMAL SCIENCE\",\n \"IRB ADMINISTRATION\", \"SCHOOL OF LAW-DEANS OFFICE\", \"STUDENT ACADEMIC SUCCESS CTR\", \"GERMAN & RUSSIAN\",\n \"INTERCOLLEGIATE ATHLETICS\", \"HUMAN ECOLOGY\", \"GRADUATE DIVISION\", \"MED: NEUROLOGY\",\n \"ENVIRONMENTAL TOXICOLOGY\", \"SCHOOL OF MED - STAFF\", \"L&S DEANS - DEVELOPMENT\",\n \"TEMPORARY EMPLOYMENT POOL ADMN\", \"SCHOOL OF MED - APS\", \"MED: GENERAL PEDIATRICS\",\n \"MED:PSYCHIATRY & BEHAV SCI\", \"NATIVE AMERICAN STUDIES\", \"ART\", \"VP UNDERGRADUATE EDUCATION\", \"GEOLOGY\",\n \"VM: CTR COMPARATIVE MEDICINE\", \"ENGR COMPUTER SCIENCE\", \"MED: DIV OF INTERNAL MED\",\n \"FM: CUSTODIAL SERVICES\", \"VOORHIES ADMINISTRATIVE UNIT\", \"MED: OPHTHALMOLOGY\", \"MED: PUBLIC HEALTH SCIENCES\",\n \"NEURO PHYSIO & BEHAVIOR\", \"INST OF TRANSPORTATION STUDIES\", \"ENVIRONMENTAL HEALTH & SAFETY\",\n \"MEDIEVAL STUDIES\", \"EDUCATION\", \"ACADEMIC AFFAIRS\", \"ANR SUSTAINABLE AG PROG\"\n return nil\n else\n Rails.logger.warn \"AD Sync: Missing OU for translation to container name: #{name}\"\n ActivityLog.err!(\"Could not translate unknown organization to AD group equivalent: #{name}\", ['active_directory'])\n end\n\n return false\nend",
"def two_word_name; end",
"def match_to_preflabel(name)\n name = name.downcase\n case name\n when /reconstruction/\n standard_name = 'University of York. Post-war Reconstruction and'\\\n ' Development Unit'\n when /applied human rights/\n standard_name = 'University of York. Centre for Applied Human Rights'\n when /health economics/\n standard_name = 'University of York. Centre for Health Economics'\n when /health sciences/\n standard_name = 'University of York. Department of Health Sciences'\n when /lifelong learning/\n standard_name = 'University of York. Centre for Lifelong Learning'\n when /medieval studies/\n standard_name = 'University of York. Centre for Medieval Studies'\n when /renaissance/\n standard_name = 'University of York. Centre for Renaissance and Early'\\\n ' Modern Studies'\n when /reviews/\n standard_name = 'University of York. Centre for Reviews and'\\\n ' Disseminations'\n when /women/\n standard_name = \"University of York. Centre for Women's Studies\"\n when /school of social and political science/\n standard_name = 'University of York. School of Social and Political'\\\n ' Science'\n when /social policy/\n standard_name = 'University of York. Department of Social Policy and'\\\n ' Social Work'\n when /school of politics economics and philosophy/\n standard_name = 'University of York. School of Politics Economics and'\\\n ' Philosophy'\n when /politics/\n standard_name = 'University of York. Department of Politics'\n when /economics and related/\n standard_name = 'University of York. Department of Economics and Related'\\\n ' Studies'\n when /economics and philosophy/\n standard_name = 'University of York. School of Politics Economics and'\\\n ' Philosophy'\n when /history of art/\n standard_name = 'University of York. Department of History of Art'\n when /history/\n standard_name = 'University of York. Department of History'\n when /electronic/\n standard_name = 'University of York. Department of Electronic Engineering'\n when /theatre/\n standard_name = 'University of York. Department of Theatre, Film and'\\\n ' Television'\n when /physics/\n standard_name = 'University of York. Department of Physics'\n when /computer/\n standard_name = 'University of York. Department of Computer Science'\n when /psychology/\n standard_name = 'University of York. Department of Psychology'\n when /law/\n standard_name = 'University of York. York Law School'\n when /mathematics/\n standard_name = 'University of York. Department of Mathematics'\n when /advanced architectural/\n standard_name = 'University of York. Institute of Advanced Architectural'\\\n ' Studies'\n when /conservation/\n standard_name = 'University of York. Centre for Conservation Studies'\n when /eighteenth century/\n standard_name = 'University of York. Centre for Eighteenth Century\n Studies'\n when /chemistry/\n standard_name = 'University of York. Department of Chemistry'\n when /sociology/\n standard_name = 'University of York. Department of Sociology'\n when /education/\n standard_name = 'University of York. Department of Education'\n when /music/\n standard_name = 'University of York. Department of Music'\n when /archaeology/\n standard_name = 'University of York. Department of Archaeology'\n when /biology/\n standard_name = 'University of York. Department of Biology'\n when /biochemistry/ # confirmed with metadata team - recheck?\n standard_name = 'University of York. Department of Biology'\n when /english and related/ # confirmed directly with English department\n standard_name = 'University of York. Department of English and Related'\\\n ' Literature'\n when /philosophy/\n standard_name = 'University of York. Department of Philosophy'\n when /management studies/\n standard_name = 'University of York. Department of Management Studies'\n when /management school/\n # older versionof department name which should be retained if match found\n standard_name = 'University of York. The York Management School'\n when /language and linguistic science/\n standard_name = 'University of York. Department of Language and'\\\n ' Linguistic Science'\n when /language and lingusitic science/ # deal with common typo\n standard_name = 'University of York. Department of Language and'\\\n ' Linguistic Science'\n when /for all/ # this is 'languages for all' but in some records 'language'\n standard_name = 'University of York. Department of Language and'\\\n ' Linguistic Science. Languages for All'\n when /hull/\n standard_name = 'Hull York Medical School'\n when /international pathway/\n standard_name = 'University of York. International Pathway College'\n when /school of criminology/\n standard_name = 'University of York. School of Criminology'\n when /natural sciences/\n standard_name = 'University of York. School of Natural Sciences'\n when /environment and geography/ # order important, more precise must be first\n standard_name = 'University of York. Department of Environment and Geography'\n when /environment/\n standard_name = 'University of York. Environment Department'\n else\n standard_name = 'COULD NOT MATCH ' + name\n end\n standard_name\n end",
"def layar_name\n \t\"apollo\" + self.name.strip.downcase.gsub(/[^a-z0-9]/, '')\n end",
"def short_name \r\n name.gsub(/([A-Z])[^A-Z]+/, '\\1')\r\n end",
"def full_name\n return \"#{make.name} #{name}\"\n end",
"def full_name\n name\n end",
"def first_name_men; end",
"def district_name(name)\n if name.to_s[/\\A[\\dA-Z]+\\z/]\n \"District #{name}\"\n else\n name\n end\n end",
"def create_multi_name\n base_name = String.new(Faker::Games::ElderScrolls.creature)\n if base_name.split.size == 1\n adjective = Spicy::Proton.adjective.capitalize\n new_name = base_name.split.unshift(adjective)\n new_name.join(' ')\n else\n return base_name\n end\n end",
"def veteran_name_object\n FullName.new(veteran_first_name, veteran_middle_initial, veteran_last_name)\n end",
"def name\n return 'AedgSmallToMediumOfficeExteriorDoorConstruction'\n end",
"def street_name; end",
"def half_wind_abbreviation; end",
"def band_name(name)\n return name.to_s.capitalize << name.to_s[1..-1] if name[0] == name[-1]\n\n article = 'The'\n article << ' ' << name.to_s.capitalize\nend",
"def full_name\n \tnombre + \" \" + apellidos\n end",
"def fullName()\n \t@first + \" \" + @middle + \" \" + @last\n end",
"def spy_alias1 full_name\n alias_name = full_name.downcase.split(' ').reverse!.join(' ').split(//)\n vowels=['a','e','i','o','u']\n alias_name.map! do |letter|\n next_vowel=letter\n vowels.each_index do |index|\n if vowels[index]=='u'&&letter==vowels[index]\n next_vowel='a'\n elsif letter==vowels[index]\n next_vowel=vowels[index+1]\n end\n end\n next_vowel\n end\n \n consonants=['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']\n alias_name.map! do |letter|\n next_consonant=letter\n consonants.each_index do |index|\n if consonants[index]=='z'&&letter==consonants[index]\n next_consonant='b'\n elsif letter==consonants[index]\n next_consonant=consonants[index+1]\n end\n end\n next_consonant\n end\n \n alias_name=alias_name.join('').split(' ').map! {|name| name.capitalize}.join(' ')\nend",
"def full_name(entry)\n \"#{entry.first_name} #{entry.last_name}\"\n end",
"def name\n return 'AedgSmallToMediumOfficeExteriorWallConstruction'\n end",
"def full_name\n \"#{type_etablissement.nom} #{nom}\"\n end",
"def insured_name\n if @eob_type != 'Patient'\n id, qual = @eob.member_id_and_qualifier\n ['NM1', 'IL', '1', @eob.subscriber_last_name, @eob.subscriber_first_name,\n @eob.subscriber_middle_initial, '', @eob.subscriber_suffix, qual,id].trim_segment.join(@element_seperator)\n end\n end",
"def names\n case name\n when \"Road\"\n [nil, \"\", 'Circuit', \"Criterium\", \"Road\", \"Time Trial\", \"Singlespeed\", \"Tour\"]\n when \"Mountain Bike\"\n ['Downhill', 'Mountain Bike']\n else\n [name]\n end\n end",
"def get_full_name\n description\n end",
"def name\n full_name\n end",
"def name\n \"Town Hall\"\n end",
"def augmented_name_for(_patient)\n name\n end",
"def name\n return \"Canadian Add Unitary and Apply Standard\"\n end",
"def alias_manager(covert_spy_name)\n\n spy_name = covert_spy_name.downcase.split(' ')\n reversed_spy_name = spy_name.reverse\n first_name = reversed_spy_name.first.to_s\n last_name = reversed_spy_name.last.to_s\n full_name = first_name + \" \" + last_name\n full_name_id = full_name.gsub(/[abcdefghijklmnopqrstuvwxyz]/, 'a' => 'e', 'b' => 'c', 'c' => 'd', 'd' => 'f', 'e' => 'i', 'f' => 'g', 'g' => 'h', 'h' => 'j', 'i' => 'o', 'j' => 'k', 'k' => 'l', 'l' => 'm', 'm' => 'n', 'n' => 'p', 'o' => 'u', 'p' => 'q', 'q' => 'r', 'r' => 's', 's' => 't', 't' => 'v', 'u' => 'a', 'v' => 'w', 'w' => 'x', 'x' => 'y', 'y' => 'z', 'z' => 'b')\n full_name_idx = full_name_id.split.map {|x| x.capitalize}.join(' ')\nend",
"def get_standard_name(name)\n # BACHELORS\n if @medicine_surgery_bachelors.include? name\n standard_name = 'Bachelor of Medicine, Bachelor of Surgery (MBBS)'\n elsif @med_sci_bachelors.include? name\n standard_name = 'Bachelor of Medical Science (BMedSci)'\n elsif @science_bachelors.include? name\n standard_name = 'Bachelor of Science (BSc)'\n elsif @art_bachelors.include? name\n standard_name = 'Bachelor of Arts (BA)'\n elsif @philosophy_bachelors.include? name\n standard_name = 'Bachelor of Philosophy (BPhil)'\n elsif @engineering_bachelors.include? name\n standard_name = 'Bachelor of Engineering (BEng)'\n elsif @law_bachelors.include? name\n standard_name = 'Bachelor of Laws (LLB)'\n # MASTERS\n elsif @philosophy_masters_by_pubs.include? name\n standard_name = 'Master of Philosophy by publications (MPhil)'\n elsif @philosophy_masters.include? name\n standard_name = 'Master of Philosophy (MPhil)'\n elsif @art_masters_by_research.include? name\n standard_name = 'Master of Arts (by research) (MA (by research))'\n elsif @art_masters.include? name\n standard_name = 'Master of Arts (MA)'\n elsif @science_masters_by_research.include? name\n standard_name = 'Master of Science (by research) (MSc (by research))'\n elsif @science_masters_by_thesis.include? name\n standard_name = 'Master of Science (by thesis) (MSc (by thesis))'\n elsif @science_masters_msc.include? name\n standard_name = 'Master of Science (MSc)'\n elsif @science_masters_msci.include? name\n standard_name = 'Master of Science (MSci)'\n elsif @laws_masters.include? name\n standard_name = 'Master of Laws (LLM)'\n elsif @law_masters.include? name\n standard_name = 'Master of Law (MLaw)'\n elsif @public_admin_masters.include? name\n standard_name = 'Master of Public Administration (MPA)'\n elsif @biology_masters.include? name\n standard_name = 'Master of Biology (MBiol)'\n elsif @bio_chem_masters.include? name\n standard_name = 'Master of Biochemistry (MBiochem)'\n elsif @bio_med_masters.include? name\n standard_name = 'Master of Biomedical Science (MBiomedsci)'\n elsif @chemistry_masters.include? name\n standard_name = 'Master of Chemistry (MChem)'\n elsif @engineering_masters.include? name\n standard_name = 'Master of Engineering (MEng)'\n elsif @math_masters.include? name\n standard_name = 'Master of Mathematics (MMath)'\n elsif @physics_masters.include? name\n standard_name = 'Master of Physics (MPhys)'\n elsif @psych_masters.include? name\n standard_name = 'Master of Psychology (MPsych)'\n elsif @env_masters.include? name\n standard_name = 'Master of Environment (MEnv)'\n elsif @nursing_masters.include? name\n standard_name = 'Master of Nursing (MNursing)'\n elsif @public_health_masters.include? name\n standard_name = 'Master of Public Health (MPH)'\n elsif @soc_work_and_sci_masters.include? name\n standard_name = 'Master of Social Work and Social Science (MSWSS)'\n # order crucial so more specific name above is searched for first\n elsif @social_work_masters.include? name\n standard_name = 'Master in Social Work (MSocW)'\n elsif @research_masters.include? name\n standard_name = 'Master of Research (MRes)'\n # DOCTORATES\n elsif @letters_docts.include? name\n standard_name = 'Doctor of Letters (DLitt)'\n elsif @music_docts.include? name\n standard_name = 'Doctor of Music (DMus)'\n elsif @science_docts.include? name\n standard_name = 'Doctor of Science (ScD)'\n elsif @engineering_docts.include? name\n standard_name = 'Doctor of Engineering (EngD)'\n elsif @medical_docts_by_pubs.include? name\n standard_name = 'Doctor of Medicine by publications (MD)'\n elsif @medical_docts.include? name\n standard_name = 'Doctor of Medicine (MD)'\n elsif @philosophy_docts_by_pubs.include? name\n standard_name = 'Doctor of Philosophy by publications (PhD)'\n elsif @philosophy_docts.include? name\n standard_name = 'Doctor of Philosophy (PhD)'\n\n # OTHER EXAMS\n elsif @foundation_degrees.include? name\n standard_name = 'Foundation Degree (FD)'\n elsif @cert_hes.include? name\n standard_name = 'Certificate of Higher Education (CertHE)'\n elsif @dip_hes.include? name\n standard_name = 'Diploma of Higher Education (DipHE)'\n elsif @grad_certs.include? name\n standard_name = 'Graduate Certificate (GradCert)'\n elsif @grad_diplomas.include? name\n standard_name = 'Graduate Diploma (GradDip)'\n elsif @uni_certs.include? name\n standard_name = 'University Certificate'\n elsif @foundation_certs.include? name\n standard_name = 'Foundation Certificate (F Cert)'\n elsif @foundation.include? name\n standard_name = 'Foundation'\n elsif @pre_masters.include? name\n standard_name = 'Pre-Masters'\n elsif @conservation_diplomas.include? name\n standard_name = 'Postgraduate Diploma in Conservation Studies (PGDip)'\n elsif @medieval_diplomas.include? name\n standard_name = 'Postgraduate Diploma in Medieval Studies (PGDip)'\n # this is more general so crucial it is tested AFTER more specific diplomas\n elsif @pg_diplomas.include? name\n standard_name = 'Postgraduate Diploma (PGDip)'\n elsif @pgces.include? name\n standard_name = 'Postgraduate Certificate in Education (PGCE)'\n elsif @pg_medical_certs.include? name\n standard_name = 'Postgraduate Certificate in Medical Education (PGCert)'\n elsif @cpds.include? name\n standard_name = 'Continuing Professional Development (CPD)'\n elsif @pg_certs.include? name\n standard_name = 'Postgraduate Certificate (PgCert)'\n elsif @cefrs.include? name\n standard_name = 'CEFR Module'\n else\n # UNMATCHED\n standard_name = 'COULD NOT MATCH ' + name\n end\n standard_name\n end",
"def full_name\n name\n end",
"def full_name\n f_name + \" \" + l_name \n end",
"def street_name\n\n end",
"def middle_name\n self.dig_for_string(\"agentSummary\", \"middleName\")\n end",
"def full_name\n full_name = object.first_name + \" \" + object.last_name\n if object.profile.try(:search_engine_privacy).present?\n display_name = object.profile.try(:search_engine_privacy) == \"Show my full name\" ? full_name : object.first_name + \" \" + object.last_name.chr\n else\n display_name = full_name\n end\n return display_name \n end",
"def name \n @this_dogs_name\n end",
"def reformat_twofaced_names(card)\n end",
"def name = (name)",
"def company_name\n name.left_name\nend",
"def names\n nameparts = name.split(' ')\n firstinitial = nameparts.second ? \"#{firstname[0, 1]}.\" : ''\n secondname = nameparts.third ? nameparts.second : ''\n secondinitial = nameparts.third ? \"#{secondname[0, 1]}.\" : ''\n middlenames = nameparts.length > 2 ? nameparts.from(1).to(nameparts.from(1).length - 2) : []\n middleinitials = ''\n middlenames.each_with_index do |name, index|\n middleinitials << ' ' if index.positive?\n middleinitials << \"#{name.to_s[0, 1]}.\"\n end\n lastname = nameparts.last\n names = []\n names << full_name # Joseph Aloysius Hansom\n names << \"#{title} #{name}\" if titled? # Sir Joseph Aloysius Hansom\n names += aka # Boz, Charlie Cheese, and Crackers\n names << \"#{title} #{firstinitial} #{middleinitials} #{lastname}\" if titled? && nameparts.length > 2\n names << \"#{title} #{firstinitial} #{lastname}\" if titled? && nameparts.length > 1\n names << name if name != full_name # Joseph Aloysius Hansom\n if name.include? ',' # George Inn, Barcombe\n names << name.split(/,/).first\n return names\n end\n names << \"#{title} #{name.split(/ of /).first}\" if name.include?(' of ') && titled? # King Charles II [of England]\n names << name.split(/ of /).first if name.include?(' of ') # [King] Charles II [of England]\n names << \"#{firstname} #{middleinitials} #{lastname}\" if nameparts.length > 2 # Joseph A[loysius]. R[obert]. Hansom\n names << \"#{firstinitial} #{middleinitials} #{lastname}\" if nameparts.length > 2 # J. A. R. Hansom\n names << \"#{firstname} #{nameparts.second} #{lastname}\" if nameparts.length > 2 # Joseph Aaron Hansom\n names << \"#{firstname} #{secondinitial} #{lastname}\" if nameparts.length > 2 # Joseph A. Hansom\n names << \"#{firstinitial} #{secondname} #{lastname}\" if nameparts.length > 2 # J. Aaron Hansom\n names << \"#{title} #{firstname} #{lastname}\" if nameparts.length > 2 && titled? # Sir Joseph Hansom\n names << \"#{firstname} #{lastname}\" if nameparts.length > 2 # Joseph Hansom\n names << \"#{firstinitial} #{lastname}\" if nameparts.length > 1 # J. Hansom\n names << \"#{title} #{lastname}\" if titled? # Lord Carlisle\n names << \"#{title} #{firstname}\" if titled? # Sir William\n names << firstname if nameparts.length > 1 # Charles\n names << lastname if nameparts.length > 1 # Kitchener\n names.uniq\n end",
"def display_name\n full_name.join(\" \")\n end",
"def display_name\n name # !pseudonym.blank? ? pseudonym : name\n end",
"def abbreviation; end",
"def abbreviation; end",
"def abbreviation; end",
"def abbreviation; end",
"def name\n @name ||= details.at(\"h1.header span[itemprop='name']\").text.strip.clean_name\n end",
"def human_to_name; end",
"def fullname\n name\n end",
"def name(type=:short)\n if type == :short && !nickname.blank?\n nickname\n elsif type == :short && displayName\n first, last = displayName.split\n \"#{first} #{last[0]}\"\n elsif type == :full && displayName\n displayName\n else\n umbcusername\n end\n end",
"def name\n @this_dogs_name\n end",
"def full_name\n self.name ? \"#{self.name.split(' ')[0..-2].join(' ')}, #{self.name.split(' ')[-1]}\" : ''\n end",
"def new_alias(full_name)\r\n\tnames = full_name.split(\" \")\r\n\tnames.reverse!\r\n\tnames.map! {|each_name| each_name.split(\"\")}\r\n\tnames.map! do |namearray|\r\n\t namearray.map! do |letter|\r\n\t if letter == \"z\"\r\n\t letter = \"a\"\r\n\t else letter.next!\r\n\t end\r\n\tend\r\n\tnames = namearray.join(\"\")\r\n\tend\r\nend",
"def full_name\n [@owner, @name].join('/')\n end",
"def first_name_women; end",
"def name\n @this_dogs_name\n end",
"def name\n @this_dogs_name\n end",
"def name\n @this_dogs_name\n end",
"def name\n @this_dogs_name\n end",
"def guard_name(p)\n [p.first_name, p.last_name, p.relation].join(' ')\n end",
"def full_name\n '(unknown)'\n end",
"def ausgabe\n\t\t@name\n\t\n\tend",
"def town_names(amount,location)\n starts=['Bed','Brunn','Dun','Far','Glen','Tarn']\n middles=['ding','fing','ly','ston']\n ends=['borough','burg','ditch','hall','pool','ville','way','worth']\n near_water=['falls','-on-sea']\n mountain=['Mount ', 'The hills of ']\n names=[]\n\n amount.times do\n if location == 'near_water'\n names.push(starts.sample+middles.sample+ends.sample+near_water.sample)\n elsif location == 'mountain'\n names.push(mountain.sample+starts.sample+middles.sample+ends.sample)\n elsif location == 'short_name'\n names.push(starts.sample+ends.sample)\n else\n names.push(starts.sample+middles.sample+ends.sample)\n end\n end\n return names\nend",
"def patient_name\n member_id, qualifier = eob.member_id_and_qualifier\n patient_name_elements = []\n patient_name_elements << 'NM1'\n patient_name_elements << 'QC'\n patient_name_elements << '1'\n patient_name_elements << eob.patient_last_name\n patient_name_elements << eob.patient_first_name\n patient_name_elements << eob.patient_middle_initial\n patient_name_elements << ''\n patient_name_elements << eob.patient_suffix\n patient_name_elements << qualifier\n patient_name_elements << member_id\n patient_name_elements = Output835.trim_segment(patient_name_elements)\n patient_name_elements.join(@element_seperator)\n end",
"def normal_name(text)\n\t\t\tar = text.split(', ')\n\t\t\tlastname = ar[0]\n\t\t\tfirstpart = ar[1]\n\t\t\tfirstname = firstpart.gsub(/[[:upper:]]\\./, '').strip\n\t\t\tfirstname + ' ' + lastname\n\t\tend",
"def full_name(delim = ', ')\n n = name\n n += \"#{delim}#{borough}\" if !borough.nil?\n n\n end",
"def briefingName \n \"briefingName\" \n end",
"def fullName()\n return first + \" \" + middle + \" \" + last\n end",
"def undercover_name(name)\n name.downcase.split(' ').map!{|name| name.split('').map! {|letter| next_letter(letter)}.join('').capitalize}.reverse.join(\" \")\nend",
"def male_name\n\t%w[Aaron Abdul Abe Abel Abraham Abram Adalberto Adam Adan Adolfo Adolph Adrian Agustin Ahmad Ahmed Al Alan Albert Alberto Alden Aldo Alec Alejandro Alex Alexander Alexis Alfonso Alfonzo Alfred Alfredo Ali Allan Allen Alonso Alonzo Alphonse Alphonso Alton Alva Alvaro Alvin Amado Ambrose Amos Anderson Andre Andrea Andreas Andres Andrew Andy Angel Angelo Anibal Anthony Antione Antoine Anton Antone Antonia Antonio Antony Antwan Archie Arden Ariel Arlen Arlie Armand Armando Arnold Arnoldo Arnulfo Aron Arron Art Arthur Arturo Asa Ashley Aubrey August Augustine Augustus Aurelio Austin Avery Barney Barrett Barry Bart Barton Basil Beau Ben Benedict Benito Benjamin Bennett Bennie Benny Benton Bernard Bernardo Bernie Berry Bert Bertram Bill Billie Billy Blaine Blair Blake Bo Bob Bobbie Bobby Booker Boris Boyce Boyd Brad Bradford Bradley Bradly Brady Brain Branden Brandon Brant Brendan Brendon Brent Brenton Bret Brett Brian Brice Britt Brock Broderick Brooks Bruce Bruno Bryan Bryant Bryce Bryon Buck Bud Buddy Buford Burl Burt Burton Buster Byron Caleb Calvin Cameron Carey Carl Carlo Carlos Carlton Carmelo Carmen Carmine Carol Carrol Carroll Carson Carter Cary Casey Cecil Cedric Cedrick Cesar Chad Chadwick Chance Chang Charles Charley Charlie Chas Chase Chauncey Chester Chet Chi Chong Chris Christian Christoper Christopher Chuck Chung Clair Clarence Clark Claud Claude Claudio Clay Clayton Clement Clemente Cleo Cletus Cleveland Cliff Clifford Clifton Clint Clinton Clyde Cody Colby Cole Coleman Colin Collin Colton Columbus Connie Conrad Cordell Corey Cornelius Cornell Cortez Cory Courtney Coy Craig Cristobal Cristopher Cruz Curt Curtis Cyril Cyrus Dale Dallas Dalton Damian Damien Damion Damon Dan Dana Dane Danial Daniel Danilo Dannie Danny Dante Darell Daren Darin Dario Darius Darnell Daron Darrel Darrell Darren Darrick Darrin Darron Darryl Darwin Daryl Dave David Davis Dean Deandre Deangelo Dee Del Delbert Delmar Delmer Demarcus Demetrius Denis Dennis Denny Denver Deon Derek Derick Derrick Deshawn Desmond Devin Devon Dewayne Dewey Dewitt Dexter Dick Diego Dillon Dino Dion Dirk Domenic Domingo Dominic Dominick Dominique Don Donald Dong Donn Donnell Donnie Donny Donovan Donte Dorian Dorsey Doug Douglas Douglass Doyle Drew Duane Dudley Duncan Dustin Dusty Dwain Dwayne Dwight Dylan Earl Earle Earnest Ed Eddie Eddy Edgar Edgardo Edison Edmond Edmund Edmundo Eduardo Edward Edwardo Edwin Efrain Efren Elbert Elden Eldon Eldridge Eli Elias Elijah Eliseo Elisha Elliot Elliott Ellis Ellsworth Elmer Elmo Eloy Elroy Elton Elvin Elvis Elwood Emanuel Emerson Emery Emil Emile Emilio Emmanuel Emmett Emmitt Emory Enoch Enrique Erasmo Eric Erich Erick Erik Erin Ernest Ernesto Ernie Errol Ervin Erwin Esteban Ethan Eugene Eugenio Eusebio Evan Everett Everette Ezekiel Ezequiel Ezra Fabian Faustino Fausto Federico Felipe Felix Felton Ferdinand Fermin Fernando Fidel Filiberto Fletcher Florencio Florentino Floyd Forest Forrest Foster Frances Francesco Francis Francisco Frank Frankie Franklin Franklyn Fred Freddie Freddy Frederic Frederick Fredric Fredrick Freeman Fritz Gabriel Gail Gale Galen Garfield Garland Garret Garrett Garry Garth Gary Gaston Gavin Gayle Gaylord Genaro Gene Geoffrey George Gerald Geraldo Gerard Gerardo German Gerry Gil Gilbert Gilberto Gino Giovanni Giuseppe Glen Glenn Gonzalo Gordon Grady Graham Graig Grant Granville Greg Gregg Gregorio Gregory Grover Guadalupe Guillermo Gus Gustavo Guy Hai Hal Hank Hans Harlan Harland Harley Harold Harris Harrison Harry Harvey Hassan Hayden Haywood Heath Hector Henry Herb Herbert Heriberto Herman Herschel Hershel Hilario Hilton Hipolito Hiram Hobert Hollis Homer Hong Horace Horacio Hosea Houston Howard Hoyt Hubert Huey Hugh Hugo Humberto Hung Hunter Hyman Ian Ignacio Ike Ira Irvin Irving Irwin Isaac Isaiah Isaias Isiah Isidro Ismael Israel Isreal Issac Ivan Ivory Jacinto Jack Jackie Jackson Jacob Jacques Jae Jaime Jake Jamaal Jamal Jamar Jame Jamel James Jamey Jamie Jamison Jan Jared Jarod Jarred Jarrett Jarrod Jarvis Jason Jasper Javier Jay Jayson Jc Jean Jed Jeff Jefferey Jefferson Jeffery Jeffrey Jeffry Jerald Jeramy Jere Jeremiah Jeremy Jermaine Jerold Jerome Jeromy Jerrell Jerrod Jerrold Jerry Jess Jesse Jessie Jesus Jewel Jewell Jim Jimmie Jimmy Joan Joaquin Jody Joe Joel Joesph Joey John Johnathan Johnathon Johnie Johnnie Johnny Johnson Jon Jonah Jonas Jonathan Jonathon Jordan Jordon Jorge Jose Josef Joseph Josh Joshua Josiah Jospeh Josue Juan Jude Judson Jules Julian Julio Julius Junior Justin Kareem Karl Kasey Keenan Keith Kelley Kelly Kelvin Ken Kendall Kendrick Keneth Kenneth Kennith Kenny Kent Kenton Kermit Kerry Keven Kevin Kieth Kim King Kip Kirby Kirk Korey Kory Kraig Kris Kristofer Kristopher Kurt Kurtis Kyle Lacy Lamar Lamont Lance Landon Lane Lanny Larry Lauren Laurence Lavern Laverne Lawerence Lawrence Lazaro Leandro Lee Leif Leigh Leland Lemuel Len Lenard Lenny Leo Leon Leonard Leonardo Leonel Leopoldo Leroy Les Lesley Leslie Lester Levi Lewis Lincoln Lindsay Lindsey Lino Linwood Lionel Lloyd Logan Lon Long Lonnie Lonny Loren Lorenzo Lou Louie Louis Lowell Loyd Lucas Luciano Lucien Lucio Lucius Luigi Luis Luke Lupe Luther Lyle Lyman Lyndon Lynn Lynwood Mac Mack Major Malcolm Malcom Malik Man Manual Manuel Marc Marcel Marcelino Marcellus Marcelo Marco Marcos Marcus Margarito Maria Mariano Mario Marion Mark Markus Marlin Marlon Marquis Marshall Martin Marty Marvin Mary Mason Mathew Matt Matthew Maurice Mauricio Mauro Max Maximo Maxwell Maynard Mckinley Mel Melvin Merle Merlin Merrill Mervin Micah Michael Michal Michale Micheal Michel Mickey Miguel Mike Mikel Milan Miles Milford Millard Milo Milton Minh Miquel Mitch Mitchel Mitchell Modesto Mohamed Mohammad Mohammed Moises Monroe Monte Monty Morgan Morris Morton Mose Moses Moshe Murray Myles Myron Napoleon Nathan Nathanael Nathanial Nathaniel Neal Ned Neil Nelson Nestor Neville Newton Nicholas Nick Nickolas Nicky Nicolas Nigel Noah Noble Noe Noel Nolan Norbert Norberto Norman Normand Norris Numbers Octavio Odell Odis Olen Olin Oliver Ollie Omar Omer Oren Orlando Orval Orville Oscar Osvaldo Oswaldo Otha Otis Otto Owen Ozzie Pablo Palmer Paris Parker Pasquale Pat Patricia Patrick Paul Pedro Percy Perry Pete Peter Phil Philip Phillip Pierre Porfirio Porter Preston Prince Quentin Quincy Quinn Quintin Quinton Rafael Raleigh Ralph Ramiro Ramon Randal Randall Randell Randolph Randy Raphael Rashad Raul Ray Rayford Raymon Raymond Raymundo Reed Refugio Reggie Reginald Reid Reinaldo Renaldo Renato Rene Reuben Rex Rey Reyes Reynaldo Rhett Ricardo Rich Richard Richie Rick Rickey Rickie Ricky Rico Rigoberto Riley Rob Robbie Robby Robert Roberto Robin Robt Rocco Rocky Rod Roderick Rodger Rodney Rodolfo Rodrick Rodrigo Rogelio Roger Roland Rolando Rolf Rolland Roman Romeo Ron Ronald Ronnie Ronny Roosevelt Rory Rosario Roscoe Rosendo Ross Roy Royal Royce Ruben Rubin Rudolf Rudolph Rudy Rueben Rufus Rupert Russ Russel Russell Rusty Ryan Sal Salvador Salvatore Sam Sammie Sammy Samual Samuel Sandy Sanford Sang Santiago Santo Santos Saul Scot Scott Scottie Scotty Sean Sebastian Sergio Seth Seymour Shad Shane Shannon Shaun Shawn Shayne Shelby Sheldon Shelton Sherman Sherwood Shirley Shon Sid Sidney Silas Simon Sol Solomon Son Sonny Spencer Stacey Stacy Stan Stanford Stanley Stanton Stefan Stephan Stephen Sterling Steve Steven Stevie Stewart Stuart Sung Sydney Sylvester Tad Tanner Taylor Ted Teddy Teodoro Terence Terrance Terrell Terrence Terry Thad Thaddeus Thanh Theo Theodore Theron Thomas Thurman Tim Timmy Timothy Titus Tobias Toby Tod Todd Tom Tomas Tommie Tommy Toney Tony Tory Tracey Tracy Travis Trent Trenton Trevor Trey Trinidad Tristan Troy Truman Tuan Ty Tyler Tyree Tyrell Tyron Tyrone Tyson Ulysses Val Valentin Valentine Van Vance Vaughn Vern Vernon Vicente Victor Vince Vincent Vincenzo Virgil Virgilio Vito Von Wade Waldo Walker Wallace Wally Walter Walton Ward Warner Warren Waylon Wayne Weldon Wendell Werner Wes Wesley Weston Whitney Wilber Wilbert Wilbur Wilburn Wiley Wilford Wilfred Wilfredo Will Willard William Williams Willian Willie Willis Willy Wilmer Wilson Wilton Winford Winfred Winston Wm Woodrow Wyatt Xavier Yong Young Zachariah Zachary Zachery Zack Zackary Zane].sample\nend",
"def get_full_name\n \"#{name} (#{description})\"\n end",
"def name\n return 'AedgSmallToMediumOfficeExteriorLighting'\n end",
"def alias_creator(full_name)\n full_name = full_name.downcase\n name = full_name.split(' ').to_a\n first_name = name[0]\n last_name = name[1]\n first_name_letters = first_name.split('')\n last_name_letters = last_name.split('')\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"a\"]\n consonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\", \"b\"]\n \n first_name_letters.map! do |letter|\n if vowels.include?(letter)\n letter_index = vowels.index(letter)\n new_letter_index = letter_index + 1\n letter = vowels[new_letter_index]\n elsif consonants.include?(letter)\n letter_index = consonants.index(letter)\n new_letter_index = letter_index + 1\n letter = consonants[new_letter_index]\n end\n end\n new_first_name = first_name_letters.join('').capitalize\n \n last_name_letters.map! do |letter|\n if vowels.include?(letter)\n letter_index = vowels.index(letter)\n new_letter_index = letter_index + 1\n letter = vowels[new_letter_index]\n elsif consonants.include?(letter)\n letter_index = consonants.index(letter)\n new_letter_index = letter_index + 1\n letter = consonants[new_letter_index]\n end\n end\n new_last_name = last_name_letters.join('').capitalize\n\n new_name = new_last_name + \" \" + new_first_name\n return new_name\n \nend",
"def full_name\n \"#{nombre} #{apellidos}\"\n end",
"def insured_name\n id, qual = eob.member_id_and_qualifier\n sub_name_ele = []\n sub_name_ele << 'NM1'\n sub_name_ele << 'IL'\n sub_name_ele << '1'\n sub_name_ele << eob.subscriber_last_name\n sub_name_ele << eob.subscriber_first_name\n sub_name_ele << eob.subscriber_middle_initial\n sub_name_ele << ''\n sub_name_ele << eob.subscriber_suffix\n sub_name_ele << qual\n sub_name_ele << id\n sub_name_ele = Output835.trim_segment(sub_name_ele)\n sub_name_ele.join(@element_seperator)\n end",
"def fullName\n return @first + ' ' + @middle + ' ' + @last\n end",
"def name\n @this_dog_name\n end",
"def show\n # FIXME really this should be the other way around: 'Bank of America' and\n # 'Americard Points' should be 2 separate columns which we join, not split,\n # in the view\n name.sub(/\\s+\\(.*\\)\\s*/, '')\n end",
"def show_full_name\n name\n end",
"def articlePartialMatchNames\n names = []\n if partial_name_match #If partial name matches are allowed for this place\n #Add any words required for a match before each trimmed name\n if before_name_article_accept_strings.length != 0\n\ttrimmed_names.uniq.each do |name|\n\t before_name_article_accept_strings.each do |string|\n\t names << string + \" \" + name\n\t end\n\tend\n else\n\tnames += trimmed_names\n end\n end\n names\n end"
] | [
"0.64742225",
"0.6427333",
"0.6344343",
"0.63430834",
"0.6299515",
"0.6277544",
"0.6233395",
"0.62087435",
"0.6203189",
"0.61714435",
"0.61332124",
"0.61231005",
"0.61062247",
"0.609935",
"0.60773283",
"0.6067734",
"0.6060615",
"0.60569674",
"0.6050722",
"0.60484797",
"0.60405266",
"0.60366696",
"0.60298055",
"0.6019182",
"0.6018084",
"0.6007604",
"0.59979755",
"0.59909445",
"0.5990692",
"0.5977729",
"0.5975468",
"0.5969549",
"0.5959837",
"0.5953066",
"0.5947011",
"0.5946719",
"0.59461164",
"0.59407717",
"0.5937075",
"0.59287345",
"0.5919818",
"0.59144765",
"0.5907591",
"0.59050745",
"0.58979785",
"0.58916974",
"0.5872719",
"0.5860751",
"0.58604264",
"0.58546245",
"0.5853161",
"0.58494437",
"0.58480483",
"0.5845401",
"0.5845369",
"0.5842965",
"0.5841246",
"0.5838642",
"0.5835839",
"0.5830521",
"0.5826035",
"0.582034",
"0.58199114",
"0.58199114",
"0.58199114",
"0.58199114",
"0.58048385",
"0.58020324",
"0.5800975",
"0.5800905",
"0.57964236",
"0.5795851",
"0.579501",
"0.57884943",
"0.57864743",
"0.57830673",
"0.57830673",
"0.57830673",
"0.57830673",
"0.5777833",
"0.5776265",
"0.57755554",
"0.57733035",
"0.57654315",
"0.5761613",
"0.57602125",
"0.57567227",
"0.57560134",
"0.5755177",
"0.5754147",
"0.5749701",
"0.5746756",
"0.57454944",
"0.5745189",
"0.5742096",
"0.5738927",
"0.57352465",
"0.5732175",
"0.57288635",
"0.5728027"
] | 0.6846041 | 0 |
Searches for the nearest higher mountain in a given radius and sets that as the parent mountain Sets distance to parent mountain as well | def set_parent_mountain_by_radius radius
Place.find_by_radius(centerLatitude, centerLongitude, radius, (height||0)+1).where("type = 'Mountain'").each do |mountain|
distance = dist(mountain.centerLatitude, mountain.centerLongitude)
if distance < dist_to_parent && self != mountain
self.dist_to_parent = distance
self.parent_mountain_id = mountain.id
self.parent_mountain = mountain
self.set_height_and_isolation
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def refresh_nearby_mountains\n return unless self.height_changed? || self.latitude_changed? || self.longitude_changed?\n Mountain.find_by_radius(self.latitude,self.longitude,self.dist_to_parent + 20).where(\"type = 'Mountain'\").each do |mountain|\n next if mountain.height.nil? || mountain.dist_to_parent.nil?\n if mountain.height < self.height && self != mountain && dist(mountain.latitude, mountain.longitude) < mountain.dist_to_parent\n mountain.parent_mountain_id = self.id\n\tmountain.dist_to_parent = dist(mountain.latitude, mountain.longitude)\n\tmountain.set_height_and_isolation\n mountain.save\n end\n end\n end",
"def grab_nearest_by_location(distance, loc)\n\n end",
"def getSurroundingLowestElevations(parent)\n\t\tx = parent.x\n\t\ty = parent.y\n\t\tcost = 0\n\t\tmin = nil\n\t\twaterFound = false\n\t\twater = nil\n\t\tmin_list = Array.new\n\t\t\n\t\t#search nodes around parent node\n\t\tfor i in (x-1..x+1)\n\t\t\tfor j in (y-1..y+1)\n\t\t\t\t#if its not the parent node\n\t\t\t\tif (i != x or j != y)\n\t\t\t\t\ttemp = @map[check_xy(i)][check_xy(j)]\n\t\t\t\t\t\n\t\t\t\t\t#if we've managed to find the ocean or some other water\n\t\t\t\t\tif temp.type != \"Land\"\n\t\t\t\t\t\twaterFound = true\n\t\t\t\t\t\twater = @river_struct.new parent, check_xy(i), check_xy(j), find_angle(parent, check_xy(i), check_xy(j)), parent.ttd-1\n\t\t\t\t\telsif (temp.elevation != -1 and temp.type == \"Land\")\n\t\t\t\t\t\tif min == nil or temp.elevation < @map[min.x][min.y].elevation\n\t\t\t\t\t\t\tmin_list.clear\n\t\t\t\t\t\t\tmin = @river_struct.new parent, check_xy(i), check_xy(j), find_angle(parent, check_xy(i), check_xy(j)), parent.ttd-1\n\t\t\t\t\t\t\tmin_list.push(min)\n\t\t\t\t\t\telsif temp.elevation == @map[min.x][min.y].elevation\n\t\t\t\t\t\t\tmin_list.push(@river_struct.new parent, check_xy(i), check_xy(j), find_angle(parent, check_xy(i), check_xy(j)), parent.ttd-1)\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t#if water has been found clear other options and use that node\n\t\tif waterFound\n\t\t\tmin_list.clear\n\t\t\tmin_list.push(water)\n\t\tend\n\t\t\n\t\treturn min_list\n\t\t\n\tend",
"def select_within_radius km\n self.location_hash = location_hash.select {|h1| distance(h1) <= km }\n end",
"def closest(num = 8)\n opts = {\n order: {\n _geo_distance: {\n 'location' => \"#{latitude},#{longitude}\",\n 'order' => 'asc',\n 'unit' => 'mi'\n }\n },\n limit: num,\n where: {\n id: { not: id }\n }\n }\n Location.search('*', opts).results\n end",
"def labelPlaces\n return unless waypoints_changed?\n Place.find_by_radius(averageLatitude, averageLongitude, 50, 0).each do |place|\n minDistance = 400#km\n closestPoint = waypoints.first\n waypoints_minus_removed.each do |waypoint|\n\tdistance = place.dist waypoint.latitude, waypoint.longitude\n\tif minDistance > distance\n\t minDistance = distance\n\t closestPoint = waypoint\n\tend\n end\n # Someone entered a point on the place. If a mountain then replace the height\n # with the correct value and adjust the height change to reflect the new value.\n # If the waypoint isn't labelled then give it the places title and icon.\n if minDistance < 0.3 && !closestPoint.height.nil?\n\tparent = waypoints_minus_removed[closestPoint.parent_index]\n if place.class == Mountain && parent.present?\n heightChange = closestPoint.height - parent.height\n self.height_gain -= heightChange > 0 ? heightChange : 0 unless self.height_gain.nil?\n self.height_loss -= heightChange < 0 ? -heightChange : 0 unless self.height_loss.nil?\n end\n\tclosestPoint.height = place.height if place.class == Mountain\n\tclosestPoint.icon = place.class::MARKER_ICON[0..-5] if closestPoint.icon.nil?\n\tclosestPoint.title = place.name if closestPoint.title.nil?\n if place.class == Mountain && parent.present?\n heightChange = closestPoint.height - parent.height\n self.height_gain += heightChange > 0 ? heightChange : 0 unless self.height_gain.nil?\n self.height_loss += heightChange < 0 ? -heightChange : 0 unless self.height_loss.nil?\n end\n end\n end\n end",
"def closest_point_to(target, min_distance=3)\n angle_rad = target.calculate_rad_angle_between(self)\n radius = target.radius + min_distance\n x = target.x + radius * Math.cos(angle_rad)\n y = target.y + radius * Math.sin(angle_rad)\n\n Position.new(x, y)\n end",
"def assignClosest(parr)\n self.dims[0].times do |i|\n self.dims[1].times do |j|\n distances = Array.new\n parr.each do |point|\n distances << point.distance(i, j)\n end\n mins = distances.min(2)\n if mins[0] == mins[1]\n @grid[i][j] = -1\n else\n @grid[i][j] = distances.index(mins[0])\n end\n end\n end\n end",
"def find_within_radius(distance, property=nil)\n locations = find_within_box(distance).delete_if { |l| self.distance_to(l) > distance }\n\t\tproperty ? locations.map(&property.to_sym) : locations\n end",
"def cluster\n closest_distance = 0\n while closest_distance < @max_distance\n closest_distance, c1, c2 = find_closest_distance\n\n if closest_distance < @max_distance\n merge(c1, c2)\n end\n end\n end",
"def nearest_mine\n src = @pos\n shortest_dst = 63\n nearest = [0,0]\n unowned_mines = @game.mines_locs.reject { |pos, hero_id| hero_id == @hero_id }\n unowned_mines.each do |pos, hero_id|\n build_branching_paths(src, pos)\n path = find_path(pos)\n if path.length < shortest_dst\n shortest_dst = path.length\n nearest = pos\n end\n end\n nearest\n end",
"def find_new_road\n return nil if finding_new_road?\n return nil if Params::NEW_ROOT_FIND_PERCENTAGE < rand(Params::PERCENT_DENOMINATOR)\n\n found_mini_map_ids = mini_map_roads.collect{|r| r.end_mini_map_id}\n found_mini_map_ids << id\n not_found_mini_map_ids = MiniMap.all.collect{|m| m.id} - found_mini_map_ids\n end_mini_map_id = not_found_mini_map_ids[rand(not_found_mini_map_ids.size)]\n \n return end_mini_map_id\n end",
"def nearby\n\n #select * from ( select * from Location\n # WHERE Longitude > @lngA-(@dist/(cos( radians(@latA+(@dist/68.703)))*69.172))\n # AND Longitude < @lngA+(@dist/(cos( radians(@latA+(@dist/68.703)))*69.172))\n # AND Latitude > @latA-(@dist/68.703)\n # AND Latitude < @latA+(@dist/68.703) ) AS `tmp` WHERE GEODISTANCE(@latA,@lngA ,Latitude,Longitude) < @dist\n\n #Calculate a bounding box we can use to quickly find nearby trucks\n lat = params[:lat].to_f\n lng = params[:lng].to_f\n dist = params[:radius].to_f\n latDelta = dist/68.703\n\n value = lat+(latDelta);\n rad = value/180 * Math::PI #Geocoder::Calculations.to_radians(value) #value.to_ra radians(value);\n\n lngDelta = dist/(Math.cos( rad)*69.172)\n minLng = lng-lngDelta\n maxLng = lng+lngDelta\n minLat = lat-latDelta\n maxLat = lat+latDelta\n\n\n #IFNULL( SQRT(((difX)(difX))+((difY)(difY))), 99999)\n trucks = Truck.find_by_sql \"SELECT trucks.* WHERE SQRT(((trucks.lng-#{lng})(trucks.lng-#{lng}))+((trucks.lat-#{lat})(trucks.lat-#{lat}))) < #{dist}\"\n\n render :json => trucks\n end",
"def update_closest(array, city, new_dist)\n if !array.include?([city, new_dist])\n insert_point = binary_insert(array, new_dist)\n array.insert(insert_point,[city, new_dist])\n end\nend",
"def surrounding(position, radius)\n dlat = 0.0001\n dlng = 0.0001\n (1..radius).map do |r|\n (-r..r).map do |rlat|\n points = [sum(position, [dlat * rlat, dlng * (r - rlat.abs)])]\n if rlat.abs != r\n points += [sum(position, [dlat * rlat, dlng * (rlat.abs - r)])]\n end\n points\n end.flatten(1)\n end\nend",
"def find_nearest_place_id max_dist\n\t#byebug\n\tphot=self.class.find(@id) #returns instance of photo\n\tphot_loc=phot.location #gets location from photo (point where photo was taken)\n\tphot_place=Place.near(phot_loc,max_dist).projection(:_id=>1).first #find closest place to point\n\tphot_place.nil? ? nil : phot_place[:_id] #return the id of the closest place to that point\nend",
"def closest_to_center(list)\n list\n .sort_by { |point| dist(point, point(0,0)) }\n .first\nend",
"def near max_meters=nil\n documents = self.class.near(@location, max_meters)\n self.class.to_places(documents)\n end",
"def closest_planet\n finder = self.class.select(\"id, name, location, planets.location<->POINT('#{self.location}') as distance\")\n self.class.my_planets.each do |p|\n finder = finder.where(\"NOT location ~= POINT(?)\", p.location)\n end\n finder.order(\"distance ASC\").first\n end",
"def reduce_root(tree_match=nil)\n if tree_match.nil?\n reduce_root_tree_var(self.name)\n else\n tree = find{|i| i === tree_match}.reduce_root\n update_height\n tree\n end\n end",
"def distanceToSearchCenter(centerLat, centerLong)\n\n # kilometers\n earthRadius = 6371 \n\n buildingLat = self.gis_lat\n buildingLong = self.gis_long\n\n buildingLatRad = buildingLat/180 * Math::PI\n centerLongRad = centerLong/180 * Math::PI\n\n\n dLat = (centerLat-buildingLat)/180 * Math::PI;\n dLon = (centerLong-buildingLong)/180 * Math::PI;\n\n a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n Math.cos(buildingLatRad) * Math.cos(centerLongRad) *\n Math.sin(dLon/2) * Math.sin(dLon/2);\n\n c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n\n distanceMeters = 6371*1000 * c; \n puts distanceMeters\n distanceMeters\n end",
"def nearest_driver(map,user)\n driver_pos=[]\n\n for i in 0..map.length-1\n for j in 0..map.length-1\n if map[i][j] == \" D \"\n driver_pos << [i,j]\n end\n end\n end\n @driver_pos=driver_pos\n\n nearest_driver_position = driver_pos[0]\n distance = driver_pos[0].zip(user).map { |x| x.reduce(:-).abs }.sum\n\n for i in 1..driver_pos.length-1\n temp = driver_pos[i].zip(user).map { |x| x.reduce(:-).abs }.sum\n if temp < distance\n distance = temp\n nearest_driver_position = driver_pos[i]\n end\n end\n nearest_driver_position\n end",
"def nearby_bike_parking(string, dist)\n area = process_coords(area)\n querry = \"$where=within_circle(geom, #{area[1]}, #{area[0]}, #{dist})\"\n bike_grabber(querry)\n end",
"def search_radius\n exact_location ? 100 : 50_000\n end",
"def climb(position, radius)\n max_rad, max_pos, max_ele, inc, my_ele = highest_neighbor(position, radius)\n if inc < 0 || max_rad < radius\n puts \"We have reached the peak (#{my_ele}) at #{position}\".green\n peak_id = store_peak(position, my_ele)\n [position, my_ele, peak_id]\n else\n puts \"Elevation #{max_ele}, position #{max_pos}\".yellow\n sleep 0.01\n if inc > 0\n puts \"Climbing more\".light_black\n climb(max_pos, 1)\n else\n new_radius = radius + 1\n puts \"On a flat, increasing radius to #{new_radius}\"\n climb(max_pos, new_radius)\n end\n end\nend",
"def near(max_meters=nil)\n result = self.class.near(@location, max_meters)\n self.class.to_places(result)\n end",
"def near(max_meters=nil)\n result = self.class.near(@location, max_meters)\n self.class.to_places(result)\n end",
"def find_nearest_parent(target_class)\n columns = ['id', 'parent_id', 'construct_id', 'construct_type']\n columns_joined = columns.join(',')\n sql =\n <<-SQL\n WITH RECURSIVE control_constructs_tree (#{columns_joined}, level)\n AS (\n SELECT\n #{columns_joined},\n 0\n FROM control_constructs\n WHERE construct_id = #{id}\n AND construct_type = '#{self.class.name}'\n\n UNION ALL\n SELECT\n #{columns.map { |col| 'cat.' + col }.join(',')},\n ct.level + 1\n FROM control_constructs cat, control_constructs_tree ct\n WHERE cat.id = ct.parent_id\n )\n SELECT #{target_class.table_name}.*\n FROM control_constructs_tree\n INNER JOIN #{target_class.table_name} ON #{target_class.table_name}.id = control_constructs_tree.construct_id\n WHERE level > 0\n AND construct_type = '#{target_class.name}'\n ORDER BY level, control_constructs_tree.id, construct_id, construct_type\n LIMIT 1;\n SQL\n target_class.find_by_sql(sql.chomp).first\n end",
"def closest_ant_view l, ai \n\tants = ai.my_ants \n\n\tcur_best = nil\n\tcur_dist = nil\n\n\tants.each do |ant|\n\t\td = Distance.get ant, l\n\t\tdist = d.dist\n\n\t\tif !cur_dist || dist < cur_dist\n\t\t\tcur_dist = dist\n\t\t\tcur_best = ant\n\t\tend\n\tend\n\n\tcur_best\nend",
"def near(max_meters=nil)\n Place.to_places(self.class.near(@location, max_meters))\n end",
"def change_distance\n @before_dist = session[:distance];\n @distance = params[:distance];\n @holes = Pothole.near([session[:lat], session[:lng]], @distance, :order => session[:sorting]);\n build_markers\nend",
"def find_nearest(key)\n node_value(find_nearest_node(key))\n end",
"def find_nearest(key)\n node_value(find_nearest_node(key))\n end",
"def min_distance\n @min_distance ||= (_fence.southwest & _fence.northeast) * @min_distance_ratio\n end",
"def closest(obj)\n zombie = @zombies.first\n\n min_dist = 19000 ** 2 + 6000 ** 2\n\n @zombies.each do |z|\n dist = z.distance(obj)\n if dist < min_dist\n zombie = z\n min_dist = dist\n end\n end\n\n zombie\n end",
"def places_around(zoom_level = MapHelper::NEIGHBORHOOD_LEVEL_ZOOM)\n Place.within(zoom_to_radius(zoom_level, lat), origin: self) - [self]\n end",
"def shortest_route_by_distance_to!(place_or_object_place_was_built_from)\n routes_for!(place_or_object_place_was_built_from).min_by(&:distance_in_meters)\n end",
"def near(max_meters=nil)\n\t#byebug\n\tif !max_meters.nil?\n\t\tresult=self.class.collection.find(\n\t\t\t\"geometry.geolocation\"=>{:$near=>{:$geometry=>@location.to_hash, :$maxDistance=>max_meters}}\n\t\t)\n\telse\n\t\tresult=self.class.collection.find(\n\t\t\t\"geometry.geolocation\"=>{:$near=>{:$geometry=>@location.to_hash}}\n\t\t)\n\tend\n\t#byebug\n\treturn result.nil? ? nil : self.class.to_places(result)\nend",
"def find_best_location(asteroids)\n\tresults = Hash.new\n\tbest = nil\n\tmax = 0\n\tasteroids.each do |(x,y), item|\n\t\tar = asteroid_relative(x,y,asteroids)\n\t\tresult = seen_i(ar)\n\t\tsize = result.size\n\t\tif size > max\n\t\t\tmax = size\n\t\t\tbest = [ x, y, result]\n\t\tend\n\tend\n\tremove_self(*best)\n\tbest\nend",
"def radius(row)\n return nil if row.obs_lat.present?\n\n r1 = lat_radius(row)\n r2 = long_radius(row)\n return nil if !r1 || !r2\n\n [r1, r2].max.to_f.round\n end",
"def closest(obj)\n zombie = @zombies.first\n\n min_dist = MAX_DIST\n\n @zombies.each do |z|\n dist = z.distance(obj)\n if dist < min_dist\n zombie = z\n min_dist = dist\n end\n end\n\n zombie\n end",
"def findClosestValHelper(tree,target,closest)\n return closest if tree.nil?\n if (target-closest).abs > (target-tree.value).abs\n closest = tree.value\n end\n if target < tree.value\n return findClosestValHelper(tree.left,target,closest)\n elsif target > tree.value\n return findClosestValHelper(tree.right,target,closest)\n else\n return closest\n end\nend",
"def nearest\n page, per_page = pagination(params)\n miles = search_with_in_miles(params)\n parking_lots = ParkingLot.within(miles, origin:[params[:latitude], params[:longitude]])\n .available_lots.sort_with_higher_availabiltiy\n size = parking_lots.size\n parking_lots = parking_lots.limit(per_page).offset(per_page * page)\n json_response(parking_lots, size)\n end",
"def distance_to(other)\n # using Spherical Law of Cosines formula to calculate 'great circle' distance\n # http://www.movable-type.co.uk/scripts/latlong.html\n # assumes a spherical moon\n # result in is metres\n lat1_r = to_rad(self.lat)\n lat2_r = to_rad(other.lat)\n delta = to_rad(other.long - self.long)\n Math.acos(\n Math.sin(lat1_r) * Math.sin(lat2_r) +\n Math.cos(lat1_r) * Math.cos(lat2_r) * Math.cos(delta)\n ) * RADIUS\n end",
"def nearby_location(dist)\n data = Location.all\n nearby_wifi = data.select { |spot| self.distance_to([spot.latitude,spot.longitude]) <= dist }\n sort_nearby_wifi = nearby_wifi.sort_by { |close| self.distance_to([close.latitude, close.longitude]) }\n end",
"def places_nearby_without_photos radius=15\n Place.find_by_radius(centerLatitude,centerLongitude,radius).where(\"places.id != ?\", id).where(\"places.name_status != 'unnamed' and places.id not in (select distinct photos.place_id from photos where photos.place_id is not null) and places.id not in (select distinct place_id from place_photos)\").order(\"places.type != 'Mountain', power(places.latitude - #{centerLatitude.to_f},2)+power(places.longitude - #{centerLongitude.to_f},2)\")\n end",
"def withinRadius(latitude,longitiude,radius)\n \n rad = 3963.1676\n lat1 = to_rad(latitude.to_f)\n lat2 = to_rad(self.latitude.to_f)\n lon1 = to_rad(longitiude.to_f)\n lon2 = to_rad(self.longitude.to_f)\n dLat = lat2-lat1 \n dLon = lon2-lon1\n \n a = Math::sin(dLat/2) * Math::sin(dLat/2) +\n Math::cos(lat1) * Math::cos(lat2) * \n Math::sin(dLon/2) * Math::sin(dLon/2);\n \n c = 2 * Math::atan2(Math::sqrt(a), Math::sqrt(1-a));\n \n distance = rad * c\n \n #logger.debug \"distance IS\"\n #logger.debug distance\n #logger.debug \"radius IS\"\n #logger.debug radius\n \n return distance\n end",
"def find_nearest_place_id(max_meters)\n Place.collection.find(\n {'geometry.geolocation':\n {'$near': @location.to_hash}\n }).limit(1).projection({:_id=>1}).first[:_id]\n end",
"def distance\n self.distance_to(current_knocker)\n end",
"def places_nearby_without_title_photos radius=15\n Place.find_by_radius(centerLatitude,centerLongitude,radius).where(\"places.id != ?\", id).where(\"places.name_status != 'unnamed' and places.id not in (select distinct photos.place_id from photos where photos.place_id is not null)\").order(\"places.type != 'Mountain', power(places.latitude - #{centerLatitude.to_f},2)+power(places.longitude - #{centerLongitude.to_f},2)\")\n end",
"def maximize_distance(params = {})\n params = fix_params params\n\n optimize_for_location({\n start: params[:start],\n finish: {\n lat: params[:start][:lat],\n lon: 175 #somewhere halfway across the pacific\n },\n timeout: params[:timeout],\n performance: params[:performance],\n use_faa: params[:use_faa],\n check_countries: params[:countries]\n })\n end",
"def nearest(lat, long, limit)\n spatial_store.nearestk(lat, long, limit)\n end",
"def find_nearest_node(key) #:nodoc:\n x = anchor\n level = node_level(x)\n while level > 0\n level -= 1\n xnext = node_next(x, level)\n while node_compare(xnext, key) <= 0\n x = xnext\n xnext = node_next(x, level)\n end\n end\n x\n end",
"def place_nodes_into_pockets\n centroid_pockets = Array.new(@centroids.size) {[]}\n @centroids.each_with_index do |centroid, centroid_index|\n @nodes.each_with_index do |node, node_index|\n if node.closest_centroid == centroid\n centroid_pockets[centroid_index] << node_index\n #Store closest nodes in the centroid object\n centroid.nodes << node\n end\n end\n end\n @centroid_pockets = centroid_pockets\n end",
"def nearest_fortress_exit_point(point)\n nearest_fortress_exit_cell = nil\n nearest_distance = MAX_DISTANCE\n fortress_exit_cells.each do |exit_cell|\n distance = Tools.calc_distance(point, exit_cell)\n if distance < nearest_distance\n nearest_distance = distance\n nearest_fortress_exit_cell = exit_cell\n end\n end\n return Point.new(nearest_fortress_exit_cell.x, nearest_fortress_exit_cell.y)\n end",
"def find_nearest_place_id(max_dist)\n \tplace = Place.near(@location, max_dist).limit(1).projection(:_id => 1).first\n \tif place.nil?\n \t\treturn nil\n \telse\n \t\treturn place[:_id]\n \tend\n end",
"def lower_bound\n return 0 if total == 0\n \n (\n phat + dist_sq/(2*total) - dist * Math.sqrt((phat*(1-phat)+dist_sq/(4*total))/total)\n ) / (\n 1+dist_sq/total\n )\n end",
"def guide(from, to, unit_type=nil, max_depth=400)\n return nil if @map.blocked?(from, unit_type) || @map.blocked?(to, unit_type)\n from_element = PathElement.new(from)\n from_element.dist_from = @map.distance(from,to)\n open = PrioritySet.new\n open.push from_element, from_element.rating\n closed = SplayTreeMap.new\n step = 0\n\n until open.empty? || step > max_depth\n step += 1\n\n current_element = open.pop\n @nodes_considered += 1\n\n loc = current_element.location\n if @map.cost(loc,to) == 0\n path = []\n until current_element.parent.nil?\n path.unshift current_element\n current_element = current_element.parent\n end\n\n return path\n else\n closed.push loc, current_element\n @map.neighbors(loc).each do |next_door|\n if closed.has_key? next_door\n next\n end\n \n el = PathElement.new(next_door,current_element)\n\n if @map.blocked? next_door, unit_type\n closed.push el.location, el\n else\n current_rating = current_element.cost_to + @map.cost(loc, next_door)\n\n # add to open\n el.cost_to = current_rating\n el.dist_from = @map.distance(next_door,to)\n el.reset_rating\n\n open.push el, el.rating\n end\n end\n end\n end\n nil\n end",
"def full_row_distance\n @full_row_distance ||= compute_distance\n end",
"def nearestLocation _args\n \"nearestLocation _args;\" \n end",
"def find_nearest_elevator(elevator_direction, request_location)\n elevators = find_elevators_by_direction(elevator_direction)\n elevators.each { |elevator| elevator.distance_score = (request_location - elevator.current_floor).abs }\n return elevators.min { |a, b| a.distance_score <=> b.distance_score }\n end",
"def closest(obj)\n human = @humans.first\n\n min_dist = MAX_DIST\n\n @humans.each do |h|\n dist = h.distance(obj)\n if dist < min_dist\n human = h\n min_dist = dist\n end\n end\n\n human\n end",
"def push_new_associate\n # We short-circuit any nodes whose global value would be less than the cutoff\n new_child unless child_attenuation < @sn_cutoff\n end",
"def guide(from, to, unit_type=nil, max_depth=400)\n return nil if @map.blocked?(from, unit_type) || @map.blocked?(to, unit_type)\n from_element = PathElement.new(from)\n from_element.dist_from = @map.distance(from,to)\n open = PriorityQueue.new { |x, y| (x <=> y) == -1 }\n open.push from_element, from_element.rating\n closed = SplayTreeMap.new\n step = 0\n \n until open.empty? || step > max_depth\n step += 1\n \n current_element = open.pop\n @nodes_considered += 1\n \n loc = current_element.location\n if @map.cost(loc,to) == 0\n path = []\n until current_element.parent.nil?\n path.unshift current_element\n current_element = current_element.parent\n end\n\n return path\n else\n closed.push loc, current_element\n @map.neighbors(loc).each do |next_door|\n next if closed.has_key? next_door\n\n el = PathElement.new(next_door,current_element)\n\n if @map.blocked? next_door, unit_type\n closed.push el.location, el\n else\n current_rating = current_element.cost_to + @map.cost(loc, next_door)\n\n # add to open\n el.cost_to = current_rating\n el.dist_from = @map.distance(next_door,to)\n \n open.push el, el.rating\n end\n end\n end\n end\n nil\n end",
"def find_closest\n find_target_coordinates\n location = build_query.geo_near(@target_cord).first\n\n return nil if location.nil?\n [(location.phone_numbers & customer_numbers).first, location.geo_name]\n end",
"def distance_to(loc2)\n self.point.ellipsoidal_distance(loc2.point)/1000\n end",
"def nearest(pc)\n d = (self.pc.to_i - pc.to_i).abs\n if d < 6\n self.class.new(pc, oct)\n else\n self.class.new(pc, oct - 1)\n end\n end",
"def get_target(map, loc)\n owned = nil\n owned_min = 1000\n GameMap::CARDINALS.each do |l|\n new_loc = map.find_location(loc, l)\n site = map.site(new_loc)\n if site.owner != $tag && site.strength < owned_min\n owned_min = site.strength\n owned = l\n end\n end\n owned\nend",
"def nearest var, path\n values = []\n path.inject(self) do |branch, k|\n values << branch.var( var )\n branch[ k ]\n end\n values.compact.last\n end",
"def find_best_missile_spot(radius = 2)\n # initialize variables\n total_unit_cost = 0.1\n best_spot = [-1,-1]\n cost = 0\n # check each spot on map\n for y in 0...$game_map.height\n for x in 0...$game_map.width\n cost = 0\n positions = $game_map.get_spaces_in_area(x,y,radius)\n positions.each{|pos|\n u = $game_map.get_unit(pos[0],pos[1])\n next if u.nil?\n if u.army == @player\n cost -= u.cost * u.unit_hp\n else\n cost += u.cost * u.unit_hp\n end\n }\n # Prefers most cost effective strike\n if cost >= total_unit_cost\n # If this spot is the same results as another spot\n if cost == total_unit_cost\n # Obtain units, if any, at these two spots\n unit_a = $game_map.get_unit(best_spot[0],best_spot[1])\n unit_b = $game_map.get_unit(x,y)\n # If there was no unit at best_spot\n if unit_a.nil?\n best_spot = [x,y]\n total_unit_cost = cost\n else\n # If there is a unit at this current spot\n unless unit_b.nil?\n # If the cost of this unit is more than the 'best_spot' unit\n if unit_a.cost < unit_b.cost\n best_spot = [x,y]\n total_unit_cost = cost\n end\n end\n end\n else\n best_spot = [x,y]\n total_unit_cost = cost\n end\n end\n end\n end\n return best_spot\n end",
"def find_closest!\n 1000.times { @particles.values.map(&:tick) }\n closest = @particles.values.min { |p1, p2| p1.manhattan_distance <=> p2.manhattan_distance }\n end",
"def init_child_search child, weight=nil\n child.init_search weight, @sn_cutoff\n # The attenuation for a child is the attenuation of the parent times the weight of the parent\n child.sn_local_to_global = child_attenuation\n @sn_associates.push child\n end",
"def ladders_near(l)\n position_range = (l.position-9)..(l.position+9)\n count = self.ladders.where(:position => position_range).count\n offset = (count > 10 ? count - 10 : 0)/2\n self.ladders.where(:position => position_range).limit(10).offset(offset).all\n end",
"def nearestLocations _args\n \"nearestLocations _args;\" \n end",
"def initialize(options = {})\n super\n @nearest = options[:nearest] || 0.1\n end",
"def radius=(_radius)\n reset_caches unless @radius == _radius\n @radius = _radius\n end",
"def transfers_to_reach_santa\n santa_ancestors = @node_hash['SAN'].ancestors\n you_ancestors = @node_hash['YOU'].ancestors\n closest_common_ancestor = self.class.closest_common_ancestor(santa_ancestors, you_ancestors)\n distance_from_common_to_santa = santa_ancestors.length - santa_ancestors.index(closest_common_ancestor) - 1\n distance_from_common_to_you = you_ancestors.length - you_ancestors.index(closest_common_ancestor) - 1\n distance_from_common_to_santa + distance_from_common_to_you\n end",
"def placeNodeNearClosestNode( base, value )\n result = 0\n if( value <= base.payload )\n if( base.leftNode )\n # Check if we're still less than the node to the left\n if( value > base.leftNode.payload)\n # Time to insert a node between leftNode and base:\n # Add a new node with leftNode as its left and base as its right\n # Set the old leftNode's rightNode to be the new node\n # Set the base's left node to be the new node\n node = Node.new(value, base.leftNode, base, nodeArray.count) \n nodeArray.push(node)\n base.leftNode.rightNode = node\n base.leftNode = node\n else\n result = -1 # Continue searching to the left\n end\n else\n # The base is the current minimum\n # Add a new far left node with the base to its right\n node = Node.new(value, nil, base, nodeArray.count) \n nodeArray.push(node)\n base.leftNode = node\n self.lowestValue = node # Update the lowest value counter with this new low\n end\n elsif( value > base.payload )\n if( base.rightNode)\n # Check if we're still more than the node to the right\n if( value <= base.rightNode.payload)\n # Time to insert a node between base and rightNode:\n # Add a new node with current as its left and rightNode as its right\n # Set the old rightNode's leftNode to be the new node\n # Set the base's right node to be the new node\n node = Node.new(value, base, base.rightNode, nodeArray.count)\n nodeArray.push(node)\n base.rightNode.leftNode = node\n base.rightNode = node\n else\n result = 1 # Continue searching to the right\n end\n else\n # The base is the current maximum\n # Add a new far right node with the base to its left\n node = Node.new(value, base, nil, nodeArray.count)\n nodeArray.push(node)\n base.rightNode = node\n self.highestValue = node # Update the highest value counter with this new max\n end\n end\n return result\nend",
"def find_closest_distance\n closest_distance = 1\n closest_clusters = [nil, nil]\n\n @clusters.combination(2) do |c|\n dist = c[0].distance_to(c[1])\n if dist < closest_distance\n closest_distance = dist\n closest_clusters = [c[0], c[1]]\n end\n end\n\n return closest_distance, closest_clusters[0], closest_clusters[1]\n end",
"def distanceToCarAhead\n return nil unless carAhead\n carAhead.bodyEnd - bodyStart\n end",
"def max_radius\n 4000\n end",
"def highest_neighbor(position, radius)\n all_positions = [[position]] + surrounding(position, radius)\n my_elevation = get_ele(position)\n neighbor_elevations = surrounding(position, radius).map do |positions_on_r|\n get_eles(positions_on_r).values\n end\n max_ele_for_radiuses_and_index = ([0] + neighbor_elevations.map(&:max)).each_with_index.max\n max_elevation = max_ele_for_radiuses_and_index[0]\n max_radius = max_ele_for_radiuses_and_index[1]\n max_position = if max_radius == 0\n puts \"Negative elevation?\"\n my_position\n else\n max_ele_index_on_radius = neighbor_elevations[max_radius - 1].each_with_index.max[1]\n all_positions[max_radius][max_ele_index_on_radius]\n end\n increase = max_elevation - my_elevation\n puts \"Among the neighbors the highest is on radius #{max_ele_for_radiuses_and_index[1]}, position #{max_position} with elevation #{max_elevation}, increase = #{increase}\"\n [max_radius, max_position, max_elevation, increase, my_elevation]\nend",
"def search root, target\n queue = [root]\n\n until queue.empty?\n current = queue.shift\n return current if current.x == target.x && current.y == target.y\n\n current.make_children.each { |child| queue << child }\n end\nend",
"def find_solution\n open = [{:cell => @start_cell, :parent => nil, :distance => 0}]\n closed = []\n\n while !open.empty?\n # Find the lowest movement cost\n current_node = open.min{ |a,b| a[:distance] <=> b[:distance]}\n\n # Check if we reached the end cell\n if is_end?(current_node[:cell])\n return current_node[:distance]\n end\n\n # Find immediate neighbors\n current_neighbors = find_neighbors(current_node[:cell])\n current_neighbors.each { | neighbor |\n if closed.find { | node | node[:cell].eql?(neighbor[:cell])}.nil?\n # Find if the cell is already in the open list\n existing_open = open.find { |node | node[:cell].eql?(neighbor[:cell])}\n if existing_open\n # Find the shorter distance to the cell\n current_distance = existing_open[:distance]\n new_distance = current_node[:distance] + neighbor[:distance]\n existing_opened[:distance] = new_distance if current_distance > new_distance\n else\n # Add the new visited cell to the open list\n neighbor[:distance] = neighbor[:distance] + current_node[:distance]\n open << neighbor\n end\n end\n }\n closed << current_node\n open.delete(current_node)\n end\n 0\n end",
"def pop_cheapest_leaf(leaves)\n cheapest_leaf = nil\n cheapest_index = nil\n leaves.each_with_index do |leaf, i|\n if cheapest_leaf.nil? || leaf[:m_distance] < cheapest_leaf[:m_distance]\n cheapest_leaf = leaf\n cheapest_index = i\n end\n end\n leaves.delete_at(cheapest_index)\n return cheapest_leaf\n end",
"def compute_position\n # The negative and the ninety are the fudge to compensate for our map.\n lat = @latitude_radians = radians(-@latitude)\n long = @longitude_radians = radians(@longitude + 90)\n radius = $app.globe.diameter / 2.0 - 23\n @x = radius * cos(lat) * sin(long)\n @y = radius * sin(lat)\n @z = radius * cos(lat) * cos(long)\n end",
"def find_best_missile_spot(radius = 2)\n # initialize variables\n total_unit_cost = 0.1\n best_spot = [-1,-1]\n cost = 0\n # check each spot on map\n for y in 0...$game_map.height\n for x in 0...$game_map.width\n cost = 0\n positions = $game_map.get_spaces_in_area(x,y,radius)\n positions.each{|pos|\n u = $game_map.get_unit(pos[0],pos[1])\n next if u.nil?\n if u.army == @player_turn\n cost -= u.cost * u.unit_hp\n else\n cost += u.cost * u.unit_hp\n end\n }\n # Prefers most cost effective strike\n if cost >= total_unit_cost\n # If this spot is the same results as another spot\n if cost == total_unit_cost\n # Obtain units, if any, at these two spots\n unit_a = $game_map.get_unit(best_spot[0],best_spot[1])\n unit_b = $game_map.get_unit(x,y)\n # If there was no unit at best_spot\n if unit_a.nil?\n best_spot = [x,y]\n total_unit_cost = cost\n else\n # If there is a unit at this current spot\n unless unit_b.nil?\n # If the cost of this unit is more than the 'best_spot' unit\n if unit_a.cost(false) < unit_b.cost(false)\n best_spot = [x,y]\n total_unit_cost = cost\n end\n end\n end\n else\n best_spot = [x,y]\n total_unit_cost = cost\n end\n end\n end\n end\n return best_spot\n end",
"def nearest(element_id)\n nearest(element_id, from: target)\n end",
"def mercator_limit\n LocationCoordinate.new([[-90.0, latitude].max, 90.0].min, longitude % 180.0)\n end",
"def set_nearest_station\n @nearest_station = NearestStation.find(params[:id])\n end",
"def distance_price\n distance * price_per_km\n end",
"def distance\n distance_and_arc[:distance]\n end",
"def distance\n distance_and_arc[:distance]\n end",
"def fill_with_oxygen\n BFS.max_depth(Finder.new(@map.oxygen_pos, @map))\n end",
"def relative(max_fret_dist)\n not_open = @positions.select{|p| !p.nil? and p > 0}\n \n if not_open.max <= (max_fret_dist + 1)\n @positions\n else\n diff = (not_open.min - 1)\n @positions.map{|p| (p.nil? or p == 0) ? p : p - diff}\n end\n end",
"def initialize(longitude, latitude, location_id, parent)\n @longitude = longitude\n @latitude = latitude\n @location_id = location_id\n @parent = parent\n @children = [nil,nil,nil,nil]\n @total_leaves = if location_id.nil? then 0 else 1 end\n end",
"def retreat(distance = 1)\n # Don't let the cursor get below zero\n return if @position.x < distance\n\n @position.x -= distance\n end",
"def drive(distanceInMiles)\n\t\t\n\t\tgasToRemove = self.fuelEfficiency * distanceInMiles\n\n\t\tself.fuelLevel -= gasToRemove\n\n\t\t#\tEnsure we don't go below zero gas\n\t\tself.fuelLevel = [self.fuelLevel, 0].max\n\tend",
"def find_nearest_place_id(max_distance)\n near = Place.near(@location, max_distance)\n near = near.limit(1)\n near.projection({:_id=>1}).first[:_id]\n end",
"def allocate_distance(total)\n\t\t# TODO - should be a range from .5 - .2 incr of .05 - 6 possibilites\n\t\tincr = rand(0..5)\n\t\t@up.target_distance = total * (0.2 + (0.05 * incr))\n\n\t\ttotal -= @up.target_distance\n\n\t\t@down.target_distance = 200\n\t\ttotal -= @down.target_distance\n\n\t\t@main.target_distance = total\n\tend"
] | [
"0.7133173",
"0.6104328",
"0.58099306",
"0.55982375",
"0.54753995",
"0.53915673",
"0.5343848",
"0.5337359",
"0.5316703",
"0.52875584",
"0.5238724",
"0.5238321",
"0.521971",
"0.51853186",
"0.51826876",
"0.5162653",
"0.51573294",
"0.5144329",
"0.5136009",
"0.51356137",
"0.51223284",
"0.5104776",
"0.5093459",
"0.50625134",
"0.5052992",
"0.5036365",
"0.5036365",
"0.50247425",
"0.4992198",
"0.49914512",
"0.49720865",
"0.49572012",
"0.49572012",
"0.49545634",
"0.49507576",
"0.49212304",
"0.490172",
"0.4878527",
"0.4874493",
"0.48643947",
"0.4857738",
"0.48567685",
"0.48539948",
"0.4853465",
"0.48401803",
"0.48258236",
"0.4825451",
"0.4824658",
"0.48243487",
"0.48219314",
"0.48189163",
"0.4818519",
"0.48127678",
"0.48073548",
"0.48016092",
"0.47996473",
"0.47974688",
"0.47730374",
"0.4772512",
"0.47692466",
"0.47472483",
"0.47387028",
"0.47249475",
"0.4724918",
"0.47192153",
"0.47143656",
"0.4705847",
"0.47039998",
"0.46957162",
"0.46916962",
"0.46912658",
"0.46878925",
"0.46827403",
"0.46804088",
"0.46721154",
"0.46720415",
"0.46629667",
"0.46626577",
"0.46616238",
"0.4652054",
"0.4648108",
"0.46449825",
"0.46416825",
"0.46406716",
"0.46401304",
"0.46390948",
"0.4634845",
"0.4634272",
"0.46337673",
"0.4632008",
"0.4625665",
"0.46236098",
"0.46236098",
"0.46196634",
"0.46191302",
"0.4617569",
"0.4616707",
"0.46154067",
"0.4610492",
"0.46073547"
] | 0.85513055 | 0 |
Look for mountains within radius to parent or 30km whichever is higher. If this mountain is higher than a mountain in this radius and closer than its parent then change that mountains parent to be this mountain and update its dist_to_parent | def refresh_nearby_mountains
return unless self.height_changed? || self.latitude_changed? || self.longitude_changed?
Mountain.find_by_radius(self.latitude,self.longitude,self.dist_to_parent + 20).where("type = 'Mountain'").each do |mountain|
next if mountain.height.nil? || mountain.dist_to_parent.nil?
if mountain.height < self.height && self != mountain && dist(mountain.latitude, mountain.longitude) < mountain.dist_to_parent
mountain.parent_mountain_id = self.id
mountain.dist_to_parent = dist(mountain.latitude, mountain.longitude)
mountain.set_height_and_isolation
mountain.save
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_parent_mountain_by_radius radius\n Place.find_by_radius(centerLatitude, centerLongitude, radius, (height||0)+1).where(\"type = 'Mountain'\").each do |mountain|\n distance = dist(mountain.centerLatitude, mountain.centerLongitude) \n if distance < dist_to_parent && self != mountain\n self.dist_to_parent = distance\n\t self.parent_mountain_id = mountain.id\n\t self.parent_mountain = mountain\n\t self.set_height_and_isolation\n\tend\n end \n end",
"def getSurroundingLowestElevations(parent)\n\t\tx = parent.x\n\t\ty = parent.y\n\t\tcost = 0\n\t\tmin = nil\n\t\twaterFound = false\n\t\twater = nil\n\t\tmin_list = Array.new\n\t\t\n\t\t#search nodes around parent node\n\t\tfor i in (x-1..x+1)\n\t\t\tfor j in (y-1..y+1)\n\t\t\t\t#if its not the parent node\n\t\t\t\tif (i != x or j != y)\n\t\t\t\t\ttemp = @map[check_xy(i)][check_xy(j)]\n\t\t\t\t\t\n\t\t\t\t\t#if we've managed to find the ocean or some other water\n\t\t\t\t\tif temp.type != \"Land\"\n\t\t\t\t\t\twaterFound = true\n\t\t\t\t\t\twater = @river_struct.new parent, check_xy(i), check_xy(j), find_angle(parent, check_xy(i), check_xy(j)), parent.ttd-1\n\t\t\t\t\telsif (temp.elevation != -1 and temp.type == \"Land\")\n\t\t\t\t\t\tif min == nil or temp.elevation < @map[min.x][min.y].elevation\n\t\t\t\t\t\t\tmin_list.clear\n\t\t\t\t\t\t\tmin = @river_struct.new parent, check_xy(i), check_xy(j), find_angle(parent, check_xy(i), check_xy(j)), parent.ttd-1\n\t\t\t\t\t\t\tmin_list.push(min)\n\t\t\t\t\t\telsif temp.elevation == @map[min.x][min.y].elevation\n\t\t\t\t\t\t\tmin_list.push(@river_struct.new parent, check_xy(i), check_xy(j), find_angle(parent, check_xy(i), check_xy(j)), parent.ttd-1)\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t#if water has been found clear other options and use that node\n\t\tif waterFound\n\t\t\tmin_list.clear\n\t\t\tmin_list.push(water)\n\t\tend\n\t\t\n\t\treturn min_list\n\t\t\n\tend",
"def labelPlaces\n return unless waypoints_changed?\n Place.find_by_radius(averageLatitude, averageLongitude, 50, 0).each do |place|\n minDistance = 400#km\n closestPoint = waypoints.first\n waypoints_minus_removed.each do |waypoint|\n\tdistance = place.dist waypoint.latitude, waypoint.longitude\n\tif minDistance > distance\n\t minDistance = distance\n\t closestPoint = waypoint\n\tend\n end\n # Someone entered a point on the place. If a mountain then replace the height\n # with the correct value and adjust the height change to reflect the new value.\n # If the waypoint isn't labelled then give it the places title and icon.\n if minDistance < 0.3 && !closestPoint.height.nil?\n\tparent = waypoints_minus_removed[closestPoint.parent_index]\n if place.class == Mountain && parent.present?\n heightChange = closestPoint.height - parent.height\n self.height_gain -= heightChange > 0 ? heightChange : 0 unless self.height_gain.nil?\n self.height_loss -= heightChange < 0 ? -heightChange : 0 unless self.height_loss.nil?\n end\n\tclosestPoint.height = place.height if place.class == Mountain\n\tclosestPoint.icon = place.class::MARKER_ICON[0..-5] if closestPoint.icon.nil?\n\tclosestPoint.title = place.name if closestPoint.title.nil?\n if place.class == Mountain && parent.present?\n heightChange = closestPoint.height - parent.height\n self.height_gain += heightChange > 0 ? heightChange : 0 unless self.height_gain.nil?\n self.height_loss += heightChange < 0 ? -heightChange : 0 unless self.height_loss.nil?\n end\n end\n end\n end",
"def cluster\n closest_distance = 0\n while closest_distance < @max_distance\n closest_distance, c1, c2 = find_closest_distance\n\n if closest_distance < @max_distance\n merge(c1, c2)\n end\n end\n end",
"def add_to_parent(new_entry, parent) \n index = 0\n parent.children.each do\n if(new_entry.cidr.packed_network < parent.children[index].cidr.packed_network)\n break\n end\n index += 1\n end\n\n parent.children.insert(index, new_entry)\n\n return()\n end",
"def grab_nearest_by_location(distance, loc)\n\n end",
"def chargeVoisins\n for x in 0..(self.lignes-1)\n for y in 0..(self.colonnes-1)\n if (self.get_child_at(x,y).status == 'i')\n\n # DROITE\n for x2 in (x+1).upto(self.lignes-1)\n if (self.get_child_at(x2, y).status == 'i')\n self.get_child_at(x, y).eastNode = self.get_child_at(x2,y)\n break\n end\n end\n\n #BAS\n for y2 in (y+1).upto(self.colonnes-1)\n if (self.get_child_at(x,y2).status == 'i')\n self.get_child_at(x,y).southNode = self.get_child_at(x,y2)\n break\n end\n end\n \n #HAUT\n for y2 in (y-1).downto(0)\n if (self.get_child_at(x,y2).status == 'i')\n self.get_child_at(x,y).northNode = self.get_child_at(x,y2)\n break\n end\n end\n\n # Gauche\n for x2 in (x-1).downto(0)\n if (self.get_child_at(x2,y).status == 'i')\n self.get_child_at(x,y).westNode = self.get_child_at(x2,y)\n break\n end\n end\n end\n end \n end\n\n return self\n end",
"def parent_mass_error_distances\n mass_error_as_distance_array(self['search']['spectrum']['parent_mass_error'])[0,2]\n end",
"def calculate_relatives!(root_id)\n @relatives = {root_id => 0}\n queue = Set[root_id]\n until queue.empty?\n new_queue = Set[]\n queue.each do |id|\n character = Character[id]\n [character.mother, character.father].compact.each do |c|\n next if @relatives[c.id]\n @relatives[c.id] = @relatives[id] + 1\n new_queue << c.id\n end\n end\n queue = new_queue\n end\n queue = Set[*@relatives.keys]\n until queue.empty?\n new_queue = Set[]\n queue.each do |id|\n character = Character[id]\n character.children.each do |c|\n next if @relatives[c.id]\n @relatives[c.id] = @relatives[id] + 1\n new_queue << c.id\n end\n end\n queue = new_queue\n end\n end",
"def waypoints_must_be_at_most_n_km_apart\n self.waypoints_minus_removed.each do |waypoint|\n next if waypoint.parent_index.nil? || waypoint.parent_index < 0 || waypoint.parent_index == waypoint.local_index\n parent = waypoints_minus_removed[waypoint.parent_index]\n if !parent.nil? && type == 'Road' && waypoint.dist(parent.latitude, parent.longitude) > 50\n\tputs \"cannot be more than 50km apart.\"\n errors.add(:waypoints, \"cannot be more than 50km apart.\")\n elsif !parent.nil? && type != 'Road' && waypoint.dist(parent.latitude, parent.longitude) > 20\n\tputs \"cannot be more than 20km apart.\"\n errors.add(:waypoints, \"cannot be more than 20km apart.\")\n end\n end\n end",
"def change_distance\n @before_dist = session[:distance];\n @distance = params[:distance];\n @holes = Pothole.near([session[:lat], session[:lng]], @distance, :order => session[:sorting]);\n build_markers\nend",
"def initialize(longitude, latitude, location_id, parent)\n @longitude = longitude\n @latitude = latitude\n @location_id = location_id\n @parent = parent\n @children = [nil,nil,nil,nil]\n @total_leaves = if location_id.nil? then 0 else 1 end\n end",
"def shortest_route_by_distance_to!(place_or_object_place_was_built_from)\n routes_for!(place_or_object_place_was_built_from).min_by(&:distance_in_meters)\n end",
"def min_distance\n @min_distance ||= (_fence.southwest & _fence.northeast) * @min_distance_ratio\n end",
"def push_new_associate\n # We short-circuit any nodes whose global value would be less than the cutoff\n new_child unless child_attenuation < @sn_cutoff\n end",
"def find_solution\n open = [{:cell => @start_cell, :parent => nil, :distance => 0}]\n closed = []\n\n while !open.empty?\n # Find the lowest movement cost\n current_node = open.min{ |a,b| a[:distance] <=> b[:distance]}\n\n # Check if we reached the end cell\n if is_end?(current_node[:cell])\n return current_node[:distance]\n end\n\n # Find immediate neighbors\n current_neighbors = find_neighbors(current_node[:cell])\n current_neighbors.each { | neighbor |\n if closed.find { | node | node[:cell].eql?(neighbor[:cell])}.nil?\n # Find if the cell is already in the open list\n existing_open = open.find { |node | node[:cell].eql?(neighbor[:cell])}\n if existing_open\n # Find the shorter distance to the cell\n current_distance = existing_open[:distance]\n new_distance = current_node[:distance] + neighbor[:distance]\n existing_opened[:distance] = new_distance if current_distance > new_distance\n else\n # Add the new visited cell to the open list\n neighbor[:distance] = neighbor[:distance] + current_node[:distance]\n open << neighbor\n end\n end\n }\n closed << current_node\n open.delete(current_node)\n end\n 0\n end",
"def select_within_radius km\n self.location_hash = location_hash.select {|h1| distance(h1) <= km }\n end",
"def find_within_radius(distance, property=nil)\n locations = find_within_box(distance).delete_if { |l| self.distance_to(l) > distance }\n\t\tproperty ? locations.map(&property.to_sym) : locations\n end",
"def distanceToSearchCenter(centerLat, centerLong)\n\n # kilometers\n earthRadius = 6371 \n\n buildingLat = self.gis_lat\n buildingLong = self.gis_long\n\n buildingLatRad = buildingLat/180 * Math::PI\n centerLongRad = centerLong/180 * Math::PI\n\n\n dLat = (centerLat-buildingLat)/180 * Math::PI;\n dLon = (centerLong-buildingLong)/180 * Math::PI;\n\n a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n Math.cos(buildingLatRad) * Math.cos(centerLongRad) *\n Math.sin(dLon/2) * Math.sin(dLon/2);\n\n c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n\n distanceMeters = 6371*1000 * c; \n puts distanceMeters\n distanceMeters\n end",
"def distance_to(other)\n # using Spherical Law of Cosines formula to calculate 'great circle' distance\n # http://www.movable-type.co.uk/scripts/latlong.html\n # assumes a spherical moon\n # result in is metres\n lat1_r = to_rad(self.lat)\n lat2_r = to_rad(other.lat)\n delta = to_rad(other.long - self.long)\n Math.acos(\n Math.sin(lat1_r) * Math.sin(lat2_r) +\n Math.cos(lat1_r) * Math.cos(lat2_r) * Math.cos(delta)\n ) * RADIUS\n end",
"def drive(distanceInMiles)\n\t\t\n\t\tgasToRemove = self.fuelEfficiency * distanceInMiles\n\n\t\tself.fuelLevel -= gasToRemove\n\n\t\t#\tEnsure we don't go below zero gas\n\t\tself.fuelLevel = [self.fuelLevel, 0].max\n\tend",
"def guide(from, to, unit_type=nil, max_depth=400)\n return nil if @map.blocked?(from, unit_type) || @map.blocked?(to, unit_type)\n from_element = PathElement.new(from)\n from_element.dist_from = @map.distance(from,to)\n open = PriorityQueue.new { |x, y| (x <=> y) == -1 }\n open.push from_element, from_element.rating\n closed = SplayTreeMap.new\n step = 0\n \n until open.empty? || step > max_depth\n step += 1\n \n current_element = open.pop\n @nodes_considered += 1\n \n loc = current_element.location\n if @map.cost(loc,to) == 0\n path = []\n until current_element.parent.nil?\n path.unshift current_element\n current_element = current_element.parent\n end\n\n return path\n else\n closed.push loc, current_element\n @map.neighbors(loc).each do |next_door|\n next if closed.has_key? next_door\n\n el = PathElement.new(next_door,current_element)\n\n if @map.blocked? next_door, unit_type\n closed.push el.location, el\n else\n current_rating = current_element.cost_to + @map.cost(loc, next_door)\n\n # add to open\n el.cost_to = current_rating\n el.dist_from = @map.distance(next_door,to)\n \n open.push el, el.rating\n end\n end\n end\n end\n nil\n end",
"def guide(from, to, unit_type=nil, max_depth=400)\n return nil if @map.blocked?(from, unit_type) || @map.blocked?(to, unit_type)\n from_element = PathElement.new(from)\n from_element.dist_from = @map.distance(from,to)\n open = PrioritySet.new\n open.push from_element, from_element.rating\n closed = SplayTreeMap.new\n step = 0\n\n until open.empty? || step > max_depth\n step += 1\n\n current_element = open.pop\n @nodes_considered += 1\n\n loc = current_element.location\n if @map.cost(loc,to) == 0\n path = []\n until current_element.parent.nil?\n path.unshift current_element\n current_element = current_element.parent\n end\n\n return path\n else\n closed.push loc, current_element\n @map.neighbors(loc).each do |next_door|\n if closed.has_key? next_door\n next\n end\n \n el = PathElement.new(next_door,current_element)\n\n if @map.blocked? next_door, unit_type\n closed.push el.location, el\n else\n current_rating = current_element.cost_to + @map.cost(loc, next_door)\n\n # add to open\n el.cost_to = current_rating\n el.dist_from = @map.distance(next_door,to)\n el.reset_rating\n\n open.push el, el.rating\n end\n end\n end\n end\n nil\n end",
"def parent_location_full_child_tree\n parent_location = self\n\n self.class.full_tree_location_ids = self.class.full_tree_location_ids + \"#{self.id}, \"\n \n parent_location.locations.each do |location|\n\n self.class.full_tree_location_ids = self.class.full_tree_location_ids + \"#{location.id}, \"\n logger.debug(\"XXXXXXXXXXXXXx #{self.class.full_tree_location_ids}\")\n \n unless location.locations.empty?\n location.parent_location_full_child_tree\n end\n end\n self.class.full_tree_location_ids[0..-3]\n end",
"def parent\n raise NoParentRationalNumberIsRootError if root?\n numerator = @nv\n denominator = @dv\n _parent = RationalNumber.new\n compare_key = RationalNumber.new\n # make sure we break if we get root values! (numerator == 0 + denominator == 0)\n while ((compare_key.nv < @nv) && (compare_key.dv < @dv)) && ((numerator > 0) && (denominator > 0))\n div = numerator / denominator\n mod = numerator % denominator\n # set return values to previous values, as they are the parent values\n _parent.set_from_other(compare_key)\n\n # temporary calculations (needed)\n parent_nv = _parent.nv + (div * _parent.snv)\n parent_dv = _parent.dv + (div * _parent.sdv)\n\n compare_key.set_values( parent_nv , #nv\n parent_dv , #dv\n parent_nv + _parent.snv, #snv\n parent_dv + _parent.sdv) #sdv\n numerator = mod\n if (numerator != 0)\n denominator = denominator % mod\n denominator = 1 if denominator == 0\n end\n end\n _parent\n end",
"def parent_share\n fetch(:parent_share) do\n if value && (slot_demand = rgt_output.external_value)\n slot_demand.zero? ? 0.0 : value / slot_demand\n end\n end\n end",
"def find_new_road\n return nil if finding_new_road?\n return nil if Params::NEW_ROOT_FIND_PERCENTAGE < rand(Params::PERCENT_DENOMINATOR)\n\n found_mini_map_ids = mini_map_roads.collect{|r| r.end_mini_map_id}\n found_mini_map_ids << id\n not_found_mini_map_ids = MiniMap.all.collect{|m| m.id} - found_mini_map_ids\n end_mini_map_id = not_found_mini_map_ids[rand(not_found_mini_map_ids.size)]\n \n return end_mini_map_id\n end",
"def calculate_up_child\n # Guard condition for movement not possible\n return nil if blank_y + 1 == size\n\n # Make the movement\n new_state = swap_up\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, blank_y + 1)\n end",
"def parent_for_new(tree_node, value)\n return tree_node if !tree_node.left && value < tree_node.value\n return tree_node if !tree_node.right && value > tree_node.value\n\n if value > tree_node.value\n return parent_for_new(tree_node.right, value)\n else\n return parent_for_new(tree_node.left, value)\n end\n end",
"def find_parent\n if params.key?(:reservation_id)\n @parent = @car.reservations.find(params[:reservation_id])\n elsif params.key?(:ride_id)\n @parent = @car.rides.find(params[:ride_id])\n else\n @parent = @car\n end\n end",
"def find_nearest_parent(target_class)\n columns = ['id', 'parent_id', 'construct_id', 'construct_type']\n columns_joined = columns.join(',')\n sql =\n <<-SQL\n WITH RECURSIVE control_constructs_tree (#{columns_joined}, level)\n AS (\n SELECT\n #{columns_joined},\n 0\n FROM control_constructs\n WHERE construct_id = #{id}\n AND construct_type = '#{self.class.name}'\n\n UNION ALL\n SELECT\n #{columns.map { |col| 'cat.' + col }.join(',')},\n ct.level + 1\n FROM control_constructs cat, control_constructs_tree ct\n WHERE cat.id = ct.parent_id\n )\n SELECT #{target_class.table_name}.*\n FROM control_constructs_tree\n INNER JOIN #{target_class.table_name} ON #{target_class.table_name}.id = control_constructs_tree.construct_id\n WHERE level > 0\n AND construct_type = '#{target_class.name}'\n ORDER BY level, control_constructs_tree.id, construct_id, construct_type\n LIMIT 1;\n SQL\n target_class.find_by_sql(sql.chomp).first\n end",
"def reduce_root(tree_match=nil)\n if tree_match.nil?\n reduce_root_tree_var(self.name)\n else\n tree = find{|i| i === tree_match}.reduce_root\n update_height\n tree\n end\n end",
"def calculate_down_child\n # Guard condition for movement not possible\n return nil if blank_y - 1 < 0\n\n # Make the movement\n new_state = swap_down\n\n # Avoids loop\n parents_array = parent_states(10)\n return nil if parents_array.include?(new_state)\n\n # Returns new node\n Node.new(new_state, self, blank_x, blank_y - 1)\n end",
"def init_child_search child, weight=nil\n child.init_search weight, @sn_cutoff\n # The attenuation for a child is the attenuation of the parent times the weight of the parent\n child.sn_local_to_global = child_attenuation\n @sn_associates.push child\n end",
"def place_nodes_into_pockets\n centroid_pockets = Array.new(@centroids.size) {[]}\n @centroids.each_with_index do |centroid, centroid_index|\n @nodes.each_with_index do |node, node_index|\n if node.closest_centroid == centroid\n centroid_pockets[centroid_index] << node_index\n #Store closest nodes in the centroid object\n centroid.nodes << node\n end\n end\n end\n @centroid_pockets = centroid_pockets\n end",
"def maximize_distance(params = {})\n params = fix_params params\n\n optimize_for_location({\n start: params[:start],\n finish: {\n lat: params[:start][:lat],\n lon: 175 #somewhere halfway across the pacific\n },\n timeout: params[:timeout],\n performance: params[:performance],\n use_faa: params[:use_faa],\n check_countries: params[:countries]\n })\n end",
"def relative(max_fret_dist)\n not_open = @positions.select{|p| !p.nil? and p > 0}\n \n if not_open.max <= (max_fret_dist + 1)\n @positions\n else\n diff = (not_open.min - 1)\n @positions.map{|p| (p.nil? or p == 0) ? p : p - diff}\n end\n end",
"def nearby\n\n #select * from ( select * from Location\n # WHERE Longitude > @lngA-(@dist/(cos( radians(@latA+(@dist/68.703)))*69.172))\n # AND Longitude < @lngA+(@dist/(cos( radians(@latA+(@dist/68.703)))*69.172))\n # AND Latitude > @latA-(@dist/68.703)\n # AND Latitude < @latA+(@dist/68.703) ) AS `tmp` WHERE GEODISTANCE(@latA,@lngA ,Latitude,Longitude) < @dist\n\n #Calculate a bounding box we can use to quickly find nearby trucks\n lat = params[:lat].to_f\n lng = params[:lng].to_f\n dist = params[:radius].to_f\n latDelta = dist/68.703\n\n value = lat+(latDelta);\n rad = value/180 * Math::PI #Geocoder::Calculations.to_radians(value) #value.to_ra radians(value);\n\n lngDelta = dist/(Math.cos( rad)*69.172)\n minLng = lng-lngDelta\n maxLng = lng+lngDelta\n minLat = lat-latDelta\n maxLat = lat+latDelta\n\n\n #IFNULL( SQRT(((difX)(difX))+((difY)(difY))), 99999)\n trucks = Truck.find_by_sql \"SELECT trucks.* WHERE SQRT(((trucks.lng-#{lng})(trucks.lng-#{lng}))+((trucks.lat-#{lat})(trucks.lat-#{lat}))) < #{dist}\"\n\n render :json => trucks\n end",
"def find_parent(cidr,parent)\n version = cidr.version\n\n parent.children.each do |entry|\n if (entry.cidr.version == version && entry.cidr.contains?(cidr))\n parent = entry\n\n if (parent.children.length > 0)\n search_results = find_parent(cidr,parent)\n parent = search_results if (search_results)\n end\n break\n end\n end\n\n return(parent)\n end",
"def weight\n @parents.inject(1) { |res, p| res + p.weight * @parent_multiplier }\n end",
"def tree_recursive(parent)\n threshold ||= 2 * 12 # 8x8 by default\n\n parent.get_info do |offset_x, offset_y, width, height|\n if (width >= threshold || height >= threshold)\n child_1 = nil\n child_2 = nil\n if (height >= threshold) # cut horizontally\n child_1 = Node.new(parent.offset.clone, [width, height/2])\n child_2 = Node.new([(parent.offset[0] + height/2),parent.offset[1]], [width, height - height/2])\n else\n child_1 = Node.new(parent.offset.clone, [width/2, height])\n child_2 = Node.new([parent.offset[0], (parent.offset[1] + width/2)], [width - width/2, height])\n end\n parent.left = child_1\n parent.right = child_2\n child_1.parent = child_2.parent = parent\n\n tree_recursive(child_1)\n tree_recursive(child_2)\n end\n end\n end",
"def parent_compare(child, parent)\n\t\tunless parent.nil?\n\t\t\tif child.rating < parent.rating\n\t\t\t\tswap(child, parent)\n\t\t\t\tparent_compare(child, child.parent)\n\t\t\tend \n\t\tend\n\tend",
"def changing_location_parent?(owner)\n\t params[:location_type] == \"parent_location\" && !owner.location.parent_id.nil? && owner.location.parent_id != params[:referenced_venue_id]\n\t end",
"def transfers_to_reach_santa\n santa_ancestors = @node_hash['SAN'].ancestors\n you_ancestors = @node_hash['YOU'].ancestors\n closest_common_ancestor = self.class.closest_common_ancestor(santa_ancestors, you_ancestors)\n distance_from_common_to_santa = santa_ancestors.length - santa_ancestors.index(closest_common_ancestor) - 1\n distance_from_common_to_you = you_ancestors.length - you_ancestors.index(closest_common_ancestor) - 1\n distance_from_common_to_santa + distance_from_common_to_you\n end",
"def closest(num = 8)\n opts = {\n order: {\n _geo_distance: {\n 'location' => \"#{latitude},#{longitude}\",\n 'order' => 'asc',\n 'unit' => 'mi'\n }\n },\n limit: num,\n where: {\n id: { not: id }\n }\n }\n Location.search('*', opts).results\n end",
"def child_attenuation\n @child_attenuation ||= @sn_local_to_global*@search_node_weight\n end",
"def update_parent(node, num, new_node)\n\t\tparent = node.parent\n\t\tunless parent.nil?\n\t\t\tif parent.key > num\n\t\t\t\tparent.left = new_node\n\t\t\telse\n\t\t\t\tparent.right = new_node\n\t\t\tend\n\t\tend\n\tend",
"def closest_to_center(list)\n list\n .sort_by { |point| dist(point, point(0,0)) }\n .first\nend",
"def cohesion(boids)\n neighbordist = 50\n sum = PVector.new(0, 0) # Start with empty vector to accumulate all locations\n count = 0\n boids.each do |other|\n d = PVector.dist(@location, other.location)\n if d > 0 && d < neighbordist\n sum.add(other.location) # Add location\n count += 1\n end\n end\n if count > 0\n sum.div(count)\n return seek(sum) # Steer towards the location\n else\n return PVector.new(0, 0)\n end\n end",
"def calculate_key_distances\n user = self.user\n group = self.group\n if self.is_key? # if a key location is changed, update all the others\n loc = self\n # get location's user (owner), then get all that users' locations, and update them based on this new key\n # second arg is self_is_key\n # this should only be within groups\n if group\n group.locations.each do |location|\n location.update_distance_to_key(loc)\n end\n else\n user.locations.each do |location|\n location.update_distance_to_key(loc)\n end\n end\n else\n # location being updated just needs to recalculate distances to known key locations for itself\n # other locations remain untouched\n if group\n keys = group.locations.where(:is_key => true)\n else\n # user did not choose a group...\n keys = user.locations.where(\"is_key =? AND group_id IS NULL\",true)\n end\n unless keys.empty? \n keys.each do |key|\n puts \"calculating key distance for #{key.address}\"\n self.update_distance_to_key(key) \n end\n end\n end\n \n end",
"def analyze_dirs(dir_to_analyze, parent)\n\n\n # bootstrap case\n # don't create an entry for the root because there's nothing to link to yet, scan the subdirs\n if (dir_to_analyze == self.target_volume)\n # puts \"Dir to analyze is the target volume\"\n # run on all child dirs, not this dir\n Dir.entries(dir_to_analyze).reject {|d| d.start_with?('.')}.each do |name|\n # puts \"\\tentry: >#{file}<\"\n full_path = File.join(dir_to_analyze, name)\n if (Dir.exist?(full_path) && !File.symlink?(full_path))\n # puts \"Contender: >#{full_path}<\"\n analyze_dirs(full_path, self.dir_tree)\n end\n end\n return\n end\n\n # use \"P\" to help prevent following any symlinks\n cmd = \"du -sxkP \\\"#{dir_to_analyze}\\\"\"\n puts \"\\trunning #{cmd}\"\n output = `#{cmd}`.strip().split(\"\\t\")\n # puts \"Du output:\"\n # pp output\n size = output[0].to_i \n size_gb = \"#{'%.0f' % (size.to_f / 1024 / 1024)}\"\n # puts \"Size: #{size}\\nCapacity: #{self.diskhash['/']['capacity']}\"\n\n # Occupancy as a fraction of total space\n # occupancy = (size.to_f / self.capacity.to_f)\n\n # Occupancy as a fraction of USED space\n occupancy = (size.to_f / self.used.to_f)\n\n occupancy_pct = \"#{'%.0f' % (occupancy * 100)}\"\n capacity_gb = \"#{'%.0f' % (self.capacity.to_f / 1024 / 1024)}\"\n \n # if this dir contains more than 5% of disk space, add it to the tree\n\n if (dir_to_analyze == self.target_dir)\n # puts \"Dir to analyze is the target dir, space used outside this dir..\"\n # account for space used outside of target dir\n other_space = self.used - size\n other_space_gb = \"#{'%.0f' % (other_space / 1024 / 1024)}\"\n parent.children.push(DirNode.new(parent, self.target_volume, 'Other Space', other_space_gb))\n end\n \n \n if (occupancy > self.threshold_pct)\n # puts \"Dir contains more than 5% of disk space: #{dir_to_analyze} \\n\\tsize:\\t#{size_gb} / \\ncapacity:\\t#{capacity_gb} = #{occupancy_pct}%\"\n puts \"Dir contains more than 5% of used disk space: #{dir_to_analyze} \\n\\tsize:\\t\\t#{size_gb} / \\n\\toccupancy:\\t#{self.used_gb} = #{occupancy_pct}% of used space\"\n\n # puts \"Dir to analyze (#{dir_to_analyze}) is not the target dir (#{self.target_dir})\"\n dirs = dir_to_analyze.split('/')\n \n short_dir = dirs.pop().gsub(\"'\",\"\\\\\\\\'\")\n full_parent = dirs.join('/')\n if (dir_to_analyze == self.target_dir || full_parent == self.target_volume)\n # puts \"Either this dir is the target dir, or the parent is the target volume, make parent the full target volume\"\n short_parent = self.target_volume.gsub(\"'\",\"\\\\\\\\'\")\n else\n # puts \"Neither this dir or parent is the target dir, making parent short\"\n short_parent = dirs.pop().gsub(\"'\",\"\\\\\\\\'\")\n end\n \n\n this_node = DirNode.new(parent, dir_to_analyze, short_dir, size_gb)\n parent.children.push(this_node)\n\n # run on all child dirs\n Dir.entries(dir_to_analyze).reject {|d| d.start_with?('.')}.each do |name|\n full_path = File.join(dir_to_analyze, name)\n # don't follow any symlinks\n if (Dir.exist?(full_path) && !File.symlink?(full_path))\n # puts \"Contender: >#{full_path}<\"\n analyze_dirs(full_path, this_node)\n end\n end\n \n end # occupancy > threshold\n \n end",
"def withinRadius(latitude,longitiude,radius)\n \n rad = 3963.1676\n lat1 = to_rad(latitude.to_f)\n lat2 = to_rad(self.latitude.to_f)\n lon1 = to_rad(longitiude.to_f)\n lon2 = to_rad(self.longitude.to_f)\n dLat = lat2-lat1 \n dLon = lon2-lon1\n \n a = Math::sin(dLat/2) * Math::sin(dLat/2) +\n Math::cos(lat1) * Math::cos(lat2) * \n Math::sin(dLon/2) * Math::sin(dLon/2);\n \n c = 2 * Math::atan2(Math::sqrt(a), Math::sqrt(1-a));\n \n distance = rad * c\n \n #logger.debug \"distance IS\"\n #logger.debug distance\n #logger.debug \"radius IS\"\n #logger.debug radius\n \n return distance\n end",
"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",
"def nearest_mine\n src = @pos\n shortest_dst = 63\n nearest = [0,0]\n unowned_mines = @game.mines_locs.reject { |pos, hero_id| hero_id == @hero_id }\n unowned_mines.each do |pos, hero_id|\n build_branching_paths(src, pos)\n path = find_path(pos)\n if path.length < shortest_dst\n shortest_dst = path.length\n nearest = pos\n end\n end\n nearest\n end",
"def calculate_left_child\n # Guard condition for movement not possible\n return nil if blank_x + 1 == size\n\n # Make the movement\n new_state = swap_left\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",
"def distance\n self.distance_to(current_knocker)\n end",
"def updateCosts(children, costs, parent, unvisitedNodes) \n # If the cost from the parent to any of the children is less than\n # what is currently recorded, replace it\n children.each do |child,cost|\n if (cost < costs[child][:cost])\n costs[child] = {\n cost: cost,\n parent: parent\n }\n end\n end\n # when we're done, remove this node from the list of unvisited nodes\n unvisitedNodes.delete(parent)\n end",
"def parent=(parent)\n if parent.nil?\n raise GeogError, \"Parent can't be set to nil in Taxonifi::Model::Geog.\"\n end\n\n if @rank.nil?\n raise Taxonifi::GeogError, \"Parent of geog can not be set if rank of child is not set.\" \n end\n\n if parent.class != Taxonifi::Model::Geog\n raise GeogError, \"Parent is not a Taxonifi::Model::Geog.\"\n end\n\n if GEOG_RANKS.index(parent.rank) >= GEOG_RANKS.index(self.rank)\n raise GeogError, \"Parent is same or lower rank than self (#{rank}).\"\n end\n \n @parent = parent\n end",
"def update_with_nested_interval\n if read_attribute(nested_interval_foreign_key).nil?\n set_nested_interval 0, 1\n elsif !parent.updated?\n db_self = self.class.find(id, :lock => true)\n write_attribute(nested_interval_foreign_key, db_self.read_attribute(nested_interval_foreign_key))\n set_nested_interval db_self.lftp, db_self.lftq\n else\n # No locking in this case -- caller should have acquired table lock.\n db_self = self.class.find(id)\n db_parent = self.class.find(read_attribute(nested_interval_foreign_key))\n if db_parent.lftp == db_self.lftp && db_parent.lftq == db_self.lftq \\\n || db_parent.lftp > db_parent.lftq * db_self.lftp / db_self.lftq \\\n && db_parent.lftp <= db_parent.lftq * db_self.rgtp / db_self.rgtq \\\n && (db_parent.lftp != db_self.rgtp || db_parent.lftq != db_self.rgtq)\n errors.add :parent_id, \"is descendant\"\n raise ActiveRecord::RecordInvalid, self\n end\n set_nested_interval *parent.next_child_lft\n mysql_tmp = \"@\" if connection.adapter_name == \"MySQL\"\n cpp = db_self.lftq * rgtp - db_self.rgtq * lftp\n cpq = db_self.rgtp * lftp - db_self.lftp * rgtp\n cqp = db_self.lftq * rgtq - db_self.rgtq * lftq\n cqq = db_self.rgtp * lftq - db_self.lftp * rgtq\n db_descendants = db_self.descendants\n if has_attribute?(:rgtp) && has_attribute?(:rgtq)\n db_descendants.update_all %(\n rgtp = #{cpp} * rgtp + #{cpq} * rgtq,\n rgtq = #{cqp} * #{mysql_tmp}rgtp + #{cqq} * rgtq\n ), mysql_tmp && %(@rgtp := rgtp)\n db_descendants.update_all %(rgt = 1.0 * rgtp / rgtq) if has_attribute?(:rgt)\n end\n db_descendants.update_all %(\n lftp = #{cpp} * lftp + #{cpq} * lftq,\n lftq = #{cqp} * #{mysql_tmp}lftp + #{cqq} * lftq\n ), mysql_tmp && %(@lftp := lftp)\n db_descendants.update_all %(lft = 1.0 * lftp / lftq) if has_attribute?(:lft)\n end\n update_without_nested_interval\n end",
"def lower_bound\n return 0 if total == 0\n \n (\n phat + dist_sq/(2*total) - dist * Math.sqrt((phat*(1-phat)+dist_sq/(4*total))/total)\n ) / (\n 1+dist_sq/total\n )\n end",
"def update_closest(array, city, new_dist)\n if !array.include?([city, new_dist])\n insert_point = binary_insert(array, new_dist)\n array.insert(insert_point,[city, new_dist])\n end\nend",
"def shortest_distance_from(latitude, longitude)\n\t\tmin_dist = BigDecimal.new(\"10.0\")\n\t\tinput_lat = BigDecimal.new(latitude)\n\t\tinput_lng = BigDecimal.new(longitude)\n\n\t\t#Find waypoint with shortest distance from input\n\t\tfor location in self.locations\n\t\t\tpoint_lat = BigDecimal(location.coord.latitude.to_s)\n\t\t\tpoint_lng = BigDecimal(location.coord.longitude.to_s)\n\n\t\t\t#Get distance between two points\n\t\t\tdist = ((input_lat - point_lat)**2 + (input_lng - point_lng)**2).sqrt(10)\n\n\t\t\t#Update the minimum\n\t\t\tif min_dist > dist\n\t\t\t\tmin_dist = dist\n\t\t\tend\n\t\tend\n\n\t\treturn min_dist\n\tend",
"def parent=(new_parent) \n parent.children.delete(self) if @parent #=> this is the old parent removing the child that is being adopted \n @parent = new_parent #=> I have a new mommy! \n new_parent.children << self unless @parent == nil || new_parent.children.include?(self) \n end",
"def distanceToCarAhead\n return nil unless carAhead\n carAhead.bodyEnd - bodyStart\n end",
"def closest_point_to(target, min_distance=3)\n angle_rad = target.calculate_rad_angle_between(self)\n radius = target.radius + min_distance\n x = target.x + radius * Math.cos(angle_rad)\n y = target.y + radius * Math.sin(angle_rad)\n\n Position.new(x, y)\n end",
"def find_parent(inputs, current) \n nextParent = nil\n\n inputs.each do |orbit|\n sun = orbit[0,3]\n moon = orbit[4,3]\n if moon == current\n nextParent = sun\n break\n end\n end\n\n return nextParent\nend",
"def shortest_route_by_distance_to(place_or_object_place_was_built_from)\n routes = routes_for place_or_object_place_was_built_from\n select_ok_routes(routes).min_by(&:distance_in_meters)\n end",
"def closest_ant_view l, ai \n\tants = ai.my_ants \n\n\tcur_best = nil\n\tcur_dist = nil\n\n\tants.each do |ant|\n\t\td = Distance.get ant, l\n\t\tdist = d.dist\n\n\t\tif !cur_dist || dist < cur_dist\n\t\t\tcur_dist = dist\n\t\t\tcur_best = ant\n\t\tend\n\tend\n\n\tcur_best\nend",
"def distance\n return 0 if self.loc == @@current_loc\n return 0 if self.loc.nil? or @@current_loc.nil?\n haversine_distance(@@current_loc,self.loc)\n end",
"def closest(obj)\n zombie = @zombies.first\n\n min_dist = 19000 ** 2 + 6000 ** 2\n\n @zombies.each do |z|\n dist = z.distance(obj)\n if dist < min_dist\n zombie = z\n min_dist = dist\n end\n end\n\n zombie\n end",
"def carve_corridors(i, j, parent)\n dirs = Direction::DIRECTIONS.keys.shuffle\n\n # Pick a random direction\n dirs.each do |d_key|\n #Check the next two squares in that direction\n t_cells = [@cells[i][j]]\n failed = false\n corientrance = false\n (1..2).each do |step|\n jump = Direction::DIRECTIONS[d_key]\n if !t_cells[step-1].nil? && !failed\n t_cells[step] = @cells[t_cells[step-1].x+jump[0]][t_cells[step-1].y+jump[1]]\n failed = true if t_cells[step].nil? || t_cells[step].type != Cell::UNALLOCATED\n if !t_cells[step].nil? && t_cells[step].type == Cell::ENTRANCE\n corientrance = true\n failed = true\n break\n end\n else\n failed = true\n end\n end\n # If unallocated, carve and start next section\n if !failed\n # Create Corridor logical structure\n corridor_obj = CorridorBranch.new(t_cells)\n t_cells.each do |c|\n c.type = Cell::CORRIDOR\n corridor_map[c] = corridor_obj\n end\n # Add to corrdidor tree\n parent.children << corridor_obj if !parent.nil?\n\n l_cell = t_cells.last\n carve_corridors(l_cell.x, l_cell.y, corridor_obj)\n end\n # special case for entrance corridor links\n if corientrance\n # Create Corridor logical structure\n corridor_obj = CorridorBranch.new(t_cells)\n t_cells.each do |c|\n corridor_map[c] = corridor_obj\n end\n l_cell = t_cells.last\n # Add to corrdidor tree\n parent.children << room_map[l_cell] if !parent.nil?\n end\n end\n\n end",
"def closest_planet\n finder = self.class.select(\"id, name, location, planets.location<->POINT('#{self.location}') as distance\")\n self.class.my_planets.each do |p|\n finder = finder.where(\"NOT location ~= POINT(?)\", p.location)\n end\n finder.order(\"distance ASC\").first\n end",
"def nearby_location(dist)\n data = Location.all\n nearby_wifi = data.select { |spot| self.distance_to([spot.latitude,spot.longitude]) <= dist }\n sort_nearby_wifi = nearby_wifi.sort_by { |close| self.distance_to([close.latitude, close.longitude]) }\n end",
"def distance_from other_loc\n rad_per_deg = Math::PI/180 # PI / 180\n rkm = 6371 # Earth radius in kilometers\n rm = rkm * 1000 # Radius in meters\n\n dlat_rad = (self[:latitude]-other_loc[:latitude]) * rad_per_deg # Delta, converted to rad\n dlon_rad = (self[:longitude]-other_loc[:longitude]) * rad_per_deg\n\n lat1_rad = self[:latitude] * rad_per_deg\n lon1_rad = self[:longitude] * rad_per_deg\n lat2_rad = other_loc[:latitude] * rad_per_deg\n lon2_rad = other_loc[:longitude] * rad_per_deg\n\n #lat1_rad, lon1_rad = loc1.map {|i| i * rad_per_deg }\n #lat2_rad, lon2_rad = loc2.map {|i| i * rad_per_deg }\n\n a = Math.sin(dlat_rad/2)**2 + Math.cos(lat1_rad) * Math.cos(lat2_rad) * Math.sin(dlon_rad/2)**2\n c = 2 * Math::atan2(Math::sqrt(a), Math::sqrt(1-a))\n\n rm * c # Delta in meters\n end",
"def assignClosest(parr)\n self.dims[0].times do |i|\n self.dims[1].times do |j|\n distances = Array.new\n parr.each do |point|\n distances << point.distance(i, j)\n end\n mins = distances.min(2)\n if mins[0] == mins[1]\n @grid[i][j] = -1\n else\n @grid[i][j] = distances.index(mins[0])\n end\n end\n end\n end",
"def move_under new_parent\n ensure_exists!\n ensure_no_cycle! new_parent\n if parent\n parent.remove_child self\n else\n trace.remove_root self\n end\n if new_parent\n new_parent.add_child self\n @parent_span_id = new_parent.span_id\n else\n trace.add_root self\n @parent_span_id = 0\n end\n @parent = new_parent\n self\n end",
"def assign_clusters\n reset_cluster_data_points\n @data_points.each do |data_point|\n closest_cluster = nil\n minimum_distance = nil\n @clusters.each do |cluster|\n distance_to_current_cluster = data_point.distance2_to(cluster.centroid)\n if minimum_distance.nil? || distance_to_current_cluster < minimum_distance\n minimum_distance = distance_to_current_cluster\n closest_cluster = cluster\n end\n end\n closest_cluster.add(data_point)\n end\n end",
"def climb(position, radius)\n max_rad, max_pos, max_ele, inc, my_ele = highest_neighbor(position, radius)\n if inc < 0 || max_rad < radius\n puts \"We have reached the peak (#{my_ele}) at #{position}\".green\n peak_id = store_peak(position, my_ele)\n [position, my_ele, peak_id]\n else\n puts \"Elevation #{max_ele}, position #{max_pos}\".yellow\n sleep 0.01\n if inc > 0\n puts \"Climbing more\".light_black\n climb(max_pos, 1)\n else\n new_radius = radius + 1\n puts \"On a flat, increasing radius to #{new_radius}\"\n climb(max_pos, new_radius)\n end\n end\nend",
"def carve_corridors(i,j, parent)\n\t\tdirs = Direction::DIRECTIONS.keys.shuffle\n\n\t\t# Pick a random direction\n\t\tdirs.each do |d_key|\n\t\t\t#Check the next two squares in that direction\n\t\t\tt_cells = [@cells[i][j]]\n\t\t\tfailed = false\n\t\t\tcorientrance = false\n\t\t\t(1..2).each do |step|\n\t\t\t\tjump = Direction::DIRECTIONS[d_key]\n\t\t\t\tif !t_cells[step-1].nil? && !failed\n\t\t\t\t\tt_cells[step] = @cells[t_cells[step-1].x+jump[0]][t_cells[step-1].y+jump[1]] \n\t\t\t\t\tfailed = true if t_cells[step].nil? || t_cells[step].type != Cell::UNALLOCATED \n\t\t\t\t\tif !t_cells[step].nil? && t_cells[step].type == Cell::ENTRANCE \n\t\t\t\t\t\tcorientrance = true \n\t\t\t\t\t\tfailed = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tfailed = true\n\t\t\t\tend\n\t\t\tend\n\t\t\t# If unallocated, carve and start next section\n\t\t\tif !failed\n\t\t\t\t# Create Corridor logical structure\n\t\t\t\tcorridor_obj = CorridorBranch.new(t_cells)\n\t\t\t\tt_cells.each do |c| \n\t\t\t\t\tc.type = Cell::CORRIDOR \n\t\t\t\t\tcorridor_map[c] = corridor_obj\n\t\t\t\tend\n\t\t\t\t# Add to corrdidor tree\n\t\t\t\tparent.children << corridor_obj if !parent.nil?\n\n\t\t\t\tl_cell = t_cells.last\n\t\t\t\tcarve_corridors(l_cell.x, l_cell.y,corridor_obj)\n\t\t\tend\n\t\t\t# special case for entrance corridor links\n\t\t\tif corientrance\n\t\t\t\t# Create Corridor logical structure\n\t\t\t\tcorridor_obj = CorridorBranch.new(t_cells)\n\t\t\t\tt_cells.each do |c| \n\t\t\t\t\tcorridor_map[c] = corridor_obj\n\t\t\t\tend\n\t\t\t\tl_cell = t_cells.last\n\t\t\t\t# Add to corrdidor tree\n\t\t\t\tparent.children << room_map[l_cell] if !parent.nil?\n\t\t\tend\n\t\tend\n\n\tend",
"def consolidate\n roots = []\n root = @next\n min = root\n # find the nodes in the list\n loop do\n roots << root\n root = root.right\n break if root == @next\n end\n degrees = []\n roots.each do |root|\n min = root if @compare_fn[root.key, min.key]\n # check if we need to merge\n if degrees[root.degree].nil? # no other node with the same degree\n degrees[root.degree] = root\n next\n else # there is another node with the same degree, consolidate them\n degree = root.degree\n until degrees[degree].nil? do\n other_root_with_degree = degrees[degree]\n if @compare_fn[root.key, other_root_with_degree.key] # determine which node is the parent, which one is the child\n smaller, larger = root, other_root_with_degree\n else\n smaller, larger = other_root_with_degree, root\n end\n link_nodes(larger, smaller)\n degrees[degree] = nil\n root = smaller\n degree += 1\n end\n degrees[degree] = root\n min = root if min.key == root.key # this fixes a bug with duplicate keys not being in the right order\n end\n end\n @next = min\n end",
"def parent_ion_mass(charge=1)\r\n (mass(nterm) + ladder.last + mass(cterm) + charge * proton_mass)/charge\r\n end",
"def update_distance(event)\n score = Scoreboard.where(:race_id => event.race_id, :walker_id => event.walker_id).first\n new_distance = event.eventData['distance']\n\n if new_distance > score.distance # is walker farther away than before\n score.distance = new_distance\n score.avgSpeed = event.eventData['avgSpeed']\n score.lastCheckpoint = event.eventData['lastCheckpoint']\n score.latitude = event.eventData['latitude']\n score.longitude = event.eventData['longitude']\n score.save\n puts \"Distance updated to: \"+new_distance.to_s # debug print\n end\n end",
"def distance_price\n distance * price_per_km\n end",
"def distance_to(loc2)\n self.point.ellipsoidal_distance(loc2.point)/1000\n end",
"def parent(child)\n return (child - 1) / 2\nend",
"def nearbys(distance_in_kms)\n\t\tsuper(distance_in_kms / Constant.miles_per_kilo_meter)\n\tend",
"def nearest_driver(map,user)\n driver_pos=[]\n\n for i in 0..map.length-1\n for j in 0..map.length-1\n if map[i][j] == \" D \"\n driver_pos << [i,j]\n end\n end\n end\n @driver_pos=driver_pos\n\n nearest_driver_position = driver_pos[0]\n distance = driver_pos[0].zip(user).map { |x| x.reduce(:-).abs }.sum\n\n for i in 1..driver_pos.length-1\n temp = driver_pos[i].zip(user).map { |x| x.reduce(:-).abs }.sum\n if temp < distance\n distance = temp\n nearest_driver_position = driver_pos[i]\n end\n end\n nearest_driver_position\n end",
"def distance\n distance_and_arc[:distance]\n end",
"def distance\n distance_and_arc[:distance]\n end",
"def nearby_bike_parking(string, dist)\n area = process_coords(area)\n querry = \"$where=within_circle(geom, #{area[1]}, #{area[0]}, #{dist})\"\n bike_grabber(querry)\n end",
"def recalculate(inode)\n full_count = 0\n inode.list_of_children.each do |node|\n#p node\n komvos = self.get(node)\n#p komvos\n if komvos.normalize==0\n puts \"node #{node} is not leaf\"\n # if not leaf\n #recalc(holon.searchFor(node).listOfChildren)\n self.recalculate(komvos)\n else \n # exw kanei: node.normalize kai einai leaf\n puts \"node #{node} is leaf\"\n \n end\n # uplogizw to sum of coun and re-normalize\n full_count = full_count + komvos.weight\n end\n inode.weight = full_count\n end",
"def set_node_distance(node_city, distance)\n @nodes[node_city].distance = distance\n end",
"def surrounding(position, radius)\n dlat = 0.0001\n dlng = 0.0001\n (1..radius).map do |r|\n (-r..r).map do |rlat|\n points = [sum(position, [dlat * rlat, dlng * (r - rlat.abs)])]\n if rlat.abs != r\n points += [sum(position, [dlat * rlat, dlng * (rlat.abs - r)])]\n end\n points\n end.flatten(1)\n end\nend",
"def find_closest_distance\n closest_distance = 1\n closest_clusters = [nil, nil]\n\n @clusters.combination(2) do |c|\n dist = c[0].distance_to(c[1])\n if dist < closest_distance\n closest_distance = dist\n closest_clusters = [c[0], c[1]]\n end\n end\n\n return closest_distance, closest_clusters[0], closest_clusters[1]\n end",
"def match_parent_configuration( & match_block )\n \n matched_parent = nil\n \n this_parent = self\n\n begin\n if match_block.call( this_parent )\n matched_parent = this_parent\n break\n end\n end while this_parent = this_parent.parent\n\n return matched_parent\n \n end",
"def move!\r\n return unless create_new_parent?\r\n parent_arg = find_new_parent\r\n self.move_to_child_of(parent_arg)\r\n if parent_arg\r\n self.debate_id = parent_arg.debate_id\r\n self.children.update_all(\"debate_id = #{parent_arg.debate_id}\")\r\n end\r\n end",
"def make_root_of_smaller_rank_point_to_root_of_larger_rank(root_p, root_q)\n if @ranks[root_p] < @ranks[root_q]\n @parents[root_p] = root_q\n elsif @ranks[root_p] > @ranks[root_q]\n @parents[root_q] = root_p\n else\n @parents[root_q] = root_p\n @ranks[root_p] += 1\n end\n @nb_sets -= 1\n end",
"def article_parents(max_distance)\n if @parents.include?(max_distance)\n return @parents\n end\n\n # direct parents\n regular = @entity.categories.to_a\n eponymous = @entity.eponymous_categories.flat_map{|c| c.parents.to_a }\n remote = @remote_context.relatives(@entity, :categories, Cyclopedio::Wiki::Category)\n @parents[1] = (regular + eponymous + remote).select { |c| c.regular? && c.plural? }\n\n add_relatives(@parents,2,max_distance,:parents){|r| r.eponymous_articles.flat_map{|a| a.categories.to_a } }\n @parents\n end",
"def shortest_distance_to_all_nodes(initial)\n Hash[shortest_path_to_all_nodes(initial).map {|n| [n, n.distance]}]\n end",
"def align(boids)\n neighbordist = 50\n sum = PVector.new(0, 0)\n count = 0\n boids.each do |other|\n d = PVector.dist(@location, other.location)\n if d > 0 && d < neighbordist\n sum.add(other.velocity)\n count += 1\n end\n end\n if count > 0\n sum.div(count.to_f);\n # First two lines of code below could be condensed with new PVector setMag() method\n # Not using this method until Processing.js catches up\n # sum.setMag(@maxspeed)\n\n # Implement Reynolds: Steering = Desired - Velocity\n sum.normalize()\n sum.mult(@maxspeed)\n steer = PVector.sub(sum, @velocity)\n steer.limit(@maxforce)\n return steer\n else\n return PVector.new(0, 0)\n end\n end"
] | [
"0.8235895",
"0.5898242",
"0.5318209",
"0.5277388",
"0.5045914",
"0.49961343",
"0.49835724",
"0.49419254",
"0.49409592",
"0.49079368",
"0.4890193",
"0.48785388",
"0.48690915",
"0.486506",
"0.4854083",
"0.4815669",
"0.48073077",
"0.47885486",
"0.478069",
"0.47805166",
"0.47803655",
"0.4726553",
"0.47214514",
"0.47132725",
"0.4710969",
"0.47084302",
"0.47076446",
"0.46990705",
"0.4661242",
"0.46412343",
"0.46382618",
"0.46239623",
"0.46055585",
"0.45980793",
"0.45908213",
"0.45810074",
"0.45775664",
"0.45716864",
"0.45707035",
"0.4559338",
"0.45545414",
"0.45544675",
"0.45543292",
"0.45528296",
"0.45515862",
"0.4543634",
"0.45300955",
"0.45235962",
"0.4496519",
"0.44949782",
"0.44893137",
"0.44814646",
"0.44814128",
"0.4480424",
"0.44785014",
"0.44745907",
"0.44732594",
"0.4466437",
"0.44592687",
"0.44555572",
"0.4453779",
"0.4453229",
"0.44531938",
"0.44522738",
"0.44479328",
"0.44354245",
"0.4432565",
"0.44252557",
"0.44230342",
"0.4416659",
"0.4414047",
"0.4407326",
"0.44066888",
"0.44040832",
"0.4404083",
"0.44031268",
"0.44027954",
"0.4402542",
"0.43949136",
"0.4392199",
"0.4389914",
"0.43800557",
"0.43752223",
"0.4373478",
"0.43718737",
"0.4368395",
"0.43646264",
"0.436207",
"0.436207",
"0.4359803",
"0.4358481",
"0.4357603",
"0.4350308",
"0.4349993",
"0.4337554",
"0.43345973",
"0.43303305",
"0.43302774",
"0.43222544",
"0.4315986"
] | 0.71061254 | 1 |
create from the targets a list of files to be included and also their destinations in the zip file and sizes throw an error if a file/directory does not exist, if it is outside of the root, if the target type is invalid, etc. | def generate_file_list
self.file_list = Concurrent::Array.new
targets.each do |target|
add_target(target)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_zip( ctx, file:, upload_dir:, archive_dir:, ** ) #File::Twin\n source_files = file.records\n\n zip_file = File.join( archive_dir, \"#{file.identifier}.zip\" )\n\n return false if File.exists?(zip_file)\n\n Zip::File.open(zip_file, Zip::File::CREATE) do |zip|\n source_files.each do |record|\n raise \"error with #{record.inspect}\" unless record.file_path # TODO: remove me\n\n name_in_zip = \"#{record.index}-#{File.basename(record.file_path)}\"\n\n zip.add( name_in_zip, File.join(upload_dir, record.file_path) ) # FIXME: this could break\n end\n end\n\n\n\n ctx[:zip] = zip_file\n end",
"def make_files(targets)\n file_pairs = targets.map { |t| \n filename = sanitize_filename(t[:data][:name] + '.json')\n [filename, t]\n }\n unique_pairs = uniqufy(file_pairs)\n unique_pairs.each do |name, content| \n puts \"Write #{File.absolute_path(name)}\"\n File.open(name, 'w') { |file| file.write(JSON.pretty_generate(content)) }\n end\nend",
"def zip (target, *sources)\n targetdir = \"#{FileUtils::Config.tmp_dir}/zip\"\n id = 1\n while File.exists?(targetdir)\n targetdir = \"#{FileUtils::Config.tmp_dir}/zip#{id}\"\n id += 1\n end\n FileUtils.mkdir(targetdir)\n\n path = ''\n sources.each do |value|\n if path == ''\n path = value\n else\n FileUtils.copy(path, \"#{targetdir}/#{value}\")\n path = ''\n end\n end\n\n `#{FileUtils::Config.zip} -j #{target} #{targetdir}/*`\n\n FileUtils.rm_rf(targetdir)\n end",
"def create_dirs_in_zipfile(created_dirs, entry_path, output_stream); end",
"def zipfiles\n @zipfile_name = \"#{$zip_folder}#{$testcase}.zip\"\n Zip::File.open(\"#{@zipfile_name}\", Zip::File::CREATE) do |zipfile|\n Dir.glob(\"#{$image_folder}#{$testcase}*\").each do |filename|\n file = File.basename(\"#{filename}\")\n zipfile.add(file, \"#{$image_folder}\" + file)\n end\n end\n end",
"def build\n entries = Dir.entries(@input_dir)\n entries.delete_if {|e| @exclude.include?(e)}\n FileUtils.rm_f(@output_file) # Make sure file doesn't exist\n ::Zip::File.open(@output_file, ::Zip::File::CREATE) do |zipfile|\n write_entries entries, '', zipfile\n end\n end",
"def add_files(zip)\n ZipFileGenerator.new(@manifest.base_dir, zip).write\n end",
"def archive\n files.each do |path|\n path_obj = Pathname.new(path)\n path_name = path_obj.dirname.to_s\n compress = Kellerkind::Compress.new(:target_path => out,\n :source_path => path,\n :tarball_prefix => path_obj.basename.to_s)\n compress.find_at_source_path = true\n if File.exists?(path)\n Kellerkind::Process.verbose(:start_compressing)\n compress.gzip\n if File.exists?(\"#{path_name}/#{compress.tarball_name}\")\n Kellerkind::Process.verbose(:finished_compressing)\n FileUtils.mv(\"#{path_name}/#{compress.tarball_name}\",\n \"#{out}/#{compress.tarball_name}\")\n FileUtils.rm_rf(path)\n FileUtils.touch(path) if self.recreate\n end\n end\n end\n end",
"def target_files\n files.map {|f| target_file f}\n end",
"def package_files\n Dir.mktmpdir {|tmpdir|\n @stemcell_files.flatten.each {|file| FileUtils.cp(file, tmpdir) if file && File.exists?(file) } # only copy files that are not nil\n Dir.chdir(tmpdir) do\n @logger.info(\"Package #@stemcell_files to #@target ...\")\n sh \"tar -czf #@target *\", {:on_error => \"unable to package #@stemcell_files into a stemcell\"}\n end\n }\n @target\n end",
"def package_files\n Dir.mktmpdir {|tmpdir|\n @stemcell_files.flatten.each {|file| FileUtils.cp(file, tmpdir) if file && File.exists?(file) } # only copy files that are not nil\n Dir.chdir(tmpdir) do\n @logger.info(\"Package #@stemcell_files to #@target ...\")\n sh \"tar -czf #@target *\", {:on_error => \"unable to package #@stemcell_files into a stemcell\"}\n end\n }\n @target\n end",
"def execute(quiet=false)\n @quiet = quiet\n @zip_file = ::Zip::File.open(@target_name, ::Zip::File::CREATE)\n do_zip(@source_paths, '')\n @zip_file.close\n @logger.debug(\"#{@count} files archived in #{@target_name}\")\n end",
"def fast_copy_chain(base_dir, targets, options={})\n # Normalize the filesnames param so it is an array\n filenames = options[:files] || ['.']\n filenames = [filenames] unless filenames.respond_to?(:each)\n \n # Normalize the targets param, so that targets is an array of Hosts and\n # destinations is a hash of hosts => dirs\n destinations = {}\n targets = [targets] unless targets.respond_to?(:each)\n base_dir += '/' unless base_dir[-1] == '/'\n if targets.is_a? Hash\n destinations = targets\n destinations.each {|t, d| destinations[t] += '/' unless d[-1] == '/'}\n targets = targets.keys\n else\n destinations = targets.inject({}) {|memo, target| memo[target] = base_dir; memo}\n end\n raise \"No target hosts supplied\" if targets.count < 1\n \n file_list = filenames.join ' '\n port = (options[:port] || 7000).to_i\n \n if Jetpants.compress_with || Jetpants.decompress_with\n comp_bin = Jetpants.compress_with.split(' ')[0]\n confirm_installed comp_bin\n output \"Using #{comp_bin} for compression\"\n else\n output \"Compression disabled -- no compression method specified in Jetpants config file\"\n end\n \n # On each destination host, do any initial setup (and optional validation/erasing),\n # and then listen for new files. If there are multiple destination hosts, all of them\n # except the last will use tee to \"chain\" the copy along to the next machine.\n workers = []\n targets.reverse.each_with_index do |t, i|\n dir = destinations[t]\n raise \"Directory #{t}:#{dir} looks suspicious\" if dir.include?('..') || dir.include?('./') || dir == '/' || dir == ''\n \n if Jetpants.compress_with || Jetpants.decompress_with\n decomp_bin = Jetpants.decompress_with.split(' ')[0]\n t.confirm_installed decomp_bin\n end\n t.ssh_cmd \"mkdir -p #{dir}\"\n \n # Check if contents already exist / non-empty.\n # Note: doesn't do recursive scan of subdirectories\n unless options[:overwrite]\n all_paths = filenames.map {|f| dir + f}.join ' '\n dirlist = t.dir_list(all_paths)\n dirlist.each {|name, size| raise \"File #{name} exists on destination and has nonzero size!\" if size.to_i > 0}\n end\n \n decompression_pipe = Jetpants.decompress_with ? \"| #{Jetpants.decompress_with}\" : ''\n if i == 0\n workers << Thread.new { t.ssh_cmd \"cd #{dir} && nc -l #{port} #{decompression_pipe} | tar xv\" }\n t.confirm_listening_on_port port\n t.output \"Listening with netcat.\"\n else\n tt = targets.reverse[i-1]\n fifo = \"fifo#{port}\"\n workers << Thread.new { t.ssh_cmd \"cd #{dir} && mkfifo #{fifo} && nc #{tt.ip} #{port} <#{fifo} && rm #{fifo}\" }\n checker_th = Thread.new { t.ssh_cmd \"while [ ! -p #{dir}/#{fifo} ] ; do sleep 1; done\" }\n raise \"FIFO not found on #{t} after 10 tries\" unless checker_th.join(10)\n workers << Thread.new { t.ssh_cmd \"cd #{dir} && nc -l #{port} | tee #{fifo} #{decompression_pipe} | tar xv\" }\n t.confirm_listening_on_port port\n t.output \"Listening with netcat, and chaining to #{tt}.\"\n end\n end\n \n # Start the copy chain.\n output \"Sending files over to #{targets[0]}: #{file_list}\"\n compression_pipe = Jetpants.compress_with ? \"| #{Jetpants.compress_with}\" : ''\n ssh_cmd \"cd #{base_dir} && tar vc #{file_list} #{compression_pipe} | nc #{targets[0].ip} #{port}\"\n workers.each {|th| th.join}\n output \"File copy complete.\"\n \n # Verify\n output \"Verifying file sizes and types on all destinations.\"\n compare_dir base_dir, destinations, options\n output \"Verification successful.\"\n end",
"def create_zip(entries, ignore_entries)\n compress(entries.map { |x|\n if x.is_a? String\n get_entries(x, nil, ignore_entries)\n elsif x[JsonConfigKey::Type].nil? || x[JsonConfigKey::Type].casecmp(FileEntryType::FILE) == 0\n get_entries(x[JsonConfigKey::Name], x[JsonConfigKey::Path], ignore_entries)\n elsif x[JsonConfigKey::Type].casecmp(FileEntryType::ZIP) == 0\n ZipEntry.new(x[JsonConfigKey::Name], create_zip(x[JsonConfigKey::Entries], x[JsonConfigKey::IgnoreEntries]))\n end\n }.flatten.select{ |f| f.is_a?(ZipEntry) || filter_entries(f.name, FileEntryType::FILE, ignore_entries) }.uniq{ |f| f.name })\n end",
"def zip_create(for_server: true, include_files: true, md5sums: {},\n size_exams: -1, files_added: nil)\n pre = for_server ? center.login_name + '_' : ''\n dir = \"exa-#{pre}#{name}\"\n file = \"#{pre}#{name}.zip\"\n tmp_file = \"/tmp/#{file}\"\n dputs(2) { \"for_server:#{for_server} - include_files:#{include_files} \" +\n \"md5sums:#{md5sums.inspect} - size_exams:#{size_exams.inspect}\" }\n\n if students and students.size > 0\n File.exists?(tmp_file) and FileUtils.rm(tmp_file)\n Zip::File.open(tmp_file, Zip::File::CREATE) { |z|\n z.mkdir dir\n dputs(3) { \"Students is #{students.inspect}\" }\n files_excluded = []\n students.sort.each { |s|\n p = \"#{dir}/#{pre}#{s}\"\n dputs(3) { \"Creating #{p}\" }\n z.mkdir(p)\n if include_files\n dputs(3) { \"Searching in #{dir_exams}/#{s}\" }\n Dir.glob(\"#{dir_exams}/#{s}/*\").sort.each { |exa_f|\n exa_md5 = Digest::MD5.file(exa_f).hexdigest\n file_add = true\n filename = exa_f.sub(/.*\\//, '')\n if md5sums.has_key?(s)\n md5sums[s].each { |f, md5|\n if (f == filename) && (md5 == exa_md5)\n dputs(3) { \"Found file #{filename} to be excluded\" }\n file_add = false\n files_excluded.push exa_f.sub(/^#{dir_exams}\\//, '')\n end\n }\n end\n if file_add and size_exams != 0\n dputs(3) { \"Adding file #{exa_f} with size #{size_exams}\" }\n files_added and files_added.push [s, File.basename(exa_f), exa_md5]\n z.file.open(\"#{p}/#{exa_f.sub(/.*\\//, '')}\", 'w') { |f|\n f.write File.open(exa_f) { |ef|\n content = ef.read\n dputs(3) { \"Size of file is #{content.size}\" }\n size_exams -= [content.size, size_exams.abs].min\n content\n }\n }\n end\n }\n end\n }\n dputs(3) { \"Files_excluded are #{files_excluded.inspect}\" }\n z.file.open(\"#{dir}/files_excluded\", 'w') { |f|\n f.write files_excluded.to_json\n }\n }\n return file\n end\n return nil\n end",
"def create_copy_file_tasks(source_files, source_root, dest_root, invoking_task)\n source_files.each do |source|\n target = source.pathmap(\"%{#{source_root},#{dest_root}}p\")\n directory File.dirname(target)\n file target => [File.dirname(target), source] do |t|\n cp source, target\n end\n task invoking_task => target\n end\nend",
"def create\n comment_file = tmp_comment_file!\n tmp_zipfile = tmp_zipfile!\n\n derivative_files = []\n\n Zip::File.open(tmp_zipfile.path, Zip::File::CREATE) do |zipfile|\n # Add attribution as file and zip comment text\n zipfile.comment = comment_text\n zipfile.add(\"about.txt\", comment_file)\n\n members_to_include.each_with_index do |member, index|\n filename = \"#{format '%03d', index+1}-#{DownloadFilenameHelper.filename_base_from_parent(member)}.jpg\"\n\n uploaded_file = file_to_include(member.leaf_representative)\n\n # While it would be nice to stream directly from remote storage into the zip, we couldn't\n # get this to work with the combo of ruby-zip and shrine api's without downloading it\n # to local disk first. There may be a way we haven't figured out. May be able\n # to pass derivative.file.open to it instead for slightly better perf\n # once https://github.com/janko/down/issues/26\n file_obj = uploaded_file.download\n derivative_files << file_obj\n\n\n # We want to add to zip as \"STORED\", not \"DEFLATE\", since our JPGs\n # won't compress under DEFLATE anyway, save the CPU. Ruby zip does not\n # give us a GREAT api to do that, but it gives us a way.\n #\n # https://github.com/rubyzip/rubyzip/blob/05af1231f49f2637b577accea2b6b732b7204bbb/lib/zip/file.rb#L271\n # https://github.com/rubyzip/rubyzip/blob/05af1231f49f2637b577accea2b6b732b7204bbb/lib/zip/entry.rb#L53\n entry = ::Zip::Entry.new(zipfile.name, filename, nil, nil, nil, nil, ::Zip::Entry::STORED)\n zipfile.add(entry, file_obj)\n\n # We don't really need to update on every page, the front-end is only polling every two seconds anyway\n if callback && (index % 3 == 0 || index >= members_to_include.count - 1)\n callback.call(progress_total: members_to_include.count, progress_i: index + 1)\n end\n end\n end\n\n # tell the Tempfile to (re)open so it has a file handle open that can see what ruby-zip wrote\n tmp_zipfile.open\n\n return tmp_zipfile\n ensure\n (derivative_files || []).each do |tmp_file|\n tmp_file.close\n tmp_file.unlink\n end\n\n if comment_file\n comment_file.close\n comment_file.unlink\n end\n end",
"def make_zipfile dir, options={}\n zipfile = options[:filename] || \"#{dir}.zip\"\n excludes = ['-x', '*/.git/*', '-x', '*/.gitignore']\n exclude_each options[:excludes] do |exclude|\n excludes.push '-x', exclude\n end\n run 'zip', '-r', zipfile, dir, *excludes\n release zipfile, :cd => 1\nend",
"def create_zip\n require 'zip'\n zip_files = [self.ground_truth, self.image_sequence, self.config_file]\n if self.acceptable_segmentation_region.present?\n zip_files.push(self.acceptable_segmentation_region)\n end\n zip_filename = Rails.root.join(dir_path, \"#{self.name}.zip\")\n Zip::File.open(zip_filename, Zip::File::CREATE) do |zipfile|\n zip_files.each do |file|\n zipfile.add(file, \"#{dir_path}/#{file}\")\n end\n end\n end",
"def make_tarball_from_files files, options={}\n tarball = options[:filename]\n args = ['czf', tarball, '--exclude-vcs']\n exclude_each options[:exclude] do |exclude|\n args.push '--exclude', exclude\n end\n args.concat files\n run 'tar', *args\n release tarball, :cd => 1\nend",
"def create_zip_file(file_paths, zip_path)\n\n # Delete the file if it exists\n File.delete(zip_path) if File.exist?(zip_path)\n\n # Do not compress and dont store file paths\n cmd = \"zip -Z store -j \\\"#{zip_path}\\\" \"\n file_paths.each { |file| cmd += \"\\\"#{file}\\\" \" }\n\n # Execute the command\n puts cmd\n result_text = `#{cmd} 2>&1`\n #puts result_text\n\n # Return the op result\n return CmdResult.new( $?.success? ? :success : :error , result_text )\n\nend",
"def zipfile(list, newer_than, zipdir = '/tmp')\n\n str_newer = newer_than.to_s.split(%r{T})[0]\n\n zipfile_fn = File.join(zipdir, \"calibre-#{str_newer}.zip\")\n if File.exists?(zipfile_fn)\n File.unlink(zipfile_fn)\n end\n\n # Write the output zip\n #\n Dir.chdir(@library_path) do\n\n Zip.continue_on_exists_proc = true\n Zip.sort_entries = true\n Zip.unicode_names = true\n #\n # Try to avoid registering local paths\n #\n begin\n Zip::File.open(zipfile_fn, Zip::File::CREATE) do |zfh|\n #\n # For each book, gather the list of files\n #\n list.each do |bk|\n authr_base = bk['authors'].split(/,/)[0]\n all_files = File.join(authr_base, \"#{bk['title']}*\", '*')\n begin\n Dir[all_files].sort.each do |file|\n zfh.add(file, file)\n end\n rescue => msg\n $stderr.puts(\"Error: #{msg} : #{full} : #{file}\")\n end\n end # -- list\n end # -- Zip::File\n rescue => msg\n $stderr.puts(\"Error creating zip: #{msg}\")\n end\n end # -- chdir\n zipfile_fn\nend",
"def compressFiles\n Dir.chdir(\"#{@outputDir}/RDPsummary\")\n #system(\"tar -zcf #{@sampleSetName1}.tar.gz * --exclude=*.log --exclude=*.sra --exclude=*.sff --exclude=*.local.metadata\")\n system(\"tar czf class.result.tar.gz class\")\n system(\"tar czf domain.result.tar.gz domain\")\n system(\"tar czf family.result.tar.gz family\")\n system(\"tar czf genus.result.tar.gz genus\")\n system(\"tar czf order.result.tar.gz order\")\n system(\"tar czf phyla.result.tar.gz phyla\")\n system(\"tar czf species.result.tar.gz species\")\n system(\"tar czf pdf.result.tar.gz 'find . -name `*.pdf`'\")\n Dir.chdir(@scratch)\n end",
"def setup_zip_attachments(image_files, filestream_id)\n filestream_id_to_use = filestream_id == 'image_access_full' ? 'image_service' : filestream_id\n attachments = { zip: true,\n filename: filestream_id == 'image_primary' ? '.TIF' : '.JPEG',\n filestream_id_to_use.to_sym => {} }\n zip_size = 0\n image_files.each do |image_file|\n img_attachments_json = JSON.parse(image_file['attachments_ss'])\n zip_size += img_attachments_json[filestream_id_to_use]['byte_size']\n end\n # estimate compression, pretty rough\n zip_size = case filestream_id\n when 'image_primary'\n zip_size * 0.798\n when 'image_access_full'\n zip_size * 0.839\n else\n zip_size * 0.927\n end\n attachments[filestream_id_to_use.to_sym][:byte_size] = zip_size\n attachments.deep_stringify_keys\n end",
"def generate_standard_submission_solution_files(zip, submission_files_to_keep, solution_files_to_keep)\n zip.mkdir('submission')\n @test_params[:submission_files].try(:each) do |file|\n next if file.nil?\n\n zip.add(\"submission/#{file.original_filename}\", file.tempfile.path)\n end\n\n submission_files_to_keep.each do |file|\n zip.add(\"submission/#{File.basename(file.path)}\", file.path)\n end\n\n zip.mkdir('solution')\n @test_params[:solution_files].try(:each) do |file|\n next if file.nil?\n\n zip.add(\"solution/#{file.original_filename}\", file.tempfile.path)\n end\n\n solution_files_to_keep.each do |file|\n zip.add(\"solution/#{File.basename(file.path)}\", file.path)\n end\n end",
"def create\n all = list_all_files_in_dir(@resource[:target])\n to_keep = select_all_matching(all, @resource[:whitelist])\n to_purge = get_files_to_purge(all, to_keep)\n purge_files(to_purge)\n end",
"def copy_to_many(source, targets)\n expanded_source = File.expand_path(source)\n\n targets.each do |target|\n expanded_target = File.expand_path(target)\n\n # ensure the subdirectories exist\n FileUtils.mkpath(File.dirname(expanded_target))\n\n # copy file to other locations\n FileUtils.cp(expanded_source, expanded_target)\n end\n end",
"def compare_dir(base_dir, targets, options={})\n # Normalize the filesnames param so it is an array\n filenames = options[:files] || ['.']\n filenames = [filenames] unless filenames.respond_to?(:each)\n \n # Normalize the targets param, so that targets is an array of Hosts and\n # destinations is a hash of hosts => dirs\n destinations = {}\n targets = [targets] unless targets.respond_to?(:each)\n base_dir += '/' unless base_dir[-1] == '/'\n if targets.is_a? Hash\n destinations = targets\n destinations.each {|t, d| destinations[t] += '/' unless d[-1] == '/'}\n targets = targets.keys\n else\n destinations = targets.inject({}) {|memo, target| memo[target] = base_dir; memo}\n end\n raise \"No target hosts supplied\" if targets.count < 1\n \n queue = filenames.map {|f| ['', f]} # array of [subdir, filename] pairs\n while (tuple = queue.shift)\n subdir, filename = tuple\n source_dirlist = dir_list(base_dir + subdir + filename)\n destinations.each do |target, path|\n target_dirlist = target.dir_list(path + subdir + filename)\n source_dirlist.each do |name, size|\n target_size = target_dirlist[name] || 'MISSING'\n raise \"Directory listing mismatch when comparing #{self}:#{base_dir}#{subdir}#{filename}/#{name} to #{target}:#{path}#{subdir}#{filename}/#{name} (size: #{size} vs #{target_size})\" unless size == target_size\n end\n end\n queue.concat(source_dirlist.map {|name, size| size == '/' ? [subdir + '/' + name, '/'] : nil}.compact)\n end\n end",
"def target_files_in_dir(base_dir = T.unsafe(nil)); end",
"def extract_files\n while file = @package_file.next_header\n if file.pathname == \"control.tar.gz\"\n control_tar_gz = Archive.read_open_memory(@package_file.read_data)\n while control_entry = control_tar_gz.next_header\n case control_entry.pathname\n when \"./control\"\n @control_file_contents = control_tar_gz.read_data\n when \"./preinst\"\n @preinst_contents = control_tar_gz.read_data\n when \"./prerm\"\n @prerm_contents = control_tar_gz.read_data\n when \"./postinst\"\n @postinst_contents = control_tar_gz.read_data\n when \"./postrm\"\n @postrm_contents = control_tar_gz.read_data\n end\n end\n end\n if file.pathname == \"data.tar.gz\"\n data_tar_gz = Archive.read_open_memory(@package_file.read_data)\n while data_entry = data_tar_gz.next_header\n # Skip dirs; they're listed with a / as the last character\n @filelist << data_entry.pathname.sub(/^\\./, \"\") unless data_entry.pathname =~ /\\/$/\n end\n end\n end\n end",
"def gather\n if File.exist?(@location_dir) && File.directory?(@location_dir)\n if Dir.glob(File.join(@location_dir, '*')).size > 0 # avoid creating the dest directory if the source dir is empty\n unless File.exists? @destination_dir\n FileUtils.mkpath @destination_dir\n end\n @files.each do |f|\n Dir.glob(File.join(@location_dir, f)).each do |file|\n FileUtils.cp_r file, @destination_dir\n end\n end\n end\n else\n puts \"Error: #{@location_dir}, doesn't exist or not a directory\"\n end\n end",
"def make_copy_file_tasks\n @files.each do |source, destination|\n next if source == destination\n next if Rake::FileTask.task_defined? destination\n type = File.directory?(source) ? 'folder' : 'file'\n task = Rake::FileTask.define_task destination do |t|\n folder = File.dirname(t.name)\n FileUtils.mkpath folder unless File.directory? folder\n FileUtils.copy source, t.name\n end\n task.comment = \"Create the #{destination} #{type}\"\n task.enhance ['wix']\n if Rake::FileTask.task_defined? source\n task.enhance [source]\n end\n end\n end",
"def genDataZip(dir='generated', file_name='OdinSampleDataSet.zip', zip_dir='generated')\n # make sure the target file does not already exist\n # if it does, rename it to a tmp file\n runShellCommand(\"zip -j #{dir}/#{file_name} #{zip_dir}/*.xml #{zip_dir}/*.ctl\")\nend",
"def check_and_build_target_directory_structure(target_host, target_directory, path_to_create)\n\n unless path_to_create.nil?\n\n @log.info(\"Attempting to create '#{path_to_create}' of target directory' '#{target_host}:#{target_directory}'...\")\n\n path_to_create_parts = path_to_create.split('/')\n remote_path = []\n\n target_directory.split('/').each do | directory |\n if !directory.empty?\n directory_path = directory.start_with?('/') ? directory : \"/#{directory}\"\n remote_path << directory\n\n if path_to_create_parts.include?(directory)\n rsync(@empty_directory, \"#{target_host}:/#{remote_path.join('/')}\", false)\n end\n\n end\n end\n @log.info(\"Successfully created '#{path_to_create}' of directory structure '#{target_host}:#{target_directory}'.\")\n\n else\n @log.info(\"Not attempting to create any of remote path '#{target_directory}' on host '#{target_host}'\")\n end\n end",
"def tarball(destination, paths)\n # check for filepath length limit\n full_destination = File.expand_path(destination)\n if full_destination.length > 259 # 256 chars max; \"C:\\\" doesn't count\n puts \"[TarBall] ERROR cannot generate #{destination} because path exceeds 256 char limit. shorten component name by at least by #{full_destination.length - 259} chars\"\n return\n end\n\n Zlib::GzipWriter.open(destination) do |gzip|\n out = Archive::Tar::Minitar::Output.new(gzip)\n\n paths.each do |fi|\n if File.exist?(fi)\n Archive::Tar::Minitar.pack_file(fi, out)\n else\n puts \"[TarBall] ERROR Could not file file: #{fi}\"\n end\n end\n out.close\n end\n end",
"def batch_copy_missing_destination_files(files)\n dest_domain = DestDomain.find_by_namespace(@dest_mogile.domain)\n\n files.each do |file|\n # Quit if no results\n break if file.nil?\n\n # Quit if program exit has been requested.\n break if SignalHandler.instance.should_quit\n\n # Look up the source file's key in the destination domain\n destfile = DestFile.find_by_dkey_and_dmid(file.dkey, dest_domain.dmid)\n if destfile\n # File exists!\n # Check that the source and dest file sizes match\n if file.length != destfile.length\n # File exists but has been modified. Copy it over.\n begin\n Log.instance.debug(\"Key [ #{file.dkey} ] is out of date. Updating.\")\n stream_copy(file)\n @updated += 1\n @copied_bytes += file.length\n rescue => e\n @failed += 1\n Log.instance.error(\"Error updating [ #{file.dkey} ]: #{e.message}\\n#{e.backtrace}\")\n end\n else\n Log.instance.debug(\"key [ #{file.dkey} ] is up to date.\")\n @uptodate += 1\n end\n else\n # File does not exist. Copy it over.\n begin\n Log.instance.debug(\"key [ #{file.dkey} ] does not exist... creating.\")\n stream_copy(file)\n @added += 1\n @copied_bytes += file.length\n rescue => e\n @failed += 1\n Log.instance.error(\"Error adding [ #{file.dkey} ]: #{e.message}\\n#{e.backtrace}\")\n end\n end\n end\n end",
"def decompress_files(compressed_files=[], dir = decompressed_spool_dir )\n\n files = []\n\n compressed_files.each do |file|\n Zip::Archive.open(file) do |ar|\n ar.each do |zf|\n if zf.directory?\n FileUtils.mkdir_p(zf.name)\n else\n dirname = File.dirname(zf.name)\n FileUtils.mkdir_p(dirname) unless File.exist?(dirname)\n output_file = File.join(dir, zf.name)\n open(output_file, 'wb') do |f|\n f << zf.read\n end\n files << output_file\n end\n end\n end\n # TODO: Delete processed file\n end\n\n files\n end",
"def write\n ::Zip::File.open(@output_file, ::Zip::File::CREATE) do |io|\n @folders.each do |input_dir, src, dest|\n src = '' if src == '/**' # the whole src directory could be specified by /**\n path = source_dir(File.join(input_dir, src))\n write_entries(path, entries(src, input_dir), dest, io)\n end\n end\n\n @output_file\n end",
"def targets( paths )\n Target.new( config.targets + paths || [], config.excludes.uniq )\n end",
"def extract\n for file_path in @files\n if !File.directory?(file_path)\n if file_path.downcase.index('.7zip') || file_path.downcase.index('.7z') || file_path.downcase.index('.zip')\n extension = '7zip' if file_path.downcase.index('.7zip')\n extension = '7z' if file_path.downcase.index('.7z')\n extension = 'zip' if file_path.downcase.index('.zip')\n cmd = \"7za e -o#{@dir} #{file_path}\"\n #puts \"Extracting #{file_path}: #{cmd}\"\n system(cmd)\n if cmd\n if file_path.downcase.index('att')\n file_name = File.join(@dir, \"attendance_ads_#{Time.now.year}_#{Time.now.month}_#{Time.now.day}.#{extension}\")\n elsif file_path.downcase.index('enroll')\n file_name = File.join(@dir, \"enrollment_ads_#{Time.now.year}_#{Time.now.month}_#{Time.now.day}.#{extension}\")\n elsif file_path.downcase.index('ili') || file_path.downcase.index('h1n1')\n file_name = File.join(@dir, \"ili_ads_#{Time.now.year}_#{Time.now.month}_#{Time.now.day}.#{extension}\")\n else\n file_name = File.join(@dir, \"ads_#{Time.now.year}_#{Time.now.month}_#{Time.now.day}.#{extension}\")\n end\n File.rename(file_path, file_name)\n FileUtils.mv(file_name, File.join(@dir, \"archive\"))\n end\n end\n end\n end\n\n end",
"def process_files(manifest, file_list, options = {})\n file_list.each do |file|\n if(File.directory?(file_root(file)))\n manifest.directory(file)\n else\n manifest.file(talia_root(file), file, options)\n end\n end\n end",
"def started(target_files); end",
"def in_dest_dir(*paths); end",
"def releaseFiles\r\n rSuccess = true\r\n\r\n logOp('Copy core files') do\r\n RubyPackager::copyFiles(@RootDir, @ReleaseDir, @ReleaseInfo.core_files)\r\n # Create the ReleaseVersion file\r\n lStrTags = nil\r\n if (@ReleaseTags.empty?)\r\n lStrTags = ':tags => []'\r\n else\r\n lStrTags = \":tags => [ '#{@ReleaseTags.join('\\', \\'')}' ]\"\r\n end\r\n File.open(\"#{@ReleaseDir}/ReleaseInfo\", 'w') do |oFile|\r\n oFile << \"\r\n# This file has been generated by RubyPackager during a delivery.\r\n# More info about RubyPackager: http://rubypackager.sourceforge.net\r\n{\r\n :version => '#{@ReleaseVersion}',\r\n #{lStrTags},\r\n :dev_status => '#{@ReleaseInfo.project_info[:dev_status]}'\r\n}\r\n\"\r\n end\r\n end\r\n @ReleaseInfo.executables_info.each do |iExecutableInfo|\r\n if (iExecutableInfo[:exe_name] != nil)\r\n logOp(\"Create binary #{iExecutableInfo[:exe_name]}\") do\r\n # TODO (crate): When crate will work correctly under Windows, use it here to pack everything\r\n # For now the executable creation is platform dependent\r\n rSuccess = @PlatformReleaseInfo.create_binary(@RootDir, @ReleaseDir, @IncludeRuby, iExecutableInfo)\r\n end\r\n end\r\n end\r\n if (rSuccess)\r\n logOp('Copy additional files') do\r\n RubyPackager::copyFiles(@RootDir, @ReleaseDir, @ReleaseInfo.additional_files)\r\n end\r\n if (@IncludeTest)\r\n logOp('Copy test files') do\r\n RubyPackager::copyFiles(@RootDir, @ReleaseDir, @ReleaseInfo.test_files)\r\n end\r\n end\r\n end\r\n\r\n return rSuccess\r\n end",
"def make_tarball(destination, conf,curDir)\n\tDir.chdir(curDir)\n\n gzip = Zlib::GzipWriter.new(File.open(destination, 'wb'))\n tar = Minitar::Output.new(gzip)\n\t conf[:zipFiles].each { |f|\tMinitar.pack_file(f, tar) }\n tar.close\n\n conf[:backupSize]=File.size(destination) #remember archive size\nend",
"def compress_source_zip(path)\n require \"zip\"\n zipfile = Tempfile.create([\"vagrant\", \".zip\"])\n zipfile.close\n if File.file?(path)\n source_items = [path]\n else\n source_items = Dir.glob(File.join(path, \"**\", \"**\", \"*\"))\n end\n c_dir = nil\n Zip::File.open(zipfile.path, Zip::File::CREATE) do |zip|\n source_items.each do |source_item|\n next if File.directory?(source_item)\n trim_item = source_item.sub(path, \"\").sub(%r{^[/\\\\]}, \"\")\n dirname = File.dirname(trim_item)\n zip.mkdir dirname if c_dir != dirname\n c_dir = dirname\n zip.get_output_stream(trim_item) do |f|\n source_file = File.open(source_item, \"rb\")\n while data = source_file.read(2048)\n f.write(data)\n end\n end\n end\n end\n zipfile.path\n end",
"def unzip_file_with_translations(zipfile_name, dest_path, files_list, ignore_match)\n # overwrite files if they already exist inside of the extracted path\n Zip.on_exists_proc = true\n\n # files that exists in archive and doesn't match current project configuration\n unmatched_files = []\n\n Zip::File.open(zipfile_name) do |zipfile|\n zipfile.select { |zip_entry| zip_entry.file? }.each do |f|\n filename = f.name\n if @branch_name and @base_path_contains_branch_subfolders\n # strip branch from filename\n filename = f.name.sub(File.join(@branch_name, '/'), '')\n end\n\n # `f' - relative path in archive\n file = files_list[filename]\n if file\n fpath = File.join(dest_path, file)\n FileUtils.mkdir_p(File.dirname(fpath))\n puts \"Extracting: `#{file}'\"\n zipfile.extract(f, fpath)\n else\n unmatched_files << f\n end\n end\n end\n\n unless unmatched_files.empty? or ignore_match\n puts \"Warning: Downloaded translations do not match current project configuration. The following files will be omitted:\"\n unmatched_files.each { |file| puts \" - `#{file}'\" }\n end\nend",
"def unarchive\n unless in_zip?\n zips, gzs = selected_items.partition(&:zip?).tap {|z, others| break [z, *others.partition(&:gz?)]}\n zips.each do |item|\n FileUtils.mkdir_p current_dir.join(item.basename)\n Zip::File.open(item) do |zip|\n zip.each do |entry|\n FileUtils.mkdir_p File.join(item.basename, File.dirname(entry.to_s))\n zip.extract(entry, File.join(item.basename, entry.to_s)) { true }\n end\n end\n end\n gzs.each do |item|\n Zlib::GzipReader.open(item) do |gz|\n Gem::Package::TarReader.new(gz) do |tar|\n dest_dir = current_dir.join (gz.orig_name || item.basename).sub(/\\.tar$/, '')\n tar.each do |entry|\n dest = nil\n if entry.full_name == '././@LongLink'\n dest = File.join dest_dir, entry.read.strip\n next\n end\n dest ||= File.join dest_dir, entry.full_name\n if entry.directory?\n FileUtils.mkdir_p dest, mode: entry.header.mode\n elsif entry.file?\n FileUtils.mkdir_p dest_dir\n File.open(dest, 'wb') {|f| f.print entry.read}\n FileUtils.chmod entry.header.mode, dest\n elsif entry.header.typeflag == '2' # symlink\n File.symlink entry.header.linkname, dest\n end\n unless Dir.exist? dest_dir\n FileUtils.mkdir_p dest_dir\n File.open(File.join(dest_dir, gz.orig_name || item.basename), 'wb') {|f| f.print gz.read}\n end\n end\n end\n end\n end\n else\n Zip::File.open(current_zip) do |zip|\n zip.select {|e| selected_items.map(&:name).include? e.to_s}.each do |entry|\n FileUtils.mkdir_p File.join(current_zip.dir, current_zip.basename, File.dirname(entry.to_s))\n zip.extract(entry, File.join(current_zip.dir, current_zip.basename, entry.to_s)) { true }\n end\n end\n end\n ls\n end",
"def test_zip_01_fmt(fmt)\n Dir.mktmpdir do | tmp |\n chdir File.join(File.dirname(__FILE__), '..') do\n archive = File.join(tmp, \"rakelib#{fmt}\")\n zip \"rakelib\", archive: archive\n assert File.exist? archive\n unzip archive\n assert File.exist? File.join(tmp, 'rakelib')\n assert File.exist? File.join(tmp, 'rakelib', 'extensions.rb')\n assert File.exist? File.join(tmp, 'rakelib', 'support.rb')\n end\n end\n end",
"def write_images\n # Enumerate all the files in the zip and write any that are in the media directory to the output buffer (which is used to generate the new zip file)\n @file.read_files do |entry| # entry is a file entry in the zip\n if entry.name.include? IMAGE_DIR_NAME\n # Check if this is an image being replaced\n current_image = @images.select { |image| !@relationship_manager.get_relationship(image.id).nil? and entry.name.include? @relationship_manager.get_relationship(image.id)[:target] }.first\n\n unless current_image.nil?\n replacement_path = current_image.path\n data = ::File.read(replacement_path)\n else\n entry.get_input_stream { |is| data = is.sysread }\n end\n\n @file.output_stream.put_next_entry(entry.name)\n @file.output_stream.write data\n end\n end\n\n # Create any new images\n @unique_image_paths = []\n @images.select { |image| image.is_new }.each do |new_image|\n next if @unique_image_paths.include? new_image.target # we only want to write each image once\n @unique_image_paths << new_image.target\n @file.output_stream.put_next_entry(\"word/#{new_image.target}\")\n @file.output_stream.write ::File.read(new_image.path)\n end\n end",
"def targz\n files = procedure.get_adapter_configuration.attributes['files']\n if files.is_a?(Array)\n puts system_messages[:archiving]; puts system_messages[:compressing]\n %x{ tar -czf #{File.join(tmp_path, compressed_file)} #{files.map{|f| f.gsub(' ', '\\ ')}.join(' ')} }\n elsif files.is_a?(String)\n puts system_messages[:archiving]; puts system_messages[:compressing]\n %x{ tar -czf #{File.join(tmp_path, compressed_file)} #{files.gsub(' ', '\\ ')} }\n end\n end",
"def build_file_list\n puts_and_logs 'Finding files...'\n file_list = []\n config[:source].each do |entry|\n if File.directory?(entry)\n populate_list_of_files_from_directory(file_list, entry) \n next\n end\n if File.file?(entry)\n populate_list_of_files_from_file(file_list, entry) \n next\n end\n logger.warn \"\\\"#{entry}\\\" is neither a directory nor a regular file. Ignored...\"\n end\n logger.debug(file_list)\n file_list\n end",
"def write_entries(entries, path, zipfile)\n entries.each do |entry|\n zipfile_path = path == '' ? entry : File.join(path, entry)\n disk_file_path = File.join(src_path, zipfile_path)\n\n if File.directory?(disk_file_path)\n recursively_deflate_directory(disk_file_path, zipfile, zipfile_path)\n else\n put_into_archive(disk_file_path, zipfile, zipfile_path)\n end\n end\n end",
"def copyZipContents(file,zipdestination)\n Zip::ZipFile.open(file) { |zip_file|\n zip_file.each { |f|\n f_path=File.join(zipdestination, f.name)\n FileUtils.mkdir_p(File.dirname(f_path))\n zip_file.extract(f, f_path) unless File.exist?(f_path)\n }\n }\nend",
"def add_files(source, files)\n files.each do |f|\n source.upload_file(f) if File.file?(f)\n end unless files.nil?\n end",
"def compress_done_files(task)\n task_dir = student_work_dir(:done, task, false)\n zip_file = zip_file_path_for_done_task(task)\n return if (zip_file.nil?) || (not Dir.exists? task_dir)\n\n FileUtils.rm(zip_file) if File.exists? zip_file\n\n input_files = Dir.entries(task_dir).select { | f | (f =~ /^\\d{3}\\.(cover|document|code|image)/) == 0 }\n\n Zip::File.open(zip_file, Zip::File::CREATE) do | zip |\n zip.mkdir \"#{task.id}\"\n input_files.each do |in_file|\n zip.add \"#{task.id}/#{in_file}\", \"#{task_dir}#{in_file}\"\n end\n end\n\n FileUtils.rm_rf(task_dir)\n end",
"def extract\n zip_file_path = \"#{Rails.root}/public/tmp/#{self.id}/#{self.zip_file_name}\"\n # 100.times { p File.exist?(zip_file_path) }\n\n Zip::ZipFile.open(zip_file_path) do |zipfile|\n zipfile.each do |file|\n export_path = \"#{Rails.root}/public/tmp/#{self.id}_2/\"\n zip_path = File.join(export_path, zip_file_name)\n\n 100.times do\n p zip_path\n end\n\n # export_path = \"#{Rails.root}/public/tmp/#{self.id}_2/\"\n # zip_path = File.join(export_path, zip_file_name)\n # FileUtils.mkdir_p(File.dirname(export_path))\n\n # unless File.exist?(zip_file_path)\n # zipfile.extract(file, zip_path)\n # # # ..stuff that it does..\n # end\n # 100.times do\n # p image_path\n # end\n # FileUtils.mkdir_p(File.dirname(image_path))\n # unless File.exist?(image_path)\n # zip_file.extract(image, image_path)\n # # ..stuff that it does..\n # end\n end\n end\n end",
"def check_zip_file(file_path)\n # assign default \"zip\" file type = true\n zip_file_type_check = true\n # declare a array hold all child file info in \"zip\" file\n file_children = []\n # read zip file\n Zip::File.open(file_path) do |zip_file|\n # Handle entries one by one\n zip_file.each do |entry|\n # get info of each child file in \"zip\" file\n file_name = entry.name.include?(SPLASH_SYMBOL) ? entry.name.split(SPLASH_SYMBOL).last : entry.name\n puts \"File name is : #{file_name}\"\n file = Tempfile.new(file_name)\n begin\n file.binmode\n file.write(entry.get_input_stream.read)\n child = BannerFileUpload.new(media_type: @media_type, file_name: file_name,\n file_temp_path: file.path, file_size: file.size,\n file_type: FileMagic.new.file(file.path, true))\n child.check_file_size(MAX_FILE_SIZE_CONDITIONS)\n child.check_banner_size\n file_children.push(child)\n # check \"file type\" of child file\n if !(IMAGE_TYPE_REG.match?(child.file_type) || FILE_TYPE_REG_JS_CSS.match?(file_name))\n child.file_type_check = false\n # if exist any child file type doest not match then \"zip\" file type will be false\n zip_file_type_check = false\n else\n # if child file type is allow\n # change file type of text file (.js, .html, .css) by clearly name\n if FILE_TYPE_REG_JS_CSS.match?(child.file_name)\n child.file_type = FileMagic.new(FileMagic::MAGIC_MIME_TYPE).file(file.path, true)\n end\n child.file_type_check = true\n end\n rescue => e\n puts e.message\n ensure\n file.close\n file.unlink # deletes the temp file\n end\n end\n # assign all child_file info to @file_children property of \"zip\" file\n @file_children = file_children\n end\n zip_file_type_check\n end",
"def setup_run_artifacts\n FileUtils.mkdir_p(\"./#{Dir.glob(\"#{$VALUE}/\").max_by { |f| File.mtime(f) }}test_logs\")\n FileUtils.mkdir_p(\"./#{Dir.glob(\"#{$VALUE}/\").max_by { |f| File.mtime(f) }}test_report\")\n FileUtils.mkdir_p(\"./#{Dir.glob(\"#{$VALUE}/\").max_by { |f| File.mtime(f) }}test_results\")\n FileUtils.mkdir_p(\"./#{Dir.glob(\"#{$VALUE}/\").max_by { |f| File.mtime(f) }}test_screenshots\") unless File.exist?(\"./#{Dir.glob(\"#{$VALUE}/\").max_by { |f| File.mtime(f) }}test_screenshots\")\nend",
"def generate_simple_submission_solution_files(zip)\n # Create solution directory and create solution files\n zip.put_next_entry 'solution/'\n zip.put_next_entry 'solution/template'\n zip.print @test_params[:solution]\n\n # # Create submission directory with template file\n zip.put_next_entry 'submission/'\n zip.put_next_entry 'submission/template'\n zip.print @test_params[:submission]\n zip.print \"\\n\"\n end",
"def test_zip_03_fmt(fmt)\n Dir.mktmpdir do | tmp |\n chdir File.join(File.dirname(__FILE__), '..') do\n archive = File.join(tmp, \"rakelib#{fmt}\")\n zip \"rakelib\", archive: archive, include: [ 'extensions.rb' ]\n assert File.exist? archive\n unzip archive\n assert File.exist? File.join(tmp, 'rakelib')\n assert File.exist? File.join(tmp, 'rakelib', 'extensions.rb')\n assert (not File.exist? File.join(tmp, 'rakelib', 'support.rb'))\n end\n end\n end",
"def unzip_file(options)\n\n assignment = Assignment.find(options[:id]);\n logger.debug \"[DEBUG] Inside unzip_file\"\n logger.debug \"[DEBUG] Inside unzip_file, id of record is \" + options[:id].to_s\n\n source = options[:source]\n target = options[:target]\n\n logger.debug \"[DEBUG] Inside unzip_file, source is :\" + source + \" and target is: \" + target;\n\n Zip::ZipFile::open(source) {\n |zf|\n zf.each { |e|\n fpath = File.join(target, e.name)\n FileUtils.mkdir_p(File.dirname(fpath))\n\n logger.debug { \"[DEBUG] Now unzipping: \" + File.join(target, e.name)}\n\n if (File.exists? File.join(target, e.name)) and not (File.directory? File.join(target, e.name))\n logger.debug { \"[DEBUG] Removing file: \" + File.join(target, e.name)}\n FileUtils.rm_rf File.join(target, e.name)\n end\n\n ## RANT begin\n # Since this method is not overwriting files, and its API documentation is a one-line joke,\n # I have to check for the file and remove it manually above.\n # Seriously, guys, I love open source, but you're not 7 year olds just starting to learn programming.\n # It takes < 1 minute to document your freaking API.\n # That 4 year old Kylie from Microsoft's ads could do a better job at\n # documenting than the authors of some of the Ruby projects out there.\n # - SA\n ## RANT end\n zf.extract(e, fpath)\n }\n }\n\n #If all has gone well, let's read the properties\n assignment.read_properties_file\n\n rescue Zip::ZipDestinationFileExistsError => ex\n # I'm going to ignore this and just overwrite the files.\n\n rescue => ex\n puts ex\n\n end",
"def create_archive\n created = false\n empty = true\n Dir.mktmpdir do |tmpdir|\n # create manifest\n tmpmf = File.join(tmpdir, DulHydra.export_set_manifest_file_name)\n # create the zip archive\n zip_name = \"export_set_#{Time.now.strftime('%Y%m%d%H%M%S')}.zip\"\n zip_path = File.join(tmpdir, zip_name)\n Zip::ZipFile.open(zip_path, Zip::ZipFile::CREATE) do |zip_file|\n CSV.open(tmpmf, 'wb') do |manifest|\n manifest << archive_manifest_header\n pids.each do |pid|\n # get Fedora object\n begin\n object = ActiveFedora::Base.find(pid, :cast => true) \n # skip if object is not content-bearing or user lacks :read permission\n next unless object.has_content? and user.can?(:read, object)\n content_ds = object.datastreams[DulHydra::Datastreams::CONTENT]\n # use guaranteed unique file name based on PID and dsID \n temp_file_path = File.join(tmpdir, content_ds.default_file_name)\n # write content to file\n File.open(temp_file_path, 'wb', :encoding => 'ascii-8bit') do |f|\n content_ds.write_content(f)\n end\n # Use original source file name, if available; otherwise the generated file name\n # Note that we keep the path of the source file in order to reduce likelihood\n # name conflicts, and since it is easy to flatten zip contents on extraction.\n # However, we don't want the path of the generated temp file, just the basename.\n file_name = object.source.first || File.basename(temp_file_path)\n # discard leading slash, if present\n file_name = file_name[1..-1] if file_name.start_with? '/'\n # add file to archive\n zip_file.add(file_name, temp_file_path)\n # add row to manifest\n manifest << archive_manifest_row(file_name, object)\n rescue ActiveFedora::ObjectNotFoundError => e\n logger.error e\n next\n end\n end # document_list\n end # manifest\n # check if the zip file is emtpy\n empty = (zip_file.size == 0)\n # write manifest \n zip_file.add(DulHydra.export_set_manifest_file_name, tmpmf) unless empty\n end # zip_file\n # update_attributes seems to be the way to get paperclip to work \n # when not using file upload form submission to create the attachment\n created = !empty && update_attributes({:archive => File.new(zip_path, \"rb\")})\n end # tmpdir is removed\n created\n end",
"def test_targets\n prov = mkprovider\n\n files = {}\n\n # Set the default target\n default = tempfile\n files[:default] = default\n prov.default_target = default\n\n # Create a file object\n inmem = tempfile\n files[:inmemory] = inmem\n prov.target_object(inmem).write(\"inmem yay ness\")\n\n # Lastly, create a resource with separate is and should values\n mtarget = tempfile\n files[:resources] = mtarget\n resource = mkresource \"yay\", :target => mtarget\n\n assert(resource.should(:target), \"Did not get a value for target\")\n\n list = nil\n\n # First run it without the resource\n assert_nothing_raised do\n list = prov.targets\n end\n\n # Make sure it got the first two, but not the resources file\n files.each do |name, file|\n if name == :resources\n assert(! list.include?(file), \"Provider somehow found resource target when no resource was passed\")\n else\n assert(list.include?(file), \"Provider did not find #{name} file\")\n end\n end\n\n # Now list with the resource passed\n assert_nothing_raised do\n list = prov.targets(\"yay\" => resource)\n end\n\n # And make sure we get all three files\n files.each do |name, file|\n assert(list.include?(file), \"Provider did not find #{name} file when resource was passed\")\n end\n end",
"def merge(*args)\n options = Hash === args.last ? args.pop : {}\n files = to_artifacts(args)\n rake_check_options options, :path\n raise ArgumentError, \"Expected at least one file to merge\" if files.empty?\n path = options[:path] || @path\n expanders = files.collect do |file|\n @sources << proc { file.to_s }\n expander = ZipExpander.new(file)\n @actions << proc do |file_map, transform_map|\n file.invoke() if file.is_a?(Rake::Task)\n expander.expand(file_map, transform_map, path)\n end\n expander\n end\n Merge.new(expanders)\n end",
"def generate_output_file(zip_out, contents); end",
"def create_work\n @files.each do |file|\n executor.queue { file.copy_file(@output_dir) }\n end\n end",
"def prepare_tmpdirs(data)\n data[:files].each do |file|\n targetdir = File.join(@workingdir, File.dirname(File.expand_path(file)).gsub(@package.target_path, \"\"))\n FileUtils.mkdir_p(targetdir) unless File.directory? targetdir\n FileUtils.cp_r(file, targetdir)\n end\n end",
"def test_extract(files=nil)\n output = 'test/embedded' # Don't think output should be setable.\n\n files = files || 'lib/**/*.rb'\n files = 'lib/**/*.rb' if TrueClass == files\n files = [files].flatten.compact\n\n filelist = files.collect{ |f| Dir.glob(f) }\n filelist.flatten!\n if filelist.empty?\n puts \"No scripts found from which to extract tests.\"\n return\n end\n\n FileUtils.mkdir_p(output) unless File.directory?(output)\n\n #vrunner = VerbosityRunner.new(\"Extracting\", verbosity?)\n #vrunner.setup(filelist.size)\n\n filelist.each do |file|\n #vrunner.prepare(file)\n\n testing = extract_test_from_file( file )\n if testing.strip.empty?\n status = \"[NONE]\"\n else\n complete_test = create_test(testing, file)\n libpath = File.dirname(file)\n testfile = \"test_\" + File.basename(file)\n fp = File.join(output, libpath, testfile)\n unless File.directory?( File.dirname(fp))\n FileUtils.mkdir_p(File.dirname(fp))\n end\n File.open(fp, \"w\"){ |fw| fw << complete_test }\n status = \"[TEST]\"\n end\n\n #vrunner.complete(file, status)\n end\n\n #vrunner.finish(\n # :normal => \"#{filelist.size} files had tests extracted.\",\n # :check => false\n #)\n end",
"def create_uploads(dirs)\n u = UploadImage.new\n dirs.map do |dir|\n UploadInspection.new(\"./inspections/\"+dir, u)\n end\n end",
"def write_entries(input_dir, entries, path, zipfile)\n entries.each do |e|\n zipfile_path = path == '' ? e : File.join(path, e)\n disk_file_path = File.join(input_dir, zipfile_path)\n\n if File.directory? disk_file_path\n recursively_deflate_directory(input_dir, disk_file_path, zipfile, zipfile_path)\n else\n put_into_archive(disk_file_path, zipfile, zipfile_path)\n end\n end\n end",
"def files\n @header.dirindexes.map { |idx|\n @header.dirnames[idx]\n }.zip(@header.basenames).map { |dir, name|\n ::File.join(dir, name)\n }.zip(@header.filesizes).map { |path, size|\n Rupert::RPM::File.new(path, size)\n }\n end",
"def write_entries(entries, path, zipfile)\n entries.each do |e|\n # relative path of file being added to the zip\n relative_path = path == '' ? e : File.join(path, e)\n # full path\n full_path = File.join(@input_dir, relative_path)\n\n if File.directory? full_path\n recursively_zip_directory(full_path, zipfile, relative_path)\n else\n put_into_archive(full_path, zipfile, relative_path)\n end\n end\n end",
"def addRefs2Target(filePath,targets,group)\n\tfile_refs = []\n\tDir.foreach(filePath) do |file|\n\t\tif file.to_s.end_with?(keyword) then\n\t\t\tpathNeed = File.join(filePath,file)\n\t\t\t# puts path\n\t\t\tfile_ref = group.new_reference(pathNeed)\n\t\t\tfile_refs.push(file_ref)\n\t\t\t# target.resources_build_phase.add_file_reference(file_ref, true)\n\t\tend\n\tend\n\t# add_file_references\n\ttargets.each do |target|\n\t\ttarget.add_resources(file_refs)\n\tend\nend",
"def get_task_resources_zip()\n # Get a temp file path\n filename = FileHelper.sanitized_filename(\"task-resources-#{self.code}.zip\")\n result = Tempfile.new(filename)\n # Create a new zip\n Zip::File.open(result.path, Zip::File::CREATE) do | zip |\n task_definitions.each do |td|\n if td.has_task_pdf?\n dst_path = FileHelper.sanitized_path( \"#{td.abbreviation}\") + \".pdf\"\n zip.add(dst_path, td.task_sheet)\n end\n\n if td.has_task_resources?\n dst_path = FileHelper.sanitized_path( \"#{td.abbreviation}\") + \".zip\"\n zip.add(dst_path, td.task_resources)\n end\n end\n end #zip\n result\n end",
"def compile_file_list(output_folder, files, data = {})\n files.each do |target, source|\n Google::LOGGER.debug \"Compiling #{source} => #{target}\"\n target_file = File.join(output_folder, target)\n .gsub('{{product_name}}', @api.prefix[1..-1])\n\n manifest = @config.respond_to?(:manifest) ? @config.manifest : {}\n generate_file(\n data.clone.merge(\n name: target,\n product: @api,\n object: {},\n config: {},\n scopes: @api.scopes,\n manifest: manifest,\n tests: '',\n template: source,\n generated_files: @generated,\n sourced_files: @sourced,\n compiler: compiler,\n output_folder: output_folder,\n out_file: target_file,\n prop_ns_dir: @api.prefix[1..-1].downcase,\n product_ns: @api.prefix[1..-1].camelize(:upper)\n )\n )\n\n %x(goimports -w #{target_file}) if File.extname(target_file) == '.go'\n end\n end",
"def zip_xml_files\n logger.debug('ZIPPING ALL FILES.')\n # time = Time.now.strftime('%Y-%d-%m_%H-%M-%S')\n Dir.glob(File.join(LOCAL_DIR, FILE_EXTN)).each do |file|\n list_files.push(file)\n end\n puts list_files.length\n list_files.each do |file|\n Archive::Zip.archive((file + ARCHIVE_EXTN), file) if File.extname(file).eql?('.xml')\n end\n list_files.each do |file|\n File.delete(file)\n end\n logger.debug('ALL FILES ZIPPED.')\n end",
"def compress(entries)\n puts \"\\nadding the following entries into zip package\"\n puts \"#{ entries.map{ |x| x.name }.join(\"\\n\")}\"\n buffer = Zip::File.add_buffer do |zio|\n entries.each do |file|\n if file.is_a? FileEntry\n zio.add(file.path == nil ? file.name : file.path, file.name)\n else\n zio.get_output_stream(file.name) { |os| os.write file.buffer.string }\n end\n end\n end\n end",
"def setup(target)\n Dir.mkdir(target) unless File.directory?(target)\nend",
"def zip(path_to_files, files_to_zip, zip_filepath, force_new_file = true)\n return unless files_to_zip\n # remove zip file, if existing already\n File.delete zip_filepath if force_new_file and File.file? zip_filepath\n\n directories = []\n\n # open or create the zip file\n Zip::ZipFile.open(zip_filepath, Zip::ZipFile::CREATE) do |zipfile|\n files_to_zip.each do |filename|\n file_path = path_to_files + '/' + filename\n logger.debug \"\\n===> adding '#{filename}' from '#{file_path}'\"\n zipfile.add(filename, file_path)\n\n directories << { :path => path_to_files, :name => filename } if File.directory? file_path\n end\n end\n \n # recursively adding directories, skipped but remembered before\n directories.each do |dir|\n get_dir_list(dir[:path] + '/' + dir[:name]).each do |sub_element|\n sub_filename = dir[:name] + '/' + sub_element\n zip(dir[:path], [ sub_filename ], zip_filepath, false)\n end\n end\n \n # set read permissions on the file\n File.chmod(0644, zip_filepath) \n end",
"def zip_download\n require 'zip'\n require 'tempfile'\n\n tmp_dir = ENV['TMPDIR'] || \"/tmp\"\n tmp_dir = Pathname.new tmp_dir\n # Deepblue::LoggingHelper.debug \"Download Zip begin tmp_dir #{tmp_dir}\"\n Deepblue::LoggingHelper.bold_debug [ \"zip_download begin\", \"tmp_dir=#{tmp_dir}\" ]\n target_dir = target_dir_name_id( tmp_dir, curation_concern.id )\n # Deepblue::LoggingHelper.debug \"Download Zip begin copy to folder #{target_dir}\"\n Deepblue::LoggingHelper.bold_debug [ \"zip_download\", \"target_dir=#{target_dir}\" ]\n Dir.mkdir( target_dir ) unless Dir.exist?( target_dir )\n target_zipfile = target_dir_name_id( target_dir, curation_concern.id, \".zip\" )\n # Deepblue::LoggingHelper.debug \"Download Zip begin copy to target_zipfile #{target_zipfile}\"\n Deepblue::LoggingHelper.bold_debug [ \"zip_download\", \"target_zipfile=#{target_zipfile}\" ]\n File.delete target_zipfile if File.exist? target_zipfile\n # clean the zip directory if necessary, since the zip structure is currently flat, only\n # have to clean files in the target folder\n files = Dir.glob( (target_dir.join '*').to_s)\n Deepblue::LoggingHelper.bold_debug files, label: \"zip_download files to delete:\"\n files.each do |file|\n File.delete file if File.exist? file\n end\n Deepblue::LoggingHelper.debug \"Download Zip begin copy to folder #{target_dir}\"\n Deepblue::LoggingHelper.bold_debug [ \"zip_download\", \"begin copy target_dir=#{target_dir}\" ]\n Zip::File.open(target_zipfile.to_s, Zip::File::CREATE ) do |zipfile|\n metadata_filename = curation_concern.metadata_report( dir: target_dir )\n zipfile.add( metadata_filename.basename, metadata_filename )\n export_file_sets_to( target_dir: target_dir, log_prefix: \"Zip: \" ) do |target_file_name, target_file|\n zipfile.add( target_file_name, target_file )\n end\n end\n # Deepblue::LoggingHelper.debug \"Download Zip copy complete to folder #{target_dir}\"\n Deepblue::LoggingHelper.bold_debug [ \"zip_download\", \"download complete target_dir=#{target_dir}\" ]\n send_file target_zipfile.to_s\n end",
"def zip_files\n time = Time.now.strftime('%Y-%d-%m_%H-%M-%S')\n Archive::Zip.archive(File.join(ARCHIVE[0], ARCHIVE[1], time, ARCHIVE[2]), File.join(LOCAL_DIR, '.'))\n Dir.glob(File.join(LOCAL_DIR, FILE_EXTN)).each { |file| File.delete(file) }\n end",
"def write_entries(entries, path, zipfile)\n entries.each do |e|\n zipfile_path = path == '' ? e : File.join(path, e)\n disk_file_path = File.join(@input_dir, zipfile_path)\n puts \"Deflating #{disk_file_path}\"\n\n if File.directory? disk_file_path\n recursively_deflate_directory(disk_file_path, zipfile, zipfile_path)\n else\n put_into_archive(disk_file_path, zipfile, zipfile_path)\n end\n end\n end",
"def configure_redist_dir(output, zip_file_name, platforms, compiler)\n\tworking_dir = File.join(RedistDirName, zip_file_name)\n\tmakedirs working_dir\n\n\toutput.from \".\"\n\toutput.to File.join(working_dir, zip_file_name)\n\t\n\tConfigurations.each do |configuration|\n\t\tfor platform in platforms\n\t\t\toutput.file \"lib/#{platform}/#{configuration}/hlsl2glsl.lib\"\n\t\t\toutput.file \"build/#{compiler}/#{platform}/#{configuration}/hlsl2glsl.pdb\", :as => \"lib/#{platform}/#{configuration}/hlsl2glsl.pdb\"\n\t\tend\n\tend\n\t\n\toutput.dir \"include\"\n\toutput.file \"LICENSE.txt\"\n\toutput.file \"README.md\"\nend",
"def write_entries(entries, path, zipfile)\n entries.each do |e|\n zipfile_path = path == '' ? e : File.join(path, e)\n disk_file_path = File.join(@input_dir, zipfile_path)\n\n if File.directory? disk_file_path\n recursively_deflate_directory(disk_file_path, zipfile, zipfile_path)\n else\n put_into_archive(disk_file_path, zipfile, zipfile_path)\n end\n end\n end",
"def write_entries(entries, path, zipfile)\n entries.each do |e|\n zipfile_path = path == '' ? e : File.join(path, e)\n disk_file_path = File.join(@input_dir, zipfile_path)\n\n if File.directory? disk_file_path\n recursively_deflate_directory(disk_file_path, zipfile, zipfile_path)\n else\n put_into_archive(disk_file_path, zipfile, zipfile_path)\n end\n end\n end",
"def test_add_case_insensitive\n ::Zip.case_insensitive_match = true\n\n SRC_FILES.each { |fn, _en| assert(::File.exist?(fn)) }\n zf = ::Zip::File.new(EMPTY_FILENAME, ::Zip::File::CREATE)\n\n assert_raises Zip::EntryExistsError do\n SRC_FILES.each { |fn, en| zf.add(en, fn) }\n end\n end",
"def check_add_assembly_files(files=self.find_assembly_files)\n add = Hash.new\n files.each do |file_type, file_hash|\n # returns an array\n file_path = file_hash[\"path\"]\n file_vendor = file_hash[\"vendor\"]\n filename = File.basename(file_path)\n # if you use file_type then if the file_type is wrong it tries to add a new file...\n# af = AssemblyFile.includes(:file_type).where(:name => filename, :file_types => {:type_name => file_type})\n af = AssemblyFile.where(:name => filename) \n\n if af.size == 0 then\n add[file_path] = Hash.new\n\tadd[file_path][\"type\"] = file_type\n\tadd[file_path][\"vendor\"] = file_vendor\n end\n\n end\n if add.size == 0 then\n logger.error(\"check_add_assembly_files did not find any files to add\")\n return []\n end\n return add\n end",
"def build_work(work_files)\n work_files.each do |file|\n next if file.blank?\n if file.end_with? '-metadata.json'\n @work_metadata = JSON.parse(File.read(file))\n work_metadata[:packaged_by_package_name] = dip_id\n write_json(work_metadata)\n else\n FileUtils.cp_r(file, src)\n end\n end\n write_dc\n end",
"def write_entries(entries, path, zipfile)\r\n entries.each do |e|\r\n zipfile_path = path == '' ? e : File.join(path, e)\r\n disk_file_path = File.join(@input_dir, zipfile_path)\r\n\r\n if File.directory? disk_file_path\r\n recursively_deflate_directory(disk_file_path, zipfile, zipfile_path)\r\n else\r\n put_into_archive(disk_file_path, zipfile, zipfile_path)\r\n end\r\n end\r\n end",
"def send_files(name, files)\n if @request.env[\"HTTP_MOD_ZIP_ENABLED\"]\n filenames = []\n files.each do |file|\n path = ::File.expand_path(file.path)\n filename = file.name\n while filenames.include? filename\n extname = ::File.extname(filename)\n basename = ::File.basename(filename, extname)\n if basename =~ /-(\\d+)$/\n counter = $1.to_i + 1\n else\n counter = 2\n end\n filename = \"#{basename}-#{counter}#{extname}\"\n end\n filenames << filename\n if file.respond_to?(:checksum)\n puts(\"#{file.checksum(:pkzip)} #{::File.size(path)} #{path} #{filename}\")\n else\n puts(\"#{Harbor::File.new(path).checksum(:pkzip)} #{::File.size(path)} #{path} #{filename}\")\n end\n end\n headers[\"X-Archive-Files\"] = \"zip\"\n self.content_type = \"application/zip\"\n @headers[\"Content-Disposition\"] = \"attachment; filename=\\\"#{escape_filename_for_http_header(name)}\\\"\"\n else\n @io = ZippedIO.new(files)\n self.size = @io.size\n self.content_type = \"application/zip\"\n @headers[\"Content-Disposition\"] = \"attachment; filename=\\\"#{escape_filename_for_http_header(name)}\\\"\"\n end\n end",
"def zipXMLFiles\n logger.debug(\"ZIPPING ALL FILES.\")\n #time = Time.now.strftime(\"%Y-%d-%m_%H-%M-%S\")\n Dir.glob(File.join(LOCAL_DIR, FILE_EXTN)).each {\n |file|\n listFiles.push(file)\n }\n puts listFiles.length\n listFiles.each {\n |file|\n if File.extname(file).eql?(\".xml\")\n Archive::Zip.archive((file + ARCHIVE_EXTN), file)\n end\n }\n listFiles.each {\n |file|\n File.delete(file)\n }\n logger.debug(\"ALL FILES ZIPPED.\")\n end",
"def build_file_sets\n return if file_nodes.empty? || processing_derivatives?\n file_nodes.each_with_index.map do |node, index|\n file_set = create_file_set(node, files[index])\n file_set\n end\n end",
"def perform_file_copy\n\t\tretrieve_target_dir do |target_dir|\n\t\t\tFileUtils.mkdir_p target_dir\n\t\t\tcopy_depdencies_to target_dir\n\t\tend\t\n\tend",
"def create_src_list\n\n if ENV['TM_PROJECT_DIRECTORY']\n\n src_list = (ENV['TM_AS3_USUAL_SRC_DIRS'] != nil) ? ENV['TM_AS3_USUAL_SRC_DIRS'].gsub(':','|') : \"src\"\n @src_dirs = `find -dE \"$TM_PROJECT_DIRECTORY\" -maxdepth 5 -regex '.*\\/(#{src_list})' -print 2>/dev/null`\n\n end\n\n cs = \"#{@completion_src}/data/completions\"\n\n # Check once for existence here as we will save repeated\n # checks later (whilst walking up the heirarchy).\n add_src_dir(\"#{cs}/intrinsic\")\n add_src_dir(\"#{cs}/frameworks/air\")\n add_src_dir(\"#{cs}/frameworks/flash_ide\")\n add_src_dir(\"#{cs}/frameworks/flash_cs3\")\n\n # Where we have access to the compressed flex 3 files use them,\n # otherwise go looking for the sdk.\n unless add_src_dir(\"#{cs}/frameworks/flex_3\")\n fx = FlexMate::SDK.src\n add_src_dir(fx) unless fx.nil?\n end\n\n #log_append( \"src_dirs \" + @src_dirs )\n\n end",
"def assure_created_zip\n FileCreator::createNewZip(self)\n raise \"No file created\" unless File.exists? zip_path\n end",
"def pack(src, dest, recurse_dirs = true, &block)\n require \"find\"\n Output.open(dest) do |outp|\n if src.is_a?(Array)\n src.each do |entry|\n if dir?(entry) && recurse_dirs\n Find.find(entry) do |ee|\n pack_file(ee, outp, &block)\n end\n else\n pack_file(entry, outp, &block)\n end\n end\n else\n Find.find(src) do |entry|\n pack_file(entry, outp, &block)\n end\n end\n end\n end",
"def files\n ext_files = mapper.extracted_files || []\n ext_files + [mapper.zip.name.to_s]\n end",
"def test_add_case_sensitive\n ::Zip.case_insensitive_match = false\n\n SRC_FILES.each { |fn, _en| assert(::File.exist?(fn)) }\n zf = ::Zip::File.new(EMPTY_FILENAME, ::Zip::File::CREATE)\n\n SRC_FILES.each { |fn, en| zf.add(en, fn) }\n zf.close\n\n zfRead = ::Zip::File.new(EMPTY_FILENAME)\n assert_equal(SRC_FILES.size, zfRead.entries.length)\n SRC_FILES.each_with_index { |a, i|\n assert_equal(a.last, zfRead.entries[i].name)\n AssertEntry.assert_contents(a.first,\n zfRead.get_input_stream(a.last) { |zis| zis.read })\n }\n end",
"def ftpImagesAndCSVAndCreateZip(order_hash, status_hash)\n\t\torder_number = order_hash[:order_number]\n\t\ttmp_path = File.join(File.dirname(__FILE__), 'orders', order_number)\n\t\tzip = order_hash[:image_zip_file]\n\t\tzip_path = File.join('orders/new/', zip)\n\t\ttmp_zip_path = File.join(tmp_path, zip)\n\t\tstatus_hash[:ftp_status] = 0\n\t\t\t\t\n\t\tif status_hash[:status] == 0\n\t\t\t3.times do\n\t\t\t\tif status_hash[:ftp_status] == 0\n\t\t\t\t\t\tuploadFilestoFTP(order_hash, status_hash)\t \n\t\t\t\tend\n\t\t\tend\t\t\t\n\t\tend\n\t\t\n\t\tif status_hash[:status] == 0\n\t\t\t# zip downloaded files \n\t\t\tZip::File.open(tmp_zip_path, 'w') do |zipfile|\n\t\t\t\tDir[\"#{tmp_path}/**/**\"].reject{|f|f==tmp_zip_path}.each do |file|\n\t\t\t\t\tbegin\t \n\t\t\t\t\t\tzipfile.add(file.sub(tmp_path+'/',''),file)\t\t\n\t\t\t\t\trescue Zip::ZipEntryExistsError\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\tstatus_hash[:msg] = \"processed order has been zipped\"\n\t\tend\n\tend"
] | [
"0.62616754",
"0.62557745",
"0.6206066",
"0.6185896",
"0.6034373",
"0.57765603",
"0.57113385",
"0.5684122",
"0.5640609",
"0.56351995",
"0.56351995",
"0.5616844",
"0.5600996",
"0.5569507",
"0.55608875",
"0.5531087",
"0.551721",
"0.5515941",
"0.5507255",
"0.5487787",
"0.5472913",
"0.54580796",
"0.5450378",
"0.54502106",
"0.54469246",
"0.542328",
"0.5382327",
"0.53643847",
"0.5332828",
"0.5318531",
"0.53066313",
"0.5299169",
"0.5282609",
"0.5274373",
"0.5255755",
"0.52547395",
"0.525322",
"0.524274",
"0.523622",
"0.5222599",
"0.5220496",
"0.52159023",
"0.52131903",
"0.52037215",
"0.51921237",
"0.517246",
"0.5171929",
"0.5164759",
"0.5164391",
"0.51624525",
"0.5156889",
"0.5156838",
"0.5151365",
"0.51446223",
"0.5131924",
"0.5130994",
"0.51289207",
"0.5127205",
"0.5116647",
"0.5116323",
"0.5113849",
"0.5113015",
"0.5102359",
"0.5100696",
"0.5100599",
"0.5076697",
"0.50629056",
"0.50593454",
"0.505233",
"0.50478303",
"0.5045909",
"0.50432175",
"0.50367975",
"0.50367874",
"0.50317234",
"0.5026963",
"0.5025928",
"0.50232637",
"0.50136876",
"0.5000444",
"0.49799556",
"0.49782178",
"0.49781886",
"0.4977173",
"0.49728262",
"0.49728262",
"0.49680758",
"0.49605855",
"0.49568903",
"0.49552545",
"0.49542734",
"0.49511576",
"0.4948568",
"0.49435985",
"0.49425316",
"0.49414948",
"0.49406493",
"0.49397227",
"0.49365193",
"0.4930978"
] | 0.5520483 | 16 |
=begin Generator needs to: Swap first and last name vowels moved forward one character consonants moved forward one character in this instance, y will be a consonant =end Swaps first and last names and turns them into arrays | def alias_generator(agent)
# changes vowels into array and uses .reverse method to account
# for edge cases
vowels = "aeiou"
new_vowels = "aeiou".split('').reverse
# changes consonants into array and uses .reverse method to account
# for edge cases
consonants = "bcdfghjklmnpqrstvwxyz"
new_consonants = "bcdfghjklmnpqrstvwxyz".split('').reverse
# defines variables for user input and parameter
real_name = agent
# swaps first and last names and turns them into arrays
reversed_real_name = real_name.downcase.split(' ').reverse
alias_name_array = reversed_real_name.join(' ').split('')
# maps the new array through the indices of the vowel and consonant arrays
altered_name = alias_name_array.map do |char|
if vowels.include?(char)
# if there is a vowel, it will map to the next vowel
new_vowels[new_vowels.index(char)-1]
elsif consonants.include?(char)
# if there is a consonant, it will map to the next consonant
new_consonants[new_consonants.index(char)-1]
else
# accounts for space or another character
char
end
end
# takes the newly mapped array, joins it back together and capitalizes it
new_alias = altered_name.join.split.map!{ |name| name.capitalize }.join(" ")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_vowcon(oldlet) #actually takes in the whole name (not just 1 letter), since it is only split to an array of [first_name, last_name]\r\n vowel = ['a','e','i','o','u']\r\n rot_vow = vowel.rotate #reverses vowel array\r\n consonant = 'bcdfghjklmnpqrstvwxzy'.split('')\r\n rot_cons= consonant.rotate #reverses consonant array\r\n i=0\r\n while i < oldlet.length\r\n if vow_index = vowel.index(oldlet[i])\r\n oldlet[i] = rot_vow[vow_index]\r\n else\r\n cons_index = consonant.index(oldlet[i])\r\n oldlet[i] = rot_cons[cons_index]\r\n end\r\n i +=1\r\n end\r\n return oldlet\r\nend",
"def make_up_name(name)\nchanged_name = [] #empty array to push letters from name into when it goes through iteration\nvowels = \"aeiou\"\n\nconsonant = \"bcdfghjklmnpqrstvwxyz\"\n\n\n#if the index of the name provided is a consonant then change it to the next letter.\n\nindex = 0 #start at 0\n \n while index < name.length\n \t\tletter = name[index] #takes every index of every letter in name and stores it in a variable\n \t\tif vowels.include?(letter) #deals with edge case\n \t\t\tif letter == \"u\"\n \t\t\t\tchanged_name.push(\"a\")\n \t\t\telse #need to make it so every other vowel changes to next vowel letter.next\n \t\t\tend\n \t\telsif consonant.inlcude?(letter)\n \t\t\tif letter == \"z\" #deals with edge case\n \t\t\t\tchanged_name.push(\"b\")\n \t\t\telse #everything else will need to be next letter using letter.next \t\t \t\t\n \t\t\tend\n \t\telsif letter == \" \"\n \t\t\t\tchanged_name.push(\" \")\n \t\t\tend\n \t\t \t index += 1\n \tend\nnew_name_array = changed_name.join('') #takes all the letters in the array above and puts it in a new array\nnew_name_array.each {|name| p name.capitalize}\nend",
"def name_converter(first_name, last_name)\n #1. swap the order names\n swapped_names = fake_name(first_name, last_name)\n #2 break swappedNames into array\n character_array = swapped_names.split('')\n #3. iterate through array\n vowel = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n consonant = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\",\"y\",\"z\"]\n\n result = ''\n character_array.each do |character|\n if vowel.include?(character)\n #move forward next vowel in vowel array\n if character == 'u'\n result += 'a'\n next\n end \n \n current_index = vowel.index (character)\n new_index = current_index + 1\n #3. go to vowel array with new_index and retrieve that letter\n # next_letter = 'i'\n # add next_letter to result\n result += vowel[new_index]\n\n #follow same steps for moving forward next vowel for consonant \n\n elsif consonant.include?(character)\n if character == \"z\"\n result += 'b'\n next\n end\n\n current_index = consonant.index (character)\n new_index = current_index + 1\n\n result += consonant [new_index]\n\n result += character \n # add new letter to result\n end\n end\n #4. if the character is a vowel do a vowel swap\n #5. elsif the character is a consonant do a consonant swap\n \n result\nend",
"def vowels_consonant_movement2(name)\n name = name.downcase.split(\" \")\nfirst_name = name[0]\nsecond_name = name[1]\n consonants = \"bcdfghjklmnpqrstvwxyz\"\n vowels = \"aeiou\"\n translated_name = []\n translated_name2 = []\n\n#adjust first name \n x = 0 \n while x < first_name.length\n if first_name[x] == \"z\"\n first_name[x] = \"b\"\n translated_name << first_name[x]\n elsif\n first_name[x] == \"u\"\n first_name[x] = \"a\"\n translated_name << first_name[x]\n \n elsif consonants.include?first_name[x]\n \n new_position = consonants.index(first_name[x]) + 1 \n \n first_name[x] = consonants[new_position]\n translated_name << first_name[x]\n \n elsif vowels.include?first_name[x]\n newer_position = vowels.index(first_name[x]) + 1\n first_name[x] = vowels[newer_position]\n translated_name << first_name[x]\n \n end\n \n x += 1\n end\n \n#adjust second name \n x = 0 \n while x < second_name.length\n if second_name[x] == \"z\"\n second_name[x] = \"b\"\n translated_name2 << second_name[x]\n elsif\n second_name[x] == \"u\"\n second_name[x] = \"a\"\n translated_name2 << second_name[x]\n \n elsif consonants.include?second_name[x]\n \n new_position = consonants.index(second_name[x]) + 1 \n \n second_name[x] = consonants[new_position]\n translated_name2 << second_name[x]\n \n elsif vowels.include?second_name[x]\n newer_position = vowels.index(second_name[x]) + 1\n second_name[x] = vowels[newer_position]\n translated_name2 << second_name[x]\n \n end\n \n x += 1\n end\n \n first_letter = translated_name[0].upcase\n translated_name.delete_at(0)\n translated_name.insert(0, first_letter)\n \n first_letter2 = translated_name2[0].upcase\n translated_name2.delete_at(0)\n translated_name2.insert(0, first_letter2)\n \n return translated_name2.join(\"\") + \" \" + translated_name.join(\"\")\n \n \nend",
"def next_vowel(str)\n\t# Need to identify the vowels in the English alphabet in a new variable\n\tvowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n\t# Need to also identify the consonants in the English alphabet in a new variable\n\tconsonants = [\"b\",\"c\",\"d\",\"f\",\"g\",\"h\",\"j\",\"k\",\"l\",\"m\",\"n\",\"p\",\"q\",\"r\",\n\t\t\"s\",\"t\",\"v\",\"w\",\"x\",\"y\",\"z\"]\n\twords = str.split # Splitting the name into words based on space (' ')\n\t\n\t## Loop into each name\n\ti = 0 # Setting an index to zero\n\tnew_word = [] # Setting up an empty array for our new scrambled word\n\tmod_word = [] # Setting up an empty array to hold the capitalized scrambled word\n\n\twhile i < words.length # Looping into each word\n\t\tchars = words[i].split('') # Split each word into characters\n\t\tnew_chars = chars.map{|char| # Mapping into each character\n\t\t\tif vowels.include?(char) # If the character is included in the vowels variable\n\t\t\t\tvowels.rotate(1)[vowels.index(char)] # Reassign it to the next vowel\n\t\t\telsif consonants.include?(char) # If the character is included in the consonants variable\n\t\t\t\tconsonants.rotate(1)[consonants.index(char)] # Reassign it to the next consonet\n\t\t\telse\n\t\t\t\tchar # Otherwise don't do anything (In case there are odd characters)\n\t\t\tend\n\t\t}\n\t\tnew_word.push(new_chars.join) # rejoin the word\n\t\t# This bit of code capitalizes the first character of the name\n\t\tmod_word.push(new_word[i].slice(0,1).capitalize + new_word[i].slice(1..-1))\n\t\ti += 1 # increment counter\n\tend\n\treturn mod_word.join(' ') # return the rejoined words\nend",
"def alias_generator(name)\n\nname = name.downcase\n\nvowels_lowcase = %w(a e i o u)\nvowels = vowels_lowcase\nconsonants_lowcase = (\"a\"..\"z\").to_a - vowels\nconsonants = consonants_lowcase\n\n# original = (vowels + consonants)\n# new_letters = (vowels.rotate + consonants.rotate)\n\nname_array = name.split\nname_reverse = name_array.reverse\n\nname_reverse.map! do |word|\n word_split = word.split(\"\")\n # name_reverse[1].split(\"\")\n\n word_split.map! do |letter|\n if vowels.include? letter\n index = vowels.index(letter)\n if letter == vowels.last\n letter = vowels.first\n else\n letter = vowels[index + 1]\n end\n else\n index = consonants.index(letter)\n if letter == consonants.last\n letter = consonants.first\n else\n letter = consonants[index + 1]\n end\n end\n end\n\n word_split[0] = word_split[0].upcase\n word_split.join('')\nend\n\nname_reverse.join(' ')\n# # p name_reverse.tr(original,new_letters)\n\n\n\nend",
"def advance(string)\n\n vowels_str = 'aeioua'\n vowels_arr = vowels_str.split('')\n consonants_str = 'bcdfghjklmnpqrstvwxyzb'\n consonants_arr = consonants_str.split('')\n \n string0 = string.downcase.split[1] + \" \" + string.downcase.split[0]\n str1 = string0.split('')\n\n str_new = str1.map do |char|\n if vowels_arr.include?(char)\n vowels_arr.rotate(1)[vowels_arr.index(char)]\n elsif consonants_arr.include?(char)\n consonants_arr.rotate(1)[consonants_arr.index(char)]\n else\n char\n end\n end\n\n newname = str_new.join #joining the array into a string\n spyname = newname.split.map(&:capitalize).join(' ') #splitting that string to capitalize the first letter, then rejoining\n p spyname\n realname = string.split.map(&:capitalize).join(' ')\n $codenames << [spyname, realname]\nend",
"def alias_generator(name)\n name_ord_reversed = name.split(' ').reverse\n name_ord_reversed = name_ord_reversed.join(\" \")\n name_ord_reversed = name_ord_reversed.split('')\n p name_ord_reversed\n vowels = \"aeiou\"\n vowels_array = vowels.split('')\n p vowels_array\n consonants = \"bcdfghjklmnpqrstvwxyz\"\n consonants_array = consonants.split('')\n p consonants_array\n index = 0 \n until index >= name.length do\n new_alias = []\n letter = name_ord_reversed[index]\n if letter == \" \"\n new_alias << letter\n elsif vowels.include? letter\n new_letter = vowels[index+1]\n new_alias << new_letter\n elsif consonants.include? letter\n new_letter = consonants[index+1]\n new_alias << new_letter\n end \n index += 1 \n end \n \n \n \n\n \nend",
"def next_consonants(vowel_name)\r\n\tconsonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']\r\n\tvowel_name = vowel_name.split('')\r\n\tconsonant_name = vowel_name.map do |consonant|\r\n\t if consonants.include?(consonant)\r\n\t consonants.rotate(1)[consonants.index(consonant)]\r\n\t else\r\n\t consonant\r\n\t end\r\n \tend\r\n consonant_name.join\r\nend",
"def aliass(full_name)\n\talphabet = \"bcdfghjklmnpqrstvwxyz\"\n\tvowels = \"aeiou\"\n\tnew_string = \"\"\n\n full_name.split('').each do |letter|\n \t\tif vowels.include?(letter)\n \t\t\tnew_string += vowel(letter)\n \t\telsif alphabet.include?(letter)\n \t\t\tnew_string += consonant(letter)\n \t\telse\n \t\t\tnew_string += letter\n \t\tend\nend\n#Transform this new string into an array\n#Swap first and second word in array\n#Turn new word into string\n#Create empty array outside of loop\nnew_word = new_string.split(' ')\n new_word.reverse!\n\nnew_word.map {|names| names.capitalize!}\nnew_string = new_word.join(\" \")\nend",
"def next_vowel_consonant(str) \r\n #create an array with only vowels or consonants\r\n\tvowels = [\"a\",\"e\",\"i\",\"o\",\"u\",\"a\"]\r\n\tconsonants = (\"a\"..\"z\").to_a\r\n consonants.reject! { |letter| vowels.include?(letter)}\r\n consonants << \"b\" #for looping back to b when z is the letter\r\n\t\r\n\t#convert input into an array of each letter\r\n\tname_array = str.split(\"\")\r\n\t\r\n\t#iterate through each letter\r\n\tname_array.each_with_index do |letter,index|\r\n\t \r\n\t #if it is a vowel, find and replace with next\r\n\t if vowels.include?(letter)\r\n\t vowel_index = vowels.index(letter) + 1\r\n\t str[index] = vowels[vowel_index]\r\n\t \r\n \t #if it is a consonant, find and replace with next\r\n\t elsif consonants.include?(letter)\r\n\t \tc_index = consonants.index(letter) + 1\r\n\t str[index] = consonants[c_index]\r\n\t end\r\n\tend\r\n\tstr\r\nend",
"def name_muddler (array)\nvowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\nconsonants = \"bcdfghjklmnpqrstvwxyz\"\nconsonant_array = consonants.chars \nnew_name = []\nindex = 0\nwhile index < array.length\n if array[index] == \"u\"\n new_name[index] = \"a\"\n elsif vowels.include?(array[index])\n new_name[index] = vowels[vowels.index(array[index]).next]\n elsif array[index] == \"z\"\n new_name[index] = \"b\"\n else new_name[index] = consonant_array[consonant_array.index(array[index]).next]\n end\n index += 1\nend \nreturn new_name\nend",
"def alias\n puts \"Hello Agent, what is your name?\"\n original_name = gets.chomp.downcase\n\n# split first and last name into two arrays\n#swap first name and last name \n\n split_name = original_name.split\n reverse_name = split_name.reverse!\n \n #join back together in a string with a space\n new_name = reverse_name.join(\" \")\n \n\n# each character into it's own array\n\n letters = new_name.each_char.to_a\n#vowel logic\n#if a charcters = vowel then change to next vowel\n\n\n\n vowels = %w(a e i o u a)\n consonant = %w(b c d f g h j k l m n p q r s t v w x y z b)\n new_alias = letters.map do |letter|\n letter.next \n end\nputs new_alias.join('')\nend",
"def alias_genrator\n done = false\n real_names = []\n spy_names = []\n\n puts \"Welcome to the super secret alias name generator. What is your full name?\"\n real_name = gets.chomp.downcase\n\n until done\n done = false\n\n real_name_array = real_name.split(' ') # Turn name into array\n\n real_first_name = real_name_array[0].capitalize # Gets and capitalizes first string in real_first_name\n real_last_name = real_name_array.last.capitalize # Gets and capitalizes last string in real_first_name\n\n real_names << real_first_name + \" \" + real_last_name # Stores real name to an array\n\n name_letters = real_name.split('') # Turns user input into array of letters\n\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n consonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\" ]\n\n index = 0\n name_letters.each do |letter| # Checks each letter in name_letters to see if the letter is in the vowels array\n if letter == \"u\"\n name_letters[index] = \"a\"\n elsif\n if vowels.include?(letter) # If it is, store the index of the vowel plus one\n vowel_index = vowels.index(letter)+1\n name_letters[index] = vowels[vowel_index] # Store the new letter in the corresponding index of name_letters\n end\n end\n index+=1\n end\n\n index = 0\n name_letters.each do |letter| # Checks each letter in name_letters to see if the letter is in the consonants array\n if letter == \"z\"\n name_letters[index] = \"b\"\n elsif\n if consonants.include?(letter) # If it is, store the index of the consonants plus one\n consonant_index = consonants.index(letter)+1\n name_letters[index] = consonants[consonant_index] # Store the new letter in the corresponding index of name_letters\n end\n end\n index+=1\n end\n\n new_full_name = name_letters.join('').split(' ') # Joins the new letters of name_letters and splits it into two strings\n\n # In case spy's real name includes a middle name\n first_name = new_full_name[0].capitalize # Gets and capitalizes first string in new_full_name\n last_name = new_full_name.last.capitalize # Gets and capitalizes last string in new_full_name\n\n alias_name = last_name + \" \" + first_name\n\n spy_names << alias_name # Stores alias into an array\n\n p \"Great, your cool new alias is #{alias_name}! Enter another name or type 'done' to exit.\"\n answer = gets.chomp.downcase\n\n if answer == \"done\" # Checks if user is done\n done = true\n else\n real_name = answer\n end\n end\n\n num_of_spies = real_names.length # Gets the number of spies\n counter = 0\n\n while counter < num_of_spies\n p \"#{spy_names[counter]} is really #{real_names[counter]}\" # Prints spies real names and aliases\n counter+=1\n end\nend",
"def letter_change(letter)\nvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\nconsonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z' ]\n if vowels.include?(letter) #conditional to check if the letter is in the vowels array above\n vowels.rotate[vowels.index(letter)] #within the vowels array.rotate over by one[the index of the letter in the vowels array]\n elsif consonants.include?(letter) #conditional to check if the letter is in the consonant array defined above\n consonants.rotate[consonants.index(letter)] #because this has met the above condition, we know that the char exists in the array. we are asking for the index of the letter in the consonants array and from there are rotate to the next by one. This movement is being saved into the new name_new array.\n elsif letter == \"z\" #edge case\n letter == \"b\"\n elsif letter == \"u\" #edge case\n letter == \"a\" \n elsif letter == \" \" #edge case\n letter = \" \" \n end\nend",
"def fake_name(name)\n\n name_array = name.split('')\n\n name_array.map! do |letter|\n vowels = ['a','e','i','o','u', 'a']\n i = 0\n until i>vowels.length\n if i == 5\n letter = letter.next\n if vowels.include?(letter.downcase)\n letter = letter.next\n end\n break\n elsif letter.downcase == vowels[i]\n letter = vowels[i+1]\n break\n elsif letter.downcase == \" \"\n break\n else\n i += 1 \n end \n end\n letter\n end\n\n p name_array \n\n final_name = name_array.join.split(' ')\n\n final_name.map! do |letter|\n letter.capitalize\n end\n\n final_name2 = final_name.rotate.join(' ')\n\n return final_name2\n\nend",
"def spy_name(str)\n #CREATE VARIABLES FOR VOWELS AND CONSONANTS\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n consonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n #CHANGE STRING FIRST INTO ARRAY THAT MAKES EACH WORD A VALUE THEN REVERSE THEM. \n #THEN TURN ARRAY BACK INTO STRING AND DOWNCASE ANY LETTER.\n #THEN TURN STRING BACK INTO ARRAY THAT TAKES EACH INDIVIDUAL CHARACATER AS A VALUE.\n str = str.split(' ').reverse.join.downcase\n str = str.split('')\n #CREATE TEMPORARY VARIABLE STR_NEW TO EQUEL STR THEN CHANGE BUMP EACH \n #VOWEL AND CONSONANT TO THE NEXT ONE IN LINE. \n str_new = str.map do |char|\n if vowels.include?(char)\n vowels.rotate(1)[vowels.index(char)]\n elsif consonants.include?(char)\n consonants.rotate(1)[consonants.index(char)]\n else\n char\n end\n end\n #TURN ARRAY BACK INTO STRING.\n str_new.join\nend",
"def change_name(name)\r\n\t#store new name in new variable, downcase, split in an array and reverse order\r\n\tnew_name = name.downcase.split(' ').reverse.join(' ')\r\n\t#return the array of all the letters\r\n\t#p new_name\r\n\t#puts new_name.length\r\n\t#p new_name\r\n\talias_and_real_name = []\r\n\tindex = 0\r\n\tvowel_list = \"aeiou\"\r\n\tconsonant_list = \"bcdfghjklmnpqrstvwxyz\"\r\n\twhile index < new_name.length\r\n\t\t#[index] takes and integer and retunrs char, .index takes a char\r\n\t\t#and returns integer**\r\n\t\t#Does the letter at the # index of new_name match the vowel_list string\r\n\t\tif vowel_list.include?(new_name[index])\r\n\t\t\t#next_vowel_index is a #\r\n\t\t\t#it equals the vowel string at the letter index \r\n\t\t\t#from new_name's # index\r\n\t\t\t#Then get the next number\r\n\t\t\tnext_vowel_index = vowel_list.index(new_name[index]).next\r\n\t\t\t#new_name at that index # now equal this new # \r\n\t\t\t#Equals the vowel list at index of the next #\r\n\t\t\tnew_name[index] = vowel_list[next_vowel_index]\r\n\t\t\t\t#Solve for edge cases\r\n\t\t\t\t#If the letter is the name is going to be the last letter \r\n\t\t\t\t#in the vowel string, change it automatically to \r\n\t\t\t\t#the first on\r\n\t\t\r\n\t\t\t\r\n\t\telsif consonant_list.include?(new_name[index])\r\n\t\t\tnext_consonant_index = consonant_list.index(new_name[index]).next\r\n\t\t\tnew_name[index] = consonant_list[next_consonant_index]\r\n\r\n\t\tend #End if statement\r\n\t\t#Incriment outside of if statment but inside while loop\r\n\t\tindex += 1\r\n\t\r\n\tend #End While loop\r\n\r\n\t#return the new alias name\r\n\tnew_name\r\n\t\r\n\t#Take the alias name and stoe it in an array, new name first and real \r\n\t#name second\r\n\talias_and_real_name << new_name << name\r\n\t\r\n#End method\t\t\r\nend",
"def name_swapper(full_name)\n full_name = full_name.downcase\n vowel_array = ['a','e','i','o','u']\n consenant_array = \"bcdfghjklmnpqrstvwxyz\".split('')\n name_array = full_name.split(\" \")\n reversed_name= \"#{name_array[1]} #{name_array[0]}\"\n secret_name = reversed_name.split('').map! do |letter|\n if vowel_array.include?(letter)\n vowel_array[vowel_array.index(letter)+1]\n elsif consenant_array.include?(letter)\n consenant_array[consenant_array.index(letter)+1]\n elsif letter == \" \"\n \" \"\n end\n\n end\n puts \"Your name USED to be #{full_name.upcase}...but now your name is #{secret_name.join.upcase}!\"\n secret_name.join.upcase\nend",
"def namecoder\n valid_input = false\n until valid_input\n secret_name_database = []\n \n puts \"Whats your first name?\"\n fname = gets.chomp.downcase.split('')\n puts \"What's your last name?\"\n lname = gets.chomp.downcase.split('')\n original_name = [fname,\" \", lname].join\n fullname = [fname,\" \", lname].reverse.flatten\n # p fullname\n \n fullalphabet = \"abcdefghijklmnopqrstuvwxyz\"\n consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']\n alpha = ['a', 'b', 'c', 'd', 'e', 'u', 'z']\n vowels = ['a', 'e', 'i', 'o', 'u']\n \n # vowel_code(original_name)\n vowels = ['a', 'e', 'i', 'o', 'u']\n fn_vowel = fullname.map do |vowel|\n if vowels.include?(vowel)\n vowels.rotate(1)[vowels.index(vowel)]\n else\n vowel\n end\n end\n # p fn_vowel \n # name_vowels_changed.join\n \n # def cons_code(name_vowels_changed)\n # name_vowels_changed = name_vowels_changed.split('')\n name_both_changed = fn_vowel.map do |cons|\n if consonants.include?(cons)\n consonants.rotate(1)[consonants.index(cons)]\n else\n cons\n end\n end\n # p name_both_changed\n secret_name = name_both_changed.join\n orig_fullname = fullname.join.capitalize\n secret_name_database << [original_name, secret_name]\n p original_name\n p secret_name\n \n puts \"Press enter if you'd like to do another name. Otherwise, type 'quit'.\"\n continue = gets.chomp\n if continue == \"quit\"\n puts \"Thank you for using the program. Here is your list of names:\"\n secret_name_database.each do |orig, secret|\n puts \"#{orig}'s secret name is #{secret}.\"\n end \n valid_input = true\n else\n puts \"Time to add another name...\"\n end \n end\nend",
"def aliass(full_name)\n alphabet = \"bcdfghjklmnpqrstvwxyz\"\n vowels = \"aeiou\"\n new_string = \"\"\n \n #break input word into array and iterate through each letter\n #if the letter is a vowel, take it and change it to next_vowel\n #if the letter is a consonant, take it and change it to consonant\n #else just add with no modification\n full_name.split('').each do |letter|\n if vowels.include?(letter)\n new_string += vowel(letter)\n elsif alphabet.include?(letter)\n new_string += consonant(letter)\n else\n new_string += letter\n end\n end\n #transform this new string into an array\n new_word = new_string.split(' ')\n #swap first and second word in array\n new_word.reverse!\n #turn new word into string\n new_word.map {|names| names.capitalize!}\n new_string = new_word.join(\" \")\n end",
"def consonant_swap (secret_name)\n\t\n\tsecret_name.map do |letters|\n\t\t\n\t\tif letters == \" \"\n\t\t\tletters\n\t\telsif letters == \"z\"\n\t\t\tletters.gsub!(/[z]/, \"a\")\n\t\telsif letters =~ /[aeiou]/\n\t\t\tletters\n\t\telse \n\t\t\tletters.next!\n\t\t\tif letters =~ /[aeiou]/\n\t\t\t\tletters.next!\n\t\t\tend\n\t\tend\n\n\tend\n\tsecret_name\nend",
"def letter_swap(agent_name)\n vowels = \"aeiou\"\n consonants = \"bcdfghjklmnpqrstvwxyz\"\n letter_swap = agent_name.split(\"\")\n secret_name = []\n letter_swap.map! do |ltr|\n if vowels.include?(ltr)\n secret_name << vowels[vowels.index(ltr)+1]\n elsif consonants.include?(ltr)\n secret_name << consonants [consonants.index(ltr)+1]\n else\n puts \" \"\n end\n end\n\n secret_name.join(\"\").split.map {|ltr| ltr.capitalize}.join(' ').capitalize\n\nend",
"def vowel_swap (secret_name)\n\t#first separate string into an array of characters\n\t#the loop through looking for vowels\n\t#use each do loop to then go through each character\n\t#check to see if it is a vowel using gsub and replace with the next vowel\n\t#have to replace with an uppercase vowel, so when a becomes 'e' and then I check for 'e's, those 'a's don't become 'i's and etc\n\tsecret_name = secret_name.split('')\n\tsecret_name.each do |letters|\n\t\tletters.gsub!(/[a]/, \"E\")\n\t\tletters.gsub!(/[e]/, \"I\")\n\t\tletters.gsub!(/[i]/, \"O\")\n\t\tletters.gsub!(/[o]/, \"U\")\n\t\tletters.gsub!(/[u]/, \"A\")\n\tend\n\t#then downcase eveything\n\tsecret_name.map!{|letter| letter.downcase}\n\t\nend",
"def scramble\n\tconsonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z', 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z']\n\tvowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']\n\n\tputs \"What name would you like to use?\"\n# Get name and return a string\n\t\tspy_name = gets.chomp.to_str\n# Turn into an array to swap name places\n\t\trotate_name = spy_name.split(' ').rotate!\n\t\tp rotate_name\n# Change all of the vowels\n\t\tscramble_name = rotate_name.join(' ')\n\t\tnew_spy_name = scramble_name.split(' ')\n\t\tvowels.each do |vowel|\n\t\t\tnew_spy_name << vowel.next\n\t\tend\nend",
"def vowel_converter(string)\r\n\tname_array = string.split('')\r\n vowel = ['a', 'e', 'i', 'o', 'u']\r\n counter = 0\r\n vowel_counter = 0\r\n# Outer loop that loops through entire name (first and last)\r\n while counter < name_array.length\r\n# Inner loop that loops through list of vowels, compares them with name, and changes vowels in name\r\n \twhile vowel_counter < vowel.length\r\n \t\tif name_array[counter] == vowel[vowel_counter]\r\n if name_array[counter] == 'u'\r\n \tname_array[counter] = 'a'\r\n break\r\n else\t\r\n \t\t name_array[counter] = vowel[vowel_counter + 1]\r\n \t\t break\r\n \t\t end\r\n \t end\r\n vowel_counter += 1\r\n end\r\n counter += 1\r\n vowel_counter = 0\r\n end \r\n return name_array\r\nend",
"def next_letter (name)\n vowels = \"aeiou\".split('')\nalphabet = ('a'..'z').to_a\nconsonants = alphabet - vowels\nname_array = name.split('')\nname_array.map! { |letter|\n if letter == \"u\"\n \"a\"\n elsif letter == \"z\"\n \"b\"\n elsif consonants.include? letter\n consonants[consonants.index(letter) + 1]\n elsif vowels.include? letter\n vowels[vowels.index(letter) + 1]\n else\n letter\n end\n}\nname_array.join('')\nend",
"def next_letter(reversed_name)\n vowels = 'aeioua'\n consonants = 'bcdfghjklmnpqrstvwxy'\n #reversed name to array\n reversed_name_array = reversed_name.split('')\n #check if letter is vowel if so make it next vowel\n #check if letter is consonant if so make it next consonant\n reversed_name_array.map! { |letter|\n if vowels.index(letter) != nil\n new_vowel = vowels.index(letter) + 1\n letter = vowels[new_vowel]\n elsif consonants.index(letter) != nil\n new_consonant = consonants.index(letter) + 1\n letter = consonants[new_consonant]\n else\n letter = letter\n end\n }\n reversed_name_array_joined = reversed_name_array.join\nend",
"def change_name(name)\n # swapes names\n name = name.split(' ').reverse.join(' ')\n\n #change all consonant's\n name = name.downcase.split('').map do |l|\n if l.match(/[a,e,i,o,u,\\s]/)\n l = l\n #account for edge case\n elsif l == \"z\"\n l = \"b\"\n else\n l = l.next\n #fixes consonant's that changed into vowels\n if l.match(/[a,e,i,o,u]/)\n l.next\n else\n l = l\n end\n end\n end\n#Loop through vowles\n for i in 0..name.length()-1\n case name[i]\n when \"a\"\n name[i] = \"e\"\n when \"e\"\n name[i] = \"i\"\n when \"i\"\n name[i] = \"o\"\n when \"o\"\n name[i] = \"u\"\n when \"u\"\n name[i] = \"a\"\n end\n end\nname = name.join()\nname = name.split.map(&:capitalize).join(' ')\nputs name\nname\nend",
"def spy_name(real_name) ####Still in progress...######\nnew_name = real_name.downcase\nadjust = new_name.split(' ')\nfirst_n = adjust[0].split('')\nlast_n = adjust[1].split('')\n\n\tindex = 0\n\tuntil index == first_n.last\n\tvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n\t\t\tif first_n[index] == [\"a\", \"e\", \"i\", \"o\"]\n\t\t\t\tfirst_n[index] = vowels.next\n\t\t\telsif first_n[index] == \"u\"\n\t\t\t\tfirst_n[index] = \"a\"\n\t\t\telsif first_n[index] == \"z\"\n\t\t\t\tfirst_n[index] = \"b\"\n\t\t\telse first_n[index].next\n\t\t\t\tfirst_n[index] = first_n[index].next\n\t\tend\n\t\tindex += 1\n\tend\n#don't forget to return the method\n\tindex = 0\n\tuntil index == last_n.last\n\tvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n\t\t\tif last_n[index] == [\"a\", \"e\", \"i\", \"o\"]\n\t\t\t\tlast_n[index] = vowels.next\n\t\t\telsif last_n[index] == \"u\"\n\t\t\t\tlast_n[index] = \"a\"\n\t\t\telsif last_n[index] == \"z\"\n\t\t\t\tlast_n[index] = \"b\"\n\t\t\telse last_n[index].next\n\t\t\t\tlast_n[index] = last_n[index].next\n\t\tend\n\t\tindex += 1\n\tend\n\n\nend",
"def spy_alias1 full_name\n alias_name = full_name.downcase.split(' ').reverse!.join(' ').split(//)\n vowels=['a','e','i','o','u']\n alias_name.map! do |letter|\n next_vowel=letter\n vowels.each_index do |index|\n if vowels[index]=='u'&&letter==vowels[index]\n next_vowel='a'\n elsif letter==vowels[index]\n next_vowel=vowels[index+1]\n end\n end\n next_vowel\n end\n \n consonants=['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']\n alias_name.map! do |letter|\n next_consonant=letter\n consonants.each_index do |index|\n if consonants[index]=='z'&&letter==consonants[index]\n next_consonant='b'\n elsif letter==consonants[index]\n next_consonant=consonants[index+1]\n end\n end\n next_consonant\n end\n \n alias_name=alias_name.join('').split(' ').map! {|name| name.capitalize}.join(' ')\nend",
"def vowel_changer(name)\n vowel_guide = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n name.each do |names|\n name = names.split('')\n name\n name.map! do |char|\n index = 0\n while index < vowel_guide.length\n if char == vowel_guide[index]\n char = vowel_guide[index += 1]\n index += 1\n elsif char == \"u\"\n char = \"a\"\n index += 1\n else\n char\n index += 1\n end\n\n end\n char\n end\n name\n end\n name\nend",
"def translate(word)\r\n vowels = \"aeio\".split('').to_a\r\n consonant = \"bcdfghjklmnpqrstuvwxyz\".split('').to_a \r\n answer = []\r\n \r\n while word.split(' ').length == 1 \r\n words = word.split('')\r\n until vowels.include?(words[0])\r\n words = words.rotate(1)\r\n end\r\n words << \"ay\"\r\n return words.join('')\r\n end # one word ^^\r\n \r\n if word.split(' ').length > 1 \r\n words = word.split(' ')\r\n end \r\n words.each do |i|\r\n if vowels.include?(i[0])\r\n i << \"ay\"\r\n answer << i\r\n #return answer\r\n end\r\n end\r\n \r\n words.each do |j|\r\n if consonant.include?(j[0])\r\n j = j.split('').rotate(1).join('') until vowels.include?(j[0])\r\n j = j + \"ay\"\r\n #return j\r\n #j << j #correct format for 1 consonant but it doesnt add to array\r\n answer << j\r\n end\r\n end\r\n \r\n return answer.join(' ')\r\n end",
"def next_vowel(last_first)\n last_first.map! do |word|\n word.gsub(/[aeiou]/, 'a' => 'e', 'e' => 'i', 'i' => 'o', 'o' => 'u', 'u' => 'a')\n end\nend",
"def letter_change\n consonant = \"bcdfghjklmnpqrstvwxyz\"\n vowel = \"aeiou\"\n new_name = \"\"\n letter_new = \"\"\n\n split_flip_name.each do |letter|\n if consonant.index(letter) != nil\n letter_new = consonant[consonant.index(letter) + 1]\n elsif vowel.index(letter) != nil\n #addresses last vowel edge case\n if letter == \"u\"\n letter_new = \"a\"\n elsif\n letter_new = vowel[vowel.index(letter) + 1]\n end\n elsif letter == \" \"\n letter_new = letter\n end\n #.to_s addresses a nil edge case\n new_name += letter_new.to_s\n end\n p new_name\n\nend",
"def vowel_converter(swapped_name)\r\n\t# Forces all letters to be lower case in order for code to work properly\r\n\tcode_name = swapped_name.downcase.chars\r\n\tvowels = %w{a e i o u}\r\n\tcode_name.map! do |letter|\r\n\t\t# Edge case fix to make code work as intended\r\n\t\tif letter == \"u\"\r\n\t\t\tletter = \"a\"\r\n\t\telsif vowels.include?(letter)\r\n\t\t\tvowels[vowels.index(letter) + 1]\r\n\t\telse\r\n\t\t\tletter\r\n\t\tend\r\n\tend\r\n\t# This re-capitalizes the first letter of each part of the name\r\n\tcode_name.join('').split.map(&:capitalize).join(' ')\r\nend",
"def alias_creator(name)\n name.downcase!\n name_array = name.split(' ')\n name_array.reverse!\n # insert method for changing vowels here\n post_vowels = next_vowel(name_array)\n # insert method for changing consonants here#\n new_name = next_consonant(post_vowels)\n # re-capitalize the first letter of each name\n new_name.map! {|word| word.capitalize}\n # take our array and turn it into a string\n puts \"Your automatically generated alias is:\"\n p new_name * \" \"\nend",
"def fake_name (full_name)\n words_array = full_name.split (\" \")\n swap_name_array = words_array.reverse\n swap_name = swap_name_array.join(\" \")\n letters = swap_name.chars\n fake_letters = []\n letters.each do |letter|\n vowel = %w[a A e E i I o O u U]\n if vowel.include?(letter)\n fake_letters << next_vowel(letter)\n elsif letter == \" \"\n fake_letters << \" \"\n else\n fake_letters << next_unvowel(letter)\n end\nend\n return fake_letters.join (\"\")\nend",
"def vowel_switch\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"A\", \"E\", \"I\", \"O\", \"U\"]\n @split_name.map! do |char|\n if vowels.include?(char)\n char = vowels[vowels.index(char)+1]\n else\n char = char.next\n end\nend\np @split_name\nend",
"def name_change(normal_name)\nvowels = \"aeiouAEIOU\".split(\"\")\nconsonants = \"bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ\".split(\"\")\n\nchanged_name = normal_name.split(\" \")\nchanged_name[0], changed_name[1] = changed_name[1], changed_name[0]\n split_name = changed_name.join(\" \")\nname = split_name.split(\"\")\n\nnew_name = \"\"\nname.each_with_index do |letter, letter_index|\n if vowels.include?(letter)\n vowels.each_with_index do |vowel, vowel_index|\n if letter === vowel\n if letter === \"u\"\n new_name << \"a\"\n elsif letter === \"U\"\n new_name << \"A\"\n else\n new_name << vowels[vowel_index+1]\n end\n end\n end\nend\n if consonants.include?(letter)\n consonants.each_with_index do |consonant, consonant_index|\n if letter === consonant\n if letter === \"z\"\n new_name << \"b\"\n elsif letter === \"Z\"\n new_name << \"B\"\n else\n new_name << consonants[consonant_index+1]\n end\n end\n end\nend\n if letter === \" \"\n new_name << \" \"\n end\n end\n new_name\nend",
"def fake_name(letters)\r\n\tvowel_arr = ['a', 'e', 'i', 'o', 'u']\r\n\tletters.map! do |letter|\r\n\t\tif vowel_arr.include?(letter.downcase)\r\n\t\t\tif letter.upcase! == nil\r\n\t\t\t\t\tif letter.downcase == vowel_arr[4]\r\n\t\t\t\t\t\tletter = vowel_arr[0].upcase\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tnumber = vowel_arr.index(letter.downcase)\r\n\t\t\t\t\t\tnumber = number + 1\r\n\t\t\t\t\t\tletter = vowel_arr[number].upcase\r\n\t\t\t\t\tend\r\n\t\t\telse\r\n\t\t\t\tnumber = vowel_arr.index(letter.downcase)\r\n\t\t\t\t\tif number == 4\r\n\t\t\t\t\t\tletter = vowel_arr[0]\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tnumber = number + 1\r\n\t\t\t\t\t\tletter = vowel_arr[number]\r\n\t\t\t\t\tend\r\n\t\t\tend\r\n\t\telsif \"abcdefghijklmnopqrstuvwxyz\".include?(letter.downcase) == false\r\n\t\t\tletter = letter\r\n\t\telse \r\n\t\t\t\tif letter.downcase == 'z'\r\n\t\t\t\t\tletter = (letter.chr.ord - 24). chr\r\n\t\t\t\telsif vowel_arr.include?(letter.next.downcase) == false\r\n\t\t\t\t\tletter = letter.next\r\n\t\t\t\telse\r\n\t\t\t\t\tletter = letter.next.next\r\n\t\t\t\tend\r\n\t\tend\r\n\tend\r\nletters.join(\"\")\r\nend",
"def make_fake_name(name)\n # downcase to avoid issues due to capitalization\n # convert name to an array of characters\n # for each letter,\n name = name.downcase.chars.map! do |letter|\n # if it is a vowel, change it to the next vowel\n if 'aeiou'.include?(letter)\n next_vowel(letter)\n # elsif it is a letter, change it to the next consonant\n elsif ('a'..'z').include?(letter)\n next_consonant(letter)\n # otherwise, nil it\n end\n end\n # convert name back to a string and re-capitalize it\n name = name.join.capitalize\nend",
"def aliass(full_name)\n\talphabet = \"bcdfghjklmnpqrstvwxyz\"\n\tvowels = \"aeiou\"\n\tnew_string = \"\"\n\n\t#break input word into array and iterate through each letter\n\t#if the letter is a vowel, take it and change it to next_vowel\n\t#if the letter is a consonant, take it and change it to consonant\n\t#else just add with no modification\n\tfull_name.split('').each do |letter|\n\t\tif vowels.include?(letter)\n\t\t\tnew_string += vowel(letter)\n\t\telsif alphabet.include?(letter)\n\t\t\tnew_string += consonant(letter)\n\t\telse\n\t\t\tnew_string += letter\n\t\tend\n\tend\n\t#transform this new string into an array\n\tnew_word = new_string.split(' ')\n\t#swap first and second word in array\n\tnew_word.reverse!\n\t#turn new word into string\n\tnew_word.map {|names| names.capitalize!}\n\tnew_string = new_word.join(\" \")\nend",
"def aliasMaker(name)\r\n\tnewName = []\r\n\tnewName2 = []\r\n\tvowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\r\n\tconsonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\r\n\tstep1 = name.split(\" \")\r\n\ti = 0\r\n\tj = 0\r\n\r\n\twhile i <= step1.length\r\n\t\tnewName.push(step1[i])\r\n\t\ti += 1\r\n\tend\r\n\tnewName = newName.reverse\r\n\tnewName = newName.join(\" \")\r\n\tstep2 = newName\r\n\twhile j <= step2.length\r\n\t\tif isConsonant(step2[j]) == true\r\n\t\t\tnewName2.push(nextConsonant(step2[j]))\r\n\t\telsif isVowel(step2[j]) == true\r\n\t\t\tnewName2.push(nextVowel(step2[j]))\r\n\t\telse newName2.push(step2[j])\r\n\t\tend\r\n\t\tj += 1\r\n\tend\r\n\tanswer = newName2.join(\"\")\r\n\r\nend",
"def consonant_converter(string)\r\n name_array = string\r\n consonant = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']\r\n counter = 0\r\n consonant_counter = 0\r\n# Outer loop that loops through entire name (first and last)\r\n while counter < name_array.length\r\n# Inner loop that loops through list of consonants, compares them with name, and changes consonants in name\r\n \twhile consonant_counter < consonant.length\r\n \t\tif name_array[counter] == consonant[consonant_counter]\r\n if name_array[counter] == 'z'\r\n \tname_array[counter] = 'b'\r\n break\r\n else\t\r\n \t\t name_array[counter] = consonant[consonant_counter + 1]\r\n \t\t break\r\n \t\t end\r\n \t end\r\n consonant_counter += 1\r\n end\r\n counter += 1\r\n consonant_counter = 0\r\n end \r\n new_name = name_array.join('')\r\n new_name = new_name.split(' ')\r\n new_name.map! { |word| word.capitalize! }\r\n new_name = new_name.join(' ')\r\n return new_name\r\nend",
"def make_vowel_change(first)\n\tnew_first = first.split(\"\") \n\ti = 0\n\tfake_firstname = \"\"\n\tlengthfirst = first.length\n\twhile i < lengthfirst\n\tif new_first[i] == \"a\"\n\t\tfake_firstname += \"e\"\n\telsif new_first[i] == \"e\"\n\t\tfake_firstname += \"i\"\n\telsif new_first[i] == \"i\"\n\t\tfake_firstname += \"o\"\n\telsif new_first[i] == \"o\"\n\t\tfake_firstname += \"u\"\n\telsif new_first[i] == \"u\"\n\t\tfake_firstname == \"a\"\n\telsif (new_first[i] != \"a\" || new_first[i] !=\"e\" || new_first[i] != \"i\" || new_first[i] != \"o\" || new_first[i] != \"u\")\n\t\tfake_firstname += new_first[i]\n\tend\n\ti+=1 \n\tend \n\tfake_firstname\nend",
"def name_rotate(name)\r\n consonants = %w[b c d f g h j k l m n p q r s t v w x y z]\r\n vowels = ['a', 'e', 'i', 'o', 'u']\r\n \r\n name = name.downcase.split('')\r\n \r\n name_rotate = name.map { |char|\r\n if vowels.include?(char)\r\n vowels.rotate(1)[vowels.index(char)]\r\n elsif consonants.include?(char)\r\n consonants.rotate(1)[consonants.index(char)]\r\n else\r\n char\r\n end\r\n }\r\n \r\n name_rotate.join.split(' ').reverse.map { |x| x.capitalize }.join(' ')\r\nend",
"def next_vowel(name)\n\tvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n\tindex = 0\n\tname = name.split('') # string to array\n\tname_change1 = name.map do |letter| \n\t\tif vowels.include? letter \n\t\t\tvowels.rotate(1)[vowels.index(letter)]\n\t\telse\n\t\t\tletter\n\t\tend\n\tend\n\tname_change1.join # new array convert back to string\nend",
"def swapping_vowels(vowel_char)\n vowels = { 'a' => 'e', 'e' => 'i', 'i' => 'o', 'o' => 'u', 'u' => 'a' }\n\n# We take our arguement and run the iteration and create our if/els/els statement.\n# we use .map to store the next change of our letter and if the vowels are included printer the letter of the vowels otherwise print them downcase and switch them to uppercase.\n vowel_char.map! do |letter|\n if vowels.include?(letter)\n vowels[letter]\n elsif vowels.include?(letter.downcase)\n vowels[letter.downcase].upcase\n else\n letter\n end\n end\nend",
"def create_alias(word)\n vowels_lower = ['a','e','i','o','u']\n vowels_upper = vowels_lower.map(&:upcase)\n consonants_lower = ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']\n consonants_upper = consonants_lower.map(&:upcase)\n \nupdated_vowels = word.map do |char|\n case\n when vowels_lower.include?(char)\n vowels_lower.rotate(1)[vowels_lower.index(char)]\n when vowels_upper.include?(char)\n vowels_upper.rotate(1)[vowels_upper.index(char)]\n when consonants_lower.include?(char)\n consonants_lower.rotate(1)[consonants_lower.index(char)]\n when consonants_upper.include?(char)\n consonants_upper.rotate(1)[consonants_upper.index(char)]\n else (char)\nend\nend\nend",
"def make_vowel_change_2(last)\n\tnew_last = last.split(\"\") \n\ti = 0\n\tfake_lastname = \"\"\n\tlengthlast = last.length\n\twhile i < lengthlast\n\tif new_last[i] == \"a\"\n\t\tfake_lastname += \"e\"\n\telsif new_last[i] == \"e\"\n\t\tfake_lastname += \"i\"\n\telsif new_last[i] == \"i\"\n\t\tfake_lastname += \"o\"\n\telsif new_last[i] == \"o\"\n\t\tfake_lastname += \"u\"\n\telsif new_last[i] == \"u\"\n\t\tfake_lastname == \"a\"\n\telsif (new_last[i] != \"a\" || new_last[i] !=\"e\" || new_last[i] != \"i\" || new_last[i] != \"o\" || new_last[i] != \"u\")\n\t\tfake_lastname += new_last[i]\n\tend\n\ti+=1 \n\tend \n\tfake_lastname\nend",
"def alias_creator(nickname)\nvowels=\"aeiou\"\nconsonants=\"bcdfghjklmnpqrstvwxyz\"\n#consonants exclude all vowels\n\nnickname_split=nickname.split(\"\")\nnew_nickname=[]\n#The translated nickname will be saved in the new_nickname arrawy\n\nnickname_split.map! do |x|\n\tif vowels.include?(x)\n\t\tnew_nickname << vowels[vowels.index(x)+1]\n\telsif consonants.include?(x)\n\t\tnew_nickname << consonants[consonants.index(x)+1]\n\telsif x == \" \"\n\t\tnew_nickname << \" \"\n\tend\nend\nnew_nickname.join(\"\").split.map {|x| x.capitalize}.join(\" \")\n#We are doing this so that we capitalize the first letter of both words\nend",
"def vowel_consonant_adv(str)\r\n \t\tvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\r\n \t\tstr = str.split('')\r\n \t\tstr_new = str.map do |letter|\r\n if vowels.include?(letter)\r\n \tvowels.rotate(1)[vowels.index(letter)]\r\n else\r\n \tletter.next\r\n end\r\n \tend\r\n \t\tstr_new.join\r\n\tend",
"def next_vowel(name)\n\tvowels = %w( a e i o u )\n\tname = name.downcase!.split('')\n\tnew_name = name.map do |vowels_method|\n\t\tif vowels.include?(vowels_method)\n\t\t\tvowels.rotate(1)[vowels.index(vowels_method)]\n\t\telsif vowels == 'u'\n\t\t\tvowels.replace('a')\t\n\t\telse\n\t\t\tvowels_method\n\t\tend\n\tend\n\tnew_name.join.capitalize\nend",
"def next_letter(name)\n vowels = \"aeiou\".split(\"\")\n consonants = \"bcdfghjklmnpqrstvwxyz\".split(\"\")\n spy_name = []\n \n name.split(\"\").map do |letter|\n if vowels.include?(letter)\n vowels.index(letter)\n index = vowels.index(letter)\n new_letter = vowels[index + 1]\n new_letter\n elsif consonants.include?(letter)\n consonants.index(letter)\n index = consonants.index(letter)\n new_letter = consonants[index + 1]\n new_letter\n elsif letter == \" \"\n new_letter = \" \"\n new_letter\n end\n spy_name.push(new_letter)\n end\n \n spy_name.join(\"\")\nend",
"def nextLetter(full_name)\n vowels = 'aeiou'\n split_letters = full_name.split('')\n split_letters.map! { |letter|\n if letter != \" \"\n if vowels.index(letter.downcase) != nil\n letter = nextVowel(letter)\n else\n letter = nextConsonant(letter)\n end\n else\n # Don't know exactly why this has to be here but I lose my spaces if I\n # don't do it.\n letter = letter\n end\n }\n split_letters.join('')\nend",
"def fake_name_c2(real_name)\n\treal_full_name = real_name.split(\" \")\n\treal_first_name = real_full_name[0] \n\treal_last_name = real_full_name[1]\n\ti = 0\n\tfake_first_name = \"\"\n\tfake_last_name = \"\"\n\tvowel_index = \"\"\n\tlength_first = real_first_name.length\n\tlength_last = real_last_name.length \n\t\twhile i < length_last\n\t\tif real_last_name[i] == \"z\"\n\t\t\tfake_last_name += \"a\"\n\t\telsif real_last_name[i] == \"a\" || real_last_name[i] ==\"e\" || \n\t\t\t real_last_name[i] == \"i\" || real_last_name[i] == \"o\" || \n\t\t\t real_last_name[i] == \"u\"\n\t\t\tfake_last_name += real_last_name[i] \n\t\telse \n\t\t\tfake_last_name += real_last_name[i].next \n\t\tend \n\t\ti+=1\n\tend\n\tfake_last_name\nend",
"def translate string\n\n\t#This splits the string into an array of words\n\twords = string.split(\" \")\n\t\n\t#Goes through each word in array words\n\tfor i in 0...words.length\n\n\t\t#This splits each word into an array of characters\n\t\tcharacters = words[i].chars\n\n\t\t#If a word begins with a vowel, add \"ay\" to the end of the word\n\t\tif isVowel characters[0]\n\n\t\t\tcharacters.push(\"a\", \"y\")\n\t\t\twords[i] = characters.join(\"\")\n\n\t\t#If a word does not begin with a vowel...\n\t\telse\n\n\t\t\t#While the first character is not a vowel, move it to the back of the word\n\t\t\twhile !(isVowel characters[0])\n\n\t\t\t\t#If the first character is a \"q,\"\n\t\t\t\tif characters[0] == \"q\"\n\n\t\t\t\t\t#and the next character is a \"u,\" push both the \"qu\" to the end\n\t\t\t\t\tif characters[1] == \"u\"\n\n\t\t\t\t\t\tconsonant = characters.shift\n\t\t\t\t\t\tcharacters.push(consonant)\n\t\t\t\t\t\tu = characters.shift\n\t\t\t\t\t\tcharacters.push(u)\n\n\t\t\t\t\tend\n\n\t\t\t\t#Otherwise, just push the first letter to the end\n\t\t\t\telse\n\n\t\t\t\t\tconsonant = characters.shift\n\t\t\t\t\tcharacters.push(consonant)\n\n\t\t\t\tend\n\n\t\t\tend\n\n\t\t\t#Then add \"ay\" to the end of the word\n\t\t\tcharacters.push(\"a\", \"y\")\n\t\t\twords[i] = characters.join(\"\")\n\n\t\tend\n\t\t\n\tend\n\n\t#Joins together all the words with a space in between them and returns the modified string as an answer\n\tanswer = words.join(\" \")\n\treturn answer\n\nend",
"def fakeName(name)\r\n\tnameLen = name.length\r\n\tnameIndex = 0\r\n\tvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\r\n\tcons = [\"b\", \"c\",\"d\", \"f\",\"g\", \"h\",\"j\", \"k\",\"l\", \"m\",\"n\", \"p\",\"q\", \"r\",\"s\", \"t\",\"v\", \"x\", \"z\",\"w\", \"y\"]\r\n\tnewName = \"\"\r\n\twhile nameIndex < nameLen\r\n\t\tvowelArrayIndex = 0\r\n\t\tvowels.each do |vow|\r\n\t\t\tif name[nameIndex] == vow\r\n\t\t\t\tnextchar = next_vowel(vowelArrayIndex)\r\n\t\t\t\tnewName = newName + nextchar\r\n\t\t\tend\r\n\t\t\tvowelArrayIndex += 1\r\n\t\tend\r\n\t\tvowelArrayIndex = 0\r\n\t\tconsArrayIndex = 0\r\n\t\tcons.each do |cons|\r\n\t\t\tif name[nameIndex] == cons\r\n\t\t\t\tnextchar = next_cons(consArrayIndex)\r\n\t\t\t\tnewName = newName + nextchar\r\n\t\t\tend\r\n\t\t\tconsArrayIndex += 1\r\n\t\tend\r\n\t\tnameIndex += 1\r\n\tend\r\n\treturn newName\r\nend",
"def fake_name(name)\n name = name.split.rotate\n name.map! do |n|\n n.downcase!\n vowels = 'aeiou'\n vowels_shifted = vowels.split('').rotate.join\n consonants = 'bcdfghjklmnpqrstvwxyz'\n consonants_shifted = consonants.split('').rotate.join\n\n n.tr!(vowels, vowels_shifted)\n n.tr!(consonants, consonants_shifted)\n\n n = n.split('')\n n[0] = n[0].upcase\n n = n.join\n end\n name = name.join(' ')\nend",
"def name_handler(name)\n name = name.downcase.chars #takes the input and makes it downcase and breaks it into an array to increment through\n name_new = name.map do |letter| #create a new array called name_new and start block to increment through each array\n letter_change(letter)\n end\n #Code addressing capitalization and swapping first / last\n namearr = name_new.join('').split #join the new_name array back into a string\n p namearr\n first_name = namearr[0] #assign first name to a new variable based on index\n last_name = namearr[1] #assign first name to a new variable based on index\n name_new = last_name.capitalize! + \" \" + first_name.capitalize! #capitalize and swap first for last\nend",
"def alias_creator (str)\n# downcase all characters incase the name had initial caps.\nstr = str.downcase\t\n\n# create vowel string for cross checking each character (I ADDED 3 REPEATING VOWEL SEGMENTS TO PREVENT EDGE CASE FROM BREAKING WHEN ENCODING A VOEWEL AT THE END OF THE STRING LIKE U in \"AEIOU\") \nvowels = \"aeiouaeiouaeiou\"\n# create consonant string for cross checking each character\nconsonants = \"bcdfghjklmnpqrstvwxz\"\n# create empty strings that encoded first and last names will be stored in.\nname_alias = \"\"\n# create empty string to create an encoded full name \nspy_alias = \"\"\n=begin encoding names \n 1.taking the first name string and iterate through each character \n 2. check if vowels string includes current character in first name string\n 3. if it does access the letter in vowels string by its index, increment that index by one\n add that new letter to the alias string. \n 4. if the current character is a consonant it will go through the same process but using the consonants string\n 5. if the current character is a space a space will be added to the encoded string. \n=end\n \n str.each_char do |char| \n \tif char == \" \"\n name_alias+= \" \"\n\n \telsif vowels.include?(char)\n \t\tname_alias += vowels[vowels.index(char).next]\n \n elsif consonants.include?(char)\n \tname_alias += consonants[consonants.index(char).next]\n\n \n\n end \n \t\n end\n # check if the string that was encoded was a full name or just a first or last name\n # if it is a full name. sperate the first and last name and reverse the order (Lastname Firstname)\n \n if name_alias.include?(\" \")\n swap_name = name_alias.split(\" \")\n spy_alias = swap_name[1] + \" \" +swap_name[0]\n else spy_alias = name_alias\n end \n \n \n return spy_alias\n\n\nend",
"def vowel_rotate(str)\n vowels = \"aeiou\"\n arr = []\n copy_str = str.dup \n copy_arr = copy_str.split(\"\")\n str.each_char.with_index do |char, i|\n if vowels.include?(char)\n arr << i\n end\n end\n p arr\n last = arr.last\n first = arr.first\n copy_str[first]= str[last]\n\n (1...arr.length).each do |j|\n copy_str[arr[j]] = str[arr[j - 1]]\n end\n copy_str\n \nend",
"def vowel_adv(str)\r\n str = secret_name(str)\r\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\r\n str = str.split('')\r\n str_new = str.map do |char|\r\n if vowels.include?(char)\r\n vowels.rotate(1)[vowels.index(char)]\r\n else\r\n char\r\n end\r\n end\r\n str_new.join\r\nend",
"def translate(arr)\n vowels = %w{a e i o u y}\n consonants = %w{b c d f g h j k l m n p q r s t v w x y z}\n\n a = arr.split.map do |word| \n if vowels.include?(word[0])\n word + \"ay\"\n elsif word[0..1] == \"qu\"\n word[2..-1] + \"quay\"\n elsif word[0..2] == \"sch\"\n word[3..-1] + \"schay\"\n elsif word[0..2] == \"squ\"\n word[3..-1] + \"squay\"\n elsif consonants.include?(word[0]) && consonants.include?(word[1]) && consonants.include?(word[2])\n word[3..-1] + word[0..2] + \"ay\"\n elsif consonants.include?(word[0]) && consonants.include?(word[1])\n word[2..-1] + word[0..1] + \"ay\"\n elsif consonants.include?(word[0])\n word[1..-1] + word[0] + \"ay\"\n end\n end\n\n a.join(\" \")\nend",
"def vowel_swapper(string)\n next_vowel_characters = ''\n characters = string.split('')\n vowels = 'aeiou'\n vowel_conversions = {'a' => 'e', 'e' => 'i', 'i' => 'o', 'o' => 'u', 'u' => 'a'}\n # Iterate through vowels and push it into vowels_characters\n characters.each do |character|\n if vowels.include?(character)\n next_vowel_characters += vowel_conversions[character]\n else\n next_vowel_characters += character\n end\n end\n next_vowel_characters\nend",
"def both_changed(name)\n part_1_vowels = next_vowel(name)\n part_2_consonants = next_consonant(part_1_vowels)\n return part_2_consonants #gives it back to caller\nend",
"def fake_name(name)\n fake_name = name.chars.map! do |letter|\n if letter == \" \"\n letter = \" \"\n elsif \"aeiou\".include?(letter)\n letter = next_vowel(letter)\n elsif \"zdhnt\".include?(letter)\n letter = pre_vowel_scramble(letter)\n else\n letter.next\n end\n end\n fake_name = fake_name.join\n swap_name_order(fake_name)\nend",
"def next_vowel(name)\n name = name.split('')\n name.each do |indivLetter| \n if indivLetter == \"a\"\n indivLetter.replace(\"e\")\n elsif indivLetter == \"e\"\n indivLetter.replace(\"i\")\n elsif indivLetter == \"i\"\n indivLetter.replace(\"o\")\n elsif indivLetter == \"o\"\n indivLetter.replace(\"u\")\n elsif indivLetter == \"u\"\n indivLetter.replace(\"a\")\n end\n end\nend",
"def vowel_rotate(str)\n vowels = 'aeiou'\n my_vowels = []\n\n str.each_char { |char| my_vowels << char if vowels.include?(char) }\n my_vowels.unshift(my_vowels.pop)\n str.each_char.with_index { |char, i| str[i] = my_vowels.shift if vowels.include?(char) }\n str\nend",
"def name_scramble(str)\n\tarr = str.downcase.split(\"\")\n\tvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n\tconsonant = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n\tstr_new = arr.map do |char|\n\t\tif vowels.include?(char) \n\t\t\tvowels.rotate[vowels.index(char)];\n\t\telsif consonant.include?(char)\n\t\t\tconsonant.rotate[consonant.index(char)]\n\t\tend\n\tend\n\tstr_new.join.capitalize\nend",
"def make_fake_name (name)\n\t# Swap first & last name\n\tswap_name = name.split(' ').reverse.join(' ')\n\n\t# Swap characters - change all vowels to next vowel,\n\t# and all consonants to next consonant\n\n\t# Initialize fake_name & index (counter) variables \n\tfake_name = ''\n\tindex = 0\n\twhile index < swap_name.length\n\t\tchar = swap_name[index]\n\n\t\t# For each character\n\t\tif char == ' '\n\t\t\t# If space, add space\n\t\t\tfake_name += ' '\n\t\telse\n\t\t\t# Handle lower & uppercase properly\n\t\t\tif char == char.downcase\n\t\t\t\tfake_name += get_swapped_char(char)\n\t\t\telse\n\t\t\t\tfake_name += get_swapped_char(char.downcase).upcase\n\t\t\tend\n\t\tend\n\n\t\t# Increment counter\n\t\tindex += 1\n\tend\n\n\tfake_name\nend",
"def swapping_consonents(consonant_char)\n consonents = { 'b' => 'c', 'c' => 'd', 'd' => 'f', 'f' => 'g', 'g' => 'h', 'h' => 'j', 'j' => 'k', 'k' => 'l', 'l' => 'm', 'm' => 'n', 'n' => 'p', 'p' => 'q', 'q' => 's', 's' => 't', 't' => 'v', 'v' => 'w', 'w' => 'x', 'x' => 'y', 'y' => 'z', 'z' => 'b' }\n\n consonant_char.map! do |letter|\n if consonents.include?(letter)\n consonents[letter]\n elsif consonents.include?(letter.downcase)\n consonents[letter.downcase].upcase\n else\n letter\n end\n end\nend",
"def alias_creator(full_name)\n full_name = full_name.downcase\n name = full_name.split(' ').to_a\n first_name = name[0]\n last_name = name[1]\n first_name_letters = first_name.split('')\n last_name_letters = last_name.split('')\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"a\"]\n consonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\", \"b\"]\n \n first_name_letters.map! do |letter|\n if vowels.include?(letter)\n letter_index = vowels.index(letter)\n new_letter_index = letter_index + 1\n letter = vowels[new_letter_index]\n elsif consonants.include?(letter)\n letter_index = consonants.index(letter)\n new_letter_index = letter_index + 1\n letter = consonants[new_letter_index]\n end\n end\n new_first_name = first_name_letters.join('').capitalize\n \n last_name_letters.map! do |letter|\n if vowels.include?(letter)\n letter_index = vowels.index(letter)\n new_letter_index = letter_index + 1\n letter = vowels[new_letter_index]\n elsif consonants.include?(letter)\n letter_index = consonants.index(letter)\n new_letter_index = letter_index + 1\n letter = consonants[new_letter_index]\n end\n end\n new_last_name = last_name_letters.join('').capitalize\n\n new_name = new_last_name + \" \" + new_first_name\n return new_name\n \nend",
"def translate(str)\n\n\n\n # Vowels to consider\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n \n # Special cases to consider\n two_letter_consonants = [\"ch\", \"sh\", \"qu\", \"th\", \"br\"]\n three_letter_consonants = [\"thr\", \"sch\", \"squ\"]\n\n words = str.split(\" \")\n result = []\n\n words.each do |word|\n if vowels.include?(word[0])\n result.push word << \"ay\"\n else \n if three_letter_consonants.include? (word[0] + word[1] + word[2])\n first_three_letters = word.slice!(0,3)\n \n # Add letters to end of word with 'ay'\n result.push word << first_three_letters << 'ay'\n elsif two_letter_consonants.include?(word[0] + word[1])\n first_two_letters = word.slice!(0,2)\n result.push word << first_two_letters << \"ay\"\n else \n first_letter = word.slice!(0)\n \n # Add first letter to end of word with 'ay'\n result.push word << first_letter << 'ay'\n end #End of special consonant check\n end \n end \n return result.join(\" \")\nend",
"def next_consonant(name)\n\tconsonants = %w( b c d f g h j k l m n p q r s t v x y z)\n\t\tname = name.downcase.split('')\n\t\tnew_name = name.map do |con|\n\t\tif consonants.include?(con)\n\t\t\tconsonants.rotate(1)[consonants.index(con)]\n\t\telsif consonants == 'z'\n\t\t\tconsonants.replace('b')\n\t\telse\n\t\t\tcon\n\t\tend\n\tend\n\tnew_name.join.capitalize\nend",
"def vowel_rotate(str)\n vowels = 'aeiou'\n array = []\n i = 0\n\n str.each_char {|char| array << char if vowels.include?(char)}\n str.each_char.with_index do |char, idx|\n if vowels.include?(char)\n str[idx] = array[i - 1]\n i += 1\n end\n end\n str\nend",
"def spy_alias2 full_name\n alphabet = {\n vowels: ['a','e','i','o','u'],\n consonants: ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']\n }\n alias_name = full_name.downcase.split(' ').reverse!.join(' ').split(//)\n alias_name.map! do |letter|\n next_letter=letter\n if alphabet[:vowels].include?(letter)\n index=alphabet[:vowels].index(letter)\n if letter==alphabet[:vowels][-1]\n next_letter=alphabet[:vowels][0]\n else\n next_letter=alphabet[:vowels][index+1]\n end\n elsif alphabet[:consonants].include?(letter)\n index = alphabet[:consonants].index(letter)\n if letter==alphabet[:consonants][-1]\n next_letter=alphabet[:consonants][0]\n else\n next_letter=alphabet[:consonants][index+1]\n end\n end\n next_letter\n end\n alias_name=alias_name.join('').split(' ').map! {|name| name.capitalize}.join(' ')\nend",
"def alias_name\n first_name = \"lia\".chars\nlast_name = \"hogan\".chars\np first_name.class\nfirst_name[3] = last_name[0]\nfirst_name[4] = last_name[1]\nfirst_name[5] = last_name[2]\nfirst_name[6] = last_name[3]\nfirst_name[7] = last_name[4]\np first_name\n\nlast_name[5] = first_name[0]\nlast_name[6] = first_name[1]\nlast_name[7] = first_name[2]\np last_name\nfirst_name.delete_at(0)\nfirst_name.delete_at(0)\nfirst_name.delete_at(0)\np first_name\nlast_name.delete_at(0)\nlast_name.delete_at(0)\nlast_name.delete_at(0)\nlast_name.delete_at(0)\nlast_name.delete_at(0)\np last_name\n \n full_name = first_name + last_name\n index = 0 \n str_back = \"\"\n while index < full_name.length\n str_back[index]\n if full_name[index] == \"a\"\n str_back[index] = \"e\"\n elsif full_name[index] == \"b\" \n str_back[index] = \"c\"\n elsif full_name[index] == \"c\" \n str_back[index] = \"d\" \n elsif full_name[index] == \"d\" \n str_back[index] = \"f\"\n elsif full_name[index] == \"e\" \n str_back[index] = \"i\"\n elsif full_name[index] == \"f\" \n str_back[index] = \"g\"\n elsif full_name[index] == \"g\" \n str_back[index] = \"h\"\n elsif full_name[index] == \"h\" \n str_back[index] = \"j\"\n elsif full_name[index] == \"i\" \n str_back[index] = \"o\"\n elsif full_name[index] == \"j\" \n str_back[index] = \"k\"\n elsif full_name[index] == \"k\" \n str_back[index] = \"l\"\n elsif full_name[index] == \"l\" \n str_back[index] = \"m\"\n elsif full_name[index] == \"m\" \n str_back[index] = \"n\"\n elsif full_name[index] == \"n\" \n str_back[index] = \"p\"\n elsif full_name[index] == \"o\" \n str_back[index] = \"u\"\n elsif full_name[index] == \"p\" \n str_back[index] = \"q\"\n elsif full_name[index] == \"q\" \n str_back[index] = \"r\"\n elsif full_name[index] == \"r\" \n str_back[index] = \"s\"\n elsif full_name[index] == \"s\" \n str_back[index] = \"t\"\n elsif full_name[index] == \"t\" \n str_back[index] = \"v\"\n elsif full_name[index] == \"u\" \n str_back[index] = \"y\"\n elsif full_name[index] == \"v\" \n str_back[index] = \"w\"\n elsif full_name[index] == \"w\" \n str_back[index] = \"x\"\n elsif full_name[index] == \"x\" \n str_back[index] = \"z\"\n elsif full_name[index] == \"y\" \n str_back[index] = \"a\"\n elsif full_name[index] == \"z\" \n str_back[index] = \"b\"\n else \n str_back[index] = \" \"\n end\n index += 1 \n end\n str_back\nend",
"def pig_latin_name(word)\n \n letters = word.split(\"\")\n \n final_array = letters.clone\n letters.each do |letter| #[p, l, u, m]\n \n \n if is_consonants?(letter)\n final_array.rotate! \n # #puts \".........#{removed_consonant}\"\n # #letters.push(removed_consonant)\n # puts \".........#{final_array}..#{letters}\"\n else \n # puts \"*****#{final_array}.... #{letters}\"\n final_array.push(\"ay\")\n return final_array.join\n end\n end\nend",
"def fake_identities(real_name)\n\n # input is downcase, split, and has reverse positions\n new_alias = real_name.downcase.split(' ').reverse\n # use map! to mutate name\n new_alias.map! {|name_info| name_info.split('')}\n\n new_alias.map! do |name_info|\n name_info.map! do |vowel|\n\n if vowel == \"z\"\n vowel = \"a\"\n elsif next_vowels(vowel) == vowel\n vowel.next!\n if next_vowels(vowel) != vowel\n vowel.next!\n end\n vowel\n else\n next_vowels(vowel)\n end\n end\n # returns a string and capitalizes first letter\n name_info.join('').capitalize\n end\n new_alias.join(' ') # keeps blank space here, otherwise it doesnt work\nend",
"def translate(text)\n\nvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"] #create array of vowels\nwords = text.split(\" \") #create array of individual words from text \ntranslation = [] #create empty array to receive the individually translated words\n\n words.each do |word| #for each individual word in the array\n \n #create loop to continue while first letter is not a vowel.\n while vowels.include?(word[0].downcase) == false #check index 0 (first letter) in word is NOT a vowel\n \n if word[0..1] == \"qu\" #create exceptional case for 'qu'\n word = word [2..-1] + word[0..1] #splice the first two letters to the end of the word\n else\n word = word [1..-1] + word[0] #push the first letter in the word (index [0]) to the end of the array\n end \n \n end\n \n word = word + \"ay\"\n translation.push(word) #push the word to the end of the final array\n\n end\n \ntranslation.join(\" \")\n \nend",
"def consonant_checker(array)\n consonant_guide = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n array.map! do |name|\n name_split = name.split('')\n name_split.map! do |char|\n index = 0\n while index < consonant_guide.length\n if char == consonant_guide[index]\n char = consonant_guide[index += 1]\n index += 1\n elsif char == \"z\"\n char = \"b\"\n index += 1\n else\n char\n index += 1\n end\n char\n end\n char\n end\n name_split\n name_join = name_split.join('').capitalize!\n name_join\n end\n p array\nend",
"def vowel_changer(name)\n vowel_string = \"aeiou\"\n name_array = name.downcase.chars\n new_name = []\n name_array.each do |character|\n if character == \"u\"\n character = \"a\"\n new_name << character\n elsif vowel_string.include? character\n character = vowel_string[vowel_string.index(character) +1]\n new_name << character\n else\n new_name << character\n end\n end\n new_name.join(\"\").split(\" \").each {|word| word.capitalize!}.join(\" \")\nend",
"def spy_name(realname)\n\tvowels = ['a','e','i','o','u']\n\tconsonants = ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']\n\treverseName = realname.downcase.split(\" \").reverse!\n\tfullName = reverseName[0] + \" \" + reverseName[1]\n\tletteredName = fullName.split('')\n \tletteredName.map! do |letter|\n \t if vowels.include?(letter)\n \t vowels.rotate(1)[vowels.index(letter)]\n \t elsif consonants.include?(letter)\n \t consonants.rotate(1)[consonants.index(letter)]\n \t end\n \tend\nfullName = letteredName.join('').insert(reverseName[0].length,' ')\nfullName.capitalize!\ntwoNames = fullName.split(\" \")\ntwoNames[1].capitalize!\nfullName = twoNames[0] + \" \" + twoNames[1]\np fullName\nend",
"def consonants_adv(str)\r\n str = vowel_adv(str)\r\n consonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\r\n str = str.downcase\r\n str = str.split('')\r\n str_new = str.map do |char|\r\n if consonants.include?(char)\r\n consonants.rotate(1)[consonants.index(char)]\r\n else\r\n char\r\n end\r\n end\r\n str_new.join\r\nend",
"def vowel_rotate(str)\n vowels = \"aeiou\"\n str_vowels = []\n str.each_char { |char| str_vowels << char if vowels.include?(char) }\n str_vowels.unshift(str_vowels.pop)\n \n str.each_char.with_index do |char, idx|\n str[idx] = str_vowels.shift if vowels.include?(char)\n end\n\n str\nend",
"def translate(input)\n\tinputArray = input.downcase.split(\" \")\n\tanswerArray = []\n\tvowelList = [\"a\", \"e\", \"i\", \"o\", \"u\", \"y\"]\n\tcurrentWordNum = 0\n\tcurrentLetterNum = 0\n\tnumberOfWords = inputArray.length - 1\n\tcurrentWordStr = inputArray[currentWordNum].to_s\n\tcurrentWordLength = currentWordStr.length - 1\n\tcurrentLetterStr = inputArray[currentWordNum][currentLetterNum].to_s\n\n\twhile currentWordNum <= numberOfWords\n\n\t\twhile currentLetterNum <= currentWordLength\n\n\t\t\t#if vowelList.include? currentLetterStr == true\n\t\t\tif currentLetterStr.among?vowelList\n\n\t\t\t\tpreviousLetterNum = currentLetterNum - 1\n\t\t\t\tpreviousLetterStr = inputArray[currentWordNum][previousLetterNum].to_s\n\n\t\t\t\tif currentLetterNum == 0\n\t\t\t\t\tcurrentWordStr = inputArray[currentWordNum].to_s\n\t\t\t\t\t\n\t\t\t\t\tnewWordStr = currentWordStr + \"ay\"\n\t\t\t\t\tputs \"newWordStr = \" + newWordStr\n\t\t\t\t\t\n\t\t\t\t\tanswerArray = answerArray.push newWordStr\n\t\t\t\t\tputs \"answerArray = \" + answerArray.to_s\n\n\t\t\t\t\tcurrentLetterNum = currentWordLength + 1\n\n\t\t\t\telsif previousLetterStr == \"q\"\n\t\t\t\t\t#quiet = ietquay\n\t\t\t\t\tcurrentWordStr = inputArray[currentWordNum].to_s\n\t\t\t\t\t\n\t\t\t\t\ttempLetterNum = currentLetterNum + 1\n\t\t\t\t\tnewWordPrefix = currentWordStr[tempLetterNum..currentWordLength]\n\t\t\t\t\t\n\t\t\t\t\tnewWordSuffix = currentWordStr[0..currentLetterNum]\n\n\t\t\t\t\tputs \"newWordPrefix = \" + newWordPrefix\n\t\t\t\t\tputs \"newWordSuffix = \" + newWordSuffix\n\t\t\t\t\t\n\t\t\t\t\tnewWordStr = newWordPrefix + newWordSuffix + \"ay\"\n\t\t\t\t\tputs \"newWordStr = \" + newWordStr\n\t\t\t\t\t\n\t\t\t\t\tanswerArray = answerArray.push newWordStr\n\t\t\t\t\tputs \"answerArray = \" + answerArray.to_s\n\n\t\t\t\t\tcurrentLetterNum = currentWordLength + 1\n\n\t\t\t\telse\n\t\t\t\t\tcurrentWordStr = inputArray[currentWordNum].to_s\n\t\t\t\t\t\n\t\t\t\t\tnewWordPrefix = currentWordStr[currentLetterNum..currentWordLength]\n\t\t\t\t\ttempLetterNum = currentLetterNum - 1\n\t\t\t\t\tnewWordSuffix = currentWordStr[0..tempLetterNum]\n\t\t\t\t\t\n\t\t\t\t\tnewWordStr = newWordPrefix + newWordSuffix + \"ay\"\n\t\t\t\t\tputs \"newWordStr = \" + newWordStr\n\t\t\t\t\t\n\t\t\t\t\tanswerArray = answerArray.push newWordStr\n\t\t\t\t\tputs \"answerArray = \" + answerArray.to_s\n\n\t\t\t\t\tcurrentLetterNum = currentWordLength + 1\n\t\t\t\tend\n\n\t\t\telse\n\n\t\t\t\tcurrentLetterNum = currentLetterNum + 1\n\t\t\t\tcurrentLetterStr = inputArray[currentWordNum][currentLetterNum].to_s\n\n\t\t\tend\n\n\t\tend\n\n\t\tcurrentWordNum = currentWordNum + 1\n\n\t\tif currentWordNum > numberOfWords\n\t\t\tbreak\n\t\tend\n\n\t\tcurrentWordStr = inputArray[currentWordNum].to_s\n\t\t# puts \"currentWordStr = \" + currentWordStr.to_s\n\n\t\tcurrentWordLength = currentWordStr.length - 1\n\t\t# puts \"currentWordLength = \" + currentWordLength.to_s\n\t\tcurrentLetterNum = 0\n\t\tcurrentLetterStr = inputArray[currentWordNum][currentLetterNum].to_s\n\n\tend\n\n\tanswer = answerArray.join(' ')\n\tputs answer\n\treturn answer\nend",
"def consenant_swap(name)\r\n name = name.downcase\r\n consenants = \"bcdfghjklmnpqrstvwxyz\"\r\n name_index = 0\r\n cons_index = 0\r\n while name_index < name.length\r\n if name[name_index] == \"a\" || name[name_index] == \"e\" ||name[name_index] == \"i\"|| name[name_index] == \"o\" || name[name_index] == \"u\" || name[name_index] == \" \"\r\n name_index += 1\r\n elsif name[name_index] == \"z\"\r\n name[name_index] = \"b\"\r\n name_index += 1\r\n else\r\n until name[name_index] == consenants[cons_index]\r\n cons_index += 1\r\n end\r\n name[name_index] = consenants[cons_index + 1]\r\n name_index += 1\r\n end\r\n cons_index = 0\r\n end\r\n name\r\nend",
"def vowel_adv(str)\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n str = str.split('')\n str_new = str.map do |char|\n if vowels.include?(char)\n vowels.rotate(1)[vowels.index(char)]\n else\n char\n end\n end\n str_new.join\nend",
"def next_consonant(name)\n\tconsonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \n\t\t\"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n\tindex = 0\n\tname = name.split('') # string to array\n\tname_change2 = name.map do |letter| \n\t\tif consonants.include? letter \n\t\t\tconsonants.rotate(1)[consonants.index(letter)]\n\t\telse\n\t\t\tletter\n\t\tend\n\tend\n\tname_change2.join\t# new array convert back to string\nend",
"def vowel_rotate(str)\n vowels = \"aeiou\"\n orig_vowels = []\n rotated = str\n\n str.chars.each {|c| orig_vowels << c if vowels.include?(c)}\n\n rotated.chars.each_with_index do |c, i|\n if vowels.include?(c)\n rotated[i] = orig_vowels[-1]\n orig_vowels << orig_vowels.shift\n end\n end\n rotated\nend",
"def vowel_rotate(str)\n arr_of_vowels = vowels(str)\n idx = 0\n new_str = \"\"\n vowels = \"aeiou\"\n str.each_char do |char|\n if vowels.include?(char)\n new_str += arr_of_vowels[(idx - 1) % arr_of_vowels.length]\n idx +=1\n else\n new_str += char\n end\n end\n new_str\nend",
"def alias_maker(name)\n \n consonants = \"bcdfghjklmnpqrstvwxz\"\n next_cons = \"cdfghjklmnpqrstvwxzb\"\n \n name.downcase.tr(consonants,next_cons)\n .tr('aeiouy', 'eiouya')\n .split.reverse.each {|word| word.capitalize!}\n .join(' ')\n\n # Separated methods on lines 24-27 for readability\n # First .tr changes all consonants to next\n # Second .tr changes all vowels to next vowel\n # Split names to reverse and capitalize them\n # Rejoin to a single string\n\nend",
"def change_name(name)\n\t\t# create alphabet range\n\t\tvowels = 'aeiou'\n\t\tvowel_change = vowels.split('').reverse\n\t\tconsonants = 'abcdefghijklmnopqrstuvwxyz'\n\t\tconsonant_change = consonants.delete('aeiou').split('').reverse\n\n\t\toriginal_name = name\n\t\tname_reverse = original_name.downcase.split.reverse.join('').split('')\n\n\n\t\tnew_name = name_reverse.map do |letter|\n\t\t\tif vowels.include?(letter)\n\t\t\t\tvowel_change[vowel_change.index(letter)-1]\n\t\t\telsif consonants.include?(letter)\n\t\t\t\tconsonant_change[consonant_change.index(letter)-1]\n\t\t\telse\n\t\t\t\tletter\n\t\t\tend\nend\n\nfinal_name = new_name.join.split.map { |name| name.capitalize}.join('')\nend",
"def translate(string)\n newArr = []\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n \n # * Split it into words\n words = string.split()\n\n # * For every word in the sentence...\n words.each do |word|\n # * If the word has 'qu'\n if word[1..2].downcase == \"qu\"\n newArr << word[3..-1] + word[0..2] + \"ay\"\n\n elsif word[0..1].downcase == \"qu\"\n newArr << word[2..-1] + word[0..1] + \"ay\"\n\n # * If it starts with a vowel\n elsif vowels.include?(word[0].downcase)\n newArr << word + \"ay\"\n\n # * If the first three consonants aren't vowels\n elsif not vowels.include?(word[0].downcase) and not vowels.include?(word[1]) and not vowels.include?(word[2])\n newArr << word[3..-1] + word[0..2] + \"ay\" \n # * ...or if the first two consonants aren't vowels\n elsif not vowels.include?(word[0].downcase) and not vowels.include?(word[1])\n newArr << word[2..-1] + word[0..1] + \"ay\" \n \n # * After all that, if it starts with one consonant\n else\n newArr << word[1..-1] + word[0] + \"ay\"\n end\n end\n\n newArr.join(\" \")\nend",
"def run_generator\n puts \"What is the first word to combine?\"\n first_word = gets.chomp\n # If the first word is less than two, require new user input until it is => to 2\n while (first_word).length < 2\n puts \"Input must be at least two characters. Please re-enter the first word.\"\n first_word = gets.chomp\n end\n\n puts \"What is the second word to combine?\"\n second_word = gets.chomp\n # If the second word is less than two, require new user input until it is => to 2\n while (second_word).length < 2\n puts \"Input must be at least two characters. Please re-enter the second word.\"\n second_word = gets.chomp\n end\n # Set new variables for the first words truncated word and index\n first_half = nil\n # Set index of first word equeal to the length of the first word minus 1 (because index starts at zero)\n first_index = first_word.length - 1\n # Reverses the string and use (\"!\") and keep it reversed\n first_word.reverse!\n # Iterate over each character of the first word to find if its a vowel\n first_word.each_char do |c|\n if !is_vowel?(c) == true\n first_index -= 1\n else\n first_word.reverse!\n first_half = first_word.slice(0...first_index)\n break\n end\n # If there are no vowels use the whole word\n if is_vowel?(c) == false\n first_half = first_word\n end\n end\n # Initialize a variable second_half \n second_half = nil\n # Iterate over each character of the second word to find vowels and then break\n second_word.each_char do |c|\n if is_vowel?(c) == true\n word2_start = second_word.index(c)\n word2_end = second_word.length\n second_half = second_word.slice(word2_start, word2_end)\n break\n end\n # If there are no vowels use the whole word\n if is_vowel?(c) == false\n second_half = second_word\n end\n end\n # Create the portmanteau by combining the first and second halfs.\n portmanteau = first_half + second_half\n\n puts \"#{first_word} + #{second_word} is #{portmanteau}!\"\n # puts \"in the run_generator method\"\nend",
"def reverberate(sentence)\n vowels = \"aeiou\"\n words = sentence.split(\" \")\n converted_sentence = []\n\n words.each do |word|\n if word.length < 3\n converted_sentence << word\n elsif vowels.include?(word[-1].downcase)\n converted_sentence << word + word[0].downcase + word[1..-1]\n else\n uppercase = word[0] == word[0].upcase ? true : false\n count = word.length - 1\n\n while count > 0\n if vowels.include?(word[count])\n new_word = word + word[count..-1]\n converted_sentence << new_word\n break\n end\n count -= 1\n end\n end\n end\n\n converted_sentence.join(\" \")\nend",
"def vowel_rotate(str)\n vowels = ['a','e','i','o','u']\n array = []\n str.each_char do |char|\n array << char if vowels.include?(char)\n end\n array = [array[-1]] + array.slice(0,array.length-1)\n str.each_char.with_index do |char, idx|\n str[idx] = array.shift if vowels.include?(char)\n end\n str\nend",
"def vowel_checker(array)\n vowel_guide = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n array.map! do |name|\n name_split = name.split('')\n name_split.map! do |char|\n index = 0\n while index < vowel_guide.length\n if char == vowel_guide[index]\n char = vowel_guide[index += 1]\n index += 1\n elsif char == \"u\"\n char = \"a\"\n index += 1\n else\n char\n index += 1\n end\n char\n end\n char\n end\n name_split\n name_join = name_split.join('')\n name_join\n end\n array\nend"
] | [
"0.75452274",
"0.7493332",
"0.7485925",
"0.7208253",
"0.7146611",
"0.7121268",
"0.70032966",
"0.69553614",
"0.6931459",
"0.6897362",
"0.6868838",
"0.685386",
"0.68537724",
"0.68500936",
"0.6841828",
"0.6837607",
"0.68166506",
"0.68003565",
"0.6794053",
"0.6783319",
"0.67566055",
"0.674772",
"0.6741577",
"0.6685608",
"0.6677749",
"0.66643566",
"0.66596144",
"0.6649909",
"0.6624802",
"0.66192967",
"0.66051024",
"0.6591846",
"0.65793437",
"0.6576432",
"0.65577173",
"0.65551555",
"0.6539653",
"0.6532478",
"0.65298283",
"0.6507702",
"0.64935446",
"0.64695954",
"0.64497775",
"0.6449016",
"0.64486957",
"0.6435199",
"0.6434874",
"0.6408925",
"0.63827276",
"0.6324143",
"0.630978",
"0.630969",
"0.62911254",
"0.62764996",
"0.6265734",
"0.62539935",
"0.62438124",
"0.6243486",
"0.6237385",
"0.62244487",
"0.6200797",
"0.619811",
"0.6188759",
"0.6170405",
"0.6151962",
"0.61515284",
"0.6150604",
"0.61414576",
"0.6131208",
"0.61286634",
"0.6127382",
"0.61199963",
"0.6118231",
"0.6117202",
"0.61132395",
"0.6107183",
"0.6105288",
"0.61025894",
"0.6092969",
"0.6092392",
"0.60866743",
"0.60838497",
"0.60828036",
"0.6069273",
"0.60691917",
"0.6068256",
"0.6063171",
"0.605654",
"0.6048891",
"0.60456127",
"0.6031392",
"0.6023591",
"0.6019864",
"0.6015742",
"0.5999569",
"0.59979266",
"0.599706",
"0.59916914",
"0.5991599",
"0.59911644"
] | 0.6769894 | 20 |
Returns an array of Licensee::License instances | def licenses(options = {})
Licensee::License.all(options)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def licenses\n licenses = []\n uris = metadata[dataset_uri][dct.license.to_s]\n if uris.nil?\n []\n else\n uris.each do |uri|\n l = metadata[uri]\n licenses << License.new(:uri => uri, :name => l[dct.title.to_s])\n end\n return licenses\n end\n rescue\n []\n end",
"def licenses\n @licenses ||= []\n end",
"def licenses\n data[:licenses]\n end",
"def licenses\n if @licenses.nil?\n @licenses = self.links.select do |link|\n link.rel == \"license\"\n end\n end\n return @licenses\n end",
"def licenses *names\n names.to_strings.each do |name| \n begin\n module_name = \"#{name.camelize}License\"\n clazz = module_name.constantize\n clazz.new(self).enforce!\n rescue\n raise \"License #{module_name} not found\"\n end\n end\n end",
"def license_items\n license_id = unsafe_params[\"license_id\"]\n unless license_id.is_a?(Numeric) && (license_id.to_i == license_id) ||\n license_id.is_a?(String) && license_id.to_i.positive?\n raise \"License license_id needs to be an Integer\"\n end\n\n # Check if the license exists and is editable by the user. Throw 404 if otherwise.\n License.editable_by(@context).find(license_id)\n\n items_to_license = unsafe_params[\"items_to_license\"]\n if items_to_license.is_a?(String)\n items_to_license = [items_to_license]\n elsif items_to_license.is_a?(Array) && items_to_license.any? { |item| item.is_a?(String) }\n raise \"License items_o_license needs to be an Array of Strings\"\n end\n\n items_licensed = []\n LicensedItem.transaction do\n items_to_license.each do |item_uid|\n item = item_from_uid(item_uid)\n if item.editable_by?(@context) && %w(asset file).include?(item.klass)\n items_licensed << LicensedItem.find_or_create_by(license_id: license_id,\n licenseable: item).id\n end\n end\n end\n\n render json: { license_id: license_id, items_licensed: items_licensed }\n end",
"def complete_licenses\n License.selectable\n .sort_by(&:identifier)\n .map { |license| [\"#{license.identifier} (#{license.name})\", license.id] }\n end",
"def licenses *names\n names.to_strings.each do |name| \n begin\n module_name = \"#{name.camelize}License\"\n clazz = module_name.constantize\n rescue\n raise \"License #{module_name} is not defined\"\n end\n\n begin\n clazz.new(self).enforce!\n rescue\n raise \"License #{clazz} could not be enforced using #{self.inspect}\"\n end\n end\n end",
"def customized_licenses\n @research_output.plan.template.licenses.map { |license| [\"#{license.identifier} (#{license.name})\", license.id] }\n end",
"def list_licenses\n check_scope!\n licenses = License.\n editable_by(@context).\n eager_load(user: :org).\n includes(:taggings).\n order(:title)\n\n licenses = licenses.where(scope: params[:scopes]) if params[:scopes].present?\n\n render json: licenses, root: \"licenses\", adapter: :json\n end",
"def licenses\r\n LicensesController.instance\r\n end",
"def licenses=(licenses)\n @licenses = Array licenses\n end",
"def find_licenses_in_source\n license_files = []\n\n @find_class.find(@gem_source) do |path|\n license_files << path if path.include?(\"LICENSE\")\n end\n\n license_files\n end",
"def index\n @licenses = License.all\n end",
"def index\n @licenses = License.all\n end",
"def licenses=(licenses)\n @licenses = [licenses].flatten\n end",
"def license_files\n @license_files ||= []\n end",
"def license=(o)\n self.licenses = [o]\n end",
"def index\n @diriving_licenses = DirivingLicense.all\n end",
"def licenses_list(opts = {})\n data, _status_code, _headers = licenses_list_with_http_info(opts)\n return data\n end",
"def get_licenses(opts = {})\n data, _status_code, _headers = get_licenses_with_http_info(opts)\n data\n end",
"def license name\n self.licenses << name.to_s\n end",
"def project_files\n return [] if @url.nil?\n\n license_data = self.class.retrieve_license(@url)\n Array(Licensee::ProjectFiles::LicenseFile.new(license_data, { uri: @url }))\n end",
"def index\n @licenses = License.page(params[:page]).per(10)\n end",
"def licenses=(new_licenses)\n @licenses = new_licenses\n end",
"def index\n @license_results = LicenseResult.all\n end",
"def get_license_listing(opts = {})\n data, _status_code, _headers = get_license_listing_with_http_info(opts)\n data\n end",
"def license_info\n self.dig_for_array(\"licenseInfo\")\n end",
"def license\n @licenses.first\n end",
"def licenses_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OtherApi.licenses_list ...\"\n end\n # resource path\n local_var_path = \"/licenses\"\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 = []\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<License>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OtherApi#licenses_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @license_tos = LicenseTo.all\n end",
"def licenses(top, output_file = nil, prv_release = nil, cur_release = nil)\n api_licenses = CLicenseModuleInfo.new(top, \"MESA\")\n\n license_options = Hash.new()\n license_options[:release_version_prv] = prv_release\n license_options[:release_version_cur] = cur_release\n\n license_options[:hdr_pre] = \"This file provides a summary of the licenses included in or used by the MESA\\n\"\n license_options[:hdr_pre] += \"sources, along with the raw licenses for each package.\\n\"\n license_options[:hdr_pre] += \"\\n\"\n license_options[:hdr_pre] += \"Notice: The MESA package includes pre-built binary firmware images. These\\n\"\n license_options[:hdr_pre] += \" images consist of the binary MESA artifacts appended to a BSP.\\n\"\n license_options[:hdr_pre] += \" The combined set of licenses for these images can be found in\\n\"\n license_options[:hdr_pre] += \" ./bin/<preset>/licenses.txt\\n\"\n license_options[:hdr_pre] += \"\\n\"\n\n license_options[:hdr_post] = \"\\n\"\n license_options[:hdr_post] += \"To obtain the source, please contact sales/marketing\\n\\n\"\n license_options[:hdr_post] += \"\\n\"\n\n licenses = CLicenseCollection.new(\"MESA\", license_options)\n licenses.concat(api_licenses)\n if output_file\n File.open(output_file, \"w\") do |lic|\n licenses.write(lic)\n end\n else\n licenses.write()\n end\nend",
"def license\n return self.licenses.first\n end",
"def licenses\n publisher_id = current_user.id\n @licenses = PowerChip.where(:publisher_id=>publisher_id)\n respond_to do |format|\n format.html # licenses.html.erb\n format.json { render json: @licenses }\n end\n end",
"def with_licenses(licenses)\n @licenses.concat licenses\n self\n end",
"def get_organization_licenses(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'organization_id' => options['organization_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/organizations/{organizationId}/licenses'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'organizationId' => options['organization_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_builder = APIHelper.append_url_with_query_parameters(\r\n _query_builder,\r\n {\r\n 'perPage' => options['per_page'],\r\n 'startingAfter' => options['starting_after'],\r\n 'endingBefore' => options['ending_before'],\r\n 'deviceSerial' => options['device_serial'],\r\n 'networkId' => options['network_id'],\r\n 'state' => options['state']\r\n },\r\n array_serialization: Configuration.array_serialization\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\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 CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\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",
"def license\n licenses.first\n end",
"def preferred_licenses\n License.preferred.map { |license| [\"#{license.identifier} (#{license.name})\", license.id] }\n end",
"def index\n @licenses = License.order(\"updated_at DESC, name ASC\")\n respond_with(@licenses)\n end",
"def license(name=nil)\n if name\n self.license = name\n else\n if copryrights.first\n copyrights.first.license\n end\n end\n end",
"def license(path)\n Licensee.project(path).license\n end",
"def get_licenses_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LicenseApi.get_licenses ...'\n end\n # resource path\n local_var_path = '/v1/license'\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[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<License>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['X-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: LicenseApi#get_licenses\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def from_content(content)\n return [] unless content\n\n LicenseField.from_array content.scan(FIELD_REGEX).flatten\n end",
"def project_files\n self.class.load_csv(path, @executable, @configurations)\n url = self.class.url_for(self)\n\n return [] if url.nil?\n\n license_data = self.class.retrieve_license(url)\n\n Array(Licensee::ProjectFiles::LicenseFile.new(license_data, { uri: url }))\n end",
"def accept_licenses\n license_ids = unsafe_params[\"license_ids\"]\n fail \"License license_ids needs to be an Array of Integers\" unless license_ids.is_a?(Array) && license_ids.all? do |license_id|\n license_id.is_a?(Numeric) && (license_id.to_i == license_id)\n end && !license_ids.empty?\n license_ids.uniq!\n fail \"Some license_ids do not exist\" unless License.where(id: license_ids).count == license_ids.count\n\n AcceptedLicense.transaction do\n license_ids.each do |license_id|\n AcceptedLicense.find_or_create_by(license_id: license_id, user_id: @context.user_id)\n end\n end\n\n render json: { accepted_licenses: license_ids }\n end",
"def index\n @license_plates = LicensePlate.all\n end",
"def license(*args)\n arguments(args, required: [:user, :repo])\n\n get_request(\"/repos/#{arguments.user}/#{arguments.repo}/license\", arguments.params)\n end",
"def all\n @all ||= begin\n path = '../../vendor/choosealicense.com/_data/fields.yml'\n path = File.expand_path path, __dir__\n fields = YAML.safe_load File.read(path)\n fields.map { |field| LicenseField.from_hash(field) }\n end\n end",
"def private_licenses_list(opts = {})\n data, _status_code, _headers = private_licenses_list_with_http_info(opts)\n return data\n end",
"def private_licenses_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OtherApi.private_licenses_list ...\"\n end\n # resource path\n local_var_path = \"/account/licenses\"\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 = ['OAuth2']\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<License>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OtherApi#private_licenses_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def license\n return @license\n end",
"def index\n @licenses = License.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @licenses }\n end\n end",
"def license(arg = nil)\n set_or_return(\n :license,\n arg,\n kind_of: [ String ]\n )\n end",
"def submodule_licenses\n @@submodule_licenses ||= begin\n submodules = {}\n submodule_paths.each { |submodule| submodules[submodule] = submodule_license(submodule) }\n submodules\n end\n end",
"def license_model\n @dbi.license_model\n end",
"def license_model\n @dbi.license_model\n end",
"def license\n if ladnn?\n [\"https://creativecommons.org/licenses/by/4.0/\"]\n else\n # If it's populated, DLCS uses MARC IDs, not labels, so we don't need to map like w/ resource_type\n map_field(:license)\n end\n end",
"def new\n @license = License.new\n end",
"def get_license_listing_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LicenseApi.get_license_listing ...'\n end\n # resource path\n local_var_path = '/v1/license/concise'\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[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<License>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['X-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: LicenseApi#get_license_listing\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def license(arg = nil)\n set_or_return(:license, arg, kind_of: [String])\n end",
"def initialize(licenses: [], notices: [], metadata: {})\n @licenses = [licenses].flatten.compact.map { |l| DependencyRecord::License.new(l) }\n @notices = [notices].flatten.compact\n @metadata = metadata\n end",
"def from_array(array)\n array.map { |key| LicenseField.find(key) }\n end",
"def license\n read_property 'License'\n end",
"def add_licenses\n return @add_licenses\n end",
"def license=(value)\n @license = value\n end",
"def getsfLma__LicenseObjName\r\n\t\t\treturn \"sfLma__License__c\"\r\n\t\tend",
"def cars\n return cars_by_license_plate unless @license_plate.empty?\n cars_by_color\n end",
"def get_license_info(account_license, device_license)\r\n account_license.map do |acc|\r\n {\r\n license_id: acc[:license_id],\r\n app_name: acc[:app_name],\r\n sku: acc[:sku],\r\n type: acc[:type],\r\n grant_date: acc[:grant_date],\r\n device_info: device_license.select { |license| license[:package_name] == acc[:app_name] }\r\n }\r\n end\r\n end",
"def get_license_info(account_license, device_license)\n account_license.map do |acc|\n {\n license_id: acc[:license_id],\n app_name: acc[:app_name],\n sku: acc[:sku],\n type: acc[:type],\n grant_date: acc[:grant_date],\n device_info: device_license.select { |license| license[:package_name] == acc[:app_name] }\n }\n end\n end",
"def retrieve_license(url)\n (@licenses ||= {})[url] ||= Net::HTTP.get(URI(url))\n end",
"def potential_licenses\n @potential_licenses ||= begin\n Licensee.licenses(hidden: true).select do |license|\n if license.creative_commons? && file.potential_false_positive?\n false\n else\n license.wordset && license.length_delta(file) <= license.max_delta\n end\n end\n end\n end",
"def license\n @flickr.photos.licenses[self.license_id]\n end",
"def license_builder\n ManifestBuilder::LicenseBuilder\n end",
"def license_object(infos)\n {\n name: infos.delete(:license),\n url: infos.delete(:license_url)\n }.delete_if { |_, value| value.blank? }\n end",
"def license_model\n data[:license_model]\n end",
"def set_license\n @license = License.find(params[:id])\n end",
"def set_license\n @license = License.find(params[:id])\n end",
"def set_license\n @license = License.find(params[:id])\n end",
"def set_license\n @license = License.find(params[:id])\n end",
"def keys\n @keys ||= LicenseField.all.map(&:key)\n end",
"def index\n @user = current_user\n if @user.is_admin\n @users = User.all\n # @licenses = @user.license\n elsif @user.licensed\n @users = User.where(id: current_user.id)\n else\n redirect_to licenses_stub_path\n end\n end",
"def find(attributes={})\n attributes = attributes.to_h\n\n all.find { |license| license.matches?(attributes) }\n end",
"def index\n @allocations = @license.allocations.all\n end",
"def license(value)\n _license(value) or fail ArgumentError, \"Unknown value for license: #{value}\"\n end",
"def index\n @comentariu_licentas = ComentariuLicenta.all\n end",
"def get_license_info(token)\n licenses = Hash.new\n licenses[\"cc-by\"] = { :name => 'Attribution', :url => 'https://creativecommons.org/licenses/by/4.0' }\n licenses[\"cc-by-nd\"] = { :name => 'Attribution-NoDerivs', :url => 'https://creativecommons.org/licenses/by-nd/4.0' }\n licenses[\"cc-by-sa\"] = { :name => 'Attribution-ShareAlike', :url => 'https://creativecommons.org/licenses/by-sa/4.0' }\n licenses[\"cc-by-nc\"] = { :name => 'Attribution-NonCommercial', :url => 'https://creativecommons.org/licenses/by-nc/4.0' }\n licenses[\"cc-by-nc-sa\"] = { :name => 'Attribution-NonCommercial-ShareAlike', :url => 'https://creativecommons.org/licenses/by-nc-sa/4.0' }\n licenses[\"cc-by-nc-nd\"] = { :name => 'Attribution-NonCommercial-NoDerivs', :url => 'https://creativecommons.org/licenses/by-nc-nd/4.0' }\n license_info = licenses[token]\nend",
"def search_by_license_type\r\n\t\t\t\tlicense = Licence.find_by_licence_type(params[:license])\t\t\r\n\r\n\t\t\t\tif license\r\n\t\t\t\t\tResource.find_all_by_licence_id(license.id)\r\n\t\t\t\telse\r\n\t\t\t\t\tresource_not_found\r\n\t\t\t\tend \r\n\t\t\tend",
"def list\n\t @licenses = License.paginate :page => params[:page], :per_page => 10\n\t\trespond_to do |format|\t\t\n\t\t\t format.html # index.html\n format.xml { render :xml => @licenses }\n format.pdf { send_data render_to_pdf({ :action => 'list.rpdf', :layout => 'standard' }) }\n \n\t\tend\n\t end",
"def license_url\n get_url(:license)\n end",
"def new\n @license = License.new\n respond_with(@license)\n end",
"def index\n @category_licors = CategoryLicor.all\n end",
"def set_license\n @license = License.find(params[:license_id])\n end",
"def add_drivers_license(xml, options)\n return unless customer = options[:customer]\n return unless drivers_license = customer[:drivers_license]\n\n xml.tag!('driversLicense') do\n # The customer's driver's license number\n xml.tag!('number', drivers_license[:number])\n # The customer's driver's license state\n xml.tag!('state', drivers_license[:state])\n # The customer's driver's license date of birth\n xml.tag!('dateOfBirth', drivers_license[:date_of_birth])\n end\n end",
"def license_url\n case self.license\n when \"cc-by-sa-3.0\"\n \"http://creativecommons.org/licenses/by-sa/3.0/\"\n when \"cc-by-nc-sa-2.0-uk\"\n \"http://creativecommons.org/licenses/by-nc-sa/2.0/uk\"\n end\n end",
"def project_licenses_json\n projects = current_user.person.projects_with_default_license\n Hash[projects.collect { |proj| [proj.id, proj.default_license] }].to_json.html_safe\n end",
"def get_cartridge_array\n cs = Array.new\n\n cartridges.each do |c|\n cs << c.name\n end\n\n cs\n end",
"def create\n @license = current_user.licenses.new(license_params)\n set_license_key\n \n respond_to do |format|\n if @license.save\n format.html { redirect_to @license, notice: 'License was successfully created.' }\n format.json { render :show, status: :created, location: @license }\n else\n format.html { render :new }\n format.json { render json: @license.errors, status: :unprocessable_entity }\n end\n end\n end",
"def detect_license(repo, files)\n file = JavaProject.new(repo, files).matched_file\n return nil unless file\n LicenseeFile.new(file)\n end",
"def select_licence(default_licence = FalkorLib::Config::Bootstrap::DEFAULTS[:metadata][:license],\n _options = {})\n list_license = FalkorLib::Config::Bootstrap::DEFAULTS[:licenses].keys\n idx = list_license.index(default_licence) unless default_licence.nil?\n select_from(list_license,\n 'Select the license index for this project:',\n (idx.nil?) ? 1 : idx + 1)\n #licence\n end",
"def rights\n uri = metadata[dataset_uri][dct.rights.to_s][0]\n rights = metadata[uri] rescue nil\n if rights.nil?\n rights = Rights.new(:uri => uri)\n else\n rights = Rights.new(:uri => uri, \n :dataLicense => rights[odrs.dataLicense.to_s][0], \n :contentLicense => rights[odrs.contentLicense.to_s][0], \n :copyrightNotice => rights[odrs.copyrightNotice.to_s][0], \n :attributionURL => rights[odrs.attributionURL.to_s][0],\n :attributionText => rights[odrs.attributionText.to_s][0]\n )\n end\n return rights\n rescue\n []\n end"
] | [
"0.79116863",
"0.7615163",
"0.7191282",
"0.7116111",
"0.7056881",
"0.70310897",
"0.6982774",
"0.6905566",
"0.6766984",
"0.66965204",
"0.6654633",
"0.6613263",
"0.66106236",
"0.65628034",
"0.65628034",
"0.65494007",
"0.65008265",
"0.64991575",
"0.6475362",
"0.6403956",
"0.6308821",
"0.6307728",
"0.6266871",
"0.6212319",
"0.62112916",
"0.6188958",
"0.61710745",
"0.6126139",
"0.61023027",
"0.61002445",
"0.60736823",
"0.60699576",
"0.6055792",
"0.6003767",
"0.5980507",
"0.59774727",
"0.5970065",
"0.5968277",
"0.5951141",
"0.5945262",
"0.5925024",
"0.59039927",
"0.5873693",
"0.5843749",
"0.5840613",
"0.58351123",
"0.5811486",
"0.5794849",
"0.5765988",
"0.5750654",
"0.5748416",
"0.5711237",
"0.5702692",
"0.5699901",
"0.56806135",
"0.56806135",
"0.5657149",
"0.56477296",
"0.5622163",
"0.562051",
"0.56084037",
"0.56025773",
"0.55472183",
"0.55391294",
"0.5535906",
"0.55285746",
"0.55199647",
"0.5518136",
"0.5511743",
"0.5510534",
"0.5502563",
"0.55006385",
"0.5469481",
"0.5468742",
"0.54619837",
"0.5456523",
"0.5456523",
"0.5456523",
"0.5445142",
"0.54415464",
"0.54376274",
"0.5411893",
"0.53935957",
"0.53620327",
"0.53473616",
"0.5306439",
"0.5282587",
"0.5280547",
"0.52691704",
"0.5263193",
"0.52621835",
"0.525744",
"0.5249901",
"0.52417314",
"0.52408165",
"0.5230547",
"0.5225615",
"0.52248824",
"0.5202611",
"0.5186237"
] | 0.8071391 | 0 |
Returns the license for a given path | def license(path)
Licensee.project(path).license
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def license\n File.read file_path('LICENSE') if license?\n end",
"def license_file_path(path = NULL)\n if null?(path)\n @license_file_path || File.join(install_dir, \"LICENSE\")\n else\n @license_file_path = File.join(install_dir, path)\n end\n end",
"def license\n last_commit = @ref.target\n license = @repo.blob_at(last_commit.oid, 'LICENSE') || @repo.blob_at(last_commit.oid, 'LICENSE.txt')\n\n if license.nil?\n 'N/A'\n else\n license_text = license.text\n\n case license_text\n when /Apache License/\n 'Apache'\n when /GNU GENERAL PUBLIC LICENSE/\n 'GPL'\n when /GNU LESSER GENERAL PUBLIC LICENSE/\n 'LGPL'\n when /Permission is hereby granted, free of charge,/\n 'MIT'\n when /Redistribution and use in source and binary forms/\n 'BSD'\n else\n 'N/A'\n end\n end\n end",
"def license_url\n get_url(:license)\n end",
"def license\n licenses.first\n end",
"def license\n @licenses.first\n end",
"def license\n return self.licenses.first\n end",
"def license_url\n case self.license\n when \"cc-by-sa-3.0\"\n \"http://creativecommons.org/licenses/by-sa/3.0/\"\n when \"cc-by-nc-sa-2.0-uk\"\n \"http://creativecommons.org/licenses/by-nc-sa/2.0/uk\"\n end\n end",
"def license(name=nil)\n if name\n self.license = name\n else\n if copryrights.first\n copyrights.first.license\n end\n end\n end",
"def license(*args)\n arguments(args, required: [:user, :repo])\n\n get_request(\"/repos/#{arguments.user}/#{arguments.repo}/license\", arguments.params)\n end",
"def license\n return @license\n end",
"def retrieve_license(url)\n (@licenses ||= {})[url] ||= Net::HTTP.get(URI(url))\n end",
"def license\n @header.license\n end",
"def license(arg = nil)\n set_or_return(:license, arg, kind_of: [String])\n end",
"def project_license_content\n project.license_file.nil? ? \"\" : IO.read(File.join(Config.project_root,project.license_file))\n end",
"def license(value)\n _license(value) or fail ArgumentError, \"Unknown value for license: #{value}\"\n end",
"def license\n read_property 'License'\n end",
"def project_license_content\n project.license_file.nil? ? \"\" : IO.read(File.join(Config.project_root, project.license_file))\n end",
"def license\n conf['license'] || proj.license\n end",
"def license(arg = nil)\n set_or_return(\n :license,\n arg,\n kind_of: [ String ]\n )\n end",
"def lic_path\n @lic_path ||= Pathname.new(configured_lic_path.path).expand_path(root)\n end",
"def license\n if ladnn?\n [\"https://creativecommons.org/licenses/by/4.0/\"]\n else\n # If it's populated, DLCS uses MARC IDs, not labels, so we don't need to map like w/ resource_type\n map_field(:license)\n end\n end",
"def license name\n self.licenses << name.to_s\n end",
"def license_as_uri\n # no mapping for `license_text` as this gets checked and ingested as a `rights` field in Fedora Item\n return nil if license == 'license_text'\n\n code = LICENSE_TO_URI_CODE.fetch(license.to_sym)\n CONTROLLED_VOCABULARIES[:license].send(code)\n end",
"def license\n @flickr.photos.licenses[self.license_id]\n end",
"def render_license\n return '' unless @document\n return '' unless @document[:license_tesim]\n license = @document[:license_tesim].first\n if license.match?(/creativecommons.org/)\n data = license_markup\n data.html_safe\n else\n license\n end\n end",
"def license\n FFI::GDAL.GDALVersionInfo('LICENSE')\n end",
"def detect_license(repo, files)\n file = JavaProject.new(repo, files).matched_file\n return nil unless file\n LicenseeFile.new(file)\n end",
"def license_info\n self.dig_for_array(\"licenseInfo\")\n end",
"def show_license(license)\n # Checks if lang is nil and we want to show the license\n if license && SHOW_LICENSE\n %Q(\n <section class=\"gh-card-license\">\n <p class=\"text-grey\">#{license}</p>\n <svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 14 16\" width=\"14\"><path fill-rule=\"evenodd\" d=\"M7 4c-.83 0-1.5-.67-1.5-1.5S6.17 1 7 1s1.5.67 1.5 1.5S7.83 4 7 4zm7 6c0 1.11-.89 2-2 2h-1c-1.11 0-2-.89-2-2l2-4h-1c-.55 0-1-.45-1-1H8v8c.42 0 1 .45 1 1h1c.42 0 1 .45 1 1H3c0-.55.58-1 1-1h1c0-.55.58-1 1-1h.03L6 5H5c0 .55-.45 1-1 1H3l2 4c0 1.11-.89 2-2 2H2c-1.11 0-2-.89-2-2l2-4H1V5h3c0-.55.45-1 1-1h4c.55 0 1 .45 1 1h3v1h-1l2 4zM2.5 7L1 10h3L2.5 7zM13 10l-1.5-3-1.5 3h3z\"></path></svg>\n </section>)\n end\n end",
"def license_image_file_url\n case self.license\n when \"cc-by-sa-3.0\"\n \"http://i.creativecommons.org/l/by-sa/3.0/80x15.png\"\n when \"cc-by-nc-sa-2.0-uk\"\n nil\n end\n end",
"def get_license_info(token)\n licenses = Hash.new\n licenses[\"cc-by\"] = { :name => 'Attribution', :url => 'https://creativecommons.org/licenses/by/4.0' }\n licenses[\"cc-by-nd\"] = { :name => 'Attribution-NoDerivs', :url => 'https://creativecommons.org/licenses/by-nd/4.0' }\n licenses[\"cc-by-sa\"] = { :name => 'Attribution-ShareAlike', :url => 'https://creativecommons.org/licenses/by-sa/4.0' }\n licenses[\"cc-by-nc\"] = { :name => 'Attribution-NonCommercial', :url => 'https://creativecommons.org/licenses/by-nc/4.0' }\n licenses[\"cc-by-nc-sa\"] = { :name => 'Attribution-NonCommercial-ShareAlike', :url => 'https://creativecommons.org/licenses/by-nc-sa/4.0' }\n licenses[\"cc-by-nc-nd\"] = { :name => 'Attribution-NonCommercial-NoDerivs', :url => 'https://creativecommons.org/licenses/by-nc-nd/4.0' }\n license_info = licenses[token]\nend",
"def license_as_uri\n # no mapping for `license_text` as this gets checked and ingested as a `rights` field in Fedora Item\n return nil if license == 'license_text'\n\n code = LICENSE_TO_URI_CODE.fetch(license.to_sym)\n\n ControlledVocabulary.era.license.from_value(code) || ControlledVocabulary.era.old_license.from_value(code)\n end",
"def download_license(license_id)\n\t\tmethod = \"GET\"\n\t\tendpoint = \"licensekey/\" << license_id\n\t\turi = ApiUri.build_uri(endpoint)\n\t\treturn self.client.request(method, uri)\n\tend",
"def render_license\n return 'No license recorded' unless @document\n return 'No license recorded' unless @document[:license_tesim]\n license = @document[:license_tesim].first\n if license.match?(/creativecommons.org/)\n data = license_markup\n data.html_safe # rubocop:disable Rails/OutputSafety\n else\n license\n end\n end",
"def license(dir = Dir.pwd,\n license = FalkorLib::Config::Bootstrap::DEFAULTS[:metadata][:license],\n authors = '',\n options = {\n :filename => 'LICENSE'\n })\n return if ((license.empty?) or (license == 'none') or (license =~ /^CC/))\n return unless FalkorLib::Config::Bootstrap::DEFAULTS[:licenses].keys.include?( license )\n info \"Generate the #{license} licence file\"\n path = normalized_path(dir)\n use_git = FalkorLib::Git.init?(path)\n rootdir = (use_git) ? FalkorLib::Git.rootdir(path) : path\n Dir.chdir( rootdir ) do\n run %( licgen #{license.downcase} #{authors} )\n run %( mv LICENSE #{options[:filename]} ) if( options[:filename] and options[:filename] != 'LICENSE')\n end\n end",
"def license=(value)\n @license = value\n end",
"def license_title\n case self.license\n when \"cc-by-sa-3.0\"\n \"Creative Commons Attribution ShareAlike 3.0\"\n when \"cc-by-nc-sa-2.0-uk\"\n \"Creative Commons Attribution-NonCommerical-ShareAlike 2.0 UK: England & Wales\"\n end\n end",
"def license_files\n @license_files ||= []\n end",
"def sources_license_path(sources)\n common_prefix = Pathname.common_prefix(*sources).to_path\n\n # don't allow the repo root to be used as common prefix\n # the project this is run for should be excluded from the manifest,\n # or ignored in the config. any license in the root should be ignored.\n return common_prefix if common_prefix != Licensed::Git.repository_root\n\n # use the first source file as the license path.\n sources.first\n end",
"def find_licenses_in_source\n license_files = []\n\n @find_class.find(@gem_source) do |path|\n license_files << path if path.include?(\"LICENSE\")\n end\n\n license_files\n end",
"def get_license_type\n return Rails.application.config.x.license_types.key(self.copyright_license)\n end",
"def submodule_license(submodule)\n # Prefer Licensee to detect a submodule's license\n project = Licensee.project(submodule, detect_packages: true, detect_readme: true)\n return project.license.key if project.licenses.length == 1 && !project.license.pseudo_license?\n\n # If we have more than one license, return the first one that isn't a\n # pseudo-license (other or no-license), if any\n if project.licenses.length > 1\n first_real_license = project.licenses.reject{ |f| f.pseudo_license? }.first\n return first_real_license.key unless first_real_license.nil?\n end\n\n # We know a license exists, but no method was able to recognize it.\n # We return the license hash in this case, to uniquely identify it.\n if project.license_file\n return project.license_file.content_hash\n elsif project.readme\n return project.readme.content_hash\n end\n end",
"def licenses\n data[:licenses]\n end",
"def display_license\n return _('None specified') if @research_output.license.blank?\n\n @research_output.license.name\n end",
"def license_model\n data[:license_model]\n end",
"def license_plate\r\n\t\t\t@license ||= json['licensePlate'].gsub(' ', '')\r\n\t\tend",
"def customized_licenses\n @research_output.plan.template.licenses.map { |license| [\"#{license.identifier} (#{license.name})\", license.id] }\n end",
"def license_key\n config.license_key ||= create_license_key\n end",
"def licenses\n licenses = []\n uris = metadata[dataset_uri][dct.license.to_s]\n if uris.nil?\n []\n else\n uris.each do |uri|\n l = metadata[uri]\n licenses << License.new(:uri => uri, :name => l[dct.title.to_s])\n end\n return licenses\n end\n rescue\n []\n end",
"def get_file(path)\n uri = URI.join('https://stellar.mit.edu', path)\n @mech.get_file uri\n end",
"def set_license\n @license = License.find(params[:id])\n end",
"def set_license\n License.where(name: params[:name]).exists? ? @license = License.find_by(name: params[:name]) : @license = License.find(params[:name])\n end",
"def set_license\n @license = License.find(params[:id])\n end",
"def set_license\n @license = License.find(params[:id])\n end",
"def set_license\n @license = License.find(params[:id])\n end",
"def licenses\n @licenses ||= []\n end",
"def license_object(infos)\n {\n name: infos.delete(:license),\n url: infos.delete(:license_url)\n }.delete_if { |_, value| value.blank? }\n end",
"def license_type\n return @license_type\n end",
"def select_licence(default_licence = FalkorLib::Config::Bootstrap::DEFAULTS[:metadata][:license],\n _options = {})\n list_license = FalkorLib::Config::Bootstrap::DEFAULTS[:licenses].keys\n idx = list_license.index(default_licence) unless default_licence.nil?\n select_from(list_license,\n 'Select the license index for this project:',\n (idx.nil?) ? 1 : idx + 1)\n #licence\n end",
"def get_license(license_id, opts = {})\n data, _status_code, _headers = get_license_with_http_info(license_id, opts)\n data\n end",
"def get_license_with_http_info(license_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LicenseApi.get_license ...'\n end\n # verify the required parameter 'license_id' is set\n if @api_client.config.client_side_validation && license_id.nil?\n fail ArgumentError, \"Missing the required parameter 'license_id' when calling LicenseApi.get_license\"\n end\n # resource path\n local_var_path = '/v1/license/{licenseId}'.sub('{' + 'licenseId' + '}', CGI.escape(license_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\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] || 'License' \n\n # auth_names\n auth_names = opts[:auth_names] || ['X-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: LicenseApi#get_license\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_license\n @license = License.find(params[:license_id])\n end",
"def show\n @user = current_user\n id = @license._id.to_s\n unless @user.is_admin\n redirect_to root_path, notice: 'Вы не имеете прав на просмотр этой страницы.' if @license.user_id != current_user.id\n end\n if @user.is_admin or @user.licensed\n if params[:lic] \n # file = \"#{Rails.root}/tmp/license_#{id.reverse}.lic\"\n # File.open(file, 'wb' ){|f| f.write(@license.licensefile.data)}\n # send_file(file, filename: \"license.lic\", type: \"application/octet-stream\")\n send_data @license.licensefile.data, filename: \"license.lic\", type: \"application/octet-stream\"\n elsif params[:key]\n file = \"#{Rails.root}/tmp/license_#{id.reverse}.key\"\n %x( encode #{@license.key} #{file} )\n key = File.read(file)\n File.delete(file)\n send_data key, filename: \"license.key\", type: \"application/octet-stream\"\n # send_file(\"#{Rails.root}/tmp/license_#{id.reverse}.key\", filename: \"license.key\", type: \"application/octet-stream\")\n end\n else\n @license = @user.order.select{|ord|ord.license.find(params[:name])} if @user.order.select{|ord|ord.license.where(name: params[:name]).exists?}\n \n if params[:lic] \n # file = \"#{Rails.root}/tmp/license_#{id.reverse}.lic\"\n # File.open(file, 'wb' ){|f| f.write(@license.licensefile.data)}\n # send_file(file, filename: \"license.lic\", type: \"application/octet-stream\")\n send_data @license.licensefile.data, filename: \"license.lic\", type: \"application/octet-stream\"\n elsif params[:key]\n file = \"#{Rails.root}/tmp/license_#{id.reverse}.key\"\n %x( encode #{@license.key} #{file} )\n key = File.read(file)\n File.delete(file)\n send_data key, filename: \"license.key\", type: \"application/octet-stream\"\n end\n end\n\n end",
"def version_file(path)\n \"#{@home}/versions/#{@version_name}/#{path}\"\nend",
"def create_software_license_files\n license_map.each do |name, values|\n license_files = values[:license_files]\n\n license_files.each do |license_file|\n if license_file\n output_file = license_package_location(name, license_file)\n\n if local?(license_file)\n input_file = File.expand_path(license_file, values[:project_dir])\n if File.exist?(input_file)\n FileUtils.cp(input_file, output_file)\n File.chmod 0644, output_file unless windows?\n else\n licensing_warning(\"License file '#{input_file}' does not exist for software '#{name}'.\")\n end\n else\n begin\n download_file!(license_file, output_file, enable_progress_bar: false)\n File.chmod 0644, output_file unless windows?\n rescue SocketError,\n Errno::ECONNREFUSED,\n Errno::ECONNRESET,\n Errno::ENETUNREACH,\n Timeout::Error,\n OpenURI::HTTPError,\n OpenSSL::SSL::SSLError\n licensing_warning(\"Can not download license file '#{license_file}' for software '#{name}'.\")\n end\n end\n end\n end\n end\n end",
"def create_software_license_files\n license_map.each do |name, values|\n license_files = values[:license_files]\n\n license_files.each do |license_file|\n if license_file\n output_file = license_package_location(name, license_file)\n\n if local?(license_file)\n input_file = File.expand_path(license_file, values[:project_dir])\n if File.exist?(input_file)\n FileUtils.cp(input_file, output_file)\n else\n licensing_warning(\"License file '#{input_file}' does not exist for software '#{name}'.\")\n end\n else\n begin\n download_file!(license_file, output_file, enable_progress_bar: false)\n rescue SocketError,\n Errno::ECONNREFUSED,\n Errno::ECONNRESET,\n Errno::ENETUNREACH,\n Timeout::Error,\n OpenURI::HTTPError\n licensing_warning(\"Can not download license file '#{license_file}' for software '#{name}'.\")\n end\n end\n end\n end\n end\n end",
"def getsfLma__LicenseObjName\r\n\t\t\treturn \"sfLma__License__c\"\r\n\t\tend",
"def license_file?(file)\n LICENSE_FILES.any? do |license|\n license.is_a?(Regexp) ? license.match(file) : license == file\n end\n end",
"def license_builder\n ManifestBuilder::LicenseBuilder\n end",
"def licenses\n if @licenses.nil?\n @licenses = self.links.select do |link|\n link.rel == \"license\"\n end\n end\n return @licenses\n end",
"def prompt_for_license(resource, versioned_resource)\n license = Seek::License.find(versioned_resource.license)\n return unless (license.nil? || license.is_null_license?) && resource.can_manage?\n content_tag(:hr) +\n content_tag(:p) do\n link_to('Click here to choose a license', polymorphic_path(resource, action: :edit, anchor: 'license-section'))\n end\n end",
"def license_model\n @dbi.license_model\n end",
"def license_model\n @dbi.license_model\n end",
"def get_customer_license(custid = nil)\r\n\r\n raise ArgumentError.new(\"Customer id should not be nil/blank\") if custid.nil?\r\n\r\n suburl = \"&action=get_customer_license\"\r\n suburl << \"&custid=\" + custid.to_s\r\n\r\n call_target_url(suburl) # call private method\r\n\r\n end",
"def submodule_licenses\n @@submodule_licenses ||= begin\n submodules = {}\n submodule_paths.each { |submodule| submodules[submodule] = submodule_license(submodule) }\n submodules\n end\n end",
"def show\n @license = License.find(params[:id])\n respond_with(@license)\n end",
"def get_packages!(path)\n response = Api::Request.new do |request|\n request[:sign] = false\n request[:method] = :GET\n request[:path] = \"/shared/packages/#{path}\"\n end.execute!\n\n Object::File.open(path, 'wb') do |file|\n file.write(response)\n end\n\n path\n end",
"def northern_irish_driving_licence; end",
"def get_licenses_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LicenseApi.get_licenses ...'\n end\n # resource path\n local_var_path = '/v1/license'\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[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<License>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['X-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: LicenseApi#get_licenses\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def licenses(top, output_file = nil, prv_release = nil, cur_release = nil)\n api_licenses = CLicenseModuleInfo.new(top, \"MESA\")\n\n license_options = Hash.new()\n license_options[:release_version_prv] = prv_release\n license_options[:release_version_cur] = cur_release\n\n license_options[:hdr_pre] = \"This file provides a summary of the licenses included in or used by the MESA\\n\"\n license_options[:hdr_pre] += \"sources, along with the raw licenses for each package.\\n\"\n license_options[:hdr_pre] += \"\\n\"\n license_options[:hdr_pre] += \"Notice: The MESA package includes pre-built binary firmware images. These\\n\"\n license_options[:hdr_pre] += \" images consist of the binary MESA artifacts appended to a BSP.\\n\"\n license_options[:hdr_pre] += \" The combined set of licenses for these images can be found in\\n\"\n license_options[:hdr_pre] += \" ./bin/<preset>/licenses.txt\\n\"\n license_options[:hdr_pre] += \"\\n\"\n\n license_options[:hdr_post] = \"\\n\"\n license_options[:hdr_post] += \"To obtain the source, please contact sales/marketing\\n\\n\"\n license_options[:hdr_post] += \"\\n\"\n\n licenses = CLicenseCollection.new(\"MESA\", license_options)\n licenses.concat(api_licenses)\n if output_file\n File.open(output_file, \"w\") do |lic|\n licenses.write(lic)\n end\n else\n licenses.write()\n end\nend",
"def singapore_license_plate\n key = 'vehicle.license_plate'\n plate_number = regexify(bothify(fetch(key)))\n \"#{plate_number}#{singapore_checksum(plate_number)}\"\n end",
"def file(path)\n file = opened_crate.dereference(path)\n if file\n file.source\n else\n opened_crate.find_entry(path)\n end\n end",
"def set_diriving_license\n @diriving_license = DirivingLicense.friendly.find(params[:id])\n end",
"def find_license_by_id(id, opts = {})\n data, _status_code, _headers = find_license_by_id_with_http_info(id, opts)\n data\n end",
"def nuspec_local_license_file\n return @nuspec_local_license_file if defined?(@nuspec_local_license_file)\n return unless nuspec_contents\n\n match = nuspec_contents.match LICENSE_FILE_REGEX\n return unless match && match[1]\n\n license_path = File.join(File.dirname(nuspec_path), match[1])\n return unless File.exist?(license_path)\n\n license_data = File.read(license_path)\n @nuspec_local_license_file = Licensee::ProjectFiles::LicenseFile.new(license_data, license_path)\n end",
"def get_file(path)\n if not @files[path]\n file_not_found(path)\n end\n \n return Chance.get_file(@files[path])\n end",
"def license_items\n license_id = unsafe_params[\"license_id\"]\n unless license_id.is_a?(Numeric) && (license_id.to_i == license_id) ||\n license_id.is_a?(String) && license_id.to_i.positive?\n raise \"License license_id needs to be an Integer\"\n end\n\n # Check if the license exists and is editable by the user. Throw 404 if otherwise.\n License.editable_by(@context).find(license_id)\n\n items_to_license = unsafe_params[\"items_to_license\"]\n if items_to_license.is_a?(String)\n items_to_license = [items_to_license]\n elsif items_to_license.is_a?(Array) && items_to_license.any? { |item| item.is_a?(String) }\n raise \"License items_o_license needs to be an Array of Strings\"\n end\n\n items_licensed = []\n LicensedItem.transaction do\n items_to_license.each do |item_uid|\n item = item_from_uid(item_uid)\n if item.editable_by?(@context) && %w(asset file).include?(item.klass)\n items_licensed << LicensedItem.find_or_create_by(license_id: license_id,\n licenseable: item).id\n end\n end\n end\n\n render json: { license_id: license_id, items_licensed: items_licensed }\n end",
"def copyright_file\n if @package.copyright and @package.copyright != \"\"\n tfile = Tempfile.new('copyright') \n File.open(tfile, 'w') { |f| f.puts @package.copyright }\n tfile.path\n else\n nil\n end\n end",
"def get_file(path)\n raise FileNotFoundError.new(path) unless @files[path]\n \n return Chance.get_file(@files[path])\n end",
"def api_v11_cm_license_get(opts = {})\n api_v11_cm_license_get_with_http_info(opts)\n return nil\n end",
"def get_license_listing_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LicenseApi.get_license_listing ...'\n end\n # resource path\n local_var_path = '/v1/license/concise'\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[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<License>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['X-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: LicenseApi#get_license_listing\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def report(context, repo, repodir)\n\n begin\n project=Licensee::GitProject.new(repodir)\n ignore=project.license # Tests for the error\n rescue ArgumentError\n return \" <reporting class='repo-report' repo='#{repo.full_name}' type='LicenseReporter'>License causes ArgumentError</reporting>\\n\"\n rescue Rugged::ReferenceError\n return \" <reporting class='repo-report' repo='#{repo.full_name}' type='LicenseReporter'>License causes RuggedError</reporting>\\n\"\n end\n\n unless(project.matched_file)\n return \" <reporting class='repo-report' repo='#{repo.full_name}' type='LicenseReporter'>No License File Found</reporting>\\n\"\n end\n\n if(project.matched_file.confidence == '100')\n return \" <license repo='#{repo.full_name}' file='#{project.matched_file.filename}' confidence='#{project.matched_file.confidence}'>#{project.license.name}</license>\\n\"\n end\n\n if(project.matched_file.hash)\n if(context.dashboard_config['LicenseReporter'] and context.dashboard_config['LicenseReporter']['license-hashes'])\n license_hashes_file=context.dashboard_config['LicenseReporter']['license-hashes']\n license_hashes = YAML.load(File.read(license_hashes_file))\n \n license_hashes['license-hashes'].each do |custom_hash|\n if(project.matched_file.hash == custom_hash['hash'])\n return \" <license repo='#{repo.full_name}' file='#{project.matched_file.filename}' confidence='100'>#{custom_hash['name']}</license>\\n\"\n end\n end\n end\n end\n\n if(project.license)\n return \" <license repo='#{repo.full_name}' file='#{project.matched_file.filename}' confidence='#{project.matched_file.confidence}'>#{project.license.name}</license>\\n\"\n else\n return \" <reporting class='repo-report' repo='#{repo.full_name}' type='LicenseReporter'><file>#{project.matched_file.filename}</file><message>License unrecognized (hash:#{project.matched_file.hash})</message></reporting>\\n\"\n end\n\n end",
"def licenses\n publisher_id = current_user.id\n @licenses = PowerChip.where(:publisher_id=>publisher_id)\n respond_to do |format|\n format.html # licenses.html.erb\n format.json { render json: @licenses }\n end\n end",
"def license_plate(state_abbreviation: '')\n return regexify(bothify(fetch('vehicle.license_plate'))) if state_abbreviation.empty?\n\n key = \"vehicle.license_plate_by_state.#{state_abbreviation}\"\n regexify(bothify(fetch(key)))\n end",
"def license_link(book)\n case book.license\n when nil\n return 'None<a class=\"btn btn-mini\" href=\"/books/' + book.id.to_s + '#license\">Choose a License</a>'\n when \"cc-by\"\n return '<a href=\"' + book.license_url + '\" class=\"linked-icon\" title=\"' + book.license_name + '\"><span class=\"icon-cc\"></span><span class=\"icon-cc-by\"></span><span class=\"cc-title\">' + book.license_name + '</span></a>'\n when \"cc-by-nd\"\n return '<a href=\"' + book.license_url + '\" class=\"linked-icon\" title=\"' + book.license_name + '\"><span class=\"icon-cc\"></span><span class=\"icon-cc-by\"></span><span class=\"icon-cc-nd\"></span><span class=\"cc-title\">' + book.license_name + '</span></a>'\n when \"cc-by-sa\"\n return '<a href=\"' + book.license_url + '\" class=\"linked-icon\" title=\"' + book.license_name + '\"><span class=\"icon-cc\"></span><span class=\"icon-cc-by\"></span><span class=\"icon-cc-sa\"></span><span class=\"cc-title\">' + book.license_name + '</span></a>'\n when \"cc-by-nc\"\n return '<a href=\"' + book.license_url + '\" class=\"linked-icon\" title=\"' + book.license_name + '\"><span class=\"icon-cc\"></span><span class=\"icon-cc-by\"></span><span class=\"icon-cc-nc\"></span><span class=\"cc-title\">' + book.license_name + '</span></a>'\n when \"cc-by-nc-sa\"\n return '<a href=\"' + book.license_url + '\" class=\"linked-icon\" title=\"' + book.license_name + '\"><span class=\"icon-cc\"></span><span class=\"icon-cc-by\"></span><span class=\"icon-cc-nc\"></span><span class=\"icon-cc-sa\"></span><span class=\"cc-title\">' + book.license_name + '</span></a>'\n when \"cc-by-nc-nd\"\n return '<a href=\"' + book.license_url + '\" class=\"linked-icon\" title=\"' + book.license_name + '\"><span class=\"icon-cc\"></span><span class=\"icon-cc-by\"></span><span class=\"icon-cc-nc\"></span><span class=\"icon-cc-nd\"></span><span class=\"cc-title\">' + book.license_name + '</span></a>'\n else\n # This is an \"Other\" license.\n # @todo, I could simplify the schema a bit by getting rid of the \"Other license\" field and just\n # allowing their custom license to be placed in the \"license\" field.\n return '<a href=\"' + Rack::Utils.escape_html(book.license_url) + '\" title=\"' + book.license_name + '\">' + Rack::Utils.escape_html(book.license_name) + '</a>'\n end\n end",
"def license=(o)\n self.licenses = [o]\n end",
"def licenses(options = {})\n Licensee::License.all(options)\n end",
"def license_package_location(component_name, where)\n if local?(where)\n File.join(output_dir, \"#{component_name}-#{File.split(where).last}\")\n else\n u = URI(where)\n File.join(output_dir, \"#{component_name}-#{File.basename(u.path)}\")\n end\n end",
"def license_allows_download?(document)\n document[:license_ss] =~ /(Creative Commons|No known restrictions)/\n end"
] | [
"0.7683035",
"0.74824435",
"0.7099152",
"0.70910287",
"0.6921656",
"0.6828952",
"0.68228656",
"0.6766218",
"0.67525727",
"0.6741766",
"0.66850466",
"0.6644496",
"0.6614537",
"0.6590169",
"0.6530255",
"0.65026665",
"0.64850676",
"0.647243",
"0.6460033",
"0.6417067",
"0.6340329",
"0.6335096",
"0.6243446",
"0.6226491",
"0.61940336",
"0.6188417",
"0.6186812",
"0.6151815",
"0.61416304",
"0.6091132",
"0.6089261",
"0.60561323",
"0.6034113",
"0.60292566",
"0.6013194",
"0.5994396",
"0.59932786",
"0.5965949",
"0.5943263",
"0.58947355",
"0.58362556",
"0.5833936",
"0.57915777",
"0.5763547",
"0.5733517",
"0.572572",
"0.57236016",
"0.57224154",
"0.57106423",
"0.56993616",
"0.56889",
"0.56858265",
"0.56788296",
"0.567069",
"0.567069",
"0.567069",
"0.5636651",
"0.56365883",
"0.5636438",
"0.5550051",
"0.55453295",
"0.5527899",
"0.5526043",
"0.55215245",
"0.54978853",
"0.5481614",
"0.54667157",
"0.5464462",
"0.5421147",
"0.54126513",
"0.5396906",
"0.5373763",
"0.5372443",
"0.5372443",
"0.5370519",
"0.53665733",
"0.53651273",
"0.5363781",
"0.53594154",
"0.5357362",
"0.533203",
"0.5327529",
"0.5326864",
"0.53164184",
"0.53138834",
"0.5295105",
"0.52832353",
"0.52777636",
"0.52457577",
"0.523454",
"0.5228632",
"0.5228377",
"0.5223104",
"0.5212159",
"0.5204809",
"0.51859576",
"0.5173568",
"0.5168027",
"0.51412135",
"0.51373446"
] | 0.86217886 | 0 |
Inverse of the confidence threshold, represented as a float By default this will be 0.1 | def inverse_confidence_threshold
@inverse ||= (1 - Licensee.confidence_threshold / 100.0).round(2)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inverse_brightness\n @base.brightness > 0.5 ? -1 : 1\n end",
"def threshold(x)\n\t\tx > 0 ? 1.0 : 0.0\n\tend",
"def confidence_lowered\n @positions.transform_values! {|value| value - 1}\n @positions.delete_if {|key, value| value == 0 }\n end",
"def inverse()\n map_hash{|k,v|[k,1/v] if v > 0}.to_p\n end",
"def cdf_inverse(confidence)\n a = [0, -3.969683028665376e+01, 2.209460984245205e+02, -2.759285104469687e+02, 1.383577518672690e+02, -3.066479806614716e+01, 2.506628277459239e+00]\n b = [0, -5.447609879822406e+01, 1.615858368580409e+02, -1.556989798598866e+02, 6.680131188771972e+01, -1.328068155288572e+01]\n c = [0, -7.784894002430293e-03, -3.223964580411365e-01, -2.400758277161838e+00, -2.549732539343734e+00, 4.374664141464968e+00, 2.938163982698783e+00]\n d = [0, 7.784695709041462e-03, 3.224671290700398e-01, 2.445134137142996e+00, 3.754408661907416e+00]\n p_low = 0.02425\n p_high = 1.0 - p_low\n\n x = 0.0\n q = 0.0\n if 0.0 < confidence && confidence < p_low\n q = Math.sqrt(-2.0 * Math.log(confidence))\n x = (((((c[1] * q + c[2]) * q + c[3]) * q + c[4]) * q + c[5]) * q + c[6]) / ((((d[1] * q + d[2]) * q + d[3]) * q + d[4]) * q + 1.0)\n elsif p_low <= confidence && confidence <= p_high\n q = confidence - 0.5\n r = q * q\n x = (((((a[1] * r + a[2]) * r + a[3]) * r + a[4]) * r + a[5]) * r + a[6]) * q / (((((b[1] * r + b[2]) * r + b[3]) * r + b[4]) * r + b[5]) * r + 1.0)\n elsif p_high < confidence && confidence < 1.0\n q = Math.sqrt(-2.0 * Math.log(1.0 - confidence))\n x = -(((((c[1] * q + c[2]) * q + c[3]) * q + c[4]) * q + c[5]) * q + c[6]) / ((((d[1] * q + d[2]) * q + d[3]) * q + d[4]) * q + 1.0)\n end\n pi = Math::PI\n if 0 < confidence && confidence < 1\n e = 0.5 * Math.erfc(-x / Math.sqrt(2.0)) - confidence\n u = e * Math.sqrt(2.0 * pi) * Math.exp((x**2.0) / 2.0)\n x = x - u / (1.0 + x * u / 2.0)\n end\n x\n end",
"def slightly_increase_confidence\r\n @confidence += LOW unless impossible\r\n end",
"def threshold\n @threshold || 95\n end",
"def confidenceLo\n end",
"def inverse!\r\n conjugate!\r\n scale!(1.0/norm)\r\n end",
"def desaturate(value=0)\n return self.saturate(-value)\n end",
"def threshold_spy\n puts \"Ergebnis:\"\n puts (@spy_level_defender - @spy_level_attacker)*0.05+0.5 \n return (@spy_level_defender - @spy_level_attacker)*0.05+0.5 \n end",
"def ir_azucares \n\t\t@ir_azucares = (@azucares/90.to_f)*100\n\t\t@ir_azucares.round(1)\n\tend",
"def ci_plusminus(confidence = 0.95)\n require 'statistics2'\n n = votes.size\n if n == 0\n return 0\n end\n z = Statistics2.pnormaldist(1 - (1 - confidence) / 2)\n phat = 1.0 * votes_for / n\n (phat + z * z / (2 * n) - z * Math.sqrt((phat * (1 - phat) + z * z / (4 * n)) / n)) / (1 + z * z / n)\n end",
"def non_negative_float(value, epsilon: nil)\n result = to_float(value) or return\n result unless epsilon ? (result < -epsilon) : result.negative?\n end",
"def variance_percent\n if [300, 700, 1200].include? upper_threshold\n 0.01\n elsif [2000, 2800].include? upper_threshold\n 0.015\n else\n 0\n end\n end",
"def normalize(value)\n return 0.0 if near_zero_or_less? value\n return 1.0 if near_one_or_more? value\n value\n end",
"def horizontal_brighting_correction_factor\n adjusted_global_horizontal_irradiance = @global_horizontal_irradiance < SMALL_VALUE_FOR_SKY_DIFFUSE_IRRADIANCE ? SMALL_VALUE_FOR_SKY_DIFFUSE_IRRADIANCE : @global_horizontal_irradiance\n # In PVLIB_MatLab as well as PVLIB_Python, there is a following adjustment. \n # However, all the negative numbers are already converted to SMALL_VALUE_FOR_SKY_DIFFUSE_IRRADIANCE in the above statement, \n # the following statement doesn't do anything. \n # I'm just writing it to remind that it is there in PVLIB_MatLab and PVLIB_Python. \n # adjusted_global_horizontal_irradiance = @global_horizontal_irradiance < BigDecimal('0') ? BigDecimal('0') : @global_horizontal_irradiance\n bigdecimal_sqrt(horizontal_beam_irradiance / adjusted_global_horizontal_irradiance)\n end",
"def cut_factor\r\n return 0.0\r\n end",
"def threshold_y\n @zac\n end",
"def inverse_brightness\n h, s, l, a = self.to_hsl\n l = 100 - l\n return self.from_hsl([h, s, l, a])\n end",
"def invert; end",
"def confidenceHi\n end",
"def inverse_f\n return 0 if f_x.zero?\n temp_value = i = 0\n while temp_value <= f_x && i < n\n temp_value = gsl_cdf.binomial_P(i, p, n)\n next if temp_value >= f_x\n i += 1\n end\n i.zero? ? 0 : i - 1\n end",
"def inverse; end",
"def inverse; end",
"def invert\n end",
"def opposite(num)\n if num < 0\n return num.abs\n else num >= 0\n return num * -1 end\nend",
"def inverse\r\n quaternion.inverse!\r\n end",
"def expectation\n -1.0 / (@weights.n - 1)\n end",
"def inverse\n Negation.new(self)\n end",
"def threshold_spy\n return (user_science_level(defender, spy_id) - user_science_level(attacker, spy_id))*0.05+0.5 \n end",
"def inf_norm\n self.to_a.map do |a|\n a.map do |ar|\n ar.abs\n end.inject(&:+)\n end.sort[0]\n end",
"def inverse\n end",
"def invert() end",
"def sanitize_interest(int)\n\t int < 1.0 ? int : (int / 100.0)\n end",
"def confidence; end",
"def inverse_f\n return 0 if f_x.zero?\n temp_value = i = 0\n while temp_value <= f_x && i < n\n temp_value = gsl_cdf.pascal_P(i, p, n)\n next if temp_value >= f_x\n i += 1\n end\n i.zero? ? 0 : i - 1\n end",
"def ifft\r\n inverse_strategy.new(data).calculate\r\n end",
"def calculate(threshold: 0.001, safety_net: false)\n dinv, b, l, u = @dinv, @b, @l, @u\n c = dinv * b\n t = -1 * dinv * (l + u)\n x_n = Matrix.column_vector(Array.new(@a.column_count, 0))\n counter = 0\n loop do \n x_n_plus_1 = c + t * x_n\n x_difference = (x_n_plus_1 - x_n).map{ |el| el.abs }\n # puts x_n_plus_1\n should_break = !x_difference.find{ |el| el > threshold }\n x_n = x_n_plus_1 \n break if should_break\n counter += 1\n if counter > 10000000 and safety_net \n return (@a.inv * b).map{ |el| el.to_f}\n end\n end \n return (safety_net and x_n.find{ |el| el.to_f.nan? }) ? (@a.inv * b).map{ |el| el.to_f} : x_n\n end",
"def vif # variance inflation factor\n @vif ||= 1 / ( 1 - r2 )\n end",
"def negate\n scale(-1.0)\n end",
"def get_neg_log(pval)\n if pval == 0\n return 50\n elsif pval == 1\n return 0.0\n else\n return -Math.log10(pval.to_f)\n end\n end",
"def act_f()\n (y() >= 0) ? 1.0 : -1.0;\n end",
"def threshold_x\n @zab\n end",
"def normalDistributionPValue(confidence)\n return Distribution::Normal.p_value(confidence)\n end",
"def kinployee_dissimilar_culture_score\n 1.0 - kinployee_similar_culture_score\n end",
"def opposite(x)\n x * -1\nend",
"def default_set(v)\n (sigmoid(v) * 2) - 1\n end",
"def unote_finale\n @unote_finale ||= begin\n r = ((unombre_points.to_f / nombre_points_total) * 20).round(1)\n r.to_i != r || r = r.to_i\n r\n end\n end",
"def round_off_percentage_px_increase\n (@percentage_px_increase*100).round\n end",
"def inversed_sum\n 1.0 / sum\n end",
"def above_zero(value)\n value.negative? ? 0 : value\n end",
"def confidence(bound = :lower)\n # include Math\n epsilon = 0.5 # Used for Lidstone smoothing\n up = up_votes + epsilon\n down = down_votes + epsilon\n n = up + down\n return 0 if n.zero?\n z = 1.4395314800662002 # Determines confidence to estimate.\n # 1.0364333771448913 = 70%\n # 1.2815515594600038 = 80%\n # 1.4395314800662002 = 85%\n # 1.644853646608357 = 90%\n # 1.9599639715843482 = 95%\n # 2.2414027073522136 = 97.5%\n p_hat = 1.0 * up / n\n left = p_hat + z * z / (2 * n)\n right = z * Math.sqrt((p_hat * (1 - p_hat) + z * z / (4 * n)) / n)\n under = 1 + z * z / n\n return (left - right) / under unless bound == :upper\n (left + right) / under\n # return Math.sqrt( p_hat + z * z / ( 2 * n ) - z * ( ( p_hat * ( 1 - p_hat ) + z * z / ( 4 * n ) ) / n ) ) / ( 1 + z * z / n )\n end",
"def percentage_off\n\t\t(you_save > 0) ? (you_save/100).round(2) : 0\n\tend",
"def opposite_color\n @base.brightness > 0.5 ? black : white\n end",
"def normal_minus\n api_get(API_MAP[:normal_minus]).to_f\n end",
"def disbursement_factor\n approved_amount == 0 ? 0 : disbursed_amount / approved_amount.to_f\n end",
"def inv\n Fraction.new(@denom, @numer)\n end",
"def cap_interruptions\n self.e_interruption = 100 if self.e_interruption > 100.0 \n self.i_interruption = 100 if self.i_interruption > 100.0\n \n self.e_interruption = 0 if self.e_interruption < 0.0 \n self.i_interruption = 0 if self.i_interruption < 0.0\n end",
"def ∞ℂ; ::Float::INFINITY_COMPLEX; end",
"def significant(value)\n normalized(value).remove!(' ')\n end",
"def probability_lower_than(value)\n probability_for_sides(:<, value)\n end",
"def opposite num\n -num\n end",
"def confidence_score\n to_nil _response_entity.fetch(\"confidenceScore\", nil)\n end",
"def clip n\n n < 0 ? 0.0 : n > 1 ? 1.0 : n\n end",
"def kinployment_dissimilar_culture_score\n 1.0 - kinployment_similar_culture_score\n end",
"def calculate_uncertainty(column)\n values = distribution.collect {|row| row[column]}\n col_type = schema.type column\n Veritable::Util.check_datatype(col_type, \"Calculate uncertainty -- \")\n n = values.size\n if col_type == 'boolean' or col_type == 'categorical'\n e = ((counts column).max_by {|k, v| v})[0]\n c = 1.0 - (values.count {|v| v == e} / n.to_f)\n c.to_f\n elsif col_type == 'count' or col_type == 'real'\n r = credible_values column\n (r[1] - r[0]).to_f\n end\n end",
"def opposite(number)\n return 0 - number\nend",
"def annuity_given_present(present_value, interest, term)\n interest = interest.to_f\n (present_value.to_f * ((interest * (1+interest) ** term) / (((1 + interest) ** term) -1))).round(4)\n end",
"def opposite(number)\n number*-1\nend",
"def invert(num) \n puts -num \nend",
"def negation\n attr_val('./@inversionInd') == \"true\"\n end",
"def decimal\n @decimal ||= implied_probability.decimal\n end",
"def decimal\n @decimal ||= implied_probability.decimal\n end",
"def get_inverse_sum\n sum = 0\n self.get_odd_names.each do |name|\n odd_value = self.best_odd_for(name).value\n sum = sum + 1.0 / odd_value\n end\n return sum\n end",
"def sigmoid x\n 1.0 / (1 + Math::E** -x)\n end",
"def normal?\n\t !self.significant?\n\t end",
"def relaxed_threshold(threshold)\n\t\tif threshold > @threshold_gap\n\t\t\trelaxed_threshold = threshold - @threshold_gap\n\t\telse\n\t\t\trelaxed_threshold = threshold\n\t\tend\n\t\trelaxed_threshold\n\tend",
"def negative\n abs.flip_sign\n end",
"def vat_spin_off()\n ((self.amount * self.vat.percentage) / (self.vat.percentage + 100))\n end",
"def flip_sign\n self * -1\n end",
"def undisbursed_amount_factor\n disbursement_remaining.to_f / Country.max_disbursement_remaining\n end",
"def og_prediction\n (1 + (0.035 * @efficiency * @grist_weight / @batch_volume)).round(3)\n end",
"def opposite(number)\r\n return number * (-1)\r\nend",
"def interest_discount(int_rate)\n\t int_rate = sanitize_interest(int_rate)\n\t 1.0 / (1.0 + int_rate)\n end",
"def ir_energetico \n\t\t@ener_ir = ener_kj\n\t\t@ir_energetico = (@ener_ir/8400.to_f) * 100\n\t\t@ir_energetico.round(1)\n\tend",
"def reliability\n (100.0 * self.surveyed / self.enrolled).round_to(0).to_i\n end",
"def full_coverage_phi\n PI - max_coverage_phi\n end",
"def ∅?; self.real.zero?; end",
"def inverse\n result = UnitQuaternion.new\n result.set(@beta0, *(-1*@beta_s))\n return result\n end",
"def biomagnetism_doughface_sissiness(avignonese_antrorsely)\n end",
"def sensitivity\n return @sensitivity\n end",
"def inverse\n inverse_powers = {}\n powers.each{ |u,p| inverse_powers[u] = -p }\n PhysicalQuantity.new(1.0/@quantity, inverse_powers)\n end",
"def rectified_liniar_unit(x)\n\t\tx > 0 ? x : 0.0\n\tend",
"def confidence95\n degfreedom = @reps[0] - 1\n student_t_quantile95(degfreedom) *\n (Si2(n) / @reps[0]) ** 0.5\n end",
"def p_burglary\n flip(0.001, :B, :notB)\nend",
"def analyze!\n if nova_score_above_threshold?\n APPROVE_VALUE\n else\n DENIAL_VALUE\n end\n end",
"def eround(decimal_points = 0)\n (\"%.#{decimal_points}e\" % self).to_f\n end",
"def sigmoid(x)\n\t\te = Math::E\n\t\t1.0 / (1 + e**(-x) )\n\tend",
"def positive_float(value, epsilon: nil)\n result = to_float(value) or return\n result if epsilon ? (result > +epsilon) : result.positive?\n end"
] | [
"0.6771814",
"0.6225526",
"0.6224604",
"0.598087",
"0.5944674",
"0.57596177",
"0.5613212",
"0.56006366",
"0.55319154",
"0.54572326",
"0.5448475",
"0.5445973",
"0.5438047",
"0.5371062",
"0.53431785",
"0.5311402",
"0.53051555",
"0.5297779",
"0.5294272",
"0.5287737",
"0.5282349",
"0.52771205",
"0.5273291",
"0.52591246",
"0.52591246",
"0.5255907",
"0.52445364",
"0.5240003",
"0.5236872",
"0.5229977",
"0.52266836",
"0.52261114",
"0.52191776",
"0.5216095",
"0.52136296",
"0.51728505",
"0.51727754",
"0.5168344",
"0.5167798",
"0.514787",
"0.5146404",
"0.5134581",
"0.51242673",
"0.51062644",
"0.51034415",
"0.510314",
"0.5099987",
"0.5094726",
"0.50722367",
"0.50703883",
"0.5044412",
"0.50409484",
"0.50359356",
"0.5032945",
"0.5026493",
"0.50251025",
"0.5023311",
"0.50175726",
"0.50059235",
"0.50015855",
"0.49945462",
"0.49817693",
"0.49774083",
"0.49755135",
"0.4967867",
"0.49622178",
"0.49620733",
"0.4958199",
"0.49568418",
"0.4956182",
"0.49544534",
"0.49522522",
"0.4939988",
"0.4939988",
"0.49352273",
"0.4928315",
"0.4927854",
"0.49248004",
"0.49182177",
"0.49172115",
"0.49108154",
"0.49101895",
"0.48984566",
"0.4894756",
"0.48929936",
"0.48798233",
"0.4868741",
"0.48679253",
"0.48670566",
"0.48591232",
"0.48502502",
"0.48294637",
"0.48266643",
"0.48190385",
"0.4812851",
"0.48011547",
"0.4801061",
"0.47848892",
"0.47650662",
"0.47647262"
] | 0.8523854 | 0 |
Create a new instance of a workitem belonging to its representation in the standard way Polarion does it | def initialize(filename)
@filename = filename
Powirb.log.debug("Retrieving workitem from #{@filename}")
begin
@doc = Nokogiri::XML(open(@filename))
rescue Exception => e
Powirb.log.error(e)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_owfe_workitem\n\n wi = OpenWFE::InFlowWorkItem.new\n\n wi.fei = full_fei\n wi.participant_name = participant_name\n wi.fields = YAML.load(self.wi_fields)\n\n wi.dispatch_time = dispatch_time\n wi.last_modified = last_modified\n\n wi\n end",
"def create_new_item( depositor, payload )\n\n ok = true\n work = GenericWork.create!( title: [ payload[ :title ] ] ) do |w|\n\n # generic work attributes\n w.apply_depositor_metadata( depositor )\n w.creator = depositor.email\n w.author_email = TaskHelpers.default_email( payload[ :author_computing_id ] ) if payload[ :author_computing_id ]\n w.author_first_name = payload[ :author_first_name ] if payload[ :author_first_name ]\n w.author_last_name = payload[ :author_last_name ] if payload[ :author_last_name ]\n w.author_institution = payload[ :institution ] if payload[ :institution ]\n w.contributor = payload[ :advisors ]\n w.description = payload[ :abstract ]\n w.keyword = payload[ :keywords ] if payload[ :keywords ]\n\n # date attributes\n w.date_created = payload[ :create_date ] if payload[ :create_date ]\n w.date_modified = DateTime.parse( payload[ :modified_date ] ) if payload[ :modified_date ]\n w.date_published = payload[ :issued ] if payload[ :issued ]\n\n # embargo attributes\n w.visibility = payload[:embargo_type ]\n w.embargo_state = payload[:embargo_type ]\n w.visibility_during_embargo = payload[:embargo_type ]\n w.embargo_end_date = payload[ :embargo_release_date ] if payload[ :embargo_release_date ]\n w.embargo_period = payload[ :embargo_period ] if payload[ :embargo_period ]\n\n # assume standard and published work type\n w.work_type = GenericWork::WORK_TYPE_THESIS\n w.draft = 'false'\n\n w.publisher = payload[ :publisher ] if payload[ :publisher ]\n w.department = payload[ :department ] if payload[ :department ]\n w.degree = payload[ :degree ] if payload[ :degree ]\n w.language = payload[ :language ] if payload[ :language ]\n\n w.notes = payload[ :notes ] if payload[ :notes ]\n w.rights = [ payload[ :rights ] ] if payload[ :rights ]\n w.license = GenericWork::DEFAULT_LICENSE\n\n w.admin_notes = payload[ :admin_notes ] if payload[ :admin_notes ]\n w.work_source = payload[ :source ] if payload[ :source ]\n\n end\n\n return ok, work\n end",
"def to_owfe_workitem (options={})\n\n wi = OpenWFE::InFlowWorkItem.new\n\n wi.fei = full_fei\n wi.participant_name = participant_name\n wi.attributes = fields_hash\n\n wi.dispatch_time = dispatch_time\n wi.last_modified = last_modified\n\n wi.db_id = self.id\n\n wi\n end",
"def to_ruote_workitem\n\n wi = Ruote::Workitem.new\n\n wi.fei = Ruote::FlowExpressionId.from_s(fei)\n wi.fields = Ruote::Json.decode(wi_fields)\n wi.participant_name = participant_name\n\n wi\n end",
"def workitem\n Workitem.new(@flow_expression.applied_workitem)\n end",
"def dup\n\n Workitem.new(Rufus::Json.dup(@h))\n end",
"def new_without_produce\n @work = Work.new\n end",
"def new\n @work = Work.new\n end",
"def applied_workitem\n\n @awi ||= Ruote::Workitem.new(h.applied_workitem)\n end",
"def fill_out_work(work)\n work.title = self.title\n\n if self.bib_number.present?\n work.build_external_id(category: \"bib\", value: self.bib_number)\n end\n if self.accession_number.present?\n work.build_external_id(category: \"accn\", value: self.accession_number)\n end\n if self.museum_object_id.present?\n work.build_external_id(category: \"object\", value: self.museum_object_id)\n end\n if self.box.present? || self.folder.present?\n work.physical_container = {box: self.box.presence, folder: self.folder.presence}\n end\n if self.dimensions.present?\n work.extent = self.dimensions\n end\n\n if self.collecting_area == \"archives\"\n work.department = \"Archives\"\n elsif self.collecting_area == \"rare_books\" || self.collecting_area == \"modern_library\"\n work.department = \"Library\"\n elsif self.collecting_area == \"museum\"\n work.department = \"Museum\"\n end\n\n end",
"def generate_new_item_object\n @new_item = Flight.new\n insert_required_params_into_new_item_object\n insert_default_params_into_new_item_object\n insert_optional_params_into_new_item_object(self)\n return @new_item\n end",
"def instantiate_new_item(name, parent, extra_state = {})\n parent = item_by_name(parent) unless parent.is_a?(StateItem)\n ss = parent.get_structure\n\n # The new instantiated item is different from the parent because\n # it has its own name, and because it can get named actions from\n # the parent as well as itself. The latter is important because\n # we can't easily make new action procs without an associated\n # World File of some kind.\n ss[1] = name\n ss[2] = deepcopy(ss[2])\n ss[2].merge!(extra_state)\n ss[2][\"parent\"] = parent.name\n\n child = register_state_item(StateItem.from_name_type(self, *ss))\n if @finished_init && child.respond_to?(:finished_init)\n child.finished_init\n end\n if child.get_action(\"new\")\n child.run_action(\"new\")\n end\n child\n end",
"def [](fei)\n\n doc = fetch(fei)\n\n doc ? Ruote::Workitem.new(doc) : nil\n end",
"def create_item\n object = @spawn_object.call\n\n object.pool_create if object.respond_to? :pool_create\n\n item = PoolItem.new(object)\n\n @item_stack.push(item)\n\n item\n end",
"def new_item(content)\n Item.new(:project_id => @project_id, :content => content)\n end",
"def copy(user_id, item_id)\n workflow = Workflow.new\n workflow.users = self.users\n workflow.status = self.status\n workflow.issued_at = self.issued_at\n workflow.decided_at = self.decided_at\n if self.original_by.nil? and self.user_id != 0\n workflow.original_by = self.user_id\n else\n workflow.original_by = self.original_by\n end\n workflow.item_id = item_id\n workflow.user_id = user_id\n\n workflow.save!\n\n return workflow\n end",
"def create(params = {})\n item = build(params)\n item.save\n item\n end",
"def create(work)\n @work = work\n @method = :create\n end",
"def encode_workitem\n\n workitem.as_json\n end",
"def create_item\n @item = Fox_Item.new(self, @content.join(\"\\t\"), @icon, @icon)\n end",
"def initialize\n create_new_rep\n end",
"def create_homework(homework)\n homeworks << homework\n end",
"def consume (workitem)\n\n workitem.attributes['compact_workitems'] = true if compact_workitems\n\n Workitem.from_owfe_workitem(workitem, @store_name)\n end",
"def create_from_scratch(attributes)\n element = new_from_scratch(attributes)\n element.save if element\n return element\n end",
"def create_from_scratch(attributes)\n element = new_from_scratch(attributes)\n element.save if element\n return element\n end",
"def create_intermediary_child_work(parent, file_set)\n new_child_work = GenericWork.new(title: file_set.title, creator: [current_user.user_key])\n new_child_work.apply_depositor_metadata(current_user.user_key)\n # make original fileset a member of our new child work\n self.class.add_to_parent(new_child_work, file_set, 0, make_thumbnail: true, make_representative: true)\n\n # and set the child work's metadata based on the parent work.\n\n # bibliographic\n attrs_to_copy = parent.attributes.sort.map { |a| a[0] }\n attrs_to_copy -= ['id', \"title\", 'lease_id', 'embargo_id', 'head', 'tail', 'access_control_id', 'thumbnail_id', 'representative_id' ]\n attrs_to_copy.each do |a|\n new_child_work[a] = parent[a]\n end\n\n # permissions-related\n new_child_work.visibility = parent.visibility\n new_child_work.embargo_release_date = parent.embargo_release_date\n new_child_work.lease_expiration_date = parent.lease_expiration_date\n parent_permissions = parent.permissions.map(&:to_hash)\n\n # member HAS to be saved to set it's permission attributes, not sure why.\n # extra saves make things extra slow. :(\n new_child_work.save!\n if parent_permissions.present?\n new_child_work.permissions_attributes = parent_permissions\n end\n # But now everything seems to be properly saved without need for another save.\n return new_child_work\n end",
"def work!(work_item)\n raise NotImplementedError\n end",
"def new\n @new_clone = Organism.new\n end",
"def create_new_work(params)\n @log.info 'Configuring work attributes'\n\n # set depositor\n depositor = User.find_by_user_key(@config['depositor'])\n raise 'User ' + @config['depositor'] + ' not found.' if depositor.nil?\n\n # set noid\n id = Noid::Rails::Service.new.minter.mint\n\n # set resource type\n resource_type = 'Thesis'\n unless params['resource_type'].first.nil?\n resource_type = params['resource_type'].first\n end\n\n # set visibility\n if params.key?('embargo_release_date')\n params['visibility_after_embargo'] = 'open'\n params['visibility_during_embargo'] = 'authenticated'\n else\n params['visibility'] = 'open'\n end\n\n # set admin set to deposit into\n unless @config['admin_set_id'].nil?\n params['admin_set_id'] = @config['admin_set_id']\n end\n\n # set campus\n params['campus'] = [@config['campus']]\n\n @log.info 'Creating a new ' + resource_type + ' with id:' + id\n\n if @config['type_to_work_map'][resource_type].nil?\n raise 'No mapping for ' + resource_type\n end\n\n model_name = @config['type_to_work_map'][resource_type]\n\n # student research but with a label that is otherwise Publication\n if params['degree_level'] || params['advisor']\n model_name = 'Thesis'\n end\n\n # create the actual work based on the mapped resource type\n model = Kernel.const_get(model_name)\n work = model.new(id: id)\n work.update(params)\n work.apply_depositor_metadata(depositor.user_key)\n work.save\n\n work\nend",
"def set_workitem\n @workitem = Workitem.find(params[:id])\n end",
"def consume (workitem)\n\n workitem.attributes['compact_workitems'] = true if compact_workitems\n\n Workitem.from_owfe_workitem workitem\n # does the 'saving to db'\n end",
"def create_item\n if @work_order_item.present?\n render json: :conflict, status: :conflict\n else\n @work_order_item = WorkOrderItem.new\n @work_order_item.assign_attributes(@json['data'])\n if !@json['data']['created_by']\n @work_order_item.created_by = current_user.id if !current_user.nil?\n end\n if @work_order_item.save\n render json: serialized_work_order_item(@work_order_item), status: :created\n else\n render json: format_errors(@work_order_item), status: :unprocessable_entity\n end\n end\n end",
"def build_work(w_hsh)\n title = Array(w_hsh[:title])\n creator = Array(w_hsh[:creator])\n rights = Array(w_hsh[:rights])\n desc = Array(w_hsh[:description])\n methodology = w_hsh[:methodology]\n subject = Array(w_hsh[:subject])\n contributor = Array(w_hsh[:contributor])\n date_created = Array(w_hsh[:date_created]) \n rtype = Array(w_hsh[:resource_type] || 'Dataset')\n\n gw = GenericWork.new( title: title, creator: creator, rights: rights,\n description: desc, resource_type: rtype,\n methodology: methodology, subject: subject,\n contributor: contributor, date_created: date_created ) \n paths_and_names = w_hsh[:files].zip w_hsh[:filenames]\n fsets = paths_and_names.map{|fp| build_file_set(fp[0], fp[1])}\n fsets.each{|fs| gw.ordered_members << fs}\n gw.apply_depositor_metadata(user_key)\n gw.owner=(user_key)\n gw.save!\n return gw\n end",
"def new \n @work_item = Work.new\n #the following is for testing only and will get improved in future version.\n 3.times { @work_item.technologies.build } #instanciate 3 types of technologies, and make it available to the form\n end",
"def set_work\n @works_item = Work.find(params[:id])\n end",
"def newitem\n entry = Pages::Storage::Entry.new(self)\n\n entry.title = ''\n entry.tags = []\n entry.date = Time.new\n entry.content = ''\n entry.draft = false\n\n @items << entry\n\n return entry\n end",
"def add_work_item_to(issue_id, attributes={})\n attributes = attributes.to_hash\n attributes.symbolize_keys!\n attributes[:date] ||= Date.current.iso8601\n epoc_date = Date.parse(attributes[:date]).to_time.to_i * 1000\n attributes[:user] ||= self.service.login\n work_items = REXML::Element.new('workItems')\n work_item = work_items.add_element('workItem')\n work_item.add_element('author').add_attribute('login', attributes[:user])\n work_item.add_element('date').add_text(epoc_date.to_s)\n work_item.add_element('duration').add_text(attributes[:duration].to_s)\n work_item.add_element('description').add_text(attributes[:description])\n put(\"import/issue/#{issue_id}/workitems\", body: work_items.to_s, :headers => {'Content-type' => 'text/xml'} )\n response\n end",
"def new\n @item = Item.new\n end",
"def encode_workitem (wi)\n YAML.dump(wi)\n end",
"def create\n attrs = create_attributes\n @object = klass.new\n object.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX\n run_callbacks :save do\n run_callbacks :create do\n klass == Collection ? create_collection(attrs) : work_actor.create(environment(attrs))\n end\n end\n log_created(object)\n end",
"def create\n\n #@workitem = Workitem.new(workitem_params)\n @workitem.user_id = current_user.id\n\n respond_to do |format|\n if @workitem.save\n format.html { redirect_to @workitem, notice: 'Workitem was successfully created.' }\n format.json { render action: 'show', status: :created, location: @workitem }\n else\n format.html { render action: 'new' }\n format.json { render json: @workitem.errors, status: :unprocessable_entity }\n end\n end\n end",
"def quick_new\n @bill = Bill.new\n @bill.items.build\n end",
"def new\n @work = Work.new\n @novel = Novel.new\n @title = 'New Work'\n end",
"def create\n @work_item_type = WorkItemType.new(work_item_type_params)\n\n respond_to do |format|\n if @work_item_type.save\n format.html { redirect_to @work_item_type, notice: 'Work item type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @work_item_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @work_item_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @work = Work.new(work_params)\n \n respond_to do |format|\n if @work.save\n format.html { redirect_to works_path, notice: 'Work item was successfully created!'}\n else\n format.html { render :new }\n end\n end\n end",
"def item\n IITArtwork.new(@ole.Item)\n end",
"def new_item(x = 0, y = 0, w = 1, h = 1)\n l = Layout.new\n l.sizes.set x, y, w, h\n add_item l\n end",
"def consume (workitem)\n ArWorkitem.from_owfe_workitem(workitem, @store_name)\n end",
"def new\n @works = Work.all\n end",
"def set_convert_object\n @input_object = BmetWorkOrder.new\n @input_object.wr_origin = nil\n @input_object.pm_origin = @bmet_preventative_maintenance\n @input_object.description = @bmet_preventative_maintenance.description\n @input_object.bmet_item = @bmet_preventative_maintenance.bmet_item\n end",
"def construct(x, y, item_type)\n item = Item.new(item_type)\n\n raise Errors::SpaceUnavailbleError.new unless can_build?(x,y)\n raise Errors::NotEnoughMoneyError.new unless can_afford?(item)\n\n # currently all items are 1x1\n grid.grid[x][y] = item\n\n # This has to be marked as self.money not money and i'm not sure why\n self.money -= item.cost\n end",
"def reserve(workitem_or_fei, owner)\n\n hwi = fetch(workitem_or_fei)\n\n fail ArgumentError.new(\"workitem not found\") if hwi.nil?\n\n return nil if hwi['owner'] && hwi['owner'] != owner\n\n hwi['owner'] = owner\n\n r = @context.storage.put(hwi, :update_rev => true)\n\n fail ArgumentError.new(\"workitem is gone\") if r == true\n fail ArgumentError.new(\"workitem got modified meanwhile\") if r != nil\n\n Workitem.new(hwi)\n end",
"def import_work_item(row)\n item = {}\n item['created_at'] = row['created_at']\n item['updated_at'] = row['updated_at']\n item['intellectual_object_id'] = @id_for_name[row['object_identifier']]\n item['generic_file_id'] = @id_for_name[row['generic_file_identifier']]\n item['name'] = row['name']\n item['etag'] = row['etag']\n item['bucket'] = row['bucket']\n item['user'] = row['user']\n item['note'] = row['note']\n item['action'] = row['action']\n item['stage'] = row['stage']\n item['status'] = ucfirst(row['status'])\n item['outcome'] = row['outcome']\n item['bag_date'] = row['bag_date']\n item['date'] = row['date']\n item['retry'] = row['retry']\n item['object_identifier'] = row['object_identifier']\n item['generic_file_identifier'] = row['generic_file_identifier']\n item['node'] = row['node']\n item['pid'] = row['pid']\n item['needs_admin_review'] = row['needs_admin_review']\n item['institution_id'] = @id_for_name[row['institution']]\n item['queued_at'] = nil\n item['size'] = nil\n item['stage_started_at'] = nil\n\n url = \"#{@base_url}/api/v2/items\"\n resp = api_post_json(url, item.to_json)\n if resp.code != '201'\n @log.write(\"Error saving WorkItem #{item['id']}\\n\")\n @log.write(item.inspect)\n if resp.body.length < 8000\n @log.write(\"\\n\" + resp.body + \"\\n\")\n else\n @log.write(\"\\nResponse body too long. Check rails logs.\\n\")\n end\n #exit(1)\n end\n data = JSON.parse(resp.body)\n return data['id']\n end",
"def create_item( *args )\n raise NotImplementedError.new(\"Subclasses must implement #create_item\")\n end",
"def create!(name, params = {})\n item = build(name, params)\n item.save!\n item\nend",
"def create\n @report = Report.find(params[:report_id])\n @work_item = @report.work_items.build(params[:work_item])\n\n respond_to do |format|\n if @work_item.save\n format.html { redirect_to @report, notice: 'Work item was successfully created.' }\n format.json { render json: @work_item, status: :created, location: [@report, @work_item] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def item\n IITWindow.new(@ole.Item)\n end",
"def create_item(index)\n item = @data[index]\n rect = item_rect(index, true)\n \n shopItem = UCShopItem.new(self, item, rect,\n SHOP_CONFIG::ITEM_NUMBER_PATTERN)\n \n shopItem.cItemPrice.align = 2\n shopItem.cItemPossess.align = 2 \n shopItem.cItemPossess.font = Font.shop_possess_font\n shopItem.ucItemNumber.cLabelNumber.align = 2\n shopItem.ucItemNumber.min = 0\n shopItem.ucItemNumber.max = shopItem.inventory_quantity\n return shopItem\n end",
"def initialize(*new_item)\n if new_item.length == 1 && new_item[0].is_a?(WIN32OLE)\n @wmi_object = new_item[0]\n else\n @wmi_object = connection.get(self.class.element_name).spawnInstance_()\n unless new_item.length == 0\n if new_item[0].is_a?(Hash)\n new_item[0].each do |attribute, value|\n self.send(attribute.to_s + \"=\", value)\n end\n else\n raise(ArgumentError)\n end\n end\n end\n self.attributes\n self\n end",
"def new\n \t@item=Item.new({:ItemName =>'def'})\n end",
"def create_work(xml_metadata)\n parsed_data = Ingest::Services::MetadataParser.new(xml_metadata,\n @depositor,\n @collection,\n @config).parse\n work_attributes = parsed_data[:work_attributes]\n # Create new work record and save\n new_work = work_record(work_attributes)\n new_work.save!\n\n new_work\n\n end",
"def workitem(fei=nil)\n\n return fetch_workitem(fei) if fei\n\n @workitem ? @workitem : applied_workitem\n end",
"def new\n @item = Item.new\n end",
"def new\n @item = Item.new\n end",
"def new\n @item = Item.new\n end",
"def create_rep(item, path)\n rep = Nanoc::Int::ItemRep.new(item.unwrap, :default)\n rep.paths[:last] = path\n @reps << rep\n Nanoc::ItemRepView.new(rep, view_context)\n end",
"def construct_payload( work, attributes = {})\n\n attributes[:prefix] = shoulder.gsub('doi:', '')\n\n # For a new record, not including a DOI will have Datacite generate one\n attributes[:doi] = work.bare_doi if work.doi.present?\n\n attributes[:titles] = [{title: work.title.join(' ')}]\n if work.abstract.present?\n attributes['descriptions'] = [{\n description: work.abstract,\n descriptionType: 'Abstract'\n }]\n end\n attributes[:creators] = format_people( work.authors) if work.authors.present?\n attributes[:contributors] = format_people( work.contributors, 'Other' ) if work.contributors.present?\n attributes[:subjects] = work.keyword.map{|k| {subject: k}} if work.keyword.present?\n attributes[:rightsList] = [{rights: work.rights_display}] if work.rights_display.present?\n attributes[:fundingReferences] = work.sponsoring_agency.map{|f| {funderName: f}} if work.sponsoring_agency.present?\n attributes[:types] = datacite_resource_type(work.resource_type)\n\n yyyymmdd = ServiceClient.extract_yyyymmdd_from_datestring( work.published_date )\n # published date cannot be only a year\n yyyymmdd = ServiceClient.extract_yyyymmdd_from_datestring( work.date_created ) if yyyymmdd.blank?\n attributes[:dates] = [{date: yyyymmdd, dateType: 'Issued'}] if yyyymmdd.present?\n attributes[:publicationYear] = yyyymmdd.first(4) if yyyymmdd.present?\n\n attributes[:url] = fully_qualified_work_url( work.id ) # 'http://google.com'\n attributes[:publisher] = work.publisher if work.publisher.present?\n\n #puts \"==> #{h.to_json}\"\n payload = {\n data: {\n type: 'dois',\n attributes: attributes\n }\n }\n #puts \"#{payload.to_json}\"\n return payload.to_json\n end",
"def load_workitem (workitem_id)\n\n @worklist = Worklist.new(session[:user])\n\n @workitem = OpenWFE::Extras::Workitem.find workitem_id\n\n @delegation_targets = @worklist.delegation_targets(@workitem)\n\n @fields, hidden_fields = filter_fields @workitem\n\n session[:workitem] = @workitem.id\n\n\n #@process_definition, @json_process_definition =\n # LaunchPermission.load_process_definition(\n # @workitem.full_fei.workflow_definition_url)\n\n pwfid = @workitem.full_fei.parent_wfid\n\n @json_process_definition =\n $openwferu_engine.process_representation(pwfid).to_json.to_s\n\n @paused = $openwferu_engine.is_paused?(pwfid)\n # a small digression (out of the worklist, into the engine)\n end",
"def new_invoice_item(invoice, i)\n invoice_item = SupplierInvoiceItem.new\n if i.class.name == 'ReceiptNoteItem'\n invoice_item.receipt_note_id = i.receipt_note_id\n invoice_item.receipt_note_item_id = i.id\n else\n invoice_item.purchase_order_id = i.purchase_order_id\n invoice_item.purchase_order_item_id = i.id\n end\n invoice_item.supplier_invoice_id = invoice.id\n invoice_item.product_id = i.product_id\n invoice_item.code = i.code\n invoice_item.description = i.description\n invoice_item.quantity = i.balance\n invoice_item.price = i.price\n invoice_item.discount_pct = i.discount_pct\n invoice_item.discount = i.discount\n invoice_item.tax_type_id = i.tax_type_id\n invoice_item.work_order_id = i.work_order_id\n invoice_item.project_id = i.project_id\n if !i.charge_account_id.blank?\n invoice_item.charge_account_id = i.charge_account_id\n else\n invoice_item.charge_account_id = ChargeAccount.expenditures(i.project_id).first.id\n end\n invoice_item.created_by = current_user.id if !current_user.nil?\n return invoice_item\n end",
"def create\n if @work_order_item.present?\n render json: :conflict, status: :conflict\n else\n @work_order_item = WorkOrderItem.new\n @work_order_item.assign_attributes(@json['data'])\n if !@json['data']['created_by']\n @work_order_item.created_by = current_user.id if !current_user.nil?\n end\n if @work_order_item.save\n render json: serialized_work_order(@work_order_item), status: :created\n else\n render json: format_errors(@work_order_item), status: :unprocessable_entity\n end\n end\n end",
"def create_item(data)\n fail 'Base class does not include ::Record!' if @base && !@base.include?(::Record)\n item = (@base || Record).new\n item.data = data\n item\n end",
"def decode_workitem( msg )\n ldebug { \"decoding workitem from: #{msg}\" }\n\n # YAML?\n if msg.index('ruby/object:OpenWFE::InFlowWorkItem')\n YAML.load( msg )\n # XML?\n elsif msg =~ /^<.*>$/m\n OpenWFE::Xml.workitem_from_xml( msg )\n # Assume JSON encoded Hash\n else\n hash = OpenWFE::Json.decode(msg)\n OpenWFE.workitem_from_h( hash )\n end\n end",
"def create\n @work = Work.new(params[:work].except(:extra_keys, :extra_values))\n @work.extra = process_extra if params[:extra_keys]\n \n current_dataset.works << @work\n \n Work.create_locations(@work) if @work.places\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to @work, notice: 'Work was successfully created.' }\n format.json { render json: @work, status: :created, location: @work }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def construct_payload( work, attributes = {})\n\n attributes[:prefix] = shoulder.gsub('doi:', '')\n # For a new record, not including a DOI will have Datacite generate one\n attributes[:doi] = work.bare_doi if work.identifier.present?\n\n attributes[:titles] = [{title: work.title.join(' ')}]\n if work.description.present?\n attributes['descriptions'] = [{\n description: work.description,\n descriptionType: 'Abstract'\n }]\n end\n\n attributes[:creators] = authors_construct( work )\n attributes[:contributors] = contributors_construct( work )\n attributes[:subjects] = work.keyword.map{|k| {subject: k}} if work.keyword.present?\n attributes[:rightsList] = [{rights: work.rights.first}] if work.rights.present? && work.rights.first.present?\n attributes[:fundingReferences] = work.sponsoring_agency.map{|f| {funderName: f}} if work.sponsoring_agency.present?\n attributes[:types] = {resourceTypeGeneral: DC_GENERAL_TYPE_TEXT, resourceType: RESOURCE_TYPE_DISSERTATION}\n\n yyyymmdd = extract_yyyymmdd_from_datestring( work.date_published )\n yyyymmdd = extract_yyyymmdd_from_datestring( work.date_created ) if yyyymmdd.blank?\n attributes[:dates] = [{date: yyyymmdd, dateType: 'Issued'}] if yyyymmdd.present?\n attributes[:publicationYear] = yyyymmdd.first(4) if yyyymmdd.present?\n\n attributes[:url] = fully_qualified_work_url( work.id ) # 'http://google.com'\n attributes[:publisher] = work.publisher if work.publisher.present?\n\n #puts \"==> #{h.to_json}\"\n payload = {\n data: {\n type: 'dois',\n attributes: attributes\n }\n }\n puts \"#{payload.to_json}\"\n return payload.to_json\n end",
"def create\n @work = Work.new(params[:work])\n\n respond_to do |format|\n if @work.save\n flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.work'))\n if @patron\n @patron.works << @work\n end\n format.html { redirect_to @work }\n format.json { render :json => @work, :status => :created, :location => @work }\n else\n prepare_options\n format.html { render :action => \"new\" }\n format.json { render :json => @work.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @work = Work.new(params[:work])\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to action: 'index', flash: {notice: 'Work item was successfully created.' }}\n format.json { render json: @work, status: :created, location: @work }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_item(index)\n item = @data[index]\n rect = item_rect(index, true)\n \n ucItem = UCItem.new(self, item, rect)\n ucItem.active = enable?(item)\n \n if $game_party.newest_items.include?(item)\n ucItem.cItemName.font.color = Color.new_item_color\n ucItem.cItemNumber.font.color = Color.new_item_color\n end\n \n return ucItem\n end",
"def new_workflow_note\n @new_workflow_note ||= ChangeSet.for(WorkflowNote.new)\n end",
"def create_work_presenter\n @create_work_presenter ||= create_work_presenter_class.new(current_ability.current_user)\n end",
"def create_work_presenter\n @create_work_presenter ||= create_work_presenter_class.new(current_ability.current_user)\n end",
"def create_work_presenter\n @create_work_presenter ||= create_work_presenter_class.new(current_ability.current_user)\n end",
"def new_work_period(options = {})\n options.merge!({employee_id: id})\n EmployeeWorkPeriod.new(options)\n end",
"def build_new_works\n\n return if self.status==:new_only_effort #estimation only, no schedule\n\n work_actual_array=self.task.work_actuals\n\n d1 = Date.last_monday(self.task.start)\n d2 = task.stop\n\n logger.info \" build_works_for_baseline from #{d1} to #{d2}\"\n\n d1.step(d2, 7) do |date|\n self.works.build do |w|\n w.start_date =date\n w.duration =WORK_TIME_FRAME\n w.workhours =Baseline.corresponding_work(work_actual_array, date).nil_or.workhours\n w.description=Baseline.corresponding_work(work_actual_array, date).nil_or.description\n end\n end\n end",
"def new\n @report = Report.find(params[:report_id])\n @work_item = @report.work_items.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work_item }\n end\n end",
"def create_item_with_location\n inventory_item = FactoryBot.create :inventory_item\n warehouse_location = FactoryBot.create :warehouse_location\n ItemLocation.create(inventory_item_id: inventory_item.id, warehouse_location_id: warehouse_location.id, quantity: inventory_item.quantity)\n\n inventory_item\n end",
"def new\n @poi = Poi.new\n end",
"def new_with(item) \n occupation = item.occupation\n if occupation.present?\n link_text = occupation&.link_text || 'n/a'\n organization = find_or_create_org(link_text, occupation)\n\n link = find_or_create_link(link_text, \"XING\", \"xing\", (occupation&.link || 'n/a'))\n\n unless (link.nil? || organization.links.exists?(link.id))\n organization.links << link\n end\n end\n end",
"def on_workitem\n\n doc = workitem.to_h\n\n doc.merge!(\n 'type' => 'workitems',\n '_id' => to_id(doc['fei']),\n 'participant_name' => doc['participant_name'],\n 'wfid' => doc['fei']['wfid'])\n\n doc['store_name'] = @store_name if @store_name\n\n @context.storage.put(doc, :update_rev => true)\n end",
"def make_round_trippable\n values = hyrax_record.send(work_identifier.to_s).to_a\n values << hyrax_record.id\n hyrax_record.send(\"#{work_identifier}=\", values)\n hyrax_record.save\n end",
"def new(klass, *args)\n unless klass.is_a?(BasicObject)\n PEROBS.log.fatal \"#{klass} is not a BasicObject derivative\"\n end\n\n @lock.synchronize do\n obj = _construct_po(klass, _new_id, *args)\n # Mark the new object as modified so it gets pushed into the database.\n @cache.cache_write(obj)\n # Return a POXReference proxy for the newly created object.\n obj.myself\n end\n end",
"def generate_pool_item(user)\r\n\tpool_item = FactoryGirl.create(:incomplete_micropost, user: user)\r\n\t\r\n\tuser.participate(pool_item)\r\n\t\r\n\tRails.logger.debug(\"\\n\\nGenerating Pool Item With ID: #{pool_item.id}\\nContent: #{pool_item.content}\\nLocation: #{pool_item.location}\\nTime: #{pool_item.time}\\nUser ID: #{pool_item.user.id}\\nUpdated At: #{pool_item.updated_at}\\n\")\r\n\t\r\n\treturn pool_item\r\nend",
"def spawn(attributes = {})\n child = dup\n work_groups.each do |wg|\n new_wg = WorkGroup.new(institution: wg.institution, project: child)\n child.work_groups << new_wg\n wg.group_memberships.each do |gm|\n new_gm = GroupMembership.new(person: gm.person, work_group: wg)\n new_wg.group_memberships << new_gm\n end\n end\n child.assign_attributes(attributes)\n child.avatar = nil\n child.lineage_ancestor = self\n child\n end",
"def workitems\n\n @expressions.select { |fexp|\n #fexp.is_a?(Ruote::Exp::ParticipantExpression)\n fexp.h.name == 'participant'\n }.collect { |fexp|\n Ruote::Workitem.new(fexp.h.applied_workitem)\n }\n end",
"def instantiate\n resource.new(data)\n end",
"def create_claim_task\n Task.create(workbench: Role.developer, workitem: self)\n end",
"def new\n @pack = @reservation.pack\n end",
"def new_from_work\n @expression = Expression.new\n @expression.login_updated_by = @login\n set_default_status(@expression)\n save_expression_instance_in_session\n\t@interval_duration = IntervalDuration.create_from_string(nil)\n \n #Sounz have requested that if you create an expression from a work then you cant change the work\n @show_works_widget = false\n \n begin\n @work = Work.find(params[:work_id])\n @expression.work = @work\n @expression.expression_title = @work.work_title\n @page_title = \"New expression for work '#{@work.work_title}'\"\n @assignedWork=FrbrObject.new(\"work\",Work.find(@work.work_id))\n rescue\n logger.debug \"****** Invalid ID for work: #{params[:work_id]}\"\n @page_title = \"New Expression\"\n end\n \n prepare_new\n render :action => :new\n end",
"def new\n @work = @assignment.works.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @work }\n end\n end",
"def prorate_create_item(t, tariff, invoice_id, subcode, price, quantity, measure, tax_type_id, discount_pct, user_id, d)\n if t == 'P'\n create_pre_invoice_item(tariff, invoice_id, subcode, price, quantity, measure, tax_type_id, discount_pct, user_id, d)\n else\n create_invoice_item(tariff, invoice_id, subcode, price, quantity, measure, tax_type_id, discount_pct, user_id, d)\n end\n end",
"def new\n @submission = Submission.new\n @workflow = Workflow.find(params[:id])\n @items_list = current_user.build_items_list\n\n c = 0\n @workflow.protocols.each do |p|\n @submission.tasks.build(:protocol => p, :rank => c)\n c += 1\n end\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @submission }\n end\n end",
"def delegate(workitem, new_owner)\n\n hwi = fetch(workitem)\n\n fail ArgumentError.new(\n \"workitem not found\"\n ) if hwi == nil\n\n fail ArgumentError.new(\n \"cannot delegate, workitem doesn't belong to anyone\"\n ) if hwi['owner'] == nil\n\n fail ArgumentError.new(\n \"cannot delegate, \" +\n \"workitem owned by '#{hwi['owner']}', not '#{workitem.owner}'\"\n ) if hwi['owner'] != workitem.owner\n\n hwi['owner'] = new_owner\n\n r = @context.storage.put(hwi, :update_rev => true)\n\n fail ArgumentError.new(\"workitem is gone\") if r == true\n fail ArgumentError.new(\"workitem got modified meanwhile\") if r != nil\n\n Workitem.new(hwi)\n end"
] | [
"0.6659081",
"0.6650529",
"0.6369247",
"0.6323991",
"0.62001574",
"0.61834425",
"0.6163132",
"0.6105817",
"0.60133636",
"0.59773165",
"0.5886128",
"0.58402336",
"0.57838595",
"0.5777761",
"0.577641",
"0.56459665",
"0.56181335",
"0.5608963",
"0.5579679",
"0.5557633",
"0.55394346",
"0.55035996",
"0.55000585",
"0.54973817",
"0.54973817",
"0.54923016",
"0.5491532",
"0.5484291",
"0.5479891",
"0.54744095",
"0.54740953",
"0.5462556",
"0.5461738",
"0.5458156",
"0.5453002",
"0.5447755",
"0.544118",
"0.54248136",
"0.54233325",
"0.54222417",
"0.5404021",
"0.5399337",
"0.5383821",
"0.5382978",
"0.53779894",
"0.5368264",
"0.5366134",
"0.53625214",
"0.53623873",
"0.5356974",
"0.5356587",
"0.53411645",
"0.53357816",
"0.5335158",
"0.53343683",
"0.53262955",
"0.532463",
"0.5305685",
"0.52962",
"0.52740836",
"0.52604336",
"0.5243986",
"0.52369905",
"0.52369905",
"0.52369905",
"0.52329683",
"0.52316403",
"0.52260643",
"0.52181476",
"0.5214984",
"0.5205158",
"0.5196006",
"0.51886266",
"0.5188543",
"0.51859206",
"0.5179729",
"0.5174304",
"0.51700455",
"0.5165374",
"0.5165374",
"0.5165374",
"0.51584077",
"0.5155635",
"0.51470387",
"0.5146502",
"0.51449203",
"0.51441073",
"0.5128014",
"0.5125566",
"0.5125244",
"0.5117362",
"0.51100767",
"0.5109464",
"0.5103636",
"0.5100173",
"0.50952655",
"0.50936383",
"0.50905603",
"0.5089946",
"0.5086026",
"0.5057784"
] | 0.0 | -1 |
Return a field value | def [](fname)
fname = fname.to_s
node = @doc.xpath("//field[@id=\"#{fname}\"]")
return nil if node.text.empty?
node.text
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_field_value(value)\r\n value\r\n end",
"def field_value(field)\n @object.respond_to?(field) ? @object.send(field) : ''\n end",
"def [](field_name)\n f = field(field_name)\n f && f.value\n end",
"def get_value(field)\n field = item_type.find_field(field) unless field.is_a? Field\n field.value_for_item(self)\n end",
"def get_field(field_name)\n\t\tend",
"def get_field_value(field)\n field_values = get_fields(field)\n return nil if field_values.blank?\n if field_values.first.delegation_field.multiple\n field_values.map(&:to_value)\n else\n field_values.first.to_value\n end\n end",
"def value_for(field)\n value = instance_variable_get(:\"@#{field}\")\n value.nil? ? nil : value.to_s\n end",
"def field(p,field_name)\n f = p.fields.find {|f| f.name == field_name}\n if f.nil? then\n return nil\n else\n return f.value\n end\nend",
"def field_value field, options = {}\n field_values(field, options)\n end",
"def value\n attributes['FieldValue']\n end",
"def get_string_value(field_name)\n\t\tend",
"def get(field)\n self.class.get(field, @data)\n end",
"def field\n @field ||= quoted_field(field_name)\n end",
"def field_value(field_identifier, options={})\n data[lookup_field_code(field_identifier, options)]\n end",
"def get_field(name)\n self[name]\n end",
"def value(field)\n if DATE_FIELDS.include? (name=attr(field))\n Time.parse(field.text) rescue field.text\n elsif USER_FIELDS.include? name\n users[field.text.downcase]\n else\n field.text\n end\n end",
"def get_value_or_id(field)\n field = item_type.find_field(field) unless field.is_a? Field\n field.value_or_id_for_item(self)\n end",
"def read_field\n end",
"def get_field_value(data, field_name)\n data[field_name]['__content__'] if data[field_name]\n end",
"def subfield_value(field, subfield)\n sub = field.subfields.find {|s| s.code == subfield}\n if sub.nil?\n return nil\n end\n sub.value\nend",
"def get_integer_value(field_name)\n\t\tend",
"def field_value(field_identifier, options={})\n data[lookup_field_id_string(field_identifier, options)]\n end",
"def get_field_value(obj, name)\n begin\n @struct_field_getter.call(obj, name)\n rescue\n 0\n end\n end",
"def field_content\n value\n end",
"def get_value_from(message_field)\n return if message_field.nil?\n\n message_field.public_send(*field_value)\n end",
"def get_double_value(field_name)\n\t\tend",
"def get_string(field)\n field['stringValue']\n end",
"def custom_field_value_for_name(name)\n return custom_fields[name.to_s][\"value\"] if custom_fields[name]\n return 'nil' # if no name found\n end",
"def field name\n @fields[name]\n end",
"def getFieldValue( name , formName = \"\" , frameName = \"\" )\n # returns the current value of the field\n \n fname = getFunctionName()\n log fname + ' Starting. getting value for field with name: ' + name if $debuglevel >=0\n\n begin # if there are 2 elements with the same name, we get an exception - so we need a different version of this method\n\n container = getObjectContainer( name , formName , frameName )\n\n o = nil\n v = \"\"\n container.all.each do |c|\n next unless o == nil\n begin\n if c.name.to_s == name \n #log 'Hack:: found the object. '\n o = c\n end\n rescue\n # probably no name\n end\n end\n if o != nil\n v = o.value.to_s\n else\n v = nil\n end\n\n rescue => e\n showException(e)\n v = nil \n end \n return v\n \n end",
"def get_string_field(field_name)\n\t\tend",
"def get_field(tag_or_name)\n self.class.get_field(tag_or_name)\n end",
"def get_field(tag_or_name)\n self.class.get_field(tag_or_name)\n end",
"def field(name); end",
"def get_field(field_name)\n fields = @data_source['fields']\n \n fields.each do | f |\n if f['name'] == filed_name\n return f\n end\n end \n return nil\n end",
"def field_value(field)\n field_config = blacklight_config.show_fields[field]\n Blacklight::ShowPresenter.new(@document, self).field_value field_config\n end",
"def field key\n @fields.get key\n end",
"def[](field)\n return self.values[field.to_s]\n end",
"def get_field_value(label)\n field_detect(label)\n element = @field.all(:css, 'div[class*=\"clearfix data-column\"]').first\n element.all(:css, 'span[class^=\"read edit\"]').each do |entry|\n entry.text\n end\n end",
"def get_value\n value\n end",
"def get_value\n value\n end",
"def get_field(key)\n @form_fields.getField key.to_s\n end",
"def field_value(name, field)\n placement_collection[name].collect{|entry| entry[field]}\n end",
"def show_field_value(id)\n get(\"fieldValues/#{id}\")\n end",
"def get_field_name\n\t\tend",
"def get_char_field(field_name)\n\t\tend",
"def get_variable(row, field)\n val = row.instance_variable_get(\"@#{field}\")\n val.nil? ? '' : val\n end",
"def value\n record.send(name).value\n end",
"def field_value\n if check_version_of(\"mail\", \"> 2.7.0\")\n %w(unparsed_value)\n elsif check_version_of(\"mail\", \"= 2.7.0\")\n %w(instance_variable_get @unparsed_value)\n elsif check_version_of(\"mail\", \"< 2.7.0\")\n %w(instance_variable_get @value)\n end\n end",
"def field_get(key)\n self.class.fetch_field(key.to_sym) # ensure that the field exists\n send key\n end",
"def effective_field field\n each do |container|\n return container.value.send(field) unless container.empty?\n end\n nil\n end",
"def field name\n f = fields.find { |fld| fld.name == name.to_s }\n return nil if f.nil?\n yield f if block_given?\n f\n end",
"def [](field)\n @fields.has_key?(field.to_s) ? @fields[field.to_s] : nil\n end",
"def [](field)\n @fields.has_key?(field.to_s) ? @fields[field.to_s] : nil\n end",
"def fetch_field\n return nil if @field_index >= @fields.length\n ret = @fields[@field_index]\n @field_index += 1\n ret\n end",
"def [](field_name)\n get(field_name)\n end",
"def get_field(tag_or_name)\n case tag_or_name\n when Integer then get_field_by_tag(tag_or_name)\n when String, Symbol then get_field_by_name(tag_or_name)\n else raise TypeError, tag_or_name.class\n end\n end",
"def get_field_by_name(name)\n self.class.get_field_by_name(name)\n end",
"def get_field_by_name(name)\n self.class.get_field_by_name(name)\n end",
"def get_value\n @value\n end",
"def value\n #--- if field is a country field, convert the country_id into real name\n if custom_field_def.field_type == 'country'\n Country.find(field_data.to_i).english_name\n elsif field_data.is_a? Array\n # make into a comma delimited string. remove any blank/nil entries\n field_data.reject(&:blank?).join(', ')\n else\n field_data\n end\n end",
"def get_value name\n get name\n end",
"def get(field)\n @dataset.get(field)\n end",
"def imported_field_value(field)\n resource.try(field) || resource.try(:primary_imported_metadata)&.[](field) || parent_resource&.try(field) || parent_resource&.try(:primary_imported_metadata)&.[](field)\n end",
"def raw_getter field\n val = self.instance_variable_get(\"@#{field}\")\n return nil if val.nil? == true || val == false\n\n if BOOL_ATTRIBUTES.include? field\n return field.to_s.gsub '_', '-' \n end\n\n if STR_ATTRIBUTES.include? field \n return val \n end\n\n if ARR_STR_ATTRIBUTES.include? field && val.empty? == false \n return val.join ' '\n end\n\n if SUB_STR_ATTRIBUTES.include? field \n return SUB_STR_ATTRIBUTES[field].sub '%sub%', val \n end \n end",
"def predictable_field_value\n return nil unless self.team\n self.team.id.to_s\n end",
"def field (key)\n\n return self.yattributes[key.to_s] if self.yattributes\n\n fields.find_by_fkey(key.to_s)\n end",
"def get_coll_field_val(fedora_obj, desired_field)\n if (desired_field.is_a?(String))\n desired_field = desired_field.to_sym\n end\n if (fedora_obj.collections.size > 0)\n coll_obj = HypatiaCollection.load_instance(fedora_obj.collections[0].pid)\n return get_values_from_datastream(coll_obj, \"descMetadata\", desired_field).first\n elsif (fedora_obj.sets.size > 0)\n # we can load the parent object as a set because we are only going to check \"collections\" and \"sets\"\n return values = get_coll_field_val(HypatiaSet.load_instance(fedora_obj.sets[0].pid), desired_field)\n end\n return \"\"\n end",
"def get_field(tag_or_name)\n case tag_or_name\n when Integer, String, Symbol\n field_dictionary[tag_or_name]\n else\n raise TypeError, tag_or_name.class\n end\n end",
"def get_value\n @value \n end",
"def field(f, val = nil)\n name = f.downcase\n\n return self.fields[name] unless val\n\n self.fields[name] = val\n\n return self\n end",
"def get_value name=nil\n @value\n end",
"def value\n @value ||= extract_value\n end",
"def get_binary_field(field_name)\n\t\tend",
"def get_field(field_name)\n fields[field_name] || interface_fields[field_name]\n end",
"def get\n val\n end",
"def get\n val\n end",
"def display_field\n current_field_values_with_field_type_id(field_types.first.id).first.try(:value) || 'no display field available'\n end",
"def field(key)\n pdf_field(key).getValueAsString\n rescue NoMethodError\n raise \"unknown key name `#{key}'\"\n end",
"def first_subfield_value(tag)\n sf = @field.subfields.select { |sf| sf.code == tag}\n return '' if sf.empty?\n sf.first.value\n end",
"def get_value\n read_attribute('text_value')\n end",
"def value_field\n \"string\"\n end",
"def field_name\n @field.name\n end",
"def name\n self.general_fields.where(fieldable_id: self.id).where(\"payload->>'key' = 'name'\").first.value\n end",
"def valGetter\n \"#{DataMetaDom.getterName(@fld)}()\" + ( isMapping ? '.getKey()' : '')\n end",
"def get_number(field)\n field['numberValue']\n end",
"def field(issue, field)\n res = \"\"\n issue = issue[\"data\"] if issue.has_key?(\"data\")\n if %w{issuetype status assignee reporter project}.include?(field)\n res = issue[\"fields\"][field][\"name\"] unless issue[\"fields\"][field].nil?\n elsif %w{duedate created updated}.include?(field)\n res = format_date(issue[\"fields\"][field]).strftime(\"%m/%d/%Y\") unless issue[\"fields\"][field].nil?\n else\n res = issue[\"fields\"][field] unless issue[\"fields\"][field].nil?\n end\n res\n end",
"def getter\r\n @getter ||= Field.getter(@name)\r\n end",
"def render_value(value, field:, **opt)\n if present? && object.field_names.include?(field)\n object[field] || EMPTY_VALUE\n end || super\n end",
"def get\n @value\n end",
"def [](field)\n @values[field.to_sym]\n end",
"def field\n @field ||= @options.fetch(:field, repository.adapter.field_naming_convention.call(name))\n end",
"def field_value\n opts = selected_options\n opts.count == 1 ? opts.first.text : opts.map(&:text)\n end",
"def [](field_)\n @_values[_interpret_field(field_)]\n end",
"def value\r\n @value\r\n end",
"def general_field(name)\n self.general_fields.where(fieldable_id: self.id).where(\"payload->>'key' = ?\", name).first\n end",
"def get(value)\n value\n end",
"def selector_field_value\n parent.record[@selector_for] rescue nil\n end",
"def getvalue\n @variable.get_value @name\n end",
"def value_field\n \"text\"\n end",
"def call_field(field)\n field.to_s.split('__').inject(self) { |a, e| a&.send(e) }\n rescue NoMethodError\n ''\n end"
] | [
"0.81568515",
"0.8053764",
"0.80355847",
"0.79275453",
"0.7897131",
"0.7731986",
"0.77180535",
"0.76942295",
"0.76231956",
"0.75703657",
"0.75689673",
"0.74404156",
"0.73817647",
"0.73519635",
"0.7347162",
"0.733658",
"0.7317098",
"0.7310233",
"0.73042214",
"0.7280855",
"0.72717375",
"0.726528",
"0.72466105",
"0.72098595",
"0.71940905",
"0.719022",
"0.71075875",
"0.71073836",
"0.7098529",
"0.7094416",
"0.7084978",
"0.70687157",
"0.70687157",
"0.7046834",
"0.70143986",
"0.6996626",
"0.6978491",
"0.6964497",
"0.6942657",
"0.6916715",
"0.6916715",
"0.6905473",
"0.69029415",
"0.6887411",
"0.68752176",
"0.6870721",
"0.68493086",
"0.6846151",
"0.68424493",
"0.6841766",
"0.68337965",
"0.6816425",
"0.68101454",
"0.68101454",
"0.6806141",
"0.67932296",
"0.67747325",
"0.6719077",
"0.6719077",
"0.67143154",
"0.67095464",
"0.66864365",
"0.6684276",
"0.667902",
"0.6676499",
"0.66669595",
"0.66563505",
"0.6652854",
"0.6642664",
"0.6641582",
"0.664006",
"0.66335905",
"0.66133296",
"0.6599331",
"0.658932",
"0.6589005",
"0.6589005",
"0.6576798",
"0.65753406",
"0.65630376",
"0.6561974",
"0.6554014",
"0.6550862",
"0.6529573",
"0.6516686",
"0.65119314",
"0.6506536",
"0.6492044",
"0.64880246",
"0.6474565",
"0.6471865",
"0.6464465",
"0.6459558",
"0.64338547",
"0.64294523",
"0.64262027",
"0.6421737",
"0.64038134",
"0.64015186",
"0.6396176",
"0.6395704"
] | 0.0 | -1 |
Return the list of linked workitems ['role1:wid1', ..., 'roleN:widN'] | def links
tmp = []
@doc.xpath('//field[@id="linkedWorkItems"]/list/struct').each do |struct|
linked_wid = struct.xpath('item[@id="workItem"]').text
role = struct.xpath('item[@id="role"]').text
tmp << "#{role}:#{linked_wid}"
end
return tmp
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def workitems (store_name=nil)\n\n return load_user_workitems if store_name == 'users'\n return (@workitems[store_name] || []) if store_name\n\n # then return all the workitems the user has access to\n\n wis = load_user_workitems\n\n @store_names.inject(wis) do |r, sname|\n r += (@workitems[sname] || [])\n end\n end",
"def linked_account_names\n # user.user explained: first user is local user, second user ir padma_user\n @linked_account_names ||= @user.user.padma_accounts.map(&:name)\n end",
"def linked_to\n @linked_to ||= []\n end",
"def index\n wl = current_user.watchlists.select(:name).distinct\n @watchlists = wl.map {|wlname| Watchlist.find_by(name: wlname.name) }\n end",
"def ministry_list\n root_ministry.descendants.pluck(:id)\n end",
"def items_list\n return self.donor_items.map{|it| \" #{it.item.andand.item_code} (#{it.number_donated}) \"}.join(\"/\")\n end",
"def list_items\r\n list = \"\"\r\n items.each{ |item| list = list + item.name + \"\\n\"}\r\n list\r\n end",
"def next_and_previous_links_listitems(work, chapter)\n links = next_and_previous_links(work, chapter)\n links.collect {|link| \"<li>\" + link + \"</li>\\n\"}\n end",
"def linked_resources\n return @linked_resources\n end",
"def lister node\n path = File.join(*node.user_object_path)\n populate path\n end",
"def roles_list(role = nil)\n self.role_symbols\n end",
"def open_lists\n List.open(id)\n end",
"def links\n linked_to.map{|to|[self,to]}\n end",
"def account_list(user)\n (user.account_lists & account_lists).first\n end",
"def items_list\n return self.pickedup_items.ordered_by_item_category.map{|it| \n \" #{it.andand.item.andand.item_code} [#{it.number_donated}] \" << (it.comments.blank? ? \"\" : \"(#{it.comments}) \")\n }.join(\"/\")\n end",
"def run_list\n self.roles.collect { |role| \"role[#{role}]\" } +\n self.recipes.collect { |recipe| \"recipe[#{recipe}]\" }\n end",
"def get_relations_of_workspace_and_user(wid)\n get \"/workspaces/#{wid}/workspace_users\"\n end",
"def list_related\n uid = unsafe_params[:uid]\n item = item_from_uid(uid)\n\n if item.accessible_by?(@context)\n unsafe_params[:opts] = unsafe_params[:opts].is_a?(Hash) ? unsafe_params[:opts] : {}\n\n scopes = unsafe_params[:opts][:scopes]\n unless scopes.nil?\n fail \"Option 'scopes' can only be an Array of Strings that are one of public, private or a space-xxxx id.\" unless scopes.is_a?(Array) && scopes.all? { |s| s == 'public' || s == 'private' || s =~ /^space-(\\d+)$/ }\n end\n\n classes = unsafe_params[:opts][:classes]\n unless classes.nil?\n fail \"Option 'classes' can be undefined or an array of strings\" unless classes.is_a?(Array) && classes.all? { |k| k.is_a?(String) }\n end\n\n scoped_items = lambda do |scoped_item, scopes_override = false|\n unless scopes.nil?\n scope_query = scopes_override ? scopes_override : { scope: scopes }\n scoped_item = scoped_item.where(scope_query)\n end\n scoped_item = if unsafe_params[:opts][:editable]\n scoped_item.editable_by(@context)\n else\n scoped_item.accessible_by(@context)\n end\n\n return scoped_item.to_a\n end\n\n allow_klass = lambda do |klass|\n return classes.nil? || classes.include?(klass)\n end\n\n related = []\n case item.klass\n when \"file\"\n related.push(*scoped_items.call(item.notes.real_notes)) if allow_klass.call(\"note\")\n related.push(*scoped_items.call(item.comparisons)) if allow_klass.call(\"comparison\")\n if item.parent_type == \"Job\"\n related.push(*scoped_items.call(Job.where(id: item.parent_id))) if allow_klass.call(\"job\")\n end\n when \"note\", \"answer\", \"discussion\"\n if item.klass == \"discussion\"\n scopes_override = !scopes.nil? ? { notes: { scope: scopes } } : false\n related.push(*scoped_items.call(item.answers.joins(:note), scopes_override)) if allow_klass.call(\"answer\")\n end\n note = if item.klass != \"note\"\n item.note\n else\n item\n end\n related.push(*scoped_items.call(note.comparisons)) if allow_klass.call(\"comparison\")\n related.push(*scoped_items.call(note.real_files)) if allow_klass.call(\"file\")\n related.push(*scoped_items.call(note.apps)) if allow_klass.call(\"app\")\n related.push(*scoped_items.call(note.jobs)) if allow_klass.call(\"job\")\n related.push(*scoped_items.call(note.assets)) if allow_klass.call(\"asset\")\n when \"app\"\n related.push(*scoped_items.call(item.notes.real_notes)) if allow_klass.call(\"note\")\n related.push(*scoped_items.call(item.jobs)) if allow_klass.call(\"job\")\n related.push(*scoped_items.call(item.assets)) if allow_klass.call(\"asset\")\n when \"job\"\n related.push(*scoped_items.call(App.where(id: item.app_id))) if allow_klass.call(\"app\")\n related.push(*scoped_items.call(item.notes.real_notes)) if allow_klass.call(\"note\")\n related.push(*scoped_items.call(item.input_files)) if allow_klass.call(\"file\")\n related.push(*scoped_items.call(item.output_files)) if allow_klass.call(\"file\")\n when \"asset\"\n when \"comparison\"\n related.push(*scoped_items.call(item.notes.real_notes)) if allow_klass.call(\"file\")\n related.push(*scoped_items.call(item.user_files)) if allow_klass.call(\"file\")\n when \"license\"\n when \"space\"\n when \"workflow\"\n related.push(*scoped_items.call(item.apps)) if allow_klass.call(\"app\")\n related.push(*scoped_items.call(item.jobs)) if allow_klass.call(\"job\")\n else\n fail \"Unknown class #{item.klass}\"\n end\n\n related = related.uniq.map { |o| describe_for_api(o, unsafe_params[:opts][:describe]) }\n\n render json: related\n else\n fail \"You do not have permission to access #{id}\"\n end\n end",
"def linked_transactions\n wizard_list_step(nil, setup_step: :setup_linked_transactions_step,\n next_step: :calculate_next_step, cache_index: LbttController,\n list_required: :linked_ind, list_attribute: :link_transactions,\n new_list_item_instance: :new_list_item_link_transactions)\n end",
"def linked\n ret = []\n self.links.inject(ret){|arr , link| arr << link.target}\n self.incomming_links.inject(ret){|arr , link| arr << link.source}\n ret\n end",
"def connections_here(whom = nil)\n list = []\n if whom\n whom = whom.map(&:downcase)\n end\n @connection.server.connections.each { |key, connection|\n if whom\n if whom.include?(connection.agent.name.downcase) and connection.agent.item == item\n list.push(connection)\n end\n else\n if connection.agent.item == item\n list.push(connection)\n end\n end\n }\n return list\n end",
"def my_memberships_list\n list = []\n self.ul(:class=>\"mygroup_items_list\").spans(:class=>\"mygroups_ellipsis_text\").each do |span|\n list << span.text\n end\n return list\n end",
"def list_worksets (username, token, include_public)\n Rails.logger.debug \"list_public_worksets #{username}\"\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets?public=#{include_public}\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Get.new(url.request_uri)\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n request.add_field(\"Accept\", \"application/vnd.htrc-workset+xml\")\n response = http.request(request)\n Rails.logger.debug \"Response Code: #{response.code}\"\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n\n response_xml = response.body\n #Rails.logger.debug response_xml\n\n worksets = Array.new\n\n doc = REXML::Document.new(response_xml)\n\n doc.elements.each('worksets/workset/metadata') { |metadata|\n hash = Hash.new\n hash['name'] = metadata.elements['name'].text\n hash['description'] = metadata.elements['description'].text\n hash['author'] = metadata.elements['author'].text\n\n if (hash['author'] == username)\n worksets.unshift(hash)\n else\n worksets.push(hash)\n end\n }\n\n id = 1\n worksets.each { |w|\n w['id'] = id;\n id = id+1\n\n }\n\n return worksets\n end",
"def associates_list()\n\t\tassocs = Contract.associates_for(current_user()).all.inject([]) \\\n\t\t\t{ |ret, assoc| ret << ([assoc.username, assoc.id] unless assoc.id == 2) }.compact\n\tend",
"def accounts\n @browser.lis(data_semantic: 'account-item')\n end",
"def row_items\n object.manifest_items.scope.active\n end",
"def list_users(workspace)\n puts \"\\nUser List\\n\\n\"\n tp workspace.users, \"id\", \"name\", \"real_name\", \"status_text\", \"status_emoji\"\nend",
"def wait_list(course)\n \twl = course.registrations.where(:wl => true)\n \treturn wl\n end",
"def add_link(lh)\n lnk_wid = lh[:wid]\n\tlnk_role = lh[:role]\n\t\n\t# find or create the attach node\n if @doc.xpath('//field[@id=\"linkedWorkItems\"]/list').last.nil?\n Nokogiri::XML::Builder.with(@doc.xpath('//work-item').last) do\n field(:id => 'linkedWorkItems') {\n\t list {}\n\t }\n end\n end\n\t\n\t# build and attach the link struct\n\tNokogiri::XML::Builder.with(@doc.xpath('//field[@id=\"linkedWorkItems\"]/list').last) do\n\t struct {\n\t item(:id => 'revision')\n\t\titem(:id => 'workItem') {\n\t\t text lnk_wid\n\t\t}\n\t\titem(:id => 'role') {\n\t\t text lnk_role\n\t\t}\n\t }\n\tend\n end",
"def workflow_ids\n approval_access = RBAC::Access.new('workflows', 'approve').process\n approval_access.send(:generate_ids)\n\n Rails.logger.info(\"Accessible workflows: #{approval_access.id_list}\")\n\n approval_access.id_list\n end",
"def organisers_as_list(logged_in = false)\n list = organisers.shuffle.map do |o|\n organiser = ActionController::Base.helpers.link_to(o.full_name, o.twitter_url)\n organiser << \" - #{o.mobile}\" if logged_in && model.future? && o.mobile\n content_tag(:li, organiser)\n end.join.html_safe\n if list.blank?\n list = content_tag(:li, 'Nobody yet')\n end\n content_tag(:ul, list)\n end",
"def list_relationships\n end",
"def account_list\n return [] unless company\n [company] + company.sibling_accounts\n end",
"def admin_original_manuscript_list\n %w( tt_original_manuscript_list@booktrope.com )\n end",
"def workitems\n\n @expressions.select { |fexp|\n #fexp.is_a?(Ruote::Exp::ParticipantExpression)\n fexp.h.name == 'participant'\n }.collect { |fexp|\n Ruote::Workitem.new(fexp.h.applied_workitem)\n }\n end",
"def curator_list\n users.map(&:email)\n end",
"def getUsersQuickLinksObjName\r\n\t\t\treturn \"mfiforce__Users_Quick_Links__c\"\r\n\t\tend",
"def fetch_syncables\n gh_client.repos.list.select{|repo| repo.permissions.admin}.map(&:full_name)\n end",
"def job_links\n links = []\n loop do\n links << listing_page.links_with(class: 'ovalbuttondetails')\n break unless next_link\n @listing_page = next_link.click\n end\n links.flatten\n end",
"def roles\n self.dig_for_array(\"roles\")\n end",
"def parse_work_items(results)\n output = []\n results.each do |x|\n x[\"name\"] = x[\"username\"] # Note: Duplicative name/username field added due to front-end bug.\n x[\"id\"] = x[\"work_item_id\"] # Note: Duplicative id/work_item_id field added due to front-end bug.\n output.append(x)\n end\n output\n end",
"def owner_id_list(resource)\n id_list(resource, owner_request_ids)\n end",
"def get_items\r\n @list\r\n end",
"def mobile_navigation_items\n @mobile_navigation_items ||= begin\n result = []\n\n # Collect the four basic navigaton links\n %i[meditations tracks streams articles].each do |role|\n next if role == :streams && !Stream.public_stream.any?\n\n static_page = static_page_preview_for(role)\n result.push({\n title: role == :streams ? translate('header.live_meditations') : static_page.name,\n url: static_page_path_for(static_page),\n active: controller_name == role.to_s,\n data: gtm_record(static_page),\n })\n end\n\n # Define the dropdown navigation.\n result.push(advanced_navigation_item)\n\n result\n end\n end",
"def admin_proofread_final_manuscript_list\n %w( tt_proofed_manuscript_list@booktrope.com )\n end",
"def list\n @list ||= manager_list\n end",
"def delegation_targets (workitem=nil)\n\n names = @store_names.find_all { |n| permission(n).may_delegate? }\n\n names.delete(workitem.store_name) if workitem\n\n names\n end",
"def mobile_navigation_items\n @mobile_navigation_items ||= begin\n result = []\n\n # Collect the four basic navigaton links\n %i[meditations tracks streams classes articles].each do |role|\n next if role == :streams && !Stream.public_stream.any?\n\n static_page = StaticPage.preview(role)\n result.push({\n title: role == :streams ? translate('header.live_meditations') : static_page.name,\n url: static_page_path(static_page),\n active: controller_name == role.to_s,\n data: gtm_record(static_page),\n })\n end\n\n # Define the dropdown navigation.\n result.push(advanced_navigation_item)\n\n result\n end\n end",
"def get_all_items\n items(@nodename)\n end",
"def getUserList\n @userList\n end",
"def links_to_workspace_collection(workspaces)\n return nil if workspaces.empty?\n workspaces.collect { |ws| link_to_workspace(ws) }.join(', ')\n end",
"def get_list\n \t@items\n end",
"def account_details_element_list(requested_by)\n { PartyRef: requested_by.party_refno, 'ins1:Requestor': requested_by.username }\n end",
"def remote_ledgers\n remote_splits.collect(&:ledger)\n end",
"def siblings\n others = user ? user.servers : Server.where(email: email, user_id: nil)\n others.where.not(id: id).to_a\n end",
"def extract_listname(object)\n extract_list(object).list\n end",
"def render_physician_links(workgroup, context)\n result = \"\"\n physicians = workgroup.find_physicians\n physicians.each do |phys|\n result += link_to(phys.full_name, { :context=>context}.merge(hash_for_network_profile_path(:id=>phys.load_default_profile(workgroup).id))) + \"<br/>\"\n end\n return result\n end",
"def workflow_ids\n approval_access = RBAC::Access.new('workflows', 'approve').process\n approval_access.send(:generate_ids)\n\n Rails.logger.info(\"Approvable workflows: #{approval_access.id_list}\")\n\n approval_access.id_list\n end",
"def work_associations(items)\n puts \" collecting work associations\"\n x = []\n items.each do |work|\n print \".\"; STDOUT.flush\n next unless (!work.unrevealed? && work.posted?) || !MULTI\n x << work.taggings\n TAGS << work.tags\n x << work.creatorships\n PSEUDS << work.pseuds\n x << work\n x << work.language\n x << work.hit_counter\n x << work.gifts\n PSEUDS << work.gifts.map(&:pseud)\n x << work.kudos\n PSEUDS << work.kudos.map(&:pseud)\n x << work.collection_items\n x << work.collections\n work.collections.each do |c|\n x << c.collection_profile\n x << c.collection_preference\n x << c.collection_participants\n PSEUDS << c.collection_participants.map(&:pseud)\n end\n x << work.serial_works\n x << work.series\n work.chapters.each do |c|\n x << c if c.posted? || !MULTI\n PSEUDS << c.pseuds\n x << c.comments\n PSEUDS << c.comments.map(&:pseud)\n x << c.kudos\n PSEUDS << c.kudos.map(&:pseud)\n end\n end\n x.flatten.compact.uniq\nend",
"def links()\n return @links\n end",
"def receivers_for(wui)\n if wui.user == current_owner\n wui.users.map(&:id)\n else\n [wui.user_id]\n end\n end",
"def links\n @links ||= []\n @links\n end",
"def project_managers\n people_with_the_role(\"project_manager\")\n end",
"def get_external_roles\n get(\"#{url_base}/external_role_map/all?#{dc}\")[\"data\"]\n end",
"def admin_rev_allocation_change_list\n %w( tt_rev_allocation_change_list@booktrope.com )\n end",
"def admin_project_created_list\n %w( tt_project_created_list@booktrope.com )\n end",
"def get_cpanel_account_list\n\t\tCPanelHelper::Local.find_accounts_by_string('.*', 'regexp').keys\n\tend",
"def list_items\r\n begin\r\n expand_combo\r\n get(:type => :list_item, :scope => :children, :how_many => :all)\r\n ensure\r\n collapse_combo\r\n end\r\n end",
"def list_item_elements(identifier)\n platform.list_items_for(identifier.clone)\n end",
"def permission_resources\n %w{roles sites employees classrooms students gapps_org_units}\n end",
"def user_works\n work_ids = Rails.cache.fetch(\"#{cache_key_with_version}/all_work_ids\") { self.works.pluck(:id) } #here is used \"cache_key_with_version\" method, so the resulting cache_key will be something like \"users/1/all_work_ids\" but \"cache_key_with_version\" generates a string based on the model's `id` and `updated_at` attributes. This is a common convention and has the benefit of invalidating the cache whenever the product is updated.\n Work.where(id: work_ids)\n end",
"def links\n\t\t@links.keys\n\tend",
"def account_ids()\n return [1, 2]\n end",
"def folder_names\n names = []\n frm.table(:class=>/listHier lines/, :text=>/Title/).rows.each do |row|\n next if row.td(:class=>\"specialLink\").exist? == false\n next if row.td(:class=>\"specialLink\").link(:title=>\"Folder\").exist? == false\n names << row.td(:class=>\"specialLink\").link(:title=>\"Folder\").text\n end\n return names\n end",
"def uris\n uris = []\n if current_user.admin?\n uris = object.uris\n elsif current_user.lead?\n uris = object.uris.select { |uri| uri.vm.project.users.include?(current_user) }\n else\n uris = object.uris.select { |uri| uri.vm.user.id == current_user.id }\n end\n uris.map { |u| u.id }\n end",
"def ncbi_linked_organisms\n return [] unless sample_type\n Rails.cache.fetch(\"sample-organisms-#{cache_key}-#{Organism.order('updated_at DESC').first.try(:cache_key)}\") do\n sample_type.sample_attributes.collect do |attribute|\n next unless attribute.sample_attribute_type.title == 'NCBI ID'\n value = get_attribute_value(attribute)\n if value\n Organism.all.select { |o| o.ncbi_id && o.ncbi_id.to_s == value }\n end\n end.flatten.compact.uniq\n end\n end",
"def other_administrators\n Administrator.where.not(['id = ? or is_super = ?',self.id, true]).order(:organisation).map {\n |t| ['%{org}: %{lname} %{name}'%{org: t.organisation, lname: t.info.last_name, name: t.info.name},t.id]\n }\n end",
"def wanted_list usr, cid=nil, loc=nil, adminFlg=true\n ListingDataProcessor.new(@listing).wanted_list(usr, cid, loc, adminFlg)\n end",
"def get_all_open_tasks_by_user(login_id)\n [{ \"Action\" => \"Query\",\n \"QueryType\" => \"AllOpenTasksByUser\",\n \"DomainType\" => \"Replicon.Project.Domain.Task\",\n \"Args\" => [{ \"__type\" => \"Replicon.Domain.User\",\n \"Identity\" => login_id\n }\n ]\n }\n ]\nend",
"def gatekeepers\n people_with_the_role(\"gatekeeper\")\n end",
"def sshkeys\n sshkeys = object.sshkeys.select do |sshk|\n !current_user ||\n current_user.id == sshk.user.id ||\n current_user.lead?\n end\n sshkeys.map { |s| s.id }\n end",
"def roles_dedicated\n find_related_frbr_objects( :is_dedicated_to, :which_roles?) \n end",
"def checklist_items\n return @checklist_items\n end",
"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",
"def attribution\n user = roles.creator.first&.user\n user = roles.administrator.not_creator.first&.user if user.blank?\n return [] if user.blank?\n\n text = user&.name(false)\n orcid = user.identifier_for_scheme(scheme: 'orcid')\n if orcid.present?\n text += format(' - <strong>ORCID:</strong> <a href=\"%{orcid_url}\" target=\"_blank\">%{orcid}</a>',\n orcid_url: orcid.value, orcid: orcid.value_without_scheme_prefix)\n end\n text\n end",
"def list(link)\n output, status = call(\"plowlist #{link} --printf '%u' -R\")\n output, status = call(\"plowlist #{link} --printf '%u'\") if status.retry_nonrecursive?\n return nil, status unless output\n\n return output.split(/\\n/), status\n end",
"def role_list \n @role_list ||= begin\n (store.display_roles | group_store.display_roles)\n end\n end",
"def createClonableList\n items = []\n Builtins.foreach(Y2ModuleConfig.ModuleMap) do |def_resource, resourceMap|\n Builtins.y2debug(\n \"r: %1 => %2\",\n def_resource,\n Ops.get_string(resourceMap, \"X-SuSE-YaST-AutoInstClonable\", \"false\")\n )\n clonable = Ops.get_string(\n resourceMap,\n \"X-SuSE-YaST-AutoInstClonable\",\n \"false\"\n ) == \"true\"\n if clonable || \"partitioning\" == def_resource ||\n \"software\" == def_resource || # has no desktop file\n \"bootloader\" == def_resource # has no desktop file\n desktop_file = Builtins.substring(\n Ops.get_string(resourceMap, \"X-SuSE-DocTeamID\", \"\"),\n 4\n )\n name = Builtins.dpgettext(\n \"desktop_translations\",\n \"/usr/share/locale/\",\n Ops.add(\n Ops.add(Ops.add(\"Name(\", desktop_file), \".desktop): \"),\n Ops.get_string(resourceMap, \"Name\", \"\")\n )\n )\n if name ==\n Ops.add(\n Ops.add(Ops.add(\"Name(\", desktop_file), \".desktop): \"),\n Ops.get_string(resourceMap, \"Name\", \"\")\n )\n name = Ops.get_string(resourceMap, \"Name\", \"\")\n end\n # Set resource name, if not using default value\n resource = Ops.get_string(\n resourceMap,\n \"X-SuSE-YaST-AutoInstResource\",\n \"\"\n )\n resource = def_resource if resource == \"\"\n if resource != \"\"\n items = Builtins.add(items, Item(Id(resource), name))\n else\n items = Builtins.add(items, Item(Id(def_resource), name))\n end\n end\n end\n # sort items for nicer display\n items = Builtins.sort(\n Convert.convert(items, :from => \"list\", :to => \"list <term>\")\n ) do |x, y|\n Ops.less_than(Ops.get_string(x, 1, \"x\"), Ops.get_string(y, 1, \"y\"))\n end\n deep_copy(items)\n end",
"def show_roles_and_users\n chorus_object_roles.map(&:role).uniq.map do |r|\n [r.name, users_for_role(r).map(&:username)]\n end\n end",
"def make_item_list\n end",
"def get_lawyer_user_ids\n @assigned_lawfirm_users.map(&:id)\n end",
"def clients\n NodeWrapper.new @links.select{|e| e.type == :client}.map(&:to)\n end",
"def role_names\n roles.split(',')\n end",
"def static_list_repositories\n %w[https://github.com/iwc-workflows/sars-cov-2-variation-reporting.git\n https://github.com/iwc-workflows/sars-cov-2-pe-illumina-artic-variant-calling.git\n https://github.com/iwc-workflows/sars-cov-2-ont-artic-variant-calling.git\n https://github.com/iwc-workflows/sars-cov-2-se-illumina-wgs-variant-calling.git\n https://github.com/iwc-workflows/sars-cov-2-pe-illumina-wgs-variant-calling.git\n https://github.com/iwc-workflows/parallel-accession-download.git\n https://github.com/iwc-workflows/sars-cov-2-consensus-from-variation.git\n https://github.com/iwc-workflows/sars-cov-2-pe-illumina-artic-ivar-analysis.git\n https://github.com/iwc-workflows/fragment-based-docking-scoring.git\n https://github.com/iwc-workflows/protein-ligand-complex-parameterization.git\n https://github.com/iwc-workflows/gromacs-mmgbsa.git\n https://github.com/iwc-workflows/gromacs-dctmd.git].map { |r| { 'clone_url' => r }}\n end",
"def workflow_ids\n AccessControlEntry.where(:aceable_type => 'Workflow', :permission => 'approve', :group_uuid => assigned_group_refs).pluck(:aceable_id)\n end",
"def send_user_list(path)\n path = path[1..-1]\n path = path[0..-2] if path.ends_with?(\"/\")\n results = []\n I3.directory.find_people(:groups, path).each do |uuid|\n p = I3.directory.read_person(uuid)\n result = I3::SharedObject.new\n result.account_name = p.account_name.to_s.downcase\n result.first_name = p.first_name.to_s\n result.last_name = p.last_name.to_s\n result.description = p.description.to_s\n results << result\n end #each\n I3.server.send_object(results)\n end",
"def stakeholders\n self.stakeholder_ids.collect{|user_id| User.find(user_id)}\n end",
"def work_id_list\n query = { params: { q: \"member_of_collection_ids_ssim:#{id} AND has_model_ssim:Work\", fl: \"id\", rows: \"100000\" } }\n results = solr.select(query)\n results['response']['docs'].flat_map(&:values)\n end",
"def get_org_unit_lti_links(org_unit_id)\n path = \"/d2l/api/le/#{$le_ver}/lti/link/#{org_unit_id}/\"\n _get(path)\nend",
"def get_character_list account\n end"
] | [
"0.588742",
"0.5639725",
"0.5494293",
"0.5393605",
"0.5306446",
"0.5221445",
"0.51779103",
"0.51683897",
"0.51538044",
"0.5148698",
"0.5145366",
"0.51173925",
"0.51153964",
"0.51047075",
"0.50885755",
"0.5083474",
"0.5060652",
"0.5057517",
"0.50118136",
"0.5007342",
"0.5004423",
"0.5000948",
"0.49995136",
"0.49925563",
"0.49902287",
"0.4987344",
"0.49848145",
"0.49615645",
"0.49488533",
"0.4948039",
"0.49370837",
"0.49351612",
"0.49341378",
"0.49091014",
"0.48968646",
"0.48946127",
"0.4892951",
"0.4890011",
"0.48829013",
"0.4881985",
"0.48805767",
"0.48758742",
"0.4867833",
"0.48602682",
"0.48592308",
"0.48544836",
"0.48453635",
"0.48452628",
"0.4840001",
"0.48365858",
"0.48343855",
"0.4829287",
"0.48107257",
"0.48080236",
"0.48042116",
"0.4800504",
"0.477675",
"0.47732842",
"0.476771",
"0.4767216",
"0.47669753",
"0.4760851",
"0.47606498",
"0.4756648",
"0.47552907",
"0.4751195",
"0.47487512",
"0.4743449",
"0.47395664",
"0.47392035",
"0.4730833",
"0.47300658",
"0.47278008",
"0.4725138",
"0.47173533",
"0.4717183",
"0.47156498",
"0.47152448",
"0.47069794",
"0.47058573",
"0.47033167",
"0.46944815",
"0.46884787",
"0.46817106",
"0.46764833",
"0.46748832",
"0.46731442",
"0.4670907",
"0.46700966",
"0.46691",
"0.46689355",
"0.46600437",
"0.465761",
"0.4657501",
"0.4654195",
"0.46532622",
"0.46505713",
"0.4647365",
"0.4643075",
"0.4642007"
] | 0.7573507 | 0 |
Add a link to another workitem with specified role | def add_link(lh)
lnk_wid = lh[:wid]
lnk_role = lh[:role]
# find or create the attach node
if @doc.xpath('//field[@id="linkedWorkItems"]/list').last.nil?
Nokogiri::XML::Builder.with(@doc.xpath('//work-item').last) do
field(:id => 'linkedWorkItems') {
list {}
}
end
end
# build and attach the link struct
Nokogiri::XML::Builder.with(@doc.xpath('//field[@id="linkedWorkItems"]/list').last) do
struct {
item(:id => 'revision')
item(:id => 'workItem') {
text lnk_wid
}
item(:id => 'role') {
text lnk_role
}
}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_role_url(url, role_index=0)\n implementation[\"roles\"][role_index][\"role_url\"]=url\n end",
"def admin_link_to_user(user)\n case user.role\n when 'influencer'\n link_to(user.full_name, admin_influencer_path(user.influencer))\n when 'affiliate'\n link_to(user.full_name, admin_affiliate_path(user.affiliate))\n when 'advertiser'\n link_to(user.full_name, admin_advertiser_path(user.advertiser))\n end\n end",
"def main_nav_link_helper(role,link_id,link_text,link_title,link_details)\n if has_role?(role)\n (\"<li id='#{link_id}'#{\" class='active'\" if main_nav_guess_current == link_id}>\" +\n link_to(link_text, link_details, :title => link_title) +\n \"</li>\").html_safe\n else\n \"\"\n end\n end",
"def update_user_role(params)\n self.link.update_attributes(role: params[:rolname], active: params[:active_link])\n end",
"def link_to_add_role(name, f, association, **args)\n new_object = f.object.send(association).klass.new\n id = new_object.object_id\n fields = f.fields_for(association, new_object, child_index: id) do |builder|\n render(association.to_s.singularize, f: builder)\n end\n link_to(name, \"#\", class: \"add_fields \" + args[:class], data: { id: id, fields: fields.gsub(\"\\n\", \"\") })\n end",
"def click_add_salesperson_link\n add_salesperson_link.click\n end",
"def create_and_link(title, itype, ltype, o={})\n item = Item.find_or_create(title, itype, o)\n Link.find_or_create(item.id, id, ltype, o)\n end",
"def linkItem _obj, _args\n \"_obj linkItem _args;\" \n end",
"def add_role(role)\n roles << role\n end",
"def addrole(event, role)\n if @assignable_roles.include? role then\n if event.message.author.roles.find {|r| r.name == role}\n event.send_message(\"but you already have that role sweetie\")\n else\n event.message.author.add_role get_role(event, role)\n event.send_message(\"mhm! role added, you're now #{role}\")\n end\n else\n event.send_message(\"i'm sorry honey, but i can't give you that role\")\n end\n end",
"def link\n h.content_tag :li do\n h.link_to h.content_tag(:i, '' , class: object.icon ) , object.url , target: \"_blank\" , title: object.name\n end\n end",
"def termref(name, role_name = nil)\n role_name ||= name\n element(role_name, {:href=>'#'+name, :class=>:object_type}, 'a')\n end",
"def termref(name, role_name = nil)\n role_name ||= name\n element(role_name, {:href=>'#'+name, :class=>:object_type}, 'a')\n end",
"def write_link(org_one, org_two)\n org_one = Organisation.find(org_one)\n org_two = Organisation.find(org_two)\n\n if org_one != org_two\n org_one.linked_to = org_one.linked_to + [org_two.uri] # write org:linkedTo\n org_two.linked_to = org_two.linked_to + [org_one.uri] # write org:linkedTo\n\n begin\n org_one.save!\n org_two.save!\n rescue\n false\n end\n end\n end",
"def add_link\n @bib.link.each do |l|\n case l.type&.downcase\n when \"doi\" then @item.doi = l.content\n when \"file\" then @item.file2 = l.content\n when \"src\" then @item.url = l.content\n end\n end\n end",
"def test_link\n authenticated_client.link test_link_full_name\nend",
"def bot_addrole(event, role=nil)\n if role.nil?\n event.send_message <<-MESSAGE\n the roles i'll let you play with are #{@assignable_roles.to_a.join \", \"}\n MESSAGE\n else\n addrole(event, role)\n end\n end",
"def add_href\n return if attributes.key?(\"href\")\n return unless attributes.key?(\"id\")\n attributes[\"href\"] = client.connection.api_path(\"#{collection.name}/#{attributes['id']}\")\n end",
"def hyperlink()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Hyperlink::HyperlinkRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def admin_user_with_role(user)\n send user.role, user\n end",
"def become_user_link_element(user)\n link_element(id: \"become-#{user.uid}\")\n end",
"def menu_item_link(m)\n options = {}\n if m.new_page\n options = {:target => \"_blank\"}\n end\n link_to m.title, m.url, options\n end",
"def link(relation, href, options={})\n @resource.add_link relation, href, options\n end",
"def addrole\n\t\tself.add_role :Guest\n\tend",
"def create_link(item_nr)\n \"<a href=\\'/item/#{item_nr}\\'>#{self}</a>\"\n end",
"def add_me_link\n link_to_function(_(\"add me\")) do |page|\n page.insert_html(:bottom, \"task_notify\",\n :partial => \"tasks/notification\",\n :locals => { :notification => current_user })\n end\n end",
"def add_another_asset_link\n expect(focused_element).to eq(find_button('Add another link').native)\n\n focused_element.send_keys(:enter,\n [:shift, :tab],\n [:shift, :tab],\n [:shift, :tab],\n [:shift, :tab])\n end",
"def project_link(project)\n context.link_to project.name, context.backlog_path(:user => project.user.username, :key => project.key)\n end",
"def add_link(link)\n links << link\n end",
"def <<(actor)\n @links[actor.mailbox.address] = actor\n end",
"def add_to_resource(resource)\n res = resource.put(:add_role, :id => resource.id, :role_id => self.id, :client_id => CLIENT_ID)\n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n return true\n else\n return false\n end\n end",
"def rezm_to_user_link(message)\n link_to message.receiver_name, user_path(message.receiver_name)\n end",
"def links\n\ttmp = []\n @doc.xpath('//field[@id=\"linkedWorkItems\"]/list/struct').each do |struct|\n\t linked_wid = struct.xpath('item[@id=\"workItem\"]').text\n\t role = struct.xpath('item[@id=\"role\"]').text\n\t tmp << \"#{role}:#{linked_wid}\"\n\tend\n\treturn tmp\n end",
"def add_link(src_policy_element, dst_policy_element)\n assert_different_machines(src_policy_element, dst_policy_element)\n src_policy_element.link_to(dst_policy_element)\n end",
"def add_salesperson_link\n self.get_element(@browser, '//a[contains(@href, \"/insertion_orders_persons_salespersons/create?insertion_orders.id=\")]')\n end",
"def add_user_to_role(role_id)\n # subject = Subject.find(preallowed_id)\n role = Role.find(role_id)\n\n # put :add_subject, :id => role.id, :subject_id => @subject.id, :client_id => @subject.client.id\n res = role.put(:add_subject, :id => role.id, :subject_id => preallowed_id, :client_id => CLIENT_ID)\n\n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n logger.debug \"successfully added preallowed_user to role\"\n return true\n else\n logger.error \"error adding preallowed_user to role\" \n return false\n end\n end",
"def add_to_wishlist product, options = {}\n options.reverse_merge! default_wishlist_options(product)\n wishlist_id = options[:wishlist_id].present? ? options[:wishlist_id] : @front_presenter.user_wishlist[product.id]\n\n link_body, link_path, link_options =\n if current_user.wishes.product_exists?(product.id)\n [I18n.t('delete'), product_wishlist_path(product, wishlist_id), options.merge!(wishlist_delete_options)]\n else\n [I18n.t('i_like'), product_wishlists_path(product), options.merge!(method: :post)]\n end\n\n link_to link_path, link_options do\n [make_tag, content_tag(:span, link_body)].join('').html_safe\n end\n end",
"def new_with(item) \n occupation = item.occupation\n if occupation.present?\n link_text = occupation&.link_text || 'n/a'\n organization = find_or_create_org(link_text, occupation)\n\n link = find_or_create_link(link_text, \"XING\", \"xing\", (occupation&.link || 'n/a'))\n\n unless (link.nil? || organization.links.exists?(link.id))\n organization.links << link\n end\n end\n end",
"def content_edit_action_link(text, object)\n content_edit_action_item(link_to_remote_facebox(text, member_url([@tier, object], :edit), {:rel => \"nofollow\"}))\n end",
"def _link(actor)\n @linked_actors << actor\n end",
"def set_link\n @link = current_user.links.find(params[:id])\n end",
"def view_edit_link(user, attraction)\n if user.admin\n content_tag(:p, link_to(\"Edit Attraction\", edit_attraction_path(attraction)))\n end\n end",
"def add_link(el, href, title, alt_text = T.unsafe(nil), ial = T.unsafe(nil)); end",
"def workflow_action_link(title, link, opts={})\n link_to(title, link, {:class=>'btn btn-mini'}.merge(opts))\n end",
"def path_for_edit(role_id)\n home_path\n end",
"def link *a; app.link *a end",
"def rezm_from_user_link(message)\n link_to message.sender_name, user_path(message.sender_name)\n end",
"def reply (workitem)\n\n reply_to_parent(workitem)\n end",
"def reply (workitem)\n\n reply_to_parent(workitem)\n end",
"def add_right(op, role)\n h = self.hhash\n h['overview'] ||= {}\n h['overview'][op] = role\n self.update_attribute(:hhash, h)\n end",
"def add_app_target_to_app_admin_role(user_id, role_id, app_name, options = {})\n put(\"/users/#{user_id}/roles/#{role_id}/targets/catalog/apps/#{app_name}\", options)\n end",
"def html_link(item)\n tag :a, yield, :href => item.url\n end",
"def delegate(workitem, new_owner)\n\n hwi = fetch(workitem)\n\n fail ArgumentError.new(\n \"workitem not found\"\n ) if hwi == nil\n\n fail ArgumentError.new(\n \"cannot delegate, workitem doesn't belong to anyone\"\n ) if hwi['owner'] == nil\n\n fail ArgumentError.new(\n \"cannot delegate, \" +\n \"workitem owned by '#{hwi['owner']}', not '#{workitem.owner}'\"\n ) if hwi['owner'] != workitem.owner\n\n hwi['owner'] = new_owner\n\n r = @context.storage.put(hwi, :update_rev => true)\n\n fail ArgumentError.new(\"workitem is gone\") if r == true\n fail ArgumentError.new(\"workitem got modified meanwhile\") if r != nil\n\n Workitem.new(hwi)\n end",
"def add_user_to_team(user, access_role)\n add_user_id_to_team(user.id, access_role)\n end",
"def add_role(role)\n return if self.roles.exists?(role.id)\n self.roles << role\n end",
"def link(link, title, content)\n\t \"<u><link href='#{link}'>#{content}</link></u>\"\n\t end",
"def add_user_role user, role\n user_role = ProjectRoleUser.new\n user_role.project = self\n user_role.user = user\n user_role.role = role\n user_role.save\n end",
"def add_role\n person\n end",
"def add_to_subject(subject)\n res = subject.put(:add_role, :id => subject.id, :role_id => self.id, :client_id => CLIENT_ID)\n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n return true\n else\n return false\n end\n end",
"def add_right\n role = Role.find(params[:id])\n\tright = Right.find(params[:right_id])\n role.rights << right\n redirect_to roles_rights_url\n\n end",
"def link_to_item(item, options = {})\n case item\n when Collection\n collection_url(item, options)\n when Community\n community_url(item, options)\n when DataObject\n data_object_url(item.latest_published_version_in_same_language || item, options)\n when User\n user_url(item, options)\n when TaxonConcept\n taxon_url(item, options)\n when UserAddedData\n options.merge!(anchor: item.anchor)\n taxon_data_url(item.taxon_concept, options)\n when DataPointUri\n options.merge!(anchor: item.anchor)\n taxon_data_url(item.taxon_concept, options)\n when Resource\n content_partner_resource_url(options[:content_partner], item)\n else\n raise EOL::Exceptions::ObjectNotFound\n end\n end",
"def link(link, title, content)\n \"#{content} (#{link})\"\n end",
"def addIssueBuyLink(unit, volume, issue, dbAttrs)\n key = \"#{unit}:#{volume}:#{issue}\"\n link = $issueBuyLinks[key]\n link and dbAttrs[:buy_link] = link\nend",
"def click_add_line_items_link\n add_line_items_link.click\n end",
"def addRole\n id = params[:id] # retrieve project ID from URI route\n proj = Project.find(id)\n if proj.add_role(params[:rolename])\n head :no_content\n else\n render_error(:unprocessable_entity, \"Failed to add a role\")\n end\n end",
"def link *a, &b; app.link *a, &b end",
"def link\n @link ||= links.find_by_organisation_id(context.current_organisation.id)\n end",
"def add_link(key, name)\n passage = Passage.where(name: name).first\n\n self.links << Link.create({ key: key, passage: passage })\n end",
"def link_to_user_training_story_edit( user_training_story )\n link_to( edit_user_training_story_path(id: user_training_story.id), class: 'btn btn-default' ) do\n image_tag('page_edit.png') << \" #{I18n.t(:edit)}\".html_safe\n end if check_story_ownership_for( user_training_story )\n end",
"def join_user user, as=:worker\n # Try to find previous role, who was deleted before\n if role = Role.unscoped.where(user_id: user.id, project_id: self.id).first\n role.update!({\n deleted: false,\n level: self.class.parse_role(as, true)\n })\n\n role\n else\n Role.create({\n level: self.class.parse_role(as, true),\n project_id: self.id,\n user_id: user.id\n })\n end\n end",
"def click_through_link\n\t\treturn '/items/' + self.items.first.slug if !self.items.first.blank?\n\t\treturn '/blog/' + self.blogs.first.slug if !self.blogs.first.blank?\n\t\treturn \"#\"\n\tend",
"def url_after_invite(invite)\n invite.invitable\n end",
"def admin_link\n # @subdomain = request.subdomain\n # @site = Site.where(subdomain: request.subdomain).first.user_id\n # @user = User.where(id: @site).first\n if user_signed_in? && @user.id == current_user.id\n html = '<li>' + (link_to '<i class=\"fa fa-cog\"></i> Admin'.html_safe, dashboard_path, target: \"_blank\") + '</li>'\n html.html_safe\n end\n end",
"def register_lti_link(org_unit_id, create_lti_link_data)\n path = \"/d2l/api/le/#{$le_ver}/lti/link/#{org_unit_id}\"\n payload = {\n 'Title' => '',\n 'Url' => '',\n 'Description' => '',\n 'Key' => '',\n 'PlainSecret' => '',\n 'IsVisible' => false,\n 'SignMessage' => false,\n 'SignWithTc' => false,\n 'SendTcInfo' => false,\n 'SendContextInfo' => false,\n 'SendUserId' => false,\n 'SendUserName' => false,\n 'SendUserEmail' => false,\n 'SendLinkTitle' => false,\n 'SendLinkDescription' => false,\n 'SendD2LUserName' => false,\n 'SendD2LOrgDefinedId' => false,\n 'SendD2LOrgRoleId' => false,\n 'UseToolProviderSecuritySettings' => false,\n 'CustomParameters' => nil # or Array of CustomParameter\n # e.g. [{\"Name\" => \"\", \"Value\" => \"\"},{\"Name\" => \"\", \"Value\" => \"\"}]\n }.merge!(create_lti_link_data)\n check_create_lti_link_data_validity(payload)\n _post(path, payload)\nend",
"def termref(name, role_name = nil)\n role_name ||= name\n element(role_name, {:href=>'#'+name, :class=>:term}, 'a')\n end",
"def link_to_invitations\n UserInvite.where(email: email).find_each do |invite|\n invite.user = self\n invite.save\n end\n end",
"def host(inv, options = {}) \n link_to(inv.inviter.user_name, member_profile_url(:id => inv.inviter.user_name), :target => options[:target]) if inv.inviter\n end",
"def link_action_edit(path = nil)\n path ||= path_args(entry)\n link_action ti(:\"link.edit\"), 'pencil', path.is_a?(String) ? path : edit_polymorphic_path(path)\n end",
"def link_action_edit(path = nil)\n path ||= path_args(entry)\n link_action ti(:\"link.edit\"), 'pencil', path.is_a?(String) ? path : edit_polymorphic_path(path)\n end",
"def add_role_account_admin\n add_role(ROLES[:account_admin], company)\n end",
"def assign_role\n self.add_role!(\"user\")\n end",
"def add_role!(role)\n role_obj = Role.find_or_create_by_name(role)\n self.add_role(role_obj.name)\n end",
"def reply(workitem)\n\n reply_to_parent(workitem)\n end",
"def ezm_link_to_inbox\r\n link_to \"Inbox\", inbox_url\r\n end",
"def url_after_invite(invite)\n invite.invitable\n end",
"def link_to_user_member user, is_index = false\n # Definimos variables\n link_class = is_index ? \"\" : \"option-button-icon option-button col-md-2 gap-right\"\n link_class = current_user == user ? link_class+\" disabled\" : link_class\n\n is_member = current_user.profile.member? user.profile\n icon = is_member ? 'user-times' : 'user-plus'\n url = is_member ? delete_user_membership_path(user_id: user) : send_user_membership_path(user_id: user, from_user: current_user)\n\n is_band_musician = current_user.band? && user.musician?\n is_musician_band = current_user.musician? && user.band?\n\n title = if is_band_musician\n if is_member\n \"Expulsar del grupo\"\n else\n \"Invitar al grupo\"\n end\n elsif is_musician_band\n if is_member\n \"Dejar el grupo\"\n else\n \"Unirte al grupo\"\n end\n end\n\n # Creamos el link si ambos usuarios son de distintos perfiles\n if is_band_musician || is_musician_band\n link_to fa_icon(icon), url, class: \"btn btn-default #{link_class}\",\n title: title, remote: true, data: {toggle: 'tooltip', placement: 'top'}\n end\n end",
"def authorized_only_link_to(obj, name, options = {}, html_options = nil)\n if obj.collaborable? || obj.user == current_user\n \" | \" + link_to(name, options, html_options)\n else\n \"\" #link_to_function name, '권한이 없습니다.'\n end\n end",
"def link(link, title, content)\n link = OodAppkit.files.api(path: @app_path.to_s + '/' + link).to_s if @app_path && relative?(link)\n return \"<a href=\\\"#{link}\\\" rel=\\\"noopener\\\" target=\\\"_blank\\\">#{content}</a>\" unless id_link?(link)\n return \"<a href=\\\"#{link}\\\">#{content}</a>\"\n end",
"def accept_role role\n self.roles.push role\n end",
"def create_links\n end",
"def create_links\n end",
"def display_edit_link(entry)\n if entry.user == current_user\n link_to (image_tag 'edit.png'), edit_entry_path(entry)\n end\n end",
"def display_edit_link(entry)\n if entry.user == current_user\n link_to (image_tag 'edit.png'), edit_entry_path(entry)\n end\n end",
"def add_link(target)\n link = Link.new\n link.target_type = target.class.to_s\n link.target_id = target.id\n #adding a link to the link collection should set the polymorphic assosication\n links << link\n link\n end",
"def assign_role(user, role_name)\n role = Role.find_by_name role_name\n user.role = role\n user.save!\nend",
"def role\n if current_user.has_role?(:guest)\n redirect_to \"/workouts\"\n elsif current_user.has_role?(:instructor)\n redirect_to \"/workouts\"\n end\n end",
"def switch_to(role)\n if self.is_admin?\n self.role = Role.find_by_name(role)\n self.save!\n return true\n else\n return false\n end\n end",
"def rails_admin_edit_user_link\n return nil unless @current_user.respond_to?(:email)\n abstract_model = RailsAdmin.config(@current_user.class).abstract_model\n return nil unless abstract_model\n return nil unless (edit_action = RailsAdmin::Config::Actions.find(:edit, controller: controller, abstract_model: abstract_model, object: @current_user)).try(:authorized?)\n get_edit_user_link @current_user, url_for(action: edit_action.action_name, model_name: abstract_model.to_param, id: @current_user.id, controller: 'rails_admin/main'.to_sym)\n end",
"def edit_link(path)\n\t\tif user_signed_in? && current_user.editor?\n\t\t\tlink_to(\"<span class='glyphicon glyphicon-pencil'> Editar\".html_safe, path)\n\t\telse\t\n\t\t\t'<a data-toggle=\"modal\" data-target=\"#can-not-edit-modal\"> <span class=\"glyphicon glyphicon-pencil\"> Editar</a>'.html_safe\n\t\tend\n\tend",
"def assign_role(role)\n found = false\n find('table[id$=\"gridRole_DXMainTable\"] > tbody').all('tr').map do |row|\n row.all('td').map do |cell|\n cell_data = cell.text.strip\n if cell_data == role\n row.click\n found = true\n end\n break if found\n end\n break if found\n end\n end"
] | [
"0.5651713",
"0.5580572",
"0.5452056",
"0.5435948",
"0.5411164",
"0.5391962",
"0.5356014",
"0.531838",
"0.5298207",
"0.5297529",
"0.52965766",
"0.5295887",
"0.5295887",
"0.5289582",
"0.52657247",
"0.52458954",
"0.52362657",
"0.52158487",
"0.52028644",
"0.51917166",
"0.5188409",
"0.51273715",
"0.51148856",
"0.51025105",
"0.5096165",
"0.5091032",
"0.5086032",
"0.50761896",
"0.5074224",
"0.50517005",
"0.5044012",
"0.50321925",
"0.5026238",
"0.50225097",
"0.50122494",
"0.50110483",
"0.501072",
"0.500906",
"0.50088197",
"0.50084037",
"0.50062567",
"0.4995942",
"0.49841005",
"0.4976987",
"0.49765313",
"0.49720153",
"0.4958333",
"0.49582988",
"0.49582988",
"0.4957993",
"0.49547789",
"0.4949674",
"0.49492016",
"0.4946458",
"0.4929912",
"0.49276245",
"0.49259248",
"0.49236006",
"0.49234596",
"0.49226242",
"0.49206412",
"0.49173614",
"0.4916382",
"0.49076176",
"0.49070764",
"0.48984742",
"0.48959905",
"0.48906595",
"0.48902923",
"0.4888362",
"0.48838368",
"0.48802966",
"0.48793522",
"0.48628995",
"0.48592982",
"0.4857869",
"0.48562536",
"0.48501894",
"0.48501894",
"0.48487976",
"0.4845634",
"0.4836548",
"0.4835542",
"0.48324454",
"0.48300022",
"0.48199293",
"0.48164195",
"0.4814339",
"0.479302",
"0.47837287",
"0.47837287",
"0.4782032",
"0.4782032",
"0.47804305",
"0.47798628",
"0.4779803",
"0.4778876",
"0.4777645",
"0.4771957",
"0.47676936"
] | 0.61871344 | 0 |
Save workitem on filesystem | def save!
Powirb.log.debug("[#{wid}] saving on #{@filename}")
File.open(@filename, 'w+') {|io| io.puts @doc}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save!\n ScriptoriaCore::Ruote.engine.storage_participant.do_update(_workitem)\n end",
"def save\n file_path = self.class.file_path(@save_id)\n File.open(file_path, 'w') { |file| \n bytes = file.write @items.inspect\n if bytes > 0\n puts \"saved to #{file_path}\"\n else\n puts \"save to #{file_path} failed\"\n end\n }\n end",
"def save_to(path); end",
"def save!; File.write @path, @data end",
"def on_workitem\n\n doc = workitem.to_h\n\n doc.merge!(\n 'type' => 'workitems',\n '_id' => to_id(doc['fei']),\n 'participant_name' => doc['participant_name'],\n 'wfid' => doc['fei']['wfid'])\n\n doc['store_name'] = @store_name if @store_name\n\n @context.storage.put(doc, :update_rev => true)\n end",
"def save\n pathname.open('w') { |file| file.write(data) }\n end",
"def store_wffile\n # verify if there is actually a file to be saved\n if @file_data\n # create the WORKFLOW_STORE Folder if it does not exist\n FileUtils.mkdir_p File.join WORKFLOW_STORE, \"#{id}\"\n # create the file and write the data to the file system\n File.open(workflow_filename, 'wb') do |f|\n f.write(@file_data.read)\n end\n # ensure that the data is only save once by clearing the cache after savig\n @file_data = nil\n end\n end",
"def save\n repository.create_contents(path, \"Upload #{path}\", content)\n end",
"def save!\n path = File.join(basedir, computed_filename)\n Rails.logger.info \"Saved GPX file as #{path}\"\n file = File.new(path, 'wb')\n file.write contents\n file.close\n file\n end",
"def save(inode)\n logger.info(\"machine.save\")\n raise Exceptions::NotImplemented\n end",
"def dump_to_file (file_name, workitem)\n\n File.open(file_name, 'w') do |file|\n file.print(encode_workitem(workitem))\n end\n end",
"def save(wfid, jid, job, context_buffer)\n raise NotImplementedError\n end",
"def save(prog, problem_id)\n FileUtils::mkdir_p get_workspace_for_problem(problem_id) # make the directory\n path = File.join(get_workspace_for_problem(problem_id), prog.original_filename) # create the file path\n File.open(path, \"wb\") { |f| f.write(prog.read) } # write the file\n end",
"def save_to(path)\n (File.open(path, 'w') << to_s).close\n path\n end",
"def save_to(path)\n (File.open(path, 'w') << to_s).close\n path\n end",
"def save(data)\n File.open(@local_file_path, \"wb\") {|file| file.write(data) }\n end",
"def save # :nodoc:\n if @file\n File.open(SAVE_FILE, 'w') do |f|\n Marshal.dump(file, f)\n end\n else\n forget\n end\n end",
"def save # :nodoc:\n if @file\n File.open(SAVE_FILE, 'w') do |f|\n Marshal.dump(file, f)\n end\n else\n forget\n end\n end",
"def save_as(path)\n @wb.saveAs(java.io.File.new(path))\n end",
"def save\n timeout_retry(3, 3){\n write \"SAVE\\r\\n\"\n status_code_reply\n }\n end",
"def save_to_file(path = nil)\n content\n file = Store::File.find_by(id: store_file_id)\n if !file\n raise \"No such file #{store_file_id}!\"\n end\n\n if !path\n path = Rails.root.join('tmp', filename)\n end\n ::File.open(path, 'wb') do |handle|\n handle.write file.content\n end\n path\n end",
"def save_as(path)\n FileUtils.mkdir_p(path)\n File.open(File.join(path, 'contents.xcworkspacedata'), 'w') do |out|\n out << to_s\n end\n end",
"def save_file\n\tcounter = 1;\n\ttime = Time.now.strftime(\"%d/%m/%Y\")\n\treport_file_puts \"\"\n\treport_file_puts \"Title of saved TodoList: #{@title}\"\n\treport_file_puts \"Save time: #{time}\"\n\treport_file_puts \"----------------------------\"\n\t\t@items.each do |item|\n\n\t\treport_file_puts \"#{counter.to_s} #{item.description} Completion status: #{item.completed_status.to_s}\"\n\t\tcounter +=1;\t\n\tend\t\nend",
"def save! path\n File.open(path, 'w') do |file|\n file.write(to_s)\n end\n end",
"def save_as(path)\n contents = generate\n path.open('w') do |f|\n f.write(contents)\n end\n end",
"def save_as(path)\n contents = generate\n path.open('w') do |f|\n f.write(contents)\n end\n end",
"def save_as(path)\n contents = generate\n path.open('w') do |f|\n f.write(contents)\n end\n end",
"def save_as(path)\n contents = generate\n path.open('w') do |f|\n f.write(contents)\n end\n end",
"def save_as(path)\n contents = generate\n path.open('w') do |f|\n f.write(contents)\n end\n end",
"def save\n MoxiworksPlatform::Task.update(self.to_hash)\n end",
"def save!\n if save\n self\n else\n raise FileNotSaved\n end\n end",
"def save\n now = Time.now\n\n data = {\n :id => @id,\n :desc => @desc,\n :ctime => Timestamp.dump(@ctime) || Timestamp.dump(now),\n :mtime => Timestamp.dump(now),\n :ppg_filename => @ppg_filename,\n }\n jobinfo.write(YAML.dump(data))\n end",
"def save!\n filepath.dirname.mkpath\n filepath.open( \"w\" ) do |f|\n f << YAML.dump( @entries )\n end\n clear_modified\n true\n end",
"def save\n ensure_file_open!\n @file.commit\n true\n end",
"def save_as(path)\n generate.save_as(path)\n end",
"def save_as(path)\n generate.save_as(path)\n end",
"def save(path)\n File.open(path,\"w\"){|out| out.puts Marshal.dump(self) }\n end",
"def save_file\n raise ArgumentError, 'Need a Path to save the file' if @path.nil?\n File.open(@path, 'w') do |f|\n f.write to_s\n end\n end",
"def save_to_file\n f = File.open(\"#{IMAGE_DATA_DIR}/#{self.id}\",\"w\")\n f.write(self.data)\n f.close\n end",
"def save_as(path, overwrite=true)\n write_file(overwrite, path)\n end",
"def save\n File.open(path, 'w+') { |f| f.write(to_rb + \"\\n\") }\n end",
"def save(item)\n url = item['images']['standard_resolution']['url']\n created_at = Time.at(item['created_time'].to_i)\n folder_name = \"#{ USERNAME }/#{ created_at.strftime(\"%Y/%m\") }\"\n file_path = \"#{ folder_name }/#{ item['id'] }.jpg\"\n\n # Organize photos into year and month folders\n `mkdir -p #{ folder_name }`\n\n # Check if 1080 resolution is available (not exposed in their api)\n url_1080 = url.gsub('s640x640', 's1080xs1080')\n url = url_1080 if `curl -s -I #{ url_1080 }` =~ /200 OK/\n\n # Download photo\n `curl -s -o #{ file_path } #{ url }`\n\n # Set exif time\n `./jhead-3.00 -mkexif -ts#{ created_at.strftime('%Y:%m:%d-%T') } #{ file_path }`\n\n # Set exif comment to include location and caption\n location = item['location']['name'] if item['location'] && item['location']['name']\n caption = item['caption']['text'] if item['caption'] && item['caption']['text']\n comment = [location, caption].compact.join(' | ')\n .gsub(/\\n/, ' ')\n .gsub(/\\s+/, ' ')\n .gsub(/\"/, \"'\")\n `./jhead-3.00 -cl \"#{ comment }\" #{ file_path }`\n\n puts \"saved #{ item['id'] }\"\nend",
"def save(options = {})\n save_to(@path, options)\n end",
"def save_path_tree\n file = File.open(DATA_STORE, 'w')\n file.write path_tree.dump.to_json\n file.close\n end",
"def save_file\n if self.file then\n self.file.save\n end\n end",
"def _save_worker(id, worker, args)\n File.open(File.join(TEMP_W_DIR, \"#{id}.yml\"), 'w') do |f|\n f.write(YAML.dump({ worker => args }))\n end\n end",
"def save_file\r\n @saved = true\r\n saving\r\n Dir.mkdir(\"saves\") unless Dir.exists? \"saves\"\r\n File.open(\"my_save.yaml\", \"w\") {|f| f.puts YAML::dump(self) }\r\n end",
"def save\n create_file\n true\n end",
"def save_file\n unless $list_Item.curselection.empty?\n idx = $list_Item.curselection\n idx = idx[0]\n $bucket_item = $bucket_items[idx]\n obj = $s3.bucket($bucket).object($bucket_item)\n filename = Tk::getSaveFile(:initialfile => $bucket_item)\n begin\n unless filename.empty?\n obj.get(response_target: filename)\n end\n rescue\n Tk.messageBox('type' => 'ok',\n 'icon' => 'error',\n 'title' => 'Cannot Save File',\n 'message' => 'Cannot Save File')\n end\n end\n end",
"def save_bookmark(data)\n t = open(File.expand_path(\"~/Dropbox/test.txt\"), \"a\")\n t.write(data)\n puts \"saved\"\n t.close\nend",
"def save_attached_files; end",
"def save_attached_files; end",
"def working_write(path, data, flags = \"\")\n @file_opener.open(path, \"w\") do |file|\n file.write(data)\n end\n if flags && flags.include?('x')\n FileHelpers.set_executable(working_join(path), true)\n end\n end",
"def save!\n begin\n case filename\n when STDOUT_FLAG\n $stdout.write(contents)\n else\n ::File.open(@filename,\"w\") do |f|\n f.write(contents)\n end\n end\n @dirty = false\n rescue => e\n raise FileAccessError, \"Error saving file #{@filename} : #{e.message}\"\n end\n end",
"def saveRepositoryObject(objectName, toSave)\n\n #puts \"saveRepositoryObject : #{@DIR_NAME}#{@FILE_NAME}_Contents#{@@FS}\"\n if !File.exist? (\"#{@DIR_NAME}#{@FILE_NAME}_Contents#{@@FS}\")\n FileUtils.mkdir_p(\"#{@DIR_NAME}#{@FILE_NAME}_Contents#{@@FS}\")\n end\n saveFile(\"#{@DIR_NAME}#{@FILE_NAME}_Contents#{@@FS}#{objectName}.obj\", toSave)\n return \"#{@DIR_NAME}#{@FILE_NAME}_Contents#{@@FS}#{objectName}\"\n\n end",
"def save(how = :to_yaml)\n file = @tlog.repository.join('spool').join(filename)\n contents = send(how)\n Info << \"#{component.name}: write #{how}(#{contents.size}Bytes) to #{file}\"\n file.open('w+') do |file|\n file.write(contents)\n end\n contents.size\n end",
"def persistent_to_quicksave\n p_file = File.open(File.join([self.path, 'persistent.sfs']), 'r'){|f| f.readlines}\n File.open(File.join([self.path, 'quicksave.sfs']), 'w'){|f| f.write(p_file.join)}\n end",
"def encode_workitem (wi)\n YAML.dump(wi)\n end",
"def save_local(place_path, io)\n file_saved = true\n begin\n file = open(place_path, \"w\")\n file.write(io.read)\n file.close\n rescue => e\n file_saved = false\n end\n return file_saved\n end",
"def consume (workitem)\n\n FileUtils.mkdir_p(@workdir) unless File.exist?(@workdir)\n\n file_name = @workdir + determine_file_name(workitem)\n\n dump_to_file(file_name, workitem)\n\n reply_to_engine(workitem) if @reply_anyway\n end",
"def save\n save_to_file(@output_file, @contents)\n end",
"def save(path_or_io)\n yaml = YAML.dump(to_yaml_hash)\n\n case path_or_io\n when String, Pathname\n File.open(path_or_io, 'w') { |f| f.write(yaml) }\n else\n path_or_io.write(yaml)\n end\n end",
"def save_file(path, content)\n FileUtils.mkdir_p(File.expand_path(\"..\", path))\n File.open(path, \"w\") do |f|\n f.write(content)\n end\n end",
"def save_status(file_path)\n begin\n Pathname.new(file_path).open('wb') do |f|\n @saved_at = Fluent::Engine.now\n @saved_duration = @saved_at - @last_checked\n Marshal.dump({\n :counts => @counts,\n :saved_at => @saved_at,\n :saved_duration => @saved_duration,\n :aggregate => @aggregate,\n :count_key => @count_key,\n :patterns => @patterns,\n }, f)\n end\n rescue => e\n log.warn \"out_datacounter: Can't write store_file #{e.class} #{e.message}\"\n end\n end",
"def save(path)\n Pathname.new(path).write(self.to_yaml)\n\n true\n rescue\n # TODO Add a custom exception here to track why it erred. IO? Permissions? etc.\n false\n end",
"def save_task(task)\n update_object_xml('Task', task.id, task.to_xml)\n end",
"def save_file(path, content)\n File.open(path, 'w') do |f|\n f.write content\n end\n end",
"def savefile(filename, fileio)\n self.class.transaction do\n self.resume_name = filename\n self.resume_path = format(upload(fileio))\n self.save\n end\n end",
"def save(item_id = @raw_data[\"id\"])\n r = chef_server_rest\n begin\n if Chef::Config[:why_run]\n Chef::Log.warn(\"In why-run mode, so NOT performing data bag item save.\")\n else\n r.put(\"data/#{data_bag}/#{item_id}\", self)\n end\n rescue Net::HTTPClientException => e\n raise e unless e.response.code == \"404\"\n\n r.post(\"data/#{data_bag}\", self)\n end\n self\n end",
"def save_as(filename = T.unsafe(nil)); end",
"def save_as(filename = T.unsafe(nil)); end",
"def save_as(filename = T.unsafe(nil)); end",
"def save!\n File.open(@config[\"lock_file\"], File::RDWR | File::CREAT, 0o600) do |fl|\n # take the lock in non-blocking mode. if this process doesn't get the lock\n # then another will be run from cron shortly. this prevents a whole bunch\n # of processes queueing on the lock and causing weirdness if/when they\n # get woken up in a random order.\n got_lock = fl.flock(File::LOCK_EX | File::LOCK_NB)\n break unless got_lock\n\n # try and write the files to tmp locations and then\n # move them into place later, to avoid in-progress\n # clashes, or people seeing incomplete files.\n begin\n changesets = open_changesets\n @state[\"sequence\"] = sequence\n @state[\"last_run\"] = @now\n\n write_tmp_files!(changesets)\n\n move_tmp_files_into_place!\n\n fl.flock(File::LOCK_UN)\n rescue StandardError\n warn \"Error! Couldn't update state.\"\n fl.flock(File::LOCK_UN)\n raise\n end\n end\n end",
"def save_to(filepath)\n File.open(filepath, \"w\") do |fp|\n fp.write(self.to_s)\n end\n end",
"def save(flatten = false)\n tmp_file = SecureRandom.uuid\n save_as(tmp_file, flatten)\n File.rename tmp_file, @file\n end",
"def update(workitem)\n\n r = @context.storage.put(workitem.to_h, :update_rev => true)\n\n r.is_a?(Hash) ? Ruote::Workitem.new(r) : r\n end",
"def save_to(path, content) \n begin \n dir = File.dirname(path)\n # Create a new directory (does nothing if directory exists or is a file)\n FileUtils.mkdir_p dir #unless File.dirname(path) == \".\"\n \n open(path, \"w\") do |f|\n f.write(content)\n end \n\n rescue StandardError => e\n puts e\n end\n end",
"def save_to(path)\n File.write(path, to_fdf)\n end",
"def consume (workitem)\n\n workitem.attributes['compact_workitems'] = true if compact_workitems\n\n Workitem.from_owfe_workitem workitem\n # does the 'saving to db'\n end",
"def store!(file_path)\n\n filename = File.basename(file_path)\n file = File.open(file_path, 'r')\n\n object_name = \"#{Date.today.strftime('%Y-%m-%d')}_#{filename}\"\n object = container.create_object(object_name)\n object.write(file)\n\n file.close\n\n puts \" -> Stored #{file_path} as #{object_name}\"\n\n end",
"def save\n raise NotImplementedError\n end",
"def save\n create_ok = exists? ? true : create\n upload_ok = @unwritten_contents ? upload_new_content : true\n\n create_ok && upload_ok\n end",
"def save\n perform_save\n end",
"def save_object\n end",
"def save\n path = UPLOADS_DIR.join(archive.original_filename)\n File.open(path, 'w') do |file| \n file.write(archive.read)\n end\n if backend = Instance.backend\n backend.deploy path\n end\n end",
"def save(obj)\n if obj.is_a? Wunderlist::List\n return save_list obj\n elsif obj.is_a? Wunderlist::Task\n return save_task obj\n end\n end",
"def save_and_close( filename = clean_name )\n result.parent.export filename\n end",
"def save(flatten: false)\n tmp_file = SecureRandom.uuid\n save_as(tmp_file, flatten: flatten)\n File.rename tmp_file, @file_path\n end",
"def save\n flush_deletes unless @options[:keep_old_files]\n process = only_process\n @queued_for_write.except!(:original) if process.any? && !process.include?(:original)\n flush_writes\n @dirty = false\n true\n end",
"def save\n File.open(path, 'w+') do |f|\n f.write(to_json)\n end\n\n true\n end",
"def persist!\n ::File.write(self.path, Marshal.dump(self))\n rescue => e\n puts e.message\n exit\n end",
"def save_file_entry\n @user.search_files.create!(file_path: uploaded_file_path.result, file_name: @file.original_filename, status: 'initialized')\n end",
"def save_file_to_disk(new_content, filepath) \n File.open(filepath, 'w') { |f| f.write(new_content)}\n end",
"def save_to(directory, options = T.unsafe(nil)); end",
"def save(resource_path, body)\n output_path = \"#{@output}/#{resource_path}\"\n return if File.exists? output_path\n required_dirs = File.dirname(output_path)\n FileUtils.mkdir_p(required_dirs) unless Dir.exists? required_dirs\n File.open(output_path, 'wb') do |fo|\n fo.write body\n end\n end",
"def save\n raise NotImplementedError\n end",
"def store obj, msg\n Dir.chdir(working_dir) do\n dirname = File.dirname(obj.path)\n FileUtils.mkdir_p(dirname) unless File.directory?(dirname)\n File.open(obj.path, 'w'){ |f| f.write(obj.content) }\n add(obj.path)\n end\n commit_index(msg)\n end",
"def save\n fail ESP::NotImplementedError\n end",
"def save\n fail ESP::NotImplementedError\n end",
"def save\n fail ESP::NotImplementedError\n end"
] | [
"0.7494753",
"0.7417596",
"0.6990294",
"0.6774721",
"0.65350753",
"0.64432013",
"0.6435946",
"0.6339212",
"0.63153625",
"0.62360924",
"0.62077975",
"0.6199994",
"0.61547506",
"0.61535966",
"0.61535966",
"0.61302906",
"0.6097697",
"0.6097697",
"0.6096614",
"0.6040261",
"0.6009495",
"0.59812313",
"0.5980293",
"0.5977462",
"0.59724957",
"0.59724957",
"0.59724957",
"0.59724957",
"0.59724957",
"0.5971303",
"0.5967493",
"0.59631115",
"0.5936307",
"0.5901798",
"0.5881016",
"0.5881016",
"0.58797216",
"0.5871704",
"0.58622533",
"0.5843394",
"0.5841854",
"0.5839232",
"0.5824454",
"0.5808187",
"0.57722235",
"0.57699746",
"0.5767873",
"0.57599497",
"0.57544035",
"0.5717216",
"0.5702302",
"0.5702302",
"0.5686069",
"0.56838",
"0.5680144",
"0.56764936",
"0.56725",
"0.5671576",
"0.56373733",
"0.56328356",
"0.56282675",
"0.5624839",
"0.56118417",
"0.5611675",
"0.5602524",
"0.5600931",
"0.55994684",
"0.5597161",
"0.55945456",
"0.55891013",
"0.55891013",
"0.55891013",
"0.5587058",
"0.55763",
"0.55762106",
"0.5566693",
"0.5557424",
"0.5556594",
"0.5552857",
"0.55479765",
"0.5547493",
"0.5540807",
"0.55395854",
"0.5536917",
"0.5536901",
"0.55255264",
"0.55233526",
"0.5521714",
"0.5513079",
"0.5511734",
"0.5511267",
"0.5505536",
"0.5502933",
"0.5501958",
"0.5500101",
"0.54993695",
"0.54987365",
"0.5484877",
"0.5484877",
"0.5484877"
] | 0.5601792 | 65 |
Return a list with all field names | def fields
@doc.xpath("//field").map{|node| node['id']}.sort
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def field_names\r\n return @field_names\r\n end",
"def field_names\n fields.keys\n end",
"def all_field_names\n field_set.all_field_names\n end",
"def field_names\n @_field_path.map{ |field_| field_.name }\n end",
"def fields\n @fields.keys\n end",
"def fields\n @fields.keys\n end",
"def field_names\n attribute_names.map(&:to_sym)\n end",
"def names\n NAME_FIELDS.map { |k| has_field?(k) ? @fields[k].tokens : nil }.flatten.compact\n end",
"def field_names\n @field_names ||= attribute_names.map(&:to_sym)\n end",
"def field_names\n jso.field_names\n end",
"def field_names\n @field_names ||= (columns_hash.keys.map(&:to_sym) rescue [])\n end",
"def keys\n fields.map { |f| f.name }\n end",
"def field_names(include_hidden = false)\n # collect field names\n names = []\n hidden = no_eval_param(:hide)\n @field_names.each do |name|\n if include_hidden or not hidden.include?(name)\n names << name\n end\n end\n names\n end",
"def fields\n klass.members.map(&:to_sym)\n end",
"def field_names\n internal_format.keys\n end",
"def all_fields\n fields.values\n end",
"def get_field_names(template)\n read(template).fields.map{|f| f.name}\n end",
"def all_fields\n @fields.values\n end",
"def field_names(filter = [], include_inherited = true)\n names = fields.keys\n\n if include_inherited && has_parent?\n names.concat(inherited_fields)\n end\n\n unless filter.empty?\n names = names & filter.map(&:to_sym)\n end\n\n names.sort!\n names\n end",
"def names\n iterator = @form_fields.keySet.iterator\n set = []\n set << iterator.next.toString.to_sym while iterator.hasNext\n set\n end",
"def fields\n []\n end",
"def field_names\n (text_fields + html_fields + atom_fields + datetime_fields +\n number_fields + geo_fields).uniq\n end",
"def fields\n FIELDS\n end",
"def fields\r\n @hash.keys\r\n end",
"def field_names\n label_fields.to_h\n end",
"def fields\n FIELDS\n end",
"def fields\n FIELDS\n end",
"def field_names\n property_defaults.keys\n end",
"def get_field_names(template); end",
"def mailchimp_list_field_names\n config.mailchimp_list_fields.map(&:name)\n end",
"def fields\n properties.keys.map(&:to_sym)\n end",
"def fields\n properties.keys.map(&:to_sym)\n end",
"def get_fields\n return (\n _get_specific_action_config(:action_fields, :fields)&.map(&:to_s) ||\n self.get_model&.column_names ||\n []\n )\n end",
"def string_field_names\n # database_field_names.join(', ')\n database_field_names.to_s[1...-1]\n end",
"def fields\n @fields ||= []\n end",
"def fields\n @fields\n end",
"def fields\n @fields\n end",
"def name_list(*fields, **opt)\n clean = !opt.key?(:clean) || opt.delete(:clean)\n fields.flat_map { |field| find_record_items(field, **opt) }.tap do |result|\n result.compact_blank!\n result.uniq!\n result.map! { |item| clean_name(item, **opt) } if clean\n end\n end",
"def fields\n all_fields\n end",
"def field_names\n (@profile.keys - NON_PROFILE_FIELDS).sort\n end",
"def fields\n @fields ||= []\n end",
"def fields\n @field_labels.collect { |k, v| { sym: k, name: v } }\n end",
"def fields\n column_names.map(&:to_sym)\n .reject { |c| [:id, :created_at, :updated_at].include? c }\n end",
"def field_ids\n @fields.keys\n end",
"def field_list(no_placeholder_fields: false)\n return @field_list if @field_list\n\n fields = db_columns.keys.map(&:to_s)\n\n if respond_to?(:placeholder_fields) && !no_placeholder_fields\n placeholder_fields.each do |before, placeholder|\n i = fields.index(before)\n i ||= 0\n fields.insert(i, placeholder)\n end\n end\n\n @field_list = fields.join(' ')\n end",
"def get_field_list\n return make_request(\"#{self.endpoint}/list/fields\")\n end",
"def display_fields\n database_field_names\n end",
"def headers\n fields.map(&:name).map(&:to_sym)\n end",
"def fields(*args)\n return @fields if args.empty?\n @fields = args.flatten.compact.map{|i| i.to_sym}\n end",
"def fields\n @fields\n end",
"def config_fields\n get_config_fields.map { |f| f[:field_name].to_sym }\n end",
"def config_fields\n get_config_fields.map { |f| f[:field_name].to_sym }\n end",
"def field_names\n drawings.pluck(:field_name)\n end",
"def get_fields\n FIELD_DESCS\n end",
"def all_fields\n found_fields = Array.new\n self.fields.each do |field|\n found_fields << field\n found_fields = found_fields + field.all_fields if field.type == 'ObjectField'\n end\n found_fields\n end",
"def fields\n self.class.fields(true)\n end",
"def field(field)\n field = field.to_s\n result = []\n keys.sort.each do |name|\n result << self[name].get(field)\n end\n result\n end",
"def person_name_fields\n \"\".tap do |result|\n fields_for(:person_name) do |f|\n result << f.text_field(:name_prefix)\n result << f.text_field(:first_name)\n result << f.text_field(:middle_name)\n result << f.text_field(:last_name)\n result << f.text_field(:name_suffix)\n end\n end\n end",
"def as_names\n __getobj__.map { |i| i.name }\n end",
"def fields\n return @fields if defined?(@fields)\n\n @fields = array_of_items_for(Fields, :fields)\n end",
"def database_field_names\n attributes = instance_variables.collect{|a| a.to_s.gsub(/@/,'')}\n delete_from_array(attributes, attributes_that_should_not_be_in_database_field_names)\n attributes\n end",
"def fields\n schema.fields\n end",
"def all_fields\n fields = Set.new(@fields)\n @times.each {|entry| fields += entry.keys} unless fields.size > 0\n return fields.to_a.sort\n end",
"def fields\n schema.fields\n end",
"def fields\n schema.fields\n end",
"def fields\n schema.fields\n end",
"def fields()\n if !@custom_fields || @fields.length == 0 then\n @elements.each { |field|\n if field.respond_to?(:is_form_field) then\n @fields << field.name\n @element_map[field.name.to_s] = field\n elsif field.is_a?(Fieldset) then\n @fields << { field.name => field.fields }\n @element_map.update(field.element_map)\n end\n }\n end\n @fields.uniq!\n return @fields\n end",
"def names\n all.map { |item| item.name_sym }\n end",
"def facet_field_names(lens = nil)\n blacklight_config_for(lens).facet_fields.values.map(&:field)\n end",
"def fields_by_name(name)\n @fields.select{|f|f.name==name}\n end",
"def names\n collect { |a| a.name }\n end",
"def fields\n class_name.constantize.fields\n end",
"def names\n map(&:name)\n end",
"def list_fields(table)\n @protocol.synchronize do\n begin\n @protocol.reset\n @protocol.send_packet Protocol::FieldListPacket.new(table)\n fields = []\n until Protocol.eof_packet?(data = @protocol.read)\n fields.push Field.new(Protocol::FieldPacket.parse(data))\n end\n return fields\n rescue ServerError => e\n @sqlstate = e.sqlstate\n raise\n end\n end\n end",
"def complete_name_list\n #User.select(:name).map{|user_record| user_record.name}\n end",
"def fields(*fields)\n result = []\n keys.sort.each do |name|\n result << self[name].pick(*fields)\n end\n result\n end",
"def names\n map(&:name)\n end",
"def fields_by_name(name)\n @fields.select{|f|f.name==name}\n end",
"def fields\n a = attributes.keys.to_a\n a.delete_if { | e | e =~ /^id$/ }\n end",
"def names\n map(&:names).flatten\n end",
"def fetch_fields\n @fields\n end",
"def fields\n [*lookup]\n end",
"def fields\n iterator = @form_fields.keySet.iterator\n map = {}\n while iterator.hasNext\n key = iterator.next.toString\n map[key.to_sym] = field(key)\n end\n map\n end",
"def fields\n raw['fields']\n end",
"def all\n __getobj__.column_names\n end",
"def fields\n self.find('ns:field', :ns => self.class.registered_ns).map do |field|\n Field.new(field)\n end\n end",
"def getHeaderFieldNames\n\t\tend",
"def dynamo_fields\n DynamoField.find(:all, :conditions=>['model = ?', self.to_s]).map(&:field_name)\n end",
"def get_array_of_symbolic_keys\n # getting array of keys (in symbol form)\n all_fields = self.attributes.keys.map do |key|\n key.to_sym;\n end\n return all_fields\n end",
"def public_fields\n fields.select{ |field_name| field_name[0] != '_' }\n end",
"def fields\n if frozen?\n Array(@gapi.fields).map { |f| Field.from_gapi(f).freeze }.freeze\n else\n Array(@gapi.fields).map { |f| Field.from_gapi f }\n end\n end",
"def fields\n java_import org.dspace.content.MetadataField\n MetadataField.findAllInSchema(DSpace.context, @obj.getSchemaID)\n end",
"def index_field_names\n Blacklight.config[:index_fields][:field_names]\n end",
"def foreign_key_fields\n keys = []\n database_field_names.each do |param|\n if self.send(param).is_a? ForeignKey\n keys << param\n end\n end\n keys\n end",
"def fields\n @fields ||= @stats.keys.select{ |k| k != RECORDS_LISTING_KEY}.flatten.uniq\n end",
"def fields\n @locations.map(&:field).uniq\n end",
"def get_fields\n # Initialize fields to return with empty array in order to include all\n fields = []\n delete_fields = []\n query_params = request.query_parameters\n if query_params.has_key? 'fields'\n fields = query_params['fields'].downcase.split(',')\n fields.each do |field|\n delete_fields << field unless (AppData.column_names.include?(field) || (field == 'review'))\n end\n end\n return fields - delete_fields\n end",
"def field_types\r\n return @field_types\r\n end",
"def names\n @list.keys\n end",
"def fields; end",
"def fields; end"
] | [
"0.8677694",
"0.86425143",
"0.8264976",
"0.82000244",
"0.7941163",
"0.7941163",
"0.79170007",
"0.7871886",
"0.786355",
"0.78615886",
"0.7802413",
"0.778707",
"0.7646379",
"0.76435477",
"0.75965893",
"0.7595485",
"0.75356984",
"0.7477407",
"0.7459868",
"0.74335945",
"0.74277395",
"0.7397674",
"0.73743355",
"0.73494333",
"0.7315071",
"0.7284292",
"0.72319615",
"0.7189206",
"0.717666",
"0.7171619",
"0.7161947",
"0.7161947",
"0.71142215",
"0.7097432",
"0.70805025",
"0.7067093",
"0.7067093",
"0.7039146",
"0.70379007",
"0.7036173",
"0.7031601",
"0.70081985",
"0.6977772",
"0.697166",
"0.6963248",
"0.6954554",
"0.6942979",
"0.6942489",
"0.69095004",
"0.690572",
"0.6880399",
"0.6880399",
"0.68788105",
"0.6848686",
"0.68379676",
"0.68356735",
"0.6826849",
"0.681581",
"0.6812611",
"0.6786401",
"0.6778605",
"0.67541295",
"0.6748869",
"0.6736357",
"0.6736357",
"0.6736357",
"0.67319393",
"0.67294216",
"0.67128706",
"0.6697022",
"0.6687714",
"0.66812086",
"0.6663728",
"0.66529757",
"0.6648125",
"0.66372544",
"0.6627481",
"0.6602919",
"0.65994525",
"0.6595179",
"0.65772086",
"0.6576467",
"0.65757686",
"0.6557587",
"0.65564823",
"0.6553186",
"0.6526573",
"0.65251154",
"0.6520416",
"0.6513788",
"0.6507398",
"0.64777535",
"0.64750206",
"0.6469754",
"0.64680904",
"0.64601153",
"0.64487803",
"0.644333",
"0.644015",
"0.6436996",
"0.6436996"
] | 0.0 | -1 |
Return the "space" under which the workitem lives (tracker xor document) | def space
if @filename.include?('/.polarion/tracker/')
return 'tracker'
else
File.dirname(@filename).split(/\//)[4]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_space()\n get_parent(\"SPACE\")\n end",
"def get_space()\n get_parent(\"SPACE\")\n end",
"def get_space(sp)\n @spaces[sp]\n end",
"def system_space\n spaces[SYSTEM_SPACE_ID]\n end",
"def get_space_use()\n return \"Office\"\n end",
"def space()\n #This is a stub, used for indexing\n end",
"def get_space(coordinates)\n\t\treturn self.tictactoespaces.find_by_coordinates(coordinates)\n\tend",
"def confidential_space\n space_membership && object.confidential_space(space_membership)\n end",
"def workspace\n\t\tself.datastore['WORKSPACE'] ||\n\t\t\t(framework.db and framework.db.active and framework.db.workspace and framework.db.workspace.name)\n\tend",
"def open_space?(spot)\n !@occupied_spaces.key?(spot)\n end",
"def path_space\n @path_space\n end",
"def space_id\n fil_header[:space_id]\n end",
"def record_space\n used_space - header_space - directory_space - trailer_space\n end",
"def get_free_space\n get(Codenjoy::Client::Games::Tetris::Board::ELEMENTS[:NONE])\n end",
"def loots(wspace=workspace)\n\t\twspace.loots\n\tend",
"def workspace\n @cue_list.workspace\n end",
"def available_space\n if is_data_center?\n 99_999_999\n else\n @available_space\n end\n end",
"def find_user_space\n @space = Space.undeleted.find(params[:space_id])\n raise ApiError, \"The space is locked.\" if @space.visible_by?(current_user) && @space.locked?\n\n return unless @space.accessible_by_user?(current_user)\n\n @space\n end",
"def occupied_spaces\n spaces = []\n return spaces unless @page\n @page.occupied_spaces.each do |coord|\n spaces << [@x + coord[0], @y + coord[1]]\n end\n return spaces\n end",
"def space_membership\n object.space_memberships.active.find_by(user: current_user)\n end",
"def nasa_space_craft; end",
"def current_workplace\n if @workplace && current_admin\n @workplace.name\n else#fail safe\n end \n end",
"def workspace_info\n link_to_workspace_info(\"http://library.nyu.edu/info/myworkspace.html\", \"left\")\n end",
"def get_spaces_to_pass\n return nil unless @start_space\n return nil unless @end_space\n\n dijkstra = Dijkstra.new(SpaceConnection.all)\n path = dijkstra.shortest_path(@start_space.id, @end_space.id)\n path\n end",
"def workspace_info\n @dir + WORKSPACE_INFO_FILENAME\n end",
"def get_area()\n @space.get_area()\n end",
"def rpc_get_workspace(wspace)\n db_check\n wspace = find_workspace(wspace)\n ret = {}\n ret[:workspace] = []\n if wspace\n w = {}\n w[:name] = wspace.name\n w[:id] = wspace.id\n w[:created_at] = wspace.created_at.to_i\n w[:updated_at] = wspace.updated_at.to_i\n ret[:workspace] << w\n end\n ret\n end",
"def space=(space)\n #This is a stub, used for indexing\n end",
"def notes(wspace=workspace)\n\t\twspace.notes\n\tend",
"def current_participatory_space\n model\n end",
"def payload_space(explicit_target = nil)\n explicit_target ||= target\n\n if (explicit_target and explicit_target.payload_space)\n explicit_target.payload_space\n elsif (payload_info['Space'])\n payload_info['Space'].to_i\n else\n nil\n end\n end",
"def cloud_space\n return nil if self.cloud_space_id.nil?\n begin\n return ::Resources::CloudSpace.new.find(self.cloud_space_id)\n rescue Resources::Exceptions::NotFound => e\n return nil\n end\n end",
"def space(space_id)\n return spaces[space_id] if spaces[space_id]\n\n unless (table_record = data_dictionary.table_by_space_id(space_id))\n raise \"Table with space ID #{space_id} not found\"\n end\n\n add_table(table_record[\"NAME\"])\n\n spaces[space_id]\n end",
"def open_spaces\n board.map.with_index { |space, index| index if space_open?(index) }.compact\n end",
"def used_space\n size - free_space\n end",
"def set_space\n @space = current_user.spaces.friendly.find(params[:id])\n end",
"def column_space(); @column_space; end",
"def current_item\n current_window.item\n end",
"def all_occupied_spaces\n occupied_spaces('black') + occupied_spaces('white')\n end",
"def GetRequSpace(initialize)\n GetPartitionInfo() if !@info_called\n\n # used space in kB\n used = 0\n\n #$[ \"dir\" : [ total, usednow, usedfuture ], .... ]\n Builtins.foreach(Pkg.TargetGetDU) do |dir, sizelist|\n used = Ops.add(used, Ops.get_integer(sizelist, 2, 0))\n end\n Builtins.y2milestone(\"GetReqSpace Pkg::TargetGetDU() %1\", Pkg.TargetGetDU)\n # used is in kB\n String.FormatSize(Ops.multiply(used, 1024))\n end",
"def myworkspace_id\n if framework.db.active\n myworkspace.id\n else\n nil\n end\n end",
"def available_spaces\n open_spaces = []\n @board.first.each_with_index do |element, index|\n open_spaces << index if element == \"\\u26b3\" \n end\n open_spaces\n end",
"def collect_winning_positions\n \twinning_positions = [ @spaces[:space_1] + @spaces[:space_2] + @spaces[:space_3],\n \t\t\t\t\t\t @spaces[:space_4] + @spaces[:space_5] + @spaces[:space_6],\n \t\t\t\t\t\t @spaces[:space_7] + @spaces[:space_8] + @spaces[:space_9],\n \t\t\t\t\t\t @spaces[:space_1] + @spaces[:space_4] + @spaces[:space_7],\n \t\t\t\t\t\t @spaces[:space_2] + @spaces[:space_5] + @spaces[:space_8],\n \t\t\t\t\t\t @spaces[:space_3] + @spaces[:space_6] + @spaces[:space_9],\n \t\t\t\t\t\t @spaces[:space_1] + @spaces[:space_5] + @spaces[:space_9],\n \t\t\t\t\t\t @spaces[:space_3] + @spaces[:space_5] + @spaces[:space_7] ]\n \twinning_positions\n end",
"def get_window_area()\n get_children_area(\"WINDOW\")\n end",
"def current_space\n if @parcels.empty?\n @volume.to_i\n else\n sum = 0\n @parcels.each do |parcel|\n sum += parcel.volume.to_i\n end\n @volume.to_i - sum\n end\n end",
"def current_user_membership\n space_membership\n end",
"def get_space(opts = {})\n data, _status_code, _headers = get_space_with_http_info(opts)\n return data\n end",
"def get_window_area()\n get_children_area(\"WINDOW\")\n end",
"def space_available?(space)\n \t@spaces[to_space_sym(space)] == \" \" ? true : false\n end",
"def space_force_rank; end",
"def get_open_spaces(board)\n\t\topen_spots = Array.new\n\t\tboard.each_with_index do |x, xi|\n\t\t\tx.each_with_index do |y, yi|\n\t\t\t\tif y == ''\n\t\t\t\t\topen_spots.push(Coordinate.new(xi, yi))\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\topen_spots\n\tend",
"def reserve_space space\n return if self.last and self.last.id >= space\n\n o = self.new\n o.id= space\n o.save_without_alter_ego\n o.delete\n return\n end",
"def misplaced_space?\n space && (space_id != space.space_id)\n end",
"def available_space\n quota - size\n end",
"def parent_work\n find_related_frbr_objects( :is_part_of, :which_works?) \n end",
"def free_space\n @ole.FreeSpace\n end",
"def space_by_table_name(table_name)\n unless (table_record = data_dictionary.table_by_name(table_name))\n raise \"Table #{table_name} not found\"\n end\n\n return if table_record[\"SPACE\"].zero?\n\n space(table_record[\"SPACE\"])\n end",
"def find_space_in_system(slug, params={}, headers=default_headers)\n @logger.info(\"Retrieving Space \\\"#{slug}\\\"\")\n get(\"#{@api_url}/spaces/#{slug}\", params, headers)\n end",
"def current_cell_items\n @cell_items[@current_room_id]\n end",
"def available_spaces\n @grid.flatten.select {|value| value.class == Fixnum}\n end",
"def add_space(space)\n raise \"Object was not an Innodb::Space\" unless space.is_a?(Innodb::Space)\n\n spaces[space.space_id.to_i] = space\n end",
"def space\n\t\tAstroLocation.new(@db, rawString)\n\tend",
"def space\n\t\tAstroLocation.new(@db, rawString)\n\tend",
"def free_spaces\n @list.map { |bin| [@operations_lower_bound - bin.size, 0].max }\n end",
"def allow_space\n name = params[:namespace]\n @space = Space.find_space(@user, name).take || not_found\n end",
"def last_used_item(); $game_temp.last_used_item; end",
"def check_for_open_board\n active_spaces.values.include?(\" \")\n end",
"def opposite_private_space(shared_space)\n if reviewer? && confidential?\n shared_space.confidential_spaces.sponsor.first\n else\n shared_space.confidential_spaces.reviewer.first\n end\n end",
"def space_user space\n begin\n space_users.find_by_space_id(space.id)\n rescue ActiveRecord::RecordNotFound\n nil\n end\n end",
"def item\n @item_window.item\n end",
"def set_space\n @space = @location.spaces.find_by_permalink(params[:space_id])\n raise ActiveRecord::RecordNotFound unless @space\n end",
"def available_slots()\n return @size - @used_spaces\n end",
"def occupied_by\n @occupied_by\n end",
"def workspace\n # Return a default workspace value if there is no parent resource\n return authenticated_workspace unless parent\n # Generate a workspace value from the visibility of the parent resource\n visibility = parent.model.visibility.try(:first)\n visibility == public_visibility ? public_workspace : authenticated_workspace\n end",
"def collection\n Decidim::ParticipatoryProcess\n .where(organization: Decidim::Organization.first)\n .published.public_spaces\n end",
"def shard\n self\n end",
"def rackspace?(node = __getnode)\n node.key?(\"rackspace\")\n end",
"def look\n @store[@top]\n end",
"def look\n @store[@top]\n end",
"def look\n @store[@top]\n end",
"def look\n @store[@top]\n end",
"def look\n @store[@top]\n end",
"def look\n @store[@top]\n end",
"def item2\n @item_window2.item\n end",
"def item\n @cm_window.item\n end",
"def x\n wd.location[0]\n end",
"def rpc_current_workspace\n db_check\n { \"workspace\" => self.framework.db.workspace.name, \"workspace_id\" => self.framework.db.workspace.id }\n end",
"def board_spaces(winning_combo)\n winning_combo.map {|space| board[space] } \n end",
"def directory_space\n directory_slots * PAGE_DIR_SLOT_SIZE\n end",
"def word()\r\n\t\treturn @word\r\n\tend",
"def empty_space\n max_stock - total_stock\n end",
"def find_word(lexical_item)\n \n end",
"def ibuffer_space()\r\n if (@pop_index > @push_index)\r\n return (@pop_index - @push_index - 1)\r\n else\r\n return (@ibuffer_len - (@push_index - @pop_index))\r\n end\r\n end",
"def used_space(notification)\n used_space = SYMBOL_NAMES_SIZE + notification.id.size + notification.created_at.to_time.to_i.size +\n notification.type.size\n\n used_space += notification.params[:action_id].size if notification.params[:action_id]\n\n used_space\n end",
"def workspace_id(index)\n i = get_field_index_by_external_id(index,@fields[:workspace])\n fields(index, i)['item_id'].to_i unless i.nil?\n end",
"def window_rect\n manage.window.rect\n end",
"def window_rect\n manage.window.rect\n end",
"def window_rect\n manage.window.rect\n end",
"def unit_of_work_id\n context[:unit_of_work_id]\n end",
"def get_tuple_space(tuple_space_id)\n @tuple_space_lock.synchronize {@tuple_space[tuple_space_id]}\n end",
"def space_taken? \n @taken_space = Carspace.find_by_taken_user_id(current_user.id)\nend"
] | [
"0.70735896",
"0.70703137",
"0.6586922",
"0.631907",
"0.62866944",
"0.62201846",
"0.61526424",
"0.5852432",
"0.5796302",
"0.57935655",
"0.5757408",
"0.5695092",
"0.56598026",
"0.56559503",
"0.5655083",
"0.5616547",
"0.5594899",
"0.555124",
"0.5539366",
"0.5458791",
"0.54364806",
"0.54274726",
"0.54261947",
"0.5424335",
"0.53771764",
"0.5373857",
"0.53704935",
"0.53535527",
"0.5334968",
"0.5330947",
"0.5330888",
"0.5317344",
"0.52435327",
"0.5230919",
"0.52229774",
"0.52082217",
"0.5202184",
"0.51745147",
"0.51691455",
"0.5166217",
"0.5163621",
"0.5162874",
"0.51553315",
"0.5141881",
"0.5132121",
"0.51162446",
"0.5103234",
"0.5102567",
"0.5100103",
"0.50913405",
"0.5083937",
"0.5082207",
"0.50530237",
"0.5041902",
"0.50339013",
"0.5027745",
"0.50140274",
"0.4998425",
"0.49844694",
"0.4967872",
"0.4957824",
"0.4957514",
"0.4957514",
"0.49523365",
"0.49517617",
"0.49506545",
"0.4949472",
"0.49449036",
"0.4941976",
"0.49209285",
"0.4919119",
"0.49181005",
"0.49170306",
"0.4908264",
"0.49063218",
"0.49002486",
"0.4897284",
"0.4891563",
"0.4891563",
"0.4891563",
"0.4891563",
"0.4891563",
"0.4891563",
"0.48884642",
"0.48855126",
"0.48822588",
"0.48801556",
"0.48760515",
"0.487416",
"0.48728877",
"0.48727092",
"0.487134",
"0.48637062",
"0.48620182",
"0.48601598",
"0.48580194",
"0.48580194",
"0.48580194",
"0.48499563",
"0.48449174",
"0.484357"
] | 0.0 | -1 |
Delete a wrapup code from a queue | def delete_routing_queue_wrapupcode(queue_id, code_id, opts = {})
delete_routing_queue_wrapupcode_with_http_info(queue_id, code_id, opts)
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_game_id_in_queue game_id, queue = nil\n current_queue = queue || craft_firebase_command(\"minesweeper/queue.json\")\n\n # getting new queue to update\n new_queue = current_queue&.reject { |queue_game_id|\n # reject chosen game\n game_id == queue_game_id\n }\n\n # update queue on server\n update_current_queue(new_queue)\nend",
"def remove\n @queue.shift\n end",
"def delete\n @queue << \"delete\"\n end",
"def remove\n @queue.pop\n end",
"def z_remove_from_queue(queue, data)\n raise PipelineNotSupported if @redis.client.is_a?(Redis::Pipeline)\n\n priority = extract_priority(data)\n z_item = @redis.zrevrange(redis_key_for_queue(queue), 0, -1).find do |item|\n (priority && item.include?(data)) || \\\n (item.include?(data[/\"class\":\"[^ \"]+/]) && item.include?(data[/\"args\":.+/]))\n end or return\n @redis.zrem(redis_key_for_queue(queue), z_item)\n end",
"def remove\n @queue.shift\n end",
"def remove\n @queue.shift\n end",
"def deq\n @queued = false\n nil\n end",
"def remove_from_queue(queue, data)\n prioritized?(queue) ? z_remove_from_queue(queue, data) : super\n end",
"def remove!(item)\n @queue.delete(item)\n end",
"def remove_from_queue\n if in_queue?\n decrement_queue_positions_on_lower_items\n update_attribute queue_position_column, nil\n end\n end",
"def purge_interrupt_queue; end",
"def purge_interrupt_queue; end",
"def remove\n\t\t#Clean up unused rtwork\n\t\tif Artwork.find_by_majorpost_uuid(params[:majorpost_uuid])\n\t\t\tResque.enqueue(Image::ArtworkCleanup, params[:majorpost_uuid])\n\t\tend\n\tend",
"def remove!; end",
"def remove!\n @queue_for_removal.each do |path|\n FileUtils.rm(path) if File.exist?(path)\n end\n @removed = @queue_for_removal.dup\n @queue_for_removal.clear\n end",
"def delete\n @thread.__trim_stack_to_level(@index)\n end",
"def remover_item\n # Remove um item do final do buffer\n BUFFER.pop\n end",
"def clear_queue\n case @remove\n when 'one'\n puts \"Clearing e-mails #{@search_direction} #{@email}\"\n puts ''\n `exiqgrep -i #{@direction} #{@email} | xargs -P10 -i exim -Mrm '{}' >/dev/null`\n when 'all'\n if @valid_domain\n puts \"Removing all e-mails #{@search_direction} #{@domain}\"\n `exiqgrep -i #{@direction} #{@domain} | xargs -P10 -i exim -Mrm '{}' >/dev/null`\n else\n puts \"#{@domain} is not a valid local domain. Removing e-mails #{@search_direction} #{@email} instead\"\n `exiqgrep -i #{@direction} #{@email} | xargs -P10 -i exim -Mrm '{}' >/dev/null`\n end\n else\n puts \"Didn't remove any emails from the mailque\"\n end\n end",
"def handle_queue_clear(args)\n @queue = [[]]\n end",
"def delete_queue(queue_name)\r\n execute(:delete, queue_name, {}, {:x_ms_version => '2009-09-19'})\r\n end",
"def remove(pid)\n @dead_queues.unshift(@pids[pid]) # keep track of queues that pid was running, put it at front of list\n @pids.delete(pid)\n procline\n end",
"def deleteQueue( queue_id)\n params = Hash.new\n params['queue_id'] = queue_id\n return doCurl(\"delete\",\"/queue\",params)\n end",
"def destroy!\n sqs.delete_queue(queue_url: address)\n end",
"def dequeue; @queue.pop end",
"def clear_code(code)\n if url = find(code)\n purge(code, url)\n end\n end",
"def delete\n result, _ = Sidekiq::Batch.redis(bid) do |conn|\n conn.pipelined do\n conn.hsetnx(\"b-#{bid}\", \"deleted\", \"1\")\n conn.del \"b-#{bid}-failinfo\",\n \"b-#{bid}-notify\",\n \"b-#{bid}-cbsucc\",\n \"b-#{bid}-success\",\n \"b-#{bid}-complete\",\n \"b-#{bid}-jids\"\n conn.zrem('batches'.freeze, bid)\n conn.expire \"b-#{bid}\", Sidekiq::Batch::LINGER\n end\n end\n result ? bid : nil\n end",
"def clean_queue!\n # Go through the song queue from start to end\n queued_songs.each_with_index do |song, index|\n if song['playAt'] + song['duration'] > Time.now.to_i\n # This song is still ok to have, trim of all the ones to the left\n $redis.ltrim(queue_key, index, -1)\n return\n end\n end\n\n # Okay, every song has played already, nuke it\n $redis.del(queue_key)\n end",
"def pop_from_restriction_queue(tracking_key, queue)\n queue_key = restriction_queue_key(tracking_key, queue)\n str = Resque.redis.lpop(queue_key)\n post_pop_size = Resque.redis.llen(queue_key)\n\n if post_pop_size == 0\n update_queues_available(tracking_key, queue, :remove)\n clear_runnable(tracking_key, queue)\n end\n\n decrement_queue_count(queue)\n\n # increment by one to indicate that we are running\n increment_running_count(tracking_key) if str\n\n decode(str)\n end",
"def delete\n # Note that $curbuf does not point to the buffer that is being deleted;\n # we need to use Vim's <abuf> for the correct buffer number.\n current = ::VIM::evaluate('expand(\"<abuf>\")').to_i\n stack.delete_if { |number| number == current }\n end",
"def deq\n\t\tremove(0)\n\tend",
"def delete_message(data); end",
"def delete_message(data); end",
"def delete_if(&block); end",
"def remove_bot(key)\n @queue.push([:remove_bot, key])\n end",
"def remove; end",
"def remove; end",
"def remove; end",
"def remove; end",
"def remove_from_queue\n Resque.remove_delayed(SchedulerJob, :id => self.id)\n end",
"def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end",
"def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end",
"def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end",
"def kill_thread\n # TODO: ideally this would be unshift, but Queues don't have that. Come up with an alternative.\n @queue << Directive::SUICIDE_PILL\n end",
"def unlock_queueing_for_queue(queue)\n Resque.data_store.everything_in_queue(queue).uniq.each do |string|\n item = Resque.decode(string)\n\n unlock_queueing(queue, item).tap { RecoveringQueue.remove(queue, item) }\n end\n end",
"def clear\n @que.clear\n end",
"def clear\n @que.clear\n end",
"def delete_song(song)\n @queue.find { |x| x == song }.delete\n @queue.delete(song)\n end",
"def purge\n @queue.purge\n end",
"def purge\n @queue.purge\n end",
"def purge\n @queue.purge\n end",
"def clear\n queue.clear\n end",
"def _put_back_on_queue(message)\n future = nil\n _redis.multi do\n _redis.rpush(@queue, message)\n future = _redis.lrem(@in_progress_queue, 1, message)\n end\n removed = future.value\n if removed !=1\n RailsPipeline.logger.error \"ERROR: Didn't remove message from in_progress queue?!!!\"\n end\n end",
"def delete_polling_thread(key); end",
"def execution_queue_finalizer(execution_id)\n\t\tproc do\n\t\t\t@execution_queues.synchronize(:EX) do\n\t\t\t\t@execution_queues.delete(execution_id)\n\t\t\tend\n\t\tend\n\tend",
"def remove_from_queue!(user)\n $redis.lrem(self.class.redis_key_for_user(user), 0, to_redis_object)\n end",
"def clear\n @que.clear\n self\n end",
"def kill\n @queue << \"kill\"\n end",
"def step\n @queue.enq nil\n end",
"def clear_code(code)\n if url_obj = url_object(code)\n @url_bucket.delete url_key(url_obj.data)\n @code_bucket.delete url_obj.key\n end\n end",
"def tcl_delete(_client_data)\n raise 'tcl function is going to be removed'\n end",
"def del(*args); end",
"def remove message\n @events.delete message.sequence\n end",
"def delete( queue_name )\n req = KJess::Request::Delete.new( :queue_name => queue_name )\n resp = send_recv( req )\n return KJess::Response::Deleted === resp\n end",
"def delete_worker\n\n rmq = Thread.current[:rmq_exchange]\n t = Thread.new(self) do |name|\n\n Thread.current[:name] = name\n Thread.current[:rmq_exchange] = rmq\n deleter = Delete.new(@broker_id, @platform, @server, @entity,\n {\n destination: @dst_class.new(@pg_connection, @broker_id, @platform, @server, @entity),\n cache: @cache\n })\n\n begin\n deleter.launch\n rescue Exception => msg\n Helper.error(msg, deleter)\n raise msg\n end\n end\n\n # Abort main thread in case child exceptions\n t.abort_on_exception = true if $config[:env][:stop_on_thread_ex]\n t\n\n end",
"def remove\n raise QueueUnderflow if empty?\n result = @info.shift\n changed\n notify_observers(self, :remove, result)\n result\n end",
"def delete_routing_queue_wrapupcode_with_http_info(queue_id, code_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_routing_queue_wrapupcode ...\"\n end\n \n \n # verify the required parameter 'queue_id' is set\n fail ArgumentError, \"Missing the required parameter 'queue_id' when calling RoutingApi.delete_routing_queue_wrapupcode\" if queue_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'code_id' is set\n fail ArgumentError, \"Missing the required parameter 'code_id' when calling RoutingApi.delete_routing_queue_wrapupcode\" if code_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/queues/{queueId}/wrapupcodes/{codeId}\".sub('{format}','json').sub('{' + 'queueId' + '}', queue_id.to_s).sub('{' + 'codeId' + '}', code_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\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: RoutingApi#delete_routing_queue_wrapupcode\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def clear_code(url)\n if url = find(code)\n purge(code, url)\n end\n end",
"def delete(element)\n synchronize do\n @queue.delete(element)\n end\n end",
"def delete_if\n deleted = []\n @queue.delete_if do |fullname|\n comment = Models::Comment.new(@client, name: fullname).reload\n action = yield comment\n if action == :delete\n comment.delete\n deleted << fullname\n end\n action == :keep || action == :delete\n end\n deleted\n end",
"def purge\n @channel.queue_purge(@name)\n end",
"def delete\n @thread.exit\n end",
"def delete(element)\n synchronize do\n @queue.delete(element)\n end\n end",
"def delete(element)\n synchronize do\n @queue.delete(element)\n end\n end",
"def done!\n @meta[Cworked_at] = nil\n put_meta\n\n # remove from both queues\n rcache.lrem(queue.working_cache_key, 0, trx_id)\n rcache.lrem(queue.retries_cache_key, 0, trx_id)\n end",
"def delete(queue)\n @mutex.lock if @multithread\n\n raise MemCacheError, \"No active servers\" unless active?\n cache_key = make_cache_key key\n server = get_server_for_key cache_key\n\n sock = server.socket\n raise MemCacheError, \"No connection to server\" if sock.nil?\n\n begin\n sock.write \"delete #{cache_key}\\r\\n\"\n sock.gets\n rescue SocketError, SystemCallError, IOError => err\n server.close\n raise MemCacheError, err.message\n end\n ensure\n @mutex.unlock if @multithread\n end",
"def clear_queue(queue_name)\r\n execute :delete, \"#{queue_name}/messages\", {}, :x_ms_version => '2009-09-19'\r\n end",
"def pop\n @lock.synchronize do\n @queue.pop\n end\n end",
"def delete_item(code)\n @stock.delete(code.to_sym)\n end",
"def clear\n @queue.clear\n end",
"def clear\n @que.clear\n end",
"def destroy!\n children = @zk.children(full_queue_path)\n locks = []\n children.each do |path|\n lock = @zk.locker(\"#{full_queue_path}/#{path}\")\n lock.lock!\n locks << lock\n end\n children.each do |path|\n @zk.delete(\"#{full_queue_path}/#{path}\")\n end\n @zk.delete(full_queue_path)\n locks.each do |lock|\n lock.unlock!\n end\n end",
"def delete_routing_queue_wrapupcode_with_http_info(queue_id, code_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_routing_queue_wrapupcode ...\"\n end\n \n \n # verify the required parameter 'queue_id' is set\n fail ArgumentError, \"Missing the required parameter 'queue_id' when calling RoutingApi.delete_routing_queue_wrapupcode\" if queue_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'code_id' is set\n fail ArgumentError, \"Missing the required parameter 'code_id' when calling RoutingApi.delete_routing_queue_wrapupcode\" if code_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/queues/{queueId}/wrapupcodes/{codeId}\".sub('{format}','json').sub('{' + 'queueId' + '}', queue_id.to_s).sub('{' + 'codeId' + '}', code_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud Auth']\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: RoutingApi#delete_routing_queue_wrapupcode\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def remove_path_from_queue(path)\n redis.srem paths_to_visit_key, path\n end",
"def clear\n @gate.synchronize do\n @queue = []\n @has_faulted = true\n end\n end",
"def pop()\n @queue.shift\n end",
"def purge\n t = Time.now\n expired = []\n @queue.each do |identity,worker|\n expired << identity if t > worker.expiry\n end\n expired.each do |identity|\n @queue.delete identity\n end\n end",
"def clear_intention_queue\n state.delete \"queued_actions\"\n nil\n end",
"def clear_queue\n @postponed_queries = []\n\n self\n end",
"def take_msg(queue)\n msg = queue.reserve\n #by calling ybody we get the content of the message and convert it from yml\n count = msg.ybody.count\n result = count*count\n msg.delete\n return result\n end",
"def purge\n @items.delete_if(&:is_done) \n end",
"def destroy\n @caller_queue = CallerQueue.find(params[:id])\n @caller_queue.destroy\n\n respond_to do |format|\n format.html { redirect_to(caller_queues_url) }\n format.xml { head :ok }\n end\n end",
"def delete_opcode(opcode)\n @chunks = chunks.select { |chunk| chunk.ord != opcode }\n self\n end",
"def redis_queues_cleanup!\n Gitlab::Redis::Queues.with(&:flushdb)\n end",
"def destroy\n profile = calc_profile\n cmd = \"jms-queue #{profile} remove --queue-address=#{@resource[:name]}\"\n bring_down 'JMS Queue', cmd\n end",
"def delete_xmp\n Jhead.call(\"-dx\", @match, @pattern)\n end",
"def remove\n @container.stop\n @container.delete\n end",
"def clearQueue\n @itemList.clear()\n end",
"def removeItemFromBackpack _obj, _args\n \"_obj removeItemFromBackpack _args;\" \n end"
] | [
"0.67168385",
"0.6701427",
"0.6632236",
"0.6622205",
"0.6597389",
"0.6577218",
"0.65414107",
"0.63598996",
"0.63252467",
"0.6315745",
"0.6314911",
"0.6211737",
"0.6211737",
"0.62098676",
"0.61528486",
"0.6131801",
"0.6096151",
"0.60693914",
"0.60602576",
"0.6050812",
"0.60457677",
"0.6045405",
"0.59943014",
"0.5991854",
"0.5958331",
"0.5924802",
"0.5919587",
"0.591517",
"0.5912816",
"0.5904047",
"0.5901195",
"0.5894928",
"0.5894928",
"0.5886766",
"0.5872888",
"0.58705264",
"0.58705264",
"0.58705264",
"0.58705264",
"0.586736",
"0.58497006",
"0.58497006",
"0.58497006",
"0.58376265",
"0.5834956",
"0.5827221",
"0.5827221",
"0.5824221",
"0.580837",
"0.580837",
"0.580837",
"0.5794768",
"0.5789489",
"0.5776015",
"0.5774998",
"0.576301",
"0.5761278",
"0.5759005",
"0.57381046",
"0.57333744",
"0.5726241",
"0.5708818",
"0.5706258",
"0.5705893",
"0.56935513",
"0.5685016",
"0.5682192",
"0.56808835",
"0.56807476",
"0.5676196",
"0.56751204",
"0.56703764",
"0.5668666",
"0.5668666",
"0.56441736",
"0.5636383",
"0.56313556",
"0.5615702",
"0.56107664",
"0.56106585",
"0.5608242",
"0.56080264",
"0.5604658",
"0.56036055",
"0.5597127",
"0.5595515",
"0.55895656",
"0.5564386",
"0.556015",
"0.5529059",
"0.5525514",
"0.5522081",
"0.5521554",
"0.551216",
"0.5510917",
"0.55088896",
"0.5500228",
"0.5498953",
"0.5493129"
] | 0.6529408 | 8 |
Delete a wrapup code from a queue | def delete_routing_queue_wrapupcode_with_http_info(queue_id, code_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.delete_routing_queue_wrapupcode ..."
end
# verify the required parameter 'queue_id' is set
fail ArgumentError, "Missing the required parameter 'queue_id' when calling RoutingApi.delete_routing_queue_wrapupcode" if queue_id.nil?
# verify the required parameter 'code_id' is set
fail ArgumentError, "Missing the required parameter 'code_id' when calling RoutingApi.delete_routing_queue_wrapupcode" if code_id.nil?
# resource path
local_var_path = "/api/v2/routing/queues/{queueId}/wrapupcodes/{codeId}".sub('{format}','json').sub('{' + 'queueId' + '}', queue_id.to_s).sub('{' + 'codeId' + '}', code_id.to_s)
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#delete_routing_queue_wrapupcode\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_game_id_in_queue game_id, queue = nil\n current_queue = queue || craft_firebase_command(\"minesweeper/queue.json\")\n\n # getting new queue to update\n new_queue = current_queue&.reject { |queue_game_id|\n # reject chosen game\n game_id == queue_game_id\n }\n\n # update queue on server\n update_current_queue(new_queue)\nend",
"def remove\n @queue.shift\n end",
"def delete\n @queue << \"delete\"\n end",
"def remove\n @queue.pop\n end",
"def z_remove_from_queue(queue, data)\n raise PipelineNotSupported if @redis.client.is_a?(Redis::Pipeline)\n\n priority = extract_priority(data)\n z_item = @redis.zrevrange(redis_key_for_queue(queue), 0, -1).find do |item|\n (priority && item.include?(data)) || \\\n (item.include?(data[/\"class\":\"[^ \"]+/]) && item.include?(data[/\"args\":.+/]))\n end or return\n @redis.zrem(redis_key_for_queue(queue), z_item)\n end",
"def remove\n @queue.shift\n end",
"def remove\n @queue.shift\n end",
"def delete_routing_queue_wrapupcode(queue_id, code_id, opts = {})\n delete_routing_queue_wrapupcode_with_http_info(queue_id, code_id, opts)\n return nil\n end",
"def delete_routing_queue_wrapupcode(queue_id, code_id, opts = {})\n delete_routing_queue_wrapupcode_with_http_info(queue_id, code_id, opts)\n return nil\n end",
"def deq\n @queued = false\n nil\n end",
"def remove_from_queue(queue, data)\n prioritized?(queue) ? z_remove_from_queue(queue, data) : super\n end",
"def remove_from_queue\n if in_queue?\n decrement_queue_positions_on_lower_items\n update_attribute queue_position_column, nil\n end\n end",
"def remove!(item)\n @queue.delete(item)\n end",
"def purge_interrupt_queue; end",
"def purge_interrupt_queue; end",
"def remove\n\t\t#Clean up unused rtwork\n\t\tif Artwork.find_by_majorpost_uuid(params[:majorpost_uuid])\n\t\t\tResque.enqueue(Image::ArtworkCleanup, params[:majorpost_uuid])\n\t\tend\n\tend",
"def remove!; end",
"def remove!\n @queue_for_removal.each do |path|\n FileUtils.rm(path) if File.exist?(path)\n end\n @removed = @queue_for_removal.dup\n @queue_for_removal.clear\n end",
"def delete\n @thread.__trim_stack_to_level(@index)\n end",
"def remover_item\n # Remove um item do final do buffer\n BUFFER.pop\n end",
"def clear_queue\n case @remove\n when 'one'\n puts \"Clearing e-mails #{@search_direction} #{@email}\"\n puts ''\n `exiqgrep -i #{@direction} #{@email} | xargs -P10 -i exim -Mrm '{}' >/dev/null`\n when 'all'\n if @valid_domain\n puts \"Removing all e-mails #{@search_direction} #{@domain}\"\n `exiqgrep -i #{@direction} #{@domain} | xargs -P10 -i exim -Mrm '{}' >/dev/null`\n else\n puts \"#{@domain} is not a valid local domain. Removing e-mails #{@search_direction} #{@email} instead\"\n `exiqgrep -i #{@direction} #{@email} | xargs -P10 -i exim -Mrm '{}' >/dev/null`\n end\n else\n puts \"Didn't remove any emails from the mailque\"\n end\n end",
"def handle_queue_clear(args)\n @queue = [[]]\n end",
"def delete_queue(queue_name)\r\n execute(:delete, queue_name, {}, {:x_ms_version => '2009-09-19'})\r\n end",
"def remove(pid)\n @dead_queues.unshift(@pids[pid]) # keep track of queues that pid was running, put it at front of list\n @pids.delete(pid)\n procline\n end",
"def deleteQueue( queue_id)\n params = Hash.new\n params['queue_id'] = queue_id\n return doCurl(\"delete\",\"/queue\",params)\n end",
"def destroy!\n sqs.delete_queue(queue_url: address)\n end",
"def dequeue; @queue.pop end",
"def clear_code(code)\n if url = find(code)\n purge(code, url)\n end\n end",
"def delete\n result, _ = Sidekiq::Batch.redis(bid) do |conn|\n conn.pipelined do\n conn.hsetnx(\"b-#{bid}\", \"deleted\", \"1\")\n conn.del \"b-#{bid}-failinfo\",\n \"b-#{bid}-notify\",\n \"b-#{bid}-cbsucc\",\n \"b-#{bid}-success\",\n \"b-#{bid}-complete\",\n \"b-#{bid}-jids\"\n conn.zrem('batches'.freeze, bid)\n conn.expire \"b-#{bid}\", Sidekiq::Batch::LINGER\n end\n end\n result ? bid : nil\n end",
"def clean_queue!\n # Go through the song queue from start to end\n queued_songs.each_with_index do |song, index|\n if song['playAt'] + song['duration'] > Time.now.to_i\n # This song is still ok to have, trim of all the ones to the left\n $redis.ltrim(queue_key, index, -1)\n return\n end\n end\n\n # Okay, every song has played already, nuke it\n $redis.del(queue_key)\n end",
"def pop_from_restriction_queue(tracking_key, queue)\n queue_key = restriction_queue_key(tracking_key, queue)\n str = Resque.redis.lpop(queue_key)\n post_pop_size = Resque.redis.llen(queue_key)\n\n if post_pop_size == 0\n update_queues_available(tracking_key, queue, :remove)\n clear_runnable(tracking_key, queue)\n end\n\n decrement_queue_count(queue)\n\n # increment by one to indicate that we are running\n increment_running_count(tracking_key) if str\n\n decode(str)\n end",
"def delete\n # Note that $curbuf does not point to the buffer that is being deleted;\n # we need to use Vim's <abuf> for the correct buffer number.\n current = ::VIM::evaluate('expand(\"<abuf>\")').to_i\n stack.delete_if { |number| number == current }\n end",
"def deq\n\t\tremove(0)\n\tend",
"def delete_message(data); end",
"def delete_message(data); end",
"def delete_if(&block); end",
"def remove_bot(key)\n @queue.push([:remove_bot, key])\n end",
"def remove; end",
"def remove; end",
"def remove; end",
"def remove; end",
"def remove_from_queue\n Resque.remove_delayed(SchedulerJob, :id => self.id)\n end",
"def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end",
"def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end",
"def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end",
"def unlock_queueing_for_queue(queue)\n Resque.data_store.everything_in_queue(queue).uniq.each do |string|\n item = Resque.decode(string)\n\n unlock_queueing(queue, item).tap { RecoveringQueue.remove(queue, item) }\n end\n end",
"def kill_thread\n # TODO: ideally this would be unshift, but Queues don't have that. Come up with an alternative.\n @queue << Directive::SUICIDE_PILL\n end",
"def clear\n @que.clear\n end",
"def clear\n @que.clear\n end",
"def delete_song(song)\n @queue.find { |x| x == song }.delete\n @queue.delete(song)\n end",
"def purge\n @queue.purge\n end",
"def purge\n @queue.purge\n end",
"def purge\n @queue.purge\n end",
"def clear\n queue.clear\n end",
"def _put_back_on_queue(message)\n future = nil\n _redis.multi do\n _redis.rpush(@queue, message)\n future = _redis.lrem(@in_progress_queue, 1, message)\n end\n removed = future.value\n if removed !=1\n RailsPipeline.logger.error \"ERROR: Didn't remove message from in_progress queue?!!!\"\n end\n end",
"def execution_queue_finalizer(execution_id)\n\t\tproc do\n\t\t\t@execution_queues.synchronize(:EX) do\n\t\t\t\t@execution_queues.delete(execution_id)\n\t\t\tend\n\t\tend\n\tend",
"def delete_polling_thread(key); end",
"def remove_from_queue!(user)\n $redis.lrem(self.class.redis_key_for_user(user), 0, to_redis_object)\n end",
"def clear\n @que.clear\n self\n end",
"def kill\n @queue << \"kill\"\n end",
"def step\n @queue.enq nil\n end",
"def clear_code(code)\n if url_obj = url_object(code)\n @url_bucket.delete url_key(url_obj.data)\n @code_bucket.delete url_obj.key\n end\n end",
"def tcl_delete(_client_data)\n raise 'tcl function is going to be removed'\n end",
"def del(*args); end",
"def delete( queue_name )\n req = KJess::Request::Delete.new( :queue_name => queue_name )\n resp = send_recv( req )\n return KJess::Response::Deleted === resp\n end",
"def remove message\n @events.delete message.sequence\n end",
"def delete_worker\n\n rmq = Thread.current[:rmq_exchange]\n t = Thread.new(self) do |name|\n\n Thread.current[:name] = name\n Thread.current[:rmq_exchange] = rmq\n deleter = Delete.new(@broker_id, @platform, @server, @entity,\n {\n destination: @dst_class.new(@pg_connection, @broker_id, @platform, @server, @entity),\n cache: @cache\n })\n\n begin\n deleter.launch\n rescue Exception => msg\n Helper.error(msg, deleter)\n raise msg\n end\n end\n\n # Abort main thread in case child exceptions\n t.abort_on_exception = true if $config[:env][:stop_on_thread_ex]\n t\n\n end",
"def clear_code(url)\n if url = find(code)\n purge(code, url)\n end\n end",
"def remove\n raise QueueUnderflow if empty?\n result = @info.shift\n changed\n notify_observers(self, :remove, result)\n result\n end",
"def delete(element)\n synchronize do\n @queue.delete(element)\n end\n end",
"def purge\n @channel.queue_purge(@name)\n end",
"def delete_if\n deleted = []\n @queue.delete_if do |fullname|\n comment = Models::Comment.new(@client, name: fullname).reload\n action = yield comment\n if action == :delete\n comment.delete\n deleted << fullname\n end\n action == :keep || action == :delete\n end\n deleted\n end",
"def delete\n @thread.exit\n end",
"def delete(element)\n synchronize do\n @queue.delete(element)\n end\n end",
"def delete(element)\n synchronize do\n @queue.delete(element)\n end\n end",
"def done!\n @meta[Cworked_at] = nil\n put_meta\n\n # remove from both queues\n rcache.lrem(queue.working_cache_key, 0, trx_id)\n rcache.lrem(queue.retries_cache_key, 0, trx_id)\n end",
"def delete(queue)\n @mutex.lock if @multithread\n\n raise MemCacheError, \"No active servers\" unless active?\n cache_key = make_cache_key key\n server = get_server_for_key cache_key\n\n sock = server.socket\n raise MemCacheError, \"No connection to server\" if sock.nil?\n\n begin\n sock.write \"delete #{cache_key}\\r\\n\"\n sock.gets\n rescue SocketError, SystemCallError, IOError => err\n server.close\n raise MemCacheError, err.message\n end\n ensure\n @mutex.unlock if @multithread\n end",
"def clear_queue(queue_name)\r\n execute :delete, \"#{queue_name}/messages\", {}, :x_ms_version => '2009-09-19'\r\n end",
"def pop\n @lock.synchronize do\n @queue.pop\n end\n end",
"def delete_item(code)\n @stock.delete(code.to_sym)\n end",
"def clear\n @queue.clear\n end",
"def clear\n @que.clear\n end",
"def destroy!\n children = @zk.children(full_queue_path)\n locks = []\n children.each do |path|\n lock = @zk.locker(\"#{full_queue_path}/#{path}\")\n lock.lock!\n locks << lock\n end\n children.each do |path|\n @zk.delete(\"#{full_queue_path}/#{path}\")\n end\n @zk.delete(full_queue_path)\n locks.each do |lock|\n lock.unlock!\n end\n end",
"def delete_routing_queue_wrapupcode_with_http_info(queue_id, code_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_routing_queue_wrapupcode ...\"\n end\n \n \n # verify the required parameter 'queue_id' is set\n fail ArgumentError, \"Missing the required parameter 'queue_id' when calling RoutingApi.delete_routing_queue_wrapupcode\" if queue_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'code_id' is set\n fail ArgumentError, \"Missing the required parameter 'code_id' when calling RoutingApi.delete_routing_queue_wrapupcode\" if code_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/queues/{queueId}/wrapupcodes/{codeId}\".sub('{format}','json').sub('{' + 'queueId' + '}', queue_id.to_s).sub('{' + 'codeId' + '}', code_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud Auth']\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: RoutingApi#delete_routing_queue_wrapupcode\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def remove_path_from_queue(path)\n redis.srem paths_to_visit_key, path\n end",
"def clear\n @gate.synchronize do\n @queue = []\n @has_faulted = true\n end\n end",
"def pop()\n @queue.shift\n end",
"def purge\n t = Time.now\n expired = []\n @queue.each do |identity,worker|\n expired << identity if t > worker.expiry\n end\n expired.each do |identity|\n @queue.delete identity\n end\n end",
"def clear_intention_queue\n state.delete \"queued_actions\"\n nil\n end",
"def clear_queue\n @postponed_queries = []\n\n self\n end",
"def take_msg(queue)\n msg = queue.reserve\n #by calling ybody we get the content of the message and convert it from yml\n count = msg.ybody.count\n result = count*count\n msg.delete\n return result\n end",
"def purge\n @items.delete_if(&:is_done) \n end",
"def destroy\n @caller_queue = CallerQueue.find(params[:id])\n @caller_queue.destroy\n\n respond_to do |format|\n format.html { redirect_to(caller_queues_url) }\n format.xml { head :ok }\n end\n end",
"def delete_opcode(opcode)\n @chunks = chunks.select { |chunk| chunk.ord != opcode }\n self\n end",
"def redis_queues_cleanup!\n Gitlab::Redis::Queues.with(&:flushdb)\n end",
"def destroy\n profile = calc_profile\n cmd = \"jms-queue #{profile} remove --queue-address=#{@resource[:name]}\"\n bring_down 'JMS Queue', cmd\n end",
"def delete_xmp\n Jhead.call(\"-dx\", @match, @pattern)\n end",
"def remove\n @container.stop\n @container.delete\n end",
"def clearQueue\n @itemList.clear()\n end",
"def removeItemFromBackpack _obj, _args\n \"_obj removeItemFromBackpack _args;\" \n end"
] | [
"0.6715141",
"0.6699791",
"0.6629268",
"0.6621124",
"0.6597574",
"0.65756047",
"0.65398455",
"0.6529983",
"0.6529983",
"0.6358087",
"0.6324666",
"0.6314439",
"0.63142675",
"0.6210734",
"0.6210734",
"0.62094456",
"0.61521393",
"0.613172",
"0.6094889",
"0.60685295",
"0.6060054",
"0.60496855",
"0.60451716",
"0.60434383",
"0.59931254",
"0.59920263",
"0.59575653",
"0.5926925",
"0.5918051",
"0.591461",
"0.5911966",
"0.59039974",
"0.5900962",
"0.5892029",
"0.5892029",
"0.5885478",
"0.587182",
"0.5869605",
"0.5869605",
"0.5869605",
"0.5869605",
"0.5866225",
"0.58484155",
"0.58484155",
"0.58484155",
"0.5836285",
"0.5836053",
"0.5826789",
"0.5826789",
"0.582282",
"0.5807676",
"0.5807676",
"0.5807676",
"0.5794688",
"0.5788077",
"0.57739085",
"0.5773155",
"0.5762165",
"0.57607627",
"0.57568544",
"0.5736532",
"0.5735282",
"0.5724613",
"0.57071686",
"0.57046854",
"0.57043827",
"0.5690711",
"0.5683946",
"0.56830835",
"0.5678205",
"0.56741506",
"0.5674125",
"0.5668295",
"0.56660545",
"0.56660545",
"0.56430763",
"0.56350476",
"0.5631485",
"0.56149507",
"0.56105316",
"0.5610523",
"0.5607718",
"0.5607121",
"0.5604468",
"0.5602293",
"0.5596522",
"0.55945796",
"0.5588313",
"0.5564578",
"0.55601776",
"0.5528013",
"0.5524891",
"0.5521305",
"0.5520824",
"0.5511449",
"0.550996",
"0.55091",
"0.55004853",
"0.5499165",
"0.5492815"
] | 0.56820256 | 69 |
Delete an organization's routing settings | def delete_routing_settings(opts = {})
delete_routing_settings_with_http_info(opts)
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @org_setting.destroy\n\n head :no_content\n end",
"def delete_routing_settings_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_routing_settings ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/routing/settings\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\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: RoutingApi#delete_routing_settings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @global_account_setting = GlobalAccountSetting.find(params[:id])\n @global_account_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(global_account_settings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy_omniauth\n organization = Maestrano::Connector::Rails::Organization.find_by_id(params[:organization_id])\n if organization && is_admin?(current_user, organization)\n organization.oauth_uid = nil\n organization.oauth_token = nil\n organization.refresh_token = nil\n organization.sync_enabled = false\n organization.save\n end\n\n redirect_to root_url\n end",
"def destroy\n @global_page_setting = GlobalPageSetting.find(params[:id])\n @global_page_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to global_page_settings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.destroy\n \n redirect_to admin_organizations_url, notice: t('organization.messages.delete.success')\n end",
"def destroy\n @global_config = AppConfig.find(params[:id])\n @global_config.destroy\n\n respond_to do |format|\n format.html { redirect_to global_configs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.delete\n end",
"def destroy\n @tournament_config.destroy\n respond_to do |format|\n format.html { redirect_to tournament_configs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n conf.delete 'dashboard'\n end",
"def destroy\n @org = Organisation.find_by( id: params[\"id\"]).delete\n redirect_to root_url\n end",
"def DeleteOrganization id\n \n APICall(path: \"organizations/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n standard_destroy(OrganizationType, params[:id])\n end",
"def destroy\n set_global_setting\n @global_setting.destroy\n respond_to do |format|\n format.html { redirect_to admin_global_settings_url, notice: 'Setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n end",
"def destroy\n authorize! @organization\n @organization.destroy\n\n redirect_to root_path\n end",
"def destroy\n @network_setting = NetworkSetting.find(params[:id])\n @network_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(network_settings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site_config = SiteConfig.find(params[:id])\n @site_config.destroy\n\n respond_to do |format|\n format.html { redirect_to site_configs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n debug('Removing location')\n crm('configure', 'delete', @resource[:name])\n @property_hash.clear\n end",
"def destroy\n system_node_id = @setting.system_node_id\n @setting.destroy\n respond_to do |format|\n format.html { redirect_to edit_system_node_path(system_node_id), notice: 'Setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization_theme.destroy\n end",
"def destroy\n @organization.destroy\n end",
"def destroy\n @portal_config.destroy\n respond_to do |format|\n format.html { redirect_to portal_configs_url, notice: 'Config was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def remove_route(route={})\n request :delete, '/routes', route\n end",
"def destroy\n @kf_global_config = Kf::GlobalConfig.find(params[:id])\n @kf_global_config.destroy\n\n respond_to do |format|\n format.html { redirect_to kf_global_configs_url({:page => params[:page]}) }\n format.json { head :no_content }\n end\n end",
"def delete(config, org_guid)\n token = @client.token\n\n user_setup_obj = UsersSetup.new(config)\n admin_token = user_setup_obj.get_admin_token\n\n # elevate user just to delete organization\n @client.token = admin_token\n org = @client.organization(org_guid)\n deleted = org.delete(:recursive => true)\n\n # then put token back to the initial one\n @client.token = token\n deleted\n end",
"def destroy\n @website_setting = WebsiteSetting.find(params[:id])\n @website_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to website_settings_url }\n format.json { head :ok }\n end\n end",
"def destroy\n org = Org.includes(:users, :templates, :guidance_groups).find(params[:id])\n authorize org\n\n # Only allow the delete if the org has no dependencies\n return if !org.users.empty? || !org.templates.empty?\n\n org.guidance_groups.delete_all\n\n if org.destroy!\n msg = success_message(org, _('removed'))\n redirect_to super_admin_orgs_path, notice: msg\n else\n failure = failure_message(org, _('remove'))\n redirect_to super_admin_orgs_path, alert: failure\n end\n end",
"def destroy\n @doc_type_am_configuration = DocTypeAmConfiguration.find(params[:id])\n @doc_type_am_configuration.destroy\n\n respond_to do |format|\n format.html { redirect_to doc_type_am_configurations_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to(organizations_url) }\n end\n end",
"def cfg_delete(cfg)\n obj_delete cfg, ZoneConfiguration\n end",
"def destroy\n @wp_dyna_config = WpDynaConfig.find(params[:id])\n @wp_dyna_config.destroy\n\n respond_to do |format|\n format.html { redirect_to wp_dyna_configs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email_setting = EmailSetting.find(params[:id])\n @company = @email_setting.company\n @email_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(company_email_settings_url(@company)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @organization = Organization.find(params[:id])\n begin\n @organization.destroy\n rescue Exception => e\n flash[:alert] = e.message\n end\n\n respond_to do |format|\n format.html { redirect_to admin_organizations_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @operation_setting = OperationSetting.find(params[:id])\n @operation_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to operation_settings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = @club.pages.find(params[:id])\n\t\t#destroy settings\n\t\t@settings = @club.settings.find(:all, :conditions => ['name = ? AND value = ?', 'pages', @page.id]);\n\t\t@settings.each do |setting|\n\t\t\tsetting.destroy\n\t\tend\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_club_pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @org.destroy\n redirect_to orgs_url, notice: \"#{@org.name} was successfully deleted.\"\n end",
"def destroy\n Organization.find(params[:id]).destroy\n flash[:success] = \"Organization deleted\"\n redirect_to search_organizations_path\n end",
"def destroy\n unless current_user.try(:admin?)\n flash[:notice] = PERMISSION_DENIED\n redirect_to organization_path(params[:id]) and return false\n end\n @organization = Organization.find(params[:id])\n @organization.destroy\n\n redirect_to organizations_url\n end",
"def destroy\r\n @org = Org.from_param(params[:abbr])\r\n @org.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to orgs_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def delete(name, action, seqno)\n configure([\"no route-map #{name} #{action} #{seqno}\"])\n end",
"def destroy\n debug('Removing location')\n self.class.run_command_in_cib(['crm', 'configure', 'delete', @resource[:name]], @resource[:cib])\n @property_hash.clear\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to(organizations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @admin_route = Admin::Route.find(params[:id])\n @admin_route.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_routes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to(organizations_url) }\n format.xml { head :ok }\n end\n end",
"def delete_at index\n @config.delete_at index\n end",
"def destroy\n @route.delete\n respond_to do |format|\n format.html { redirect_to routes_url, notice: t(\"routes.deleted\") }\n format.json { head :no_content }\n end\n end",
"def destroy\n @configure = Configure.find(params[:id])\n @configure.destroy\n\n respond_to do |format|\n format.html { redirect_to configures_url }\n format.json { head :no_content }\n end\n end",
"def delete_route(path, options = nil)\n route = get_route(path, options)\n root.delete(route)\n routes.replace(root.unique_routes)\n build_grapher!\n route\n end",
"def destroy\n @demo_host_setting = Demo::HostSetting.find(params[:id])\n @demo_host_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(demo_host_settings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @configuracion = Configuracion.find(params[:id])\n @configuracion.destroy\n\n respond_to do |format|\n format.html { redirect_to(configuracions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @setting = Setting.find(params[:id])\n @setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(escola_ano_letivo_settings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @setting.destroy\n respond_to do |format|\n format.html { redirect_to settings_url, notice: 'Configuration was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n onesecgroup('delete', resource[:name])\n @property_hash.clear\n end",
"def destroy\n @edge_configuration = model.find(params[:id])\n if @edge_configuration.destroy\n flash[:notice] = \"Configuration Variable Deleted\"\n redirect_to :action => :index\n else\n flash[:notice] = \"Failed to delete configuration variable\"\n redirect_to :action => :index\n end\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def delete\n config = get\n return true unless config\n configure(\"no router bgp #{config[:bgp_as]}\")\n end",
"def destroy\n @acc_setting.destroy\n respond_to do |format|\n format.html { redirect_to acc_settings_url, notice: 'Acc setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @room_config.destroy\n respond_to do |format|\n format.html { redirect_to room_configs_url }\n format.json { head :no_content }\n end\n end",
"def cmd_clear_routes argv\n setup argv\n response = @api.clear_routes\n msg response\n return response\n end",
"def destroy\n @setting = Setting.find(params[:id])\n authorize @setting, :destroy?\n @setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(settings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @project_type_association = @project.project_type_associations.find(params[:id])\n @project_type_association.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_project_project_type_associations_url(@project)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @organization_detail = OrganizationDetail.find(params[:id])\n @organization_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(organization_details_url) }\n format.xml { head :ok }\n end\n end",
"def remove_route(value)\n @children['route'][:value].delete(value)\n end",
"def destroy\n @registration_setting.destroy\n respond_to do |format|\n format.html { redirect_to registration_settings_url, notice: 'Registration setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hierarchy = Hierarchy.find(params[:id])\n @hierarchy.destroy\n\n redirect_to configs_hierarchies_url\n end",
"def destroy\n \n @organization.destroy\n \n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Place was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @configuracion.destroy\n respond_to do |format|\n format.html { redirect_to configuraciones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sysconfig = Sysconfig.find(params[:id])\n @sysconfig.destroy\n\n respond_to do |format|\n format.html { redirect_to sysconfigs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sys_config = SysConfig.find(params[:id])\n @sys_config.destroy\n\n respond_to do |format|\n format.html { redirect_to user_system_sys_configs_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Организация успешно удалена.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application_setting.destroy\n respond_to do |format|\n format.html { redirect_to application_settings_url, notice: 'Application setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @configuration = current_host.configuration_parameters.find(params[:id])\n @configuration.destroy\n\n respond_to do |format|\n flash[:notice] = 'hostConfiguration was successfully deleted.'\n format.html { redirect_to host_url(current_host) }\n format.xml { head :ok }\n end\n end",
"def destroy\n unless current_user.try(:superadmin?)\n flash[:notice] = PERMISSION_DENIED\n redirect_to organisation_path(params[:id]) and return false\n end\n @organisation = Organisation.friendly.find(params[:id])\n @organisation.destroy\n flash[:success] = \"Deleted #{@organisation.name}\"\n\n redirect_to organisations_path\n end",
"def destroy\n @system_configuration = SystemConfiguration.find(params[:id])\n @system_configuration.destroy\n\n respond_to do |format|\n format.html { redirect_to system_configurations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @system_config.destroy\n respond_to do |format|\n format.html { redirect_to system_configs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bus_route = BusRoute.find(params[:id])\n @bus_route.destroy\n\n respond_to do |format|\n format.html { redirect_to bus_routes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to admin_routes_url, notice: 'Route was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @setting.destroy\n respond_to do |format|\n format.html { redirect_to settings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @setting.destroy\n respond_to do |format|\n format.html { redirect_to settings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @setting.destroy\n respond_to do |format|\n format.html { redirect_to settings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization = Organization.find(params[:id])\n\n authorize! :destroy, @organization\n\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rec_run_route.destroy\n flash[:danger] = \"Recreational Run Route Deleted.\"\n respond_to do |format|\n format.html { redirect_to admin_rec_run_routes_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @select_route.destroy\n respond_to do |format|\n format.html { redirect_to select_routes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @arl.destroy\n respond_to do |format|\n format.html { redirect_to settings_path, notice: 'ARL was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_with(@organization)\n end",
"def destroy\n @system_config = SystemConfig.find(params[:id])\n @system_config.destroy\n\n respond_to do |format|\n format.html { redirect_to system_configs_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @app_setting.destroy\n respond_to do |format|\n format.html { redirect_to app_settings_url, notice: 'App setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_route(path, options = nil)\n route = get_route(path, options)\n @root.delete(route)\n @routes = @root.unique_routes\n rebuild_grapher!\n route\n end",
"def destroy\n @project_configuration.destroy\n respond_to do |format|\n format.html { redirect_to project_configurations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n conf.delete 'api'\n end",
"def destroy\n Rails.logger.info('👻 Disraptor: Destroying route.')\n\n if Disraptor::Route.remove(params[:route_id])\n Rails.application.reload_routes!\n\n render json: success_json\n else\n render json: failed_json\n end\n end",
"def destroy\n @user_car_setting.destroy\n respond_to do |format|\n format.html { redirect_to _user_car_settings_url, notice: 'Configuración eliminada' }\n format.json { head :no_content }\n end\n end"
] | [
"0.730187",
"0.65662843",
"0.6402383",
"0.6378157",
"0.6342843",
"0.63057655",
"0.62673783",
"0.62329805",
"0.6202773",
"0.6193246",
"0.617383",
"0.61692655",
"0.6145706",
"0.61408544",
"0.61327016",
"0.61080647",
"0.6107035",
"0.60616076",
"0.6054164",
"0.6053777",
"0.6050099",
"0.603824",
"0.59991866",
"0.5950887",
"0.5938601",
"0.59319836",
"0.5928705",
"0.59281904",
"0.5919351",
"0.5918877",
"0.5909633",
"0.58968484",
"0.58730537",
"0.58723676",
"0.5869491",
"0.58642536",
"0.58622676",
"0.58548325",
"0.5845753",
"0.5825277",
"0.58114886",
"0.5810123",
"0.5809959",
"0.580473",
"0.5800014",
"0.57994115",
"0.5788132",
"0.5784554",
"0.5780237",
"0.5777334",
"0.57729685",
"0.57723653",
"0.5771377",
"0.576728",
"0.5765823",
"0.57644945",
"0.57644945",
"0.5762752",
"0.576043",
"0.57528293",
"0.57512",
"0.5750955",
"0.5749355",
"0.57490826",
"0.5745791",
"0.57385755",
"0.5730246",
"0.5724839",
"0.57071203",
"0.57065135",
"0.57065135",
"0.57065135",
"0.57040274",
"0.5698614",
"0.5686629",
"0.5685795",
"0.56734973",
"0.5673016",
"0.5672413",
"0.5672202",
"0.5664058",
"0.56609845",
"0.56575096",
"0.56575096",
"0.56575096",
"0.5656732",
"0.5654088",
"0.5652392",
"0.5652392",
"0.5652392",
"0.56478536",
"0.5647378",
"0.56426793",
"0.5642608",
"0.5637143",
"0.5636851",
"0.5635717",
"0.5630407",
"0.5629118",
"0.5629029"
] | 0.6706296 | 1 |
Delete an organization&39;s routing settings | def delete_routing_settings_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.delete_routing_settings ..."
end
# resource path
local_var_path = "/api/v2/routing/settings".sub('{format}','json')
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#delete_routing_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @org_setting.destroy\n\n head :no_content\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.destroy\n \n redirect_to admin_organizations_url, notice: t('organization.messages.delete.success')\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.delete\n end",
"def DeleteOrganization id\n \n APICall(path: \"organizations/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n @org = Organisation.find_by( id: params[\"id\"]).delete\n redirect_to root_url\n end",
"def destroy\n standard_destroy(OrganizationType, params[:id])\n end",
"def destroy\n @organization.destroy\n end",
"def destroy_omniauth\n organization = Maestrano::Connector::Rails::Organization.find_by_id(params[:organization_id])\n if organization && is_admin?(current_user, organization)\n organization.oauth_uid = nil\n organization.oauth_token = nil\n organization.refresh_token = nil\n organization.sync_enabled = false\n organization.save\n end\n\n redirect_to root_url\n end",
"def destroy\n authorize! @organization\n @organization.destroy\n\n redirect_to root_path\n end",
"def destroy\n @org.destroy\n redirect_to orgs_url, notice: \"#{@org.name} was successfully deleted.\"\n end",
"def destroy\n @organization.destroy\n end",
"def destroy\r\n @org = Org.from_param(params[:abbr])\r\n @org.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to orgs_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @organization = Organization.find(params[:id])\n begin\n @organization.destroy\n rescue Exception => e\n flash[:alert] = e.message\n end\n\n respond_to do |format|\n format.html { redirect_to admin_organizations_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to(organizations_url) }\n end\n end",
"def destroy\n @global_account_setting = GlobalAccountSetting.find(params[:id])\n @global_account_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(global_account_settings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n Organization.find(params[:id]).destroy\n flash[:success] = \"Organization deleted\"\n redirect_to search_organizations_path\n end",
"def destroy\n unless current_user.try(:admin?)\n flash[:notice] = PERMISSION_DENIED\n redirect_to organization_path(params[:id]) and return false\n end\n @organization = Organization.find(params[:id])\n @organization.destroy\n\n redirect_to organizations_url\n end",
"def destroy\n org = Org.includes(:users, :templates, :guidance_groups).find(params[:id])\n authorize org\n\n # Only allow the delete if the org has no dependencies\n return if !org.users.empty? || !org.templates.empty?\n\n org.guidance_groups.delete_all\n\n if org.destroy!\n msg = success_message(org, _('removed'))\n redirect_to super_admin_orgs_path, notice: msg\n else\n failure = failure_message(org, _('remove'))\n redirect_to super_admin_orgs_path, alert: failure\n end\n end",
"def delete(config, org_guid)\n token = @client.token\n\n user_setup_obj = UsersSetup.new(config)\n admin_token = user_setup_obj.get_admin_token\n\n # elevate user just to delete organization\n @client.token = admin_token\n org = @client.organization(org_guid)\n deleted = org.delete(:recursive => true)\n\n # then put token back to the initial one\n @client.token = token\n deleted\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to(organizations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to(organizations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @global_page_setting = GlobalPageSetting.find(params[:id])\n @global_page_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to global_page_settings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization_theme.destroy\n end",
"def destroy\n \n @organization.destroy\n \n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Place was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Организация успешно удалена.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n unless current_user.try(:superadmin?)\n flash[:notice] = PERMISSION_DENIED\n redirect_to organisation_path(params[:id]) and return false\n end\n @organisation = Organisation.friendly.find(params[:id])\n @organisation.destroy\n flash[:success] = \"Deleted #{@organisation.name}\"\n\n redirect_to organisations_path\n end",
"def destroy\n @organization_detail = OrganizationDetail.find(params[:id])\n @organization_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(organization_details_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\t\t@organization = Organization.find(params[:id])\n\t\t@organization.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(organizations_url) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend",
"def destroy\n debug('Removing location')\n crm('configure', 'delete', @resource[:name])\n @property_hash.clear\n end",
"def destroy\n @global_config = AppConfig.find(params[:id])\n @global_config.destroy\n\n respond_to do |format|\n format.html { redirect_to global_configs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n set_global_setting\n @global_setting.destroy\n respond_to do |format|\n format.html { redirect_to admin_global_settings_url, notice: 'Setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n flash[:notice] = 'Organization was successfully removed.'\n\n respond_to do |format|\n format.html { redirect_to(organizations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @organization = Organization.find(params[:id])\n\n authorize! :destroy, @organization\n\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n check_privileges(:superadmin?, organisation_path(params[:id])); return if performed?\n @organisation = Organisation.friendly.find(params[:id])\n @organisation.destroy\n flash[:success] = \"Deleted #{@organisation.name}\"\n redirect_to organisations_path\n end",
"def destroy\n @tournament_config.destroy\n respond_to do |format|\n format.html { redirect_to tournament_configs_url }\n format.json { head :no_content }\n end\n end",
"def delete_routing_settings(opts = {})\n delete_routing_settings_with_http_info(opts)\n return nil\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to current_user }\n format.json { head :no_content }\n end\n end",
"def destroy\n @network_setting = NetworkSetting.find(params[:id])\n @network_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(network_settings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @organization.destroy\n respond_with(@organization)\n end",
"def destroy\n \n @organism.destroy\n\n respond_to do |format|\n format.html { redirect_to organisms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @external_organization = ExternalOrganization.find(params[:id])\n @external_organization.destroy\n\n respond_to do |format|\n format.html { redirect_to external_organizations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n system_node_id = @setting.system_node_id\n @setting.destroy\n respond_to do |format|\n format.html { redirect_to edit_system_node_path(system_node_id), notice: 'Setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.destroy\n respond_with(@organization)\n end",
"def destroy\n @doc_type_am_configuration = DocTypeAmConfiguration.find(params[:id])\n @doc_type_am_configuration.destroy\n\n respond_to do |format|\n format.html { redirect_to doc_type_am_configurations_url }\n format.json { head :ok }\n end\n end",
"def destroy\n conf.delete 'dashboard'\n end",
"def destroy\n @people_organization.destroy\n respond_to do |format|\n format.html { redirect_to people_organizations_url, notice: 'People organization was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email_setting = EmailSetting.find(params[:id])\n @company = @email_setting.company\n @email_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(company_email_settings_url(@company)) }\n format.xml { head :ok }\n end\n end",
"def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end",
"def destroy\n @organization_account = OrganizationAccount.find(params[:id])\n @organization_account.destroy\n\n respond_to do |format|\n format.html { redirect_to organization_accounts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organ = Organ.find(params[:id])\n @organ.destroy\n\n respond_to do |format|\n format.html { redirect_to(organs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @portal_config.destroy\n respond_to do |format|\n format.html { redirect_to portal_configs_url, notice: 'Config was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n if !current_user.super_admin?\n head :forbidden\n else\n @organisation.destroy\n head :no_content\n end\n end",
"def destroy\n @organization.destroy\n render json: { success: \"Organization deleted successfully\" }, status: :ok\n end",
"def destroy\n @organism = Organism.find(params[:id])\n @organism.destroy\n\n respond_to do |format|\n format.html { redirect_to organisms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project_type_association = @project.project_type_associations.find(params[:id])\n @project_type_association.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_project_project_type_associations_url(@project)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @host_org.destroy\n respond_to do |format|\n format.html { redirect_to host_orgs_url, notice: 'Host org was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organ = Organ.find(params[:id])\n @organ.destroy\n\n respond_to do |format|\n format.html { redirect_to organs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @casa_org.destroy\n respond_to do |format|\n format.html { redirect_to casa_orgs_url, notice: 'CASA org was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization = Organization.find(params[:id])\n @organization.destroy\n respond_with @organization\n end",
"def destroy\n @participating_organization = ParticipatingOrganization.find(params[:id])\n @participating_organization.destroy\n\n respond_to do |format|\n format.html { redirect_to(participating_organizations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @orgn.destroy\n track_activity @orgn\n respond_to do |format|\n format.html { redirect_to orgns_url, notice: 'Orgn was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n debug('Removing location')\n self.class.run_command_in_cib(['crm', 'configure', 'delete', @resource[:name]], @resource[:cib])\n @property_hash.clear\n end",
"def destroy\n # @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sourcing_org.destroy\n respond_to do |format|\n format.html { redirect_to sourcing_orgs_url, notice: 'Sourcing org was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization_connection.destroy\n respond_to do |format|\n format.html { redirect_to organization_connections_url, notice: 'Organization connection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organization_url, notice: 'Organization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @room_tenant_link.destroy\n respond_to do |format|\n format.html { redirect_to room_tenant_links_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @operation_setting = OperationSetting.find(params[:id])\n @operation_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to operation_settings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization_profile = OrganizationProfile.find(params[:id])\n @organization_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to organization_profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @website_setting = WebsiteSetting.find(params[:id])\n @website_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to website_settings_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @site_config = SiteConfig.find(params[:id])\n @site_config.destroy\n\n respond_to do |format|\n format.html { redirect_to site_configs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization.unrelate_classes\n @organization.destroy\n redirect_to organizations_url, notice: \"Organization was successfully deleted.\"\n end",
"def destroy\n @organization.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url, notice: \"Organization was destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def cfg_delete(cfg)\n obj_delete cfg, ZoneConfiguration\n end",
"def destroy\n @acc_setting.destroy\n respond_to do |format|\n format.html { redirect_to acc_settings_url, notice: 'Acc setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = @club.pages.find(params[:id])\n\t\t#destroy settings\n\t\t@settings = @club.settings.find(:all, :conditions => ['name = ? AND value = ?', 'pages', @page.id]);\n\t\t@settings.each do |setting|\n\t\t\tsetting.destroy\n\t\tend\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_club_pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy \n get_system\n @nav_entry = NavEntry.find(params[:id])\n @nav_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to(system_url(@system)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @wp_dyna_config = WpDynaConfig.find(params[:id])\n @wp_dyna_config.destroy\n\n respond_to do |format|\n format.html { redirect_to wp_dyna_configs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hierarchy = Hierarchy.find(params[:id])\n @hierarchy.destroy\n\n redirect_to configs_hierarchies_url\n end",
"def destroy\n @organisation.destroy\n respond_to do |format|\n format.html { redirect_to organisations_url, notice: 'Organisation was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n onesecgroup('delete', resource[:name])\n @property_hash.clear\n end",
"def destroy\n @admins_organization.destroy\n respond_to do |format|\n format.html { redirect_to admins_organizations_url, notice: 'Organization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @registration_setting.destroy\n respond_to do |format|\n format.html { redirect_to registration_settings_url, notice: 'Registration setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @room_config.destroy\n respond_to do |format|\n format.html { redirect_to room_configs_url }\n format.json { head :no_content }\n end\n end",
"def delete\n @room_type_channel_mapping = RoomTypeChannelMapping.find(params[:id])\n @room_type_channel_mapping.delete\n\n flash[:notice] = t('room_type_channel_mappings.delete.message.success')\n pc = PropertyChannel.find_by_property_id_and_channel_id(current_admin_property.id, @room_type_channel_mapping.channel.id)\n redirect_to admin_room_type_channel_mappings_path(:room_type_id => @room_type_channel_mapping.room_type.id)\n end",
"def destroy\n @arl.destroy\n respond_to do |format|\n format.html { redirect_to settings_path, notice: 'ARL was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @organization_member = OrganizationMember.find(params[:id])\n @organization_member.destroy\n\n respond_to do |format|\n format.html { redirect_to(organization_members_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @o_rganization.destroy\n respond_to do |format|\n format.html { redirect_to o_rganizations_url, notice: 'O rganization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.74669045",
"0.6805188",
"0.66975385",
"0.6602611",
"0.65964794",
"0.6563039",
"0.6557922",
"0.6517594",
"0.6503264",
"0.6485661",
"0.64487743",
"0.64348334",
"0.6389579",
"0.6389442",
"0.6368104",
"0.6350502",
"0.632453",
"0.63117653",
"0.630649",
"0.62791026",
"0.62712526",
"0.625949",
"0.6238159",
"0.6238159",
"0.62183154",
"0.61974084",
"0.61921656",
"0.61703247",
"0.61703247",
"0.61703247",
"0.6164139",
"0.6136039",
"0.61332107",
"0.6123012",
"0.6121807",
"0.6103927",
"0.60998374",
"0.60895663",
"0.60861063",
"0.6076388",
"0.60612303",
"0.60576767",
"0.6051669",
"0.60423005",
"0.6036161",
"0.6031648",
"0.60215986",
"0.60146946",
"0.60071874",
"0.60030085",
"0.5994285",
"0.59911674",
"0.59889615",
"0.5988928",
"0.5980986",
"0.5974754",
"0.59746015",
"0.5960896",
"0.5960343",
"0.5948964",
"0.59468025",
"0.59444994",
"0.59392005",
"0.593905",
"0.5926955",
"0.59269166",
"0.59220433",
"0.5921548",
"0.592147",
"0.5909287",
"0.5886573",
"0.58843195",
"0.5882525",
"0.5875874",
"0.5875874",
"0.5875874",
"0.5875874",
"0.5875874",
"0.5875874",
"0.5875874",
"0.5875166",
"0.5874188",
"0.5873369",
"0.58701974",
"0.58671415",
"0.5850027",
"0.58396214",
"0.5838587",
"0.583729",
"0.58293813",
"0.5825371",
"0.5816078",
"0.58159024",
"0.58071893",
"0.5804751",
"0.57987833",
"0.5798242",
"0.57908595",
"0.57863754",
"0.5785861"
] | 0.6359687 | 15 |
Delete an Address by Id for SMS | def delete_routing_sms_address(address_id, opts = {})
delete_routing_sms_address_with_http_info(address_id, opts)
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_address(id)\n delete(\"addresses/#{id}\")\n end",
"def delete\n @address = Address.find(params[:address_id])\n end",
"def delete_address(address)\n address.delete!\n end",
"def delete id=nil\n id ||= self.id\n @nimble.delete \"contact/#{id}\"\n end",
"def delete_contact(id)\n delete(\"contacts/#{id}\")\n end",
"def delete_address_list(id)\n delete(\"addressGroups/#{id}\")\n end",
"def delete(id)\n results = connection.exec_params('DELETE FROM contacts WHERE id=$1;', [id]) \n end",
"def delete_routing_sms_address_with_http_info(address_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_routing_sms_address ...\"\n end\n \n \n # verify the required parameter 'address_id' is set\n fail ArgumentError, \"Missing the required parameter 'address_id' when calling RoutingApi.delete_routing_sms_address\" if address_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/sms/addresses/{addressId}\".sub('{format}','json').sub('{' + 'addressId' + '}', address_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\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: RoutingApi#delete_routing_sms_address\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def delete_address_group(id)\n delete(\"addressGroups/#{id}\")\n end",
"def delete_address(order_or_user, address_id, expect_success)\n address_id = address_id.id if address_id.is_a?(Spree::Address)\n\n visit_addresses(order_or_user)\n\n click_link \"delete-address-#{address_id}\"\n\n if expect_success\n expect(page).to have_content(Spree.t(:successfully_removed, resource: Spree::Address.model_name.human))\n else\n expect(page).to have_no_content(Spree.t(:successfully_removed, resource: Spree::Address.model_name.human))\n end\n end",
"def destroy\n @taddress = Taddress.find(params[:id])\n @taddress.destroy\n \n respond_to do |format|\n format.html { redirect_to taddresses_url }\n format.json { head :ok }\n end\n end",
"def delete_contact(id, options = {})\n delete \"contacts/#{id}\"\n end",
"def delete_address_book(address_book_id)\n end",
"def delete_address\n @mailing_list_address.destroy if @ok\n render 'update_addresses'\n end",
"def destroy\n @addresses = Address.paginate(:page => params[:page], :per_page => 5).order('updated_at DESC')\n @address = Address.find(params[:id])\n @error = nil\n\n begin\n @address.destroy\n rescue ActiveRecord::DeleteRestrictionError => e\n @error = e.message\n end\n end",
"def destroy\n @address = current_user.addresses.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to user_addresses_path(current_user) }\n format.json { head :no_content }\n end\n end",
"def delete_routing_sms_phonenumber_with_http_info(address_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_routing_sms_phonenumber ...\"\n end\n \n \n # verify the required parameter 'address_id' is set\n fail ArgumentError, \"Missing the required parameter 'address_id' when calling RoutingApi.delete_routing_sms_phonenumber\" if address_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/sms/phonenumbers/{addressId}\".sub('{format}','json').sub('{' + 'addressId' + '}', address_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\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: RoutingApi#delete_routing_sms_phonenumber\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to(:action=>'index') }\n format.xml { head :ok }\n end\n end",
"def destroy\n # @address = Address.find(params[:id])\n @address = Address.find_by_permalink!(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to(addresses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @customers_address = CustomersAddress.find(params[:id])\n @customers_address.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n address = Address.find(params[:id])\n status = address.delivery_address # stores whether it is delivery address or not\n address.destroy\n current_user_address = @current_user.addresses\n # if the address deleted is the current delivery address and the user should have atleast one address to mark the first address as delivery address.\n if (status && !(current_user_address.empty?))\n addrs = Address.first\n addrs.delivery_address = true\n addrs.save!\n end\n redirect_to cart_items_path\n end",
"def delete\n @addresses = Address.where(person_id: params[:id])\n @addresses.each do |c|\n Address.find(c.id).destroy\n end\n Person.find(params[:id]).destroy\n redirect_to :action => 'list'\n end",
"def delete_address(address_id, profile_id)\n @type = Type::CIM_DELETE_ADDRESS\n handle_address_id(address_id)\n handle_profile_id(profile_id)\n make_request\n end",
"def destroy\n @user_address = UserAddress.find(params[:id])\n @user_address.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_addresses_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n @carddav_backend.delete_address_book(@address_book_info['id'])\n end",
"def contact_delete(handle)\n query 'contact-delete', { handle: handle }\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to url_back, notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Address was successfully destroyed.' }\n end\n end",
"def deleteEntityInvoice_address( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"delete\",\"/entity/invoice_address\",params)\n end",
"def destroy\n @user_address = UserAddress.find(params[:id])\n @user_address.destroy\n\n respond_to do |format|\n format.html { redirect_to user_addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to admin_path(current_user), notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact(contact_to_delete)\n @contacts.delete(contact_to_delete)\n end",
"def delete_contact(params={})\n @obj.delete('delete-contact', @auth.merge(params))\n end",
"def delete(options={})\n DNSimple::Client.delete(\"/v1/contacts/#{id}\", options)\n end",
"def destroy\n @billing_address = BillingAddress.find(params[:id])\n @billing_address.destroy\n\n respond_to do |format|\n format.html { redirect_to billing_addresses_url }\n format.json { head :no_content }\n end\n end",
"def delete_contact(id)\n if contact = Contact.find_by(id: id)\n contact.destroy\n {status: true, contact: contact.display}\n else\n {status: false, error: \"\\nContact with that I.D. not found.\"}\n end\n end",
"def delete_contact(id)\n person = find_particular_contact(id)\n if person\n @contacts.delete(person)\n return true\n else\n return nil\n end\n end",
"def destroy\n\t\t@address = Address.find(params[:id])\n\t\t@address.coordinates.each do |c|\n\t\t\tc.destroy\n\t\tend\n\t\tredirect_to address_url(@address)\n\tend",
"def delete(address)\n \tMailgun.submit :delete, list_url(address)\n end",
"def destroy\n @address_detail.destroy\n respond_to do |format|\n format.html { redirect_to address_details_url, notice: 'Address detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact(token, id, user = nil)\n request_url = user_context(user) << \"/Contacts/\" << id\n\n delete_response = make_api_call \"DELETE\", request_url, token\n\n return nil if delete_response.nil? || delete_response.empty?\n\n parse_response(delete_response)\n end",
"def destroy\n @delivery_address = DeliveryAddress.find(params[:id])\n @delivery_address.destroy\n\n respond_to do |format|\n format.html { redirect_to delivery_addresses_url }\n format.json { head :no_content }\n end\n end",
"def delete(contactname)\n\n end",
"def destroy\n @ag_address.destroy\n respond_to do |format|\n format.html { redirect_to ag_addresses_url, notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n\t\t#@@contacts -= [delete_id.to_i]\n\t\t@@contacts.delete(self)\n\tend",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: \"Address was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: \"Address was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address_customer = AddressCustomer.find(params[:id])\n @address_customer.destroy\n\n respond_to do |format|\n format.html { redirect_to address_customers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @technocal_client_address = TechnocalClientAddress.find(params[:id])\n @technocal_client_address.destroy\n\n respond_to do |format|\n format.html { redirect_to(technocal_client_addresses_url) }\n format.xml { head :ok }\n end\n end",
"def remove(address_or_id)\n delete(\"#{domain}/complaints/#{address_or_id}\")\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: 'Form was deleted successfully!' }\n format.json { head :no_content }\n end\n end",
"def delete_contact\n display_all_contacts\n puts \"which ID would you like to delete?\"\n id = gets.chomp.to_i\n delete_value = Contact.find(id)\n delete_value.delete\n end",
"def destroy\n @adress = Adresse.find(params[:id])\n @adress.destroy\n\n respond_to do |format|\n format.html { redirect_to adresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address.destroy\n\n render :nothing => true\n end",
"def delete_contact\n\t\tputs \"\\nProvide a contact ID: \"\n\t\tid_entry = gets.chomp.to_i\n\t\t@rolodex.delete_one_contact(id_entry)\n\t\tputs \"\\nContact #{id_entry} is deleted FOREVER!\"\n\tend",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { render :partial => 'addresses/list' }\n end\n end",
"def delete(id_to_delete)\n DATABASE.execute(\"DELETE FROM locations WHERE id = '#{id_to_delete}'\")\n end",
"def delete_message(id)\n record \"/msg/delete/#{id}\"\n end",
"def delete()\n\n MailAccount.destroy(self.id)\n end",
"def delete_sip_account(id)\n @cloudvox_api[\"/phones/#{id}.json\"].delete\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to edit_company_path(@company), notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sulabh_address.destroy\n respond_to do |format|\n format.html { redirect_to sulabh_addresses_url, notice: 'Sulabh address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address = current_user.addresses.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n format.js { render :js => \"$(this).parent().parent().remove(); this.preventDefault();\" } \n end\n end",
"def destroy\n @subscriber = Subscriber.find(session[:subscriber_id])\n @shipping_address = @subscriber.shipping_addresses.find_by_id(params[:id])\n @shipping_address && @shipping_address.destroy\n\n respond_to do |format|\n format.html { redirect_to shipping_addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sales_address.destroy\n respond_to do |format|\n format.html { redirect_to sales_seller_addresses_path(@sales_seller), notice: \"Endereço removido com sucesso!\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ripple_address.destroy\n respond_to do |format|\n format.html { redirect_to ripple_addresses_url, notice: 'Ripple address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @customer_address.destroy\n respond_to do |format|\n format.html { redirect_to customer_addresses_url, notice: 'Customer address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@phone = Phone.find(params[:id])\n #@phone.destroy\n end",
"def delete(id)\n # The call uses a begin/rescue block so any errors can be handled properly\n begin\n Contact.filter(:id => id).destroy\n flash[:success] = 'The specified Contact has been removed'\n rescue => e\n Ramaze::Log.error(e.message)\n flash[:error] = 'The specified Contact could not be removed'\n end\n Action.add_record(@contact.id, session[:email], 'deleted', 'contact', @contact.last_name)\n redirect(Contacts.r(:index))\n end",
"def destroy\n @address_type = AddressType.find(params[:id])\n @address_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(address_types_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n\n Email.destroy(self.id)\n end",
"def delete(type, id)\n http_delete @target, \"#{type_info(type, :path)}/#{Addressable::URI.encode(id)}\", @auth_header, @zone\n end",
"def delete_which_contact\n\t\tputs \"What is the ID of the contact you want to delete?\"\n\t\tuser_id = gets.chomp.to_i\n\t\t@rolodex.delete_contact(user_id)\n\tend",
"def destroy\n @account_address.destroy\n respond_to do |format|\n format.html { redirect_to account_addresses_url, notice: 'Account address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address_record.destroy\n respond_to do |format|\n format.html { redirect_to address_records_url, notice: 'Address record was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact\n contact = retrieve_contact_by_email\n if contact\n if @rolodex.delete(contact)\n puts \"Contact successfully deleted.\"\n end\n end\n end",
"def delete_note id\n @nimble.delete \"contact/notes/#{id}\"\n end",
"def destroy\n @user_address_book_item = UserAddressBookItem.find(params[:id])\n @user_address_book_item.destroy\n end",
"def remove_mailing(id)\n delete(\"/mailings/#{id}\")\n end",
"def delete(id)\n # TODO: Implement this for Stripe webhooks\n end",
"def destroy\n @post_address.destroy\n respond_to do |format|\n format.html { redirect_to post_addresses_url }\n format.json { head :no_content }\n end\n end",
"def delete_contact\n\t\tcontact_delate_check(params[:user_id], params[:to_delete_id])\n\t\tContact.delete(Contact.where(from_user: params[:user_id], to_user: params[:to_delete_id]))\n\t\tredirect_to contacts_page_path(id: params[:user_id])\n\tend",
"def destroy\n @invitee = Invitee.find(params[:id])\n\t\t@address = @invitee.address\n\t\t@address.destroy\n @invitee.destroy\n\n respond_to do |format|\n format.html { redirect_to invitees_url }\n format.json { head :ok }\n\t\t\tformat.js\n end\n end",
"def delete(contact)\n @@contacts.delete(contact)\n end",
"def destroy\n @user_address.destroy\n respond_to do |format|\n format.html { redirect_to user_addresses_path, notice: 'User address was successfully destroyed.' }\n end\n end",
"def delete(id)\n @service.delete(id)\n end",
"def delete(id)\n emsg = \"The %s argument cannot be nil, empty, or a zero length string\"\n raise(ArgumentError, emsg % ['id']) if !id.kind_of?(Integer)\n\n # remove the account\n @accounts.delete_if{|a| a.id == id}\n end",
"def delete(options={})\n options.merge!({:basic_auth => Client.credentials})\n self.class.delete(\"#{Client.base_uri}/contacts/#{id}.json\", options)\n end",
"def destroy\n @address_book = AddressBook.find(params[:id])\n @address_book.destroy\n flash[:notice] = :address_book_deleted.l\n\n respond_to do |format|\n format.html { redirect_to(address_books_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n @client.post('/api/del_msg', id: get_attribute(:name))\n end",
"def delete_by_id(id)\n delete_payment_token_by_id(id)\n end",
"def delete_pin(id, options = {})\n id = id.to_sym\n # Check if this is a Pin or a PinGroup\n if pin_groups.key? id\n Origen.pin_bank.delete_pingroup(Origen.pin_bank.find_pin_group(id, options))\n elsif pins(id).class.to_s.match(/Pin/)\n Origen.pin_bank.delete_pin(Origen.pin_bank.find(id, options))\n else\n fail \"Error: the object #{id} you tried to delete is not a pin or pingroup\"\n end\n end",
"def delete(virtual_machine_id, ip_address_id)\n request(:delete, \"/virtual_machines/#{virtual_machine_id}/ip_addresses/#{ip_address_id}.json\")\n end",
"def destroy\n @contributor_address = ContributorAddress.find(params[:id])\n @contributor_address.destroy\n\n respond_to do |format|\n format.html { redirect_to contributor_addresses_url }\n format.json { head :no_content }\n end\n end",
"def delete_customer_phone(customer_id, phone_id)\n delete(\"customers/#{customer_id}/phones/#{phone_id}\")\n end"
] | [
"0.823823",
"0.76458126",
"0.74411255",
"0.7301863",
"0.72175115",
"0.71461296",
"0.71368736",
"0.71223724",
"0.70379937",
"0.70300573",
"0.70029104",
"0.70017475",
"0.6908176",
"0.6907868",
"0.6796576",
"0.6768015",
"0.67422336",
"0.6723795",
"0.6723795",
"0.6723795",
"0.6723795",
"0.6716357",
"0.67040586",
"0.6692696",
"0.6689725",
"0.6687519",
"0.6671452",
"0.660734",
"0.6579516",
"0.65632397",
"0.652423",
"0.65212905",
"0.65206",
"0.6512326",
"0.6509426",
"0.649462",
"0.64940053",
"0.64787465",
"0.6477802",
"0.6472581",
"0.64721423",
"0.64535874",
"0.64070356",
"0.64018816",
"0.63644594",
"0.63606256",
"0.63594955",
"0.634717",
"0.6343031",
"0.63350743",
"0.63266885",
"0.63266885",
"0.6326683",
"0.6305561",
"0.62965286",
"0.6278839",
"0.62775755",
"0.627043",
"0.62675667",
"0.6252244",
"0.62409",
"0.62382656",
"0.6234841",
"0.62239176",
"0.6219827",
"0.6218452",
"0.62163657",
"0.62158245",
"0.62031263",
"0.61593205",
"0.6132701",
"0.61249256",
"0.6120531",
"0.61168414",
"0.61013633",
"0.6094081",
"0.60886973",
"0.6085369",
"0.60825676",
"0.6078009",
"0.60769564",
"0.60745376",
"0.606895",
"0.6066909",
"0.6049394",
"0.60460144",
"0.603364",
"0.6031622",
"0.6027983",
"0.60206866",
"0.6006492",
"0.6003042",
"0.60007024",
"0.5999982",
"0.5992165",
"0.5991623",
"0.59909785",
"0.5986965",
"0.5985414",
"0.5984345"
] | 0.64942884 | 36 |
Delete an Address by Id for SMS | def delete_routing_sms_address_with_http_info(address_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.delete_routing_sms_address ..."
end
# verify the required parameter 'address_id' is set
fail ArgumentError, "Missing the required parameter 'address_id' when calling RoutingApi.delete_routing_sms_address" if address_id.nil?
# resource path
local_var_path = "/api/v2/routing/sms/addresses/{addressId}".sub('{format}','json').sub('{' + 'addressId' + '}', address_id.to_s)
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#delete_routing_sms_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_address(id)\n delete(\"addresses/#{id}\")\n end",
"def delete\n @address = Address.find(params[:address_id])\n end",
"def delete_address(address)\n address.delete!\n end",
"def delete id=nil\n id ||= self.id\n @nimble.delete \"contact/#{id}\"\n end",
"def delete_contact(id)\n delete(\"contacts/#{id}\")\n end",
"def delete_address_list(id)\n delete(\"addressGroups/#{id}\")\n end",
"def delete(id)\n results = connection.exec_params('DELETE FROM contacts WHERE id=$1;', [id]) \n end",
"def delete_address_group(id)\n delete(\"addressGroups/#{id}\")\n end",
"def delete_address(order_or_user, address_id, expect_success)\n address_id = address_id.id if address_id.is_a?(Spree::Address)\n\n visit_addresses(order_or_user)\n\n click_link \"delete-address-#{address_id}\"\n\n if expect_success\n expect(page).to have_content(Spree.t(:successfully_removed, resource: Spree::Address.model_name.human))\n else\n expect(page).to have_no_content(Spree.t(:successfully_removed, resource: Spree::Address.model_name.human))\n end\n end",
"def delete_contact(id, options = {})\n delete \"contacts/#{id}\"\n end",
"def destroy\n @taddress = Taddress.find(params[:id])\n @taddress.destroy\n \n respond_to do |format|\n format.html { redirect_to taddresses_url }\n format.json { head :ok }\n end\n end",
"def delete_address_book(address_book_id)\n end",
"def delete_address\n @mailing_list_address.destroy if @ok\n render 'update_addresses'\n end",
"def destroy\n @addresses = Address.paginate(:page => params[:page], :per_page => 5).order('updated_at DESC')\n @address = Address.find(params[:id])\n @error = nil\n\n begin\n @address.destroy\n rescue ActiveRecord::DeleteRestrictionError => e\n @error = e.message\n end\n end",
"def destroy\n @address = current_user.addresses.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to user_addresses_path(current_user) }\n format.json { head :no_content }\n end\n end",
"def delete_routing_sms_phonenumber_with_http_info(address_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_routing_sms_phonenumber ...\"\n end\n \n \n # verify the required parameter 'address_id' is set\n fail ArgumentError, \"Missing the required parameter 'address_id' when calling RoutingApi.delete_routing_sms_phonenumber\" if address_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/sms/phonenumbers/{addressId}\".sub('{format}','json').sub('{' + 'addressId' + '}', address_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\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: RoutingApi#delete_routing_sms_phonenumber\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to(:action=>'index') }\n format.xml { head :ok }\n end\n end",
"def destroy\n # @address = Address.find(params[:id])\n @address = Address.find_by_permalink!(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to(addresses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @customers_address = CustomersAddress.find(params[:id])\n @customers_address.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n address = Address.find(params[:id])\n status = address.delivery_address # stores whether it is delivery address or not\n address.destroy\n current_user_address = @current_user.addresses\n # if the address deleted is the current delivery address and the user should have atleast one address to mark the first address as delivery address.\n if (status && !(current_user_address.empty?))\n addrs = Address.first\n addrs.delivery_address = true\n addrs.save!\n end\n redirect_to cart_items_path\n end",
"def delete\n @addresses = Address.where(person_id: params[:id])\n @addresses.each do |c|\n Address.find(c.id).destroy\n end\n Person.find(params[:id]).destroy\n redirect_to :action => 'list'\n end",
"def delete_address(address_id, profile_id)\n @type = Type::CIM_DELETE_ADDRESS\n handle_address_id(address_id)\n handle_profile_id(profile_id)\n make_request\n end",
"def destroy\n @user_address = UserAddress.find(params[:id])\n @user_address.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_addresses_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n @carddav_backend.delete_address_book(@address_book_info['id'])\n end",
"def contact_delete(handle)\n query 'contact-delete', { handle: handle }\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to url_back, notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def deleteEntityInvoice_address( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"delete\",\"/entity/invoice_address\",params)\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Address was successfully destroyed.' }\n end\n end",
"def destroy\n @user_address = UserAddress.find(params[:id])\n @user_address.destroy\n\n respond_to do |format|\n format.html { redirect_to user_addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to admin_path(current_user), notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact(contact_to_delete)\n @contacts.delete(contact_to_delete)\n end",
"def delete_contact(params={})\n @obj.delete('delete-contact', @auth.merge(params))\n end",
"def delete_routing_sms_address(address_id, opts = {})\n delete_routing_sms_address_with_http_info(address_id, opts)\n return nil\n end",
"def delete(options={})\n DNSimple::Client.delete(\"/v1/contacts/#{id}\", options)\n end",
"def destroy\n @billing_address = BillingAddress.find(params[:id])\n @billing_address.destroy\n\n respond_to do |format|\n format.html { redirect_to billing_addresses_url }\n format.json { head :no_content }\n end\n end",
"def delete_contact(id)\n if contact = Contact.find_by(id: id)\n contact.destroy\n {status: true, contact: contact.display}\n else\n {status: false, error: \"\\nContact with that I.D. not found.\"}\n end\n end",
"def delete_contact(id)\n person = find_particular_contact(id)\n if person\n @contacts.delete(person)\n return true\n else\n return nil\n end\n end",
"def destroy\n\t\t@address = Address.find(params[:id])\n\t\t@address.coordinates.each do |c|\n\t\t\tc.destroy\n\t\tend\n\t\tredirect_to address_url(@address)\n\tend",
"def delete(address)\n \tMailgun.submit :delete, list_url(address)\n end",
"def destroy\n @address_detail.destroy\n respond_to do |format|\n format.html { redirect_to address_details_url, notice: 'Address detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact(token, id, user = nil)\n request_url = user_context(user) << \"/Contacts/\" << id\n\n delete_response = make_api_call \"DELETE\", request_url, token\n\n return nil if delete_response.nil? || delete_response.empty?\n\n parse_response(delete_response)\n end",
"def destroy\n @delivery_address = DeliveryAddress.find(params[:id])\n @delivery_address.destroy\n\n respond_to do |format|\n format.html { redirect_to delivery_addresses_url }\n format.json { head :no_content }\n end\n end",
"def delete(contactname)\n\n end",
"def destroy\n @ag_address.destroy\n respond_to do |format|\n format.html { redirect_to ag_addresses_url, notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n\t\t#@@contacts -= [delete_id.to_i]\n\t\t@@contacts.delete(self)\n\tend",
"def destroy\n @address_customer = AddressCustomer.find(params[:id])\n @address_customer.destroy\n\n respond_to do |format|\n format.html { redirect_to address_customers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: \"Address was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: \"Address was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @technocal_client_address = TechnocalClientAddress.find(params[:id])\n @technocal_client_address.destroy\n\n respond_to do |format|\n format.html { redirect_to(technocal_client_addresses_url) }\n format.xml { head :ok }\n end\n end",
"def remove(address_or_id)\n delete(\"#{domain}/complaints/#{address_or_id}\")\n end",
"def delete_contact\n display_all_contacts\n puts \"which ID would you like to delete?\"\n id = gets.chomp.to_i\n delete_value = Contact.find(id)\n delete_value.delete\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: 'Form was deleted successfully!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @adress = Adresse.find(params[:id])\n @adress.destroy\n\n respond_to do |format|\n format.html { redirect_to adresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address.destroy\n\n render :nothing => true\n end",
"def delete_contact\n\t\tputs \"\\nProvide a contact ID: \"\n\t\tid_entry = gets.chomp.to_i\n\t\t@rolodex.delete_one_contact(id_entry)\n\t\tputs \"\\nContact #{id_entry} is deleted FOREVER!\"\n\tend",
"def delete(id_to_delete)\n DATABASE.execute(\"DELETE FROM locations WHERE id = '#{id_to_delete}'\")\n end",
"def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { render :partial => 'addresses/list' }\n end\n end",
"def delete_message(id)\n record \"/msg/delete/#{id}\"\n end",
"def delete()\n\n MailAccount.destroy(self.id)\n end",
"def delete_sip_account(id)\n @cloudvox_api[\"/phones/#{id}.json\"].delete\n end",
"def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to edit_company_path(@company), notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address = current_user.addresses.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n format.js { render :js => \"$(this).parent().parent().remove(); this.preventDefault();\" } \n end\n end",
"def destroy\n @sulabh_address.destroy\n respond_to do |format|\n format.html { redirect_to sulabh_addresses_url, notice: 'Sulabh address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subscriber = Subscriber.find(session[:subscriber_id])\n @shipping_address = @subscriber.shipping_addresses.find_by_id(params[:id])\n @shipping_address && @shipping_address.destroy\n\n respond_to do |format|\n format.html { redirect_to shipping_addresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sales_address.destroy\n respond_to do |format|\n format.html { redirect_to sales_seller_addresses_path(@sales_seller), notice: \"Endereço removido com sucesso!\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ripple_address.destroy\n respond_to do |format|\n format.html { redirect_to ripple_addresses_url, notice: 'Ripple address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @customer_address.destroy\n respond_to do |format|\n format.html { redirect_to customer_addresses_url, notice: 'Customer address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(id)\n # The call uses a begin/rescue block so any errors can be handled properly\n begin\n Contact.filter(:id => id).destroy\n flash[:success] = 'The specified Contact has been removed'\n rescue => e\n Ramaze::Log.error(e.message)\n flash[:error] = 'The specified Contact could not be removed'\n end\n Action.add_record(@contact.id, session[:email], 'deleted', 'contact', @contact.last_name)\n redirect(Contacts.r(:index))\n end",
"def destroy\n #@phone = Phone.find(params[:id])\n #@phone.destroy\n end",
"def destroy\n @address_type = AddressType.find(params[:id])\n @address_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(address_types_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n\n Email.destroy(self.id)\n end",
"def delete(type, id)\n http_delete @target, \"#{type_info(type, :path)}/#{Addressable::URI.encode(id)}\", @auth_header, @zone\n end",
"def delete_which_contact\n\t\tputs \"What is the ID of the contact you want to delete?\"\n\t\tuser_id = gets.chomp.to_i\n\t\t@rolodex.delete_contact(user_id)\n\tend",
"def destroy\n @account_address.destroy\n respond_to do |format|\n format.html { redirect_to account_addresses_url, notice: 'Account address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @address_record.destroy\n respond_to do |format|\n format.html { redirect_to address_records_url, notice: 'Address record was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact\n contact = retrieve_contact_by_email\n if contact\n if @rolodex.delete(contact)\n puts \"Contact successfully deleted.\"\n end\n end\n end",
"def delete_note id\n @nimble.delete \"contact/notes/#{id}\"\n end",
"def destroy\n @user_address_book_item = UserAddressBookItem.find(params[:id])\n @user_address_book_item.destroy\n end",
"def remove_mailing(id)\n delete(\"/mailings/#{id}\")\n end",
"def delete(id)\n # TODO: Implement this for Stripe webhooks\n end",
"def destroy\n @post_address.destroy\n respond_to do |format|\n format.html { redirect_to post_addresses_url }\n format.json { head :no_content }\n end\n end",
"def delete_contact\n\t\tcontact_delate_check(params[:user_id], params[:to_delete_id])\n\t\tContact.delete(Contact.where(from_user: params[:user_id], to_user: params[:to_delete_id]))\n\t\tredirect_to contacts_page_path(id: params[:user_id])\n\tend",
"def destroy\n @invitee = Invitee.find(params[:id])\n\t\t@address = @invitee.address\n\t\t@address.destroy\n @invitee.destroy\n\n respond_to do |format|\n format.html { redirect_to invitees_url }\n format.json { head :ok }\n\t\t\tformat.js\n end\n end",
"def delete(contact)\n @@contacts.delete(contact)\n end",
"def destroy\n @user_address.destroy\n respond_to do |format|\n format.html { redirect_to user_addresses_path, notice: 'User address was successfully destroyed.' }\n end\n end",
"def delete(id)\n @service.delete(id)\n end",
"def delete(id)\n emsg = \"The %s argument cannot be nil, empty, or a zero length string\"\n raise(ArgumentError, emsg % ['id']) if !id.kind_of?(Integer)\n\n # remove the account\n @accounts.delete_if{|a| a.id == id}\n end",
"def delete(options={})\n options.merge!({:basic_auth => Client.credentials})\n self.class.delete(\"#{Client.base_uri}/contacts/#{id}.json\", options)\n end",
"def destroy\n @address_book = AddressBook.find(params[:id])\n @address_book.destroy\n flash[:notice] = :address_book_deleted.l\n\n respond_to do |format|\n format.html { redirect_to(address_books_url) }\n format.xml { head :ok }\n end\n end",
"def delete_by_id(id)\n delete_payment_token_by_id(id)\n end",
"def delete\n @client.post('/api/del_msg', id: get_attribute(:name))\n end",
"def delete_pin(id, options = {})\n id = id.to_sym\n # Check if this is a Pin or a PinGroup\n if pin_groups.key? id\n Origen.pin_bank.delete_pingroup(Origen.pin_bank.find_pin_group(id, options))\n elsif pins(id).class.to_s.match(/Pin/)\n Origen.pin_bank.delete_pin(Origen.pin_bank.find(id, options))\n else\n fail \"Error: the object #{id} you tried to delete is not a pin or pingroup\"\n end\n end",
"def delete(virtual_machine_id, ip_address_id)\n request(:delete, \"/virtual_machines/#{virtual_machine_id}/ip_addresses/#{ip_address_id}.json\")\n end",
"def destroy\n @contributor_address = ContributorAddress.find(params[:id])\n @contributor_address.destroy\n\n respond_to do |format|\n format.html { redirect_to contributor_addresses_url }\n format.json { head :no_content }\n end\n end",
"def delete_customer_phone(customer_id, phone_id)\n delete(\"customers/#{customer_id}/phones/#{phone_id}\")\n end"
] | [
"0.8239342",
"0.76468897",
"0.7438909",
"0.7303914",
"0.72190845",
"0.71464264",
"0.7139652",
"0.7039335",
"0.7030278",
"0.70030314",
"0.700274",
"0.6908973",
"0.6906973",
"0.67967844",
"0.676737",
"0.6741834",
"0.67238075",
"0.67238075",
"0.67238075",
"0.67238075",
"0.6716853",
"0.67044896",
"0.66920745",
"0.6689159",
"0.66882026",
"0.66713524",
"0.6606888",
"0.658053",
"0.65631354",
"0.6522886",
"0.6522078",
"0.6520861",
"0.65117586",
"0.65086967",
"0.64941955",
"0.6492344",
"0.64922196",
"0.6478792",
"0.6477746",
"0.647528",
"0.6474655",
"0.645305",
"0.64065075",
"0.64015937",
"0.63645506",
"0.63598514",
"0.6359713",
"0.63461846",
"0.6342589",
"0.6335865",
"0.6327167",
"0.63262796",
"0.63262796",
"0.6304909",
"0.6296734",
"0.6279494",
"0.6278845",
"0.62703526",
"0.62679124",
"0.62537473",
"0.6241611",
"0.6240068",
"0.6237461",
"0.62241757",
"0.6219948",
"0.62180436",
"0.6215661",
"0.6215473",
"0.6201919",
"0.6157739",
"0.6131512",
"0.61243457",
"0.612091",
"0.6120087",
"0.61007565",
"0.6094759",
"0.60910654",
"0.608531",
"0.60816306",
"0.6078201",
"0.60768247",
"0.6076416",
"0.6068366",
"0.60676855",
"0.6054058",
"0.6046049",
"0.60336816",
"0.6031702",
"0.6027252",
"0.60198396",
"0.601034",
"0.60061514",
"0.6001092",
"0.60005856",
"0.5994802",
"0.5992769",
"0.59916294",
"0.5987853",
"0.5985052",
"0.59837884"
] | 0.71223754 | 7 |
Delete a phone number provisioned for SMS. | def delete_routing_sms_phonenumber(address_id, opts = {})
delete_routing_sms_phonenumber_with_http_info(address_id, opts)
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_customer_phone(customer_id, phone_id)\n delete(\"customers/#{customer_id}/phones/#{phone_id}\")\n end",
"def remove_phone (p)\n phone_numbers.delete_at p\n end",
"def destroy\n @phonenumber = Phonenumber.find(params[:id])\n @phonenumber.destroy\n\n head :no_content\n end",
"def destroy\n phone_number.destroy\n flash[:notice] = 'The phone number was successfully removed.'\n respond_with(phone_number)\n end",
"def destroy\n @phone_number = PhoneNumber.find(params[:id])\n @phone_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_numbers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to(contact_info_admin_phones_url) }\n format.xml { head :ok }\n end\n add_log(user: current_user, action: \"Deleted phone: #{@phone.phone}\")\n end",
"def destroy\n @phone_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_numbers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @phone_num.destroy\n respond_to do |format|\n format.html { redirect_to phone_nums_url, notice: 'Phone num was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_phone_number.destroy\n respond_to do |format|\n format.html { redirect_to user_phone_numbers_url, notice: 'User phone number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@phone = Phone.find(params[:id])\n #@phone.destroy\n end",
"def delete_an_incoming_number(phone_number_id, opts = {})\n delete_an_incoming_number_with_http_info(phone_number_id, opts)\n nil\n end",
"def destroy\n @phone_number.destroy\n respond_to do |format|\n format.html { redirect_to phone_numbers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url, notice: \"Номер #{@phone.number} был успешно удален\" }\n end\n\n end",
"def delete_telephone_number(account_number, telephone_number)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts/{account_number}/dids/{telephone_number}'\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\r\n 'account_number' => account_number,\r\n 'telephone_number' => telephone_number\r\n }\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'X-Auth-Token' => Configuration.x_auth_token\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.delete query_url, headers: headers\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new 'You are not authenticated', 401, response.raw_body\r\n elsif response.code == 403\r\n raise APIException.new 'This action needs a valid WSSE header', 403, response.raw_body\r\n elsif response.code == 404\r\n raise APIException.new 'Resource not found', 404, response.raw_body\r\n elsif response.code == 400\r\n raise APIException.new 'Http bad request', 400, response.raw_body\r\n elsif !response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end",
"def destroy\n @moto_user_phone = MotoUserPhone.find(params[:id])\n @moto_user_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_user_phones_url) }\n format.xml { head :ok }\n end\n end",
"def delete_sip_account(id)\n @cloudvox_api[\"/phones/#{id}.json\"].delete\n end",
"def destroy\n\n begin \n @client = Twilio::REST::Client.new BwCallTracking::Application.config.account_sid, BwCallTracking::Application.config.auth_token \n \n @client.account.incoming_phone_numbers.list({:phone_number => @number.tracking_number}).each do |n|\n n.delete\n end\n\n rescue StandardError => e\n puts \"ERROR: \"+e.message \n end \n\n @number.destroy\n\n respond_to do |format|\n format.html { redirect_to numbers_url, notice: 'Number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to(contacts_url) }\n format.xml { head :ok }\n end\n end",
"def deletesubscriber\n\n\tparams[\"phone\"] = params[\"phone\"].gsub(\"\\s\",\"\").gsub(/^0044/, \"\").gsub(/^\\+44/, \"\")\n\tif params[\"phone\"].length == 10\n\t\tparams[\"phone\"] = '0' + params[\"phone\"]\n\tend\n\n\tif (Subscriber.exists?(:phone => params[:phone]))\n\t\tsubscriber = Subscriber.where(:phone => params[:phone]).first\n\t\tsubscriber.destroy\n\n\t\trespond_to do |format|\n\t\t format.html # deletesubscriber.html.erb\n\t\tend\n\telse\n\t\tredirect_to :action => \"unsubscribe\", phone: params[:phone]\n end\n end",
"def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :ok }\n end\n end",
"def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extension(value)\n end",
"def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extension(value)\n end",
"def remove_sms_number(telerivet_link)\n attribute = telerivet_link.attribute\n sms_number = telerivet_link.sms_number\n\n TelerivetBridge.unsync_telerivet_link(telerivet_link)\n assign_attributes(attribute => split_sms_numbers(attribute).reject{ |sms| sms == sms_number }.join(', '))\n end",
"def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_detail = PhoneDetail.find(params[:id])\n @phone_detail.destroy\n respond_to do |format|\n format.html { redirect_to phone_details_path, notice: 'Phone detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contactperson_phone.destroy\n respond_to do |format|\n format.html { redirect_to contactperson_phones_url, notice: 'Contactperson phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vip_phone.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_phones_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip phone: #{@vip_phone.phone}\")\n end",
"def destroy\n @boat_user_phone = BoatUserPhone.find(params[:id])\n @boat_user_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to(boat_user_phones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @contact_phone.destroy\n respond_to do |format|\n format.html { redirect_to contact_phones_url(@contact), notice: 'Phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url, notice: 'Phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url, notice: 'Phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @call_num = CallNum.find(params[:id])\n @call_num.destroy\n\n respond_to do |format|\n flash[:success] = 'Call number was successfully deleted.'\n format.html { redirect_to add_details_path }\n format.xml { head :ok }\n end\n end",
"def destroy\n get_supplier\n @supplier_phone = @supplier.phones.find(params[:id])\n @supplier_phone.destroy\n end",
"def destroy\n @moto_registration_number = MotoRegistrationNumber.find(params[:id])\n @moto_registration_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_registration_numbers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n begin \n\n Bandwidth::PhoneNumber.get(@number.bw_id).delete \n \n rescue StandardError => e\n puts \"ERROR: \"+e.message \n end \n\n @number.destroy\n\n respond_to do |format|\n format.html { redirect_to numbers_url, notice: 'Number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_number_type = PhoneNumberType.find(params[:id])\n @phone_number_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_number_types_url) }\n format.xml { head :ok }\n end\n end",
"def delete_routing_sms_phonenumber_with_http_info(address_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_routing_sms_phonenumber ...\"\n end\n \n \n # verify the required parameter 'address_id' is set\n fail ArgumentError, \"Missing the required parameter 'address_id' when calling RoutingApi.delete_routing_sms_phonenumber\" if address_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/sms/phonenumbers/{addressId}\".sub('{format}','json').sub('{' + 'addressId' + '}', address_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\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: RoutingApi#delete_routing_sms_phonenumber\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def delete_contact(params={})\n @obj.delete('delete-contact', @auth.merge(params))\n end",
"def destroy\n @phone_use = PhoneUse.find(params[:id])\n @phone_use.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_uses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @phonecall = Phonecall.find(params[:id])\n @phonecall.destroy\n\n respond_to do |format|\n format.html { redirect_to(phonecalls_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @add_phone_to_nouveau_ticket = AddPhoneToNouveauTicket.find(params[:id])\n @add_phone_to_nouveau_ticket.destroy\n\n respond_to do |format|\n format.html { redirect_to add_phone_to_nouveau_tickets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tw_phone.destroy\n respond_to do |format|\n format.html { redirect_to tw_phones_url, notice: 'Tw phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @account = current_user.person.phone_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end",
"def destroy\n @smsno.destroy\n respond_to do |format|\n format.html { redirect_to smsnos_url, notice: 'Smsno was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact(id)\n delete(\"contacts/#{id}\")\n end",
"def destroy\n @contact_number = ContactNumber.find(params[:id])\n @contact_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(contact_numbers_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @outgoing_sms_number_group = OutgoingSmsNumberGroup.find(params[:id])\n @outgoing_sms_number_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(outgoing_sms_number_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @phone_item.destroy\n respond_to do |format|\n format.html { redirect_to phone_items_url, notice: '删除成功.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_order.destroy\n respond_to do |format|\n format.html { redirect_to phone_orders_url, notice: 'Phone order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete id=nil\n id ||= self.id\n @nimble.delete \"contact/#{id}\"\n end",
"def delete_contact\n contact = retrieve_contact_by_email\n if contact\n if @rolodex.delete(contact)\n puts \"Contact successfully deleted.\"\n end\n end\n end",
"def delete_contact(contact_to_delete)\n @contacts.delete(contact_to_delete)\n end",
"def delete\n @reason_structure.delete(@num)\n end",
"def destroy\n @sm = Sm.find(params[:id])\n @sm.destroy\n\n respond_to do |format|\n format.html { redirect_to sms_url }\n format.json { head :no_content }\n end\n end",
"def test_cleans_number\n p_number = PhoneNumber.new('(123) 456-7890')\n assert_equal('1234567890', p_number.number)\n end",
"def destroy\n @user_telephone.destroy\n respond_to do |format|\n format.html { redirect_to user_telephones_url, notice: 'User telephone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_model = PhoneModel.find(params[:id])\n @phone_model.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_models_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sms = Sms.find(params[:id])\n @sms.destroy\n\n respond_to do |format|\n format.html { redirect_to(sms_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sm = Sm.find(params[:id])\n @sm.destroy\n\n respond_to do |format|\n format.html { redirect_to(sms_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n #@phone.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_line.destroy\n respond_to do |format|\n format.html { redirect_to phone_lines_url, notice: 'Phone line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_contact_num.destroy\n respond_to do |format|\n format.html { redirect_to user_contact_nums_url, notice: 'User contact num was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact(id, options = {})\n delete \"contacts/#{id}\"\n end",
"def destroy\n @sms_based.destroy\n respond_to do |format|\n format.html { redirect_to sms_baseds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pphone = Pphone.find(params[:id])\n @pphone.destroy\n\n respond_to do |format|\n format.html { redirect_to(pphones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @number = Number.where(:value => params[:number][:value]).first\n @number.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @registration_number.destroy\n respond_to do |format|\n format.html { redirect_to registration_numbers_url, notice: 'Registration number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_call.destroy\n respond_to do |format|\n format.html { redirect_to phone_calls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @apple_phone.destroy\n respond_to do |format|\n format.html { redirect_to apple_phones_url, notice: 'Apple phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destoryed_memorial(memorial_id)\n mail to: \"yossishalem@gmail.com\", subject: \"NerEzion: memorial #{memorial_id} is removed!\"\n end",
"def delete\n if empty?\n @perforce.run(\"change\", \"-d\", @number)\n end\n end",
"def destroy\n @sms_retrieval.destroy\n respond_to do |format|\n format.html { redirect_to sms_retrievals_url, notice: 'Sms retrieval was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @modele_telephone.destroy\n respond_to do |format|\n format.html { redirect_to modele_telephones_url, notice: 'Modele telephone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @number_call = NumberCall.find(params[:id])\n @number_call.destroy\n\n respond_to do |format|\n format.html { redirect_to number_calls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message_phone_connection = MessagePhoneConnection.find(params[:id])\n @message_phone_connection.destroy\n\n respond_to do |format|\n format.html { redirect_to message_phone_connections_url }\n format.json { head :no_content }\n end\n end",
"def delete\n\t\t#@@contacts -= [delete_id.to_i]\n\t\t@@contacts.delete(self)\n\tend",
"def deleteEntityPhone( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/phone\",params)\n end",
"def delete_dedicated_number(id, opts = {})\n delete_dedicated_number_with_http_info(id, opts)\n nil\n end",
"def delete_which_contact\n\t\tputs \"What is the ID of the contact you want to delete?\"\n\t\tuser_id = gets.chomp.to_i\n\t\t@rolodex.delete_contact(user_id)\n\tend",
"def destroy\n @phone_type.destroy\n respond_to do |format|\n format.html { redirect_to phone_types_url, notice: 'Tipo Telefone excluído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tnumber = Tnumber.find(params[:id])\n @tnumber.destroy\n\n respond_to do |format|\n format.html { redirect_to tnumbers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @registration_number = RegistrationNumber.find(params[:id])\n @registration_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(registration_numbers_url) }\n format.xml { head :ok }\n end\n end",
"def delete_message(sid)\n\t@client = Twilio::REST::Client.new ACCOUNT_SID, AUTH_TOKEN\n\t@client.recordings.get(sid).delete()\nend",
"def destroy\n @tag_for_phone = TagForPhone.find(params[:id])\n @tag_for_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to tag_for_phones_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @emergency_phone = @center.emergency_phones.find(params[:id])\n @emergency_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to center_emergency_phones_url }\n format.json { head :no_content }\n format.js\n end\n end",
"def contact_delete(handle)\n query 'contact-delete', { handle: handle }\n end",
"def destroy\n @phone_app.destroy\n respond_to do |format|\n format.html { redirect_to phone_apps_url, notice: 'Phone app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n flash[:success] = 'Your phone book has been deleted.' if @phone_book.destroy\n respond_with @organization, @phone_book\n end",
"def destroy\n @number.destroy\n respond_to do |format|\n format.html { redirect_to numbers_url, notice: 'Number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact(token, id, user = nil)\n request_url = user_context(user) << \"/Contacts/\" << id\n\n delete_response = make_api_call \"DELETE\", request_url, token\n\n return nil if delete_response.nil? || delete_response.empty?\n\n parse_response(delete_response)\n end",
"def cell_phone\n value = Faker::PhoneNumber.cell_phone\n remove_extension(value)\n end",
"def cell_phone\n value = Faker::PhoneNumber.cell_phone\n remove_extension(value)\n end",
"def delete(contact)\n @@contacts.delete(contact)\n end",
"def destroy\n @phone_accessory.destroy\n respond_to do |format|\n format.html { redirect_to phone_accessories_url, notice: 'Phone accessory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact\n\t\tputs \"\\nProvide a contact ID: \"\n\t\tid_entry = gets.chomp.to_i\n\t\t@rolodex.delete_one_contact(id_entry)\n\t\tputs \"\\nContact #{id_entry} is deleted FOREVER!\"\n\tend",
"def sms(phone_number, **params)\n\n self.post(VERIFY_SMS_RESOURCE,\n phone_number: phone_number,\n **params)\n end",
"def destroy\n @number_master = NumberMaster.find(params[:id])\n @number_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(number_masters_url) }\n format.xml { head :ok }\n end\n end"
] | [
"0.7268533",
"0.72600186",
"0.71352464",
"0.71031314",
"0.6942986",
"0.6842988",
"0.6807594",
"0.67865956",
"0.6767084",
"0.67649484",
"0.6731482",
"0.672774",
"0.6636843",
"0.66213554",
"0.6558635",
"0.65473104",
"0.65257716",
"0.65052646",
"0.6479042",
"0.6440309",
"0.6406066",
"0.63915646",
"0.63915646",
"0.638351",
"0.6374533",
"0.63299865",
"0.6311964",
"0.6311964",
"0.6307107",
"0.6298563",
"0.6294456",
"0.62825096",
"0.62762195",
"0.62762195",
"0.6273444",
"0.6259704",
"0.62390393",
"0.61825305",
"0.6172373",
"0.61286086",
"0.61034596",
"0.6046381",
"0.6040836",
"0.60360676",
"0.6016616",
"0.60130435",
"0.60047233",
"0.5986222",
"0.5986127",
"0.5975846",
"0.5937401",
"0.5913577",
"0.59134775",
"0.5908994",
"0.5906911",
"0.5906028",
"0.5904546",
"0.5897055",
"0.58598155",
"0.5854724",
"0.5852654",
"0.58371836",
"0.58311814",
"0.58166516",
"0.5804263",
"0.57966423",
"0.57955736",
"0.5789541",
"0.5786098",
"0.57685196",
"0.5761504",
"0.5758265",
"0.5755447",
"0.5745318",
"0.57370275",
"0.573654",
"0.5733903",
"0.5728115",
"0.5717132",
"0.5703751",
"0.570123",
"0.5696311",
"0.5696272",
"0.56859463",
"0.568571",
"0.5684985",
"0.5674184",
"0.56631905",
"0.56631887",
"0.56533414",
"0.5637938",
"0.56376624",
"0.5627893",
"0.56221724",
"0.56221724",
"0.5611841",
"0.5606742",
"0.5589943",
"0.55851245",
"0.5578118"
] | 0.6369731 | 25 |
Delete a phone number provisioned for SMS. | def delete_routing_sms_phonenumber_with_http_info(address_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.delete_routing_sms_phonenumber ..."
end
# verify the required parameter 'address_id' is set
fail ArgumentError, "Missing the required parameter 'address_id' when calling RoutingApi.delete_routing_sms_phonenumber" if address_id.nil?
# resource path
local_var_path = "/api/v2/routing/sms/phonenumbers/{addressId}".sub('{format}','json').sub('{' + 'addressId' + '}', address_id.to_s)
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#delete_routing_sms_phonenumber\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_customer_phone(customer_id, phone_id)\n delete(\"customers/#{customer_id}/phones/#{phone_id}\")\n end",
"def remove_phone (p)\n phone_numbers.delete_at p\n end",
"def destroy\n @phonenumber = Phonenumber.find(params[:id])\n @phonenumber.destroy\n\n head :no_content\n end",
"def destroy\n phone_number.destroy\n flash[:notice] = 'The phone number was successfully removed.'\n respond_with(phone_number)\n end",
"def destroy\n @phone_number = PhoneNumber.find(params[:id])\n @phone_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_numbers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to(contact_info_admin_phones_url) }\n format.xml { head :ok }\n end\n add_log(user: current_user, action: \"Deleted phone: #{@phone.phone}\")\n end",
"def destroy\n @phone_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_numbers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @phone_num.destroy\n respond_to do |format|\n format.html { redirect_to phone_nums_url, notice: 'Phone num was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_phone_number.destroy\n respond_to do |format|\n format.html { redirect_to user_phone_numbers_url, notice: 'User phone number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@phone = Phone.find(params[:id])\n #@phone.destroy\n end",
"def delete_an_incoming_number(phone_number_id, opts = {})\n delete_an_incoming_number_with_http_info(phone_number_id, opts)\n nil\n end",
"def destroy\n @phone_number.destroy\n respond_to do |format|\n format.html { redirect_to phone_numbers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url, notice: \"Номер #{@phone.number} был успешно удален\" }\n end\n\n end",
"def delete_telephone_number(account_number, telephone_number)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts/{account_number}/dids/{telephone_number}'\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\r\n 'account_number' => account_number,\r\n 'telephone_number' => telephone_number\r\n }\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'X-Auth-Token' => Configuration.x_auth_token\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.delete query_url, headers: headers\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new 'You are not authenticated', 401, response.raw_body\r\n elsif response.code == 403\r\n raise APIException.new 'This action needs a valid WSSE header', 403, response.raw_body\r\n elsif response.code == 404\r\n raise APIException.new 'Resource not found', 404, response.raw_body\r\n elsif response.code == 400\r\n raise APIException.new 'Http bad request', 400, response.raw_body\r\n elsif !response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end",
"def destroy\n @moto_user_phone = MotoUserPhone.find(params[:id])\n @moto_user_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_user_phones_url) }\n format.xml { head :ok }\n end\n end",
"def delete_sip_account(id)\n @cloudvox_api[\"/phones/#{id}.json\"].delete\n end",
"def destroy\n\n begin \n @client = Twilio::REST::Client.new BwCallTracking::Application.config.account_sid, BwCallTracking::Application.config.auth_token \n \n @client.account.incoming_phone_numbers.list({:phone_number => @number.tracking_number}).each do |n|\n n.delete\n end\n\n rescue StandardError => e\n puts \"ERROR: \"+e.message \n end \n\n @number.destroy\n\n respond_to do |format|\n format.html { redirect_to numbers_url, notice: 'Number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to(contacts_url) }\n format.xml { head :ok }\n end\n end",
"def deletesubscriber\n\n\tparams[\"phone\"] = params[\"phone\"].gsub(\"\\s\",\"\").gsub(/^0044/, \"\").gsub(/^\\+44/, \"\")\n\tif params[\"phone\"].length == 10\n\t\tparams[\"phone\"] = '0' + params[\"phone\"]\n\tend\n\n\tif (Subscriber.exists?(:phone => params[:phone]))\n\t\tsubscriber = Subscriber.where(:phone => params[:phone]).first\n\t\tsubscriber.destroy\n\n\t\trespond_to do |format|\n\t\t format.html # deletesubscriber.html.erb\n\t\tend\n\telse\n\t\tredirect_to :action => \"unsubscribe\", phone: params[:phone]\n end\n end",
"def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :ok }\n end\n end",
"def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extension(value)\n end",
"def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extension(value)\n end",
"def remove_sms_number(telerivet_link)\n attribute = telerivet_link.attribute\n sms_number = telerivet_link.sms_number\n\n TelerivetBridge.unsync_telerivet_link(telerivet_link)\n assign_attributes(attribute => split_sms_numbers(attribute).reject{ |sms| sms == sms_number }.join(', '))\n end",
"def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end",
"def delete_routing_sms_phonenumber(address_id, opts = {})\n delete_routing_sms_phonenumber_with_http_info(address_id, opts)\n return nil\n end",
"def destroy\n @phone_detail = PhoneDetail.find(params[:id])\n @phone_detail.destroy\n respond_to do |format|\n format.html { redirect_to phone_details_path, notice: 'Phone detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contactperson_phone.destroy\n respond_to do |format|\n format.html { redirect_to contactperson_phones_url, notice: 'Contactperson phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vip_phone.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_phones_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip phone: #{@vip_phone.phone}\")\n end",
"def destroy\n @boat_user_phone = BoatUserPhone.find(params[:id])\n @boat_user_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to(boat_user_phones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @contact_phone.destroy\n respond_to do |format|\n format.html { redirect_to contact_phones_url(@contact), notice: 'Phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url, notice: 'Phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url, notice: 'Phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @call_num = CallNum.find(params[:id])\n @call_num.destroy\n\n respond_to do |format|\n flash[:success] = 'Call number was successfully deleted.'\n format.html { redirect_to add_details_path }\n format.xml { head :ok }\n end\n end",
"def destroy\n get_supplier\n @supplier_phone = @supplier.phones.find(params[:id])\n @supplier_phone.destroy\n end",
"def destroy\n @moto_registration_number = MotoRegistrationNumber.find(params[:id])\n @moto_registration_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_registration_numbers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n begin \n\n Bandwidth::PhoneNumber.get(@number.bw_id).delete \n \n rescue StandardError => e\n puts \"ERROR: \"+e.message \n end \n\n @number.destroy\n\n respond_to do |format|\n format.html { redirect_to numbers_url, notice: 'Number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_number_type = PhoneNumberType.find(params[:id])\n @phone_number_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_number_types_url) }\n format.xml { head :ok }\n end\n end",
"def delete_contact(params={})\n @obj.delete('delete-contact', @auth.merge(params))\n end",
"def destroy\n @phone_use = PhoneUse.find(params[:id])\n @phone_use.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_uses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @phonecall = Phonecall.find(params[:id])\n @phonecall.destroy\n\n respond_to do |format|\n format.html { redirect_to(phonecalls_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @add_phone_to_nouveau_ticket = AddPhoneToNouveauTicket.find(params[:id])\n @add_phone_to_nouveau_ticket.destroy\n\n respond_to do |format|\n format.html { redirect_to add_phone_to_nouveau_tickets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tw_phone.destroy\n respond_to do |format|\n format.html { redirect_to tw_phones_url, notice: 'Tw phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @account = current_user.person.phone_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end",
"def destroy\n @smsno.destroy\n respond_to do |format|\n format.html { redirect_to smsnos_url, notice: 'Smsno was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact(id)\n delete(\"contacts/#{id}\")\n end",
"def destroy\n @contact_number = ContactNumber.find(params[:id])\n @contact_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(contact_numbers_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @outgoing_sms_number_group = OutgoingSmsNumberGroup.find(params[:id])\n @outgoing_sms_number_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(outgoing_sms_number_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @phone_item.destroy\n respond_to do |format|\n format.html { redirect_to phone_items_url, notice: '删除成功.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_order.destroy\n respond_to do |format|\n format.html { redirect_to phone_orders_url, notice: 'Phone order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete id=nil\n id ||= self.id\n @nimble.delete \"contact/#{id}\"\n end",
"def delete_contact\n contact = retrieve_contact_by_email\n if contact\n if @rolodex.delete(contact)\n puts \"Contact successfully deleted.\"\n end\n end\n end",
"def delete_contact(contact_to_delete)\n @contacts.delete(contact_to_delete)\n end",
"def delete\n @reason_structure.delete(@num)\n end",
"def destroy\n @sm = Sm.find(params[:id])\n @sm.destroy\n\n respond_to do |format|\n format.html { redirect_to sms_url }\n format.json { head :no_content }\n end\n end",
"def test_cleans_number\n p_number = PhoneNumber.new('(123) 456-7890')\n assert_equal('1234567890', p_number.number)\n end",
"def destroy\n @user_telephone.destroy\n respond_to do |format|\n format.html { redirect_to user_telephones_url, notice: 'User telephone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_model = PhoneModel.find(params[:id])\n @phone_model.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_models_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sms = Sms.find(params[:id])\n @sms.destroy\n\n respond_to do |format|\n format.html { redirect_to(sms_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sm = Sm.find(params[:id])\n @sm.destroy\n\n respond_to do |format|\n format.html { redirect_to(sms_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n #@phone.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_line.destroy\n respond_to do |format|\n format.html { redirect_to phone_lines_url, notice: 'Phone line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_contact_num.destroy\n respond_to do |format|\n format.html { redirect_to user_contact_nums_url, notice: 'User contact num was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact(id, options = {})\n delete \"contacts/#{id}\"\n end",
"def destroy\n @sms_based.destroy\n respond_to do |format|\n format.html { redirect_to sms_baseds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pphone = Pphone.find(params[:id])\n @pphone.destroy\n\n respond_to do |format|\n format.html { redirect_to(pphones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @number = Number.where(:value => params[:number][:value]).first\n @number.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @registration_number.destroy\n respond_to do |format|\n format.html { redirect_to registration_numbers_url, notice: 'Registration number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_call.destroy\n respond_to do |format|\n format.html { redirect_to phone_calls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @apple_phone.destroy\n respond_to do |format|\n format.html { redirect_to apple_phones_url, notice: 'Apple phone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destoryed_memorial(memorial_id)\n mail to: \"yossishalem@gmail.com\", subject: \"NerEzion: memorial #{memorial_id} is removed!\"\n end",
"def delete\n if empty?\n @perforce.run(\"change\", \"-d\", @number)\n end\n end",
"def destroy\n @sms_retrieval.destroy\n respond_to do |format|\n format.html { redirect_to sms_retrievals_url, notice: 'Sms retrieval was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @modele_telephone.destroy\n respond_to do |format|\n format.html { redirect_to modele_telephones_url, notice: 'Modele telephone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @number_call = NumberCall.find(params[:id])\n @number_call.destroy\n\n respond_to do |format|\n format.html { redirect_to number_calls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message_phone_connection = MessagePhoneConnection.find(params[:id])\n @message_phone_connection.destroy\n\n respond_to do |format|\n format.html { redirect_to message_phone_connections_url }\n format.json { head :no_content }\n end\n end",
"def delete\n\t\t#@@contacts -= [delete_id.to_i]\n\t\t@@contacts.delete(self)\n\tend",
"def deleteEntityPhone( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/phone\",params)\n end",
"def delete_dedicated_number(id, opts = {})\n delete_dedicated_number_with_http_info(id, opts)\n nil\n end",
"def delete_which_contact\n\t\tputs \"What is the ID of the contact you want to delete?\"\n\t\tuser_id = gets.chomp.to_i\n\t\t@rolodex.delete_contact(user_id)\n\tend",
"def destroy\n @phone_type.destroy\n respond_to do |format|\n format.html { redirect_to phone_types_url, notice: 'Tipo Telefone excluído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tnumber = Tnumber.find(params[:id])\n @tnumber.destroy\n\n respond_to do |format|\n format.html { redirect_to tnumbers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @registration_number = RegistrationNumber.find(params[:id])\n @registration_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(registration_numbers_url) }\n format.xml { head :ok }\n end\n end",
"def delete_message(sid)\n\t@client = Twilio::REST::Client.new ACCOUNT_SID, AUTH_TOKEN\n\t@client.recordings.get(sid).delete()\nend",
"def destroy\n @tag_for_phone = TagForPhone.find(params[:id])\n @tag_for_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to tag_for_phones_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @emergency_phone = @center.emergency_phones.find(params[:id])\n @emergency_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to center_emergency_phones_url }\n format.json { head :no_content }\n format.js\n end\n end",
"def contact_delete(handle)\n query 'contact-delete', { handle: handle }\n end",
"def destroy\n @phone_app.destroy\n respond_to do |format|\n format.html { redirect_to phone_apps_url, notice: 'Phone app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n flash[:success] = 'Your phone book has been deleted.' if @phone_book.destroy\n respond_with @organization, @phone_book\n end",
"def destroy\n @number.destroy\n respond_to do |format|\n format.html { redirect_to numbers_url, notice: 'Number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact(token, id, user = nil)\n request_url = user_context(user) << \"/Contacts/\" << id\n\n delete_response = make_api_call \"DELETE\", request_url, token\n\n return nil if delete_response.nil? || delete_response.empty?\n\n parse_response(delete_response)\n end",
"def cell_phone\n value = Faker::PhoneNumber.cell_phone\n remove_extension(value)\n end",
"def cell_phone\n value = Faker::PhoneNumber.cell_phone\n remove_extension(value)\n end",
"def delete(contact)\n @@contacts.delete(contact)\n end",
"def destroy\n @phone_accessory.destroy\n respond_to do |format|\n format.html { redirect_to phone_accessories_url, notice: 'Phone accessory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_contact\n\t\tputs \"\\nProvide a contact ID: \"\n\t\tid_entry = gets.chomp.to_i\n\t\t@rolodex.delete_one_contact(id_entry)\n\t\tputs \"\\nContact #{id_entry} is deleted FOREVER!\"\n\tend",
"def sms(phone_number, **params)\n\n self.post(VERIFY_SMS_RESOURCE,\n phone_number: phone_number,\n **params)\n end",
"def destroy\n @number_master = NumberMaster.find(params[:id])\n @number_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(number_masters_url) }\n format.xml { head :ok }\n end\n end"
] | [
"0.7268533",
"0.72600186",
"0.71352464",
"0.71031314",
"0.6942986",
"0.6842988",
"0.6807594",
"0.67865956",
"0.6767084",
"0.67649484",
"0.6731482",
"0.672774",
"0.6636843",
"0.66213554",
"0.6558635",
"0.65473104",
"0.65257716",
"0.65052646",
"0.6479042",
"0.6440309",
"0.6406066",
"0.63915646",
"0.63915646",
"0.638351",
"0.6374533",
"0.6369731",
"0.63299865",
"0.6311964",
"0.6311964",
"0.6307107",
"0.6298563",
"0.6294456",
"0.62825096",
"0.62762195",
"0.62762195",
"0.6273444",
"0.6259704",
"0.62390393",
"0.61825305",
"0.6172373",
"0.61034596",
"0.6046381",
"0.6040836",
"0.60360676",
"0.6016616",
"0.60130435",
"0.60047233",
"0.5986222",
"0.5986127",
"0.5975846",
"0.5937401",
"0.5913577",
"0.59134775",
"0.5908994",
"0.5906911",
"0.5906028",
"0.5904546",
"0.5897055",
"0.58598155",
"0.5854724",
"0.5852654",
"0.58371836",
"0.58311814",
"0.58166516",
"0.5804263",
"0.57966423",
"0.57955736",
"0.5789541",
"0.5786098",
"0.57685196",
"0.5761504",
"0.5758265",
"0.5755447",
"0.5745318",
"0.57370275",
"0.573654",
"0.5733903",
"0.5728115",
"0.5717132",
"0.5703751",
"0.570123",
"0.5696311",
"0.5696272",
"0.56859463",
"0.568571",
"0.5684985",
"0.5674184",
"0.56631905",
"0.56631887",
"0.56533414",
"0.5637938",
"0.56376624",
"0.5627893",
"0.56221724",
"0.56221724",
"0.5611841",
"0.5606742",
"0.5589943",
"0.55851245",
"0.5578118"
] | 0.61286086 | 40 |
Delete the user's max utilization settings and revert to the organizationwide default. | def delete_routing_user_utilization(user_id, opts = {})
delete_routing_user_utilization_with_http_info(user_id, opts)
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_default_user\n @_default_user = nil\n end",
"def destroy\n @user_page_setting.destroy\n end",
"def reset_member_limits\r\n @member_limits.each do |user, limit|\r\n limit.reset\r\n end\r\n end",
"def clear_current_user; end",
"def destroy\n result = current_user.user_settings.find(params[:id])\n result.destroy\n\n respond_with result\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n redirect_to settings_path\n end",
"def delate_constraint\n\t\tdelete_constraint_check(params[:user_id], params[:constraint_id])\n\t\tConstraint.delete(params[:constraint_id])\n\t\tredirect_to settings_page_path(id: params[:user_id])\n\tend",
"def clear_user_and_mark_purged\n random_suffix = (('0'..'9').to_a + ('a'..'z').to_a).sample(8).join\n\n self.studio_person_id = nil\n self.name = nil\n self.username = \"#{SYSTEM_DELETED_USERNAME}_#{random_suffix}\"\n self.current_sign_in_ip = nil\n self.last_sign_in_ip = nil\n self.email = ''\n self.hashed_email = ''\n self.parent_email = nil\n self.encrypted_password = nil\n self.uid = nil\n self.reset_password_token = nil\n self.full_address = nil\n self.properties = {}\n\n self.purged_at = Time.zone.now\n\n save!\n end",
"def reset_defaults; end",
"def delete\n\t\tcurrent_user\n\t\tcurrent_user.regexpressions.destroy_all\n\t\tcurrent_user.tasks.destroy_all\n\t\tcurrent_user.clouds.destroy_all\n\t\tcurrent_user.platforms.destroy_all\n\t\tcurrent_user.demos.destroy_all\n\t\tcurrent_user.favorites.destroy_all\n\tend",
"def clear_current_user\n User.current_user = nil\n end",
"def remove_defaults(name)\n pre_processed_defaults.delete_one(name)\n post_processed_defaults.delete_one(name)\n end",
"def init_limit_reset_for(account)\n @task_manager.in '1d' do\n account.reset_limit\n end\n end",
"def delete_max\n loc = delete_max_locator\n loc and loc.value\n end",
"def removeWorkingUser user\n @workingUsers.delete user\n end",
"def delete_max\n @root = delete_max_node(@root)\n end",
"def update_quota_override(users:)\n figshare = Figshare::Init.new(figshare_user: 'figshare_admin', conf_dir: \"#{__dir__}/../conf\" )\n users.each do |upi, quota|\n user_record_from_upi(figshare: figshare, upi: upi) do |u|\n # don't change, if they already have more quota than the override.\n users[upi] = u['quota'] >= quota ? nil : u['quota']\n end\n end\nend",
"def remove_remaining_notification_settings\n source_project.notification_settings.destroy_all # rubocop: disable DestroyAll\n end",
"def remove_property_from_user_profile_schema(options = {})\n post('/meta/schemas/user/default', options)\n end",
"def reset_user\n sitrack_user = SitrackUser.find_by_ssm_id(current_user.id, :include => :sitrack_views)\n end",
"def unset_limits(options = {})\r\n mem_fix = 1\r\n @@resource_limits = {}\r\n if options[:unset_env]\r\n ENV[\"MAGICK_AREA_LIMIT\"]=nil\r\n ENV[\"MAGICK_MAP_LIMIT\"]=nil\r\n ENV[\"MAGICK_MEMORY_LIMIT\"]=nil\r\n ENV[\"MAGICK_DISK_LIMIT\"]=nil\r\n end\r\n end",
"def unauthorize\n Logger.info \"Cleaning up authorization for #{@registry.prefix}\"\n FileUtils.rm_rf(@gcloud_config_dir) unless @gcloud_config_dir.nil?\n end",
"def unadmin!\n metadata['admin'] = false\n save\n end",
"def userinfo_unset\n userinfo_set nil\n end",
"def destroy\n current_user.graph.destroy(current_user.id) if current_user\n super\n end",
"def stop_organization_help\n User.find(session[:user_id]).update(:organization_help=>false)\n end",
"def dp_unauthorize\n require 'dropbox_sdk'\n \n session[:dropbox_session] = nil\n @setting.dropbox_session = nil\n @setting.save!\n end",
"def site_on_on_uninstall_theme(theme)\n theme.get_field_groups().destroy_all\n theme.destroy\n end",
"def destroy\n @user_setting.destroy\n respond_to do |format|\n format.html { redirect_to user_settings_url, notice: 'User setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def reset_user\n return unless exists?(:previous_user)\n set :user, fetch(:previous_user)\n unset :previous_user\n clear_sessions\n end",
"def decrement_of_health(user)\n -((user.max_health / 10) + 5 * (4 - difficulty)).round\n end",
"def super_active_users_retention\n \n end",
"def purge\n @user.destroy\n redirect_to admin_users_path\n end",
"def destroy\n set_global_setting\n @global_setting.destroy\n respond_to do |format|\n format.html { redirect_to admin_global_settings_url, notice: 'Setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def remove_accounts_below_disk_free_percentage=(value)\n @remove_accounts_below_disk_free_percentage = value\n end",
"def ensure_an_admin_remains\n if User.count.zero?\n raise \"Can't delete last user\"\n end\n end",
"def clear_system_defaults\n @region = nil if @region == Rudy::DEFAULT_REGION\n @zone = nil if @zone == Rudy::DEFAULT_ZONE\n @environment = nil if @environment == Rudy::DEFAULT_ENVIRONMENT\n @role = nil if @role == Rudy::DEFAULT_ROLE\n @localhost = nil if @localhost == (Rudy.sysinfo.hostname || 'localhost')\n @auto = nil if @auto == false\n end",
"def teardown\n PersistentUser.new(TEST_USER).delete\n Time.use_system_time\n clear_change_log\n end",
"def set_default_role!\n clear!\n end",
"def set_default_role!\n clear!\n end",
"def set_default_role!\n clear!\n end",
"def undo_update\n # CreateDefaultAdminUser.where(:type_code => 'very_shiny').first.delete\n end",
"def Elimina_Utente()\n Category.delete_all(user_id: self.id)\n Dish.delete_all(user_id: self.id)\n Ingredient.delete_all(user_id: self.id)\n Medium.destroy_all(user_id: self.id)\n Menu.delete_all(user_id: self.id)\n Profile.destroy_all(user_id: self.id)\n self.destroy()\n end",
"def reset_app\n if current_user.type == 'Admin'\n # Also eliminates all lesson_periods and weeks\n Form.destroy_all\n redirect_to root_url\n else\n respond_with messages: 'Only Admins may use this feature'\n end\n end",
"def reset\n # Power (Don't Override)\n self.power_class = 'Jak::Power'\n\n # What model to use for the Ability file\n self.user_ability_class = nil\n\n # Role (Override)\n self.role_class = nil\n\n # User (Override)\n self.user_class = nil\n\n # Default Jaks actions\n self.default_actions ||= %i[manage index show new create edit update destroy].freeze\n\n # Let them specify the exact column\n self.tenant_id_column = nil\n\n # Set the default invokers to an empty set\n self.invokers = Set.new\n\n # profiles\n # self.profiles = {test1: 'spec/support/dsl/test1', dev: 'spec/dummy/config/dsl/dev' }\n end",
"def ensure_if_admin_remains\n raise \"Can't delete last admin user.\" if User.count.zero?\n end",
"def ensure_if_admin_remains\n raise \"Can't delete last admin user.\" if User.count.zero?\n end",
"def ensure_an_admin_remains\n if User.count.zero?\n raise \"Can't delete last user\"\n end\n end",
"def clear_defaults( name )\n @aliases.delete( name )\n @defaults.delete( name )\n @callbacks.delete( name )\n self\n end",
"def destroy\n @org_setting.destroy\n\n head :no_content\n end",
"def destroy\n conf.delete 'dashboard'\n end",
"def destroy\n debug('Removing resource default')\n cmd = [command(:pcs), 'resource', 'defaults', (@property_hash[:name]).to_s + '=']\n self.class.run_command_in_cib(cmd, @resource[:cib])\n @property_hash.clear\n end",
"def remove\n system(\"qconf -duser #{name}\")\n end",
"def reset_integer(user_id, value)\n # non-negative values enforced by database for now\n #\n user = User.find user_id\n user.integer_value = value\n user.save\n\n user\n end",
"def clear_administrator_accounts\n Administrator.destroy_all\n end",
"def destroy\n @user = User.all.first\n if @expense.gains\n @user.current_balance = @user.current_balance - @expense.amount\n else\n @user.current_balance = @user.current_balance + @expense.amount\n end\n @user.save\n @expense.destroy\n respond_to do |format|\n format.html { redirect_to expenses_url, notice: 'Expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def clear_users\n @users = {}\n end",
"def configuration_deployed_user_count=(value)\n @configuration_deployed_user_count = value\n end",
"def delete(config, org_guid)\n token = @client.token\n\n user_setup_obj = UsersSetup.new(config)\n admin_token = user_setup_obj.get_admin_token\n\n # elevate user just to delete organization\n @client.token = admin_token\n org = @client.organization(org_guid)\n deleted = org.delete(:recursive => true)\n\n # then put token back to the initial one\n @client.token = token\n deleted\n end",
"def logout_user\n if Marty::User.current\n cookies.delete :autologin\n Marty::Token.delete_all([\"user_id = ?\", Marty::User.current.id]) unless\n Marty::Util.db_in_recovery?\n self.set_user(nil)\n end\n end",
"def clear_users\n @users = {}\n end",
"def destroy\n if params[:admin_password] == ENV[\"ADMIN_PASSWORD\"]\n @operation.destroy\n amount = User.find(operation_params[:user_id]).initAmount\n Operation.where(user_id: operation_params[:user_id]).find_each do |operation|\n amount = amount + operation.sum\n end\n User.find(operation_params[:user_id]).update_attribute(:amount, amount)\n respond_to do |format|\n format.html { redirect_to Operation, notice: \"L'opération a bien été supprimée.\" }\n format.json { head :no_content }\n end\n end\n end",
"def clear_legacy_user\n session[:user_id] = nil if session[:user_id].present?\n end",
"def down\n ActiveRecord::Base.record_timestamps = false\n\n # Parse and modify the data in memory, because the JSON to modify is stored as a string in the database\n UserExportPreset.all.in_batches do |batch|\n batch.each do |uep|\n config = JSON.parse(uep.config)\n if config.dig('data', 'patients', 'query', 'workflow') == 'global'\n config['data']['patients']['query']['workflow'] = 'all'\n uep.update!(config: config.to_json)\n end\n end\n end\n\n ActiveRecord::Base.record_timestamps = true\n end",
"def clear_user\n warden.set_user(nil) if warden.user.present?\n end",
"def destroy\n if @user.account.present? && @user.account.accountable.is_a?(Npo)\n @user.npo.npo_events.create(npo_event_status: NpoEventStatus.user_deleted, user: current_user, description: \"Deleting User: #{@user.email}\")\n end\n sso_user_setting = @user.user_settings.where(setting_type: 'sisense_sso').first\n if sso_user_setting.present?\n Rails.logger.info(\"sso_user_setting for user id: #{@user.id} - #{sso_user_setting.inspect}\")\n Producer.publish({ :message_type => Fox::QueueTypes::ANALYTICS_QUEUE, :analytics_type => SisenseUserService::DELETE_SSO_USER, :sisense_user_id => sso_user_setting.setting_value })\n end\n\n @user.destroy\n redirect_path = current_user.account.is_channel_partner? ? edit_account_settings_path : account_path\n\n respond_to do |format|\n format.html { redirect_to redirect_path }\n format.json { head :ok }\n end\n end",
"def reset_settings\n Thread.current[:shoppe_settings] = nil\n end",
"def admin_deny_user\n @user.destroy\n redirect_to admin_path, notice: \"User Denied and Account Deleted\"\n end",
"def unshare!( user )\n save if unshare( user )\n end",
"def log_out\n\t\tsuper\n\t\t@current_user = nil\n\tend",
"def unban!\n MTurkUtils.unban_user self\n end",
"def rem\n\t\t@team = Team.find(params[:id])\n\t\t@team.status_ace = false\n\t\t\n\t\tif @team.save\n\t\t\tredirect_to coord_path, notice: \"User unassigned successfully!\"\n\t\t\telse\n\t\t\tredirect_to :back, notice: \"Couldn't unassign the user from this project. Please contact system administrator.\"\n\t\tend\n\t\t\n\tend",
"def delete *args; Setting.unscoped{ super } end",
"def delete_max_priority\n loc = delete_max_locator\n loc and [loc.value, loc.priority]\n end",
"def delete_users_choices\n choices = get_choices\n choices.each do |choice|\n choice.delete\n end\n end",
"def vash_munge_value(val); self.class.munge_option_value(val); end",
"def remove_member(user)\r\n fail \"not enough admins left\" if self.is_last_admin?(user)\r\n\r\n @member_limits.delete(user.email)\r\n self.members.delete(user.email)\r\n self.admins.delete(user.email) if self.is_admin?(user)\r\n end",
"def remove_users\r\n @userAdmin.destroy\r\n @user2.destroy\r\n @user3.destroy\r\n end",
"def remove_property_from_app_user_profile_schema(id, options = {})\n post(\"/meta/schemas/apps/#{id}/default\", options)\n end",
"def clear_users_cache\n GridState.all_users = nil\n end",
"def remove_accounts_below_disk_free_percentage\n return @remove_accounts_below_disk_free_percentage\n end",
"def exit_admin_mode\n if m = Mission.where(:id => session[:last_mission_id]).first\n current_user.change_mission!(m)\n end\n redirect_to(root_url(:admin_mode => nil))\n end",
"def reset_defaults_and_overrides\n default.clear\n override.clear\n end",
"def purge_old_tokens\n auth_tokens.desc(:last_used_at).offset(20).destroy_all\n end",
"def unassign_site\n Site.current = nil\n end",
"def before_destroy_user\n indestructible_demo_user\n\n self.opml_import_job_state.opml_import_failures.delete_all\n self.opml_import_job_state.delete\n self.opml_export_job_state.delete\n self.refresh_feed_job_states.delete_all\n self.subscribe_job_states.delete_all\n\n self.folders.delete_all\n self.entry_states.delete_all\n\n # feed subscriptions are deleted WITH callbacks, to take care of the possible deletion of feeds with no more\n # subscribed users\n self.feed_subscriptions.destroy_all\n end",
"def gobierno_linea_on_uninstall_theme(theme)\n theme.get_field_groups().destroy_all\n theme.destroy\n end",
"def deregister_setting(key)\n res = @defaults.delete(key)\n\n # update cache\n @settings.delete(key)\n\n return res\n end",
"def update_user_balance\n user.decrement(:loyalty_points_balance, loyalty_points)\n user.save!\n end",
"def delete_profile\n driver.deleteOperaPrefs\n end",
"def delete_launch_configs\n auto_scaling = new_auto_scaling\n groups = auto_scaling.groups\n auto_scaling.launch_configurations.each do |config|\n if groups[config.name].nil?\n puts \"deleting asg launch configuration, #{config.name}\"\n config.delete()\n end\n end\nend",
"def disable_factoring\n self.CustomerProfileNo = 1\n self.FormProfileCustNo = 1\n self.RemittanceProfileNo = 1\n self.FactCustomerNo = nil\n end",
"def reset_session\n if Settings.test_user_dashboard.env == 'staging' && @current_user\n TestUserDashboard::UpdateUser.new(@current_user).call\n TestUserDashboard::AccountMetrics.new(@current_user).checkin\n end\n Rails.logger.info('SSO: ApplicationController#reset_session', sso_logging_info)\n\n clear_session\n super\n end",
"def clear_outdated\n redis.zremrangebyscore(REDIS_KEY, 0, score_limit)\n end",
"def clear_user_without_logout\n subject.instance_variable_set(:@current_user, nil)\n end",
"def reset_fb_posts_limit!\n @facebook_posts_limit_global = @defaults[:facebook_posts_limit]\n end",
"def unconfirm_user(user)\n confirmed_interpreter_requests.find_by(user_id: user.id).destroy\n end",
"def active_users_retention\n \n end",
"def clear_assignments\n assignments = self.assignments\n assignments.each do |a|\n a.user.assignments.delete(a)\n a.destroy\n end\n end",
"def clear\n reset_defaults\n self\n end",
"def appctrl_admin_destroy( model )\n return appctrl_not_permitted() unless ( @current_user.admin? )\n appctrl_destroy( model )\n end"
] | [
"0.6049853",
"0.5794077",
"0.55486745",
"0.55344087",
"0.5484073",
"0.53461325",
"0.53131163",
"0.52906805",
"0.52800155",
"0.52749556",
"0.52602345",
"0.52483624",
"0.5208856",
"0.517547",
"0.5168046",
"0.51489973",
"0.51465255",
"0.51444685",
"0.5130903",
"0.51286817",
"0.5127595",
"0.5116461",
"0.5110487",
"0.509523",
"0.5084692",
"0.50773686",
"0.50738627",
"0.50674796",
"0.5056255",
"0.50523114",
"0.5042765",
"0.5029503",
"0.50212115",
"0.5017891",
"0.5015435",
"0.4998112",
"0.49944377",
"0.49916118",
"0.4987611",
"0.4987611",
"0.4987611",
"0.49829325",
"0.49736017",
"0.4958344",
"0.4956787",
"0.49294966",
"0.49294966",
"0.4925238",
"0.49227569",
"0.49223393",
"0.4913584",
"0.491207",
"0.4903453",
"0.4903258",
"0.48935077",
"0.48922879",
"0.48861215",
"0.4882291",
"0.4881684",
"0.4880382",
"0.48785645",
"0.48776707",
"0.48750806",
"0.4874666",
"0.48734808",
"0.4866564",
"0.48632354",
"0.4862488",
"0.485974",
"0.485672",
"0.48410478",
"0.48410362",
"0.48397976",
"0.48338586",
"0.48335913",
"0.4827831",
"0.4825461",
"0.48145616",
"0.48136863",
"0.48135093",
"0.48122397",
"0.48109025",
"0.48050022",
"0.48025465",
"0.4798311",
"0.47955343",
"0.47940382",
"0.4790287",
"0.47902423",
"0.47827804",
"0.47788593",
"0.47745204",
"0.4767686",
"0.47643057",
"0.476292",
"0.4759321",
"0.47567093",
"0.47507393",
"0.47493333",
"0.47483313",
"0.47470343"
] | 0.0 | -1 |
Delete the user&39;s max utilization settings and revert to the organizationwide default. | def delete_routing_user_utilization_with_http_info(user_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.delete_routing_user_utilization ..."
end
# verify the required parameter 'user_id' is set
fail ArgumentError, "Missing the required parameter 'user_id' when calling RoutingApi.delete_routing_user_utilization" if user_id.nil?
# resource path
local_var_path = "/api/v2/routing/users/{userId}/utilization".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#delete_routing_user_utilization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_default_user\n @_default_user = nil\n end",
"def destroy\n @user_page_setting.destroy\n end",
"def clear_current_user; end",
"def clear_user_and_mark_purged\n random_suffix = (('0'..'9').to_a + ('a'..'z').to_a).sample(8).join\n\n self.studio_person_id = nil\n self.name = nil\n self.username = \"#{SYSTEM_DELETED_USERNAME}_#{random_suffix}\"\n self.current_sign_in_ip = nil\n self.last_sign_in_ip = nil\n self.email = ''\n self.hashed_email = ''\n self.parent_email = nil\n self.encrypted_password = nil\n self.uid = nil\n self.reset_password_token = nil\n self.full_address = nil\n self.properties = {}\n\n self.purged_at = Time.zone.now\n\n save!\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n redirect_to settings_path\n end",
"def destroy\n result = current_user.user_settings.find(params[:id])\n result.destroy\n\n respond_with result\n end",
"def clear_current_user\n User.current_user = nil\n end",
"def delete\n\t\tcurrent_user\n\t\tcurrent_user.regexpressions.destroy_all\n\t\tcurrent_user.tasks.destroy_all\n\t\tcurrent_user.clouds.destroy_all\n\t\tcurrent_user.platforms.destroy_all\n\t\tcurrent_user.demos.destroy_all\n\t\tcurrent_user.favorites.destroy_all\n\tend",
"def delate_constraint\n\t\tdelete_constraint_check(params[:user_id], params[:constraint_id])\n\t\tConstraint.delete(params[:constraint_id])\n\t\tredirect_to settings_page_path(id: params[:user_id])\n\tend",
"def reset_defaults; end",
"def reset_member_limits\r\n @member_limits.each do |user, limit|\r\n limit.reset\r\n end\r\n end",
"def removeWorkingUser user\n @workingUsers.delete user\n end",
"def reset_user\n return unless exists?(:previous_user)\n set :user, fetch(:previous_user)\n unset :previous_user\n clear_sessions\n end",
"def purge\n @user.destroy\n redirect_to admin_users_path\n end",
"def stop_organization_help\n User.find(session[:user_id]).update(:organization_help=>false)\n end",
"def remove_property_from_user_profile_schema(options = {})\n post('/meta/schemas/user/default', options)\n end",
"def undo_update\n # CreateDefaultAdminUser.where(:type_code => 'very_shiny').first.delete\n end",
"def remove\n system(\"qconf -duser #{name}\")\n end",
"def unauthorize\n Logger.info \"Cleaning up authorization for #{@registry.prefix}\"\n FileUtils.rm_rf(@gcloud_config_dir) unless @gcloud_config_dir.nil?\n end",
"def unadmin!\n metadata['admin'] = false\n save\n end",
"def userinfo_unset\n userinfo_set nil\n end",
"def remove_defaults(name)\n pre_processed_defaults.delete_one(name)\n post_processed_defaults.delete_one(name)\n end",
"def reset_user\n sitrack_user = SitrackUser.find_by_ssm_id(current_user.id, :include => :sitrack_views)\n end",
"def dp_unauthorize\n require 'dropbox_sdk'\n \n session[:dropbox_session] = nil\n @setting.dropbox_session = nil\n @setting.save!\n end",
"def clear_legacy_user\n session[:user_id] = nil if session[:user_id].present?\n end",
"def destroy\n current_user.graph.destroy(current_user.id) if current_user\n super\n end",
"def Elimina_Utente()\n Category.delete_all(user_id: self.id)\n Dish.delete_all(user_id: self.id)\n Ingredient.delete_all(user_id: self.id)\n Medium.destroy_all(user_id: self.id)\n Menu.delete_all(user_id: self.id)\n Profile.destroy_all(user_id: self.id)\n self.destroy()\n end",
"def admin_deny_user\n @user.destroy\n redirect_to admin_path, notice: \"User Denied and Account Deleted\"\n end",
"def destroy\n @user_setting.destroy\n respond_to do |format|\n format.html { redirect_to user_settings_url, notice: 'User setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def ensure_an_admin_remains\n if User.count.zero?\n raise \"Can't delete last user\"\n end\n end",
"def set_default_role!\n clear!\n end",
"def set_default_role!\n clear!\n end",
"def set_default_role!\n clear!\n end",
"def update_quota_override(users:)\n figshare = Figshare::Init.new(figshare_user: 'figshare_admin', conf_dir: \"#{__dir__}/../conf\" )\n users.each do |upi, quota|\n user_record_from_upi(figshare: figshare, upi: upi) do |u|\n # don't change, if they already have more quota than the override.\n users[upi] = u['quota'] >= quota ? nil : u['quota']\n end\n end\nend",
"def delete_user\n begin\n if @kernel_version_major < 11\n guid = @user['generateduid'][0].to_ruby\n password_hash_file = \"#{@@password_hash_dir}/#{guid}\"\n FileUtils.rm_rf(password_hash_file)\n end\n FileUtils.rm_rf(@file)\n rescue Puppet::ExecutionFailure => detail\n fail(\"Could not destroy the user account #{resource[:name]}: #{detail}\")\n end\n end",
"def teardown\n PersistentUser.new(TEST_USER).delete\n Time.use_system_time\n clear_change_log\n end",
"def clear_system_defaults\n @region = nil if @region == Rudy::DEFAULT_REGION\n @zone = nil if @zone == Rudy::DEFAULT_ZONE\n @environment = nil if @environment == Rudy::DEFAULT_ENVIRONMENT\n @role = nil if @role == Rudy::DEFAULT_ROLE\n @localhost = nil if @localhost == (Rudy.sysinfo.hostname || 'localhost')\n @auto = nil if @auto == false\n end",
"def clear_users\n @users = {}\n end",
"def delete(config, org_guid)\n token = @client.token\n\n user_setup_obj = UsersSetup.new(config)\n admin_token = user_setup_obj.get_admin_token\n\n # elevate user just to delete organization\n @client.token = admin_token\n org = @client.organization(org_guid)\n deleted = org.delete(:recursive => true)\n\n # then put token back to the initial one\n @client.token = token\n deleted\n end",
"def clear_users\n @users = {}\n end",
"def delete_profile\n driver.deleteOperaPrefs\n end",
"def ensure_an_admin_remains\n if User.count.zero?\n raise \"Can't delete last user\"\n end\n end",
"def clear_administrator_accounts\n Administrator.destroy_all\n end",
"def logout_user\n if Marty::User.current\n cookies.delete :autologin\n Marty::Token.delete_all([\"user_id = ?\", Marty::User.current.id]) unless\n Marty::Util.db_in_recovery?\n self.set_user(nil)\n end\n end",
"def remove_users\r\n @userAdmin.destroy\r\n @user2.destroy\r\n @user3.destroy\r\n end",
"def destroy\n if @user.account.present? && @user.account.accountable.is_a?(Npo)\n @user.npo.npo_events.create(npo_event_status: NpoEventStatus.user_deleted, user: current_user, description: \"Deleting User: #{@user.email}\")\n end\n sso_user_setting = @user.user_settings.where(setting_type: 'sisense_sso').first\n if sso_user_setting.present?\n Rails.logger.info(\"sso_user_setting for user id: #{@user.id} - #{sso_user_setting.inspect}\")\n Producer.publish({ :message_type => Fox::QueueTypes::ANALYTICS_QUEUE, :analytics_type => SisenseUserService::DELETE_SSO_USER, :sisense_user_id => sso_user_setting.setting_value })\n end\n\n @user.destroy\n redirect_path = current_user.account.is_channel_partner? ? edit_account_settings_path : account_path\n\n respond_to do |format|\n format.html { redirect_to redirect_path }\n format.json { head :ok }\n end\n end",
"def clear_user\n warden.set_user(nil) if warden.user.present?\n end",
"def super_active_users_retention\n \n end",
"def clear_defaults( name )\n @aliases.delete( name )\n @defaults.delete( name )\n @callbacks.delete( name )\n self\n end",
"def log_out\n\t\tsuper\n\t\t@current_user = nil\n\tend",
"def destroy\n debug('Removing resource default')\n cmd = [command(:pcs), 'resource', 'defaults', (@property_hash[:name]).to_s + '=']\n self.class.run_command_in_cib(cmd, @resource[:cib])\n @property_hash.clear\n end",
"def ensure_if_admin_remains\n raise \"Can't delete last admin user.\" if User.count.zero?\n end",
"def ensure_if_admin_remains\n raise \"Can't delete last admin user.\" if User.count.zero?\n end",
"def delete_user_account\n # delete their favorites before deleting user\n User.all.destroy(current_user.id)\n puts \"\n Your account have been removed! I will never tell, xoxo\n \"\n \n end",
"def destroy\n if params[:admin_password] == ENV[\"ADMIN_PASSWORD\"]\n @operation.destroy\n amount = User.find(operation_params[:user_id]).initAmount\n Operation.where(user_id: operation_params[:user_id]).find_each do |operation|\n amount = amount + operation.sum\n end\n User.find(operation_params[:user_id]).update_attribute(:amount, amount)\n respond_to do |format|\n format.html { redirect_to Operation, notice: \"L'opération a bien été supprimée.\" }\n format.json { head :no_content }\n end\n end\n end",
"def delete_profile\n system 'clear'\n CoffeeMan.stay_logo\n @userid.delete\n puts \"Your account has been terminated\"\n puts \"NO CAFFEINE\"\n stop_music\n abort\n end",
"def init_limit_reset_for(account)\n @task_manager.in '1d' do\n account.reset_limit\n end\n end",
"def reset_app\n if current_user.type == 'Admin'\n # Also eliminates all lesson_periods and weeks\n Form.destroy_all\n redirect_to root_url\n else\n respond_with messages: 'Only Admins may use this feature'\n end\n end",
"def destroy\n @user = User.all.first\n if @expense.gains\n @user.current_balance = @user.current_balance - @expense.amount\n else\n @user.current_balance = @user.current_balance + @expense.amount\n end\n @user.save\n @expense.destroy\n respond_to do |format|\n format.html { redirect_to expenses_url, notice: 'Expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def rem\n\t\t@team = Team.find(params[:id])\n\t\t@team.status_ace = false\n\t\t\n\t\tif @team.save\n\t\t\tredirect_to coord_path, notice: \"User unassigned successfully!\"\n\t\t\telse\n\t\t\tredirect_to :back, notice: \"Couldn't unassign the user from this project. Please contact system administrator.\"\n\t\tend\n\t\t\n\tend",
"def delete_max\n loc = delete_max_locator\n loc and loc.value\n end",
"def delete_user(iam_client)\n\n\n\t# Remove Login Profile\n\tbegin\n\t\tiam_client.delete_login_profile({\n\t\t\tuser_name: Options[:username],\n\t\t})\n\trescue Exception => e\n\t\tputs \"Login profile already gone\"\n\tend\n\n\t# Remove Access Keys\n\tbegin\n\t\tresp = iam_client.list_access_keys({\n\t\t\tuser_name: Options[:username]\n\t\t})\n\t\tresp.access_key_metadata.each do |k|\n\t\t\tresp = iam_client.delete_access_key({\n\t\t\t\tuser_name: Options[:username], # required\n\t\t\t\taccess_key_id: k.access_key_id # required\n\t\t\t})\n\t\tend\n\trescue Exception => e\n\t\tputs \"issue removing access keys: #{e.message}\"\n\tend\t\t\t\n\n\t# Remove MFA\n\tbegin \n\t\tresp = iam_client.list_mfa_devices({\n\t\t\tuser_name: Options[:username]\n\t\t})\n\n\t\t# First deactivate then remove. I don't think you can have multiple MFA, but the structure says you can\n\t\tresp.mfa_devices.each do |d|\n\t\t\tiam_client.deactivate_mfa_device({\n\t\t\t\tuser_name: Options[:username], # required\n\t\t\t\tserial_number: d.serial_number, # required\n\t\t\t})\n\t\t\tiam_client.delete_virtual_mfa_device({\n\t\t\t\tserial_number: d.serial_number, # required\n\t\t\t})\n\t\tend\n\trescue Exception => e\n\t\tputs \"issue removing MFA Devices: #{e.message}\"\n\tend\n\n\t# Remove managed policies\n\tbegin \n\t\tresp = iam_client.list_attached_user_policies({\n\t\t\tuser_name: Options[:username]\n\t\t})\n\t\tresp.attached_policies.each do |p|\n\t\t\tiam_client.detach_user_policy({\n\t\t\t\tuser_name: Options[:username], # required\n\t\t\t\tpolicy_arn: p.policy_arn, # required\n\t\t\t})\n\t\tend\n\trescue Exception => e\n\t\tputs \"issue removing inline policies: #{e.message}\"\n\tend\n\n\t# Remove inline policies\n\tbegin \n\t\tresp = iam_client.list_user_policies({\n\t\t\tuser_name: Options[:username]\n\t\t})\n\t\tresp.policy_names.each do |p|\n\t\t\tiam_client.delete_user_policy({\n\t\t\t\tuser_name: Options[:username], # required\n\t\t\t\tpolicy_name: p, # required\n\t\t\t})\n\t\tend\n\trescue Exception => e\n\t\tputs \"issue removing inline policies: #{e.message}\"\n\tend\n\n\t# Remove from Groups\n\tbegin \n\t\tresp = iam_client.list_groups_for_user({\n\t\t\tuser_name: Options[:username]\n\t\t})\n\t\tresp.groups.each do |g|\n\t\t\tiam_client.remove_user_from_group({\n\t\t\t\tgroup_name: g.group_name, # required\n\t\t\t\tuser_name: Options[:username], # required\n\t\t\t})\n\t\tend\n\trescue Exception => e\n\t\tputs \"issue removing from groups: #{e.message}\"\n\tend\n\n\t# Purge CodeCommit SSH Keys\n\tbegin\n\t\tresp = iam_client.list_ssh_public_keys({\n\t\t\tuser_name: Options[:username],\n\t\t})\n\t\tresp.ssh_public_keys.each do |key|\n\t\t\tresp = iam_client.delete_ssh_public_key({\n\t\t\t\tuser_name: Options[:username], # required\n\t\t\t\tssh_public_key_id: key.ssh_public_key_id, # required\n\t\t\t})\n\t\tend\n\trescue Exception => e\n\t\tputs \"Issue removing SSH Keys #{e.message}\"\n\tend\n\n\t# yay. Can finally do what I came for.\n\tbegin\n\t\tiam_client.delete_user({\n\t\t\tuser_name: Options[:username],\n\t\t})\n\t\texit 0\n\trescue Aws::IAM::Errors::DeleteConflict => e\n\t\tputs \"Other error deleting user: #{e.message}\"\n\t\texit 1\n\trescue Aws::IAM::Errors::NoSuchEntity =>e \n\t\tputs \"No such user #{Options[:username]} to delete.\"\n\t\texit 1\n\tend\nend",
"def delete_max\n @root = delete_max_node(@root)\n end",
"def site_on_on_uninstall_theme(theme)\n theme.get_field_groups().destroy_all\n theme.destroy\n end",
"def destroy\n set_global_setting\n @global_setting.destroy\n respond_to do |format|\n format.html { redirect_to admin_global_settings_url, notice: 'Setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def reset\n # Power (Don't Override)\n self.power_class = 'Jak::Power'\n\n # What model to use for the Ability file\n self.user_ability_class = nil\n\n # Role (Override)\n self.role_class = nil\n\n # User (Override)\n self.user_class = nil\n\n # Default Jaks actions\n self.default_actions ||= %i[manage index show new create edit update destroy].freeze\n\n # Let them specify the exact column\n self.tenant_id_column = nil\n\n # Set the default invokers to an empty set\n self.invokers = Set.new\n\n # profiles\n # self.profiles = {test1: 'spec/support/dsl/test1', dev: 'spec/dummy/config/dsl/dev' }\n end",
"def reset_current_user(user_x)\n user = User === user_x ? user_x : User.find(user_x)\n unless user.nil? || current_user_id == user.id\n clear_auth_cookie\n reset_user_session\n set_current_user(user)\n end \n end",
"def remove_accounts_below_disk_free_percentage=(value)\n @remove_accounts_below_disk_free_percentage = value\n end",
"def remove_user(user_id)\n user = User.find(user_id)\n unless user.blank?\n Consumption.where(user_id: user_id, action_status: Consumption::ActionStatusPending).destroy_all#.delete_all\n Arrangement.where(user_id: user_id, action_status: Consumption::ActionStatusPending).destroy_all#.delete_all\n user.email = string_for_user_value(user.email)\n user.company_unique_entity_number = string_for_user_value(user.company_unique_entity_number)\n user.company_license_number = string_for_user_value(user.company_license_number)\n user.is_deleted = 1\n user.approval_status = User::ApprovalStatusRemoved\n user.deleted_at = DateTime.current\n user.save!\n end\n user\n end",
"def destroy\n @org_setting.destroy\n\n head :no_content\n end",
"def decrement_of_health(user)\n -((user.max_health / 10) + 5 * (4 - difficulty)).round\n end",
"def reset_integer(user_id, value)\n # non-negative values enforced by database for now\n #\n user = User.find user_id\n user.integer_value = value\n user.save\n\n user\n end",
"def delete_users_choices\n choices = get_choices\n choices.each do |choice|\n choice.delete\n end\n end",
"def destroy\n current_user.destroy\n redirect_to site_root_url\n end",
"def abandon!\n @user = nil\n session.delete\n end",
"def abandon!\n @user = nil\n session.delete\n end",
"def destroy\n @current_user.destroy\n end",
"def remove_readonly_user(opts)\n opts = check_params(opts,[:ro_user_info])\n super(opts)\n end",
"def abandon!\n @user = nil\n session.clear\n end",
"def unset_limits(options = {})\r\n mem_fix = 1\r\n @@resource_limits = {}\r\n if options[:unset_env]\r\n ENV[\"MAGICK_AREA_LIMIT\"]=nil\r\n ENV[\"MAGICK_MAP_LIMIT\"]=nil\r\n ENV[\"MAGICK_MEMORY_LIMIT\"]=nil\r\n ENV[\"MAGICK_DISK_LIMIT\"]=nil\r\n end\r\n end",
"def unban!\n MTurkUtils.unban_user self\n end",
"def reset_user\n user_id = params.require(:user_id)\n\n user = User.find_by(id: user_id)\n raise Discourse::NotFound if user.blank?\n\n guardian.ensure_can_edit!(user)\n\n if params[:everything] == 'true'\n TopicAllowedUser\n .joins(topic: :_custom_fields)\n .where(topic_custom_fields: { name: DiscourseEncrypt::TITLE_CUSTOM_FIELD })\n .where(topic_allowed_users: { user_id: user.id })\n .delete_all\n\n PluginStoreRow\n .where(plugin_name: 'discourse-encrypt')\n .where(\"key LIKE 'key_%_' || ?\", user.id)\n .delete_all\n end\n\n # Delete encryption keys.\n user.custom_fields.delete(DiscourseEncrypt::PUBLIC_CUSTOM_FIELD)\n user.custom_fields.delete(DiscourseEncrypt::PRIVATE_CUSTOM_FIELD)\n user.save_custom_fields\n\n render json: success_json\n end",
"def before_destroy_user\n indestructible_demo_user\n\n self.opml_import_job_state.opml_import_failures.delete_all\n self.opml_import_job_state.delete\n self.opml_export_job_state.delete\n self.refresh_feed_job_states.delete_all\n self.subscribe_job_states.delete_all\n\n self.folders.delete_all\n self.entry_states.delete_all\n\n # feed subscriptions are deleted WITH callbacks, to take care of the possible deletion of feeds with no more\n # subscribed users\n self.feed_subscriptions.destroy_all\n end",
"def clear\r\n System.instance.search.unregister(self)\r\n\r\n DAOItem.instance.fetch_items_of(self.id).each { |e| e.clear }\r\n DAOAccount.instance.remove_account(self.id)\r\n\r\n unless (self.avatar == \"/images/organisations/default_avatar.png\")\r\n File.delete(\"#{self.avatar.sub(\"/images\", \"./public/images\")}\")\r\n end\r\n end",
"def clear_users_cache\n GridState.all_users = nil\n end",
"def teardown\n @user = nil\n end",
"def purge_old_tokens\n auth_tokens.desc(:last_used_at).offset(20).destroy_all\n end",
"def remove_remaining_notification_settings\n source_project.notification_settings.destroy_all # rubocop: disable DestroyAll\n end",
"def reset\n \t\t@admin = current_admin\n\tend",
"def remove_accounts_below_disk_free_percentage\n return @remove_accounts_below_disk_free_percentage\n end",
"def destroy\n @user_pref = UserPref.find(params[:id])\n @user_pref.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_prefs_url) }\n format.xml { head :ok }\n end\n end",
"def untrust!\n MTurkUtils.untrust_user self\n end",
"def destroy\n conf.delete 'dashboard'\n end",
"def destroy\n\t\tsms_user_alert(\"User deleted: \")\n\t\t@user.destroy\n\t\tsession[:user_id] = nil\n\t\tredirect_to root_path, :notice => \"Profile deleted\"\n\tend",
"def delete_user(user)\n res1 = remove_filtered_grouping_policy(0, user)\n res2 = remove_filtered_policy(0, user)\n res1 || res2\n end",
"def off_org_users\n \n end",
"def destroy\n\t\t@user.delete\n\tend",
"def reset_account\n @current_account = @options[:brightbox_account]\n end",
"def snmp_user_destroy(opts = {})\n group = [*opts[:roles]].first\n version = opts[:version].to_s.sub('v2', 'v2c')\n cmd = \"no snmp-server user #{opts[:name]} #{group} #{version}\"\n configure cmd\n {}\n end",
"def clean_bootstrap\n delete_acls\n\n OpenNebula::User.new_with_id(@vdc.VDCADMIN_ID, @client).delete\n OpenNebula::Group.new_with_id(@vdc.GROUP_ID, @client).delete\n end",
"def clear_user_without_logout\n subject.instance_variable_set(:@current_user, nil)\n end"
] | [
"0.6358747",
"0.59112644",
"0.58927345",
"0.5701909",
"0.5687984",
"0.5594676",
"0.5546773",
"0.5545212",
"0.5491082",
"0.54698616",
"0.5453417",
"0.54111135",
"0.5390647",
"0.53800553",
"0.5379309",
"0.5363997",
"0.5345485",
"0.5336234",
"0.5331013",
"0.52898973",
"0.528878",
"0.52826476",
"0.52712667",
"0.5265071",
"0.52566886",
"0.5241215",
"0.52315986",
"0.52301604",
"0.5229927",
"0.5224439",
"0.5223423",
"0.5223423",
"0.5223423",
"0.5206018",
"0.5203679",
"0.5192771",
"0.5182638",
"0.51696515",
"0.51688313",
"0.51625127",
"0.51544964",
"0.5145235",
"0.51417166",
"0.5128756",
"0.5127826",
"0.5126527",
"0.5118026",
"0.51091725",
"0.51057726",
"0.51051587",
"0.5100603",
"0.50966966",
"0.50966966",
"0.5095881",
"0.509544",
"0.5095095",
"0.509241",
"0.5089731",
"0.5076179",
"0.50744843",
"0.5068638",
"0.5066928",
"0.50640917",
"0.50630647",
"0.5062034",
"0.50615394",
"0.5059959",
"0.5052841",
"0.5041729",
"0.50399697",
"0.50396997",
"0.50355065",
"0.50347364",
"0.5033582",
"0.5010287",
"0.5010287",
"0.50076735",
"0.50053734",
"0.50046927",
"0.50014603",
"0.49783853",
"0.4976397",
"0.49756488",
"0.4974774",
"0.4973722",
"0.49719912",
"0.49715188",
"0.49651146",
"0.49643356",
"0.4961815",
"0.49608976",
"0.49600795",
"0.49542886",
"0.49539307",
"0.49538454",
"0.49528518",
"0.49485067",
"0.49485064",
"0.49483922",
"0.49478993",
"0.4947117"
] | 0.0 | -1 |
Delete the organizationwide max utilization settings and revert to the system default. | def delete_routing_utilization(opts = {})
delete_routing_utilization_with_http_info(opts)
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unset_limits(options = {})\r\n mem_fix = 1\r\n @@resource_limits = {}\r\n if options[:unset_env]\r\n ENV[\"MAGICK_AREA_LIMIT\"]=nil\r\n ENV[\"MAGICK_MAP_LIMIT\"]=nil\r\n ENV[\"MAGICK_MEMORY_LIMIT\"]=nil\r\n ENV[\"MAGICK_DISK_LIMIT\"]=nil\r\n end\r\n end",
"def clear_system_defaults\n @region = nil if @region == Rudy::DEFAULT_REGION\n @zone = nil if @zone == Rudy::DEFAULT_ZONE\n @environment = nil if @environment == Rudy::DEFAULT_ENVIRONMENT\n @role = nil if @role == Rudy::DEFAULT_ROLE\n @localhost = nil if @localhost == (Rudy.sysinfo.hostname || 'localhost')\n @auto = nil if @auto == false\n end",
"def reset_defaults; end",
"def reset_settings\n Thread.current[:shoppe_settings] = nil\n end",
"def destroy\n @org_setting.destroy\n\n head :no_content\n end",
"def remove_remaining_notification_settings\n source_project.notification_settings.destroy_all # rubocop: disable DestroyAll\n end",
"def destroy\n @user_page_setting.destroy\n end",
"def destroy\n set_global_setting\n @global_setting.destroy\n respond_to do |format|\n format.html { redirect_to admin_global_settings_url, notice: 'Setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_launch_configs\n auto_scaling = new_auto_scaling\n groups = auto_scaling.groups\n auto_scaling.launch_configurations.each do |config|\n if groups[config.name].nil?\n puts \"deleting asg launch configuration, #{config.name}\"\n config.delete()\n end\n end\nend",
"def delete_max\n @root = delete_max_node(@root)\n end",
"def remove_defaults(name)\n pre_processed_defaults.delete_one(name)\n post_processed_defaults.delete_one(name)\n end",
"def config_delete(name)\n Bundler.settings.set_local(name, nil)\n Bundler.settings.set_global(name, nil)\n end",
"def destroy\n debug('Removing resource default')\n cmd = [command(:pcs), 'resource', 'defaults', (@property_hash[:name]).to_s + '=']\n self.class.run_command_in_cib(cmd, @resource[:cib])\n @property_hash.clear\n end",
"def delete_max\n loc = delete_max_locator\n loc and loc.value\n end",
"def clear_default_user\n @_default_user = nil\n end",
"def unauthorize\n Logger.info \"Cleaning up authorization for #{@registry.prefix}\"\n FileUtils.rm_rf(@gcloud_config_dir) unless @gcloud_config_dir.nil?\n end",
"def clear\n reset_defaults\n self\n end",
"def init_limit_reset_for(account)\n @task_manager.in '1d' do\n account.reset_limit\n end\n end",
"def clear_page_settings\n shaz_nolock_clear_page_settings\n @nolock = false\n end",
"def destroy\n conf.delete 'dashboard'\n end",
"def fuel_settings_with_renew\n @fuel_settings = nil\n fuel_settings\n end",
"def dp_unauthorize\n require 'dropbox_sdk'\n \n session[:dropbox_session] = nil\n @setting.dropbox_session = nil\n @setting.save!\n end",
"def reset\n (@settings||{}).each do |name,instance| \n remove_setter(name)\n remove_getter(name)\n remove_boolean_getter(name)\n instance.destroy\n end\n @settings = Hash.new\n end",
"def reset_global_statistics\n super\n end",
"def reset_defaults_and_overrides\n default.clear\n override.clear\n end",
"def down\n ActiveRecord::Base.record_timestamps = false\n\n # Parse and modify the data in memory, because the JSON to modify is stored as a string in the database\n UserExportPreset.all.in_batches do |batch|\n batch.each do |uep|\n config = JSON.parse(uep.config)\n if config.dig('data', 'patients', 'query', 'workflow') == 'global'\n config['data']['patients']['query']['workflow'] = 'all'\n uep.update!(config: config.to_json)\n end\n end\n end\n\n ActiveRecord::Base.record_timestamps = true\n end",
"def clear!\n defined_settings.each {|setting| instance_variable_set(\"@#{setting}\", nil)}\n @storage_adapters = []\n @cached_paths = {}\n end",
"def delate_constraint\n\t\tdelete_constraint_check(params[:user_id], params[:constraint_id])\n\t\tConstraint.delete(params[:constraint_id])\n\t\tredirect_to settings_page_path(id: params[:user_id])\n\tend",
"def reset_member_limits\r\n @member_limits.each do |user, limit|\r\n limit.reset\r\n end\r\n end",
"def reset_gtm_global_statistics\n super\n end",
"def reset_default_bandwidth\n @bandwidth = OneviewSDK::ConnectionTemplate.get_default(@client)['bandwidth']\n update_connection_template\n end",
"def franchise_resetter\n ## Step1: DELETES FRANCHISE DATA IN CORES\n # cores = Core.all[0..1]\n cores = Core.all\n counter_reset = 1\n cores.each do |core|\n core.update_attributes(sfdc_franchise: nil, sfdc_franch_cons: nil, sfdc_franch_cat: nil)\n puts \"Resetting Franchise Values: #{counter_reset}\"\n counter_reset +=1\n end\n end",
"def reset_config\n config.reset_to_defaults\n end",
"def reset\n set(default_preferences)\n end",
"def clear_defaults( name )\n @aliases.delete( name )\n @defaults.delete( name )\n @callbacks.delete( name )\n self\n end",
"def reset\n # Power (Don't Override)\n self.power_class = 'Jak::Power'\n\n # What model to use for the Ability file\n self.user_ability_class = nil\n\n # Role (Override)\n self.role_class = nil\n\n # User (Override)\n self.user_class = nil\n\n # Default Jaks actions\n self.default_actions ||= %i[manage index show new create edit update destroy].freeze\n\n # Let them specify the exact column\n self.tenant_id_column = nil\n\n # Set the default invokers to an empty set\n self.invokers = Set.new\n\n # profiles\n # self.profiles = {test1: 'spec/support/dsl/test1', dev: 'spec/dummy/config/dsl/dev' }\n end",
"def reset\n @config = nil\n end",
"def clear(config)\n Array(config).each do |setting|\n delete_setting setting\n end\n end",
"def deregister_setting(key)\n res = @defaults.delete(key)\n\n # update cache\n @settings.delete(key)\n\n return res\n end",
"def clear\n\t\t\t@store.transaction { @store.delete(:custom_numerals); @store.commit}\n\t\t\tputs \"User defined Roman Numerals cleared.\"\n\t\t\tconfig(true)\t\t\t\n\t\tend",
"def set_defaults\n self.bucket_agency_allocations = []\n end",
"def remove_default_tool\n \n index_node = 0\n @site_data[\"site\"][\"node\"].each do | node |\n if node[\"node_name\"] =~ /^default.*/\n index_tool = 0\n node[\"tools\"].each do | tools |\n if tools[\"name\"] == @tool_name\n @site_data[\"site\"][\"node\"][index_node][\"tools\"].delete_at(index_tool)\n end\n index_tool = index_tool + 1\n end\n end\n index_node = index_node + 1\n end\n @site_data = remove_empty_default_nodes(@site_data)\n end",
"def reset_default\n \n w=WinReg.new(@file)\n w.debug=@debug\n FOLDER_DEFAULTS.each do |key|\n w.write_key(FOLDERS_BASE+'\\\\'+key[:name],PROFILE_BASE+'\\\\'+key[:dir])\n end\n end",
"def delete_old_asg config, launch_config_name\n auto_scaling = new_auto_scaling\n auto_scaling.groups.each do |group|\n server = tag_value(group.tags, \"server\")\n if server != config[\"server\"]\n next \n end\n\n env = tag_value(group.tags, \"env\")\n if env != config[\"env\"]\n next \n end\n\n if group.name != launch_config_name.name\n puts \"deleting instance group, #{group.name} => #{launch_config_name.name}\"\n delete_asg group.name\n end\n end\nend",
"def unassign_site\n Site.current = nil\n end",
"def destroy\n @configattribincl.destroy\n respond_to do |format|\n format.html { redirect_to configattribs_path, notice: 'Configattribincl Threshold is reset to default.' }\n format.json { head :no_content }\n end\n end",
"def site_on_on_uninstall_theme(theme)\n theme.get_field_groups().destroy_all\n theme.destroy\n end",
"def delete_asg name\n auto_scaling = new_auto_scaling\n groups = auto_scaling.groups\n raise \"unable to delete asg, #{name}. asg not found!\" if groups[name].nil? \n\n asg = groups[name]\n\n puts \"deleting asg, #{asg.name}\"\n asg.delete({:force => true})\n delete_launch_configs\nend",
"def reset\n reset_config\n reset_driver\n end",
"def reset_allocation_bonus!\n self.allocation_bonus = 0\n save(validate: false)\n end",
"def reset_usage!\n @usage.reset!\n end",
"def delete_max_locator\n return nil if empty?\n use_max\n loc = mode_call(:find_max_loc)\n @heapsize = mode_call(:delete_loc, loc)\n loc\n end",
"def delete *args; Setting.unscoped{ super } end",
"def reset\n @max_color_distance = @color_distance_limit ? 0 : nil\n @max_shift_distance = @shift_distance_limit ? 0 : nil\n end",
"def remove_hourly_cost_for(os_family)\n incarnation = flavor_os_families.find_by(os_family: os_family)\n incarnation && incarnation.destroy # nil if incarnation.blank?\n end",
"def delete_max_priority\n loc = delete_max_locator\n loc and [loc.value, loc.priority]\n end",
"def process_reset\n node.reset_defaults_and_overrides\n check_for_state_change(\"Default and Override Reset\")\n end",
"def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.reset_attribute(opt) }\n end",
"def prefs_clear_cache\n # clear the theme cache\n FileUtils.rm_r \"#{RAILS_ROOT}/public/themes\", :force => true\n # unset the theme\n @@gm_curr_theme = nil\n # unset prefs hash\n Preference.clear_hash\n # that's it!\n flash[:notice] = '<b>Success:</b> Theme cache was cleared.'\n # redirect back\n redirect_to Site.full_url + '/admin/prefs'\n end",
"def clear_device_metrics_override\n {\n method: \"Page.clearDeviceMetricsOverride\"\n }\n end",
"def cleanup\n case SubutaiConfig.provider\n when :hyper_v\n SubutaiDisk.hyperv_remove_disk\n end\n\n # cleanup virtual disks\n disks = SubutaiConfig.get(:_DISK_PATHES)\n unless disks.nil?\n disks.keys.each do |key|\n if File.exist?(disks[key])\n begin\n File.delete(disks[key])\n puts \"==> default: Deleted file: #{disks[key]}\"\n rescue Errno::EACCES\n puts \"==> default: (Permission denied) Failed delete file: #{disks[key]}\"\n end\n end\n end\n end\n\n # cleanup generated files\n if File.exist?(SubutaiConfig::GENERATED_FILE)\n begin\n File.delete SubutaiConfig::GENERATED_FILE\n puts \"==> default: Deleted file: #{SubutaiConfig::GENERATED_FILE}\"\n rescue Errno::EACCES\n puts \"==> default: (Permission denied) Failed delete file: #{SubutaiConfig::GENERATED_FILE}\"\n end\n end\n end",
"def clean_up\n #Delete every thing but the most recent config[:screenshot_max_keep] screenshots\n max_screenshots = self.config[:screenshot_max_keep] || 5\n #Delete the last created one while they count is more then the max\n while self.admo_screenshots.count > max_screenshots\n self.admo_screenshots.order_by('created_at asc').first.destroy\n end\n end",
"def reset_configuration\n @configuration = nil\n end",
"def reset\n @cur_energy = @max_energy\n end",
"def delete_all_configurations\n super\n end",
"def delete_all_configurations\n super\n end",
"def vash_munge_value(val); self.class.munge_option_value(val); end",
"def destroy\n @stage_common_option.destroy\n end",
"def reset\n @options = Marshal.load(@default)\nend",
"def clear_damage_values\n mrts_conditional_drops_clear_damage_values\n @element = 0\n end",
"def unassign_resource_from_theme!( resource )\n resource_key = get_resource_class_key(resource.class)\n self.assigned_resource_ids.each_pair{|page_layout_id, resourcs|\n if resourcs.key? resource_key\n resourcs[resource_key].each_with_index{|resource_id,idx|\n if resource_id == resource.id\n assigned_resource_ids[page_layout_id][resource_key][idx] = 0\n end\n }\n end\n }\n self.save! \n end",
"def destroy\n @global_account_setting = GlobalAccountSetting.find(params[:id])\n @global_account_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(global_account_settings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @adm_sets.destroy\n respond_to do |format|\n format.html { redirect_to admin_settings_url, notice: 'Setting destroyed.' }\n format.json { head :no_content }\n end\n end",
"def reset_storage_options!\n self.storage_options = storage_options_defaults.dup\n end",
"def reset_config\n\t\t\t@config = {}\n\t\tend",
"def clear_administrator_accounts\n Administrator.destroy_all\n end",
"def undefine_config(tool)\n @setup[tool.to_s] = false\n end",
"def clear_outdated\n redis.zremrangebyscore(REDIS_KEY, 0, score_limit)\n end",
"def dec_usage\n @mutex.synchronize { @usage_count -= 1 }\n end",
"def erase_old_data()\n Djinn.log_run(\"rm -rf /tmp/h*\")\n Djinn.log_run(\"rm -f ~/.appscale_cookies\")\n Djinn.log_run(\"rm -f #{APPSCALE_HOME}/.appscale/status-*\")\n Djinn.log_run(\"rm -f #{APPSCALE_HOME}/.appscale/database_info\")\n\n Nginx.clear_sites_enabled\n HAProxy.clear_sites_enabled\n Djinn.log_run(\"echo '' > /root/.ssh/known_hosts\") # empty it out but leave the file there\n CronHelper.clear_crontab\n end",
"def reset_themes\n @theme_options = {}\n end",
"def clear_device_metrics_override\n {\n method: \"Emulation.clearDeviceMetricsOverride\"\n }\n end",
"def delete_configuration\n super\n end",
"def delete_configuration\n super\n end",
"def reset\n \t\t@admin = current_admin\n\tend",
"def reset\n self.time_step = DEFAULT_TIME_STEP\n self.availiable_days = DEFAULT_AVAILIABLE_DAYS\n self.availiable_steps = DEFAULT_AVAILIABLE_STEPS\n self.steps_day_shift = DEFAULT_STEPS_DAY_SHIFT\n end",
"def deactivate\n deactivate_sandbox if needs_sandbox?\n remove_node\n save_config\n end",
"def delete_all_modes\n @_modes = nil\n end",
"def delete_max\n result = nil\n if @root\n @root, result = delete_max_recursive(@root)\n @root.color = :black if @root\n end\n result\n end",
"def reset_all_statistics\n super\n end",
"def destroy\n @global_page_setting = GlobalPageSetting.find(params[:id])\n @global_page_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to global_page_settings_url }\n format.json { head :no_content }\n end\n end",
"def sweep_max_reward_price_cache\n @max_reward_price_cache = nil\n end",
"def unadmin!\n metadata['admin'] = false\n save\n end",
"def reset!\n logs.remove\n features.remove\n users.remove\n end",
"def remove_config(name)\n variables[name] = nil\n end",
"def reset!\n tap { set_defaults }\n end",
"def unlock\n request_body = {\"index\" => {\"blocks\" => {\"write\" => false}}}.to_json\n @client.put(\"_settings\", request_body, content_type: :json)\n end",
"def delete_all\n @configuration = nil\n end",
"def delete_all\n @configuration = nil\n end",
"def remove_accounts_below_disk_free_percentage=(value)\n @remove_accounts_below_disk_free_percentage = value\n end",
"def clear_gemed_theme_instances\n @@gemed_themes = nil\n end"
] | [
"0.57343435",
"0.56966364",
"0.5666205",
"0.5529655",
"0.5471934",
"0.54717773",
"0.5459326",
"0.5430016",
"0.5400638",
"0.53749424",
"0.5359212",
"0.53408",
"0.5300837",
"0.5300321",
"0.5291792",
"0.52771837",
"0.5207832",
"0.5204624",
"0.5196764",
"0.51963335",
"0.5181743",
"0.5170573",
"0.5163748",
"0.5157476",
"0.5126596",
"0.5123815",
"0.5121707",
"0.5079772",
"0.5076132",
"0.50734633",
"0.50723004",
"0.50635403",
"0.505671",
"0.50493586",
"0.5044562",
"0.5043389",
"0.50372475",
"0.5029731",
"0.5027931",
"0.50148576",
"0.500685",
"0.5003813",
"0.49980527",
"0.49979824",
"0.49968103",
"0.4980044",
"0.49775887",
"0.49775544",
"0.49703145",
"0.4968593",
"0.49629527",
"0.49578905",
"0.4956956",
"0.49567962",
"0.49551374",
"0.49514377",
"0.4949833",
"0.4944905",
"0.49380258",
"0.49332768",
"0.49222237",
"0.49212676",
"0.49192753",
"0.49173376",
"0.49155772",
"0.49155772",
"0.4911315",
"0.49090153",
"0.48983774",
"0.4897923",
"0.48966125",
"0.48950675",
"0.48924056",
"0.48910517",
"0.48804247",
"0.48788774",
"0.4871109",
"0.486964",
"0.48647514",
"0.48642325",
"0.48620582",
"0.4858864",
"0.4855729",
"0.4855729",
"0.48531374",
"0.4849373",
"0.48492652",
"0.48460698",
"0.48458922",
"0.48431906",
"0.4838669",
"0.4826864",
"0.4825436",
"0.48180914",
"0.4814317",
"0.48086795",
"0.48086232",
"0.4807275",
"0.4807275",
"0.4804793",
"0.4795664"
] | 0.0 | -1 |
Delete the organizationwide max utilization settings and revert to the system default. | def delete_routing_utilization_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.delete_routing_utilization ..."
end
# resource path
local_var_path = "/api/v2/routing/utilization".sub('{format}','json')
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#delete_routing_utilization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unset_limits(options = {})\r\n mem_fix = 1\r\n @@resource_limits = {}\r\n if options[:unset_env]\r\n ENV[\"MAGICK_AREA_LIMIT\"]=nil\r\n ENV[\"MAGICK_MAP_LIMIT\"]=nil\r\n ENV[\"MAGICK_MEMORY_LIMIT\"]=nil\r\n ENV[\"MAGICK_DISK_LIMIT\"]=nil\r\n end\r\n end",
"def clear_system_defaults\n @region = nil if @region == Rudy::DEFAULT_REGION\n @zone = nil if @zone == Rudy::DEFAULT_ZONE\n @environment = nil if @environment == Rudy::DEFAULT_ENVIRONMENT\n @role = nil if @role == Rudy::DEFAULT_ROLE\n @localhost = nil if @localhost == (Rudy.sysinfo.hostname || 'localhost')\n @auto = nil if @auto == false\n end",
"def reset_defaults; end",
"def reset_settings\n Thread.current[:shoppe_settings] = nil\n end",
"def destroy\n @org_setting.destroy\n\n head :no_content\n end",
"def remove_remaining_notification_settings\n source_project.notification_settings.destroy_all # rubocop: disable DestroyAll\n end",
"def destroy\n @user_page_setting.destroy\n end",
"def destroy\n set_global_setting\n @global_setting.destroy\n respond_to do |format|\n format.html { redirect_to admin_global_settings_url, notice: 'Setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_launch_configs\n auto_scaling = new_auto_scaling\n groups = auto_scaling.groups\n auto_scaling.launch_configurations.each do |config|\n if groups[config.name].nil?\n puts \"deleting asg launch configuration, #{config.name}\"\n config.delete()\n end\n end\nend",
"def delete_max\n @root = delete_max_node(@root)\n end",
"def remove_defaults(name)\n pre_processed_defaults.delete_one(name)\n post_processed_defaults.delete_one(name)\n end",
"def config_delete(name)\n Bundler.settings.set_local(name, nil)\n Bundler.settings.set_global(name, nil)\n end",
"def destroy\n debug('Removing resource default')\n cmd = [command(:pcs), 'resource', 'defaults', (@property_hash[:name]).to_s + '=']\n self.class.run_command_in_cib(cmd, @resource[:cib])\n @property_hash.clear\n end",
"def delete_max\n loc = delete_max_locator\n loc and loc.value\n end",
"def clear_default_user\n @_default_user = nil\n end",
"def unauthorize\n Logger.info \"Cleaning up authorization for #{@registry.prefix}\"\n FileUtils.rm_rf(@gcloud_config_dir) unless @gcloud_config_dir.nil?\n end",
"def clear\n reset_defaults\n self\n end",
"def init_limit_reset_for(account)\n @task_manager.in '1d' do\n account.reset_limit\n end\n end",
"def clear_page_settings\n shaz_nolock_clear_page_settings\n @nolock = false\n end",
"def destroy\n conf.delete 'dashboard'\n end",
"def fuel_settings_with_renew\n @fuel_settings = nil\n fuel_settings\n end",
"def dp_unauthorize\n require 'dropbox_sdk'\n \n session[:dropbox_session] = nil\n @setting.dropbox_session = nil\n @setting.save!\n end",
"def reset\n (@settings||{}).each do |name,instance| \n remove_setter(name)\n remove_getter(name)\n remove_boolean_getter(name)\n instance.destroy\n end\n @settings = Hash.new\n end",
"def reset_global_statistics\n super\n end",
"def reset_defaults_and_overrides\n default.clear\n override.clear\n end",
"def down\n ActiveRecord::Base.record_timestamps = false\n\n # Parse and modify the data in memory, because the JSON to modify is stored as a string in the database\n UserExportPreset.all.in_batches do |batch|\n batch.each do |uep|\n config = JSON.parse(uep.config)\n if config.dig('data', 'patients', 'query', 'workflow') == 'global'\n config['data']['patients']['query']['workflow'] = 'all'\n uep.update!(config: config.to_json)\n end\n end\n end\n\n ActiveRecord::Base.record_timestamps = true\n end",
"def clear!\n defined_settings.each {|setting| instance_variable_set(\"@#{setting}\", nil)}\n @storage_adapters = []\n @cached_paths = {}\n end",
"def delate_constraint\n\t\tdelete_constraint_check(params[:user_id], params[:constraint_id])\n\t\tConstraint.delete(params[:constraint_id])\n\t\tredirect_to settings_page_path(id: params[:user_id])\n\tend",
"def reset_member_limits\r\n @member_limits.each do |user, limit|\r\n limit.reset\r\n end\r\n end",
"def reset_gtm_global_statistics\n super\n end",
"def reset_default_bandwidth\n @bandwidth = OneviewSDK::ConnectionTemplate.get_default(@client)['bandwidth']\n update_connection_template\n end",
"def franchise_resetter\n ## Step1: DELETES FRANCHISE DATA IN CORES\n # cores = Core.all[0..1]\n cores = Core.all\n counter_reset = 1\n cores.each do |core|\n core.update_attributes(sfdc_franchise: nil, sfdc_franch_cons: nil, sfdc_franch_cat: nil)\n puts \"Resetting Franchise Values: #{counter_reset}\"\n counter_reset +=1\n end\n end",
"def reset_config\n config.reset_to_defaults\n end",
"def reset\n set(default_preferences)\n end",
"def reset\n # Power (Don't Override)\n self.power_class = 'Jak::Power'\n\n # What model to use for the Ability file\n self.user_ability_class = nil\n\n # Role (Override)\n self.role_class = nil\n\n # User (Override)\n self.user_class = nil\n\n # Default Jaks actions\n self.default_actions ||= %i[manage index show new create edit update destroy].freeze\n\n # Let them specify the exact column\n self.tenant_id_column = nil\n\n # Set the default invokers to an empty set\n self.invokers = Set.new\n\n # profiles\n # self.profiles = {test1: 'spec/support/dsl/test1', dev: 'spec/dummy/config/dsl/dev' }\n end",
"def clear_defaults( name )\n @aliases.delete( name )\n @defaults.delete( name )\n @callbacks.delete( name )\n self\n end",
"def reset\n @config = nil\n end",
"def clear(config)\n Array(config).each do |setting|\n delete_setting setting\n end\n end",
"def deregister_setting(key)\n res = @defaults.delete(key)\n\n # update cache\n @settings.delete(key)\n\n return res\n end",
"def clear\n\t\t\t@store.transaction { @store.delete(:custom_numerals); @store.commit}\n\t\t\tputs \"User defined Roman Numerals cleared.\"\n\t\t\tconfig(true)\t\t\t\n\t\tend",
"def set_defaults\n self.bucket_agency_allocations = []\n end",
"def remove_default_tool\n \n index_node = 0\n @site_data[\"site\"][\"node\"].each do | node |\n if node[\"node_name\"] =~ /^default.*/\n index_tool = 0\n node[\"tools\"].each do | tools |\n if tools[\"name\"] == @tool_name\n @site_data[\"site\"][\"node\"][index_node][\"tools\"].delete_at(index_tool)\n end\n index_tool = index_tool + 1\n end\n end\n index_node = index_node + 1\n end\n @site_data = remove_empty_default_nodes(@site_data)\n end",
"def reset_default\n \n w=WinReg.new(@file)\n w.debug=@debug\n FOLDER_DEFAULTS.each do |key|\n w.write_key(FOLDERS_BASE+'\\\\'+key[:name],PROFILE_BASE+'\\\\'+key[:dir])\n end\n end",
"def delete_old_asg config, launch_config_name\n auto_scaling = new_auto_scaling\n auto_scaling.groups.each do |group|\n server = tag_value(group.tags, \"server\")\n if server != config[\"server\"]\n next \n end\n\n env = tag_value(group.tags, \"env\")\n if env != config[\"env\"]\n next \n end\n\n if group.name != launch_config_name.name\n puts \"deleting instance group, #{group.name} => #{launch_config_name.name}\"\n delete_asg group.name\n end\n end\nend",
"def unassign_site\n Site.current = nil\n end",
"def destroy\n @configattribincl.destroy\n respond_to do |format|\n format.html { redirect_to configattribs_path, notice: 'Configattribincl Threshold is reset to default.' }\n format.json { head :no_content }\n end\n end",
"def site_on_on_uninstall_theme(theme)\n theme.get_field_groups().destroy_all\n theme.destroy\n end",
"def delete_asg name\n auto_scaling = new_auto_scaling\n groups = auto_scaling.groups\n raise \"unable to delete asg, #{name}. asg not found!\" if groups[name].nil? \n\n asg = groups[name]\n\n puts \"deleting asg, #{asg.name}\"\n asg.delete({:force => true})\n delete_launch_configs\nend",
"def reset\n reset_config\n reset_driver\n end",
"def reset_allocation_bonus!\n self.allocation_bonus = 0\n save(validate: false)\n end",
"def reset_usage!\n @usage.reset!\n end",
"def delete *args; Setting.unscoped{ super } end",
"def reset\n @max_color_distance = @color_distance_limit ? 0 : nil\n @max_shift_distance = @shift_distance_limit ? 0 : nil\n end",
"def delete_max_locator\n return nil if empty?\n use_max\n loc = mode_call(:find_max_loc)\n @heapsize = mode_call(:delete_loc, loc)\n loc\n end",
"def remove_hourly_cost_for(os_family)\n incarnation = flavor_os_families.find_by(os_family: os_family)\n incarnation && incarnation.destroy # nil if incarnation.blank?\n end",
"def process_reset\n node.reset_defaults_and_overrides\n check_for_state_change(\"Default and Override Reset\")\n end",
"def delete_max_priority\n loc = delete_max_locator\n loc and [loc.value, loc.priority]\n end",
"def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.reset_attribute(opt) }\n end",
"def prefs_clear_cache\n # clear the theme cache\n FileUtils.rm_r \"#{RAILS_ROOT}/public/themes\", :force => true\n # unset the theme\n @@gm_curr_theme = nil\n # unset prefs hash\n Preference.clear_hash\n # that's it!\n flash[:notice] = '<b>Success:</b> Theme cache was cleared.'\n # redirect back\n redirect_to Site.full_url + '/admin/prefs'\n end",
"def clear_device_metrics_override\n {\n method: \"Page.clearDeviceMetricsOverride\"\n }\n end",
"def cleanup\n case SubutaiConfig.provider\n when :hyper_v\n SubutaiDisk.hyperv_remove_disk\n end\n\n # cleanup virtual disks\n disks = SubutaiConfig.get(:_DISK_PATHES)\n unless disks.nil?\n disks.keys.each do |key|\n if File.exist?(disks[key])\n begin\n File.delete(disks[key])\n puts \"==> default: Deleted file: #{disks[key]}\"\n rescue Errno::EACCES\n puts \"==> default: (Permission denied) Failed delete file: #{disks[key]}\"\n end\n end\n end\n end\n\n # cleanup generated files\n if File.exist?(SubutaiConfig::GENERATED_FILE)\n begin\n File.delete SubutaiConfig::GENERATED_FILE\n puts \"==> default: Deleted file: #{SubutaiConfig::GENERATED_FILE}\"\n rescue Errno::EACCES\n puts \"==> default: (Permission denied) Failed delete file: #{SubutaiConfig::GENERATED_FILE}\"\n end\n end\n end",
"def reset_configuration\n @configuration = nil\n end",
"def clean_up\n #Delete every thing but the most recent config[:screenshot_max_keep] screenshots\n max_screenshots = self.config[:screenshot_max_keep] || 5\n #Delete the last created one while they count is more then the max\n while self.admo_screenshots.count > max_screenshots\n self.admo_screenshots.order_by('created_at asc').first.destroy\n end\n end",
"def reset\n @cur_energy = @max_energy\n end",
"def delete_all_configurations\n super\n end",
"def delete_all_configurations\n super\n end",
"def vash_munge_value(val); self.class.munge_option_value(val); end",
"def destroy\n @stage_common_option.destroy\n end",
"def unassign_resource_from_theme!( resource )\n resource_key = get_resource_class_key(resource.class)\n self.assigned_resource_ids.each_pair{|page_layout_id, resourcs|\n if resourcs.key? resource_key\n resourcs[resource_key].each_with_index{|resource_id,idx|\n if resource_id == resource.id\n assigned_resource_ids[page_layout_id][resource_key][idx] = 0\n end\n }\n end\n }\n self.save! \n end",
"def reset\n @options = Marshal.load(@default)\nend",
"def clear_damage_values\n mrts_conditional_drops_clear_damage_values\n @element = 0\n end",
"def destroy\n @global_account_setting = GlobalAccountSetting.find(params[:id])\n @global_account_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(global_account_settings_url) }\n format.xml { head :ok }\n end\n end",
"def reset_storage_options!\n self.storage_options = storage_options_defaults.dup\n end",
"def destroy\n @adm_sets.destroy\n respond_to do |format|\n format.html { redirect_to admin_settings_url, notice: 'Setting destroyed.' }\n format.json { head :no_content }\n end\n end",
"def reset_config\n\t\t\t@config = {}\n\t\tend",
"def clear_administrator_accounts\n Administrator.destroy_all\n end",
"def undefine_config(tool)\n @setup[tool.to_s] = false\n end",
"def clear_outdated\n redis.zremrangebyscore(REDIS_KEY, 0, score_limit)\n end",
"def erase_old_data()\n Djinn.log_run(\"rm -rf /tmp/h*\")\n Djinn.log_run(\"rm -f ~/.appscale_cookies\")\n Djinn.log_run(\"rm -f #{APPSCALE_HOME}/.appscale/status-*\")\n Djinn.log_run(\"rm -f #{APPSCALE_HOME}/.appscale/database_info\")\n\n Nginx.clear_sites_enabled\n HAProxy.clear_sites_enabled\n Djinn.log_run(\"echo '' > /root/.ssh/known_hosts\") # empty it out but leave the file there\n CronHelper.clear_crontab\n end",
"def dec_usage\n @mutex.synchronize { @usage_count -= 1 }\n end",
"def reset_themes\n @theme_options = {}\n end",
"def clear_device_metrics_override\n {\n method: \"Emulation.clearDeviceMetricsOverride\"\n }\n end",
"def delete_configuration\n super\n end",
"def delete_configuration\n super\n end",
"def reset\n \t\t@admin = current_admin\n\tend",
"def deactivate\n deactivate_sandbox if needs_sandbox?\n remove_node\n save_config\n end",
"def reset\n self.time_step = DEFAULT_TIME_STEP\n self.availiable_days = DEFAULT_AVAILIABLE_DAYS\n self.availiable_steps = DEFAULT_AVAILIABLE_STEPS\n self.steps_day_shift = DEFAULT_STEPS_DAY_SHIFT\n end",
"def delete_all_modes\n @_modes = nil\n end",
"def reset_all_statistics\n super\n end",
"def delete_max\n result = nil\n if @root\n @root, result = delete_max_recursive(@root)\n @root.color = :black if @root\n end\n result\n end",
"def destroy\n @global_page_setting = GlobalPageSetting.find(params[:id])\n @global_page_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to global_page_settings_url }\n format.json { head :no_content }\n end\n end",
"def unadmin!\n metadata['admin'] = false\n save\n end",
"def sweep_max_reward_price_cache\n @max_reward_price_cache = nil\n end",
"def reset!\n logs.remove\n features.remove\n users.remove\n end",
"def remove_config(name)\n variables[name] = nil\n end",
"def unlock\n request_body = {\"index\" => {\"blocks\" => {\"write\" => false}}}.to_json\n @client.put(\"_settings\", request_body, content_type: :json)\n end",
"def reset!\n tap { set_defaults }\n end",
"def delete_all\n @configuration = nil\n end",
"def delete_all\n @configuration = nil\n end",
"def remove_accounts_below_disk_free_percentage=(value)\n @remove_accounts_below_disk_free_percentage = value\n end",
"def clear_gemed_theme_instances\n @@gemed_themes = nil\n end"
] | [
"0.57323545",
"0.5696815",
"0.56653935",
"0.5530463",
"0.5471131",
"0.5470981",
"0.54589444",
"0.5428829",
"0.54001933",
"0.5371029",
"0.53578496",
"0.5340306",
"0.5299525",
"0.52967054",
"0.5290305",
"0.5276439",
"0.52066785",
"0.5204589",
"0.51966095",
"0.5195773",
"0.5182823",
"0.5169728",
"0.5163769",
"0.5157503",
"0.51267904",
"0.512435",
"0.51221853",
"0.5078705",
"0.507531",
"0.5072843",
"0.50717336",
"0.506419",
"0.5057111",
"0.5049584",
"0.50441575",
"0.5042263",
"0.50379944",
"0.5029079",
"0.5026544",
"0.50158936",
"0.5006181",
"0.5003199",
"0.49982378",
"0.49971956",
"0.4996267",
"0.49802348",
"0.49778354",
"0.49759623",
"0.4971354",
"0.49691424",
"0.496385",
"0.49556938",
"0.49554518",
"0.49542925",
"0.49539068",
"0.4952005",
"0.49484038",
"0.49457374",
"0.49381632",
"0.4933925",
"0.49225628",
"0.4919693",
"0.4919571",
"0.49171144",
"0.49152374",
"0.49152374",
"0.4910773",
"0.49083394",
"0.48986822",
"0.48985302",
"0.48976633",
"0.48939383",
"0.4891599",
"0.48913756",
"0.4881353",
"0.4878333",
"0.48721498",
"0.48669153",
"0.48641142",
"0.48640534",
"0.4863444",
"0.48597446",
"0.48553798",
"0.48553798",
"0.4853732",
"0.48500386",
"0.48496833",
"0.48454365",
"0.48431858",
"0.4842527",
"0.48371503",
"0.4825427",
"0.48242167",
"0.48182288",
"0.4813673",
"0.48086128",
"0.48083085",
"0.48064512",
"0.48064512",
"0.4804652",
"0.47958213"
] | 0.0 | -1 |
Remove routing language from user | def delete_user_routinglanguage(user_id, language_id, opts = {})
delete_user_routinglanguage_with_http_info(user_id, language_id, opts)
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_lang(uri, lang=self.path_lang)\n lang_code = Store.instance.settings['custom_lang_aliases'][lang] || lang\n\n # Do nothing if lang is empty.\n if lang_code.nil? || lang_code.empty?\n return uri\n end\n\n case @settings['url_pattern']\n when 'query'\n return uri.sub(/(^|\\?|&)wovn=#{lang_code}(&|$)/, '\\1').gsub(/(\\?|&)$/, '')\n when 'subdomain'\n rp = Regexp.new('(^|(//))' + lang_code + '\\.', 'i')\n return uri.sub(rp, '\\1')\n #when 'path'\n else\n return uri.sub(/\\/#{lang_code}(\\/|$)/, '/')\n end\n end",
"def remove_locale_file language\n File.delete yml_path(language) if File.exists?(yml_path language)\n\n new_load_paths = I18n.load_path.map do |path|\n path unless path.include?(\"#{language}.yml\")\n end.compact\n\n I18n.load_path = new_load_paths\n\n I18n.locale = I18n.default_locale\nend",
"def remove_lang_from_uri_component(uri, lang, headers = nil)\n lang_code = @store.settings['custom_lang_aliases'][lang] || lang\n\n return uri if lang_code.blank?\n\n case @store.settings['url_pattern']\n when 'query'\n lang_param_name = @store.settings['lang_param_name']\n uri.sub(/(^|\\?|&)#{lang_param_name}=#{lang_code}(&|$)/, '\\1').gsub(/(\\?|&)$/, '')\n when 'subdomain'\n rp = Regexp.new(\"(^|(//))#{lang_code}\\\\.\", 'i')\n uri.sub(rp, '\\1')\n when 'path'\n # ^(.*://|//)? 1: schema (optional) like https://\n # ([^/]*/)? 2: host (optional) like wovn.io, with trailing '/' (mandatory)\n # (/|$) 3: path or end-of-string\n lang_code_pattern = %r{^(.*://|//)?([^/]*/)?#{lang_code}(/|$)}\n uri.sub(lang_code_pattern, '\\1\\2')\n when 'custom_domain'\n custom_domain_langs = @store.custom_domain_langs\n custom_domain_lang_to_remove = custom_domain_langs.custom_domain_lang_by_lang(lang_code)\n default_custom_domain_lang = custom_domain_langs.custom_domain_lang_by_lang(@store.default_lang)\n new_uri = uri\n if Wovnrb::URL.absolute_url?(uri)\n new_uri = CustomDomainLangUrlHandler.change_to_new_custom_domain_lang(uri, custom_domain_lang_to_remove, default_custom_domain_lang)\n elsif Wovnrb::URL.absolute_path?(uri)\n absolute_url = \"#{headers.protocol}://#{headers.unmasked_host}#{uri}\"\n absolute_url_with_lang = CustomDomainLangUrlHandler.change_to_new_custom_domain_lang(absolute_url, custom_domain_lang_to_remove, default_custom_domain_lang)\n segments = make_segments_from_absolute_url(absolute_url_with_lang)\n new_uri = segments['others']\n elsif uri == custom_domain_lang_to_remove.host\n absolute_url = \"#{headers.protocol}://#{uri}#{headers.unmasked_pathname}\"\n absolute_url_with_lang = CustomDomainLangUrlHandler.change_to_new_custom_domain_lang(absolute_url, custom_domain_lang_to_remove, default_custom_domain_lang)\n segments = make_segments_from_absolute_url(absolute_url_with_lang)\n new_uri = segments['host']\n end\n new_uri\n else\n raise RuntimeError(\"Invalid URL pattern: #{@store.settings['url_pattern']}\")\n end\n end",
"def destroy\n @language_user.destroy\n end",
"def destroy\n @user_language.destroy\n respond_to do |format|\n format.html { redirect_to user_user_languages_url(@user) }\n format.json { head :no_content }\n end\n end",
"def strip_locale_uri(path)\n path.to_s.gsub(/\\/(en|da|no|sv)/i, \"\")\n end",
"def enforce_no_locale\n redirect_permanently_to additional_params.merge(locale: nil)\n end",
"def enforce_no_locale\n redirect_permanently_to additional_params.merge(locale: nil)\n end",
"def locale_switch_link(language)\n path = request.original_fullpath\n if params.to_unsafe_h.include? 'locale'\n path.gsub(%r{locale=#{I18n.locale}}, \"locale=#{language}\")\n elsif request.query_parameters.empty?\n path + \"?locale=#{language}\"\n else\n path + \"&locale=#{language}\"\n end\n end",
"def destroy\n if @language[:default] ='true'\n Language.where(\"id != #{@language[:id]}\").first().update_attributes(:default => true)\n end\n if @language.destroy\n flash[:notice] = I18n.t('admin.languages.destroy.success', :name => @language.name)\n else\n flash[:notice] = I18n.t('admin.languages.destroy.failure', :name => @language.name)\n end\n\n redirect_to :action => :index\n end",
"def delete_po\r\n\r\n FileUtils.rm_rf \"#{Rails.root}/po/#{params[:locale]}\"\r\n redirect_to locales_path\r\n end",
"def change_to_bosnian\n if session[:user_id] != nil\n @user = User.find(session[:user_id])\n @user.prefered_language=\"bosnian\"\n @user.save\n redirect_to '/home'\n #redirect_to(:back)\n else\n session[:language]=\"bosnian\"\n redirect_to 'home'\n end\nend",
"def remove_slug(language, original)\n\t\t\t\t\t\t\n\t\t\t\t\t\t# Prepare\n\t\t\t\t\t\tlanguage = language.to_s\n\t\t\t\t\t\toriginal = \"/\" + original.to_s.trim(\"/\")\n\n\t\t\t\t\t\t# Try to find existing record\n\t\t\t\t\t\tslug = where(slug_language: language, original: original).first\t\t\t\t\t\t\n\t\t\t\t\t\tif !slug.nil?\n\t\t\t\t\t\t\tslug.destroy\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\t# Clear cache\n\t\t\t\t\t\tclear_cache\n\n\t\t\t\t\tend",
"def current_path_without_locale(path)\n locale_pattern = /^(\\/)(en|sv)?(\\/)?(.*)$/\n path.gsub(locale_pattern, '\\1\\4')\n end",
"def remove_language\n expression_language = ExpressionLanguage.find(params[:expression_language_id]) unless params[:expression_language_id].blank?\n @expression = expression_language.expression\n \n if !expression_language.blank?\n if expression_language.destroy\n # update related work for solr indexing\n work = @expression.work\n work.save\n end\n end\n \n render :partial => 'languages_form', :locals => { :expression => @expression }\n end",
"def set_language\n\n if current_user.nil? || params[:controller] =~ /rails_admin/i\n I18n.locale = params[:language] || I18n.default_locale\n else\n I18n.locale = params[:language] || current_user.language.try(:iso_code) || I18n.default_locale\n end\n end",
"def destroy\n if current_user.admin\n #authorize @natlang\n @natlang.destroy\n respond_to do |format|\n format.html { redirect_to natlangs_url, notice: 'Natlang was successfully destroyed.' }\n format.json { head :no_content }\n end\n else \n redirect_to root_url, alert: \"Sorry, only the admin can do this function\"\n end\n end",
"def change_user_lang\n session[:language] = params[:lang]\n render :json => {:controller => params[:controller_name]}\n end",
"def change_to_english\n if session[:user_id] != nil\n @user = User.find(session[:user_id])\n @user.prefered_language=\"english\"\n @user.save\n redirect_to '/home'\n #redirect_to(:back)\nelse\n session[:language]=\"english\"\n redirect_to '/home'\nend\nend",
"def set_language\n language = params[:language].to_s\n unless language.blank?\n session[:language] = nil # Don't want to \"remember\" this anymore, since they've manually changed it.\n alter_current_user do |user|\n I18n.locale = language\n user.language = Language.from_iso(language)\n end\n end\n return_to = (params[:return_to].blank? ? root_url : params[:return_to])\n redirect_to return_to\n end",
"def after_sign_out_path_for(_resource)\n I18n.locale == I18n.default_locale ? '/' : \"/#{I18n.locale}\"\n end",
"def ensure_language\n # disabling rubocop here as I think this is readable\n # rubocop:disable Style/GuardClause\n unless I18n.locale.nil? || params[:user][:language_id].present?\n params[:user][:language_id] = ::Language.id_for(I18n.locale)\n end\n # rubocop:enable Style/GuardClause\n end",
"def set_language\n return if request.fullpath.match(/^\\/(\\S+)preview/)\n unless current_user.nil?\n I18n.locale = current_user.language\n end\n I18n.locale = session[:lang] if session[:lang]\n end",
"def force_locale_on_root_path\n # Do *not* force the locale to be shown in the URL (via redirect) if\n # * A user wants to switch his language (param)\n # * This is not the root path\n # * This is an API or JavaScript call (i.e. no :html)\n if params[:locale].blank? and request and request.url == root_url(:locale => nil) and request.get? and request.format.symbol == :html\n respond_to do |format|\n format.html { redirect_to root_path(:locale => I18n.locale) and return }\n end\n end\n end",
"def clean_from_i18n(url)\n parts = url.split('/').select { |p| p && p.size > 0 }\n parts.shift if langs.map(&:to_s).include?(parts[0])\n parts.join('/')\n end",
"def set_user_language\n I18n.locale = 'es-VE'\n end",
"def delete_user_routinglanguage_with_http_info(user_id, language_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_user_routinglanguage ...\"\n end\n \n \n # verify the required parameter 'user_id' is set\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling RoutingApi.delete_user_routinglanguage\" if user_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'language_id' is set\n fail ArgumentError, \"Missing the required parameter 'language_id' when calling RoutingApi.delete_user_routinglanguage\" if language_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/users/{userId}/routinglanguages/{languageId}\".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'languageId' + '}', language_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\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: RoutingApi#delete_user_routinglanguage\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def reset_locale language\n if language.nil? or language.empty?\n return\n end\n create_base_yml_file_without_missions(language) unless File.exists?(yml_path(language))\n\n I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]\n I18n.locale = language\nend",
"def set_language_from\n session[:lang_from] = params[:lang].to_sym\n I18n.locale = session[:lang_from]\n render nothing: true\n end",
"def clean_from_i18n(url)\n parts = url.split('/').select { |p| p && p.size > 0 }\n parts.shift if langs.map(&:to_s).include?(parts[0])\n\n parts.join('/')\n end",
"def delete_translations\n end",
"def remove(key,locale)\n key = \"#{locale}.#{key}\" if locale\n self.destroy(key)\n end",
"def ignore_path_prefix_language(context={})\n %w(/mail/messages-reader)\n end",
"def sanitize_lang(lang)\n supported_lang?(lang) ? lang : DEFAULT_LANGUAGE\n end",
"def set_language\n params[:lang] ||= 'en'\n Localization.use params[:lang]\n end",
"def change_to_default\n if session[:user_id] != nil\n @user = User.find(session[:user_id])\n @user.prefered_language=\"default\"\n @user.save\n redirect_to(:back)\nelse\n session[:language]=\"default\"\n redirect_to users_path\nend\nend",
"def on_load_language; load_language('lang/login'); end",
"def set_language_to\n session[:lang_to] = params[:lang].to_sym\n \n respond_to do |format|\n format.html { redirect_to root_url } \n format.js { render nothing: true }\n end\n end",
"def remove_translation(word)\n translation = @dictionary[word]\n @dictionary.delete(word)\n @dictionary.delete(translation)\n end",
"def lang\n # get current page url hash\n back_hash = Rails.application.routes.recognize_path request.referer\n Rails.logger.debug(\"original back_hash: #{back_hash.inspect}\")\n # change the locale code in the current page url hash\n back_hash[:locale] = @locale_code\n Rails.logger.debug(\"redirect to: #{back_hash.inspect}\")\n # see current page in new locale!\n redirect_to back_hash\n end",
"def change_locale_url(locale)\n current_path = \"#{request.protocol}#{request.host_with_port}#{request.fullpath}\"\n if current_path.include?('lang_to=')\n current_path.gsub(\"lang_to=#{session[:lang_to]}\", \"lang_to=#{locale.to_s}\")\n elsif current_path.include?('?')\n \"#{current_path}&lang_to=#{locale.to_s}\"\n else\n \"#{current_path}?lang_to=#{locale.to_s}\"\n end\n \n end",
"def destroy\n @admin_language = Language.find(params[:id])\n @admin_language.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_languages_url) }\n format.xml { head :ok }\n end\n end",
"def home(&block)\n check_language!\n route(\"GET\", \"/:lang\", { :skip_i18n => true }, &block)\n end",
"def patch_user_routinglanguage(user_id, language_id, body, opts = {})\n data, _status_code, _headers = patch_user_routinglanguage_with_http_info(user_id, language_id, body, opts)\n return data\n end",
"def ignore_path_prefix_language(context={})\n %w(/p/order/payment-gateway /p/order/pay /p/myorder /p/activity)\n end",
"def destroy\n respond_to do |format|\n if @locale.destroy\n format.html { redirect_to admin_locales_path, notice: '刪除語系成功' }\n format.json { head :no_content }\n end\n end\n end",
"def untranslated(collection)\n @texts.reject { |i| collection.translated?(i, @provider.name) }\n end",
"def remove_sensitive_fields\n if params[:user] && [:admin, :pps_balance].any? { |p| params[:user].delete(p) }\n redirect_to user_root_path,\n :alert => t(\"flash.dont_even\")\n end\n end",
"def default_locale\n redirect_to locale_root_path, status: :moved_permanently and return false\n end",
"def clear_available_locales_set; end",
"def destroy\n @language_type.destroy\n\n head :no_content\n end",
"def translators_note # :nologin:\n end",
"def destroy\n @lang = Lang.find(params[:id])\n @lang.destroy\n\n respond_to do |format|\n format.html { redirect_to langs_url }\n format.json { head :no_content }\n end\n end",
"def change_locale\n # Toma la variable del lenguaje\n # de los parametros\n locale = params[:locale]\n # verifica si la variable existe sino toma la\n # que viene por defecto\n I18n.locale = I18n.available_locales.include?(locale.strip.to_sym) ? locale.strip.to_sym : I18n.default_locale\n # crea la cookie\n cookies[:locale] = locale\n if request.referrer\n redirect_to request.referrer\n else\n redirect_to \"/\"\n end\n end",
"def set_user_language\n cookies[:language] ||= '0'\n I18n.locale = LOCALES_AVAILABLE[cookies[:language].to_i]\n end",
"def destroy\n @language = Language.find(params[:id])\n @language.destroy\n\n respond_to do |format|\n format.html { redirect_to(languages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @language = Language.find(params[:id])\n @language.destroy\n\n respond_to do |format|\n format.html { redirect_to(languages_url) }\n format.xml { head :ok }\n end\n end",
"def switch_locale(new_locale)\n request.path.sub(/^\\/[a-zA-Z\\-]{2,8}/, \"/#{new_locale}\")\n end",
"def languagefallback()\n merge(languagefallback: 'true')\n end",
"def destroy\n authorize! :destroy, MasteredLanguage, :message => 'Not authorized as an administrator.'\n @mastered_language = MasteredLanguage.find(params[:id])\n @mastered_language.destroy\n\n respond_to do |format|\n format.html { redirect_to user_mastered_languages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @r_language.destroy\n respond_to do |format|\n format.html { redirect_to r_languages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t@language = Language.find(params[:id])\n\t\t@language.destroy\n\n\t\trespond_with @language do |format|\n\t\t\tformat.html { redirect_to languages_url }\n\t\t\tformat.json { head :ok }\n\t\tend\n\tend",
"def set_language_filter\n session[:language_filter] ||= []\n if params[:locale] == 'all'\n session[:language_filter] = []\n else\n if session[:language_filter].include?(params[:locale])\n session[:language_filter] -= [params[:locale]] \n else\n session[:language_filter] += [params[:locale]]\n end\n end\n end",
"def after_inactive_sign_up_path_for(resource)\n languages_path\n end",
"def lang\n # get current page url hash\n back_hash = Rails.application.routes.recognize_path request.referer\n Rails.logger.debug(\"original back_hash: #{back_hash.inspect}\")\n # change the locale code in the current page url hash\n back_hash[:locale] = @locale_code\n back_hash[:dim_type] = params[:dim_type] if params[:dim_type]\n Rails.logger.debug(\"redirect to: #{back_hash.inspect}\")\n # see current page in new locale!\n redirect_to back_hash\n end",
"def change_lang\n eng = :en\n jap = :ja\n if I18n.locale == eng\n params[:locale] = :ja\n I18n.locale = :ja\n elsif I18n.locale == jap\n params[:locale] = :en\n I18n.locale = :en\n end\n end",
"def destroy\r\n @language.destroy\r\n respond_to do |format|\r\n format.html { redirect_to languages_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def unsubscribe_sms\n if current_user\n current_user.update_notification_preference(:push) \n render :text => \"ok\"\n else\n render :text => \"unknown user\"\n end\n end",
"def set_locale\n I18n.locale = access_control.user.locale\n end",
"def unvoice(nick,reason=nil,&blk)\n set_role 'visitor', nick, reason, &blk\n end",
"def redir_missing_locale\n explicit_locale = params[:locale]\n return if explicit_locale.present?\n\n # Don't bother redirecting some formats\n return if DO_NOT_REDIRECT_LOCALE.include?(params[:format])\n\n #\n # No locale, determine the best locale and redirect.\n #\n best_locale = find_best_locale\n preferred_url = force_locale_url(request.original_url, best_locale)\n # It's not clear what status code to provide on a locale-based redirect.\n # However, we must avoid 301 (Moved Permanently), because it is certainly\n # not a permanent move.\n # We previously used use 300 (Multiple Choices),\n # because that code indicates there's a redirect based on agent choices\n # (which is certainly true), by doing this:\n # redirect_to preferred_url, status: :multiple_choices # 300\n # It worked on staging, but causes problems in production when trying\n # to redirect the root path, so as emergency we're\n # switching to \"found\" (302) which is supported by everyone.\n redirect_to preferred_url, status: :found\n end",
"def delete\n @language = Language.find(params[:id])\n @language.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url, notice: t(:language_deleted) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @accountadmin_language = AccountadminLanguage.find(params[:id])\n @accountadmin_language.destroy\n\n unless @accountadmin_language.errors.empty?\n flash[:notice] = \"WARNING: Couldn't delete language because:\"\n @accountadmin_language.errors.full_messages.each { |m| flash[:notice] << \"<br/>\" << m }\n end\n\n respond_to do |format|\n format.html { redirect_to(accountadmin_languages_url) }\n format.xml { head :ok }\n end\n end",
"def set_locale\n if I18N_SUPPORTED_LOCALES.include?( params[:locale] )\n if logged_in?\n current_user.update_attribute(:locale, params[:locale])\n end\n session[:locale] = params[:locale]\n end\n redirect_back_or_default( root_url )\n end",
"def remove_protection(pyro_word)\n pyro_word.gsub(/!/,'')\n end",
"def remove_block\n block = params[:block].to_s.underscore\n @user = User.current\n # remove block in all groups\n layout = @user.pref[:my_page_layout] || {}\n %w(top left right).each {|f| (layout[f] ||= []).delete block }\n @user.pref[:my_page_layout] = layout\n @user.pref.save\n redirect_to my_page_layout_path\n end",
"def remove_block\n block = params[:block].to_s.underscore\n @user = User.current\n # remove block in all groups\n layout = @user.pref[:my_page_layout] || {}\n %w(top left right).each {|f| (layout[f] ||= []).delete block }\n @user.pref[:my_page_layout] = layout\n @user.pref.save\n redirect_to my_page_layout_path\n end",
"def delete_translation_address\n super\n end",
"def destroy\n @languagename.destroy\n respond_to do |format|\n format.html { redirect_to languagenames_url, notice: 'Languagename was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(action, parameters = {}, session = nil, flash = nil)\n parameters[:locale] = I18n.locale\n super(action, parameters, session, flash)\n end",
"def language\n @values.fetch('ai.device.language') { \n @values['ai.device.language'] = nil\n }\n end",
"def remove_route(route={})\n request :delete, '/routes', route\n end",
"def constrain_freeculture\n session[:name_of_search] = nil\n if params[:remove] == 'true'\n session[:constraints].each {|constraint|\n if constraint[:type] == 'FreeCultureConstraint'\n session[:constraints].delete(constraint)\n break\n end\n }\n else\n session[:constraints] << FreeCultureConstraint.new(:inverted => false )\n end\n \n redirect_to :action => 'browse', :phrs => params[:phrs]\n end",
"def locale_to_translate_into\n multilanguage_site = settings.multilanguage_site\n default_language = settings.default_language\n if multilanguage_site and session[:locale] != default_language\n session[:locale]\n else\n nil\n end\n end",
"def destroy\n authorize! :destroy, @admin_language_code\n\n @admin_language_code.destroy\n respond_to do |format|\n format.html { redirect_to admin_language_codes_url }\n format.json { head :no_content }\n end\n end",
"def htlal_users_url\n if htlal_language_id\n \"http://how-to-learn-any-language.com/forum/languages.asp?language=#{htlal_language_id}\"\n end\n end",
"def set_user_language\n @user_language = UserLanguage.find(params[:id])\n end",
"def destroy\n @translation = @locale.translations.find(params[:id])\n @translation.destroy\n redirect_to(locale_translations_url)\n end",
"def translit_non_latin_lang(lang)\n case lang\n when \"ar\",\"ru\",\"el\"\n self.translit\n else\n self\n end\n end",
"def localized\n redirect_to user_omniauth_authorize_path(params[:provider], locale: params[:locale])\n end",
"def handle_locale\n return if request.headers['Accept-Language'].nil?\n\n I18n.locale = case request.headers['Accept-Language'].downcase\n when 'ru' || 'russian'\n :ru\n when 'en' || 'english'\n :en\n else\n I18n.default_locale\n end\n end",
"def uri_for_language(language)\n return LANGUAGE_ENDPOINTS[language] + \"/rest/disambiguate\"\n end",
"def set_website_locale\n app_locales = %w(es ca)\n I18n.locale = params[:lang] if app_locales.include?(params[:lang])\n end",
"def set_language\n @language = current_user.languages.find(params[:language_id])\n end",
"def reset_guest!\n original_locale = session[:locale]\n original_scores = session[:show_scores]\n\n sign_out(:user) if user_signed_in?\n reset_session\n\n session[:locale] = original_locale\n session[:show_scores] = original_scores\n\n cookies.delete :guest\n @_guest = nil\n end",
"def user_language\n USER_LANGUAGE[spoken_language]\n end",
"def remove_block\n @user = User.current\n @user.pref.remove_block params[:block]\n @user.pref.save\n redirect_to my_page_layout_path\n end",
"def set_language\r\n session[:language] = 'english'\r\n end",
"def destroy\n session[:user_id] = nil\n redirect_to root_url, :notice => \"تسجيل الخروج!\"\n end",
"def path_lang\n if @path_lang.nil?\n rp = Regexp.new(@settings['url_pattern_reg'])\n if @settings['use_proxy'] && @env.has_key?('HTTP_X_FORWARDED_HOST')\n match = \"#{@env['HTTP_X_FORWARDED_HOST']}#{@env['REQUEST_URI']}\".match(rp)\n else\n match = \"#{@env['SERVER_NAME']}#{@env['REQUEST_URI']}\".match(rp)\n end\n if match && match[:lang] && Lang.get_lang(match[:lang])\n @path_lang = Lang.get_code(match[:lang])\n else\n @path_lang = ''\n end\n end\n return @path_lang\n end"
] | [
"0.68258554",
"0.62279284",
"0.61071986",
"0.6066848",
"0.6048045",
"0.5916321",
"0.5913798",
"0.5913798",
"0.573063",
"0.5687655",
"0.56399965",
"0.5626786",
"0.56220305",
"0.5565366",
"0.5565234",
"0.55618393",
"0.5542741",
"0.5539161",
"0.5535223",
"0.5532577",
"0.5526178",
"0.55139756",
"0.55105513",
"0.55083936",
"0.5507262",
"0.550138",
"0.5484885",
"0.5477222",
"0.5472198",
"0.54551303",
"0.5447709",
"0.54373145",
"0.5421565",
"0.54091185",
"0.5405244",
"0.5400525",
"0.539624",
"0.5395419",
"0.5386646",
"0.53772515",
"0.5373742",
"0.5350105",
"0.533989",
"0.5332952",
"0.5312938",
"0.5299121",
"0.5290476",
"0.52902794",
"0.52609384",
"0.5257487",
"0.5257195",
"0.52449656",
"0.5243259",
"0.52404326",
"0.52266407",
"0.52222973",
"0.52222973",
"0.52091527",
"0.519022",
"0.5176103",
"0.516661",
"0.5148412",
"0.5135065",
"0.51321083",
"0.51318026",
"0.51237947",
"0.5123131",
"0.51207316",
"0.5112995",
"0.51085407",
"0.51040417",
"0.5101317",
"0.5095808",
"0.50819165",
"0.507829",
"0.50729793",
"0.50729793",
"0.5064502",
"0.50637937",
"0.5059471",
"0.505385",
"0.5053745",
"0.5053235",
"0.50531584",
"0.50467545",
"0.5046037",
"0.50459397",
"0.50389713",
"0.50258887",
"0.50226736",
"0.50111806",
"0.50068384",
"0.50042814",
"0.49890354",
"0.4976912",
"0.4976905",
"0.49730805",
"0.49625513",
"0.49473625",
"0.49471724"
] | 0.5226902 | 54 |
Remove routing language from user | def delete_user_routinglanguage_with_http_info(user_id, language_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.delete_user_routinglanguage ..."
end
# verify the required parameter 'user_id' is set
fail ArgumentError, "Missing the required parameter 'user_id' when calling RoutingApi.delete_user_routinglanguage" if user_id.nil?
# verify the required parameter 'language_id' is set
fail ArgumentError, "Missing the required parameter 'language_id' when calling RoutingApi.delete_user_routinglanguage" if language_id.nil?
# resource path
local_var_path = "/api/v2/users/{userId}/routinglanguages/{languageId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'languageId' + '}', language_id.to_s)
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#delete_user_routinglanguage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_lang(uri, lang=self.path_lang)\n lang_code = Store.instance.settings['custom_lang_aliases'][lang] || lang\n\n # Do nothing if lang is empty.\n if lang_code.nil? || lang_code.empty?\n return uri\n end\n\n case @settings['url_pattern']\n when 'query'\n return uri.sub(/(^|\\?|&)wovn=#{lang_code}(&|$)/, '\\1').gsub(/(\\?|&)$/, '')\n when 'subdomain'\n rp = Regexp.new('(^|(//))' + lang_code + '\\.', 'i')\n return uri.sub(rp, '\\1')\n #when 'path'\n else\n return uri.sub(/\\/#{lang_code}(\\/|$)/, '/')\n end\n end",
"def remove_locale_file language\n File.delete yml_path(language) if File.exists?(yml_path language)\n\n new_load_paths = I18n.load_path.map do |path|\n path unless path.include?(\"#{language}.yml\")\n end.compact\n\n I18n.load_path = new_load_paths\n\n I18n.locale = I18n.default_locale\nend",
"def remove_lang_from_uri_component(uri, lang, headers = nil)\n lang_code = @store.settings['custom_lang_aliases'][lang] || lang\n\n return uri if lang_code.blank?\n\n case @store.settings['url_pattern']\n when 'query'\n lang_param_name = @store.settings['lang_param_name']\n uri.sub(/(^|\\?|&)#{lang_param_name}=#{lang_code}(&|$)/, '\\1').gsub(/(\\?|&)$/, '')\n when 'subdomain'\n rp = Regexp.new(\"(^|(//))#{lang_code}\\\\.\", 'i')\n uri.sub(rp, '\\1')\n when 'path'\n # ^(.*://|//)? 1: schema (optional) like https://\n # ([^/]*/)? 2: host (optional) like wovn.io, with trailing '/' (mandatory)\n # (/|$) 3: path or end-of-string\n lang_code_pattern = %r{^(.*://|//)?([^/]*/)?#{lang_code}(/|$)}\n uri.sub(lang_code_pattern, '\\1\\2')\n when 'custom_domain'\n custom_domain_langs = @store.custom_domain_langs\n custom_domain_lang_to_remove = custom_domain_langs.custom_domain_lang_by_lang(lang_code)\n default_custom_domain_lang = custom_domain_langs.custom_domain_lang_by_lang(@store.default_lang)\n new_uri = uri\n if Wovnrb::URL.absolute_url?(uri)\n new_uri = CustomDomainLangUrlHandler.change_to_new_custom_domain_lang(uri, custom_domain_lang_to_remove, default_custom_domain_lang)\n elsif Wovnrb::URL.absolute_path?(uri)\n absolute_url = \"#{headers.protocol}://#{headers.unmasked_host}#{uri}\"\n absolute_url_with_lang = CustomDomainLangUrlHandler.change_to_new_custom_domain_lang(absolute_url, custom_domain_lang_to_remove, default_custom_domain_lang)\n segments = make_segments_from_absolute_url(absolute_url_with_lang)\n new_uri = segments['others']\n elsif uri == custom_domain_lang_to_remove.host\n absolute_url = \"#{headers.protocol}://#{uri}#{headers.unmasked_pathname}\"\n absolute_url_with_lang = CustomDomainLangUrlHandler.change_to_new_custom_domain_lang(absolute_url, custom_domain_lang_to_remove, default_custom_domain_lang)\n segments = make_segments_from_absolute_url(absolute_url_with_lang)\n new_uri = segments['host']\n end\n new_uri\n else\n raise RuntimeError(\"Invalid URL pattern: #{@store.settings['url_pattern']}\")\n end\n end",
"def destroy\n @language_user.destroy\n end",
"def destroy\n @user_language.destroy\n respond_to do |format|\n format.html { redirect_to user_user_languages_url(@user) }\n format.json { head :no_content }\n end\n end",
"def enforce_no_locale\n redirect_permanently_to additional_params.merge(locale: nil)\n end",
"def enforce_no_locale\n redirect_permanently_to additional_params.merge(locale: nil)\n end",
"def strip_locale_uri(path)\n path.to_s.gsub(/\\/(en|da|no|sv)/i, \"\")\n end",
"def locale_switch_link(language)\n path = request.original_fullpath\n if params.to_unsafe_h.include? 'locale'\n path.gsub(%r{locale=#{I18n.locale}}, \"locale=#{language}\")\n elsif request.query_parameters.empty?\n path + \"?locale=#{language}\"\n else\n path + \"&locale=#{language}\"\n end\n end",
"def destroy\n if @language[:default] ='true'\n Language.where(\"id != #{@language[:id]}\").first().update_attributes(:default => true)\n end\n if @language.destroy\n flash[:notice] = I18n.t('admin.languages.destroy.success', :name => @language.name)\n else\n flash[:notice] = I18n.t('admin.languages.destroy.failure', :name => @language.name)\n end\n\n redirect_to :action => :index\n end",
"def delete_po\r\n\r\n FileUtils.rm_rf \"#{Rails.root}/po/#{params[:locale]}\"\r\n redirect_to locales_path\r\n end",
"def change_to_bosnian\n if session[:user_id] != nil\n @user = User.find(session[:user_id])\n @user.prefered_language=\"bosnian\"\n @user.save\n redirect_to '/home'\n #redirect_to(:back)\n else\n session[:language]=\"bosnian\"\n redirect_to 'home'\n end\nend",
"def remove_slug(language, original)\n\t\t\t\t\t\t\n\t\t\t\t\t\t# Prepare\n\t\t\t\t\t\tlanguage = language.to_s\n\t\t\t\t\t\toriginal = \"/\" + original.to_s.trim(\"/\")\n\n\t\t\t\t\t\t# Try to find existing record\n\t\t\t\t\t\tslug = where(slug_language: language, original: original).first\t\t\t\t\t\t\n\t\t\t\t\t\tif !slug.nil?\n\t\t\t\t\t\t\tslug.destroy\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\t# Clear cache\n\t\t\t\t\t\tclear_cache\n\n\t\t\t\t\tend",
"def set_language\n\n if current_user.nil? || params[:controller] =~ /rails_admin/i\n I18n.locale = params[:language] || I18n.default_locale\n else\n I18n.locale = params[:language] || current_user.language.try(:iso_code) || I18n.default_locale\n end\n end",
"def current_path_without_locale(path)\n locale_pattern = /^(\\/)(en|sv)?(\\/)?(.*)$/\n path.gsub(locale_pattern, '\\1\\4')\n end",
"def remove_language\n expression_language = ExpressionLanguage.find(params[:expression_language_id]) unless params[:expression_language_id].blank?\n @expression = expression_language.expression\n \n if !expression_language.blank?\n if expression_language.destroy\n # update related work for solr indexing\n work = @expression.work\n work.save\n end\n end\n \n render :partial => 'languages_form', :locals => { :expression => @expression }\n end",
"def change_user_lang\n session[:language] = params[:lang]\n render :json => {:controller => params[:controller_name]}\n end",
"def destroy\n if current_user.admin\n #authorize @natlang\n @natlang.destroy\n respond_to do |format|\n format.html { redirect_to natlangs_url, notice: 'Natlang was successfully destroyed.' }\n format.json { head :no_content }\n end\n else \n redirect_to root_url, alert: \"Sorry, only the admin can do this function\"\n end\n end",
"def change_to_english\n if session[:user_id] != nil\n @user = User.find(session[:user_id])\n @user.prefered_language=\"english\"\n @user.save\n redirect_to '/home'\n #redirect_to(:back)\nelse\n session[:language]=\"english\"\n redirect_to '/home'\nend\nend",
"def set_language\n language = params[:language].to_s\n unless language.blank?\n session[:language] = nil # Don't want to \"remember\" this anymore, since they've manually changed it.\n alter_current_user do |user|\n I18n.locale = language\n user.language = Language.from_iso(language)\n end\n end\n return_to = (params[:return_to].blank? ? root_url : params[:return_to])\n redirect_to return_to\n end",
"def after_sign_out_path_for(_resource)\n I18n.locale == I18n.default_locale ? '/' : \"/#{I18n.locale}\"\n end",
"def ensure_language\n # disabling rubocop here as I think this is readable\n # rubocop:disable Style/GuardClause\n unless I18n.locale.nil? || params[:user][:language_id].present?\n params[:user][:language_id] = ::Language.id_for(I18n.locale)\n end\n # rubocop:enable Style/GuardClause\n end",
"def set_language\n return if request.fullpath.match(/^\\/(\\S+)preview/)\n unless current_user.nil?\n I18n.locale = current_user.language\n end\n I18n.locale = session[:lang] if session[:lang]\n end",
"def force_locale_on_root_path\n # Do *not* force the locale to be shown in the URL (via redirect) if\n # * A user wants to switch his language (param)\n # * This is not the root path\n # * This is an API or JavaScript call (i.e. no :html)\n if params[:locale].blank? and request and request.url == root_url(:locale => nil) and request.get? and request.format.symbol == :html\n respond_to do |format|\n format.html { redirect_to root_path(:locale => I18n.locale) and return }\n end\n end\n end",
"def clean_from_i18n(url)\n parts = url.split('/').select { |p| p && p.size > 0 }\n parts.shift if langs.map(&:to_s).include?(parts[0])\n parts.join('/')\n end",
"def set_user_language\n I18n.locale = 'es-VE'\n end",
"def reset_locale language\n if language.nil? or language.empty?\n return\n end\n create_base_yml_file_without_missions(language) unless File.exists?(yml_path(language))\n\n I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]\n I18n.locale = language\nend",
"def set_language_from\n session[:lang_from] = params[:lang].to_sym\n I18n.locale = session[:lang_from]\n render nothing: true\n end",
"def clean_from_i18n(url)\n parts = url.split('/').select { |p| p && p.size > 0 }\n parts.shift if langs.map(&:to_s).include?(parts[0])\n\n parts.join('/')\n end",
"def delete_translations\n end",
"def remove(key,locale)\n key = \"#{locale}.#{key}\" if locale\n self.destroy(key)\n end",
"def ignore_path_prefix_language(context={})\n %w(/mail/messages-reader)\n end",
"def set_language\n params[:lang] ||= 'en'\n Localization.use params[:lang]\n end",
"def sanitize_lang(lang)\n supported_lang?(lang) ? lang : DEFAULT_LANGUAGE\n end",
"def on_load_language; load_language('lang/login'); end",
"def change_to_default\n if session[:user_id] != nil\n @user = User.find(session[:user_id])\n @user.prefered_language=\"default\"\n @user.save\n redirect_to(:back)\nelse\n session[:language]=\"default\"\n redirect_to users_path\nend\nend",
"def set_language_to\n session[:lang_to] = params[:lang].to_sym\n \n respond_to do |format|\n format.html { redirect_to root_url } \n format.js { render nothing: true }\n end\n end",
"def lang\n # get current page url hash\n back_hash = Rails.application.routes.recognize_path request.referer\n Rails.logger.debug(\"original back_hash: #{back_hash.inspect}\")\n # change the locale code in the current page url hash\n back_hash[:locale] = @locale_code\n Rails.logger.debug(\"redirect to: #{back_hash.inspect}\")\n # see current page in new locale!\n redirect_to back_hash\n end",
"def remove_translation(word)\n translation = @dictionary[word]\n @dictionary.delete(word)\n @dictionary.delete(translation)\n end",
"def change_locale_url(locale)\n current_path = \"#{request.protocol}#{request.host_with_port}#{request.fullpath}\"\n if current_path.include?('lang_to=')\n current_path.gsub(\"lang_to=#{session[:lang_to]}\", \"lang_to=#{locale.to_s}\")\n elsif current_path.include?('?')\n \"#{current_path}&lang_to=#{locale.to_s}\"\n else\n \"#{current_path}?lang_to=#{locale.to_s}\"\n end\n \n end",
"def destroy\n @admin_language = Language.find(params[:id])\n @admin_language.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_languages_url) }\n format.xml { head :ok }\n end\n end",
"def home(&block)\n check_language!\n route(\"GET\", \"/:lang\", { :skip_i18n => true }, &block)\n end",
"def patch_user_routinglanguage(user_id, language_id, body, opts = {})\n data, _status_code, _headers = patch_user_routinglanguage_with_http_info(user_id, language_id, body, opts)\n return data\n end",
"def ignore_path_prefix_language(context={})\n %w(/p/order/payment-gateway /p/order/pay /p/myorder /p/activity)\n end",
"def destroy\n respond_to do |format|\n if @locale.destroy\n format.html { redirect_to admin_locales_path, notice: '刪除語系成功' }\n format.json { head :no_content }\n end\n end\n end",
"def untranslated(collection)\n @texts.reject { |i| collection.translated?(i, @provider.name) }\n end",
"def remove_sensitive_fields\n if params[:user] && [:admin, :pps_balance].any? { |p| params[:user].delete(p) }\n redirect_to user_root_path,\n :alert => t(\"flash.dont_even\")\n end\n end",
"def default_locale\n redirect_to locale_root_path, status: :moved_permanently and return false\n end",
"def clear_available_locales_set; end",
"def destroy\n @language_type.destroy\n\n head :no_content\n end",
"def translators_note # :nologin:\n end",
"def change_locale\n # Toma la variable del lenguaje\n # de los parametros\n locale = params[:locale]\n # verifica si la variable existe sino toma la\n # que viene por defecto\n I18n.locale = I18n.available_locales.include?(locale.strip.to_sym) ? locale.strip.to_sym : I18n.default_locale\n # crea la cookie\n cookies[:locale] = locale\n if request.referrer\n redirect_to request.referrer\n else\n redirect_to \"/\"\n end\n end",
"def destroy\n @lang = Lang.find(params[:id])\n @lang.destroy\n\n respond_to do |format|\n format.html { redirect_to langs_url }\n format.json { head :no_content }\n end\n end",
"def set_user_language\n cookies[:language] ||= '0'\n I18n.locale = LOCALES_AVAILABLE[cookies[:language].to_i]\n end",
"def delete_user_routinglanguage(user_id, language_id, opts = {})\n delete_user_routinglanguage_with_http_info(user_id, language_id, opts)\n return nil\n end",
"def destroy\n @language = Language.find(params[:id])\n @language.destroy\n\n respond_to do |format|\n format.html { redirect_to(languages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @language = Language.find(params[:id])\n @language.destroy\n\n respond_to do |format|\n format.html { redirect_to(languages_url) }\n format.xml { head :ok }\n end\n end",
"def switch_locale(new_locale)\n request.path.sub(/^\\/[a-zA-Z\\-]{2,8}/, \"/#{new_locale}\")\n end",
"def languagefallback()\n merge(languagefallback: 'true')\n end",
"def destroy\n authorize! :destroy, MasteredLanguage, :message => 'Not authorized as an administrator.'\n @mastered_language = MasteredLanguage.find(params[:id])\n @mastered_language.destroy\n\n respond_to do |format|\n format.html { redirect_to user_mastered_languages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @r_language.destroy\n respond_to do |format|\n format.html { redirect_to r_languages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t@language = Language.find(params[:id])\n\t\t@language.destroy\n\n\t\trespond_with @language do |format|\n\t\t\tformat.html { redirect_to languages_url }\n\t\t\tformat.json { head :ok }\n\t\tend\n\tend",
"def set_language_filter\n session[:language_filter] ||= []\n if params[:locale] == 'all'\n session[:language_filter] = []\n else\n if session[:language_filter].include?(params[:locale])\n session[:language_filter] -= [params[:locale]] \n else\n session[:language_filter] += [params[:locale]]\n end\n end\n end",
"def lang\n # get current page url hash\n back_hash = Rails.application.routes.recognize_path request.referer\n Rails.logger.debug(\"original back_hash: #{back_hash.inspect}\")\n # change the locale code in the current page url hash\n back_hash[:locale] = @locale_code\n back_hash[:dim_type] = params[:dim_type] if params[:dim_type]\n Rails.logger.debug(\"redirect to: #{back_hash.inspect}\")\n # see current page in new locale!\n redirect_to back_hash\n end",
"def after_inactive_sign_up_path_for(resource)\n languages_path\n end",
"def change_lang\n eng = :en\n jap = :ja\n if I18n.locale == eng\n params[:locale] = :ja\n I18n.locale = :ja\n elsif I18n.locale == jap\n params[:locale] = :en\n I18n.locale = :en\n end\n end",
"def destroy\r\n @language.destroy\r\n respond_to do |format|\r\n format.html { redirect_to languages_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def set_locale\n I18n.locale = access_control.user.locale\n end",
"def unsubscribe_sms\n if current_user\n current_user.update_notification_preference(:push) \n render :text => \"ok\"\n else\n render :text => \"unknown user\"\n end\n end",
"def unvoice(nick,reason=nil,&blk)\n set_role 'visitor', nick, reason, &blk\n end",
"def redir_missing_locale\n explicit_locale = params[:locale]\n return if explicit_locale.present?\n\n # Don't bother redirecting some formats\n return if DO_NOT_REDIRECT_LOCALE.include?(params[:format])\n\n #\n # No locale, determine the best locale and redirect.\n #\n best_locale = find_best_locale\n preferred_url = force_locale_url(request.original_url, best_locale)\n # It's not clear what status code to provide on a locale-based redirect.\n # However, we must avoid 301 (Moved Permanently), because it is certainly\n # not a permanent move.\n # We previously used use 300 (Multiple Choices),\n # because that code indicates there's a redirect based on agent choices\n # (which is certainly true), by doing this:\n # redirect_to preferred_url, status: :multiple_choices # 300\n # It worked on staging, but causes problems in production when trying\n # to redirect the root path, so as emergency we're\n # switching to \"found\" (302) which is supported by everyone.\n redirect_to preferred_url, status: :found\n end",
"def delete\n @language = Language.find(params[:id])\n @language.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url, notice: t(:language_deleted) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @accountadmin_language = AccountadminLanguage.find(params[:id])\n @accountadmin_language.destroy\n\n unless @accountadmin_language.errors.empty?\n flash[:notice] = \"WARNING: Couldn't delete language because:\"\n @accountadmin_language.errors.full_messages.each { |m| flash[:notice] << \"<br/>\" << m }\n end\n\n respond_to do |format|\n format.html { redirect_to(accountadmin_languages_url) }\n format.xml { head :ok }\n end\n end",
"def set_locale\n if I18N_SUPPORTED_LOCALES.include?( params[:locale] )\n if logged_in?\n current_user.update_attribute(:locale, params[:locale])\n end\n session[:locale] = params[:locale]\n end\n redirect_back_or_default( root_url )\n end",
"def remove_protection(pyro_word)\n pyro_word.gsub(/!/,'')\n end",
"def remove_block\n block = params[:block].to_s.underscore\n @user = User.current\n # remove block in all groups\n layout = @user.pref[:my_page_layout] || {}\n %w(top left right).each {|f| (layout[f] ||= []).delete block }\n @user.pref[:my_page_layout] = layout\n @user.pref.save\n redirect_to my_page_layout_path\n end",
"def remove_block\n block = params[:block].to_s.underscore\n @user = User.current\n # remove block in all groups\n layout = @user.pref[:my_page_layout] || {}\n %w(top left right).each {|f| (layout[f] ||= []).delete block }\n @user.pref[:my_page_layout] = layout\n @user.pref.save\n redirect_to my_page_layout_path\n end",
"def delete_translation_address\n super\n end",
"def destroy\n @languagename.destroy\n respond_to do |format|\n format.html { redirect_to languagenames_url, notice: 'Languagename was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def language\n @values.fetch('ai.device.language') { \n @values['ai.device.language'] = nil\n }\n end",
"def delete(action, parameters = {}, session = nil, flash = nil)\n parameters[:locale] = I18n.locale\n super(action, parameters, session, flash)\n end",
"def locale_to_translate_into\n multilanguage_site = settings.multilanguage_site\n default_language = settings.default_language\n if multilanguage_site and session[:locale] != default_language\n session[:locale]\n else\n nil\n end\n end",
"def constrain_freeculture\n session[:name_of_search] = nil\n if params[:remove] == 'true'\n session[:constraints].each {|constraint|\n if constraint[:type] == 'FreeCultureConstraint'\n session[:constraints].delete(constraint)\n break\n end\n }\n else\n session[:constraints] << FreeCultureConstraint.new(:inverted => false )\n end\n \n redirect_to :action => 'browse', :phrs => params[:phrs]\n end",
"def htlal_users_url\n if htlal_language_id\n \"http://how-to-learn-any-language.com/forum/languages.asp?language=#{htlal_language_id}\"\n end\n end",
"def remove_route(route={})\n request :delete, '/routes', route\n end",
"def set_user_language\n @user_language = UserLanguage.find(params[:id])\n end",
"def destroy\n authorize! :destroy, @admin_language_code\n\n @admin_language_code.destroy\n respond_to do |format|\n format.html { redirect_to admin_language_codes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @translation = @locale.translations.find(params[:id])\n @translation.destroy\n redirect_to(locale_translations_url)\n end",
"def translit_non_latin_lang(lang)\n case lang\n when \"ar\",\"ru\",\"el\"\n self.translit\n else\n self\n end\n end",
"def localized\n redirect_to user_omniauth_authorize_path(params[:provider], locale: params[:locale])\n end",
"def handle_locale\n return if request.headers['Accept-Language'].nil?\n\n I18n.locale = case request.headers['Accept-Language'].downcase\n when 'ru' || 'russian'\n :ru\n when 'en' || 'english'\n :en\n else\n I18n.default_locale\n end\n end",
"def uri_for_language(language)\n return LANGUAGE_ENDPOINTS[language] + \"/rest/disambiguate\"\n end",
"def set_website_locale\n app_locales = %w(es ca)\n I18n.locale = params[:lang] if app_locales.include?(params[:lang])\n end",
"def set_language\n @language = current_user.languages.find(params[:language_id])\n end",
"def user_language\n USER_LANGUAGE[spoken_language]\n end",
"def reset_guest!\n original_locale = session[:locale]\n original_scores = session[:show_scores]\n\n sign_out(:user) if user_signed_in?\n reset_session\n\n session[:locale] = original_locale\n session[:show_scores] = original_scores\n\n cookies.delete :guest\n @_guest = nil\n end",
"def remove_block\n @user = User.current\n @user.pref.remove_block params[:block]\n @user.pref.save\n redirect_to my_page_layout_path\n end",
"def set_language\r\n session[:language] = 'english'\r\n end",
"def path_lang\n if @path_lang.nil?\n rp = Regexp.new(@settings['url_pattern_reg'])\n if @settings['use_proxy'] && @env.has_key?('HTTP_X_FORWARDED_HOST')\n match = \"#{@env['HTTP_X_FORWARDED_HOST']}#{@env['REQUEST_URI']}\".match(rp)\n else\n match = \"#{@env['SERVER_NAME']}#{@env['REQUEST_URI']}\".match(rp)\n end\n if match && match[:lang] && Lang.get_lang(match[:lang])\n @path_lang = Lang.get_code(match[:lang])\n else\n @path_lang = ''\n end\n end\n return @path_lang\n end",
"def destroy\n session[:user_id] = nil\n redirect_to root_url, :notice => \"تسجيل الخروج!\"\n end"
] | [
"0.6822575",
"0.6225353",
"0.6104507",
"0.6062999",
"0.6043901",
"0.5913468",
"0.5913468",
"0.5913309",
"0.5735854",
"0.56866145",
"0.5636554",
"0.5629252",
"0.5618913",
"0.5565829",
"0.55654293",
"0.55628204",
"0.5540987",
"0.5540403",
"0.55381083",
"0.55366707",
"0.55249065",
"0.5517531",
"0.5514272",
"0.5510663",
"0.5505778",
"0.55044055",
"0.5477992",
"0.547502",
"0.54535586",
"0.5444371",
"0.54335845",
"0.5423518",
"0.54101443",
"0.54090446",
"0.54030895",
"0.5402021",
"0.5398479",
"0.538451",
"0.5382688",
"0.53777987",
"0.5348812",
"0.5344516",
"0.5336543",
"0.5314543",
"0.5296555",
"0.5286978",
"0.52856886",
"0.5264491",
"0.5256194",
"0.5255082",
"0.52473015",
"0.5244465",
"0.52413094",
"0.52296335",
"0.52230424",
"0.5221021",
"0.5221021",
"0.52122176",
"0.5192963",
"0.51740223",
"0.51648307",
"0.5147764",
"0.513875",
"0.513865",
"0.513646",
"0.51280236",
"0.51215935",
"0.5115421",
"0.51138526",
"0.51067954",
"0.5105822",
"0.5100043",
"0.5095053",
"0.5084506",
"0.5075961",
"0.50675005",
"0.50675005",
"0.50631434",
"0.5062059",
"0.50570846",
"0.5057058",
"0.5054849",
"0.5054114",
"0.5051371",
"0.5051111",
"0.5049556",
"0.50450414",
"0.5036645",
"0.50289303",
"0.50262105",
"0.5014014",
"0.5009601",
"0.5008328",
"0.49939802",
"0.4980406",
"0.49755597",
"0.4967703",
"0.49667218",
"0.49532664",
"0.49421668"
] | 0.548246 | 26 |
Remove routing skill from user | def delete_user_routingskill(user_id, skill_id, opts = {})
delete_user_routingskill_with_http_info(user_id, skill_id, opts)
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove(skillName)\n\n end",
"def destroy\n @skill = @user.skills.find(params[:id])\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_skills_url(@user)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @skill = current_user.skills.find(params[:id])\n @skill.destroy\n\n respond_to do |format|\n flash[:notice] = 'Skill deleted.'\n format.html { redirect_to(user_skills_path(current_user)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_skill = UserSkill.find(params[:id])\n @user_skill.destroy\n\n respond_to do |format|\n format.html { redirect_to user_skills_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @skill_user_profile.destroy\n\n head :no_content\n end",
"def delete_user_route(user)\n self.client.delete(\"gh.storage.user.#{user}\")\n end",
"def destroy\n @skill = Skill.find(params[:id])\n\t\tauthorize! :destroy, Skill\n\t\t\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to skills_url }\n format.json { head :no_content }\n end\n end",
"def remove_requester(user)\n attempted_interpreter_requests.find_by(user_id: user.id).destroy\n end",
"def forget_skill(skill_id)\n @skills.delete(skill_id)\n end",
"def delete_user_routingskill_with_http_info(user_id, skill_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_user_routingskill ...\"\n end\n \n \n # verify the required parameter 'user_id' is set\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling RoutingApi.delete_user_routingskill\" if user_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'skill_id' is set\n fail ArgumentError, \"Missing the required parameter 'skill_id' when calling RoutingApi.delete_user_routingskill\" if skill_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/users/{userId}/routingskills/{skillId}\".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'skillId' + '}', skill_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\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: RoutingApi#delete_user_routingskill\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def delete_user_routingskill_with_http_info(user_id, skill_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_user_routingskill ...\"\n end\n \n \n # verify the required parameter 'user_id' is set\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling RoutingApi.delete_user_routingskill\" if user_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'skill_id' is set\n fail ArgumentError, \"Missing the required parameter 'skill_id' when calling RoutingApi.delete_user_routingskill\" if skill_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/users/{userId}/routingskills/{skillId}\".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'skillId' + '}', skill_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud Auth']\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: RoutingApi#delete_user_routingskill\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def remove_tag\n @user = User.find(params[:id])\n @user.tag = nil\n @user.save\n respond_to do |format|\n format.html { redirect_to(@user.fleet) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vip_skill.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_skills_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip skill: #{@vip_skill.name}\")\n end",
"def remove\n current_user.twins.delete(Twin.find(params[:id]))\n redirect_to user_path(current_user)\n end",
"def destroy\n @user_trick.destroy\n end",
"def remove_permission!(permission)\n remove_permission(permission)\n self.save\n end",
"def unclaim\n timeslot = Timeslot.find(params[:id])\n if current_user.id == timeslot.user_id || current_user.user_role.can_create\n timeslot.user = nil\n timeslot.save\n end\n redirect_to event_path(timeslot.event)\n end",
"def removerole(userrole)\n userrole.delete if userroles.count > 1\n end",
"def kill_player(input_user)\n @enemies_in_sight.delete(input_user)\n end",
"def remove_user(user)\n @in_room = false if user == @bot\n @users.delete(user)\n end",
"def untrust!\n MTurkUtils.untrust_user self\n end",
"def remove_user\n create_user.tap do |r|\n r.action(:remove)\n end\n end",
"def delete_word_from_lexicon(word)\n # should delete the respective row from user_words\n # user_to_update = nil\n target = UserWord.all.find do |entry|\n entry.word_id == word.id\n end\n UserWord.delete(target.id)\n self.reload #refreshes user variable\n end",
"def subtract(skillName, user, skillpoint)\n\n end",
"def remove_route(route={})\n request :delete, '/routes', route\n end",
"def destroy\n @skill.destroy\n\n head :no_content\n end",
"def remove_user(jid)\n users.delete(jid.to_s.downcase)\n end",
"def remove_member(user)\n update_membership(user, false)\n end",
"def destroy\n @skills_user.destroy\n respond_to do |format|\n format.html { redirect_to skills_users_url, notice: 'Skills user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def remove_user\n query_api '/rest/user', nil, 'DELETE'\n end",
"def unshare!( user )\n save if unshare( user )\n end",
"def remove_user(user)\n self.users.destroy(user)\n end",
"def rm_user(member)\n self[:users].delete member\n end",
"def destroy\n @admin_skill.destroy\n\n head :no_content\n end",
"def remove_from_gamespace\n # remove it from the room it's in.\n self.from_room \n self.recycle \n # Possibly in the future return all switches. I.e. an admin taking over an NPC body.\n end",
"def destroy\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_skills_path, \n notice: 'Skill was successfully deleted.' }\n end\n end",
"def remove_user\n\t\troom = Room.find(params[:room_id].to_i)\n\t\tuser = current_user\n\t\troom.users.delete(user) # Deletes user from room when they leave the browser window\n\t\t# --- If no users remain in room, all data about the room deletes itself ---\n\t\tif room.users.length == 0 \n\t\t\troom.songs.each do |song|\n\t\t\t\tsong.destroy\n\t\t\tend\n\t\t\troom.destroy\n\t\tend\n\t\t# --- end ---\n\t\t# Remove user from user-list\n\t\t$redis.publish(\"remove_user_#{room.id}\", {user: current_user.username, id: current_user.id}.to_json) \n\t\t# --- end ---\n\t\trender nothing: true\n\tend",
"def removeWorkingUser user\n @workingUsers.delete user\n end",
"def remove_user_by_id(user_id)\n # ........\n end",
"def remove_user\n query_api \"/rest/user\", nil, \"DELETE\"\n end",
"def destroy\n @user_work_skill.destroy\n respond_to do |format|\n format.html { redirect_to action:\"index\", :user_work_experience_role_id=> @user_work_skill.user_work_experience_role_id }\n format.json { head :no_content }\n end\n end",
"def remove_friend\n end",
"def destroy\n profileSkill = ProfileManager.find_by_skill_id(@skill.id)\n if profileSkill.destroy\n respond_to do |format|\n format.html { redirect_to skills_url, notice: 'Skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to root_path, :flash => { :error => \"Profile Skill was not deleted\" } }\n end\n end\n end",
"def remove_role\n if @user.has_role? params[:role]\n @user.remove_role params[:role]\n render json: { :success => 'role successfully removed' } \n else \n render json: { :success => 'The user does not have this role' }\n end\n end",
"def destroy\n @skill = Skill.find(params[:id])\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to skills_url }\n format.json { head :no_content }\n end\n end",
"def unconfirm_user(user)\n confirmed_interpreter_requests.find_by(user_id: user.id).destroy\n end",
"def destroy\n\t\t@user.delete\n\tend",
"def remove_member\n @team = Team.find(params[:id])\n authorize @team, :update?\n\n @user = User.find(params[:user_id])\n @user.remove_role :member, @team\n\n respond_to do |format|\n format.html { redirect_to @team, notice: 'User was successfully removed as member.' }\n format.json { head :no_content }\n end\n end",
"def delete_user\n end",
"def remove_retailer\n user_id = params[:user_id]\n remove_user(user_id)\n render json: { result: 'success' }, status: 200\n end",
"def destroy\n @user_quest = UserQuest.find(params[:id])\n @user_quest.destroy\n\n respond_to do |format|\n format.html { redirect_to user_quests_url }\n format.json { head :no_content }\n end\n end",
"def unmake_promoted\n @user.remove_role :promoted\n render_success_message('Removed successfully promoted role.')\n end",
"def remove_reverse_friendship\n Friendship.delete_all :user_id => self.friend_id, :friend_id => self.user_id\n end",
"def uninvite\n @meal = Meal.find(params[:meal_id])\n authorize @meal, :update?\n temp_user = @meal.invited_users.find(params[:user_id])\n @meal.invited_users.delete(temp_user)\n redirect_to @meal\n end",
"def unfollow(other_user)\n \tactive_relationships.find_by(followed_id: other_user.id).destroy\n \tend",
"def destroy\n @desired_skill.destroy\n respond_to do |format|\n format.html { redirect_to desired_skills_url, notice: 'Desired skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def unmake_volunteer\n @user.remove_role :volunteer\n render_success_message('Removed successfully volunteer badge.')\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n redirect_to look_up_colonies_path\n\n end",
"def delete_user(user)\n delete user_path(user)\n end",
"def destroy_user(id)\n #TODO:\n # ADD SOME USER LEVEL TO AVOID THESE\n end",
"def unfollow!(user)\n relationships.find_by_followed_id(user).destroy\n end",
"def remove_user(user_id)\n\t\treturn if is_admin?(user_id)\n\t\tparty_list.delete(user_id)\n\t\tself.update_attribute(:party_list, party_list)\n\tend",
"def unfriend(other_user)\n @friendship = user.friendships.find_by(friend: other_user)\n @friendship.destroy\n end",
"def remove\n\t\t@user = User.find_by(id: params[:user_id])\n\t\tif !@user\n\t\t\tflash[:error] = \"User non esistente\"\n\t\t\t#redirect_to user_team_path current_user, @team\n\t\t\treturn\t\t\n\t\tend\n\t\tif @user != current_user\n\t\t\tflash[:error] = \"User non esistente\"\n\t\t\t#redirect_to user_team_path current_user, @team\n\t\t\treturn\n\t\tend\n\t\t@team = Team.find_by(id: params[:team_id])\n\t\tif !@team\n\t\t\tflash[:error] = \"Team non esistente\"\n\t\t\t#redirect_to user_team_path current_user, @team\n\t\t\treturn\n\t\tend\n\t\t@user_to_remove = User.find_by(id: params[:user])\n\t\tif !@user_to_remove\n\t\t\tflash[:error] = \"User da rimuovere non esistente\"\n\t\t\tredirect_to user_team_path current_user, @team\n\t\t\treturn\t\t\n\t\tend\n\t\tauthorize! :remove, @team, :message => \"Non sei autorizzato a rimuovere questo utente\"\n\t\tif is_in_team?(@user_to_remove,@team)\n\t\t\t@team.membro.where(user_id: @user_to_remove.id).destroy_all\n\t\t\t#redirect_to user_team_path current_user, @team\n\t\t\tflash[:success] = \"#{@user_to_remove.nick} è stato eliminato\"\n\t\t\treturn\n\t\tend\n\t\tflash[:error] = \"#{@user_to_remove.nick} non è presente nella squadra\"\n\t\t#redirect_to user_team_path current_user, @team\n\tend",
"def destroy\n @dilemma.destroy\n redirect_to user_path(@dilemma.user_id)\n end",
"def deactivate_user(user, pid)\n\n headers = {:x_storageapi_token => @kbc_api_token, :accept => :json, :content_type => :json}\n\n resource = (\"#{@api_endpoint}/project-users?writerId=#{@writer_id}&pid=#{pid}&email=#{user}\")\n\n resource.gsub!(\"+\", \"%2B\")\n\n response = RestClient.delete resource, headers\n\n return response\n\n end",
"def teardown\n remove_user :login_id => @user.login_id\n end",
"def destroy\n if current_scope.is_a?(Program)\n @user = current_scope.associated_users.find(params[:id])\n @user.remove_program!(current_scope)\n flash[:notice] = \"Access revoked for #{@user}\"\n else\n @user = current_scope.associated_users.find(params[:id])\n @user.remove_account!(current_scope)\n flash[:notice] = \"Access revoked for #{@user}\"\n end\n\n respond_with [:admin, @user]\n end",
"def destroy\n if @relation.user1_id == @currentUser.id or @currentUser.role == 0\n @relation.destroy\n respond_to do |format|\n format.html { redirect_to relations_url, notice: 'Relation was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n redirect_to relations_url, notice: 'You cant revoke anothers users queries'\n end\n end",
"def unfollow_user(user)\n following.delete(user)\n end",
"def remove_member(_team, _user)\n # stub\n end",
"def destroy\n @trial = Trial.find(params[:id])\n @trial.users.delete(User.find session[:userID])\n logger.info(@trial.users)\n session[:current_trial] = nil\n respond_to do |format|\n format.html { redirect_to :controller => 'home', :action => 'index' }\n format.json { head :no_content }\n end\n end",
"def unfollowed(other_user)\n passive_relationships.find_by(follower_id: other_user.id).try(:destroy) \n end",
"def destroy\n @skill.destroy\n if (@skill.kind.between?(0, 3))\n ApplicationController.helpers.updatedrum(@skill.user_id)\n redirect_to drum_user_path(@skill.user_id), :flash => {:success => \"スキル (#{@skill.music.name}) を削除しました.\"}\n else\n ApplicationController.helpers.updateguitar(@skill.user_id)\n redirect_to guitar_user_path(@skill.user_id), :flash => {:success => \"スキル (#{@skill.music.name}) を削除しました.\"}\n end\n end",
"def delete_permissions_for_user(user)\n remove_filtered_policy(0, user)\n end",
"def remove_assistant(user)\n user = User.find(user) unless user.is_a?(User)\n assistants.delete(user)\n return 1\n\n rescue\n return 0\n end",
"def remove_movie_from_likes\n @user = User.find(params[:user_id])\n binding.pry\n @user.likes.delete(params[:id])\n @user.save\n redirect_to user_path(@user)\n end",
"def uncomplete_job(user)\n job_completions.find_by(user_id: user.id).destroy\n end",
"def remove_user(user)\n self.users.destroy(id: user.id)\n end",
"def remove_user(user)\n self.users.destroy(id: user.id)\n end",
"def destroy\n user.destroy\n end",
"def destroy_req_usecase\n find_user\n if !@user.nil?\n req=Requirement.find_by_id(session[:req_id])\n if !session[:req_id].nil? and !req.nil?\n @use_case=UseCase.find(params[:id])\n if !@use_case.nil? and @user.privilige!=\"Read\"\n @use_case.requirements.delete(req)\n end\n respond_to do |format|\n format.html { redirect_to show_usecases_url(req.id) }\n end\n else\n redirect_to requirements_path\n end\n else\n redirect_to sign_in_url\n end\n\n end",
"def unassign_role\n\t\t@user.role_id = Role.get_user_id\n\t\t@user.vendor_id = nil\n\t\t@user.save\n\t\tredirect_to :administrations\n\tend",
"def destroy\n session.delete(:user)\n end",
"def process_trophy_removal\n params.keys.select { |k, _v| k.starts_with? 'remove_trophy_' }.each do |smash_trophy|\n smash_trophy = smash_trophy.sub(/^remove_trophy_/, '')\n current_user.trophies.where(work_id: smash_trophy).destroy_all\n end\n end",
"def unfriend(user)\n friend_name = extract_string(user, :username)\n friend_request 'unfriend', :container => current_user.full_name, :name => friend_name, :type => :friend\n end",
"def remove\n uninstall_yri\n uninstall_yard\n end",
"def destroy\n authorize @user\n @tags = @user.tag_list if @tags.empty?\n @user.tag_list.remove @tags\n if @user.save\n render :json => @user.reload.tags\n else\n error!(:invalid_resource, @user.errors, \"Tags have not been saved\")\n end\n end",
"def unblock_user!(_user_id)\n blocked_users_relationships.where(user_id: _user_id).destroy_all\n end",
"def remove\n if not user_signed_in?\n redirect_to new_user_session_path\n else\n User.find(params[:user_id]).friends.delete(current_user)\n current_user.friends.delete(User.find(params[:user_id]))\n\n redirect_to friends_path\n end\n end",
"def remove_user_with_custom_field()\r\n remove_user_without_custom_field\r\n GroupsUserIndexed.find_by_group_id_and_user_id(@group.id, params[:user_id]).try!(&:destroy)\r\n end",
"def remove_interest\n @interest = Interest.where(\"user_id = ? and property_id= ?\",params[:user_id],params[:property_id])\n @interest.first.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :ok }\n end\n end",
"def remove_from_my_location\n\t\tremove_from_my_location = Location.find(params[:id])\n\n\t\t# Validation prevents a user from deleting a location unless it is linked to their account.\n\t\tif current_user.locations.include?(remove_from_my_location)\n\t\t\tcurrent_user.locations.delete(remove_from_my_location)\n\t\tend\n\n\t\tredirect_to locations_path\n\tend",
"def abandon!\n @user = nil\n session.delete\n end",
"def abandon!\n @user = nil\n session.delete\n end",
"def destroy\n #TODO update hyku user.destroy to do roles.destroy_all instead\n if @user.present? && @user.destroy\n redirect_to main_app.persona_users_path, notice: t('.success', user: @user)\n else\n redirect_to main_app.persona_users_path flash: { error: t('.failure', user: @user) }\n end\n end",
"def destroy\n @person.skills.delete_all\n \n @person.destroy\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end",
"def unmake_watchdog\n authorize! :manage_watchdogs, User\n @user.remove_role [:watchdog, :watchdog_probation]\n render_success_message('Removed successfully watchdog role.')\n end",
"def delete_user(user)\n res1 = remove_filtered_grouping_policy(0, user)\n res2 = remove_filtered_policy(0, user)\n res1 || res2\n end"
] | [
"0.66520846",
"0.65087",
"0.64458805",
"0.64318055",
"0.640045",
"0.63773775",
"0.62562084",
"0.6177585",
"0.61537915",
"0.61395776",
"0.60950154",
"0.607264",
"0.6032688",
"0.5999029",
"0.59834707",
"0.59799224",
"0.5969916",
"0.5962005",
"0.59486455",
"0.5937563",
"0.5924668",
"0.58959943",
"0.5886893",
"0.5880945",
"0.5844626",
"0.5830117",
"0.58264184",
"0.5820361",
"0.5819228",
"0.5816776",
"0.5806366",
"0.58051544",
"0.57994735",
"0.5794124",
"0.57809055",
"0.57696724",
"0.57497126",
"0.574746",
"0.57462054",
"0.5720906",
"0.57164794",
"0.5703422",
"0.57020605",
"0.56986403",
"0.56961924",
"0.5695304",
"0.5694116",
"0.56939346",
"0.56880826",
"0.5677996",
"0.5668382",
"0.56681067",
"0.5662546",
"0.5661399",
"0.56599504",
"0.56568897",
"0.5644587",
"0.56405777",
"0.56376046",
"0.5636399",
"0.56334734",
"0.56329703",
"0.5627256",
"0.5615019",
"0.561281",
"0.56121236",
"0.5610874",
"0.5599176",
"0.55901766",
"0.55842835",
"0.5579806",
"0.5579283",
"0.55763286",
"0.5575601",
"0.5575262",
"0.55737793",
"0.5571442",
"0.5565335",
"0.5559218",
"0.5559218",
"0.55559903",
"0.55438995",
"0.55358815",
"0.55352366",
"0.5533635",
"0.55229956",
"0.55197954",
"0.5512819",
"0.55122733",
"0.54985934",
"0.5496554",
"0.5489312",
"0.54887235",
"0.54848844",
"0.54848844",
"0.54833347",
"0.54815483",
"0.5477402",
"0.5476436"
] | 0.6129079 | 11 |
Remove routing skill from user | def delete_user_routingskill_with_http_info(user_id, skill_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.delete_user_routingskill ..."
end
# verify the required parameter 'user_id' is set
fail ArgumentError, "Missing the required parameter 'user_id' when calling RoutingApi.delete_user_routingskill" if user_id.nil?
# verify the required parameter 'skill_id' is set
fail ArgumentError, "Missing the required parameter 'skill_id' when calling RoutingApi.delete_user_routingskill" if skill_id.nil?
# resource path
local_var_path = "/api/v2/users/{userId}/routingskills/{skillId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'skillId' + '}', skill_id.to_s)
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#delete_user_routingskill\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove(skillName)\n\n end",
"def destroy\n @skill = @user.skills.find(params[:id])\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_skills_url(@user)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @skill = current_user.skills.find(params[:id])\n @skill.destroy\n\n respond_to do |format|\n flash[:notice] = 'Skill deleted.'\n format.html { redirect_to(user_skills_path(current_user)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_skill = UserSkill.find(params[:id])\n @user_skill.destroy\n\n respond_to do |format|\n format.html { redirect_to user_skills_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @skill_user_profile.destroy\n\n head :no_content\n end",
"def delete_user_route(user)\n self.client.delete(\"gh.storage.user.#{user}\")\n end",
"def destroy\n @skill = Skill.find(params[:id])\n\t\tauthorize! :destroy, Skill\n\t\t\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to skills_url }\n format.json { head :no_content }\n end\n end",
"def remove_requester(user)\n attempted_interpreter_requests.find_by(user_id: user.id).destroy\n end",
"def forget_skill(skill_id)\n @skills.delete(skill_id)\n end",
"def delete_user_routingskill(user_id, skill_id, opts = {})\n delete_user_routingskill_with_http_info(user_id, skill_id, opts)\n return nil\n end",
"def delete_user_routingskill(user_id, skill_id, opts = {})\n delete_user_routingskill_with_http_info(user_id, skill_id, opts)\n return nil\n end",
"def delete_user_routingskill_with_http_info(user_id, skill_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.delete_user_routingskill ...\"\n end\n \n \n # verify the required parameter 'user_id' is set\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling RoutingApi.delete_user_routingskill\" if user_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'skill_id' is set\n fail ArgumentError, \"Missing the required parameter 'skill_id' when calling RoutingApi.delete_user_routingskill\" if skill_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/users/{userId}/routingskills/{skillId}\".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'skillId' + '}', skill_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud Auth']\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: RoutingApi#delete_user_routingskill\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def remove_tag\n @user = User.find(params[:id])\n @user.tag = nil\n @user.save\n respond_to do |format|\n format.html { redirect_to(@user.fleet) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vip_skill.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_skills_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip skill: #{@vip_skill.name}\")\n end",
"def remove\n current_user.twins.delete(Twin.find(params[:id]))\n redirect_to user_path(current_user)\n end",
"def destroy\n @user_trick.destroy\n end",
"def remove_permission!(permission)\n remove_permission(permission)\n self.save\n end",
"def unclaim\n timeslot = Timeslot.find(params[:id])\n if current_user.id == timeslot.user_id || current_user.user_role.can_create\n timeslot.user = nil\n timeslot.save\n end\n redirect_to event_path(timeslot.event)\n end",
"def removerole(userrole)\n userrole.delete if userroles.count > 1\n end",
"def kill_player(input_user)\n @enemies_in_sight.delete(input_user)\n end",
"def remove_user(user)\n @in_room = false if user == @bot\n @users.delete(user)\n end",
"def untrust!\n MTurkUtils.untrust_user self\n end",
"def remove_user\n create_user.tap do |r|\n r.action(:remove)\n end\n end",
"def delete_word_from_lexicon(word)\n # should delete the respective row from user_words\n # user_to_update = nil\n target = UserWord.all.find do |entry|\n entry.word_id == word.id\n end\n UserWord.delete(target.id)\n self.reload #refreshes user variable\n end",
"def subtract(skillName, user, skillpoint)\n\n end",
"def remove_route(route={})\n request :delete, '/routes', route\n end",
"def destroy\n @skill.destroy\n\n head :no_content\n end",
"def remove_user(jid)\n users.delete(jid.to_s.downcase)\n end",
"def remove_member(user)\n update_membership(user, false)\n end",
"def destroy\n @skills_user.destroy\n respond_to do |format|\n format.html { redirect_to skills_users_url, notice: 'Skills user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def remove_user\n query_api '/rest/user', nil, 'DELETE'\n end",
"def unshare!( user )\n save if unshare( user )\n end",
"def remove_user(user)\n self.users.destroy(user)\n end",
"def rm_user(member)\n self[:users].delete member\n end",
"def destroy\n @admin_skill.destroy\n\n head :no_content\n end",
"def remove_from_gamespace\n # remove it from the room it's in.\n self.from_room \n self.recycle \n # Possibly in the future return all switches. I.e. an admin taking over an NPC body.\n end",
"def destroy\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_skills_path, \n notice: 'Skill was successfully deleted.' }\n end\n end",
"def remove_user\n\t\troom = Room.find(params[:room_id].to_i)\n\t\tuser = current_user\n\t\troom.users.delete(user) # Deletes user from room when they leave the browser window\n\t\t# --- If no users remain in room, all data about the room deletes itself ---\n\t\tif room.users.length == 0 \n\t\t\troom.songs.each do |song|\n\t\t\t\tsong.destroy\n\t\t\tend\n\t\t\troom.destroy\n\t\tend\n\t\t# --- end ---\n\t\t# Remove user from user-list\n\t\t$redis.publish(\"remove_user_#{room.id}\", {user: current_user.username, id: current_user.id}.to_json) \n\t\t# --- end ---\n\t\trender nothing: true\n\tend",
"def removeWorkingUser user\n @workingUsers.delete user\n end",
"def remove_user_by_id(user_id)\n # ........\n end",
"def remove_user\n query_api \"/rest/user\", nil, \"DELETE\"\n end",
"def destroy\n @user_work_skill.destroy\n respond_to do |format|\n format.html { redirect_to action:\"index\", :user_work_experience_role_id=> @user_work_skill.user_work_experience_role_id }\n format.json { head :no_content }\n end\n end",
"def remove_friend\n end",
"def destroy\n profileSkill = ProfileManager.find_by_skill_id(@skill.id)\n if profileSkill.destroy\n respond_to do |format|\n format.html { redirect_to skills_url, notice: 'Skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to root_path, :flash => { :error => \"Profile Skill was not deleted\" } }\n end\n end\n end",
"def remove_role\n if @user.has_role? params[:role]\n @user.remove_role params[:role]\n render json: { :success => 'role successfully removed' } \n else \n render json: { :success => 'The user does not have this role' }\n end\n end",
"def destroy\n @skill = Skill.find(params[:id])\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to skills_url }\n format.json { head :no_content }\n end\n end",
"def unconfirm_user(user)\n confirmed_interpreter_requests.find_by(user_id: user.id).destroy\n end",
"def destroy\n\t\t@user.delete\n\tend",
"def remove_member\n @team = Team.find(params[:id])\n authorize @team, :update?\n\n @user = User.find(params[:user_id])\n @user.remove_role :member, @team\n\n respond_to do |format|\n format.html { redirect_to @team, notice: 'User was successfully removed as member.' }\n format.json { head :no_content }\n end\n end",
"def delete_user\n end",
"def remove_retailer\n user_id = params[:user_id]\n remove_user(user_id)\n render json: { result: 'success' }, status: 200\n end",
"def destroy\n @user_quest = UserQuest.find(params[:id])\n @user_quest.destroy\n\n respond_to do |format|\n format.html { redirect_to user_quests_url }\n format.json { head :no_content }\n end\n end",
"def unmake_promoted\n @user.remove_role :promoted\n render_success_message('Removed successfully promoted role.')\n end",
"def remove_reverse_friendship\n Friendship.delete_all :user_id => self.friend_id, :friend_id => self.user_id\n end",
"def uninvite\n @meal = Meal.find(params[:meal_id])\n authorize @meal, :update?\n temp_user = @meal.invited_users.find(params[:user_id])\n @meal.invited_users.delete(temp_user)\n redirect_to @meal\n end",
"def unfollow(other_user)\n \tactive_relationships.find_by(followed_id: other_user.id).destroy\n \tend",
"def destroy\n @desired_skill.destroy\n respond_to do |format|\n format.html { redirect_to desired_skills_url, notice: 'Desired skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def unmake_volunteer\n @user.remove_role :volunteer\n render_success_message('Removed successfully volunteer badge.')\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n redirect_to look_up_colonies_path\n\n end",
"def delete_user(user)\n delete user_path(user)\n end",
"def destroy_user(id)\n #TODO:\n # ADD SOME USER LEVEL TO AVOID THESE\n end",
"def unfollow!(user)\n relationships.find_by_followed_id(user).destroy\n end",
"def remove_user(user_id)\n\t\treturn if is_admin?(user_id)\n\t\tparty_list.delete(user_id)\n\t\tself.update_attribute(:party_list, party_list)\n\tend",
"def unfriend(other_user)\n @friendship = user.friendships.find_by(friend: other_user)\n @friendship.destroy\n end",
"def remove\n\t\t@user = User.find_by(id: params[:user_id])\n\t\tif !@user\n\t\t\tflash[:error] = \"User non esistente\"\n\t\t\t#redirect_to user_team_path current_user, @team\n\t\t\treturn\t\t\n\t\tend\n\t\tif @user != current_user\n\t\t\tflash[:error] = \"User non esistente\"\n\t\t\t#redirect_to user_team_path current_user, @team\n\t\t\treturn\n\t\tend\n\t\t@team = Team.find_by(id: params[:team_id])\n\t\tif !@team\n\t\t\tflash[:error] = \"Team non esistente\"\n\t\t\t#redirect_to user_team_path current_user, @team\n\t\t\treturn\n\t\tend\n\t\t@user_to_remove = User.find_by(id: params[:user])\n\t\tif !@user_to_remove\n\t\t\tflash[:error] = \"User da rimuovere non esistente\"\n\t\t\tredirect_to user_team_path current_user, @team\n\t\t\treturn\t\t\n\t\tend\n\t\tauthorize! :remove, @team, :message => \"Non sei autorizzato a rimuovere questo utente\"\n\t\tif is_in_team?(@user_to_remove,@team)\n\t\t\t@team.membro.where(user_id: @user_to_remove.id).destroy_all\n\t\t\t#redirect_to user_team_path current_user, @team\n\t\t\tflash[:success] = \"#{@user_to_remove.nick} è stato eliminato\"\n\t\t\treturn\n\t\tend\n\t\tflash[:error] = \"#{@user_to_remove.nick} non è presente nella squadra\"\n\t\t#redirect_to user_team_path current_user, @team\n\tend",
"def destroy\n @dilemma.destroy\n redirect_to user_path(@dilemma.user_id)\n end",
"def deactivate_user(user, pid)\n\n headers = {:x_storageapi_token => @kbc_api_token, :accept => :json, :content_type => :json}\n\n resource = (\"#{@api_endpoint}/project-users?writerId=#{@writer_id}&pid=#{pid}&email=#{user}\")\n\n resource.gsub!(\"+\", \"%2B\")\n\n response = RestClient.delete resource, headers\n\n return response\n\n end",
"def teardown\n remove_user :login_id => @user.login_id\n end",
"def destroy\n if current_scope.is_a?(Program)\n @user = current_scope.associated_users.find(params[:id])\n @user.remove_program!(current_scope)\n flash[:notice] = \"Access revoked for #{@user}\"\n else\n @user = current_scope.associated_users.find(params[:id])\n @user.remove_account!(current_scope)\n flash[:notice] = \"Access revoked for #{@user}\"\n end\n\n respond_with [:admin, @user]\n end",
"def destroy\n if @relation.user1_id == @currentUser.id or @currentUser.role == 0\n @relation.destroy\n respond_to do |format|\n format.html { redirect_to relations_url, notice: 'Relation was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n redirect_to relations_url, notice: 'You cant revoke anothers users queries'\n end\n end",
"def unfollow_user(user)\n following.delete(user)\n end",
"def remove_member(_team, _user)\n # stub\n end",
"def destroy\n @trial = Trial.find(params[:id])\n @trial.users.delete(User.find session[:userID])\n logger.info(@trial.users)\n session[:current_trial] = nil\n respond_to do |format|\n format.html { redirect_to :controller => 'home', :action => 'index' }\n format.json { head :no_content }\n end\n end",
"def unfollowed(other_user)\n passive_relationships.find_by(follower_id: other_user.id).try(:destroy) \n end",
"def destroy\n @skill.destroy\n if (@skill.kind.between?(0, 3))\n ApplicationController.helpers.updatedrum(@skill.user_id)\n redirect_to drum_user_path(@skill.user_id), :flash => {:success => \"スキル (#{@skill.music.name}) を削除しました.\"}\n else\n ApplicationController.helpers.updateguitar(@skill.user_id)\n redirect_to guitar_user_path(@skill.user_id), :flash => {:success => \"スキル (#{@skill.music.name}) を削除しました.\"}\n end\n end",
"def delete_permissions_for_user(user)\n remove_filtered_policy(0, user)\n end",
"def remove_assistant(user)\n user = User.find(user) unless user.is_a?(User)\n assistants.delete(user)\n return 1\n\n rescue\n return 0\n end",
"def remove_movie_from_likes\n @user = User.find(params[:user_id])\n binding.pry\n @user.likes.delete(params[:id])\n @user.save\n redirect_to user_path(@user)\n end",
"def uncomplete_job(user)\n job_completions.find_by(user_id: user.id).destroy\n end",
"def remove_user(user)\n self.users.destroy(id: user.id)\n end",
"def remove_user(user)\n self.users.destroy(id: user.id)\n end",
"def destroy\n user.destroy\n end",
"def destroy_req_usecase\n find_user\n if !@user.nil?\n req=Requirement.find_by_id(session[:req_id])\n if !session[:req_id].nil? and !req.nil?\n @use_case=UseCase.find(params[:id])\n if !@use_case.nil? and @user.privilige!=\"Read\"\n @use_case.requirements.delete(req)\n end\n respond_to do |format|\n format.html { redirect_to show_usecases_url(req.id) }\n end\n else\n redirect_to requirements_path\n end\n else\n redirect_to sign_in_url\n end\n\n end",
"def unassign_role\n\t\t@user.role_id = Role.get_user_id\n\t\t@user.vendor_id = nil\n\t\t@user.save\n\t\tredirect_to :administrations\n\tend",
"def destroy\n session.delete(:user)\n end",
"def process_trophy_removal\n params.keys.select { |k, _v| k.starts_with? 'remove_trophy_' }.each do |smash_trophy|\n smash_trophy = smash_trophy.sub(/^remove_trophy_/, '')\n current_user.trophies.where(work_id: smash_trophy).destroy_all\n end\n end",
"def unfriend(user)\n friend_name = extract_string(user, :username)\n friend_request 'unfriend', :container => current_user.full_name, :name => friend_name, :type => :friend\n end",
"def remove\n uninstall_yri\n uninstall_yard\n end",
"def destroy\n authorize @user\n @tags = @user.tag_list if @tags.empty?\n @user.tag_list.remove @tags\n if @user.save\n render :json => @user.reload.tags\n else\n error!(:invalid_resource, @user.errors, \"Tags have not been saved\")\n end\n end",
"def unblock_user!(_user_id)\n blocked_users_relationships.where(user_id: _user_id).destroy_all\n end",
"def remove\n if not user_signed_in?\n redirect_to new_user_session_path\n else\n User.find(params[:user_id]).friends.delete(current_user)\n current_user.friends.delete(User.find(params[:user_id]))\n\n redirect_to friends_path\n end\n end",
"def remove_user_with_custom_field()\r\n remove_user_without_custom_field\r\n GroupsUserIndexed.find_by_group_id_and_user_id(@group.id, params[:user_id]).try!(&:destroy)\r\n end",
"def remove_interest\n @interest = Interest.where(\"user_id = ? and property_id= ?\",params[:user_id],params[:property_id])\n @interest.first.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :ok }\n end\n end",
"def remove_from_my_location\n\t\tremove_from_my_location = Location.find(params[:id])\n\n\t\t# Validation prevents a user from deleting a location unless it is linked to their account.\n\t\tif current_user.locations.include?(remove_from_my_location)\n\t\t\tcurrent_user.locations.delete(remove_from_my_location)\n\t\tend\n\n\t\tredirect_to locations_path\n\tend",
"def abandon!\n @user = nil\n session.delete\n end",
"def abandon!\n @user = nil\n session.delete\n end",
"def destroy\n #TODO update hyku user.destroy to do roles.destroy_all instead\n if @user.present? && @user.destroy\n redirect_to main_app.persona_users_path, notice: t('.success', user: @user)\n else\n redirect_to main_app.persona_users_path flash: { error: t('.failure', user: @user) }\n end\n end",
"def destroy\n @person.skills.delete_all\n \n @person.destroy\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end",
"def unmake_watchdog\n authorize! :manage_watchdogs, User\n @user.remove_role [:watchdog, :watchdog_probation]\n render_success_message('Removed successfully watchdog role.')\n end",
"def delete_user(user)\n res1 = remove_filtered_grouping_policy(0, user)\n res2 = remove_filtered_policy(0, user)\n res1 || res2\n end"
] | [
"0.66520846",
"0.65087",
"0.64458805",
"0.64318055",
"0.640045",
"0.63773775",
"0.62562084",
"0.6177585",
"0.61537915",
"0.6129079",
"0.6129079",
"0.60950154",
"0.607264",
"0.6032688",
"0.5999029",
"0.59834707",
"0.59799224",
"0.5969916",
"0.5962005",
"0.59486455",
"0.5937563",
"0.5924668",
"0.58959943",
"0.5886893",
"0.5880945",
"0.5844626",
"0.5830117",
"0.58264184",
"0.5820361",
"0.5819228",
"0.5816776",
"0.5806366",
"0.58051544",
"0.57994735",
"0.5794124",
"0.57809055",
"0.57696724",
"0.57497126",
"0.574746",
"0.57462054",
"0.5720906",
"0.57164794",
"0.5703422",
"0.57020605",
"0.56986403",
"0.56961924",
"0.5695304",
"0.5694116",
"0.56939346",
"0.56880826",
"0.5677996",
"0.5668382",
"0.56681067",
"0.5662546",
"0.5661399",
"0.56599504",
"0.56568897",
"0.5644587",
"0.56405777",
"0.56376046",
"0.5636399",
"0.56334734",
"0.56329703",
"0.5627256",
"0.5615019",
"0.561281",
"0.56121236",
"0.5610874",
"0.5599176",
"0.55901766",
"0.55842835",
"0.5579806",
"0.5579283",
"0.55763286",
"0.5575601",
"0.5575262",
"0.55737793",
"0.5571442",
"0.5565335",
"0.5559218",
"0.5559218",
"0.55559903",
"0.55438995",
"0.55358815",
"0.55352366",
"0.5533635",
"0.55229956",
"0.55197954",
"0.5512819",
"0.55122733",
"0.54985934",
"0.5496554",
"0.5489312",
"0.54887235",
"0.54848844",
"0.54848844",
"0.54833347",
"0.54815483",
"0.5477402",
"0.5476436"
] | 0.61395776 | 9 |
Get the list of supported languages. | def get_routing_languages(opts = {})
data, _status_code, _headers = get_routing_languages_with_http_info(opts)
return data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def supported_languages\n return self.supported_locales.present? ? self.supported_locales : [\"en\"]\n end",
"def getlist\r\n result = SUPPORTED_LANG_LIST\r\n end",
"def get_language_list\n call :get_language_list\n end",
"def languages\n translations.map(&:language)\n end",
"def languages\n return [] if @grpc.property.nil?\n @languages ||= Array(@grpc.property.detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n get(\"/repos/show/#{owner.login}/#{name}/languages\")['languages']\n end",
"def available_languages\n AppConfig.available_languages\n end",
"def get_ocr_supported_languages\n path = '/v3/miscellaneous/ocr-languages-list'\n\n headers = {\n 'Content-Type' => 'application/json',\n 'User-Agent' => Config.user_agent\n }\n request = Net::HTTP::Get.new(path, headers)\n handle_response(@api_client.request(request), 'get_ocr_supported_languages')\n end",
"def languages\n return @languages\n end",
"def languages(options={})\n res = self.get \"/translate/service/languages\", :query => options\n check_for_errors(res)\n res['response']\n end",
"def list_lang\n call! :list_lang\n end",
"def languages\n ['HTML', 'Javascript', 'CSS', 'PHP', 'ERB', 'Ruby', 'Objective-C']\n end",
"def loaded_languages\n @@languages.keys\n end",
"def available_locales\n translations = Dir.glob('config/locales/*').map { |locale| locale.split('/').last.split('.').first }\n locales = []\n translations.each do |t|\n value = (t == 'zh' ? 'zh-CN' : t)\n locales << [LanguageList::LanguageInfo.find(t).name, value]\n end\n locales\n end",
"def get_languages\n response = get_siteinfo('languages')\n ret = {}\n response['query']['languages'].each { |l| ret[l['code']] = l['*'] }\n ret\n end",
"def get_languages(options = {})\n object_from_response(GogoKit::PagedResource,\n GogoKit::LanguagesRepresenter,\n :get,\n get_root.links['viagogo:languages'].href,\n options)\n end",
"def available_locales\n []\n end",
"def getLangs\r\n result = self.class.get '/getLangs', { query:{ key:@@api_key } }\r\n check_result result\r\n end",
"def available_locales\n locales = Language.sorted_by_abbreviation.pluck(:abbreviation).presence if Language.table_exists?\n (locales.presence || [default_locale])\n end",
"def get_languages\r\n @xml_doc.xpath(\"/TextDatabase/Languages/Language\").inject([]) do |languages, lang_node|\r\n language = empty_to_nil(lang_node[\"Id\"])\r\n languages.push(language)\r\n end\r\n end",
"def available_locales\n evaluate_localization_option!(:available_locales)\n end",
"def languages\n value.document.fetch(\"#{value.key}_lang\", [])\n end",
"def accepted_languages()\n # no language accepted\n return [] if request.env[\"HTTP_ACCEPT_LANGUAGE\"].nil?\n \n # parse Accept-Language\n accepted = request.env[\"HTTP_ACCEPT_LANGUAGE\"].split(\",\")\n accepted = accepted.map { |l| l.strip.split(\";\") }\n accepted = accepted.map { |l|\n if (l.size == 2)\n # quality present\n #[ l[0].split(\"-\")[0].downcase, l[1].sub(/^q=/, \"\").to_f ]\n else\n # no quality specified => quality == 1\n #[ l[0].split(\"-\")[0].downcase, 1.0 ]\n ll = l[0].split(\"-\")\n if (ll.size > 1)\n [ll[0], ll[1].upcase]\n else\n []\n end\n end\n }\n accepted[0].join(\"-\") if accepted[0]\n end",
"def lang_files\n @@languages\n end",
"def accepted_locales\n http_accept_language = request.env['HTTP_ACCEPT_LANGUAGE']\n return [] if http_accept_language.blank?\n langs = http_accept_language.scan(/([a-zA-Z]{2,4})(?:-[a-zA-Z]{2})?(?:;q=(1|0?\\.[0-9]{1,3}))?/).map do |pair|\n lang, q = pair\n [lang.to_sym, (q || '1').to_f]\n end\n langs.sort_by { |lang, q| q }.map { |lang, q| lang }.reverse.uniq\n end",
"def available_locales\r\n ::LinguaFranca.available_locales\r\n end",
"def languages\n @bio.fetch('Languages')\n end",
"def available_locales\n resource.translations.all(:fields => [:locale_tag], :unique => true).map { |t| t.locale }\n end",
"def available_locales\n @available_locales ||= self.languages.published\n end",
"def available_locales\n self.locales.map { |locale| locale.to_sym }\n end",
"def languages\n h2 :languages\n p (langs = @record.languages).empty? ? '-' : langs.map(&:to_s).join(', ')\n gap\n end",
"def select_languages_localized\n available_languages.map{ |x| known_languages.assoc(x)}.map{ |y| [y[2],y[0]]}.sort!\n end",
"def supported_language_codes\n language_codes = TranslationsHelper.supported_language_codes\n\n if language_codes.empty?\n return_error_infos(400, 'Error no supported languages', 'TranslationError', nil)\n else\n render :status => 200, :json => { :language_codes => language_codes }\n end\n end",
"def languages=(value)\n @languages = value\n end",
"def available_locales; end",
"def available_locales; end",
"def display_all_languages\n # Interface method\n end",
"def loaded_languages\n @@cached_language_data.keys\n end",
"def languages\n result = []\n @mods_ng_xml.language.each { |n|\n # get languageTerm codes and add their translations to the result\n n.code_term.each { |ct|\n if ct.authority.match(/^iso639/)\n begin\n vals = ct.text.split(/[,|\\ ]/).reject {|x| x.strip.length == 0 }\n vals.each do |v|\n result << ISO_639.find(v.strip).english_name\n end\n rescue => e\n p \"Couldn't find english name for #{ct.text}\"\n result << ct.text\n end\n else\n result << ct.text\n end\n }\n # add languageTerm text values\n n.text_term.each { |tt|\n val = tt.text.strip\n result << val if val.length > 0\n }\n\n # add language values that aren't in languageTerm subelement\n if n.languageTerm.size == 0\n result << n.text\n end\n }\n result.uniq\n end",
"def language_codes_for_select\n configuration(:languages).collect { |language|\n language[:language_code]\n }\n end",
"def list_languages\n\t\trender json: Language.all.to_json\n\tend",
"def get_voice_languages\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/lang'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n return nil if _context.response.status_code == 404\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"def available_locales\n translation_model.all(:fields => [:locale_tag], :unique => true).map { |t| t.locale }\n end",
"def languages_required\n possible_languages = {\n java: nil,\n javascript: nil,\n ruby: nil,\n python: nil,\n scala: nil,\n clojure: nil,\n go: nil,\n node: nil\n }\n description = @description.downcase\n\n possible_languages.each do |language, value|\n if description.include?(language.to_s)\n possible_languages[language] = true\n else\n possible_languages[language] = false\n end\n end\n\n possible_languages\n end",
"def language_codes_for_select\n configuration(:languages).collect{ |language|\n language[:language_code]\n }\n end",
"def all_languages\n project_file = XCProjectFile.new(@xcode_proj_path)\n project_file.project[\"knownRegions\"].select { |r| r != \"Base\" }\n end",
"def all_languages\n project_file = XCProjectFile.new(@xcode_proj_path)\n project_file.project[\"knownRegions\"].select { |r| r != \"Base\" }\n end",
"def translate_list_language_names project_id:, language_code: \"en\"\n # [START translate_list_language_names]\n # project_id = \"Your Google Cloud project ID\"\n\n # To receive the names of the supported languages, provide the code\n # for the language in which you wish to receive the names\n # language_code = \"en\"\n\n require \"google/cloud/translate\"\n\n translate = Google::Cloud::Translate.translation_v2_service project_id: project_id\n languages = translate.languages language_code\n\n puts \"Supported languages:\"\n languages.each do |language|\n puts \"#{language.code} #{language.name}\"\n end\n # [END translate_list_language_names]\nend",
"def languages(options = {})\n Babel.distances(self, options).map() {|item| item.first}\n end",
"def get_locales\n fall_back = [:ru].to_yaml\n locales = CustomSetting.find_or_create_by_name(\"languages\").value || fall_back\n begin\n locales = YAML::load(locales)\n rescue\n locales = YAML::load(fall_back)\n end\n end",
"def available_locales\n init_translations unless initialized?\n translations.inject([]) do |locales, (locale, data)|\n locales << locale unless (data.keys - [:i18n]).empty?\n locales\n end\n end",
"def addl_languages_names\n self.dig_for_array(\"addlLanguageNames\")\n end",
"def available_locales_set; end",
"def languages\n return [:en] unless abstract_form_valid?\n l = questions.collect { |q| (q.qtext.is_a?(Hash) ? q.qtext.keys : nil) }.flatten.compact.uniq\n (l.nil? || l.empty?) ? [:en] : l\n end",
"def select_languages_native\n available_languages.map{ |x| known_languages.assoc(x)}.map{ |y| [y[1],y[0]]}.sort!\n end",
"def get_voice_languages\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/lang'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # validate response against endpoint and global error codes\r\n if _context.response.status_code == 404\r\n return nil\r\n end\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n return _context.response.raw_body\r\n end",
"def available_translations\n {\n 'en' => 'English',\n 'es' => 'Español',\n 'pt-BR' => 'Português do Brasil'\n }\n end",
"def user_languages_hash\n result = Hash.new\n\n I18n.available_locales.each do |locale|\n result[t(\"languages.#{locale.to_s}\")] = locale.to_s\n end\n \n return result\n end",
"def languages\n @xml.xpath('//language').map do |lang|\n lang.text.to_s.gsub(/\\.|\\,/,'').strip.capitalize.gsub(\"Finding aid written in english\", \"English\")\n end.uniq\n end",
"def all_languages\n Dir.entries(metadata_path)\n .select { |f| File.directory? File.join(metadata_path, f) }\n .reject { |f| f.start_with?('.') }\n .sort { |x, y| x <=> y }\n end",
"def accepted_languages=(languages)\n @accepted_languages = languages\n end",
"def languages\n documents.collect(&:sections).flatten.collect(&:examples).flatten.map(&:language).compact.uniq\n end",
"def languages\n document.search(\"h5[text()='Language:'] ~ a[@href*=/language/']\").map { |link| link.innerHTML.strip.imdb_unescape_html } rescue []\n end",
"def languages_spoken\n self.dig_for_array(\"languagesSpoken\")\n end",
"def languages_as_uri\n languages.pluck(:name).map do |language|\n ControlledVocabulary.era.language.from_value(language)\n end\n end",
"def available_locales\n @available_locales ||= begin\n locales = Set.new\n @read.map do |pattern|\n [pattern, Dir.glob(pattern % {locale: '*'})] if pattern.include?('%{locale}')\n end.compact.each do |pattern, paths|\n p = pattern.gsub('\\\\', '\\\\\\\\').gsub('/', '\\/').gsub('.', '\\.')\n p = p.gsub(/(\\*+)/) { $1 == '**' ? '.*' : '[^/]*?' }.gsub('%{locale}', '([^/.]+)')\n re = /\\A#{p}\\z/\n paths.each do |path|\n if re =~ path\n locales << $1\n end\n end\n end\n locales\n end\n end",
"def get_locales(defaults=[])\n if self.available_locales.present?\n self.available_locales\n else\n defaults\n end\n end",
"def translate_v3_get_supported_languages_for_target\n # [START translate_v3_get_supported_languages_for_target]\n require \"google/cloud/translate\"\n\n client = Google::Cloud::Translate.new\n\n project_id = \"[Google Cloud Project ID]\"\n location_id = \"[LOCATION ID]\"\n language_code = \"en\"\n\n parent = client.class.location_path project_id, location_id\n\n response = client.get_supported_languages parent, display_language_code: language_code\n\n # List language codes of supported languages\n response.languages.each do |language|\n puts \"Language Code: #{language.language_code}\"\n puts \"Display Name: #{language.display_name}\"\n end\n # [END translate_v3_get_supported_languages_for_target]\nend",
"def languages\n @item_attributes.first.languages.first.language.inject([]) do |m, l|\n m << (l.send('name').to_s rescue nil)\n m\n end.compact.uniq\n end",
"def getcodes\r\n result = SUPPORTED_LANG_CODES\r\n end",
"def enabled_locales\n self[:enabled_locales].split(\",\").map(&:to_sym)\n end",
"def enabled_locales\n self[:enabled_locales].split(\",\").map(&:to_sym)\n end",
"def languages_as_uri\n languages.pluck(:name).map do |language|\n CONTROLLED_VOCABULARIES[:language].send(language)\n end\n end",
"def available_locales\n @available_locales ||= begin\n locales = Set.new\n Array(config[:read]).map do |pattern|\n [pattern, Dir.glob(format(pattern, locale: '*'))] if pattern.include?('%{locale}')\n end.compact.each do |pattern, paths|\n p = pattern.gsub('\\\\', '\\\\\\\\').gsub('/', '\\/').gsub('.', '\\.')\n p = p.gsub(/(\\*+)/) { Regexp.last_match(1) == '**' ? '.*' : '[^/]*?' }.gsub('%{locale}', '([^/.]+)')\n re = /\\A#{p}\\z/\n paths.each do |path|\n locales << Regexp.last_match(1) if re =~ path\n end\n end\n locales\n end\n end",
"def available_locales\n init_names unless init_names?\n names.keys\n end",
"def language_options(current_value = nil)\n standard_options = [ [t('patient.helper.language.English'),nil] ]\n full_set = standard_options + Config.find_or_create_by(config_key: 'language').options\n\n options_plus_current(full_set, current_value)\n end",
"def preferred_locales\n read_attribute(\"preferred_locales\").map(&:to_sym)\n end",
"def languages\n @selects = YAML.load_file(\"#{ExpressTranslate.root}/config/languages.yml\")\n @origin = Language.get_origin(params[:packages])\n @origin_keys = @origin.present? ? LanguageDetail.info(@origin).all.collect{|x| x['code']} : []\n @languages = Package.find(params[:packages])['language']\n @max = @origin.nil? ? 1 : LanguageDetail.info(@origin).all.count\n @LanguageDetail = LanguageDetail\n @Package = Package\n render :action => :languages, layout: 'express_translate/translate'\n end",
"def languages(*values)\n values.inject(self) { |res, val| res._languages(val) or fail ArgumentError, \"Unknown value for languages: #{val}\" }\n end",
"def languages(repo, options = {})\n paginate \"#{Repository.path repo}/languages\", options\n end",
"def language\n fetch('dnd.languages')\n end",
"def pbGetLanguage()\n getUserDefaultLangID=Win32API.new(\"kernel32\",\"GetUserDefaultLangID\",\"\",\"i\") rescue nil\n ret=0\n if getUserDefaultLangID\n ret=getUserDefaultLangID.call()&0x3FF\n end\n if ret==0 # Unknown\n ret=MiniRegistry.get(MiniRegistry::HKEY_CURRENT_USER,\n \"Control Panel\\\\Desktop\\\\ResourceLocale\",\"\",0)\n ret=MiniRegistry.get(MiniRegistry::HKEY_CURRENT_USER,\n \"Control Panel\\\\International\",\"Locale\",\"0\").to_i(16) if ret==0\n ret=ret&0x3FF\n return 0 if ret==0 # Unknown\n end\n return 1 if ret==0x11 # Japanese\n return 2 if ret==0x09 # English\n return 3 if ret==0x0C # French\n return 4 if ret==0x10 # Italian\n return 5 if ret==0x07 # German\n return 7 if ret==0x0A # Spanish\n return 8 if ret==0x12 # Korean\n return 2 # Use 'English' by default\nend",
"def locales\n get(\"locales\")[\"locales\"]\n end",
"def language\n @language ||= LanguageDetector.new\n end",
"def available_translations\n missing_locales = Gallifreyian::Configuration.available_locales - translations.map(&:language)\n missing_locales.each do |locale|\n self.translations << Gallifreyian::Translation::I18nKey.new(language: locale)\n end\n self.translations.order_by({:language => :asc})\n end",
"def translations_for_select\n configuration(:translations).collect{ |translation|\n [translation[:language], translation[:language_code]]\n }\n end",
"def all\n @raw.map { |l| l['language'] }\n end",
"def lang\n language = \"#{@lang}\".strip.downcase\n { #Aliases to languages names\n \"eng\" => [\"en\",\"en-us\",\"english\"],\n \"ita\" => [\"it\"],\n \"por\" => [\"pt\",\"pt-br\",\"portuguese\"],\n \"spa\" => [\"sp\"]\n }.each do |value,names|\n return \" -l #{value} \" if names.include? language\n end\n return \" -l #{language} \" if language.size > 0\n \"\"\n rescue\n \"\"\n end",
"def language\n case \n when self.ENU || self.ENG then \"ENG\"\n when self.SPM || self.SPE then \"SPE\"\n when self.FRC || self.FRF then \"FRF\"\n when self.ITI then \"ITI\"\n when self.DUN then \"DUN\"\n when self.GED then \"GED\"\n end\n end",
"def languages\n array = []\n details.css(\"div.txt-block a[href^='/language/']\").each do |node|\n array << {:code => node['href'].clean_href, :name => node.text.strip}\n end\n\n array\n end",
"def language\n read_attribute(:language) || Language::MULTIPLE_LANGUAGES\n end",
"def enabled_locales=(values)\n languages = values.reject{|x| x.blank?}\n # add default, since it's the configured fallback it must exist\n languages = (languages << I18n.default_locale.to_s).uniq\n self[:enabled_locales] = languages.join(\",\")\n end",
"def language\n \tread_attribute(:language) || Language::MULTIPLE_LANGUAGES\n\tend",
"def language_prs\n languages.map do |language|\n [language.fetch(\"language\").name, language.fetch(\"prs\")]\n end\n end",
"def enabled_locales(app_path = nil)\r\n ::LinguaFranca.enabled_locales(app_path)\r\n end"
] | [
"0.8217595",
"0.8006343",
"0.78214765",
"0.7794687",
"0.76729876",
"0.7650815",
"0.7650815",
"0.7650815",
"0.7650815",
"0.76375616",
"0.7583294",
"0.7466376",
"0.745824",
"0.73969007",
"0.73734707",
"0.73068357",
"0.724023",
"0.72044873",
"0.71648544",
"0.7157739",
"0.71501017",
"0.70862514",
"0.7083946",
"0.7070311",
"0.70220125",
"0.70110476",
"0.69714874",
"0.69657356",
"0.6928212",
"0.69121045",
"0.6899428",
"0.68669343",
"0.68631244",
"0.6818712",
"0.681158",
"0.6804712",
"0.680399",
"0.67865056",
"0.6786047",
"0.6786047",
"0.6729597",
"0.6699842",
"0.66677725",
"0.6637596",
"0.6605504",
"0.6599721",
"0.655839",
"0.65441203",
"0.65307677",
"0.6529868",
"0.6529868",
"0.65190977",
"0.6519011",
"0.65134466",
"0.65134054",
"0.6498865",
"0.6489316",
"0.6481617",
"0.64708346",
"0.6467378",
"0.6458673",
"0.64437824",
"0.6425433",
"0.6400676",
"0.6383874",
"0.63763463",
"0.6339143",
"0.63271886",
"0.63270104",
"0.63195294",
"0.6315716",
"0.6298771",
"0.62951916",
"0.62885255",
"0.62721163",
"0.62721163",
"0.6246308",
"0.6241461",
"0.62324905",
"0.6226155",
"0.6211423",
"0.6175832",
"0.61694163",
"0.61591506",
"0.6114112",
"0.61072844",
"0.6106364",
"0.60765994",
"0.60323894",
"0.60199016",
"0.60033584",
"0.59995455",
"0.5996208",
"0.5993633",
"0.598193",
"0.59664434",
"0.5960373",
"0.59430534",
"0.5936418"
] | 0.6002978 | 92 |
Get the list of supported languages. | def get_routing_languages_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.get_routing_languages ..."
end
if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order'])
fail ArgumentError, 'invalid value for "sort_order", must be one of ascending, descending'
end
# resource path
local_var_path = "/api/v2/routing/languages".sub('{format}','json')
# query parameters
query_params = {}
query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']
query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']
query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']
query_params[:'name'] = opts[:'name'] if opts[:'name']
query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => 'LanguageEntityListing')
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#get_routing_languages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def supported_languages\n return self.supported_locales.present? ? self.supported_locales : [\"en\"]\n end",
"def getlist\r\n result = SUPPORTED_LANG_LIST\r\n end",
"def get_language_list\n call :get_language_list\n end",
"def languages\n translations.map(&:language)\n end",
"def languages\n return [] if @grpc.property.nil?\n @languages ||= Array(@grpc.property.detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n return [] if @grpc.property.nil?\n detected_languages = @grpc.property.detected_languages\n @languages ||= Array(detected_languages).map do |l|\n Language.from_grpc l\n end\n end",
"def languages\n get(\"/repos/show/#{owner.login}/#{name}/languages\")['languages']\n end",
"def available_languages\n AppConfig.available_languages\n end",
"def get_ocr_supported_languages\n path = '/v3/miscellaneous/ocr-languages-list'\n\n headers = {\n 'Content-Type' => 'application/json',\n 'User-Agent' => Config.user_agent\n }\n request = Net::HTTP::Get.new(path, headers)\n handle_response(@api_client.request(request), 'get_ocr_supported_languages')\n end",
"def languages\n return @languages\n end",
"def languages(options={})\n res = self.get \"/translate/service/languages\", :query => options\n check_for_errors(res)\n res['response']\n end",
"def list_lang\n call! :list_lang\n end",
"def languages\n ['HTML', 'Javascript', 'CSS', 'PHP', 'ERB', 'Ruby', 'Objective-C']\n end",
"def loaded_languages\n @@languages.keys\n end",
"def available_locales\n translations = Dir.glob('config/locales/*').map { |locale| locale.split('/').last.split('.').first }\n locales = []\n translations.each do |t|\n value = (t == 'zh' ? 'zh-CN' : t)\n locales << [LanguageList::LanguageInfo.find(t).name, value]\n end\n locales\n end",
"def get_languages\n response = get_siteinfo('languages')\n ret = {}\n response['query']['languages'].each { |l| ret[l['code']] = l['*'] }\n ret\n end",
"def get_languages(options = {})\n object_from_response(GogoKit::PagedResource,\n GogoKit::LanguagesRepresenter,\n :get,\n get_root.links['viagogo:languages'].href,\n options)\n end",
"def available_locales\n []\n end",
"def getLangs\r\n result = self.class.get '/getLangs', { query:{ key:@@api_key } }\r\n check_result result\r\n end",
"def available_locales\n locales = Language.sorted_by_abbreviation.pluck(:abbreviation).presence if Language.table_exists?\n (locales.presence || [default_locale])\n end",
"def get_languages\r\n @xml_doc.xpath(\"/TextDatabase/Languages/Language\").inject([]) do |languages, lang_node|\r\n language = empty_to_nil(lang_node[\"Id\"])\r\n languages.push(language)\r\n end\r\n end",
"def available_locales\n evaluate_localization_option!(:available_locales)\n end",
"def languages\n value.document.fetch(\"#{value.key}_lang\", [])\n end",
"def accepted_languages()\n # no language accepted\n return [] if request.env[\"HTTP_ACCEPT_LANGUAGE\"].nil?\n \n # parse Accept-Language\n accepted = request.env[\"HTTP_ACCEPT_LANGUAGE\"].split(\",\")\n accepted = accepted.map { |l| l.strip.split(\";\") }\n accepted = accepted.map { |l|\n if (l.size == 2)\n # quality present\n #[ l[0].split(\"-\")[0].downcase, l[1].sub(/^q=/, \"\").to_f ]\n else\n # no quality specified => quality == 1\n #[ l[0].split(\"-\")[0].downcase, 1.0 ]\n ll = l[0].split(\"-\")\n if (ll.size > 1)\n [ll[0], ll[1].upcase]\n else\n []\n end\n end\n }\n accepted[0].join(\"-\") if accepted[0]\n end",
"def lang_files\n @@languages\n end",
"def accepted_locales\n http_accept_language = request.env['HTTP_ACCEPT_LANGUAGE']\n return [] if http_accept_language.blank?\n langs = http_accept_language.scan(/([a-zA-Z]{2,4})(?:-[a-zA-Z]{2})?(?:;q=(1|0?\\.[0-9]{1,3}))?/).map do |pair|\n lang, q = pair\n [lang.to_sym, (q || '1').to_f]\n end\n langs.sort_by { |lang, q| q }.map { |lang, q| lang }.reverse.uniq\n end",
"def available_locales\r\n ::LinguaFranca.available_locales\r\n end",
"def languages\n @bio.fetch('Languages')\n end",
"def available_locales\n resource.translations.all(:fields => [:locale_tag], :unique => true).map { |t| t.locale }\n end",
"def available_locales\n @available_locales ||= self.languages.published\n end",
"def available_locales\n self.locales.map { |locale| locale.to_sym }\n end",
"def languages\n h2 :languages\n p (langs = @record.languages).empty? ? '-' : langs.map(&:to_s).join(', ')\n gap\n end",
"def select_languages_localized\n available_languages.map{ |x| known_languages.assoc(x)}.map{ |y| [y[2],y[0]]}.sort!\n end",
"def supported_language_codes\n language_codes = TranslationsHelper.supported_language_codes\n\n if language_codes.empty?\n return_error_infos(400, 'Error no supported languages', 'TranslationError', nil)\n else\n render :status => 200, :json => { :language_codes => language_codes }\n end\n end",
"def languages=(value)\n @languages = value\n end",
"def available_locales; end",
"def available_locales; end",
"def display_all_languages\n # Interface method\n end",
"def loaded_languages\n @@cached_language_data.keys\n end",
"def languages\n result = []\n @mods_ng_xml.language.each { |n|\n # get languageTerm codes and add their translations to the result\n n.code_term.each { |ct|\n if ct.authority.match(/^iso639/)\n begin\n vals = ct.text.split(/[,|\\ ]/).reject {|x| x.strip.length == 0 }\n vals.each do |v|\n result << ISO_639.find(v.strip).english_name\n end\n rescue => e\n p \"Couldn't find english name for #{ct.text}\"\n result << ct.text\n end\n else\n result << ct.text\n end\n }\n # add languageTerm text values\n n.text_term.each { |tt|\n val = tt.text.strip\n result << val if val.length > 0\n }\n\n # add language values that aren't in languageTerm subelement\n if n.languageTerm.size == 0\n result << n.text\n end\n }\n result.uniq\n end",
"def language_codes_for_select\n configuration(:languages).collect { |language|\n language[:language_code]\n }\n end",
"def list_languages\n\t\trender json: Language.all.to_json\n\tend",
"def get_voice_languages\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/lang'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n return nil if _context.response.status_code == 404\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"def available_locales\n translation_model.all(:fields => [:locale_tag], :unique => true).map { |t| t.locale }\n end",
"def languages_required\n possible_languages = {\n java: nil,\n javascript: nil,\n ruby: nil,\n python: nil,\n scala: nil,\n clojure: nil,\n go: nil,\n node: nil\n }\n description = @description.downcase\n\n possible_languages.each do |language, value|\n if description.include?(language.to_s)\n possible_languages[language] = true\n else\n possible_languages[language] = false\n end\n end\n\n possible_languages\n end",
"def language_codes_for_select\n configuration(:languages).collect{ |language|\n language[:language_code]\n }\n end",
"def all_languages\n project_file = XCProjectFile.new(@xcode_proj_path)\n project_file.project[\"knownRegions\"].select { |r| r != \"Base\" }\n end",
"def all_languages\n project_file = XCProjectFile.new(@xcode_proj_path)\n project_file.project[\"knownRegions\"].select { |r| r != \"Base\" }\n end",
"def languages(options = {})\n Babel.distances(self, options).map() {|item| item.first}\n end",
"def translate_list_language_names project_id:, language_code: \"en\"\n # [START translate_list_language_names]\n # project_id = \"Your Google Cloud project ID\"\n\n # To receive the names of the supported languages, provide the code\n # for the language in which you wish to receive the names\n # language_code = \"en\"\n\n require \"google/cloud/translate\"\n\n translate = Google::Cloud::Translate.translation_v2_service project_id: project_id\n languages = translate.languages language_code\n\n puts \"Supported languages:\"\n languages.each do |language|\n puts \"#{language.code} #{language.name}\"\n end\n # [END translate_list_language_names]\nend",
"def available_locales\n init_translations unless initialized?\n translations.inject([]) do |locales, (locale, data)|\n locales << locale unless (data.keys - [:i18n]).empty?\n locales\n end\n end",
"def get_locales\n fall_back = [:ru].to_yaml\n locales = CustomSetting.find_or_create_by_name(\"languages\").value || fall_back\n begin\n locales = YAML::load(locales)\n rescue\n locales = YAML::load(fall_back)\n end\n end",
"def addl_languages_names\n self.dig_for_array(\"addlLanguageNames\")\n end",
"def available_locales_set; end",
"def languages\n return [:en] unless abstract_form_valid?\n l = questions.collect { |q| (q.qtext.is_a?(Hash) ? q.qtext.keys : nil) }.flatten.compact.uniq\n (l.nil? || l.empty?) ? [:en] : l\n end",
"def select_languages_native\n available_languages.map{ |x| known_languages.assoc(x)}.map{ |y| [y[1],y[0]]}.sort!\n end",
"def get_voice_languages\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/lang'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # validate response against endpoint and global error codes\r\n if _context.response.status_code == 404\r\n return nil\r\n end\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n return _context.response.raw_body\r\n end",
"def available_translations\n {\n 'en' => 'English',\n 'es' => 'Español',\n 'pt-BR' => 'Português do Brasil'\n }\n end",
"def user_languages_hash\n result = Hash.new\n\n I18n.available_locales.each do |locale|\n result[t(\"languages.#{locale.to_s}\")] = locale.to_s\n end\n \n return result\n end",
"def languages\n @xml.xpath('//language').map do |lang|\n lang.text.to_s.gsub(/\\.|\\,/,'').strip.capitalize.gsub(\"Finding aid written in english\", \"English\")\n end.uniq\n end",
"def all_languages\n Dir.entries(metadata_path)\n .select { |f| File.directory? File.join(metadata_path, f) }\n .reject { |f| f.start_with?('.') }\n .sort { |x, y| x <=> y }\n end",
"def accepted_languages=(languages)\n @accepted_languages = languages\n end",
"def languages\n documents.collect(&:sections).flatten.collect(&:examples).flatten.map(&:language).compact.uniq\n end",
"def languages\n document.search(\"h5[text()='Language:'] ~ a[@href*=/language/']\").map { |link| link.innerHTML.strip.imdb_unescape_html } rescue []\n end",
"def languages_spoken\n self.dig_for_array(\"languagesSpoken\")\n end",
"def languages_as_uri\n languages.pluck(:name).map do |language|\n ControlledVocabulary.era.language.from_value(language)\n end\n end",
"def available_locales\n @available_locales ||= begin\n locales = Set.new\n @read.map do |pattern|\n [pattern, Dir.glob(pattern % {locale: '*'})] if pattern.include?('%{locale}')\n end.compact.each do |pattern, paths|\n p = pattern.gsub('\\\\', '\\\\\\\\').gsub('/', '\\/').gsub('.', '\\.')\n p = p.gsub(/(\\*+)/) { $1 == '**' ? '.*' : '[^/]*?' }.gsub('%{locale}', '([^/.]+)')\n re = /\\A#{p}\\z/\n paths.each do |path|\n if re =~ path\n locales << $1\n end\n end\n end\n locales\n end\n end",
"def get_locales(defaults=[])\n if self.available_locales.present?\n self.available_locales\n else\n defaults\n end\n end",
"def translate_v3_get_supported_languages_for_target\n # [START translate_v3_get_supported_languages_for_target]\n require \"google/cloud/translate\"\n\n client = Google::Cloud::Translate.new\n\n project_id = \"[Google Cloud Project ID]\"\n location_id = \"[LOCATION ID]\"\n language_code = \"en\"\n\n parent = client.class.location_path project_id, location_id\n\n response = client.get_supported_languages parent, display_language_code: language_code\n\n # List language codes of supported languages\n response.languages.each do |language|\n puts \"Language Code: #{language.language_code}\"\n puts \"Display Name: #{language.display_name}\"\n end\n # [END translate_v3_get_supported_languages_for_target]\nend",
"def languages\n @item_attributes.first.languages.first.language.inject([]) do |m, l|\n m << (l.send('name').to_s rescue nil)\n m\n end.compact.uniq\n end",
"def getcodes\r\n result = SUPPORTED_LANG_CODES\r\n end",
"def enabled_locales\n self[:enabled_locales].split(\",\").map(&:to_sym)\n end",
"def enabled_locales\n self[:enabled_locales].split(\",\").map(&:to_sym)\n end",
"def languages_as_uri\n languages.pluck(:name).map do |language|\n CONTROLLED_VOCABULARIES[:language].send(language)\n end\n end",
"def available_locales\n @available_locales ||= begin\n locales = Set.new\n Array(config[:read]).map do |pattern|\n [pattern, Dir.glob(format(pattern, locale: '*'))] if pattern.include?('%{locale}')\n end.compact.each do |pattern, paths|\n p = pattern.gsub('\\\\', '\\\\\\\\').gsub('/', '\\/').gsub('.', '\\.')\n p = p.gsub(/(\\*+)/) { Regexp.last_match(1) == '**' ? '.*' : '[^/]*?' }.gsub('%{locale}', '([^/.]+)')\n re = /\\A#{p}\\z/\n paths.each do |path|\n locales << Regexp.last_match(1) if re =~ path\n end\n end\n locales\n end\n end",
"def available_locales\n init_names unless init_names?\n names.keys\n end",
"def language_options(current_value = nil)\n standard_options = [ [t('patient.helper.language.English'),nil] ]\n full_set = standard_options + Config.find_or_create_by(config_key: 'language').options\n\n options_plus_current(full_set, current_value)\n end",
"def preferred_locales\n read_attribute(\"preferred_locales\").map(&:to_sym)\n end",
"def languages\n @selects = YAML.load_file(\"#{ExpressTranslate.root}/config/languages.yml\")\n @origin = Language.get_origin(params[:packages])\n @origin_keys = @origin.present? ? LanguageDetail.info(@origin).all.collect{|x| x['code']} : []\n @languages = Package.find(params[:packages])['language']\n @max = @origin.nil? ? 1 : LanguageDetail.info(@origin).all.count\n @LanguageDetail = LanguageDetail\n @Package = Package\n render :action => :languages, layout: 'express_translate/translate'\n end",
"def languages(*values)\n values.inject(self) { |res, val| res._languages(val) or fail ArgumentError, \"Unknown value for languages: #{val}\" }\n end",
"def languages(repo, options = {})\n paginate \"#{Repository.path repo}/languages\", options\n end",
"def language\n fetch('dnd.languages')\n end",
"def pbGetLanguage()\n getUserDefaultLangID=Win32API.new(\"kernel32\",\"GetUserDefaultLangID\",\"\",\"i\") rescue nil\n ret=0\n if getUserDefaultLangID\n ret=getUserDefaultLangID.call()&0x3FF\n end\n if ret==0 # Unknown\n ret=MiniRegistry.get(MiniRegistry::HKEY_CURRENT_USER,\n \"Control Panel\\\\Desktop\\\\ResourceLocale\",\"\",0)\n ret=MiniRegistry.get(MiniRegistry::HKEY_CURRENT_USER,\n \"Control Panel\\\\International\",\"Locale\",\"0\").to_i(16) if ret==0\n ret=ret&0x3FF\n return 0 if ret==0 # Unknown\n end\n return 1 if ret==0x11 # Japanese\n return 2 if ret==0x09 # English\n return 3 if ret==0x0C # French\n return 4 if ret==0x10 # Italian\n return 5 if ret==0x07 # German\n return 7 if ret==0x0A # Spanish\n return 8 if ret==0x12 # Korean\n return 2 # Use 'English' by default\nend",
"def locales\n get(\"locales\")[\"locales\"]\n end",
"def language\n @language ||= LanguageDetector.new\n end",
"def available_translations\n missing_locales = Gallifreyian::Configuration.available_locales - translations.map(&:language)\n missing_locales.each do |locale|\n self.translations << Gallifreyian::Translation::I18nKey.new(language: locale)\n end\n self.translations.order_by({:language => :asc})\n end",
"def translations_for_select\n configuration(:translations).collect{ |translation|\n [translation[:language], translation[:language_code]]\n }\n end",
"def all\n @raw.map { |l| l['language'] }\n end",
"def get_routing_languages(opts = {})\n data, _status_code, _headers = get_routing_languages_with_http_info(opts)\n return data\n end",
"def get_routing_languages(opts = {})\n data, _status_code, _headers = get_routing_languages_with_http_info(opts)\n return data\n end",
"def lang\n language = \"#{@lang}\".strip.downcase\n { #Aliases to languages names\n \"eng\" => [\"en\",\"en-us\",\"english\"],\n \"ita\" => [\"it\"],\n \"por\" => [\"pt\",\"pt-br\",\"portuguese\"],\n \"spa\" => [\"sp\"]\n }.each do |value,names|\n return \" -l #{value} \" if names.include? language\n end\n return \" -l #{language} \" if language.size > 0\n \"\"\n rescue\n \"\"\n end",
"def language\n case \n when self.ENU || self.ENG then \"ENG\"\n when self.SPM || self.SPE then \"SPE\"\n when self.FRC || self.FRF then \"FRF\"\n when self.ITI then \"ITI\"\n when self.DUN then \"DUN\"\n when self.GED then \"GED\"\n end\n end",
"def languages\n array = []\n details.css(\"div.txt-block a[href^='/language/']\").each do |node|\n array << {:code => node['href'].clean_href, :name => node.text.strip}\n end\n\n array\n end",
"def language\n read_attribute(:language) || Language::MULTIPLE_LANGUAGES\n end",
"def enabled_locales=(values)\n languages = values.reject{|x| x.blank?}\n # add default, since it's the configured fallback it must exist\n languages = (languages << I18n.default_locale.to_s).uniq\n self[:enabled_locales] = languages.join(\",\")\n end",
"def language\n \tread_attribute(:language) || Language::MULTIPLE_LANGUAGES\n\tend",
"def language_prs\n languages.map do |language|\n [language.fetch(\"language\").name, language.fetch(\"prs\")]\n end\n end",
"def enabled_locales(app_path = nil)\r\n ::LinguaFranca.enabled_locales(app_path)\r\n end"
] | [
"0.82176244",
"0.8004659",
"0.7822113",
"0.77946955",
"0.7672182",
"0.76501215",
"0.76501215",
"0.76501215",
"0.76501215",
"0.7637189",
"0.75831145",
"0.74667925",
"0.7458409",
"0.7397909",
"0.7372927",
"0.7306661",
"0.7240775",
"0.7204052",
"0.7165767",
"0.71590245",
"0.7148524",
"0.70861506",
"0.708478",
"0.70704776",
"0.70213324",
"0.7011165",
"0.6971331",
"0.6965468",
"0.69279945",
"0.69108814",
"0.68996096",
"0.68658304",
"0.6863315",
"0.6817441",
"0.68119025",
"0.6805329",
"0.68041474",
"0.67866117",
"0.67848283",
"0.67848283",
"0.6729717",
"0.6700213",
"0.666804",
"0.6636844",
"0.6606039",
"0.6600503",
"0.6557602",
"0.6545708",
"0.65299326",
"0.65290856",
"0.65290856",
"0.65195733",
"0.6517732",
"0.6513661",
"0.6513581",
"0.64984363",
"0.648777",
"0.64818436",
"0.6471305",
"0.646816",
"0.6458241",
"0.64443916",
"0.64248914",
"0.64012766",
"0.6384282",
"0.63776165",
"0.633964",
"0.63274425",
"0.6326076",
"0.6319224",
"0.63156545",
"0.62983215",
"0.62959135",
"0.6286091",
"0.62704164",
"0.62704164",
"0.6245996",
"0.6241068",
"0.62318206",
"0.6226674",
"0.62100464",
"0.61763895",
"0.61715597",
"0.6160249",
"0.6114585",
"0.61067444",
"0.61054325",
"0.60775656",
"0.60328925",
"0.6019808",
"0.60041",
"0.60037386",
"0.60037386",
"0.59998137",
"0.5996455",
"0.59926605",
"0.5982104",
"0.59657",
"0.5960551",
"0.59443223",
"0.5934814"
] | 0.0 | -1 |
Get details about this queue. | def get_routing_queue(queue_id, opts = {})
data, _status_code, _headers = get_routing_queue_with_http_info(queue_id, opts)
return data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queue_stats\n broker_stats[\"queues\"]\n end",
"def name\n @queue.name\n end",
"def queue\n @queue ||= QueueManager.fetch(@name,@visibility)\n end",
"def info\n @queue << \"info\"\n end",
"def name\n @queue.queue_name\n end",
"def queued_build_details(task_id)\n response = get(\"buildQueue/taskId:#{task_id}\")\n response\n end",
"def name\n @queue_string\n end",
"def get_queue_metadata(queue_name)\r\n execute(:head, queue_name, { :comp => 'metadata'}, :x_ms_version => '2009-09-19').headers\r\n end",
"def queue\n @queue ||= channel.queue(queue_name)\n end",
"def queue\n # Probably should be a UUID in the real world\n @queue ||= channel.queue(self.object_id.to_s)\n end",
"def queue_stats( queue_name )\n stats['queues'][queue_name]\n end",
"def queue(queue_name)\n @queues[queue_name]\n end",
"def inspect\n \"#<#{self.class}:0x#{self.__id__.to_s(16)} NT=#{@run_queue.length}>\"\n end",
"def inspect\n \"#<#{self.class}:0x#{self.__id__.to_s(16)} NT=#{@run_queue.length}>\"\n end",
"def get_queue_attributes(*attrs)\n self.class.get_queue_attributes queue_url, *attrs\n end",
"def overview\n @overview ||= rmq_manager.overview\n end",
"def show\n\t\t@queue = Queue.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @queue }\n\t\tend\n\tend",
"def get_queue\n return @queue unless @queue.nil?\n\n Domo::Queue::Redis::JobQueue.active_queue(@redis_client, @dataset_id, @stream_id, pipeline_id)\n end",
"def queue\n @queue.pending\n end",
"def key_queue_status\n key(\"queue\", \"status\")\n end",
"def get_current_queue\n log_everything(\"Get current queue\")\n craft_firebase_command(\"minesweeper/queue.json\")\nend",
"def queue\n @queue ||= SizedQueue.new @queue_size\n end",
"def queue\n @queue ||= channel.queue(generate_queue_name, exclusive: true)\n end",
"def queue(queue = 'default')\n get_queue(queue)\n end",
"def queued\n @queued\n end",
"def queue\n @queue ||= Queue.new\n end",
"def queue( name )\n Qup::Adapter::Kestrel::Queue.new( @addr, name )\n end",
"def getQueueBy_id( queue_id)\n params = Hash.new\n params['queue_id'] = queue_id\n return doCurl(\"get\",\"/queue/by_id\",params)\n end",
"def personal_queue\n unless (local_queues = self.queues).empty?\n local_queues[0]\n end\n end",
"def details\n return @details\n end",
"def details\n return @details\n end",
"def details\n return @details\n end",
"def queue\n @handle.queue_name if @handle\n end",
"def queued_message\n @queued_message ||= self.id ? QueuedMessage.where(:message_id => self.id, :server_id => @database.server_id).first : nil\n end",
"def retrieve_message(q)\n WMQ::QueueManager.connect(@connection_options) do |qmgr|\n qmgr.open_queue(:q_name => q.name, :mode => :input) do |queue|\n\n get_options = q.get_options.dup\n wmq_message = WMQ::Message.new\n \n if queue.get(get_options.merge(:message => wmq_message))\n return Message.new(wmq_message, q.name)\n else \n return nil\n end\n end\n end\n end",
"def waiting_queue_name\n @waiting_queue_name\n end",
"def messages\n @zk.children(full_queue_path)\n end",
"def peek\n raise QueueUnderflow if empty?\n @info[0]\n end",
"def get_queue_attributes(queue_name_or_url, *attrs)\n Adapter.get_queue_attributes(\n queue_url(queue_name_or_url),\n *attrs\n )['GetQueueAttributesResponse']['GetQueueAttributesResult']['Attribute']\n end",
"def view_waitlist\n @queue.to_str\n end",
"def get_info()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('partner', 'getInfo', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend",
"def show\n @construction_queue = Construction::Queue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json do\n logger.debug @construction_queue.inspect\n render :json => @construction_queue, :root => :construction_queue\n end\n end\n end",
"def queues\n @channel.queues\n end",
"def monitor_queue\n @monitor_queue ||= sqs.queue('monitor')\n return @monitor_queue\n end",
"def queue\n\n @queue ||= channel.queue(*(opt('queue') || [ '' ]))\n end",
"def queues\n\t\t\t@queues ||= {}\n\t\tend",
"def queue\n @queue ||= []\n end",
"def get_command_queue_properties( options )\n properties = CommandQueue::Properties::new(0)\n if options[:properties] then\n if options[:properties].respond_to?(:each) then\n options[:properties].each { |f| properties = properties | f }\n else\n properties = properties | options[:properties]\n end\n end\n return properties\n end",
"def pluck_message\n pluck_queue_message(name)\n end",
"def command_queue\n @_command_queue ||= begin\n ptr = MemoryPointer::new( CommandQueue )\n error = OpenCL.clGetEventInfo(self, COMMAND_QUEUE, CommandQueue.size, ptr, nil)\n error_check(error)\n pt = ptr.read_pointer\n if pt.null? then\n nil\n else\n CommandQueue::new( pt )\n end\n end\n end",
"def queue(options={})\n# puts 'in queue'\n set_auto_attributes\n upload_if_needed\n\n response = SimpleWorker.service.queue(self.class.name, sw_get_data, options)\n# puts 'queue response=' + response.inspect\n# @task_set_id = response[\"task_set_id\"]\n @task_id = response[\"task_id\"]\n response\n end",
"def top()\n @queue[0]\n end",
"def get_general_queue\n reply = @client.call(:get_general_queue)\n data = reply.body.dig(:get_general_queue_response,\n :get_general_queue_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n service_id: attrs[:string][0],\n service_name: attrs[:string][1],\n channel_id: attrs[:string][2],\n channel_name: attrs[:string][3],\n contact_type: attrs[:string][4],\n directive: attrs[:string][5],\n queue_length: attrs[:string][6],\n time_in_queue: attrs[:string][7]\n }\n end\n rescue Savon::HTTPError => error\n Rails.logger.debug error.http.code\n return []\n end",
"def queue_size\n _get(\"/system/queue-size\") { |json| json }\n end",
"def queued(options={})\n url_params = options.empty? ? '' : \"?locator=#{locator(options)}\"\n response = get(\"buildQueue#{url_params}\")\n response['build']\n end",
"def peek\n\t\t@queue.first\n\tend",
"def queue_attributes\n @queue_attributes ||= Hash[queue_urls.map { |name, url| [name, init_attributes(url)] }]\n end",
"def instance_queue\n @instance_queue ||= sqs.queue(instance_id)\n return @instance_queue\n end",
"def show\n @queuing = Queuing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @queuing }\n end\n end",
"def peek( queue_name )\n get( queue_name, :peek => true )\n end",
"def info\n return @info\n end",
"def details\n @attributes[:details]\n end",
"def peek()\n @queue.first\n end",
"def peek(queue_name, options = {})\r\n return get_messages(queue_name, {:peek_only => true}.merge(options))\r\n end",
"def queues\n subject.queues\n end",
"def status\n MsgQ.status(@qid)\n end",
"def info\n @info\n end",
"def queue\n JenkinsApi::Client::BuildQueue.new(self)\n end",
"def queue\n JenkinsApi::Client::BuildQueue.new(self)\n end",
"def get_routing_queue_with_http_info(queue_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_queue ...\"\n end\n \n \n # verify the required parameter 'queue_id' is set\n fail ArgumentError, \"Missing the required parameter 'queue_id' when calling RoutingApi.get_routing_queue\" if queue_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/queues/{queueId}\".sub('{format}','json').sub('{' + 'queueId' + '}', queue_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\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 => 'Queue')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_queue\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def retrieve(key)\n @amq.queue(key)\n end",
"def size\n @queue.size\n end",
"def peek \n self.queue_var[-1]\n end",
"def messages\n @queue.messages.select { |m| m.claim == self }\n end",
"def details\n @details ||= Tmdb::Collection.detail(@id)\n return @details\n end",
"def mock_queue(queue_name)\n data[queue_name]\n end",
"def details\n data.details\n end",
"def size\n @queue.size\n end",
"def get_queue_config(queue_name)\n queue_configs.find { |q| q.name == queue_name }\n end",
"def get_routing_queue_with_http_info(queue_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_queue ...\"\n end\n \n \n # verify the required parameter 'queue_id' is set\n fail ArgumentError, \"Missing the required parameter 'queue_id' when calling RoutingApi.get_routing_queue\" if queue_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/queues/{queueId}\".sub('{format}','json').sub('{' + 'queueId' + '}', queue_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud Auth']\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 => 'Queue')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_queue\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def queue_pending\n \"resque:queue:prgov_cap\"\n end",
"def size\n @queue.size\n end",
"def _q\n @queue||=[]\n end",
"def size\n @queue.size\n end",
"def info\n @info\n end",
"def href\n \"#{PATH_BASE}/#{@queue.name}/messages/#{@id}\"\n end",
"def info_display\n @queue << \"i d\"\n end",
"def simple_queue\n make_json_request('qstatus')\n end",
"def list_queues(options ={})\r\n content = execute(:get, nil, { :comp => 'list' }.merge!(options), { :x_ms_version => \"2009-09-19\" })\r\n doc = REXML::Document.new(content)\r\n queues = []\r\n \r\n REXML::XPath.each(doc, '//Queue/') do |item|\r\n metadata = {}\r\n \r\n item.elements['Metadata'].elements.each do |element|\r\n metadata.merge!(element.name.gsub(/-/, '_').downcase.to_sym => element.text)\r\n end unless item.elements['Metadata'].nil?\r\n \r\n queues << { :name => REXML::XPath.first(item, \"Name\").text,\r\n :url => REXML::XPath.first(item, \"Url\").text,\r\n :metadata => metadata}\r\n end\r\n return queues\r\n end",
"def get( queue_name, opts = {} )\n opts = opts.merge( :queue_name => queue_name )\n g = KJess::Request::Get.new( opts )\n\n if opts[:wait_for]\n wait_for_in_seconds = Float(opts[:wait_for]) / 1000.0\n else\n wait_for_in_seconds = 0.1\n end\n\n connection.with_additional_read_timeout(wait_for_in_seconds) do\n resp = send_recv( g )\n return resp.data if KJess::Response::Value === resp\n return nil\n end\n end",
"def get_queues\n @gem_queue = get_queue 'gem'\n @md5_queue = get_queue 'md5'\n @sha512_queue = get_queue 'sha512'\n end",
"def queue_arns\n @queue_arns ||= Hash[queue_attributes.map { |name, attrs| [name, attrs[\"QueueArn\"]] }]\n end",
"def fetch_queue(room)\n fail ArgumentError, 'must be a Lita::Room object' unless room.is_a? Lita::Room\n\n serialized = redis.get(room.id)\n\n if serialized\n MultiJson.load(serialized)\n else\n []\n end\n end",
"def list_queues()\n result = make_request('ListQueues')\n\n if result['ListQueuesResult']\n value = result['ListQueuesResult']\n elsif result['ListQueuesResponse']\n value = result['ListQueuesResponse']['ListQueuesResult']\n else\n value = nil\n end\n\n unless value.nil?\n return value\n else\n raise Exception, \"Amazon SQS Error Code: \" + result['Error'][0]['Code'][0] +\n \"\\n\" + result['Error'][0]['Message'][0]\n end\n end",
"def message\n\t\tself.object[\"message\"]\n\tend",
"def size\n\n @queue.size\n end",
"def queued\n hydra.queued_requests\n end",
"def show\n @training_queue = Training::Queue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training_queue, :root => :training_queue }\n end\n end",
"def info\n Thread.current[:info]\n end",
"def queue\n @queue ||= produce_queue\n end",
"def tomqueue_payload\n JSON.dump({\n \"delayed_job_id\" => self.id,\n \"delayed_job_digest\" => tomqueue_digest,\n \"delayed_job_updated_at\" => self.updated_at.iso8601(0)\n })\n end"
] | [
"0.7035148",
"0.6950711",
"0.6895175",
"0.6888979",
"0.68703395",
"0.6814118",
"0.6755307",
"0.66440725",
"0.6433887",
"0.6354206",
"0.63439405",
"0.63269806",
"0.6320574",
"0.6320574",
"0.62654006",
"0.6218406",
"0.6208837",
"0.6202117",
"0.6181912",
"0.6115444",
"0.6067164",
"0.6044996",
"0.6043121",
"0.6041195",
"0.60189706",
"0.60041815",
"0.599307",
"0.5961175",
"0.5926828",
"0.5924632",
"0.5924632",
"0.5924632",
"0.59090775",
"0.59054005",
"0.5893958",
"0.58858794",
"0.5876781",
"0.58444047",
"0.5838897",
"0.58285636",
"0.5799748",
"0.5793342",
"0.57729167",
"0.57598454",
"0.5748654",
"0.57160956",
"0.56969714",
"0.56806594",
"0.5677399",
"0.5674831",
"0.5674666",
"0.5674371",
"0.56732714",
"0.56719875",
"0.56521416",
"0.5645623",
"0.56437606",
"0.5627107",
"0.56042445",
"0.5592549",
"0.55824566",
"0.55813783",
"0.5580281",
"0.557905",
"0.55673873",
"0.556207",
"0.55579346",
"0.553897",
"0.553897",
"0.5525941",
"0.5523091",
"0.55216724",
"0.55118287",
"0.5511155",
"0.55101144",
"0.55090356",
"0.54984856",
"0.54974395",
"0.54936683",
"0.5492884",
"0.54773855",
"0.54736006",
"0.54664624",
"0.5457593",
"0.54528636",
"0.54315555",
"0.54288393",
"0.54250926",
"0.5423453",
"0.54214954",
"0.5413354",
"0.5406199",
"0.54030627",
"0.54014367",
"0.5398676",
"0.53946024",
"0.5382173",
"0.5373895",
"0.53716946",
"0.5371167",
"0.536868"
] | 0.0 | -1 |
Get details about this queue. | def get_routing_queue_with_http_info(queue_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.get_routing_queue ..."
end
# verify the required parameter 'queue_id' is set
fail ArgumentError, "Missing the required parameter 'queue_id' when calling RoutingApi.get_routing_queue" if queue_id.nil?
# resource path
local_var_path = "/api/v2/routing/queues/{queueId}".sub('{format}','json').sub('{' + 'queueId' + '}', queue_id.to_s)
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => 'Queue')
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#get_routing_queue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queue_stats\n broker_stats[\"queues\"]\n end",
"def name\n @queue.name\n end",
"def queue\n @queue ||= QueueManager.fetch(@name,@visibility)\n end",
"def info\n @queue << \"info\"\n end",
"def name\n @queue.queue_name\n end",
"def queued_build_details(task_id)\n response = get(\"buildQueue/taskId:#{task_id}\")\n response\n end",
"def name\n @queue_string\n end",
"def get_queue_metadata(queue_name)\r\n execute(:head, queue_name, { :comp => 'metadata'}, :x_ms_version => '2009-09-19').headers\r\n end",
"def queue\n @queue ||= channel.queue(queue_name)\n end",
"def queue\n # Probably should be a UUID in the real world\n @queue ||= channel.queue(self.object_id.to_s)\n end",
"def queue_stats( queue_name )\n stats['queues'][queue_name]\n end",
"def queue(queue_name)\n @queues[queue_name]\n end",
"def inspect\n \"#<#{self.class}:0x#{self.__id__.to_s(16)} NT=#{@run_queue.length}>\"\n end",
"def inspect\n \"#<#{self.class}:0x#{self.__id__.to_s(16)} NT=#{@run_queue.length}>\"\n end",
"def get_queue_attributes(*attrs)\n self.class.get_queue_attributes queue_url, *attrs\n end",
"def overview\n @overview ||= rmq_manager.overview\n end",
"def show\n\t\t@queue = Queue.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @queue }\n\t\tend\n\tend",
"def get_queue\n return @queue unless @queue.nil?\n\n Domo::Queue::Redis::JobQueue.active_queue(@redis_client, @dataset_id, @stream_id, pipeline_id)\n end",
"def queue\n @queue.pending\n end",
"def key_queue_status\n key(\"queue\", \"status\")\n end",
"def get_current_queue\n log_everything(\"Get current queue\")\n craft_firebase_command(\"minesweeper/queue.json\")\nend",
"def queue\n @queue ||= SizedQueue.new @queue_size\n end",
"def queue\n @queue ||= channel.queue(generate_queue_name, exclusive: true)\n end",
"def queue(queue = 'default')\n get_queue(queue)\n end",
"def queued\n @queued\n end",
"def queue\n @queue ||= Queue.new\n end",
"def queue( name )\n Qup::Adapter::Kestrel::Queue.new( @addr, name )\n end",
"def getQueueBy_id( queue_id)\n params = Hash.new\n params['queue_id'] = queue_id\n return doCurl(\"get\",\"/queue/by_id\",params)\n end",
"def personal_queue\n unless (local_queues = self.queues).empty?\n local_queues[0]\n end\n end",
"def details\n return @details\n end",
"def details\n return @details\n end",
"def details\n return @details\n end",
"def queue\n @handle.queue_name if @handle\n end",
"def queued_message\n @queued_message ||= self.id ? QueuedMessage.where(:message_id => self.id, :server_id => @database.server_id).first : nil\n end",
"def retrieve_message(q)\n WMQ::QueueManager.connect(@connection_options) do |qmgr|\n qmgr.open_queue(:q_name => q.name, :mode => :input) do |queue|\n\n get_options = q.get_options.dup\n wmq_message = WMQ::Message.new\n \n if queue.get(get_options.merge(:message => wmq_message))\n return Message.new(wmq_message, q.name)\n else \n return nil\n end\n end\n end\n end",
"def waiting_queue_name\n @waiting_queue_name\n end",
"def messages\n @zk.children(full_queue_path)\n end",
"def peek\n raise QueueUnderflow if empty?\n @info[0]\n end",
"def get_queue_attributes(queue_name_or_url, *attrs)\n Adapter.get_queue_attributes(\n queue_url(queue_name_or_url),\n *attrs\n )['GetQueueAttributesResponse']['GetQueueAttributesResult']['Attribute']\n end",
"def view_waitlist\n @queue.to_str\n end",
"def get_info()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('partner', 'getInfo', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend",
"def show\n @construction_queue = Construction::Queue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json do\n logger.debug @construction_queue.inspect\n render :json => @construction_queue, :root => :construction_queue\n end\n end\n end",
"def queues\n @channel.queues\n end",
"def monitor_queue\n @monitor_queue ||= sqs.queue('monitor')\n return @monitor_queue\n end",
"def queue\n\n @queue ||= channel.queue(*(opt('queue') || [ '' ]))\n end",
"def queues\n\t\t\t@queues ||= {}\n\t\tend",
"def queue\n @queue ||= []\n end",
"def get_command_queue_properties( options )\n properties = CommandQueue::Properties::new(0)\n if options[:properties] then\n if options[:properties].respond_to?(:each) then\n options[:properties].each { |f| properties = properties | f }\n else\n properties = properties | options[:properties]\n end\n end\n return properties\n end",
"def pluck_message\n pluck_queue_message(name)\n end",
"def command_queue\n @_command_queue ||= begin\n ptr = MemoryPointer::new( CommandQueue )\n error = OpenCL.clGetEventInfo(self, COMMAND_QUEUE, CommandQueue.size, ptr, nil)\n error_check(error)\n pt = ptr.read_pointer\n if pt.null? then\n nil\n else\n CommandQueue::new( pt )\n end\n end\n end",
"def queue(options={})\n# puts 'in queue'\n set_auto_attributes\n upload_if_needed\n\n response = SimpleWorker.service.queue(self.class.name, sw_get_data, options)\n# puts 'queue response=' + response.inspect\n# @task_set_id = response[\"task_set_id\"]\n @task_id = response[\"task_id\"]\n response\n end",
"def top()\n @queue[0]\n end",
"def get_general_queue\n reply = @client.call(:get_general_queue)\n data = reply.body.dig(:get_general_queue_response,\n :get_general_queue_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n service_id: attrs[:string][0],\n service_name: attrs[:string][1],\n channel_id: attrs[:string][2],\n channel_name: attrs[:string][3],\n contact_type: attrs[:string][4],\n directive: attrs[:string][5],\n queue_length: attrs[:string][6],\n time_in_queue: attrs[:string][7]\n }\n end\n rescue Savon::HTTPError => error\n Rails.logger.debug error.http.code\n return []\n end",
"def queue_size\n _get(\"/system/queue-size\") { |json| json }\n end",
"def queued(options={})\n url_params = options.empty? ? '' : \"?locator=#{locator(options)}\"\n response = get(\"buildQueue#{url_params}\")\n response['build']\n end",
"def peek\n\t\t@queue.first\n\tend",
"def queue_attributes\n @queue_attributes ||= Hash[queue_urls.map { |name, url| [name, init_attributes(url)] }]\n end",
"def instance_queue\n @instance_queue ||= sqs.queue(instance_id)\n return @instance_queue\n end",
"def show\n @queuing = Queuing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @queuing }\n end\n end",
"def peek( queue_name )\n get( queue_name, :peek => true )\n end",
"def info\n return @info\n end",
"def details\n @attributes[:details]\n end",
"def peek()\n @queue.first\n end",
"def peek(queue_name, options = {})\r\n return get_messages(queue_name, {:peek_only => true}.merge(options))\r\n end",
"def queues\n subject.queues\n end",
"def status\n MsgQ.status(@qid)\n end",
"def info\n @info\n end",
"def queue\n JenkinsApi::Client::BuildQueue.new(self)\n end",
"def queue\n JenkinsApi::Client::BuildQueue.new(self)\n end",
"def retrieve(key)\n @amq.queue(key)\n end",
"def size\n @queue.size\n end",
"def peek \n self.queue_var[-1]\n end",
"def messages\n @queue.messages.select { |m| m.claim == self }\n end",
"def details\n @details ||= Tmdb::Collection.detail(@id)\n return @details\n end",
"def mock_queue(queue_name)\n data[queue_name]\n end",
"def details\n data.details\n end",
"def size\n @queue.size\n end",
"def get_queue_config(queue_name)\n queue_configs.find { |q| q.name == queue_name }\n end",
"def get_routing_queue_with_http_info(queue_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_queue ...\"\n end\n \n \n # verify the required parameter 'queue_id' is set\n fail ArgumentError, \"Missing the required parameter 'queue_id' when calling RoutingApi.get_routing_queue\" if queue_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/queues/{queueId}\".sub('{format}','json').sub('{' + 'queueId' + '}', queue_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 local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud Auth']\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 => 'Queue')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_queue\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def queue_pending\n \"resque:queue:prgov_cap\"\n end",
"def size\n @queue.size\n end",
"def _q\n @queue||=[]\n end",
"def size\n @queue.size\n end",
"def info\n @info\n end",
"def href\n \"#{PATH_BASE}/#{@queue.name}/messages/#{@id}\"\n end",
"def info_display\n @queue << \"i d\"\n end",
"def simple_queue\n make_json_request('qstatus')\n end",
"def list_queues(options ={})\r\n content = execute(:get, nil, { :comp => 'list' }.merge!(options), { :x_ms_version => \"2009-09-19\" })\r\n doc = REXML::Document.new(content)\r\n queues = []\r\n \r\n REXML::XPath.each(doc, '//Queue/') do |item|\r\n metadata = {}\r\n \r\n item.elements['Metadata'].elements.each do |element|\r\n metadata.merge!(element.name.gsub(/-/, '_').downcase.to_sym => element.text)\r\n end unless item.elements['Metadata'].nil?\r\n \r\n queues << { :name => REXML::XPath.first(item, \"Name\").text,\r\n :url => REXML::XPath.first(item, \"Url\").text,\r\n :metadata => metadata}\r\n end\r\n return queues\r\n end",
"def get( queue_name, opts = {} )\n opts = opts.merge( :queue_name => queue_name )\n g = KJess::Request::Get.new( opts )\n\n if opts[:wait_for]\n wait_for_in_seconds = Float(opts[:wait_for]) / 1000.0\n else\n wait_for_in_seconds = 0.1\n end\n\n connection.with_additional_read_timeout(wait_for_in_seconds) do\n resp = send_recv( g )\n return resp.data if KJess::Response::Value === resp\n return nil\n end\n end",
"def get_queues\n @gem_queue = get_queue 'gem'\n @md5_queue = get_queue 'md5'\n @sha512_queue = get_queue 'sha512'\n end",
"def queue_arns\n @queue_arns ||= Hash[queue_attributes.map { |name, attrs| [name, attrs[\"QueueArn\"]] }]\n end",
"def fetch_queue(room)\n fail ArgumentError, 'must be a Lita::Room object' unless room.is_a? Lita::Room\n\n serialized = redis.get(room.id)\n\n if serialized\n MultiJson.load(serialized)\n else\n []\n end\n end",
"def list_queues()\n result = make_request('ListQueues')\n\n if result['ListQueuesResult']\n value = result['ListQueuesResult']\n elsif result['ListQueuesResponse']\n value = result['ListQueuesResponse']['ListQueuesResult']\n else\n value = nil\n end\n\n unless value.nil?\n return value\n else\n raise Exception, \"Amazon SQS Error Code: \" + result['Error'][0]['Code'][0] +\n \"\\n\" + result['Error'][0]['Message'][0]\n end\n end",
"def message\n\t\tself.object[\"message\"]\n\tend",
"def size\n\n @queue.size\n end",
"def queued\n hydra.queued_requests\n end",
"def show\n @training_queue = Training::Queue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training_queue, :root => :training_queue }\n end\n end",
"def info\n Thread.current[:info]\n end",
"def queue\n @queue ||= produce_queue\n end",
"def tomqueue_payload\n JSON.dump({\n \"delayed_job_id\" => self.id,\n \"delayed_job_digest\" => tomqueue_digest,\n \"delayed_job_updated_at\" => self.updated_at.iso8601(0)\n })\n end"
] | [
"0.7035148",
"0.6950711",
"0.6895175",
"0.6888979",
"0.68703395",
"0.6814118",
"0.6755307",
"0.66440725",
"0.6433887",
"0.6354206",
"0.63439405",
"0.63269806",
"0.6320574",
"0.6320574",
"0.62654006",
"0.6218406",
"0.6208837",
"0.6202117",
"0.6181912",
"0.6115444",
"0.6067164",
"0.6044996",
"0.6043121",
"0.6041195",
"0.60189706",
"0.60041815",
"0.599307",
"0.5961175",
"0.5926828",
"0.5924632",
"0.5924632",
"0.5924632",
"0.59090775",
"0.59054005",
"0.5893958",
"0.58858794",
"0.5876781",
"0.58444047",
"0.5838897",
"0.58285636",
"0.5799748",
"0.5793342",
"0.57729167",
"0.57598454",
"0.5748654",
"0.57160956",
"0.56969714",
"0.56806594",
"0.5677399",
"0.5674831",
"0.5674666",
"0.5674371",
"0.56732714",
"0.56719875",
"0.56521416",
"0.5645623",
"0.56437606",
"0.5627107",
"0.56042445",
"0.5592549",
"0.55824566",
"0.55813783",
"0.5580281",
"0.557905",
"0.55673873",
"0.556207",
"0.55579346",
"0.553897",
"0.553897",
"0.5523091",
"0.55216724",
"0.55118287",
"0.5511155",
"0.55101144",
"0.55090356",
"0.54984856",
"0.54974395",
"0.54936683",
"0.5492884",
"0.54773855",
"0.54736006",
"0.54664624",
"0.5457593",
"0.54528636",
"0.54315555",
"0.54288393",
"0.54250926",
"0.5423453",
"0.54214954",
"0.5413354",
"0.5406199",
"0.54030627",
"0.54014367",
"0.5398676",
"0.53946024",
"0.5382173",
"0.5373895",
"0.53716946",
"0.5371167",
"0.536868"
] | 0.5525941 | 69 |
Get Estimated Wait Time | def get_routing_queue_estimatedwaittime(queue_id, opts = {})
data, _status_code, _headers = get_routing_queue_estimatedwaittime_with_http_info(queue_id, opts)
return data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait_time\n self.measurement.wait_time\n end",
"def runtime_latency\n (finished_at || Time.current) - performed_at if performed_at\n end",
"def estimate_at_completion_duration\n return planned_duration - earned_schedule\n end",
"def total_mpi_busy_wait_time\n @total_mpi_busy_time ||= parse_for_event(:mpi_busy_wait_time)\n @total_mpi_busy_time\n end",
"def estimated_stop_time\n result = 0\n recipe.schedule.tasks.each do |t|\n result += t.duration + t.ramp_estimate\n end\n\n start_time + result.seconds\n end",
"def total_wait\n if cart.delivers\n if !cart.delivery_duration.blank?\n response = estimated_wait + cart.delivery_duration\n else\n response = estimated_wait + 20\n end\n else\n response = estimated_wait\n end\n\n return response\n end",
"def get_waiting_time_str\n get_time_diff_string(self.requested_at, self.started_at)\n end",
"def remaining_time()\n return @total_time_units - @done_time_units\n end",
"def wait_time(attempts)\n 2 ** (attempts.to_i + 2)\n end",
"def take_time\n if self.completed?\n (complete_on - started_on) if complete_on && started_on\n end\n end",
"def time_elapsed\n if !self.finished.blank?\n ((self.finished - self.started) / 60).to_i\n end\n end",
"def get_time_remaining\n\n end",
"def wait_time\n if rate_limit_remaining < 50\n [rate_limit_reset - Time.zone.now, 0.001].sort.last\n else\n 3600.0 / rate_limiting\n end\n end",
"def get_elapse_time\n @start_time ||= @time_now\n return @time_now - @start_time\n end",
"def cpu_time\n @cpu_time_finish - @cpu_time_start\n end",
"def run_time\n ((Time.now - start_time) * 1000).round\n end",
"def time_remaining\n end",
"def execution_time\n @process.instance_variable_get(:@execution_time).total\n end",
"def time_remaining\n\n end",
"def calculate_sleep\n if @timeouts.empty?\n @sleep_for = DefaultSleepFor\n else\n diff = @timeouts.first.value.timeout_at.to_f - Time.now.to_f\n\n if diff < 0.0\n @sleep_for = 0\n else\n @sleep_for = diff\n end\n end\n end",
"def running_time\n a = started_at or return nil\n b = done_at or return nil\n (b - a).to_f * 24 * 60\n end",
"def max_wait_time\n @data[\"max_wait_time\"]\n end",
"def execution_time\n @execution_time ||= order.attribute_ids_with_qauntity.map do |data|\n att = photographer_attributes.find_by(attribute_item_id: data.first)\n att.default_time + data.last.modulo(att.attribute_item.base_quantity) * att.extra_time\n end.sum\n end",
"def duration # (in seconds)\n if self.end_time and self.start_time \n return (self.end_time - self.start_time).to_i\n end\n walk_time.to_i +\n transit_time.to_i +\n wait_time.to_i\n end",
"def num_waiting\n @num_waiting\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000000\n end",
"def calculate_duration_of(task) ; 5 ; end",
"def process_duration\n return 0.0 unless process_ended_at && process_started_at\n\n (process_ended_at - process_started_at).ceil(3)\n end",
"def duration\n ran? ? (completed_at || failed_at) - started_at : 0\n end",
"def progress()\n return 1.0 * @done_time_units / @total_time_units\n end",
"def time_spent_attempting_state(state, options)\n states = retries_for_state(state, options)\n if states.empty?\n 0\n else\n Time.now.to_f - states.last[:transitioned_at].to_f\n end.to_f\n end",
"def time_remaining\n return 0 if finished_at\n backup_source_jobs.map(&:time_remaining).sum\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000\n end",
"def num_waiting\n @num_waiting.value\n end",
"def fetchSimulationTime()\n com = Sumo::Traci::Command_GetVariable.new(:sim, :timeStep, \"\") ;\n execCommands(com) ;\n time = com.responseValue() ;\n return time ;\n end",
"def timeout_frozen_tests_secs\n @game_info['timeout_frozen_tests_secs']\n end",
"def time_elapsed\n\t\treturn Time.now - self.start_time\n\tend",
"def cycle_time\n if completed_at && started_at\n completed_at - started_at\n else\n 0.0\n end\n end",
"def requests_per_second\n requests / horizon_time\n end",
"def time_spent\n return nil if self.finished_at.nil?\n# if self.completed?\n self.finished_at - self.started_at\n# else\n# Time.now - self.started_at\n# end\n end",
"def time_elapsed\n Time.now - @start_time\n end",
"def getCompleted\n if @dry_run\n nil\n else\n JSON.parse(@client[\"/LoadTest?loadTestId=#{@test_id}\"].get)[0].to_h['completed_time']\n end\n end",
"def elapsed_time\n return nil if !started_at.present? || aborted_at.present?\n\n (finished_at.present? ? finished_at : Time.now) - started_at\n end",
"def get_duration()\n puts \"The task will take #{(@date_end - @date_start).to_i} days\"\n end",
"def up_time\n (Process.clock_gettime(Process::CLOCK_MONOTONIC) - (@start[:time] || Time.now)).round(3)\n end",
"def get_completion_time()\n return process_stamp(@end_time)\n end",
"def duration\n finished? ? finished_at.to_f - started_at.to_f : -1\n end",
"def ev_do_calculate_rw_wait(wait); end",
"def elapsed\n (Time.now - @start_time).round\n end",
"def duration_of_stay\n duration_of_stay = (@check_out - @check_in).to_i\n return duration_of_stay\n end",
"def get_run_time(ant)\n end",
"def estimated_reading_time\n estimate = content.split(/\\s+/).length / AVERAGE_WPM\n \"#{estimate >= 1 ? estimate : '< 1'} min read\"\n end",
"def average_wait_time\n self.reviews.average(:wait_time).to_i\n end",
"def get_time_required\n 1.0\n end",
"def run_time\n return nil unless self.start_time\n (self.end_time || Time.now) - self.start_time\n end",
"def time_left\n return 0.0 if free?\n return end_time - Time.now.to_f\n end",
"def calculate_elapsed_time(result)\n Time.parse(result.finish_time).to_i - Time.parse(result.start_time).to_i\n end",
"def get_total_runtime_ms\n (TimeDifference.between(*get_runtime_timestamps).in_seconds * 1000).to_i\n end",
"def elapsed_time\n if end_time && start_time\n return ((end_time - start_time)/60).round\n else\n return 0\n end\n end",
"def run_time_or_time_elapsed\n if self.end_time \n return Time.at(self.end_time - self.start_time)\n else\n return Time.at(Time.now - self.start_time)\n end\n end",
"def total_time; end",
"def find_time_asleep\n @total_time_asleep = 0\n @wake_times.each_with_index do |wake_time, index|\n @total_time_asleep += ( wake_time - @sleep_times[index] )\n end\n end",
"def get_net_duration()\n durations = @test_cases.collect{ |c| \n c.get_net_duration()\n }\n return durations.reduce(:+)\n end",
"def num_waiting\n @waiting\n end",
"def time_to_finish\n past_time = Time.now - self[:start_time]\n seconds_to_go = past_time * self[:max] / self[:current] - past_time\n puts \"time to go: #{seconds_to_go.round}s\"\n end",
"def get_total_runtime\n TimeDifference.between(*get_runtime_timestamps).humanize\n end",
"def waitTime()\n time = Time.now().to_i / 60\n\n # Cleanup once every ten minutes\n if (@lastFloodBucketReap != time && time % 10 == 0)\n @floodControl.delete_if{|key, val| key <= (time - 5) }\n @lastFloodBucketReap = time\n end\n\n @floodControl[time] += 1\n\n count = 0\n for i in 0...5\n count += (@floodControl[time - i] * (5 - i))\n end\n\n return 0.1 + (count * 0.0393)\n end",
"def duration\n start = start_time.to_i\n end_with_delay = end_time.to_i + (@parts.last.target_delay * 1.minutes)\n\n end_with_delay - start\n end",
"def get_timeout\n if @valgrind\n return timeout_seconds * TestBase::VALGRIND_TIMEOUT_MULTIPLIER\n elsif has_active_sanitizers\n return timeout_seconds * TestBase::SANITIZERS_TIMEOUT_MULTIPLIER\n else\n return timeout_seconds\n end\n end",
"def time_diff_milli(start, finish)\n (finish - start) * 1000.0\n end",
"def children_time\n self.total_time - self.self_time - self.wait_time\n end",
"def get_duration\n ((finish - start) / 60 / 60) - (break_length / 60)\n end",
"def idle_time\n diff = duration - cpu_time\n diff > 0.0 ? diff : 0.0\n end",
"def elapsed_time\n if @start_time && @end_time\n @end_time - @start_time\n else\n nil\n end\n end",
"def num_waiting\n end",
"def num_waiting\n end",
"def get_waiting\n raise NotImplementedError\n end",
"def ready_in_time\n return self.preparation_time + self.cooking_time\n end",
"def report_time_elapsed\n self.test_session.time_elapsed\n end",
"def wait_interval\n timer = @timers.first\n return 0 unless timer\n\n delay = timer.fire_time - Timers.now\n delay < 0 ? -1 : delay\n end",
"def time\n building_time + execution_time\n end",
"def tsbs_wait_dur\n return TSBS::TSBS_END_SEQUENCE_WAIT\n end",
"def when_to_run\n time - @@REMINDER_TIME\n end",
"def process_duration\n t1 = Process.times.utime\n Process.times.utime - t1\nend",
"def wait_time_span\n return @retry_period unless @use_backoff\n time_span = [ 2 ** @iteration * @retry_period, @max_retry_period ].min\n @iteration += 1\n time_span\n end",
"def duration\n\t\tt =(Time.now- @start)\n\t\treturn t\n\tend",
"def seconds_remaining\n ends_at ? (ends_at - started_at).round : 0\n end",
"def delay_time\n return (self.aggressive == false ? 0 : (15 - self.aggressive) * 3)\n end",
"def task_duration\n\n if self.complete?\n sprintf(\"%4.1f\", (self.completed_on - self.created_on) / 1.day)\n else\n '0'\n end\n\n end",
"def duration\n return unless finished_at\n\n elapsed_time(started_at, finished_at)\n end",
"def time_diff_milli( start, finish )\n\n\t( finish - start )\n\nend",
"def time\n end_time - start_time\n end",
"def waiting_size\n @waiting.size\n end",
"def get_time_required\n 0 # number of minutes\n end",
"def finish_time\n prop = finish_property\n prop ? prop.to_finish_time : nil\n end",
"def execution_duration\n duration = nil\n unless self.stopped_at.nil?\n duration_seconds = self.stopped_at - self.started_at\n dhc = duration_seconds / 3600 # hours component\n dhc_mod = duration_seconds % 3600\n dhm = dhc_mod / 60 # minutes component\n dhs = dhc_mod % 60 # seconds component\n\n duration = format('%02d:%02d:%02d', dhc, dhm, dhs)\n end\n\n duration\n end",
"def tests_poll_secs\n @game_info['tests_poll_secs']\n end",
"def estimatedEndServerTime \n \"estimatedEndServerTime\" \n end",
"def fast_duration\n 0.5\n end",
"def duration\n (finish - start)/3600\n end",
"def time_duration\n t1 = Time.now.to_f\n Time.now.to_f - t1\nend"
] | [
"0.81492645",
"0.7104484",
"0.70677775",
"0.70523655",
"0.7039066",
"0.7015603",
"0.69371104",
"0.688588",
"0.68729275",
"0.68664545",
"0.686521",
"0.68544644",
"0.67905307",
"0.6749323",
"0.6745617",
"0.6745584",
"0.67152995",
"0.6707634",
"0.66368276",
"0.6594622",
"0.65853965",
"0.6563669",
"0.65414375",
"0.65267974",
"0.64856523",
"0.64800984",
"0.6472956",
"0.6457408",
"0.6435629",
"0.6402705",
"0.6395043",
"0.6384435",
"0.6362969",
"0.6349933",
"0.6333551",
"0.6330605",
"0.63229233",
"0.6319564",
"0.630554",
"0.63052356",
"0.6298853",
"0.6296771",
"0.62922776",
"0.6291361",
"0.6282124",
"0.62817746",
"0.6272392",
"0.62720764",
"0.62685674",
"0.62600064",
"0.62599283",
"0.62515825",
"0.62515175",
"0.6249938",
"0.624736",
"0.62443703",
"0.6234605",
"0.6221683",
"0.6215637",
"0.6212041",
"0.6205881",
"0.62040216",
"0.62034535",
"0.62011254",
"0.61979985",
"0.6162319",
"0.6160553",
"0.6158797",
"0.6150984",
"0.61384165",
"0.61227804",
"0.6122777",
"0.6118311",
"0.61147",
"0.6095424",
"0.6095424",
"0.6087918",
"0.6074446",
"0.607387",
"0.6070428",
"0.60667026",
"0.60631084",
"0.6061473",
"0.60555935",
"0.60555285",
"0.6047217",
"0.6043858",
"0.60413796",
"0.60339075",
"0.60338145",
"0.60199565",
"0.6008925",
"0.60056055",
"0.600255",
"0.6000807",
"0.5994831",
"0.5987515",
"0.5987041",
"0.59815407",
"0.59807044",
"0.59787345"
] | 0.0 | -1 |
Get Estimated Wait Time | def get_routing_queue_estimatedwaittime_with_http_info(queue_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.get_routing_queue_estimatedwaittime ..."
end
# verify the required parameter 'queue_id' is set
fail ArgumentError, "Missing the required parameter 'queue_id' when calling RoutingApi.get_routing_queue_estimatedwaittime" if queue_id.nil?
# resource path
local_var_path = "/api/v2/routing/queues/{queueId}/estimatedwaittime".sub('{format}','json').sub('{' + 'queueId' + '}', queue_id.to_s)
# query parameters
query_params = {}
query_params[:'conversationId'] = opts[:'conversation_id'] if opts[:'conversation_id']
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => 'EstimatedWaitTimePredictions')
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#get_routing_queue_estimatedwaittime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait_time\n self.measurement.wait_time\n end",
"def runtime_latency\n (finished_at || Time.current) - performed_at if performed_at\n end",
"def estimate_at_completion_duration\n return planned_duration - earned_schedule\n end",
"def total_mpi_busy_wait_time\n @total_mpi_busy_time ||= parse_for_event(:mpi_busy_wait_time)\n @total_mpi_busy_time\n end",
"def estimated_stop_time\n result = 0\n recipe.schedule.tasks.each do |t|\n result += t.duration + t.ramp_estimate\n end\n\n start_time + result.seconds\n end",
"def total_wait\n if cart.delivers\n if !cart.delivery_duration.blank?\n response = estimated_wait + cart.delivery_duration\n else\n response = estimated_wait + 20\n end\n else\n response = estimated_wait\n end\n\n return response\n end",
"def get_waiting_time_str\n get_time_diff_string(self.requested_at, self.started_at)\n end",
"def remaining_time()\n return @total_time_units - @done_time_units\n end",
"def wait_time(attempts)\n 2 ** (attempts.to_i + 2)\n end",
"def take_time\n if self.completed?\n (complete_on - started_on) if complete_on && started_on\n end\n end",
"def time_elapsed\n if !self.finished.blank?\n ((self.finished - self.started) / 60).to_i\n end\n end",
"def get_time_remaining\n\n end",
"def wait_time\n if rate_limit_remaining < 50\n [rate_limit_reset - Time.zone.now, 0.001].sort.last\n else\n 3600.0 / rate_limiting\n end\n end",
"def get_elapse_time\n @start_time ||= @time_now\n return @time_now - @start_time\n end",
"def cpu_time\n @cpu_time_finish - @cpu_time_start\n end",
"def run_time\n ((Time.now - start_time) * 1000).round\n end",
"def time_remaining\n end",
"def execution_time\n @process.instance_variable_get(:@execution_time).total\n end",
"def time_remaining\n\n end",
"def calculate_sleep\n if @timeouts.empty?\n @sleep_for = DefaultSleepFor\n else\n diff = @timeouts.first.value.timeout_at.to_f - Time.now.to_f\n\n if diff < 0.0\n @sleep_for = 0\n else\n @sleep_for = diff\n end\n end\n end",
"def running_time\n a = started_at or return nil\n b = done_at or return nil\n (b - a).to_f * 24 * 60\n end",
"def max_wait_time\n @data[\"max_wait_time\"]\n end",
"def execution_time\n @execution_time ||= order.attribute_ids_with_qauntity.map do |data|\n att = photographer_attributes.find_by(attribute_item_id: data.first)\n att.default_time + data.last.modulo(att.attribute_item.base_quantity) * att.extra_time\n end.sum\n end",
"def duration # (in seconds)\n if self.end_time and self.start_time \n return (self.end_time - self.start_time).to_i\n end\n walk_time.to_i +\n transit_time.to_i +\n wait_time.to_i\n end",
"def num_waiting\n @num_waiting\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000000\n end",
"def calculate_duration_of(task) ; 5 ; end",
"def process_duration\n return 0.0 unless process_ended_at && process_started_at\n\n (process_ended_at - process_started_at).ceil(3)\n end",
"def duration\n ran? ? (completed_at || failed_at) - started_at : 0\n end",
"def progress()\n return 1.0 * @done_time_units / @total_time_units\n end",
"def time_spent_attempting_state(state, options)\n states = retries_for_state(state, options)\n if states.empty?\n 0\n else\n Time.now.to_f - states.last[:transitioned_at].to_f\n end.to_f\n end",
"def time_remaining\n return 0 if finished_at\n backup_source_jobs.map(&:time_remaining).sum\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000\n end",
"def num_waiting\n @num_waiting.value\n end",
"def fetchSimulationTime()\n com = Sumo::Traci::Command_GetVariable.new(:sim, :timeStep, \"\") ;\n execCommands(com) ;\n time = com.responseValue() ;\n return time ;\n end",
"def timeout_frozen_tests_secs\n @game_info['timeout_frozen_tests_secs']\n end",
"def time_elapsed\n\t\treturn Time.now - self.start_time\n\tend",
"def cycle_time\n if completed_at && started_at\n completed_at - started_at\n else\n 0.0\n end\n end",
"def requests_per_second\n requests / horizon_time\n end",
"def time_spent\n return nil if self.finished_at.nil?\n# if self.completed?\n self.finished_at - self.started_at\n# else\n# Time.now - self.started_at\n# end\n end",
"def time_elapsed\n Time.now - @start_time\n end",
"def getCompleted\n if @dry_run\n nil\n else\n JSON.parse(@client[\"/LoadTest?loadTestId=#{@test_id}\"].get)[0].to_h['completed_time']\n end\n end",
"def elapsed_time\n return nil if !started_at.present? || aborted_at.present?\n\n (finished_at.present? ? finished_at : Time.now) - started_at\n end",
"def get_duration()\n puts \"The task will take #{(@date_end - @date_start).to_i} days\"\n end",
"def up_time\n (Process.clock_gettime(Process::CLOCK_MONOTONIC) - (@start[:time] || Time.now)).round(3)\n end",
"def get_completion_time()\n return process_stamp(@end_time)\n end",
"def duration\n finished? ? finished_at.to_f - started_at.to_f : -1\n end",
"def ev_do_calculate_rw_wait(wait); end",
"def elapsed\n (Time.now - @start_time).round\n end",
"def duration_of_stay\n duration_of_stay = (@check_out - @check_in).to_i\n return duration_of_stay\n end",
"def get_run_time(ant)\n end",
"def estimated_reading_time\n estimate = content.split(/\\s+/).length / AVERAGE_WPM\n \"#{estimate >= 1 ? estimate : '< 1'} min read\"\n end",
"def average_wait_time\n self.reviews.average(:wait_time).to_i\n end",
"def get_time_required\n 1.0\n end",
"def run_time\n return nil unless self.start_time\n (self.end_time || Time.now) - self.start_time\n end",
"def time_left\n return 0.0 if free?\n return end_time - Time.now.to_f\n end",
"def calculate_elapsed_time(result)\n Time.parse(result.finish_time).to_i - Time.parse(result.start_time).to_i\n end",
"def get_total_runtime_ms\n (TimeDifference.between(*get_runtime_timestamps).in_seconds * 1000).to_i\n end",
"def elapsed_time\n if end_time && start_time\n return ((end_time - start_time)/60).round\n else\n return 0\n end\n end",
"def run_time_or_time_elapsed\n if self.end_time \n return Time.at(self.end_time - self.start_time)\n else\n return Time.at(Time.now - self.start_time)\n end\n end",
"def total_time; end",
"def get_net_duration()\n durations = @test_cases.collect{ |c| \n c.get_net_duration()\n }\n return durations.reduce(:+)\n end",
"def find_time_asleep\n @total_time_asleep = 0\n @wake_times.each_with_index do |wake_time, index|\n @total_time_asleep += ( wake_time - @sleep_times[index] )\n end\n end",
"def num_waiting\n @waiting\n end",
"def time_to_finish\n past_time = Time.now - self[:start_time]\n seconds_to_go = past_time * self[:max] / self[:current] - past_time\n puts \"time to go: #{seconds_to_go.round}s\"\n end",
"def get_total_runtime\n TimeDifference.between(*get_runtime_timestamps).humanize\n end",
"def waitTime()\n time = Time.now().to_i / 60\n\n # Cleanup once every ten minutes\n if (@lastFloodBucketReap != time && time % 10 == 0)\n @floodControl.delete_if{|key, val| key <= (time - 5) }\n @lastFloodBucketReap = time\n end\n\n @floodControl[time] += 1\n\n count = 0\n for i in 0...5\n count += (@floodControl[time - i] * (5 - i))\n end\n\n return 0.1 + (count * 0.0393)\n end",
"def duration\n start = start_time.to_i\n end_with_delay = end_time.to_i + (@parts.last.target_delay * 1.minutes)\n\n end_with_delay - start\n end",
"def get_timeout\n if @valgrind\n return timeout_seconds * TestBase::VALGRIND_TIMEOUT_MULTIPLIER\n elsif has_active_sanitizers\n return timeout_seconds * TestBase::SANITIZERS_TIMEOUT_MULTIPLIER\n else\n return timeout_seconds\n end\n end",
"def time_diff_milli(start, finish)\n (finish - start) * 1000.0\n end",
"def get_duration\n ((finish - start) / 60 / 60) - (break_length / 60)\n end",
"def children_time\n self.total_time - self.self_time - self.wait_time\n end",
"def idle_time\n diff = duration - cpu_time\n diff > 0.0 ? diff : 0.0\n end",
"def elapsed_time\n if @start_time && @end_time\n @end_time - @start_time\n else\n nil\n end\n end",
"def num_waiting\n end",
"def num_waiting\n end",
"def get_waiting\n raise NotImplementedError\n end",
"def ready_in_time\n return self.preparation_time + self.cooking_time\n end",
"def report_time_elapsed\n self.test_session.time_elapsed\n end",
"def wait_interval\n timer = @timers.first\n return 0 unless timer\n\n delay = timer.fire_time - Timers.now\n delay < 0 ? -1 : delay\n end",
"def time\n building_time + execution_time\n end",
"def tsbs_wait_dur\n return TSBS::TSBS_END_SEQUENCE_WAIT\n end",
"def when_to_run\n time - @@REMINDER_TIME\n end",
"def process_duration\n t1 = Process.times.utime\n Process.times.utime - t1\nend",
"def wait_time_span\n return @retry_period unless @use_backoff\n time_span = [ 2 ** @iteration * @retry_period, @max_retry_period ].min\n @iteration += 1\n time_span\n end",
"def duration\n\t\tt =(Time.now- @start)\n\t\treturn t\n\tend",
"def seconds_remaining\n ends_at ? (ends_at - started_at).round : 0\n end",
"def delay_time\n return (self.aggressive == false ? 0 : (15 - self.aggressive) * 3)\n end",
"def task_duration\n\n if self.complete?\n sprintf(\"%4.1f\", (self.completed_on - self.created_on) / 1.day)\n else\n '0'\n end\n\n end",
"def duration\n return unless finished_at\n\n elapsed_time(started_at, finished_at)\n end",
"def time_diff_milli( start, finish )\n\n\t( finish - start )\n\nend",
"def time\n end_time - start_time\n end",
"def waiting_size\n @waiting.size\n end",
"def get_time_required\n 0 # number of minutes\n end",
"def finish_time\n prop = finish_property\n prop ? prop.to_finish_time : nil\n end",
"def execution_duration\n duration = nil\n unless self.stopped_at.nil?\n duration_seconds = self.stopped_at - self.started_at\n dhc = duration_seconds / 3600 # hours component\n dhc_mod = duration_seconds % 3600\n dhm = dhc_mod / 60 # minutes component\n dhs = dhc_mod % 60 # seconds component\n\n duration = format('%02d:%02d:%02d', dhc, dhm, dhs)\n end\n\n duration\n end",
"def estimatedEndServerTime \n \"estimatedEndServerTime\" \n end",
"def tests_poll_secs\n @game_info['tests_poll_secs']\n end",
"def fast_duration\n 0.5\n end",
"def duration\n (finish - start)/3600\n end",
"def time_duration\n t1 = Time.now.to_f\n Time.now.to_f - t1\nend"
] | [
"0.81487745",
"0.71049595",
"0.7069294",
"0.7051209",
"0.70391375",
"0.7016588",
"0.6935786",
"0.68869776",
"0.68720704",
"0.68671584",
"0.68660015",
"0.68559414",
"0.67899704",
"0.6750042",
"0.6745653",
"0.6744974",
"0.67171395",
"0.6707889",
"0.66387314",
"0.65927136",
"0.6584501",
"0.65639377",
"0.6541751",
"0.6527897",
"0.6485767",
"0.64811367",
"0.64743435",
"0.6457498",
"0.64360267",
"0.6403506",
"0.63949615",
"0.6384333",
"0.6363913",
"0.63509566",
"0.6333814",
"0.6330099",
"0.63240534",
"0.6319703",
"0.63067096",
"0.63059175",
"0.62996656",
"0.62969697",
"0.6292555",
"0.62923414",
"0.6281868",
"0.62813437",
"0.6273598",
"0.6271734",
"0.6269551",
"0.62606657",
"0.62602085",
"0.62530637",
"0.6252272",
"0.625003",
"0.6247353",
"0.62448967",
"0.6235722",
"0.6221871",
"0.6216456",
"0.6211822",
"0.62081367",
"0.6204912",
"0.62038803",
"0.62016505",
"0.6197879",
"0.61623937",
"0.6159876",
"0.6159763",
"0.61507106",
"0.61393076",
"0.6123354",
"0.6122507",
"0.6118367",
"0.61159533",
"0.60963184",
"0.60963184",
"0.6087143",
"0.6074449",
"0.6074003",
"0.60694593",
"0.60665715",
"0.6062143",
"0.6061984",
"0.6055809",
"0.60526",
"0.604899",
"0.6044143",
"0.60420203",
"0.60352045",
"0.6034387",
"0.60213983",
"0.6009635",
"0.60062194",
"0.60031325",
"0.60009146",
"0.59952855",
"0.5988522",
"0.59884566",
"0.59835",
"0.59819335",
"0.59802365"
] | 0.0 | -1 |
Get Estimated Wait Time | def get_routing_queue_mediatype_estimatedwaittime(queue_id, media_type, opts = {})
data, _status_code, _headers = get_routing_queue_mediatype_estimatedwaittime_with_http_info(queue_id, media_type, opts)
return data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait_time\n self.measurement.wait_time\n end",
"def runtime_latency\n (finished_at || Time.current) - performed_at if performed_at\n end",
"def estimate_at_completion_duration\n return planned_duration - earned_schedule\n end",
"def total_mpi_busy_wait_time\n @total_mpi_busy_time ||= parse_for_event(:mpi_busy_wait_time)\n @total_mpi_busy_time\n end",
"def estimated_stop_time\n result = 0\n recipe.schedule.tasks.each do |t|\n result += t.duration + t.ramp_estimate\n end\n\n start_time + result.seconds\n end",
"def total_wait\n if cart.delivers\n if !cart.delivery_duration.blank?\n response = estimated_wait + cart.delivery_duration\n else\n response = estimated_wait + 20\n end\n else\n response = estimated_wait\n end\n\n return response\n end",
"def get_waiting_time_str\n get_time_diff_string(self.requested_at, self.started_at)\n end",
"def remaining_time()\n return @total_time_units - @done_time_units\n end",
"def wait_time(attempts)\n 2 ** (attempts.to_i + 2)\n end",
"def take_time\n if self.completed?\n (complete_on - started_on) if complete_on && started_on\n end\n end",
"def time_elapsed\n if !self.finished.blank?\n ((self.finished - self.started) / 60).to_i\n end\n end",
"def get_time_remaining\n\n end",
"def wait_time\n if rate_limit_remaining < 50\n [rate_limit_reset - Time.zone.now, 0.001].sort.last\n else\n 3600.0 / rate_limiting\n end\n end",
"def get_elapse_time\n @start_time ||= @time_now\n return @time_now - @start_time\n end",
"def cpu_time\n @cpu_time_finish - @cpu_time_start\n end",
"def run_time\n ((Time.now - start_time) * 1000).round\n end",
"def time_remaining\n end",
"def execution_time\n @process.instance_variable_get(:@execution_time).total\n end",
"def time_remaining\n\n end",
"def calculate_sleep\n if @timeouts.empty?\n @sleep_for = DefaultSleepFor\n else\n diff = @timeouts.first.value.timeout_at.to_f - Time.now.to_f\n\n if diff < 0.0\n @sleep_for = 0\n else\n @sleep_for = diff\n end\n end\n end",
"def running_time\n a = started_at or return nil\n b = done_at or return nil\n (b - a).to_f * 24 * 60\n end",
"def max_wait_time\n @data[\"max_wait_time\"]\n end",
"def execution_time\n @execution_time ||= order.attribute_ids_with_qauntity.map do |data|\n att = photographer_attributes.find_by(attribute_item_id: data.first)\n att.default_time + data.last.modulo(att.attribute_item.base_quantity) * att.extra_time\n end.sum\n end",
"def duration # (in seconds)\n if self.end_time and self.start_time \n return (self.end_time - self.start_time).to_i\n end\n walk_time.to_i +\n transit_time.to_i +\n wait_time.to_i\n end",
"def num_waiting\n @num_waiting\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000000\n end",
"def calculate_duration_of(task) ; 5 ; end",
"def process_duration\n return 0.0 unless process_ended_at && process_started_at\n\n (process_ended_at - process_started_at).ceil(3)\n end",
"def duration\n ran? ? (completed_at || failed_at) - started_at : 0\n end",
"def progress()\n return 1.0 * @done_time_units / @total_time_units\n end",
"def time_spent_attempting_state(state, options)\n states = retries_for_state(state, options)\n if states.empty?\n 0\n else\n Time.now.to_f - states.last[:transitioned_at].to_f\n end.to_f\n end",
"def time_remaining\n return 0 if finished_at\n backup_source_jobs.map(&:time_remaining).sum\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000\n end",
"def num_waiting\n @num_waiting.value\n end",
"def fetchSimulationTime()\n com = Sumo::Traci::Command_GetVariable.new(:sim, :timeStep, \"\") ;\n execCommands(com) ;\n time = com.responseValue() ;\n return time ;\n end",
"def timeout_frozen_tests_secs\n @game_info['timeout_frozen_tests_secs']\n end",
"def time_elapsed\n\t\treturn Time.now - self.start_time\n\tend",
"def cycle_time\n if completed_at && started_at\n completed_at - started_at\n else\n 0.0\n end\n end",
"def requests_per_second\n requests / horizon_time\n end",
"def time_spent\n return nil if self.finished_at.nil?\n# if self.completed?\n self.finished_at - self.started_at\n# else\n# Time.now - self.started_at\n# end\n end",
"def time_elapsed\n Time.now - @start_time\n end",
"def getCompleted\n if @dry_run\n nil\n else\n JSON.parse(@client[\"/LoadTest?loadTestId=#{@test_id}\"].get)[0].to_h['completed_time']\n end\n end",
"def elapsed_time\n return nil if !started_at.present? || aborted_at.present?\n\n (finished_at.present? ? finished_at : Time.now) - started_at\n end",
"def get_duration()\n puts \"The task will take #{(@date_end - @date_start).to_i} days\"\n end",
"def up_time\n (Process.clock_gettime(Process::CLOCK_MONOTONIC) - (@start[:time] || Time.now)).round(3)\n end",
"def get_completion_time()\n return process_stamp(@end_time)\n end",
"def duration\n finished? ? finished_at.to_f - started_at.to_f : -1\n end",
"def ev_do_calculate_rw_wait(wait); end",
"def elapsed\n (Time.now - @start_time).round\n end",
"def duration_of_stay\n duration_of_stay = (@check_out - @check_in).to_i\n return duration_of_stay\n end",
"def get_run_time(ant)\n end",
"def estimated_reading_time\n estimate = content.split(/\\s+/).length / AVERAGE_WPM\n \"#{estimate >= 1 ? estimate : '< 1'} min read\"\n end",
"def average_wait_time\n self.reviews.average(:wait_time).to_i\n end",
"def get_time_required\n 1.0\n end",
"def run_time\n return nil unless self.start_time\n (self.end_time || Time.now) - self.start_time\n end",
"def time_left\n return 0.0 if free?\n return end_time - Time.now.to_f\n end",
"def calculate_elapsed_time(result)\n Time.parse(result.finish_time).to_i - Time.parse(result.start_time).to_i\n end",
"def get_total_runtime_ms\n (TimeDifference.between(*get_runtime_timestamps).in_seconds * 1000).to_i\n end",
"def elapsed_time\n if end_time && start_time\n return ((end_time - start_time)/60).round\n else\n return 0\n end\n end",
"def run_time_or_time_elapsed\n if self.end_time \n return Time.at(self.end_time - self.start_time)\n else\n return Time.at(Time.now - self.start_time)\n end\n end",
"def total_time; end",
"def get_net_duration()\n durations = @test_cases.collect{ |c| \n c.get_net_duration()\n }\n return durations.reduce(:+)\n end",
"def find_time_asleep\n @total_time_asleep = 0\n @wake_times.each_with_index do |wake_time, index|\n @total_time_asleep += ( wake_time - @sleep_times[index] )\n end\n end",
"def num_waiting\n @waiting\n end",
"def time_to_finish\n past_time = Time.now - self[:start_time]\n seconds_to_go = past_time * self[:max] / self[:current] - past_time\n puts \"time to go: #{seconds_to_go.round}s\"\n end",
"def get_total_runtime\n TimeDifference.between(*get_runtime_timestamps).humanize\n end",
"def waitTime()\n time = Time.now().to_i / 60\n\n # Cleanup once every ten minutes\n if (@lastFloodBucketReap != time && time % 10 == 0)\n @floodControl.delete_if{|key, val| key <= (time - 5) }\n @lastFloodBucketReap = time\n end\n\n @floodControl[time] += 1\n\n count = 0\n for i in 0...5\n count += (@floodControl[time - i] * (5 - i))\n end\n\n return 0.1 + (count * 0.0393)\n end",
"def duration\n start = start_time.to_i\n end_with_delay = end_time.to_i + (@parts.last.target_delay * 1.minutes)\n\n end_with_delay - start\n end",
"def get_timeout\n if @valgrind\n return timeout_seconds * TestBase::VALGRIND_TIMEOUT_MULTIPLIER\n elsif has_active_sanitizers\n return timeout_seconds * TestBase::SANITIZERS_TIMEOUT_MULTIPLIER\n else\n return timeout_seconds\n end\n end",
"def time_diff_milli(start, finish)\n (finish - start) * 1000.0\n end",
"def get_duration\n ((finish - start) / 60 / 60) - (break_length / 60)\n end",
"def children_time\n self.total_time - self.self_time - self.wait_time\n end",
"def idle_time\n diff = duration - cpu_time\n diff > 0.0 ? diff : 0.0\n end",
"def elapsed_time\n if @start_time && @end_time\n @end_time - @start_time\n else\n nil\n end\n end",
"def num_waiting\n end",
"def num_waiting\n end",
"def get_waiting\n raise NotImplementedError\n end",
"def ready_in_time\n return self.preparation_time + self.cooking_time\n end",
"def report_time_elapsed\n self.test_session.time_elapsed\n end",
"def wait_interval\n timer = @timers.first\n return 0 unless timer\n\n delay = timer.fire_time - Timers.now\n delay < 0 ? -1 : delay\n end",
"def time\n building_time + execution_time\n end",
"def tsbs_wait_dur\n return TSBS::TSBS_END_SEQUENCE_WAIT\n end",
"def when_to_run\n time - @@REMINDER_TIME\n end",
"def process_duration\n t1 = Process.times.utime\n Process.times.utime - t1\nend",
"def wait_time_span\n return @retry_period unless @use_backoff\n time_span = [ 2 ** @iteration * @retry_period, @max_retry_period ].min\n @iteration += 1\n time_span\n end",
"def duration\n\t\tt =(Time.now- @start)\n\t\treturn t\n\tend",
"def seconds_remaining\n ends_at ? (ends_at - started_at).round : 0\n end",
"def delay_time\n return (self.aggressive == false ? 0 : (15 - self.aggressive) * 3)\n end",
"def task_duration\n\n if self.complete?\n sprintf(\"%4.1f\", (self.completed_on - self.created_on) / 1.day)\n else\n '0'\n end\n\n end",
"def duration\n return unless finished_at\n\n elapsed_time(started_at, finished_at)\n end",
"def time_diff_milli( start, finish )\n\n\t( finish - start )\n\nend",
"def time\n end_time - start_time\n end",
"def waiting_size\n @waiting.size\n end",
"def get_time_required\n 0 # number of minutes\n end",
"def finish_time\n prop = finish_property\n prop ? prop.to_finish_time : nil\n end",
"def execution_duration\n duration = nil\n unless self.stopped_at.nil?\n duration_seconds = self.stopped_at - self.started_at\n dhc = duration_seconds / 3600 # hours component\n dhc_mod = duration_seconds % 3600\n dhm = dhc_mod / 60 # minutes component\n dhs = dhc_mod % 60 # seconds component\n\n duration = format('%02d:%02d:%02d', dhc, dhm, dhs)\n end\n\n duration\n end",
"def estimatedEndServerTime \n \"estimatedEndServerTime\" \n end",
"def tests_poll_secs\n @game_info['tests_poll_secs']\n end",
"def fast_duration\n 0.5\n end",
"def duration\n (finish - start)/3600\n end",
"def time_duration\n t1 = Time.now.to_f\n Time.now.to_f - t1\nend"
] | [
"0.81487745",
"0.71049595",
"0.7069294",
"0.7051209",
"0.70391375",
"0.7016588",
"0.6935786",
"0.68869776",
"0.68720704",
"0.68671584",
"0.68660015",
"0.68559414",
"0.67899704",
"0.6750042",
"0.6745653",
"0.6744974",
"0.67171395",
"0.6707889",
"0.66387314",
"0.65927136",
"0.6584501",
"0.65639377",
"0.6541751",
"0.6527897",
"0.6485767",
"0.64811367",
"0.64743435",
"0.6457498",
"0.64360267",
"0.6403506",
"0.63949615",
"0.6384333",
"0.6363913",
"0.63509566",
"0.6333814",
"0.6330099",
"0.63240534",
"0.6319703",
"0.63067096",
"0.63059175",
"0.62996656",
"0.62969697",
"0.6292555",
"0.62923414",
"0.6281868",
"0.62813437",
"0.6273598",
"0.6271734",
"0.6269551",
"0.62606657",
"0.62602085",
"0.62530637",
"0.6252272",
"0.625003",
"0.6247353",
"0.62448967",
"0.6235722",
"0.6221871",
"0.6216456",
"0.6211822",
"0.62081367",
"0.6204912",
"0.62038803",
"0.62016505",
"0.6197879",
"0.61623937",
"0.6159876",
"0.6159763",
"0.61507106",
"0.61393076",
"0.6123354",
"0.6122507",
"0.6118367",
"0.61159533",
"0.60963184",
"0.60963184",
"0.6087143",
"0.6074449",
"0.6074003",
"0.60694593",
"0.60665715",
"0.6062143",
"0.6061984",
"0.6055809",
"0.60526",
"0.604899",
"0.6044143",
"0.60420203",
"0.60352045",
"0.6034387",
"0.60213983",
"0.6009635",
"0.60062194",
"0.60031325",
"0.60009146",
"0.59952855",
"0.5988522",
"0.59884566",
"0.59835",
"0.59819335",
"0.59802365"
] | 0.0 | -1 |
Get Estimated Wait Time | def get_routing_queue_mediatype_estimatedwaittime_with_http_info(queue_id, media_type, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.get_routing_queue_mediatype_estimatedwaittime ..."
end
# verify the required parameter 'queue_id' is set
fail ArgumentError, "Missing the required parameter 'queue_id' when calling RoutingApi.get_routing_queue_mediatype_estimatedwaittime" if queue_id.nil?
# verify the required parameter 'media_type' is set
fail ArgumentError, "Missing the required parameter 'media_type' when calling RoutingApi.get_routing_queue_mediatype_estimatedwaittime" if media_type.nil?
# resource path
local_var_path = "/api/v2/routing/queues/{queueId}/mediatypes/{mediaType}/estimatedwaittime".sub('{format}','json').sub('{' + 'queueId' + '}', queue_id.to_s).sub('{' + 'mediaType' + '}', media_type.to_s)
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => 'EstimatedWaitTimePredictions')
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#get_routing_queue_mediatype_estimatedwaittime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait_time\n self.measurement.wait_time\n end",
"def runtime_latency\n (finished_at || Time.current) - performed_at if performed_at\n end",
"def estimate_at_completion_duration\n return planned_duration - earned_schedule\n end",
"def total_mpi_busy_wait_time\n @total_mpi_busy_time ||= parse_for_event(:mpi_busy_wait_time)\n @total_mpi_busy_time\n end",
"def estimated_stop_time\n result = 0\n recipe.schedule.tasks.each do |t|\n result += t.duration + t.ramp_estimate\n end\n\n start_time + result.seconds\n end",
"def total_wait\n if cart.delivers\n if !cart.delivery_duration.blank?\n response = estimated_wait + cart.delivery_duration\n else\n response = estimated_wait + 20\n end\n else\n response = estimated_wait\n end\n\n return response\n end",
"def get_waiting_time_str\n get_time_diff_string(self.requested_at, self.started_at)\n end",
"def remaining_time()\n return @total_time_units - @done_time_units\n end",
"def wait_time(attempts)\n 2 ** (attempts.to_i + 2)\n end",
"def take_time\n if self.completed?\n (complete_on - started_on) if complete_on && started_on\n end\n end",
"def time_elapsed\n if !self.finished.blank?\n ((self.finished - self.started) / 60).to_i\n end\n end",
"def get_time_remaining\n\n end",
"def wait_time\n if rate_limit_remaining < 50\n [rate_limit_reset - Time.zone.now, 0.001].sort.last\n else\n 3600.0 / rate_limiting\n end\n end",
"def get_elapse_time\n @start_time ||= @time_now\n return @time_now - @start_time\n end",
"def cpu_time\n @cpu_time_finish - @cpu_time_start\n end",
"def run_time\n ((Time.now - start_time) * 1000).round\n end",
"def time_remaining\n end",
"def execution_time\n @process.instance_variable_get(:@execution_time).total\n end",
"def time_remaining\n\n end",
"def calculate_sleep\n if @timeouts.empty?\n @sleep_for = DefaultSleepFor\n else\n diff = @timeouts.first.value.timeout_at.to_f - Time.now.to_f\n\n if diff < 0.0\n @sleep_for = 0\n else\n @sleep_for = diff\n end\n end\n end",
"def running_time\n a = started_at or return nil\n b = done_at or return nil\n (b - a).to_f * 24 * 60\n end",
"def max_wait_time\n @data[\"max_wait_time\"]\n end",
"def execution_time\n @execution_time ||= order.attribute_ids_with_qauntity.map do |data|\n att = photographer_attributes.find_by(attribute_item_id: data.first)\n att.default_time + data.last.modulo(att.attribute_item.base_quantity) * att.extra_time\n end.sum\n end",
"def duration # (in seconds)\n if self.end_time and self.start_time \n return (self.end_time - self.start_time).to_i\n end\n walk_time.to_i +\n transit_time.to_i +\n wait_time.to_i\n end",
"def num_waiting\n @num_waiting\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000000\n end",
"def calculate_duration_of(task) ; 5 ; end",
"def process_duration\n return 0.0 unless process_ended_at && process_started_at\n\n (process_ended_at - process_started_at).ceil(3)\n end",
"def duration\n ran? ? (completed_at || failed_at) - started_at : 0\n end",
"def progress()\n return 1.0 * @done_time_units / @total_time_units\n end",
"def time_spent_attempting_state(state, options)\n states = retries_for_state(state, options)\n if states.empty?\n 0\n else\n Time.now.to_f - states.last[:transitioned_at].to_f\n end.to_f\n end",
"def time_remaining\n return 0 if finished_at\n backup_source_jobs.map(&:time_remaining).sum\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000\n end",
"def num_waiting\n @num_waiting.value\n end",
"def fetchSimulationTime()\n com = Sumo::Traci::Command_GetVariable.new(:sim, :timeStep, \"\") ;\n execCommands(com) ;\n time = com.responseValue() ;\n return time ;\n end",
"def timeout_frozen_tests_secs\n @game_info['timeout_frozen_tests_secs']\n end",
"def time_elapsed\n\t\treturn Time.now - self.start_time\n\tend",
"def cycle_time\n if completed_at && started_at\n completed_at - started_at\n else\n 0.0\n end\n end",
"def requests_per_second\n requests / horizon_time\n end",
"def time_spent\n return nil if self.finished_at.nil?\n# if self.completed?\n self.finished_at - self.started_at\n# else\n# Time.now - self.started_at\n# end\n end",
"def time_elapsed\n Time.now - @start_time\n end",
"def getCompleted\n if @dry_run\n nil\n else\n JSON.parse(@client[\"/LoadTest?loadTestId=#{@test_id}\"].get)[0].to_h['completed_time']\n end\n end",
"def elapsed_time\n return nil if !started_at.present? || aborted_at.present?\n\n (finished_at.present? ? finished_at : Time.now) - started_at\n end",
"def get_duration()\n puts \"The task will take #{(@date_end - @date_start).to_i} days\"\n end",
"def up_time\n (Process.clock_gettime(Process::CLOCK_MONOTONIC) - (@start[:time] || Time.now)).round(3)\n end",
"def get_completion_time()\n return process_stamp(@end_time)\n end",
"def duration\n finished? ? finished_at.to_f - started_at.to_f : -1\n end",
"def ev_do_calculate_rw_wait(wait); end",
"def elapsed\n (Time.now - @start_time).round\n end",
"def duration_of_stay\n duration_of_stay = (@check_out - @check_in).to_i\n return duration_of_stay\n end",
"def get_run_time(ant)\n end",
"def estimated_reading_time\n estimate = content.split(/\\s+/).length / AVERAGE_WPM\n \"#{estimate >= 1 ? estimate : '< 1'} min read\"\n end",
"def average_wait_time\n self.reviews.average(:wait_time).to_i\n end",
"def get_time_required\n 1.0\n end",
"def run_time\n return nil unless self.start_time\n (self.end_time || Time.now) - self.start_time\n end",
"def time_left\n return 0.0 if free?\n return end_time - Time.now.to_f\n end",
"def calculate_elapsed_time(result)\n Time.parse(result.finish_time).to_i - Time.parse(result.start_time).to_i\n end",
"def get_total_runtime_ms\n (TimeDifference.between(*get_runtime_timestamps).in_seconds * 1000).to_i\n end",
"def elapsed_time\n if end_time && start_time\n return ((end_time - start_time)/60).round\n else\n return 0\n end\n end",
"def run_time_or_time_elapsed\n if self.end_time \n return Time.at(self.end_time - self.start_time)\n else\n return Time.at(Time.now - self.start_time)\n end\n end",
"def total_time; end",
"def get_net_duration()\n durations = @test_cases.collect{ |c| \n c.get_net_duration()\n }\n return durations.reduce(:+)\n end",
"def find_time_asleep\n @total_time_asleep = 0\n @wake_times.each_with_index do |wake_time, index|\n @total_time_asleep += ( wake_time - @sleep_times[index] )\n end\n end",
"def num_waiting\n @waiting\n end",
"def time_to_finish\n past_time = Time.now - self[:start_time]\n seconds_to_go = past_time * self[:max] / self[:current] - past_time\n puts \"time to go: #{seconds_to_go.round}s\"\n end",
"def get_total_runtime\n TimeDifference.between(*get_runtime_timestamps).humanize\n end",
"def waitTime()\n time = Time.now().to_i / 60\n\n # Cleanup once every ten minutes\n if (@lastFloodBucketReap != time && time % 10 == 0)\n @floodControl.delete_if{|key, val| key <= (time - 5) }\n @lastFloodBucketReap = time\n end\n\n @floodControl[time] += 1\n\n count = 0\n for i in 0...5\n count += (@floodControl[time - i] * (5 - i))\n end\n\n return 0.1 + (count * 0.0393)\n end",
"def duration\n start = start_time.to_i\n end_with_delay = end_time.to_i + (@parts.last.target_delay * 1.minutes)\n\n end_with_delay - start\n end",
"def get_timeout\n if @valgrind\n return timeout_seconds * TestBase::VALGRIND_TIMEOUT_MULTIPLIER\n elsif has_active_sanitizers\n return timeout_seconds * TestBase::SANITIZERS_TIMEOUT_MULTIPLIER\n else\n return timeout_seconds\n end\n end",
"def time_diff_milli(start, finish)\n (finish - start) * 1000.0\n end",
"def get_duration\n ((finish - start) / 60 / 60) - (break_length / 60)\n end",
"def children_time\n self.total_time - self.self_time - self.wait_time\n end",
"def idle_time\n diff = duration - cpu_time\n diff > 0.0 ? diff : 0.0\n end",
"def elapsed_time\n if @start_time && @end_time\n @end_time - @start_time\n else\n nil\n end\n end",
"def num_waiting\n end",
"def num_waiting\n end",
"def get_waiting\n raise NotImplementedError\n end",
"def ready_in_time\n return self.preparation_time + self.cooking_time\n end",
"def report_time_elapsed\n self.test_session.time_elapsed\n end",
"def wait_interval\n timer = @timers.first\n return 0 unless timer\n\n delay = timer.fire_time - Timers.now\n delay < 0 ? -1 : delay\n end",
"def time\n building_time + execution_time\n end",
"def tsbs_wait_dur\n return TSBS::TSBS_END_SEQUENCE_WAIT\n end",
"def when_to_run\n time - @@REMINDER_TIME\n end",
"def process_duration\n t1 = Process.times.utime\n Process.times.utime - t1\nend",
"def wait_time_span\n return @retry_period unless @use_backoff\n time_span = [ 2 ** @iteration * @retry_period, @max_retry_period ].min\n @iteration += 1\n time_span\n end",
"def duration\n\t\tt =(Time.now- @start)\n\t\treturn t\n\tend",
"def seconds_remaining\n ends_at ? (ends_at - started_at).round : 0\n end",
"def delay_time\n return (self.aggressive == false ? 0 : (15 - self.aggressive) * 3)\n end",
"def task_duration\n\n if self.complete?\n sprintf(\"%4.1f\", (self.completed_on - self.created_on) / 1.day)\n else\n '0'\n end\n\n end",
"def duration\n return unless finished_at\n\n elapsed_time(started_at, finished_at)\n end",
"def time_diff_milli( start, finish )\n\n\t( finish - start )\n\nend",
"def time\n end_time - start_time\n end",
"def waiting_size\n @waiting.size\n end",
"def get_time_required\n 0 # number of minutes\n end",
"def finish_time\n prop = finish_property\n prop ? prop.to_finish_time : nil\n end",
"def execution_duration\n duration = nil\n unless self.stopped_at.nil?\n duration_seconds = self.stopped_at - self.started_at\n dhc = duration_seconds / 3600 # hours component\n dhc_mod = duration_seconds % 3600\n dhm = dhc_mod / 60 # minutes component\n dhs = dhc_mod % 60 # seconds component\n\n duration = format('%02d:%02d:%02d', dhc, dhm, dhs)\n end\n\n duration\n end",
"def estimatedEndServerTime \n \"estimatedEndServerTime\" \n end",
"def tests_poll_secs\n @game_info['tests_poll_secs']\n end",
"def fast_duration\n 0.5\n end",
"def duration\n (finish - start)/3600\n end",
"def time_duration\n t1 = Time.now.to_f\n Time.now.to_f - t1\nend"
] | [
"0.81487745",
"0.71049595",
"0.7069294",
"0.7051209",
"0.70391375",
"0.7016588",
"0.6935786",
"0.68869776",
"0.68720704",
"0.68671584",
"0.68660015",
"0.68559414",
"0.67899704",
"0.6750042",
"0.6745653",
"0.6744974",
"0.67171395",
"0.6707889",
"0.66387314",
"0.65927136",
"0.6584501",
"0.65639377",
"0.6541751",
"0.6527897",
"0.6485767",
"0.64811367",
"0.64743435",
"0.6457498",
"0.64360267",
"0.6403506",
"0.63949615",
"0.6384333",
"0.6363913",
"0.63509566",
"0.6333814",
"0.6330099",
"0.63240534",
"0.6319703",
"0.63067096",
"0.63059175",
"0.62996656",
"0.62969697",
"0.6292555",
"0.62923414",
"0.6281868",
"0.62813437",
"0.6273598",
"0.6271734",
"0.6269551",
"0.62606657",
"0.62602085",
"0.62530637",
"0.6252272",
"0.625003",
"0.6247353",
"0.62448967",
"0.6235722",
"0.6221871",
"0.6216456",
"0.6211822",
"0.62081367",
"0.6204912",
"0.62038803",
"0.62016505",
"0.6197879",
"0.61623937",
"0.6159876",
"0.6159763",
"0.61507106",
"0.61393076",
"0.6123354",
"0.6122507",
"0.6118367",
"0.61159533",
"0.60963184",
"0.60963184",
"0.6087143",
"0.6074449",
"0.6074003",
"0.60694593",
"0.60665715",
"0.6062143",
"0.6061984",
"0.6055809",
"0.60526",
"0.604899",
"0.6044143",
"0.60420203",
"0.60352045",
"0.6034387",
"0.60213983",
"0.6009635",
"0.60062194",
"0.60031325",
"0.60009146",
"0.59952855",
"0.5988522",
"0.59884566",
"0.59835",
"0.59819335",
"0.59802365"
] | 0.0 | -1 |
Get the members of this queue | def get_routing_queue_users(queue_id, opts = {})
data, _status_code, _headers = get_routing_queue_users_with_http_info(queue_id, opts)
return data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def members\n return @members\n end",
"def members\n return @members\n end",
"def members\n return @members\n end",
"def members\n return @members\n end",
"def members\n @members\n end",
"def members\n @members\n end",
"def members\n fetch if @members.nil? || @members[0].nil?\n @members\n end",
"def members\n @model.getMemberGroups.collect { |p| p } + @model.getMembers.collect { |p| p }\n end",
"def members\n\t\t\t@hash.keys\n\t\tend",
"def retrieve_members\n @root_member = nil\n @members = []\n shared = []\n @member_lookup = {}\n log.finer \"Retrieving members of dimension '#{@name}'\"\n alias_tbls = try{ @cube.get_alias_table_names.to_a }\n mbr_sel = try{ @cube.open_member_selection(\"MemberQuery\") }\n begin\n spec = %Q{@IDESCENDANTS(\"#{self.name}\")}\n query = <<-EOQ.strip\n <OutputType Binary\n <SelectMbrInfo(MemberName, MemberAliasName, ParentMemberName,\n MemberGeneration, MemberLevel, Consolidation,\n ShareOption, MemberFormula, UDAList)\n EOQ\n @cube.instrument 'retrieve_members', dimension: self do\n try{ mbr_sel.execute_query(query, spec) }\n end\n mbr_sel.get_members.get_all.each do |ess_mbr|\n mbr = Member.new(self, ess_mbr, alias_tbls)\n @members << mbr\n if mbr.shared?\n shared << mbr\n else\n @member_lookup[mbr.name.upcase] = mbr\n end\n end\n # Link shared members to non-shared member (and vice versa)\n shared.each do |smbr|\n mbr = @member_lookup[smbr.name.upcase]\n smbr.instance_variable_set(:@non_shared_member, mbr)\n mbr.instance_variable_get(:@shared_members) << smbr\n end\n @root_member = @member_lookup[self.name.upcase]\n # Convert parent names to references to the parent Member object\n # This can only be done after we've seen all members, since the\n # member selection query returns parents after children\n @members.each do |mbr|\n par = @member_lookup[mbr.parent.upcase]\n mbr.instance_variable_set(:@parent, par)\n par.instance_variable_get(:@children) << mbr if par\n end\n ensure\n try{ mbr_sel.close }\n end\n log.finer \"Retrieved #{@members.size} members\"\n end",
"def members\n \n return @gemset.members\n \n end",
"def members\n self.u_members + self.g_members\n end",
"def members\n _members = []\n time = Benchmark.measure do\n _members = Rails.cache.fetch(\"group/#{id}/members/#{updated_at.to_f}\") do\n Person.where(id: (memberships.pluck(:entity_id) + rule_member_ids).uniq)\n end\n end\n\n Rails.logger.warn \"Group.members for group with ID #{id} took #{time.real}\" if time.real > 0.50\n\n return _members\n end",
"def members\n participants\n end",
"def members\n participants\n end",
"def members\n subscribers.split\n end",
"def members\n self.class.members\n end",
"def members\n @spec['members']\n end",
"def messages\n @queue.messages.select { |m| m.claim == self }\n end",
"def members\n return @members if @members\n @members = Client.get(\"/organizations/#{id}/members/all\").json_into(Member)\n end",
"def messages\n @zk.children(full_queue_path)\n end",
"def members\n @teams.map { |_, t|\n t.members\n }.flatten\n end",
"def members\n @source.get_elements('//Member').map { |item| Member.new(item) }\n end",
"def members\n\t\t@cpg_members\n\tend",
"def members\n users\n end",
"def members\n users\n end",
"def getMembersList()\n\t\tbegin\n\t \t@members=[];\n\t \tuserMembers = TwitterClient.list_members(@selectedList)\n\t \tuserMembers.each do |memberInList|\n\t \t\t@members << memberInList.id\n\t \tend\n\t \t@members\n\t rescue\n\t \t-1\n\t end\n\tend",
"def get_members()\n # TODO remove hardcap limit\n res = Array.new\n results = Note_User.all(:note_id => self.id, :order => [id.desc], :offset => 0, :limit => 10)\n results.each do |result|\n user = User.first(:id => result.user_id)\n res << user if user\n end\n return res\n end",
"def members\n @members ||= population_group_members.collect(&:members).flatten.uniq\n end",
"def members\n response = service.get_members\n response.map do |member_data|\n Member.new(member_data)\n end\n end",
"def scoped_members\n return @scoped_members\n end",
"def members\n @internal_hash.keys\n end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def available_members()\n # added some logic in here to check whether the class is peak, and only supply a list\n # of premium members. Also want to check to see if there are available spaces for the\n # class, if not - return an empty array.\n if @spaces > 0\n if is_peak()\n sql = \"SELECT * from members WHERE id NOT IN (SELECT member_id FROM bookings WHERE gymclass_id = $1) AND premium = TRUE;\"\n else\n sql = \"SELECT * from members WHERE id NOT IN (SELECT member_id FROM bookings WHERE gymclass_id = $1);\"\n end\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map {|member| Member.new(member)}\n else\n return []\n end\n end",
"def members\n @members ||= relation_members.map do |member|\n [member.member_type, member.member_id, member.member_role]\n end\n end",
"def users\n GroupMembers.new(:id => id).get.items\n end",
"def battle_members\n @positions[0, max_battle_members].collect {|id| id && $game_actors[id] }.compact\n end",
"def list_members\n HTTP.headers(:accept => @@accept, \"content-type\" => @@content_type).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/members\").parse[\"members\"]\n end",
"def get_guild_members(guild_id)\n @member_cache.select { |key| key[0] == guild_id }.values\n end",
"def get_member_list\n members = []\n events.each do |event|\n event.attendees.each do |attendee|\n members.push(attendee) unless members.include?(attendee)\n end\n end\n members\n end",
"def getMembersAsArray() \n ret = []\n it = self.getIterator() \n while(it.hasMoreResources())\n ret << it.nextResource().getContentAsREXML()\n end\n \n return ret\n end",
"def members\n return nil unless MEMBERS_EVENT.include?(type)\n @members ||= begin\n payload.each_line.map do |line|\n name, address, _, tags_str = line.chomp.split(/\\t/)\n {name: name, address: address, tags: parse_tags(tags_str || '')}\n end\n end\n end",
"def members\n resp = MU::Cloud::Google.admin_directory(credentials: @credentials).list_members(@cloud_id)\n members = []\n if resp and resp.members\n members = resp.members.map { |m| m.email }\n# XXX reject status != \"ACTIVE\" ?\n end\n members\n end",
"def members(*) end",
"def all_members\n @all_members ||= begin\n members = work.members.includes(:leaf_representative)\n\n unless can_see_unpublished_records?\n members = members.where(published: true)\n end\n\n members = members.strict_loading # prevent accidental n+1 lazy-loading.\n members.order(:position).to_a\n end\n end",
"def allowed_members\n return @allowed_members\n end",
"def members\n \n return @gems_or_gemsets.keys\n \n end",
"def smembers(key)\n if queues?(key)\n servers.inject([]) { |a, s| a + s.smembers(key) }.uniq\n else\n server_for(key).smembers(key)\n end\n end",
"def members\n return @members unless @members .nil?\n\n members = []\n seat_incumbencies.each do |seat_incumbency|\n members << seat_incumbency.member\n end\n\n @members = members.flatten.uniq\n end",
"def members\n return @members unless @members.nil?\n\n members = []\n seat_incumbencies.each do |seat_incumbency|\n members << seat_incumbency.member\n end\n\n @members = members.flatten.uniq\n end",
"def members(options = { :filter => :all })\n return @members if @members\n @members = Client.get(\"/boards/#{id}/members\", options).json_into(Member)\n end",
"def members\n\t\t(self.users.to_a + self.admins.to_a).uniq\n\tend",
"def queues\n subject.queues\n end",
"def all_members\n @strands.map { |s| s.members }.flatten\n end",
"def all_members(**params)\n client.api.get_room_members(id, **params)[:chunk].map { |ch| client.get_user(ch[:state_key]) }\n end",
"def members\n raw_response = get_request('users/members')\n parse_response(raw_response, :users)\n end",
"def get_mailing_members(id)\n get(\"/mailings/#{id}/members\")\n end",
"def members( params={} )\n members = get_connections(\"members\", params)\n return map_connections members, :to => Facebook::Graph::Generic\n end",
"def get_members(dimension, filter_spec = nil, all_gens = true)\n check_attached\n\n @logger.info \"Retrieving list of members for #{dimension}\"\n filter_name, filter_args = process_filter(dimension, filter_spec)\n @req.EnumMembers do |xml|\n xml.sID @session_id\n xml.dim dimension\n xml.memberFilter do |xml|\n xml.filter('name' => filter_name) do |xml|\n insert_filter_args xml, filter_args\n end\n end\n xml.getAtts '0'\n xml.alsTbl @preferences.alias_table\n xml.allGenerations all_gens ? '1' : '0'\n end\n doc = invoke\n members = doc.at('//res_EnumMembers/mbrs').to_plain_text.split('|')\n members\n end",
"def all_members\n members = []\n\n project_members.owner.each { |u| members[u.user_id] = u }\n project_members.manager.each do |u|\n if members[u.user_id].nil?\n members[u.user_id] = u\n else\n members[u.user_id].role_id += ', ' + u.role_id\n end\n end\n\n project_members.member.each do |u|\n if members[u.user_id].nil?\n members[u.user_id] = u\n else\n members[u.user_id].role_id.to_s << ', ' << u.role_id\n end\n end\n\n members.compact\n end",
"def get_members(params)\n pool_name = get_param(params, :pool)\n notify(:msg => \"[#{@name}] Retrieving all members for pool #{pool_name} on load balancer #{@config[:host]}\",\n :tags => [:f5, :trace])\n members = with_f5('LocalLB.PoolMember') do\n # TODO: deal with pool not existing (get_object_status returns nil)\n get_object_status([ pool_name ])[0].collect do |pool_member|\n member = pool_member['member']\n status = pool_member['object_status']\n { :ip => member['address'],\n :port => member['port'],\n :availability => status['availability_status'],\n :enabled => (status['enabled_status'] == 'ENABLED_STATUS_ENABLED'),\n :pool => pool_name }\n end\n end\n members_hash = members.inject({}) { |h, member| h[member[:ip].to_s + ':' + member[:port].to_s] = member; h }\n pool_members = members.map { |member| { 'address' => member[:ip], 'port' => member[:port] } }\n with_f5('LocalLB.PoolMember') do\n get_monitor_association([ pool_name ])[0].each do |monitor_associations|\n address = monitor_associations['member']['ipport']\n member = members_hash[address['address'].to_s + ':' + address['port'].to_s]\n if member\n monitor_rule = monitor_associations['monitor_rule']\n member[:monitor_rule] = { :type => monitor_rule['type'],\n :quorum => monitor_rule['quorum'],\n :templates => monitor_rule['monitor_templates'] }\n end\n end\n end\n\n members\n end",
"def members\n attributes.keys\n end",
"def member_collections\n collections\n end",
"def view_members()\n a = []\n GroupMember.all.each {|r|\n if r.group_id == @group.id\n a.push(r.username)\n end\n }\n puts a\n end",
"def queues\n @channel.queues\n end",
"def items\n return @items\n end",
"def items\n return @items\n end",
"def get(*members)\n keys = members.map { |tag| id_for(tag) }\n elements = @redis.sunion(keys)\n @redis.del(keys)\n \n scopes = members.delete_if {|a| not a.is_a? ActiveRecord::Base}\n\n elements += get_scope(*scopes)\n elements.flatten.uniq.compact\n end",
"def member_object_ids\n return [] unless id\n member_objects.map(&:id)\n end",
"def members()\n return MicrosoftGraph::Me::JoinedTeams::Item::Members::MembersRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def get_member_objects()\n return MicrosoftGraph::Contacts::Item::GetMemberObjects::GetMemberObjectsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def get_memberids ()\n member_ids = {};\n active_members_sql = Hathiquery.get_active_members;\n @log.d(active_members_sql);\n @conn.query(active_members_sql) do |row|\n member_ids[row[:member_id]] = true;\n end\n\n @log.d(\"Seeing #{member_ids.length} active members.\\n\" + member_ids.keys.sort.join(\"\\n\"));\n\n return member_ids;\nend",
"def users\n return [member_1, member_2];\n end",
"def queued_messages\r\n @buffer.slice(@pointer, @buffer.length - @pointer)\r\n end",
"def member_ids\n self.class.player_ids_for([id])\n end",
"def show\n @mc_members = @mc_batch.mc_members\n end",
"def get_members()\n @client.make_request(:get, @client.concat_user_path(\"#{CONFERENCE_PATH}/#{id}/members\"))[0].map do |i|\n member = ConferenceMember.new(i, @client)\n member.conference_id = id\n member\n end\n end",
"def member_of\n @member_of ||= Rails.cache.fetch(\"#{uid}/memberof\") do\n memberof = []\n all = LdapGroup.all_cached\n\n all.each do |g|\n if g.is_member?(self) then\n memberof << g\n end\n end\n memberof\n end\n end",
"def just_members\n members - [owner]\n end",
"def queued_jids\n queued.entries\n end",
"def queued_messages\n @buffer.slice(@pointer, @buffer.length - @pointer)\n end",
"def group_members\n Notification.where(group_owner_id: id)\n end",
"def messages\n Enumerator.new do |y|\n loop do\n y << @redis.blpop(@name).last\n end\n end\n end",
"def group_members\n members(\"Group\")\n end",
"def workers\n @queues.keys\n end",
"def members()\n sql = \"SELECT members.* FROM members INNER JOIN bookings ON bookings.member_id = members.id WHERE bookings.gymclass_id = $1;\"\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map {|member| Member.new(member)}\n end",
"def entries\n MicroQ.redis do |r|\n r.lrange(QUEUES[:entries], 0, -1)\n end.collect(&MicroQ::Util.json_parse)\n end",
"def show_members\n @members.each do |member, amt|\n puts member\n end\n @members\n end",
"def subqueues\n JSON.parse(@client.call('queue.subqueues', @name))\n end",
"def members()\n sql = \"SELECT members.* FROM members INNER JOIN bookings ON bookings.member_id = members.id INNER JOIN gym_classes ON bookings.gym_class_id = gym_classes.id WHERE gym_classes.id = $1\"\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map { |member| Member.new(member)}\n end",
"def entries\n @redis.keys('*')\n end",
"def to_ary\n load_members\n @members\n end",
"def list_members(prefix = nil, options={})\n raise NotImplementedError\n end",
"def [](idx)\n load_members\n @members[idx]\n end",
"def users\n if text?\n server.online_members(include_idle: true).select { |u| u.can_read_messages? self }\n elsif voice?\n server.voice_states.map { |id, voice_state| server.member(id) if !voice_state.voice_channel.nil? && voice_state.voice_channel.id == @id }.compact\n end\n end"
] | [
"0.76058334",
"0.76058334",
"0.76058334",
"0.76058334",
"0.70418316",
"0.70418316",
"0.68412703",
"0.6680668",
"0.6662234",
"0.65510917",
"0.65439665",
"0.6524629",
"0.65193725",
"0.64570415",
"0.64570415",
"0.64328146",
"0.6432404",
"0.63932735",
"0.6340072",
"0.63375974",
"0.63269275",
"0.6280732",
"0.62689406",
"0.6267405",
"0.624187",
"0.624187",
"0.6221608",
"0.62166935",
"0.62038517",
"0.6192584",
"0.6135353",
"0.6104506",
"0.61026865",
"0.61026865",
"0.61026865",
"0.61026865",
"0.61026865",
"0.61026865",
"0.61026865",
"0.6071412",
"0.60529613",
"0.6025682",
"0.6015223",
"0.60092473",
"0.59743136",
"0.59734595",
"0.59450275",
"0.59054697",
"0.59019107",
"0.5896764",
"0.588818",
"0.587631",
"0.5863821",
"0.5847314",
"0.58447",
"0.581353",
"0.5812574",
"0.57969266",
"0.5793177",
"0.5789358",
"0.57785153",
"0.57729983",
"0.57727957",
"0.5724635",
"0.57147104",
"0.56960845",
"0.569543",
"0.56826097",
"0.5643958",
"0.5642903",
"0.56375086",
"0.56266695",
"0.56266695",
"0.5624442",
"0.56234664",
"0.5620537",
"0.56176853",
"0.5606822",
"0.559055",
"0.5590324",
"0.55856645",
"0.55798715",
"0.5579473",
"0.5577429",
"0.55728054",
"0.5571233",
"0.55614525",
"0.55565363",
"0.5549864",
"0.55421466",
"0.55335456",
"0.55097806",
"0.550887",
"0.5502241",
"0.54997814",
"0.5498207",
"0.5492454",
"0.54920596",
"0.54864013",
"0.54821616",
"0.5474933"
] | 0.0 | -1 |
Get the members of this queue | def get_routing_queue_users_with_http_info(queue_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: RoutingApi.get_routing_queue_users ..."
end
# verify the required parameter 'queue_id' is set
fail ArgumentError, "Missing the required parameter 'queue_id' when calling RoutingApi.get_routing_queue_users" if queue_id.nil?
# resource path
local_var_path = "/api/v2/routing/queues/{queueId}/users".sub('{format}','json').sub('{' + 'queueId' + '}', queue_id.to_s)
# query parameters
query_params = {}
query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']
query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']
query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']
query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand']
query_params[:'joined'] = opts[:'joined'] if opts[:'joined']
query_params[:'name'] = opts[:'name'] if opts[:'name']
query_params[:'profileSkills'] = @api_client.build_collection_param(opts[:'profile_skills'], :multi) if opts[:'profile_skills']
query_params[:'skills'] = @api_client.build_collection_param(opts[:'skills'], :multi) if opts[:'skills']
query_params[:'languages'] = @api_client.build_collection_param(opts[:'languages'], :multi) if opts[:'languages']
query_params[:'routingStatus'] = @api_client.build_collection_param(opts[:'routing_status'], :multi) if opts[:'routing_status']
query_params[:'presence'] = @api_client.build_collection_param(opts[:'presence'], :multi) if opts[:'presence']
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
form_params = {}
# http body (model)
post_body = nil
auth_names = ['PureCloud OAuth']
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => 'QueueMemberEntityListing')
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RoutingApi#get_routing_queue_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def members\n return @members\n end",
"def members\n return @members\n end",
"def members\n return @members\n end",
"def members\n return @members\n end",
"def members\n @members\n end",
"def members\n @members\n end",
"def members\n fetch if @members.nil? || @members[0].nil?\n @members\n end",
"def members\n @model.getMemberGroups.collect { |p| p } + @model.getMembers.collect { |p| p }\n end",
"def members\n\t\t\t@hash.keys\n\t\tend",
"def retrieve_members\n @root_member = nil\n @members = []\n shared = []\n @member_lookup = {}\n log.finer \"Retrieving members of dimension '#{@name}'\"\n alias_tbls = try{ @cube.get_alias_table_names.to_a }\n mbr_sel = try{ @cube.open_member_selection(\"MemberQuery\") }\n begin\n spec = %Q{@IDESCENDANTS(\"#{self.name}\")}\n query = <<-EOQ.strip\n <OutputType Binary\n <SelectMbrInfo(MemberName, MemberAliasName, ParentMemberName,\n MemberGeneration, MemberLevel, Consolidation,\n ShareOption, MemberFormula, UDAList)\n EOQ\n @cube.instrument 'retrieve_members', dimension: self do\n try{ mbr_sel.execute_query(query, spec) }\n end\n mbr_sel.get_members.get_all.each do |ess_mbr|\n mbr = Member.new(self, ess_mbr, alias_tbls)\n @members << mbr\n if mbr.shared?\n shared << mbr\n else\n @member_lookup[mbr.name.upcase] = mbr\n end\n end\n # Link shared members to non-shared member (and vice versa)\n shared.each do |smbr|\n mbr = @member_lookup[smbr.name.upcase]\n smbr.instance_variable_set(:@non_shared_member, mbr)\n mbr.instance_variable_get(:@shared_members) << smbr\n end\n @root_member = @member_lookup[self.name.upcase]\n # Convert parent names to references to the parent Member object\n # This can only be done after we've seen all members, since the\n # member selection query returns parents after children\n @members.each do |mbr|\n par = @member_lookup[mbr.parent.upcase]\n mbr.instance_variable_set(:@parent, par)\n par.instance_variable_get(:@children) << mbr if par\n end\n ensure\n try{ mbr_sel.close }\n end\n log.finer \"Retrieved #{@members.size} members\"\n end",
"def members\n \n return @gemset.members\n \n end",
"def members\n self.u_members + self.g_members\n end",
"def members\n _members = []\n time = Benchmark.measure do\n _members = Rails.cache.fetch(\"group/#{id}/members/#{updated_at.to_f}\") do\n Person.where(id: (memberships.pluck(:entity_id) + rule_member_ids).uniq)\n end\n end\n\n Rails.logger.warn \"Group.members for group with ID #{id} took #{time.real}\" if time.real > 0.50\n\n return _members\n end",
"def members\n participants\n end",
"def members\n participants\n end",
"def members\n subscribers.split\n end",
"def members\n self.class.members\n end",
"def members\n @spec['members']\n end",
"def messages\n @queue.messages.select { |m| m.claim == self }\n end",
"def members\n return @members if @members\n @members = Client.get(\"/organizations/#{id}/members/all\").json_into(Member)\n end",
"def messages\n @zk.children(full_queue_path)\n end",
"def members\n @teams.map { |_, t|\n t.members\n }.flatten\n end",
"def members\n @source.get_elements('//Member').map { |item| Member.new(item) }\n end",
"def members\n\t\t@cpg_members\n\tend",
"def members\n users\n end",
"def members\n users\n end",
"def getMembersList()\n\t\tbegin\n\t \t@members=[];\n\t \tuserMembers = TwitterClient.list_members(@selectedList)\n\t \tuserMembers.each do |memberInList|\n\t \t\t@members << memberInList.id\n\t \tend\n\t \t@members\n\t rescue\n\t \t-1\n\t end\n\tend",
"def get_members()\n # TODO remove hardcap limit\n res = Array.new\n results = Note_User.all(:note_id => self.id, :order => [id.desc], :offset => 0, :limit => 10)\n results.each do |result|\n user = User.first(:id => result.user_id)\n res << user if user\n end\n return res\n end",
"def members\n @members ||= population_group_members.collect(&:members).flatten.uniq\n end",
"def members\n response = service.get_members\n response.map do |member_data|\n Member.new(member_data)\n end\n end",
"def scoped_members\n return @scoped_members\n end",
"def members\n @internal_hash.keys\n end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def available_members()\n # added some logic in here to check whether the class is peak, and only supply a list\n # of premium members. Also want to check to see if there are available spaces for the\n # class, if not - return an empty array.\n if @spaces > 0\n if is_peak()\n sql = \"SELECT * from members WHERE id NOT IN (SELECT member_id FROM bookings WHERE gymclass_id = $1) AND premium = TRUE;\"\n else\n sql = \"SELECT * from members WHERE id NOT IN (SELECT member_id FROM bookings WHERE gymclass_id = $1);\"\n end\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map {|member| Member.new(member)}\n else\n return []\n end\n end",
"def members\n @members ||= relation_members.map do |member|\n [member.member_type, member.member_id, member.member_role]\n end\n end",
"def users\n GroupMembers.new(:id => id).get.items\n end",
"def battle_members\n @positions[0, max_battle_members].collect {|id| id && $game_actors[id] }.compact\n end",
"def list_members\n HTTP.headers(:accept => @@accept, \"content-type\" => @@content_type).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/members\").parse[\"members\"]\n end",
"def get_guild_members(guild_id)\n @member_cache.select { |key| key[0] == guild_id }.values\n end",
"def get_member_list\n members = []\n events.each do |event|\n event.attendees.each do |attendee|\n members.push(attendee) unless members.include?(attendee)\n end\n end\n members\n end",
"def getMembersAsArray() \n ret = []\n it = self.getIterator() \n while(it.hasMoreResources())\n ret << it.nextResource().getContentAsREXML()\n end\n \n return ret\n end",
"def members\n return nil unless MEMBERS_EVENT.include?(type)\n @members ||= begin\n payload.each_line.map do |line|\n name, address, _, tags_str = line.chomp.split(/\\t/)\n {name: name, address: address, tags: parse_tags(tags_str || '')}\n end\n end\n end",
"def members\n resp = MU::Cloud::Google.admin_directory(credentials: @credentials).list_members(@cloud_id)\n members = []\n if resp and resp.members\n members = resp.members.map { |m| m.email }\n# XXX reject status != \"ACTIVE\" ?\n end\n members\n end",
"def members(*) end",
"def all_members\n @all_members ||= begin\n members = work.members.includes(:leaf_representative)\n\n unless can_see_unpublished_records?\n members = members.where(published: true)\n end\n\n members = members.strict_loading # prevent accidental n+1 lazy-loading.\n members.order(:position).to_a\n end\n end",
"def allowed_members\n return @allowed_members\n end",
"def members\n \n return @gems_or_gemsets.keys\n \n end",
"def smembers(key)\n if queues?(key)\n servers.inject([]) { |a, s| a + s.smembers(key) }.uniq\n else\n server_for(key).smembers(key)\n end\n end",
"def members\n return @members unless @members .nil?\n\n members = []\n seat_incumbencies.each do |seat_incumbency|\n members << seat_incumbency.member\n end\n\n @members = members.flatten.uniq\n end",
"def members\n return @members unless @members.nil?\n\n members = []\n seat_incumbencies.each do |seat_incumbency|\n members << seat_incumbency.member\n end\n\n @members = members.flatten.uniq\n end",
"def members(options = { :filter => :all })\n return @members if @members\n @members = Client.get(\"/boards/#{id}/members\", options).json_into(Member)\n end",
"def members\n\t\t(self.users.to_a + self.admins.to_a).uniq\n\tend",
"def queues\n subject.queues\n end",
"def all_members\n @strands.map { |s| s.members }.flatten\n end",
"def all_members(**params)\n client.api.get_room_members(id, **params)[:chunk].map { |ch| client.get_user(ch[:state_key]) }\n end",
"def members\n raw_response = get_request('users/members')\n parse_response(raw_response, :users)\n end",
"def get_mailing_members(id)\n get(\"/mailings/#{id}/members\")\n end",
"def members( params={} )\n members = get_connections(\"members\", params)\n return map_connections members, :to => Facebook::Graph::Generic\n end",
"def get_members(dimension, filter_spec = nil, all_gens = true)\n check_attached\n\n @logger.info \"Retrieving list of members for #{dimension}\"\n filter_name, filter_args = process_filter(dimension, filter_spec)\n @req.EnumMembers do |xml|\n xml.sID @session_id\n xml.dim dimension\n xml.memberFilter do |xml|\n xml.filter('name' => filter_name) do |xml|\n insert_filter_args xml, filter_args\n end\n end\n xml.getAtts '0'\n xml.alsTbl @preferences.alias_table\n xml.allGenerations all_gens ? '1' : '0'\n end\n doc = invoke\n members = doc.at('//res_EnumMembers/mbrs').to_plain_text.split('|')\n members\n end",
"def all_members\n members = []\n\n project_members.owner.each { |u| members[u.user_id] = u }\n project_members.manager.each do |u|\n if members[u.user_id].nil?\n members[u.user_id] = u\n else\n members[u.user_id].role_id += ', ' + u.role_id\n end\n end\n\n project_members.member.each do |u|\n if members[u.user_id].nil?\n members[u.user_id] = u\n else\n members[u.user_id].role_id.to_s << ', ' << u.role_id\n end\n end\n\n members.compact\n end",
"def get_members(params)\n pool_name = get_param(params, :pool)\n notify(:msg => \"[#{@name}] Retrieving all members for pool #{pool_name} on load balancer #{@config[:host]}\",\n :tags => [:f5, :trace])\n members = with_f5('LocalLB.PoolMember') do\n # TODO: deal with pool not existing (get_object_status returns nil)\n get_object_status([ pool_name ])[0].collect do |pool_member|\n member = pool_member['member']\n status = pool_member['object_status']\n { :ip => member['address'],\n :port => member['port'],\n :availability => status['availability_status'],\n :enabled => (status['enabled_status'] == 'ENABLED_STATUS_ENABLED'),\n :pool => pool_name }\n end\n end\n members_hash = members.inject({}) { |h, member| h[member[:ip].to_s + ':' + member[:port].to_s] = member; h }\n pool_members = members.map { |member| { 'address' => member[:ip], 'port' => member[:port] } }\n with_f5('LocalLB.PoolMember') do\n get_monitor_association([ pool_name ])[0].each do |monitor_associations|\n address = monitor_associations['member']['ipport']\n member = members_hash[address['address'].to_s + ':' + address['port'].to_s]\n if member\n monitor_rule = monitor_associations['monitor_rule']\n member[:monitor_rule] = { :type => monitor_rule['type'],\n :quorum => monitor_rule['quorum'],\n :templates => monitor_rule['monitor_templates'] }\n end\n end\n end\n\n members\n end",
"def members\n attributes.keys\n end",
"def member_collections\n collections\n end",
"def view_members()\n a = []\n GroupMember.all.each {|r|\n if r.group_id == @group.id\n a.push(r.username)\n end\n }\n puts a\n end",
"def queues\n @channel.queues\n end",
"def items\n return @items\n end",
"def items\n return @items\n end",
"def get(*members)\n keys = members.map { |tag| id_for(tag) }\n elements = @redis.sunion(keys)\n @redis.del(keys)\n \n scopes = members.delete_if {|a| not a.is_a? ActiveRecord::Base}\n\n elements += get_scope(*scopes)\n elements.flatten.uniq.compact\n end",
"def member_object_ids\n return [] unless id\n member_objects.map(&:id)\n end",
"def members()\n return MicrosoftGraph::Me::JoinedTeams::Item::Members::MembersRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def get_member_objects()\n return MicrosoftGraph::Contacts::Item::GetMemberObjects::GetMemberObjectsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def get_memberids ()\n member_ids = {};\n active_members_sql = Hathiquery.get_active_members;\n @log.d(active_members_sql);\n @conn.query(active_members_sql) do |row|\n member_ids[row[:member_id]] = true;\n end\n\n @log.d(\"Seeing #{member_ids.length} active members.\\n\" + member_ids.keys.sort.join(\"\\n\"));\n\n return member_ids;\nend",
"def users\n return [member_1, member_2];\n end",
"def queued_messages\r\n @buffer.slice(@pointer, @buffer.length - @pointer)\r\n end",
"def member_ids\n self.class.player_ids_for([id])\n end",
"def show\n @mc_members = @mc_batch.mc_members\n end",
"def get_members()\n @client.make_request(:get, @client.concat_user_path(\"#{CONFERENCE_PATH}/#{id}/members\"))[0].map do |i|\n member = ConferenceMember.new(i, @client)\n member.conference_id = id\n member\n end\n end",
"def member_of\n @member_of ||= Rails.cache.fetch(\"#{uid}/memberof\") do\n memberof = []\n all = LdapGroup.all_cached\n\n all.each do |g|\n if g.is_member?(self) then\n memberof << g\n end\n end\n memberof\n end\n end",
"def just_members\n members - [owner]\n end",
"def queued_jids\n queued.entries\n end",
"def queued_messages\n @buffer.slice(@pointer, @buffer.length - @pointer)\n end",
"def group_members\n Notification.where(group_owner_id: id)\n end",
"def messages\n Enumerator.new do |y|\n loop do\n y << @redis.blpop(@name).last\n end\n end\n end",
"def group_members\n members(\"Group\")\n end",
"def workers\n @queues.keys\n end",
"def members()\n sql = \"SELECT members.* FROM members INNER JOIN bookings ON bookings.member_id = members.id WHERE bookings.gymclass_id = $1;\"\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map {|member| Member.new(member)}\n end",
"def entries\n MicroQ.redis do |r|\n r.lrange(QUEUES[:entries], 0, -1)\n end.collect(&MicroQ::Util.json_parse)\n end",
"def show_members\n @members.each do |member, amt|\n puts member\n end\n @members\n end",
"def subqueues\n JSON.parse(@client.call('queue.subqueues', @name))\n end",
"def members()\n sql = \"SELECT members.* FROM members INNER JOIN bookings ON bookings.member_id = members.id INNER JOIN gym_classes ON bookings.gym_class_id = gym_classes.id WHERE gym_classes.id = $1\"\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map { |member| Member.new(member)}\n end",
"def entries\n @redis.keys('*')\n end",
"def to_ary\n load_members\n @members\n end",
"def list_members(prefix = nil, options={})\n raise NotImplementedError\n end",
"def [](idx)\n load_members\n @members[idx]\n end",
"def users\n if text?\n server.online_members(include_idle: true).select { |u| u.can_read_messages? self }\n elsif voice?\n server.voice_states.map { |id, voice_state| server.member(id) if !voice_state.voice_channel.nil? && voice_state.voice_channel.id == @id }.compact\n end\n end"
] | [
"0.7605825",
"0.7605825",
"0.7605825",
"0.7605825",
"0.70418257",
"0.70418257",
"0.68412596",
"0.66806644",
"0.6662208",
"0.6551057",
"0.65439236",
"0.6524602",
"0.6519345",
"0.6457027",
"0.6457027",
"0.64328",
"0.6432381",
"0.6393252",
"0.63400126",
"0.6337563",
"0.632695",
"0.6280686",
"0.6268942",
"0.6267399",
"0.6241857",
"0.6241857",
"0.6221616",
"0.6216703",
"0.6203817",
"0.6192577",
"0.61353135",
"0.61044526",
"0.6102664",
"0.6102664",
"0.6102664",
"0.6102664",
"0.6102664",
"0.6102664",
"0.6102664",
"0.6071378",
"0.6052943",
"0.602568",
"0.6015202",
"0.6009232",
"0.59742796",
"0.5973458",
"0.5945042",
"0.590544",
"0.59018964",
"0.5896747",
"0.5888149",
"0.5876295",
"0.5863779",
"0.58472925",
"0.58447",
"0.5813533",
"0.5812555",
"0.5796886",
"0.5793135",
"0.57893056",
"0.5778494",
"0.5772965",
"0.577276",
"0.5724642",
"0.5714647",
"0.56960416",
"0.56954306",
"0.56825924",
"0.5643939",
"0.5642931",
"0.5637486",
"0.56266683",
"0.56266683",
"0.5624454",
"0.56234694",
"0.5620516",
"0.56176585",
"0.56067926",
"0.5590535",
"0.55903256",
"0.5585666",
"0.5579844",
"0.5579476",
"0.5577408",
"0.5572785",
"0.55712223",
"0.55614537",
"0.555654",
"0.55498654",
"0.5542153",
"0.5533549",
"0.5509747",
"0.550887",
"0.5502234",
"0.54997706",
"0.5498176",
"0.5492448",
"0.5492037",
"0.54864025",
"0.54821604",
"0.54749113"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.